@layer pages {
  @media (prefers-reduced-motion: no-preference) {
    html:has(.landing) {
      scroll-behavior: smooth;
    }
  }

  .landing {
    overflow-x: clip;
  }

  :where(.landing) :where(ul, ol) {
    padding: 0;
    list-style: none;
  }

  :where(.landing) [id] {
    scroll-margin-block-start: 5rem;
  }

  .lp-visually-hidden {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .lp-eyebrow {
    color: var(--color-accent-text);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
  }

  [data-photo] {
    background: var(--color-surface-2) center / cover no-repeat;
  }

  [data-photo="sea"] { background-image: url("../../img/landing/sea.webp"); }
  [data-photo="colour"] { background-image: url("../../img/landing/colour.webp"); }
  [data-photo="see"] { background-image: url("../../img/landing/see.webp"); }
  [data-photo="cafe"] { background-image: url("../../img/landing/cafe.webp"); }
  [data-photo="cafe-2"] { background-image: url("../../img/landing/cafe-2.webp"); }
  [data-photo="cafe-3"] { background-image: url("../../img/landing/cafe-3.webp"); }
  [data-photo="cafe-4"] { background-image: url("../../img/landing/cafe-4.webp"); }
  [data-photo="cafe-5"] { background-image: url("../../img/landing/cafe-5.webp"); }
  [data-photo="cafe-6"] { background-image: url("../../img/landing/cafe-6.webp"); }
  [data-photo="series"] { background-image: url("../../img/landing/series.webp"); }
  [data-photo="football"] { background-image: url("../../img/landing/football.webp"); }
  [data-photo="cooking"] { background-image: url("../../img/landing/cooking.webp"); }
  [data-photo="travel"] { background-image: url("../../img/landing/travel.webp"); }
  [data-photo="podcasts"] { background-image: url("../../img/landing/podcasts.webp"); }
  [data-photo="cartoons"] { background-image: url("../../img/landing/cartoons.webp"); }
  [data-photo="documentaries"] { background-image: url("../../img/landing/documentaries.webp"); }
  [data-photo="talks"] { background-image: url("../../img/landing/talks.webp"); }
  [data-photo="wall-street"] { background-image: url("../../img/landing/wall-street.webp"); }
  [data-photo="wall-sunset"] { background-image: url("../../img/landing/wall-sunset.webp"); }
  [data-photo="wall-dubai"] { background-image: url("../../img/landing/wall-dubai.webp"); }
  [data-photo="wall-smile"] { background-image: url("../../img/landing/wall-smile.webp"); }
  [data-photo="wall-food"] { background-image: url("../../img/landing/wall-food.webp"); }
  [data-photo="wall-redsea"] { background-image: url("../../img/landing/wall-redsea.webp"); }
  [data-photo="wall-stadium"] { background-image: url("../../img/landing/wall-stadium.webp"); }
  [data-photo="wall-stars"] { background-image: url("../../img/landing/wall-stars.webp"); }

  /* Hero */
  .lp-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: center;
    gap: var(--space-7);
    min-block-size: 100svh;
    max-inline-size: var(--content-max);
    margin-inline: auto;
    padding: var(--space-10) var(--gutter) var(--space-8);

    &::before {
      content: "";
      position: absolute;
      inset: -20% -50% auto;
      z-index: -1;
      block-size: 120%;
      background: radial-gradient(50% 40% at 70% 40%, var(--color-accent-soft), transparent 70%);
      pointer-events: none;
    }

    @media (width < 64rem) {
      grid-template-columns: 1fr;
      padding-block-start: var(--space-9);
    }
  }

  .lp-hero-copy {
    display: grid;
    justify-items: start;
    gap: var(--space-5);
  }

  .lp-hero-title {
    max-inline-size: 14ch;
    font-size: calc(var(--text-4xl) * 1.15);
    line-height: 1.05;
  }

  .lp-hero-text {
    max-inline-size: 34rem;
    color: var(--color-text-muted);
    font-size: var(--text-lg);
  }

  .lp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  .lp-trust {
    color: var(--color-text-subtle);
    font-size: var(--text-sm);
  }

  /* The splash: everything you watch behind, the player in front, mined words flying out. */
  .lp-splash {
    position: relative;
    container-type: inline-size;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding-block: var(--space-6);
  }

  .lp-wall {
    position: absolute;
    inset: -25% -20%;
    z-index: -1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-3);
    opacity: 0.7;
    transform: perspective(1400px) rotateX(18deg) rotateZ(-9deg);
    mask-image: radial-gradient(farthest-side, black 25%, transparent 90%);
    pointer-events: none;

    li {
      position: relative;
      aspect-ratio: 16 / 9;
      overflow: hidden;
      border-radius: var(--radius-md);
      filter: saturate(0.85) brightness(0.8);

      /* A watched-so-far bar, so the tiles read as videos. */
      &::after {
        content: "";
        position: absolute;
        inset-inline: 0;
        inset-block-end: 0;
        block-size: 3px;
        background: linear-gradient(to right, var(--color-accent) var(--watched, 40%), oklch(1 0 0 / 0.25) 0);
      }

      &:nth-child(3n) {
        --watched: 75%;
      }

      &:nth-child(4n + 1) {
        --watched: 15%;
      }
    }
  }

  .lp-device {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: var(--color-surface-1);
    box-shadow: var(--shadow-3), 0 0 0 1px oklch(0 0 0 / 0.4);
  }

  .lp-device-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: var(--space-2) var(--space-3);
    background: var(--color-surface-2);

    > span:not(.lp-device-url) {
      inline-size: 0.6rem;
      block-size: 0.6rem;
      border-radius: var(--radius-full);
      background: var(--color-surface-3);
    }
  }

  .lp-device-url {
    margin-inline-start: var(--space-3);
    padding: 0.15rem var(--space-3);
    border-radius: var(--radius-full);
    background: var(--color-bg);
    color: var(--color-text-subtle);
    font-size: var(--text-xs);
  }

  .lp-scene {
    position: relative;
    container-type: inline-size;
    aspect-ratio: 16 / 9;
    overflow: hidden;

    &::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(to top, oklch(0 0 0 / 0.65), transparent 55%);
    }
  }

  .lp-subtitles {
    position: absolute;
    inset-inline: 0;
    inset-block-end: 7%;
    z-index: var(--z-raised);
    display: grid;
    justify-items: center;
    gap: 0.6cqi;
    padding-inline: 6cqi;
    text-align: center;
  }

  .lp-subtitle-target {
    color: var(--color-text-strong);
    font-size: calc(4.4cqi * var(--script-scale));
    font-weight: var(--weight-medium);
    line-height: 1.6;
    text-shadow: 0 2px 12px oklch(0 0 0 / 0.7);

    mark {
      padding-inline: 0.15em;
      color: inherit;
    }

    .lp-selected {
      background: var(--color-accent);
      color: var(--color-on-accent);
      text-shadow: none;
    }
  }

  .lp-subtitle-native {
    color: oklch(1 0 0 / 0.8);
    font-size: 2.6cqi;
    text-shadow: 0 1px 8px oklch(0 0 0 / 0.8);
  }

  /* Mined words: a fanned stack beside the player, overlapping its edge but never the subtitles. */
  .lp-mined {
    position: relative;
    display: grid;
    margin-inline-start: -2.5rem;

    > li + li {
      margin-block-start: -1.75rem;
    }
  }

  .lp-mini-card {
    display: grid;
    gap: var(--space-1);
    inline-size: 8.5rem;
    padding: var(--space-2) var(--space-2) var(--space-3);
    border: 1px solid var(--color-accent-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-2);
    box-shadow: var(--glow-accent), var(--shadow-3);
    text-align: center;

    &:nth-child(1) {
      z-index: 3;
      rotate: -5deg;
    }

    &:nth-child(2) {
      z-index: 2;
      rotate: 4deg;
      margin-inline-start: 1.5rem;
    }

    &:nth-child(3) {
      z-index: 1;
      rotate: -2deg;
      margin-inline-start: 0.5rem;
    }

    [lang="ar"] {
      color: var(--color-text-strong);
      font-size: calc(var(--text-lg) * var(--script-scale));
      font-weight: var(--weight-semibold);
      line-height: 1.5;
    }

    small {
      color: var(--color-text-muted);
      font-size: var(--text-xs);
    }
  }

  .lp-mini-picture {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-sm);
  }

  /* Phones: the cards sit in a row under the player. */
  @media (width < 40rem) {
    .lp-splash {
      grid-template-columns: 1fr;
    }

    .lp-mined {
      display: flex;
      justify-content: center;
      margin: var(--space-4) 0 0;

      > li + li {
        margin-block-start: 0;
        margin-inline-start: -0.75rem;
      }
    }

    .lp-mini-card {
      inline-size: 6.5rem;
    }
  }

  /* Mining, played once on load: each word lights up, then its card flies out of the player.
     Without motion the page shows the end state. */
  @media (prefers-reduced-motion: no-preference) {
    .lp-splash {
      --fly-x: -38cqi;
      --fly-y: 12cqi;

      mark {
        animation: lp-mark-saved 1.6s var(--ease-out) both;
      }

      .lp-selected {
        animation-name: lp-mark-selected;
      }

      .lp-w1 {
        animation-delay: 3s;
      }

      .lp-w2 {
        animation-delay: 0.8s;
      }

      .lp-w3 {
        animation-delay: 1.9s;
      }
    }

    .lp-mini-card {
      animation: lp-fly-out 1s var(--ease-emphasized) both;

      &:nth-child(1) {
        animation-delay: 3.4s;
      }

      &:nth-child(2) {
        animation-delay: 1.2s;
      }

      &:nth-child(3) {
        animation-delay: 2.3s;
      }
    }

    .lp-wall {
      animation: lp-drift 40s linear infinite alternate;
    }

    @media (width < 40rem) {
      .lp-splash {
        --fly-x: 0;
        --fly-y: -30cqi;
      }
    }
  }

  @keyframes lp-mark-saved {
    0% {
      background-color: transparent;
    }

    20%,
    60% {
      background-color: var(--color-accent);
      color: var(--color-on-accent);
      text-shadow: none;
    }
  }

  @keyframes lp-mark-selected {
    0% {
      background-color: transparent;
      color: var(--color-text-strong);
      text-shadow: 0 2px 12px oklch(0 0 0 / 0.7);
    }

    20%,
    100% {
      background-color: var(--color-accent);
      color: var(--color-on-accent);
      text-shadow: none;
    }
  }

  @keyframes lp-fly-out {
    0% {
      opacity: 0;
      translate: var(--fly-x) var(--fly-y);
      scale: 0.3;
    }

    40% {
      opacity: 1;
    }
  }

  @keyframes lp-drift {
    to {
      translate: -4% -3%;
    }
  }

  /* Sections */
  .lp-section {
    max-inline-size: var(--content-max);
    margin-inline: auto;
    padding: clamp(var(--space-8), 10vw, var(--space-10)) var(--gutter) 0;
  }

  .lp-section-head {
    display: grid;
    gap: var(--space-3);
    max-inline-size: 44rem;
    margin-block-end: var(--space-7);

    h2 {
      font-size: var(--text-3xl);
    }

    p:not(.lp-eyebrow) {
      color: var(--color-text-muted);
      font-size: var(--text-lg);
    }
  }

  .lp-genre-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: clamp(10rem, 18vw, 16rem);
    gap: var(--space-4);
    margin-inline: calc(-1 * var(--gutter));
    padding: var(--space-2) var(--gutter) var(--space-4);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }

  .lp-genre {
    position: relative;
    display: grid;
    align-content: end;
    gap: var(--space-1);
    aspect-ratio: 2 / 3;
    padding: var(--space-4);
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    text-align: center;
    scroll-snap-align: start;

    &::before {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(to top, oklch(0 0 0 / 0.7), transparent 60%);
    }

    > * {
      position: relative;
    }

    [lang="ar"] {
      color: var(--color-text-strong);
      font-size: calc(var(--text-2xl) * var(--script-scale));
      font-weight: var(--weight-semibold);
      line-height: 1.4;
    }

    small {
      color: oklch(1 0 0 / 0.75);
      font-size: var(--text-sm);
    }
  }

  .lp-dialects {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-block-start: var(--space-5);
  }

  .lp-insight {
    display: grid;
    justify-items: center;
    gap: var(--space-5);
    text-align: center;

    p {
      max-inline-size: 40rem;
      color: var(--color-text-muted);
      font-size: var(--text-lg);
    }
  }

  .lp-insight-title {
    max-inline-size: 22ch;
    font-size: var(--text-4xl);

    em {
      color: var(--color-accent-text);
      font-style: normal;
    }
  }

  .lp-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--space-6) var(--space-5);
  }

  .lp-step {
    display: grid;
    align-content: start;
    gap: var(--space-3);
  }

  .lp-step-text {
    display: grid;
    align-content: start;
    gap: var(--space-3);

    h3 {
      display: flex;
      align-items: center;
      gap: var(--space-3);
      font-size: var(--text-xl);
    }

    p {
      color: var(--color-text-muted);
    }
  }

  .lp-step-number {
    display: grid;
    place-items: center;
    inline-size: 1.75rem;
    block-size: 1.75rem;
    border-radius: var(--radius-full);
    background: var(--color-accent-soft);
    color: var(--color-accent-text);
    font-size: var(--text-sm);
  }

  .lp-step-visual {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    margin-block-end: var(--space-2);
    padding: var(--space-4);
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-surface-1);

    > .lp-scene {
      inline-size: 100%;
      border-radius: var(--radius-md);
    }
  }

  .lp-popover {
    display: grid;
    justify-items: start;
    gap: var(--space-1);
    inline-size: 100%;
    padding: var(--space-4);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: var(--color-surface-2);
    box-shadow: var(--shadow-2);

    .reading {
      justify-self: stretch;
      font-size: calc(var(--text-sm) * var(--reading-scale));
    }

    .button {
      margin-block-start: var(--space-2);
      pointer-events: none;
    }
  }

  .lp-popover-word {
    justify-self: stretch;
    color: var(--color-text-strong);
    font-size: calc(var(--text-xl) * var(--script-scale));
    font-weight: var(--weight-semibold);
  }

  .lp-popover-gloss {
    color: var(--color-text-strong);
  }

  .lp-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    inline-size: 100%;

    li {
      display: grid;
      place-items: center;
      aspect-ratio: 4 / 3;
      border-radius: var(--radius-sm);
    }

    [aria-current] {
      outline: 3px solid var(--color-accent);
      outline-offset: 2px;
      color: var(--color-on-accent);

      .icon {
        padding: 0.2rem;
        border-radius: var(--radius-full);
        background: var(--color-accent);
      }
    }
  }

  .lp-flashcard {
    display: grid;
    justify-items: center;
    gap: var(--space-2);
    inline-size: 70%;
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    background: var(--color-surface-3);
    box-shadow: var(--shadow-2);
  }

  .lp-flashcard-picture {
    inline-size: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md);
  }

  .lp-flashcard-word {
    color: var(--color-text-strong);
    font-size: calc(var(--text-xl) * var(--script-scale));
    font-weight: var(--weight-semibold);
  }

  /* Feature spotlights: copy and visual side by side, alternating. */
  .lp-features {
    display: grid;
    gap: var(--space-10);
  }

  .lp-feature {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: var(--space-8);

    &:nth-child(even) .lp-feature-copy {
      order: 2;
    }

    @media (width < 56rem) {
      grid-template-columns: 1fr;
      gap: var(--space-6);

      &:nth-child(even) .lp-feature-copy {
        order: 0;
      }
    }
  }

  .lp-feature-copy {
    display: grid;
    gap: var(--space-4);

    h2 {
      font-size: var(--text-3xl);
    }

    p:not(.lp-eyebrow) {
      max-inline-size: 32rem;
      color: var(--color-text-muted);
      font-size: var(--text-lg);
    }
  }

  .lp-feature-visual {
    display: grid;
    place-items: center;
    min-block-size: 22rem;
    padding: var(--space-6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background:
      radial-gradient(60% 60% at 50% 40%, var(--color-accent-soft), transparent 70%),
      var(--color-surface-1);
  }

  .lp-word-card {
    display: grid;
    gap: var(--space-2);
    inline-size: min(100%, 22rem);
    padding: var(--space-3) var(--space-3) var(--space-4);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: var(--color-surface-2);
    box-shadow: var(--shadow-3);

    > :not(.lp-word-card-picture) {
      margin-inline: var(--space-2);
    }

    .chip {
      justify-self: start;
    }
  }

  .lp-word-card-picture {
    aspect-ratio: 16 / 9;
    margin-block-end: var(--space-2);
    border-radius: var(--radius-md);
  }

  .lp-word-card-word {
    color: var(--color-text-strong);
    font-size: calc(var(--text-2xl) * var(--script-scale));
    font-weight: var(--weight-semibold);
  }

  .lp-word-card-gloss {
    color: var(--color-text-strong);
  }

  .lp-word-card-translation {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
  }

  .lp-anki {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 12rem));
    gap: var(--space-4);
  }

  .lp-anki-card {
    display: grid;
    align-content: start;
    justify-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--color-surface-3);
    box-shadow: var(--shadow-2);
    text-align: center;

    &:nth-child(1) {
      rotate: -3deg;
    }

    &:nth-child(2) {
      rotate: 3deg;
      translate: 0 1.5rem;
    }

    small {
      color: var(--color-text-subtle);
      font-size: var(--text-xs);
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
    }

    .reading {
      font-size: calc(var(--text-sm) * var(--reading-scale));
    }
  }

  .lp-specimen {
    display: grid;
    gap: var(--space-4);
    text-align: center;

    .reading {
      font-size: calc(var(--text-xl) * var(--reading-scale));
    }
  }

  .lp-specimen-match {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--space-4);
    color: var(--color-text-strong);
    font-size: calc(var(--text-3xl) * var(--arabic-scale));
    font-weight: var(--weight-semibold);
  }

  .lp-specimen-equals {
    color: var(--color-accent-text);
    font-weight: var(--weight-light);
  }

  .lp-library {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
    inline-size: 100%;

    li {
      display: grid;
      gap: var(--space-2);
      justify-items: start;
    }
  }

  .lp-library-thumb {
    inline-size: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-2);
  }

  .lp-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: var(--space-4);
  }

  .lp-tile {
    display: grid;
    align-content: start;
    gap: var(--space-2);
    padding: var(--space-5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface-1);

    > .icon {
      --icon-size: 1.5rem;
      margin-block-end: var(--space-2);
      color: var(--color-accent-text);
    }

    h3 {
      font-size: var(--text-lg);
    }

    p {
      color: var(--color-text-muted);
      font-size: var(--text-sm);
    }
  }

  /* Pricing: the billing toggle is two radios; :has() swaps the price, no JS. */
  .lp-pricing {
    display: grid;
    justify-items: center;
    text-align: center;

    .lp-section-head {
      justify-items: center;
      margin-block-end: var(--space-5);
    }
  }

  .lp-billing {
    display: inline-flex;
    gap: var(--space-1);
    margin-block-end: var(--space-6);
    padding: var(--space-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-surface-1);

    label {
      display: inline-flex;
      align-items: center;
      gap: var(--space-2);
      padding: var(--space-2) var(--space-4);
      border-radius: var(--radius-full);
      color: var(--color-text-muted);
      font-size: var(--text-sm);
      font-weight: var(--weight-medium);
      cursor: pointer;
    }

    label:has(:checked) {
      background: var(--color-surface-3);
      color: var(--color-text-strong);
    }

    label:has(:focus-visible) {
      outline: 2px solid var(--color-accent);
    }

    input {
      position: absolute;
      opacity: 0;
    }
  }

  .lp-pricing:has([value="yearly"]:checked) [data-billing="monthly"],
  .lp-pricing:not(:has([value="yearly"]:checked)) [data-billing="yearly"] {
    display: none;
  }

  .lp-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: var(--space-5);
    inline-size: min(100%, 52rem);
    text-align: start;
  }

  .lp-plan {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: var(--space-4);
    padding: var(--space-6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-surface-1);

    &[data-variant="premium"] {
      border-color: var(--color-accent-border);
      box-shadow: var(--glow-accent);
    }

    h3 {
      font-size: var(--text-lg);
    }
  }

  .lp-price {
    color: var(--color-text-strong);
    font-size: var(--text-4xl);
    font-weight: var(--weight-semibold);
    line-height: 1;

    small {
      margin-inline-start: var(--space-2);
      color: var(--color-text-muted);
      font-size: var(--text-md);
      font-weight: var(--weight-regular);
    }
  }

  .lp-plan-list {
    display: grid;
    align-content: start;
    gap: var(--space-3);

    li {
      display: flex;
      gap: var(--space-2);
      color: var(--color-text);
    }

    .icon {
      --icon-size: 1.1rem;
      flex: none;
      margin-block-start: 0.2em;
      color: var(--color-accent-text);
    }
  }

  .lp-faq {
    max-inline-size: calc(var(--reading-max) + 2 * var(--gutter));

    h2 {
      margin-block-end: var(--space-5);
      font-size: var(--text-3xl);
    }

    details {
      border-block-end: 1px solid var(--color-border);
    }

    summary {
      display: flex;
      justify-content: space-between;
      gap: var(--space-4);
      padding-block: var(--space-4);
      color: var(--color-text-strong);
      font-size: var(--text-lg);
      font-weight: var(--weight-medium);
      cursor: pointer;
      list-style: none;

      &::-webkit-details-marker {
        display: none;
      }

      &::after {
        content: "+";
        color: var(--color-text-subtle);
        transition: rotate var(--duration-base) var(--ease-out);
      }
    }

    [open] summary::after {
      rotate: 45deg;
    }

    details p {
      padding-block-end: var(--space-4);
      color: var(--color-text-muted);
    }
  }

  .lp-final {
    position: relative;
    isolation: isolate;
    display: grid;
    justify-items: center;
    gap: var(--space-6);
    margin-block-start: var(--space-10);
    padding: var(--space-10) var(--gutter);
    overflow: hidden;
    text-align: center;

    .lp-wall {
      inset: -40% -10%;
      z-index: -2;
      opacity: 0.5;
    }

    &::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: -1;
      background: radial-gradient(50% 70% at 50% 100%, var(--color-accent-soft), transparent 70%);
    }

    h2 {
      max-inline-size: 16ch;
      font-size: var(--text-4xl);
    }
  }

  .lp-genre {
    transition:
      translate var(--duration-base) var(--ease-out),
      box-shadow var(--duration-base) var(--ease-out);

    &:hover {
      translate: 0 -4px;
      box-shadow: var(--shadow-3);
    }
  }

  /* Scroll-driven motion (no JS). Browsers without it, and reduced motion, get the static page. */
  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      :is(.lp-section-head, .lp-insight, .lp-feature-copy, .lp-feature-visual, .lp-tile, .lp-plan, .lp-faq, .lp-final) {
        animation: lp-reveal linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 80%;
      }

      .lp-feature-visual {
        animation-range: entry 10% cover 40%;
      }

      /* Stagger a row of tiles by starting each a little later. */
      .lp-tile:nth-child(3n + 2) {
        animation-range: entry 15% entry 95%;
      }

      .lp-tile:nth-child(3n) {
        animation-range: entry 25% entry 100%;
      }

      /* Wide screens: how it works becomes a story. Steps scroll on the left while one
         sticky stage on the right cross-fades between their visuals. */
      @media (width >= 64rem) {
        .lp-steps {
          grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
          column-gap: var(--space-9);
          row-gap: 0;
          timeline-scope: --step-1, --step-2, --step-3, --step-4;
        }

        .lp-step {
          display: contents;
        }

        .lp-step-text {
          grid-column: 1;
          align-content: center;
          min-block-size: 70vh;
          animation: lp-step-text linear both;
          animation-timeline: view();
          animation-range: cover 20% cover 80%;

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

          p {
            font-size: var(--text-lg);
          }
        }

        .lp-step-visual {
          position: sticky;
          inset-block-start: calc(50vh - 15rem);
          grid-column: 2;
          grid-row: 1 / span 4;
          align-self: start;
          block-size: 30rem;
          aspect-ratio: auto;
          margin: 0;
          padding: var(--space-8);
          animation: lp-step-visual linear both;
          animation-range: cover 0% cover 100%;
        }

        .lp-step:nth-child(1) {
          .lp-step-text {
            grid-row: 1;
            view-timeline-name: --step-1;
          }

          .lp-step-visual {
            animation-name: lp-step-visual-first;
            animation-timeline: --step-1;
          }
        }

        .lp-step:nth-child(2) {
          .lp-step-text {
            grid-row: 2;
            view-timeline-name: --step-2;
          }

          .lp-step-visual {
            animation-timeline: --step-2;
          }
        }

        .lp-step:nth-child(3) {
          .lp-step-text {
            grid-row: 3;
            view-timeline-name: --step-3;
          }

          .lp-step-visual {
            animation-timeline: --step-3;
          }
        }

        .lp-step:nth-child(4) {
          .lp-step-text {
            grid-row: 4;
            view-timeline-name: --step-4;
          }

          .lp-step-visual {
            animation-name: lp-step-visual-last;
            animation-timeline: --step-4;
          }
        }
      }
    }
  }

  @keyframes lp-reveal {
    from {
      opacity: 0;
      translate: 0 2rem;
    }
  }

  @keyframes lp-step-text {
    0%,
    100% {
      opacity: 0.35;
    }

    30%,
    70% {
      opacity: 1;
    }
  }

  /* Each visual shows while its step crosses the middle of the screen. */
  @keyframes lp-step-visual {
    0%,
    25% {
      opacity: 0;
      scale: 0.96;
    }

    40%,
    60% {
      opacity: 1;
      scale: 1;
    }

    75%,
    100% {
      opacity: 0;
      scale: 0.96;
    }
  }

  @keyframes lp-step-visual-first {
    0%,
    60% {
      opacity: 1;
    }

    75%,
    100% {
      opacity: 0;
      scale: 0.96;
    }
  }

  @keyframes lp-step-visual-last {
    0%,
    25% {
      opacity: 0;
      scale: 0.96;
    }

    40%,
    100% {
      opacity: 1;
    }
  }
}
