/* The landing page: the weekly's bar, a short pitch, the newest challenges as
   library cards, then a bento row: the records most recently set beside an
   account's pitch (or, signed in, your progress), 5 : 3. Each section opens
   under a structural rule, as the library's filter bar does. On a phone
   everything is one column. */
@layer components {
  .home {
    overflow: clip;
  }

  /* The pitch and, beside it on a wide screen, the part turning. */
  .home__intro {
    display: grid;
    align-items: center;
    gap: var(--block-space) calc(var(--inline-space) * 4);
    padding: calc(var(--block-space) * 2) calc(var(--inline-space) * 2.5);
    border-block-end: var(--rule-width) solid var(--color-rule);

    @media (min-width: 60rem) {
      grid-template-columns: minmax(0, 5fr) minmax(0, 3fr);
      padding-block: var(--block-space);
    }
  }

  .home__intro-text {
    display: grid;
    gap: calc(var(--block-space) * 0.5);
  }

  /* Wide screens only: on a phone it would push the challenges down. */
  .home__showcase {
    display: none;
    justify-content: center;

    @media (min-width: 60rem) {
      display: flex;
    }
  }

  .home__spin {
    inline-size: min(100%, 26rem);
    block-size: auto;
  }

  .home__title {
    font-size: var(--text-2xl);
  }

  .home__pitch {
    max-inline-size: 62ch;
    color: var(--color-ink-dim);
  }

  .home__more {
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
  }

  /* Until the first START: the SolidWorks guide (guide.css). */
  .home__guide {
    border-block-end: var(--rule-width) solid var(--color-rule);
  }

  .home__guide-more {
    padding: 0 calc(var(--inline-space) * 2.5) calc(var(--block-space) * 1.5);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
  }

  .home__heading {
    padding: calc(var(--block-space) * 0.75) calc(var(--inline-space) * 2.5);
    border-block-end: var(--rule-width) solid var(--color-rule);
    font-size: var(--label-size);
    font-stretch: var(--stretch-normal);
    line-height: var(--leading);
  }

  .home__records {
    container-type: inline-size;
    padding: calc(var(--block-space) * 0.5) calc(var(--inline-space) * 1);
  }

  /* The board's cell styles, without its place column. */
  .home__records .board__time {
    text-align: end;
  }

  /* The newest eight always fill their rows: two rows of four, four of
     two, or one column on a phone. */
  .home__grid {
    grid-template-columns: 1fr;

    @media (min-width: 36rem) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    @media (min-width: 72rem) {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }

  /* A sheet waiting for its challenge: the card's hairlines and nothing
     else. Not on a phone, where a column has no rows to fill. */
  .home__blank {
    display: none;
    border-inline-end: var(--rule-width) solid var(--color-hairline);
    border-block-end: var(--rule-width) solid var(--color-hairline);

    .label {
      color: var(--color-ink-faint);
    }

    @media (min-width: 36rem) {
      display: flex;
    }

    .library-card__sheet {
      flex-grow: 1;
    }
  }

  .home__bento {
    display: grid;
    grid-template-columns: minmax(0, 1fr);

    @media (min-width: 60rem) {
      grid-template-columns: minmax(0, 5fr) minmax(0, 3fr);
    }
  }

  /* Beside the records on a wide screen, under them on a phone. */
  .home__aside {
    display: flex;
    flex-direction: column;
    border-block-start: var(--rule-width) solid var(--color-rule);

    @media (min-width: 60rem) {
      border-block-start: 0;
      border-inline-start: var(--rule-width) solid var(--color-rule);
    }
  }

  .home__aside-body {
    display: grid;
    align-content: start;
    gap: calc(var(--block-space) * 0.75);
    padding: calc(var(--block-space) * 1.25) calc(var(--inline-space) * 2.5);
  }

  .home__aside-text {
    max-inline-size: 48ch;
    color: var(--color-ink-dim);
    font-size: var(--text-sm);
  }

  .home__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: calc(var(--block-space) * 0.75) calc(var(--inline-space) * 2.5);
    font-size: var(--text-sm);
  }

  .home__count {
    color: var(--color-ink-dim);
    font-size: var(--text-sm);
  }

  .home__count-number {
    color: var(--color-ink);
    font-size: var(--text-2xl);
    font-stretch: var(--stretch-condensed);
    font-variant-numeric: tabular-nums;
    font-weight: var(--weight-heavy);
    line-height: var(--leading-tight);
  }

  .home__next {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--inline-space) calc(var(--inline-space) * 2);
    font-weight: var(--weight-bold);
  }

  .home__next-grade {
    color: var(--color-ink-dim);
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
  }

  .home__empty {
    padding: calc(var(--block-space) * 1.25) calc(var(--inline-space) * 2.5);
    color: var(--color-ink-dim);
    font-size: var(--text-sm);
  }
}
