.TypeHero {
  --case-canvas: calc(100vw - var(--w-console));
  --opening: 0;
  --headline-opacity: 1;
  --backdrop-scale: .8;
  box-sizing: border-box;
  margin-inline: calc((100% - var(--case-canvas)) / 2);
  inline-size: var(--case-canvas);
  padding: 0;
  display: flow-root;
  block-size: calc(100dvh - var(--h-header));
  z-index: 1;
  pointer-events: none;

  &::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--ui-station-b);
    opacity: var(--opening);
    pointer-events: none;
  }
  .TypeStage {
    position: relative;
    display: grid;
    pointer-events: auto;
    align-items: start;
    min-block-size: calc(100svh - var(--h-header));
    > * { grid-area: 1 / 1; min-inline-size: 0; }
  }
  .Manifesto {
    /* Native #manifesto navigation must land at the headline stop even
       while a slow console import is holding the window load event. */
    scroll-margin-block-start: var(--h-header);
    position: relative;
    z-index: 2;
    box-sizing: border-box;
    inline-size: min(100%, 100cqi);
    padding: clamp(2rem, 7svh, 5rem) var(--plate-pad);
    background: transparent;
    opacity: var(--headline-opacity);
    pointer-events: none;
    :is(a, button, dialog, .InstallChip) { pointer-events: auto; }
    @media (width <= 768px) {
      h1 {
        /* Fit the longer phrase in each translation; the authored break
           carries the second line, including Korean ruby. */
        --headline-measure: 11;
        --manifesto-min-size: min(2.5rem, (100cqi - 2 * var(--plate-pad)) / var(--headline-measure));
        &:lang(ja), &:lang(ko) { --headline-measure: 12; }
        &:lang(en) { --headline-measure: 14; }
      }
    }
  }
  .TypeCase {
    padding-block: 1rem;
    translate: 0 var(--headline-tray-offset, 0px);
  }
  .TypeCase .FormeRail {
    margin: 0;
    overflow-x: auto;
    pointer-events: auto;
  }
  .LeadForme { margin-block: 0; }
  .TypeCase .FormePlate {
    transform-origin: right top;
    scale: calc(var(--backdrop-scale) + (1 - var(--backdrop-scale)) * var(--opening));
  }
  .TypeCase .FormePlate > svg {
    opacity: calc(.68 + .32 * var(--opening));
    mask-image: linear-gradient(to right,
      rgb(0 0 0 / calc(.16 + .84 * var(--opening))),
      rgb(0 0 0 / calc(.32 + .68 * var(--opening))) 52%, black 82%
    );
  }
  .TypeCase .Controls {
    display: flex;
    translate: 0 max(0px, calc(1.5rem - var(--pill-stage-top, 0px)));
  }
  @media (width < 85rem) {
    /* Extend the horizontal scrollport into the space above the docked tray
       so it can paint and hit-test the controls there. */
    .TypeCase .FormeRail {
      --pill-room: max(0px, calc(var(--opening) * var(--tray-dock, 0px)));
      margin-block-start: calc(-1 * var(--pill-room));
      padding-block-start: var(--pill-room);
    }
    .TypeCase .Controls {
      margin-block-start: 0;
      translate: 0 max(calc(-100% - .75rem), calc(3.5rem - var(--pill-stage-top, 0px)));
    }
    .TypeCase figcaption { --lf-cap-gap: 1rem; }
  }
  @media (width < 48rem) {
    .TypeCase .Controls {
      position: sticky;
      inset-inline-end: 0;
    }
  }
  /* Shorten the caption pocket along the same diagonal as the plate.
     Translating the text upward would push its first line through the metal. */
  .TypeCase figcaption { --lf-cap-bottom: 4rem; }
  .TypeCase :is(.Controls, figcaption)[inert] { visibility: hidden; }
  .FormeNav {
    &.is-reversed {
      flex-direction: row-reverse;
      [data-icon] { scale: -1 1; }
    }
  }
}
/* The close-up can extend past the fold. Only its headline pose is cropped. */
:root[data-type-hero='headline'] .TypeHero .TypeCase {
  clip-path: inset(-100vh 0 max(0px, calc(100% - var(--headline-tray-clip, 100%))));
}
:root:not([data-type-hero='play']) .TypeHero .FormeNav { display: none; }
:root:is([data-type-hero='opening'], [data-type-hero='play']) .TypeHero {
  --opening: 1;
  --headline-opacity: .08;
  .TypeCase {
    z-index: 3;
    translate: 0 var(--tray-dock, 0px);
  }
}
body:has(#console-collapsed:checked) .TypeHero {
  --case-canvas: 100vw;
  .FormeRail { margin-inline: 0; }
}
:root[data-type-hero='play'] .TypeHero .Manifesto :is(.HeroActions, .dogfood),
:root[data-type-hero='headline'] .TypeCase :is(.Controls, figcaption) { visibility: hidden; }

