/*
 * Responsible for: the landing screen's own pieces: the opening (headline, paragraph, mail icon), the numbered step titles,
 * the tabbed container that holds the pictures (its inside is landing-pictures.css), the Demo button and the trust statement
 * under step 2, and the pricing section with its three cards.
 *
 * Must never: put the mail icon anywhere but to the right of the opening paragraph (phone and laptop alike), make a
 * pricing card look pressable (it brightens under the pointer; only its own button is pressable), or let anything on a
 * phone cover text or run off the side.
 */

@layer screens {
  .ia-landing__hero {
    display: grid;
    /* The icon's column has the icon's own width: a column sized by its content would also be stretched by the headline above it. */
    grid-template-columns: minmax(0, 36em) var(--ia-mail-size);
    --ia-mail-size: var(--s-8);
    justify-content: start;
    grid-template-areas:
      "title title"
      "lead mail";
    align-items: center;
    gap: var(--s-4) var(--s-4);
    max-width: 54rem;
    padding-block: var(--s-5) var(--s-6);
  }

  .ia-landing__title {
    grid-area: title;
  }

  .ia-landing__lead {
    grid-area: lead;
    color: var(--muted);
    font-size: var(--t-lg);
  }

  .ia-landing__hero > .ia-landing__mail {
    grid-area: mail;
  }

  /* Under step 2: the Demo button, then the trust statement in bold. */
  .ia-landing__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    margin-block: var(--s-6) var(--s-5);
  }

  /* A numbered step's title: one large numeral beside "Step n" and the title. Both steps use this one look. */
  .ia-landing__step {
    display: flex;
    align-items: center;
    gap: var(--s-3);
  }

  .ia-landing__step-number {
    flex: none;
    min-width: 1ch;
    color: var(--accent);
    font: 600 var(--t-step-number) / 1 var(--serif);
    font-variant-numeric: lining-nums;
  }

  .ia-landing__step-words {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
    min-width: 0;
  }

  .ia-landing__step-label {
    color: var(--muted);
    font: 600 var(--t-sm) / 1.2 var(--sans);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .ia-landing__section {
    padding-block: var(--s-6);
  }

  .ia-landing__heading {
    margin-bottom: var(--s-5);
  }

  .ia-landing__trust {
    max-width: 48rem;
    padding: var(--s-4) var(--s-5);
    border-radius: var(--r-lg);
    background: var(--tint);
    color: var(--ink);
    font-size: var(--t-lg);
    font-weight: 700;
  }

  .ia-landing__pricing {
    scroll-margin-top: calc(var(--ia-head) + var(--s-4));
  }

  .ia-landing__cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-4);
  }

  .ia-landing__card {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    min-width: 0;
    padding: var(--s-5);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    background: var(--panel);
    transition: transform var(--move) var(--ease);
  }

  /* Under the pointer a card gains its accent outline and a deeper shadow, both laid over it as opacity, and lifts. */
  .ia-landing__card::before,
  .ia-landing__card::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--move) var(--ease);
  }

  .ia-landing__card::before {
    z-index: -1;
    box-shadow: var(--shadow-2);
  }

  .ia-landing__card::after {
    border: 1px solid var(--accent);
  }

  @media (hover: hover) {
    .ia-landing__card:hover {
      transform: translateY(calc(-1 * var(--s-1)));
    }

    .ia-landing__card:hover::before,
    .ia-landing__card:hover::after {
      opacity: 1;
    }
  }

  .ia-landing__card-price {
    color: var(--muted);
    font-size: var(--t-sm);
  }

  .ia-landing__amount {
    color: var(--ink);
    font: 500 var(--t-xl) / 1.2 var(--serif);
  }

  .ia-landing__card-about {
    color: var(--ink);
  }

  /* The mail-app icon: a rounded blue tile, a white envelope, a red count at the top right. */
  .ia-landing__mail {
    --size: var(--ia-mail-size, var(--s-8));
    position: relative;
    flex: none;
    width: var(--size);
    height: var(--size);
    font-size: calc(var(--size) * 0.2);
  }

  .ia-landing__mail-tile {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 22.4%;
    background: linear-gradient(to bottom, color-mix(in srgb, var(--pop) 38%, var(--unread)), var(--unread));
    box-shadow: var(--shadow-1);
  }

  .ia-landing__mail-tile svg {
    width: 100%;
    height: 100%;
  }

  .ia-landing__mail-tile path:first-child {
    fill: var(--pop);
  }

  .ia-landing__mail-tile path:last-child {
    fill: none;
    stroke: var(--unread);
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .ia-landing__mail-badge {
    position: absolute;
    top: -0.5em;
    right: -0.6em;
    min-width: 1.8em;
    height: 1.8em;
    padding: 0 0.5em;
    border-radius: var(--r-pill);
    background: var(--badge);
    color: var(--pop);
    font: 700 1em / 1.8em var(--sans);
    text-align: center;
    box-shadow: var(--shadow-1);
  }

  @media (min-width: 640px) {
    .ia-landing__hero {
      --ia-mail-size: calc(var(--s-8) + var(--s-5));
      gap: var(--s-5) var(--s-6);
      padding-block: var(--s-6) var(--s-7);
    }

    .ia-landing__section {
      padding-block: var(--s-7);
    }

    .ia-landing__trust {
      padding: var(--s-5) var(--s-6);
    }
  }

  @media (min-width: 760px) {
    .ia-landing__cards {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: var(--s-5);
    }
  }

  /* "What's in your inbox?" stands above the tabbed container; the container begins just under it. */
  .ia-landing__lede {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    margin-bottom: var(--s-5);
  }

  .ia-landing__lede .ia-landing__heading {
    margin: 0;
  }

  .ia-landing__note {
    color: var(--muted);
  }

  /* One quiet line under the two paid cards: on a laptop it stands under them (the cards' columns), on a phone at the foot. */
  .ia-landing__buy-note {
    color: var(--muted);
    font-size: var(--t-sm);
  }

  @media (min-width: 760px) {
    .ia-landing__buy-note {
      grid-column: 2 / -1;
    }
  }

  .ia-landing__card-link {
    align-self: flex-start;
    margin-top: auto;
  }

  .ia-landing__tour {
    scroll-margin-top: calc(var(--ia-head) + var(--s-4));
  }
}