@keyframes type-case-arrive {
  from { opacity: 0; transform: translateY(var(--arrive-from)); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  :root[data-type-hero='play'] .TypeHero .FormePlate.is-in-view
    .FormePaperJump:not(:hover, :focus-visible) .SlugLift {
    animation: lf-paper-hop 7.5s infinite;
  }
  .TypeHero.is-ready {
    .TypeCase { transition: translate 440ms cubic-bezier(.22,.75,.25,1); }
    .FormePlate { transition: scale 440ms cubic-bezier(.22,.75,.25,1); }
    &::before, .Manifesto, .FormePlate > svg { transition: opacity 320ms ease; }
  }
  :root[data-type-hero='play'] .TypeCase {
    .Controls { --arrive-from: -.875rem; }
    figcaption { --arrive-from: 1rem; }
    :is(.Controls, figcaption) {
      animation: type-case-arrive 360ms cubic-bezier(.2,.7,.3,1) 120ms backwards;
    }
  }
  :root[data-type-hero] .TypeHero:not(.is-ready) .Manifesto h1 { animation: none; }
  :root[data-type-hero] .TypeHero:not(.is-ready) :is(.FormePlate, .Manifesto) { visibility: hidden; }
  .TypeHero.is-awaiting-drop .Slug { visibility: hidden; }
  .TypeHero.is-dropping .Slug {
    animation: lf-drop 580ms cubic-bezier(.22,.88,.38,1.08) calc(180ms + var(--d) * .55) backwards;
  }
}

@keyframes lf-paper-hop {
  0%, 92%, 100% { translate: 0 0; }
  92% { animation-timing-function: ease-out; }
  96% { translate: 0 -20px; animation-timing-function: ease-in; }
}

/* Only the preview runs the vertical inscription behind the face samples.
   Reserve its column when the reading measure allows it. */
main:has(.TypeHero) #station-fonts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* The intro grows into the empty stretch before the first dash. Both
     start on the same grid line, so wrapping a sample cannot move the column. */
  > :is(.Illust[data-variant='faces'], .TwoEmDashes) {
    grid-area: 3 / 1;
    align-self: start;
    min-inline-size: 0;
  }
  > .Illust [data-part='samples'] {
    --rail-gutter: calc(var(--rail-pad) - var(--w-console) / 2 + var(--sample-padding, 0px));
    body:has(#console-collapsed:checked) & {
      --rail-gutter: calc(var(--rail-pad) + var(--sample-padding, 0px));
    }
    --sample-start: calc(var(--rail-gutter) + var(--sample-inset, 0px));
    margin-inline: calc(-1 * var(--sample-start)) calc(-1 * var(--rail-gutter));
    padding-inline: var(--sample-start) 1rem;
  }

  > hgroup + p { margin-block-end: clamp(1.25rem, 2.5cqi, 2rem); }

  @container (inline-size >= 52rem) {
    & { --sample-inset: max(0px, calc(1.3 * var(--df-fs) + 1.5rem - var(--plate-pad))); }
    > :is(hgroup, hgroup + p, .Illust[data-variant="faces"]) {
      margin-inline-start: var(--sample-inset);
    }
    .TwoEmDashes { --df-copy-inset: var(--sample-inset); }
  }
  @container (inline-size < 52rem) {
    > :is(hgroup, hgroup + p, .Illust[data-variant="faces"]) {
      position: relative;
      z-index: 1;
      --sample-padding: clamp(.75rem, 2cqi, 1.25rem);
      padding-inline: var(--sample-padding);
    }
  }
}

/* The shared dash timeline measures the station edge in the column's own
   coordinate space when the forme is upstairs. Both inks meet at that edge. */
main:has(.TypeHero) #station-fonts .TwoEmDashes {
  /* A translate on this container would carry the station boundary along
     during its entrance and put the background column in front of the copy. */
  translate: none;
  opacity: 1;
  --df-overhang: .25;
  --df-column-top: calc(var(--df-forme-top, 0px) - var(--df-overhang) * var(--df-fs));
  --df-col-left: calc(var(--df-page-left, 0px) + .5 * var(--df-fs));
  &[data-dash-measured] .Column { opacity: 1; }
  /* The sticky note translates up by half its height, so its anchor is its centre. */
  --df-dash-top: calc(var(--df-column-top) + var(--df-first-dash, calc(8 * var(--df-fs))));
  --df-dash-height: var(--df-first-dash-height, calc(2 * var(--df-fs)));
  --df-note-center: calc(var(--df-dash-top) + .5 * var(--df-dash-height));
  --df-note-start: max(
    var(--df-note-center),
    calc(var(--df-intro-height, 0px) + 1rem + .5 * var(--df-problem-size, 0px))
  );
  &.is-note-taller {
    --df-note-center: calc(var(--df-dash-top) + var(--df-dash-height) + 12px + .5 * var(--df-problem-size));
  }
  .Note > p:last-child { margin-block-end: 0; }
  .Column > .Initial {
    /* A vertical atomic inline uses a different baseline from the next glyph. */
    display: inline;
    color: transparent;
    background: linear-gradient(to bottom,
      var(--ui-accent) calc(100% * var(--df-overhang)),
      var(--df-face) calc(100% * var(--df-overhang))
    );
    background-clip: text;
  }
}

@media (prefers-reduced-motion: no-preference) {
  main:has(.TypeHero) #station-fonts {
    /* A short lateral movement leaves the vertical dash anchors intact. */
    .TwoEmDashes .Column {
      transition:
        opacity 480ms ease-out,
        translate 560ms cubic-bezier(.2,.7,.3,1),
        --df-hold 320ms cubic-bezier(.22,.61,.36,1),
        --df-weld 240ms ease
      ;
    }
    &:not([data-revealed]) .TwoEmDashes .Column,
    .TwoEmDashes:not([data-dash-measured]) .Column {
      opacity: 0;
      translate: -.35em 0;
    }
    .TwoEmDashes .Note p { animation: none; opacity: 1; }
    .TwoEmDashes .Note[data-revealed] p { animation: df-copy-in 450ms ease-out backwards; }
    .TwoEmDashes .Note[data-revealed] p + p { animation-delay: 90ms; }
    .TwoEmDashes .Note:not([data-revealed]) p { opacity: 0; }
  }
}
