/* ═══════════════════════════════════════════════════════════════════════════
   MAERSK HEROES ASSEMBLE — design system
   ───────────────────────────────────────────────────────────────────────────
   The single source of every token and component class in this app.

   The look is the MAERSK EVENT KEY VISUAL, as specified by
   assets/Maersk-Superhero-Style-Guide.html: deep maritime navy under ivory
   ink, saturated print accents, square corners, heavy condensed capitals and
   hard offset shadows in #020A16. It replaced an indigo-and-neon comic theme
   on 2026-10-31. If a rule here looks softer or rounder than the guide, it was
   missed in that pass — the guide is the authority, not this file's history.

   Consumed by three surfaces:
     1. public/index.html      (static landing page — <link>s this file)
     2. public/styleguide.html (the design-system reference page)
     3. app/globals.css        (@imports this file, then maps the same custom
                                properties into Tailwind v4's @theme so the
                                admin UI resolves to identical values)

   This event sends no email, so unlike the other apps in the workspace there
   is no template carrying a second, literal copy of these hexes. The ones that
   ARE duplicated are listed at `Faction identity` below.

   Everything is prefixed `hq-` (hero HQ) so nothing can collide with a
   Tailwind utility.
   ═══════════════════════════════════════════════════════════════════════════ */

/* The display face: Nimbus Sans Narrow Bold, shipped inside the style guide
   and extracted by scripts/extract-kv-assets.ts. Declared once, here, because
   both the React side and the two static pages read this stylesheet — which is
   simpler than the Bangers arrangement it replaced, where next/font and a
   Google Fonts <link> each loaded their own copy of the same face.

   Vendored rather than fetched: tests/motion.spec.ts allows the landing page
   no third-party request except fonts.g*, and this face is not on Google
   Fonts. Licence in public/fonts/LICENCE-urw-base35.txt.

   The file holds one weight. The 100-900 range is deliberate: the guide sets
   the display face at 900 everywhere and relies on the browser synthesising
   the extra weight, which is what gives the poster lettering its mass. */
@font-face {
  font-family: 'KV Display';
  src: url('/fonts/kv-display.woff') format('woff');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ── Surfaces ─────────────────────────────────────────────────────────── */
  --bg:          #08172d;
  --surface:     #112541;
  --surface-2:   #1c3558;
  --input:       #061224;
  --border:      #3c5473;
  --text:        #fff8ea;
  --text-muted:  #b9c6d8;

  /* ── Accents ──────────────────────────────────────────────────────────── */
  --yellow:      #ffbc24;
  --amber:       #e99b18;
  --cream:       #fff2d4;
  --red:         #f13c35;
  --blue:        #397dc3;
  --purple:      #9665b0;
  --cyan:        #91c6e8;

  /* The four the guide does not specify, so that each of the eight factions
     can own a colour nobody can mistake for another's. Picked inside the key
     visual's own register (L* 55-66, C* 34-70 — the band its four sit in) and
     then checked the way the four were: the tightest pair across all eight is
     31.1 in CIELAB, and every one of them is at least 34.9 from --cyan, which
     is held back so an unresolved faction has somewhere to stand.

     There is no --green, --neon-green, --magenta or --lime any more. The key
     visual has no green in it at all, and the guide reassigns Impact from jade
     to violet, so a green accent would belong to nothing. */
  --teal:        #2ba39a;
  --rose:        #e0518f;
  --orange:      #e8762b;
  --leaf:        #6fb03a;

  /* ── Metals ───────────────────────────────────────────────────────────── */
  --gold:        #ffbc24;
  --silver:      #c8d4e1;
  --bronze:      #c77f3f;

  /* ── Effects ──────────────────────────────────────────────────────────── */
  /* Square, not nearly square. The guide draws every panel, field and chip as
     a printed plate with a hard corner; a 4px radius is the one change that
     makes the whole page read as the old theme again. */
  --radius:      0px;
  --ink:         #020a16;             /* the shadow colour: ink, not black */
  --shadow-hard: 4px 5px 0 var(--ink);
  --shadow-lift: 5px 6px 0 var(--ink);  /* hover */
  --shadow-soft: 3px 4px 0 var(--ink);  /* resting, on panels */
  --glow-gold:   0 0 0 2px var(--gold), 5px 6px 0 var(--ink);

  /* ── Derived tokens ───────────────────────────────────────────────────────
     Additions to the brief, each earning its place. Contrast ratios below are
     MEASURED against the surface named, using the WCAG 2.x relative-luminance
     formula, and were recomputed when the palette changed. Anything carrying
     body copy clears 4.5:1; anything carrying only large display text or a
     graphic clears 3:1.

       --text       on --bg          17.0:1
       --text       on --surface     14.6:1
       --text-muted on --bg          10.4:1
       --text-muted on --surface      8.9:1
       --text-muted on --surface-2    7.1:1
       --on-accent  on --yellow      11.1:1
       --on-accent  on --cream       16.9:1
       --on-accent  on --silver      12.5:1
     ────────────────────────────────────────────────────────────────────── */

  /* Ink for text sitting on yellow / amber / cream / silver fills. */
  --on-accent:   #061224;

  /* Three accents are too dark to carry body copy on this canvas: --red 3.98:1
     on --surface, --blue 3.59:1, --purple 3.51:1. Each gets a lighter tint for
     TEXT while the accent itself keeps every fill, border, dot and shadow.
     These three values are the guide's own alliance inks, so the tint a
     faction's name is written in is the one the guide specifies for it.
       --red-text    8.6:1 on --surface, 10.0:1 on --bg
       --blue-text  10.1:1 on --surface, 11.8:1 on --bg
       --purple-text 8.8:1 on --surface, 10.2:1 on --bg */
  --red-text:    #ffaca5;
  --blue-text:   #a7d8f5;
  --purple-text: #d8b8eb;

  /* Hairline used over accent fills, where --border would disappear. */
  --edge-dark:   rgba(2, 10, 22, .55);

  /* ── Type ───────────────────────────────────────────────────────────────
     The display face comes from the @font-face above, which both surfaces get
     from this file. Body and mono are still loaded twice by two routes — on
     the React side app/layout.tsx defines --font-inter and --font-share-tech
     via next/font (self-hosted); on the static pages those variables are
     undefined and the fallback resolves to the copy from Google Fonts. Either
     way the rendered face is the same.

     'Arial Narrow' leads the display fallbacks because the guide's own stack
     does: if the webfont fails, a condensed grotesque is a far closer miss
     than Impact. */
  --font-display: 'KV Display', 'Arial Narrow', Impact, 'Haettenschweiler', sans-serif;
  --font-mono:    var(--font-share-tech, 'Share Tech Mono'), ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-body:    var(--font-inter, 'Inter'), system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* The condensed face is drawn for mass, so display type is set at 900 and
     tracked almost to zero. Bangers was a single-weight novelty face and
     needed neither. */
  --fw-display: 900;

  /* Fluid modular scale, ~1.25 between steps so the hierarchy never reads flat. */
  --fs-label: .6875rem;                                   /* 11px, tracked caps */
  --fs-xs:    .75rem;
  --fs-sm:    .875rem;
  --fs-base:  1rem;
  --fs-md:    clamp(1.0625rem, .97rem + .42vw, 1.25rem);
  --fs-lg:    clamp(1.375rem, 1.17rem + .9vw,  1.75rem);
  --fs-xl:    clamp(1.75rem,  1.34rem + 1.8vw, 2.5rem);
  --fs-2xl:   clamp(2.25rem,  1.52rem + 3.2vw, 3.75rem);
  --fs-3xl:   clamp(3rem,     1.7rem  + 5.7vw, 6rem);
  --fs-hero:  clamp(3.25rem,  1.4rem  + 8.2vw, 8.5rem);
  --fs-num:   clamp(4rem,     2.2rem  + 7.9vw, 7.5rem);   /* 64px → 120px */

  /* Light type on dark reads lighter than it is, so body leading runs long. */
  --lh-tight: .92;
  --lh-head:  1.05;
  --lh-body:  1.65;
  --measure:  68ch;

  /* ── Space ────────────────────────────────────────────────────────────── */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --gutter:    clamp(20px, 5vw, 72px);
  --section-y: clamp(56px, 9vw, 148px);

  /* ── Motion ───────────────────────────────────────────────────────────────
     Built-in CSS easings are too soft for this much contrast; these curves
     move immediately, which is what makes a press feel heard. No bounce. */
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-io:  cubic-bezier(.77, 0, .175, 1);
  --t-press:  120ms;
  --t-hover:  180ms;
  --t-enter:  420ms;

  /* ── Layers ───────────────────────────────────────────────────────────── */
  --z-raised:  10;
  --z-sticky:  40;
  --z-overlay: 100;
  --z-modal:   1000;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BASE
   Kept deliberately small. The admin UI loads Tailwind's preflight before this
   file, so these rules restate the few things both surfaces need and then get
   out of the way.
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; }

::selection { background: var(--yellow); color: var(--on-accent); }

/* One focus treatment for the whole system. Cyan reads against every surface
   AND against the yellow of a focused primary button. */
:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPE
   ═══════════════════════════════════════════════════════════════════════════ */

.hq-display {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  text-transform: uppercase;
  line-height: var(--lh-head);
  letter-spacing: .005em;
}

.hq-mono {
  font-family: var(--font-mono);
  letter-spacing: .06em;
}

/* Tracked caps. Used for field labels and column heads, never as a kicker
   above every heading. */
.hq-label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-muted);
}

/* The arcade tagline plate: mono text inside a thin rule. */
.hq-plate {
  display: inline-block;
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--input) 72%, transparent);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Spaced ticket code, e.g. 2 W W R 7 Q */
.hq-code {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  letter-spacing: .42em;
  text-indent: .42em;       /* re-centres text whose trailing space is tracked */
  color: var(--amber);
  text-transform: uppercase;
}

/* Big number. The gradient fill is the signature device of the system, so the
   solid colour is declared first and only replaced where clipping works. */
.hq-bignum {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: var(--fs-num);
  line-height: var(--lh-tight);
  letter-spacing: -.025em;
  color: var(--yellow);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hq-bignum {
    /* Ivory at the top falling to gold, which is how the guide prints a big
       number: the figure reads as lit from above rather than as a flat fill.
       The drop-shadow replaces the text-stroke once clipping works, because a
       stroke over a clipped gradient paints the stroke colour across it. */
    background: linear-gradient(170deg, var(--text) 10%, var(--cream) 30%, var(--yellow) 75%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-stroke: 0;
    filter: drop-shadow(3px 4px 0 var(--ink));
  }
}

/* Stands where .hq-bignum would, for a score that has not happened yet. Sized
   as body copy, not as a number: the point is that there is nothing to read. */
.hq-empty {
  max-width: 34ch;
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--text-muted);
}

/* ── Logo lockup ────────────────────────────────────────────────────────────
   Ivory fill over a navy-then-gold double offset, skewed -6deg, with a bolt
   glyph ahead of the wordmark. The guide drops the outline the old lockup
   carried: at weight 900 the letterforms already hold their own edge, and a
   stroke on top only muddies the counters. The bolt is an inline SVG in the
   markup, not an emoji: emoji render differently per platform and cannot be
   themed. */
.hq-logo {
  display: inline-flex;
  align-items: center;
  gap: .28em;
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  text-transform: uppercase;
  line-height: .88;
  letter-spacing: -.01em;
  color: var(--cream);
  transform: skewX(-6deg);
  text-shadow: 2px 3px 0 var(--bg), 3px 4px 0 var(--gold);
  -webkit-text-stroke: 0;
}
.hq-logo svg { flex: none; width: .82em; height: .82em; filter: drop-shadow(2px 2px 0 var(--ink)); }
/* The bolt is a gold glyph with a navy keyline, which is how the key visual
   prints every mark. Getting that right needs both of these declarations and
   it took a real defect to learn why.

   `stroke-width` was 14 on this 64-unit viewBox. The glyph's widest limb is
   about 11 units, and a stroke is centred on the path, so 7 units each side
   covered the gold fill completely -- at EVERY size. The lockup in the admin
   header and the landing footer rendered as a navy lozenge for weeks, and the
   sign-in cover carried a local override to get its own bolt back
   (workspace lesson L65).

   3 units is a keyline: about 1.2px at the 2rem lockup, a crisp edge on the
   1200px social card. And `paint-order: stroke fill` is what makes a keyline a
   keyline rather than a diet -- the fill paints over the stroke, so the visible
   ink sits OUTSIDE the glyph and the gold arrives whole. Same device
   .hq-bignum uses for its outlined numerals. */
.hq-logo__bolt {
  fill: var(--yellow);
  stroke: var(--ink);
  stroke-width: 3;
  paint-order: stroke fill;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TEXTURES
   All gradient-drawn: zero image bytes, crisp at any density, themeable.
   Applied as a low-opacity layer so surfaces stay calm and accents can pop.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Printed halftone. Coarser and far more present than the old 6px whisper:
   the key visual puts visible dot screens in every panel corner, and at .1
   opacity on a 6px grid the texture simply did not survive the navy. */
.tx-halftone {
  background-image: radial-gradient(currentColor 1.8px, transparent 2px);
  background-size: 8px 8px;
  opacity: .26;
}

/* Speed hatching. Three stops, not two: a wide cobalt band with an ivory
   hairline riding its trailing edge, which is how the guide draws motion. */
.tx-hatch {
  background-image: repeating-linear-gradient(
    125deg,
    transparent 0 14px,
    color-mix(in srgb, var(--blue) 30%, transparent) 14px 20px,
    color-mix(in srgb, var(--cream) 20%, transparent) 20px 22px
  );
}

/* Print grain. The old name is kept because the class is referenced from the
   style guide and the landing page, but it is no longer a pixel grid — the
   guide's equivalent is a coarse violet/navy diagonal, closer to a misaligned
   print run than to a screen. */
.tx-pixels {
  background-image: repeating-linear-gradient(
    115deg,
    transparent 0 28px,
    color-mix(in srgb, var(--purple) 30%, transparent) 28px 43px,
    var(--bg) 43px 46px
  );
}

.tx-speed {
  background-image: repeating-linear-gradient(
    102deg,
    color-mix(in srgb, var(--cream) 20%, transparent) 0 1px,
    transparent 1px 12px,
    color-mix(in srgb, var(--cream) 11%, transparent) 12px 14px,
    transparent 14px 34px
  );
  -webkit-mask-image: linear-gradient(90deg, var(--ink), transparent 72%);
          mask-image: linear-gradient(90deg, var(--ink), transparent 72%);
}

.tx-burst {
  background-image: radial-gradient(
    ellipse 120% 78% at 50% 26%,
    color-mix(in srgb, var(--yellow) 22%, transparent),
    color-mix(in srgb, var(--yellow) 6%, transparent) 42%,
    transparent 68%
  );
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   The press is a 2px shift with a shrinking shadow: the block physically
   moves toward the page, which is the comic-print convention and reads more
   clearly than a scale at this weight. 120ms, so it lands with the finger.
   ═══════════════════════════════════════════════════════════════════════════ */

.hq-btn,
.hq-btn-cream {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  min-height: 48px;
  padding: var(--s-3) var(--s-5);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: var(--fs-md);
  letter-spacing: .025em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  /* The second shadow is a 1px rim, not a glow: it keeps the gold edge lit
     where the 2px ink border would otherwise swallow it against the navy. */
  box-shadow: var(--shadow-soft), 0 0 0 1px var(--gold);
  transition:
    transform var(--t-press) var(--ease-out),
    box-shadow var(--t-press) var(--ease-out),
    filter var(--t-hover) ease;
}

.hq-btn {
  color: var(--on-accent);
  /* Four stops, near-vertical. The ivory at the top is what makes the face
     read as stamped metal rather than as a flat yellow rectangle. */
  background: linear-gradient(174deg, var(--cream) 0%, #ffce57 28%, var(--yellow) 65%, var(--amber) 100%);
}

.hq-btn-cream {
  color: var(--on-accent);
  background: var(--cream);
  min-height: 44px;
  font-size: var(--fs-base);
  box-shadow: var(--shadow-soft), 0 0 0 1px var(--cream);
}

@media (hover: hover) and (pointer: fine) {
  .hq-btn:hover       { filter: brightness(1.05); box-shadow: var(--shadow-lift), 0 0 0 1px var(--cream); }
  .hq-btn-cream:hover { filter: brightness(1.05); box-shadow: var(--shadow-lift), 0 0 0 1px var(--cream); }
}

.hq-btn:active       { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink), 0 0 0 1px var(--gold); }
.hq-btn-cream:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink), 0 0 0 1px var(--cream); }

.hq-btn[disabled],
.hq-btn-cream[disabled],
.hq-btn[aria-disabled='true'] {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.hq-btn svg,
.hq-btn-cream svg { flex: none; width: 1em; height: 1em; }

/* Danger: a square destructive control. The glyph is a 24px SVG cross, which
   clears the 3:1 graphic threshold that white-on-red does not clear at body
   size. Always paired with an aria-label in the markup. */
.hq-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--red);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition:
    transform var(--t-press) var(--ease-out),
    box-shadow var(--t-press) var(--ease-out),
    filter var(--t-hover) ease;
}
.hq-btn-danger svg { width: 24px; height: 24px; }
@media (hover: hover) and (pointer: fine) {
  .hq-btn-danger:hover { filter: brightness(1.12); box-shadow: var(--shadow-lift); }
}
.hq-btn-danger:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* Quiet tertiary action. No shadow: it must not compete with the one yellow
   thing on the view. */
.hq-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  min-height: 44px;
  padding: var(--s-2) var(--s-4);
  /* A lighter hairline than --border. The guide gives the ghost button a
     visible edge on the page background, where --border at 2.31:1 reads as a
     smudge rather than as the outline of a control. */
  border: 1px solid #71849e;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--t-hover) ease, color var(--t-hover) ease,
              background-color var(--t-hover) ease;
}
@media (hover: hover) and (pointer: fine) {
  .hq-btn-ghost:hover { border-color: var(--yellow); color: var(--yellow); }
}
.hq-btn-ghost:active { background: color-mix(in srgb, var(--yellow) 10%, var(--bg)); }

/* ═══════════════════════════════════════════════════════════════════════════
   FORM CONTROLS
   ═══════════════════════════════════════════════════════════════════════════ */

.hq-input,
.hq-select,
.hq-textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: var(--s-3) var(--s-4);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);   /* 16px: anything smaller auto-zooms on iOS */
  line-height: 1.4;
  transition: border-color var(--t-hover) ease, box-shadow var(--t-hover) ease;
}
.hq-textarea { min-height: 112px; resize: vertical; line-height: var(--lh-body); }

.hq-select {
  appearance: none;
  padding-right: var(--s-7);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.hq-input::placeholder,
.hq-textarea::placeholder { color: var(--text-muted); opacity: 1; }

.hq-input:focus-visible,
.hq-select:focus-visible,
.hq-textarea:focus-visible {
  outline: none;
  border-color: var(--yellow);
  /* An ink offset, not a glow. The guide's focused field looks like a plate
     that has been lifted off the page; a soft halo belongs to the old theme. */
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--yellow) 22%, transparent), var(--shadow-soft);
}

.hq-input[aria-invalid='true'],
.hq-select[aria-invalid='true'],
.hq-textarea[aria-invalid='true'] { border-color: var(--red); }

/* Error copy. Paired with an icon or the word "Error" in markup so colour is
   never the only signal. */
.hq-error {
  margin: var(--s-2) 0 0;
  color: var(--red-text);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SURFACES
   ═══════════════════════════════════════════════════════════════════════════ */

.hq-card {
  position: relative;
  background: var(--surface);
  /* A lighter hairline than --border, which the guide uses on panels so the
     card edge survives against the page without reaching for a second token. */
  border: 1px solid #596c86;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

/* Printed halftone tucked into one corner. Decorative only — but cyan on a
   7px grid at .18, not a .07 whisper: the key visual's dot screens are meant
   to be seen, and the old value disappeared entirely on the darker canvas. */
.hq-card::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 130px;
  height: 110px;
  color: var(--cyan);
  background-image: radial-gradient(currentColor 1.5px, transparent 1.8px);
  background-size: 7px 7px;
  opacity: .18;
  -webkit-mask-image: radial-gradient(circle at 100% 100%, var(--ink), transparent 72%);
          mask-image: radial-gradient(circle at 100% 100%, var(--ink), transparent 72%);
  pointer-events: none;
}

/* ── Header strip ───────────────────────────────────────────────────────────
   Recolour with data-accent, not a raw --strip, because the accent and the ink
   that can be read on it are one decision rather than two. That rule has not
   changed; what the ink IS has.

   The key visual does not put type on a flat accent fill. It lays a navy wash
   across the accent, heaviest at the leading edge, and sets ivory on top — so
   the accent survives as colour while the text is always measured against
   something close to --bg. That inverts the old arrangement, where every
   preset carried dark ink because white failed on the light accents.

   Measured across the gradient, cream on the wash over each preset:

                    left (where the title sits)   mid    far right
     --red                       17.0             14.0      10.1
     --blue                      17.0             13.2       9.6
     --purple                    17.0             13.4       9.9
     --amber                     17.0             11.8       7.2
     --gold                      17.0             10.8       6.0
     --cyan                      17.0             10.6       6.1
     --teal                      17.0             12.3       8.2
     --rose                      17.0             13.4       9.4
     --orange                    17.0             12.8       8.5
     --leaf                      17.0             12.0       7.6

   The worst number anywhere on any preset is 6.0:1, and the title never
   reaches that end of the box. --cream and --silver are deliberately NOT
   presets: they bottom out at 4.4 and 5.4, which is too close to the floor for
   a background whose whole job is to be bright.

   style="--strip: …" remains available for a one-off, in which case set
   --strip-ink alongside it. */
.hq-strip {
  --strip: var(--red);
  --strip-ink: var(--text);
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  background: linear-gradient(110deg, var(--bg) 10%, transparent 220%), var(--strip);
  border-top: 3px solid var(--cream);
  overflow: hidden;
}

/* Each preset names a background AND the ink that stays readable on it. Every
   one carries --text, because the wash above is what the ink is measured
   against; the preset still sets both so the pair cannot be split. */
.hq-strip[data-accent='red']     { --strip: var(--red);    --strip-ink: var(--text); }
.hq-strip[data-accent='blue']    { --strip: var(--blue);   --strip-ink: var(--text); }
.hq-strip[data-accent='purple']  { --strip: var(--purple); --strip-ink: var(--text); }
.hq-strip[data-accent='amber']   { --strip: var(--amber);  --strip-ink: var(--text); }
.hq-strip[data-accent='gold']    { --strip: var(--gold);   --strip-ink: var(--text); }
.hq-strip[data-accent='cyan']    { --strip: var(--cyan);   --strip-ink: var(--text); }
/* The four invented for the factions the guide does not name. `green` and
   `jade` are gone with the colours behind them; `teal` is the nearest thing
   the key visual's palette has, and `leaf` is the only green in the app. */
.hq-strip[data-accent='teal']    { --strip: var(--teal);   --strip-ink: var(--text); }
.hq-strip[data-accent='rose']    { --strip: var(--rose);   --strip-ink: var(--text); }
.hq-strip[data-accent='orange']  { --strip: var(--orange); --strip-ink: var(--text); }
.hq-strip[data-accent='leaf']    { --strip: var(--leaf);   --strip-ink: var(--text); }
.hq-strip::after {
  content: '';
  position: absolute;
  inset: 0 0 0 50%;
  background-image: repeating-linear-gradient(
    120deg, transparent 0 7px, color-mix(in srgb, var(--bg) 25%, transparent) 7px 10px
  );
  -webkit-mask-image: linear-gradient(90deg, transparent, var(--ink));
          mask-image: linear-gradient(90deg, transparent, var(--ink));
  pointer-events: none;
}
.hq-strip__title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: var(--fs-lg);
  letter-spacing: .025em;
  text-transform: uppercase;
  color: var(--strip-ink);
  transform: skewX(-8deg);
}

/* The winner treatment: gold border, ink shadow and a printed halftone ground.
   Still scaled 1.02 — the guide's own winner panel is not, but the medals row
   on the landing page is built around the gold card standing forward of the
   other two, and that is layout rather than skin. */
.hq-panel-win {
  position: relative;
  background:
    radial-gradient(color-mix(in srgb, var(--gold) 13%, transparent) 1px, transparent 1.5px) 0 0 / 7px 7px,
    var(--surface);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transform: scale(1.02);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SMALL COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Chip. --dot paints the optional leading marker. */
.hq-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 5px var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}
.hq-chip__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, var(--cyan));
}

/* Status pill: mono label, pale rule, one pulsing gold diamond. The green that
   used to say "live" has no equivalent in the key visual, so the signal moves
   to the shape — a four-point diamond rather than a round dot — and keeps the
   pulse. Colour was never the only cue here; the pill always carries a word. */
.hq-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 5px var(--s-3);
  border: 1px solid #b8cbda;
  border-radius: var(--radius);
  background: #142c42;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cream);
}
.hq-pill__dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 0;
  background: var(--yellow);
  clip-path: polygon(50% 0, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0 50%, 35% 35%);
  animation: hq-pulse 2.4s var(--ease-io) infinite;
}
@keyframes hq-pulse { 50% { opacity: .38; } }

/* Stat tile: tiny label, one big cream figure, quiet denominator. */
.hq-stat {
  padding: var(--s-4);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.hq-stat__value {
  display: block;
  margin: var(--s-1) 0;
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: var(--fs-xl);
  line-height: var(--lh-tight);
  color: var(--cream);
}
.hq-stat__sub {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* Category tile. Set --strip on the tile itself; the parts below READ it and
   never redeclare it, because a declaration on the child would shadow the
   inherited value and every tile would come out the same colour.
   data-highlight adds the gold treatment plus a corner ribbon. */
.hq-tile {
  --strip: var(--purple);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  /* No inline padding: the colour strip runs edge to edge. */
  padding: 0 0 var(--s-5);
  background: var(--surface);
  border: 1px solid #596c86;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  text-decoration: none;
  transition: border-color var(--t-hover) ease, box-shadow var(--t-hover) ease,
              transform var(--t-hover) var(--ease-out);
}
.hq-tile__strip {
  width: 100%;
  height: 10px;
  background: var(--strip);
}
.hq-tile__icon { width: 52px; height: 52px; margin-top: var(--s-4); color: var(--strip); }
.hq-tile__label {
  margin: var(--s-4) 0 0;
  padding-inline: var(--s-4);
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: var(--fs-md);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text);
}
.hq-tile__note {
  margin: 0;
  padding-inline: var(--s-5);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-align: center;
}

@media (hover: hover) and (pointer: fine) {
  .hq-tile:hover {
    border-color: var(--strip);
    box-shadow: var(--shadow-lift);
    transform: translateY(-3px);
  }
}

.hq-tile[data-highlight] {
  border: 2px solid var(--gold);
  box-shadow: var(--glow-gold);
}
.hq-tile[data-highlight]::after {
  content: attr(data-highlight);
  position: absolute;
  top: 16px;
  right: -42px;
  width: 150px;
  padding: 4px 0;
  background: var(--gold);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
  transform: rotate(38deg);
  pointer-events: none;
}

/* Medallion. The metallic conic stays — it is the one place a gradient earns
   its keep — but the glow becomes an ink offset and the rim becomes solid ink,
   so the medal reads as a struck disc sitting on the page rather than as a
   lit one floating above it. */
.hq-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: var(--fs-md);
  color: var(--on-accent);
  border: 2px solid var(--ink);
  filter: drop-shadow(3px 3px 0 var(--ink));
}
.hq-medal.is-gold {
  background: conic-gradient(from 210deg, var(--cream), var(--gold) 30%, #9a6f00 62%, var(--gold) 84%, var(--cream));
}
.hq-medal.is-silver {
  background: conic-gradient(from 210deg, var(--text), var(--silver) 30%, #6d7c8e 62%, var(--silver) 84%, var(--text));
}
.hq-medal.is-bronze {
  background: conic-gradient(from 210deg, #f4c38a, var(--bronze) 30%, #7a4512 62%, var(--bronze) 84%, #f4c38a);
}

/* List row: mono index, colour-coded dot, display title, amber figure. */
.hq-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: var(--s-3) var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.hq-row__index { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-muted); }
.hq-row__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--dot, var(--blue));
}
.hq-row__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: var(--fs-md);
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text);
}
.hq-row__sub { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.hq-row__figure {
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Divider: a spoken section break. */
.hq-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hq-divider::before,
.hq-divider::after {
  content: '';
  width: clamp(24px, 8vw, 96px);
  height: 1px;
  background: var(--border);
}

/* Pagination dots. The control is a 44px square so it can actually be tapped;
   only the pseudo-element is small. Sizing the button itself to 8px would make
   the design impossible to use on a phone. */
.hq-dots { display: flex; align-items: center; }
.hq-dots__dot {
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}
.hq-dots__dot::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--border);
  transition: background-color var(--t-hover) ease, transform var(--t-hover) var(--ease-out);
}
.hq-dots__dot[aria-current='true']::after { background: var(--amber); transform: scale(1.5); }
@media (hover: hover) and (pointer: fine) {
  .hq-dots__dot:hover::after { background: var(--text-muted); }
}
@media (prefers-reduced-motion: reduce) {
  .hq-dots__dot::after { transition-property: background-color; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT HELPERS
   ═══════════════════════════════════════════════════════════════════════════ */

.hq-wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.hq-prose { max-width: var(--measure); }

/* Breakpoint-free grid. */
.hq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: var(--s-4);
}

/* Skip link: off-screen until focused, then a real button at top-left. */
.hq-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--z-modal);
  padding: var(--s-3) var(--s-4);
  background: var(--yellow);
  color: var(--on-accent);
  font-family: var(--font-display);
  text-transform: uppercase;
  text-decoration: none;
}
.hq-skip:focus { left: var(--s-3); top: var(--s-3); }

/* Visually hidden but readable by assistive tech. */
.hq-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GAME LAYER
   The passport, the boards, the scanner and the admin hierarchy. Everything
   here is built from the tokens above; none of it introduces a colour.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Faction identity ────────────────────────────────────────────────────────
   One rule per faction, each setting the background AND its foreground. That
   pairing is the trap L25 records: a caller who picks a background without
   picking its foreground gets white on amber at 2.15:1. A faction is always
   accompanied by an emblem and a name -- never colour alone, because eight
   colours is more than anyone distinguishes from memory and some people
   distinguish none of them.
   The eight were chosen for mutual distance, not taste: the closest pair is
   31.1 in CIELAB (courage and precision). --amber is deliberately absent, 13.0
   from --gold, which is close enough that two factions wearing them would read
   as one.

   The DEFAULT is --cyan, which no faction claims. A badge for a player whose
   faction could not be resolved must not wear a real faction's colour, and
   --blue (the old default) now belongs to Unity.

   These values are duplicated in lib/constants.ts FACTIONS[], because
   scripts/sync-styleguide.ts generates the style guide from that array and
   cannot read a stylesheet. Change them together. */
.hq-faction {
  --faction: var(--cyan);
  --faction-ink: var(--on-accent);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--faction);
  border-radius: var(--radius);
  background: var(--input);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}
.hq-faction[data-faction='courage']   { --faction: var(--red);    --faction-ink: var(--on-accent); --faction-on-dark: #ffaca5; }
.hq-faction[data-faction='agility']   { --faction: var(--gold);   --faction-ink: var(--on-accent); --faction-on-dark: #ffce62; }
.hq-faction[data-faction='unity']     { --faction: var(--blue);   --faction-ink: var(--on-accent); --faction-on-dark: #a7d8f5; }
.hq-faction[data-faction='impact']    { --faction: var(--purple); --faction-ink: var(--on-accent); --faction-on-dark: #d8b8eb; }
.hq-faction[data-faction='resolve']   { --faction: var(--teal);   --faction-ink: var(--on-accent); --faction-on-dark: #6ad8cf; }
.hq-faction[data-faction='vision']    { --faction: var(--rose);   --faction-ink: var(--on-accent); --faction-on-dark: #f79fc1; }
.hq-faction[data-faction='precision'] { --faction: var(--orange); --faction-ink: var(--on-accent); --faction-on-dark: #fba86b; }
.hq-faction[data-faction='momentum']  { --faction: var(--leaf);   --faction-ink: var(--on-accent); --faction-on-dark: #b6e07e; }
.hq-faction__emblem { width: 20px; height: 20px; flex: none; }

/* The faction's colour as TEXT on the dark canvas, which is a different problem
   from its colour as a background. --faction itself is NOT reliably legible on
   --bg -- unity is 4.18:1 and impact 4.09:1 -- so a faction-tinted heading uses
   these lightened tints instead. The first four are the guide's own alliance
   inks; the other four were built to match their lightness band (L* 75-84).
   Measured against --bg #08172d: courage 9.99, agility 12.18, unity 11.77,
   impact 10.23, resolve 10.54, vision 9.13, precision 9.32, momentum 11.92.
   The weakest against --surface #112541 is vision at 7.83. */
.hq-faction-ink { color: var(--faction-on-dark, var(--faction)); }

/* Solid variant, for when the faction IS the surface rather than a label on
   one. It wears the same navy wash the header strip does, for the same reason:
   dark ink straight onto --blue measures 4.37:1 and onto --purple 4.27:1, both
   under AA for a 12px chip, while ivory over the wash clears 9:1 on every
   faction. Ink comes from the preset, so it cannot be set independently. */
.hq-faction--solid {
  background: linear-gradient(110deg, var(--bg) 10%, transparent 220%), var(--faction);
  color: var(--text);
  border-color: var(--edge-dark);
}

/* ── QR plate ────────────────────────────────────────────────────────────────
   A scanner needs dark modules on light with a quiet zone, which is the exact
   opposite of everything else on this dark page. So the plate is deliberately
   plain: white, square, no texture, no glow, no gradient. The comic treatment
   lives on the card AROUND it. A halftone laid over the modules is the fastest
   way to ship a code that will not scan. */
.hq-qr {
  display: block;
  padding: var(--s-3);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  line-height: 0;
  cursor: pointer;
}
/* An explicit width, not `width: 100%`. The plate is centred by a flex parent,
   so it shrinks to fit its content -- and a percentage width inside a
   shrink-to-fit box has nothing to resolve against, which collapsed the code to
   a 28px square. max-width keeps it inside a 390px phone. */
.hq-qr img {
  display: block;
  width: 288px;
  max-width: 100%;
  height: auto;
  /* Never smooth a QR. Interpolating the modules is what makes a code that
     scans on a laptop fail on a phone held at arm's length. */
  image-rendering: pixelated;
}
.hq-qr--lg { cursor: default; }
.hq-qr--lg img { width: min(78vw, 560px); }

/* ── Full-screen sheet ───────────────────────────────────────────────────────
   Used to hold a QR up to a scanner, so it is bright and uncluttered. */
.hq-sheet {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  backdrop-filter: blur(3px);
}
.hq-sheet__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-4);
  max-height: 100%;
  overflow: auto;
}

/* ── Dialog ──────────────────────────────────────────────────────────────────
   A real decision point: the award confirmation and the destructive-delete
   prompt. Centred, trapped, and never dismissible by the same tap that
   confirms. */
.hq-dialog {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
  background: color-mix(in srgb, var(--ink) 80%, transparent);
}
.hq-dialog__panel {
  width: 100%;
  max-width: 30rem;
  max-height: calc(100dvh - 2 * var(--s-4));
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
}

/* ── Toast ───────────────────────────────────────────────────────────────────
   One line of outcome. Status is carried by the word AND the colour, never the
   colour on its own. */
.hq-toast {
  position: fixed;
  left: 50%;
  bottom: var(--s-5);
  z-index: var(--z-overlay);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  max-width: min(92vw, 34rem);
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--tone, var(--blue));
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  font-size: var(--fs-sm);
  color: var(--text);
}
.hq-toast[data-tone='good']  { --tone: var(--cyan); }
.hq-toast[data-tone='warn']  { --tone: var(--amber); }
.hq-toast[data-tone='bad']   { --tone: var(--red); }

/* ── Data table ──────────────────────────────────────────────────────────────
   Admin screens only. Scrolls inside its own wrapper so a wide table never
   makes the page scroll sideways. */
.hq-tablewrap { width: 100%; overflow-x: auto; }
.hq-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.hq-table th,
.hq-table td {
  padding: var(--s-3) var(--s-3);
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.hq-table th {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.hq-table tbody tr:last-child td { border-bottom: 0; }
.hq-table .is-num { text-align: right; white-space: nowrap; }

/* ── Collapsible group ───────────────────────────────────────────────────────
   Faction -> tables -> players. A <details>, so it works with no JavaScript
   and the keyboard behaviour is the browser's rather than something I wrote. */
.hq-group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.hq-group + .hq-group { margin-top: var(--s-3); }
.hq-group > summary {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 48px;
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  letter-spacing: .03em;
  text-transform: uppercase;
  list-style: none;
}
.hq-group > summary::-webkit-details-marker { display: none; }
.hq-group > summary::before {
  content: '';
  flex: none;
  width: 0; height: 0;
  border-left: 7px solid var(--text-muted);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform var(--t-hover) var(--ease-out);
}
.hq-group[open] > summary::before { transform: rotate(90deg); }
.hq-group__meta { margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); letter-spacing: .08em; }
.hq-group__body { padding: 0 var(--s-4) var(--s-4); }

/* The player's own row, on a board or in a roster. Marked with a ribbon AND
   aria-current at every call site -- the tint alone would be invisible to a
   screen reader and to anyone who cannot distinguish it. */
.hq-row[data-highlight] {
  position: relative;
  border-color: var(--yellow);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 35%, transparent);
}
.hq-row[data-highlight]::after {
  content: attr(data-highlight);
  position: absolute;
  top: 0; right: 0;
  padding: 2px 8px;
  background: var(--yellow);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  border-bottom-left-radius: var(--radius);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SMALL SCREENS
   This app is used on a phone more than on anything else: guests open their
   passport at the table, roving staff scan from a handset, and the door team
   checks names in on a tablet. Everything below is written mobile-OUT -- the
   desktop rules above are the defaults and these narrow the gap, rather than
   the reverse -- so a surface that gains a component inherits the phone
   treatment without anyone remembering to add it.
   ═══════════════════════════════════════════════════════════════════════════ */

/* A single-row tab strip that scrolls sideways instead of wrapping.
   Seven admin tabs at 44px each wrap to a ~700px column on a 390px phone, which
   is a whole screen of navigation before any content. One scrolling row costs
   44px and keeps every tab reachable, and because the scroller clips its own
   overflow the PAGE still measures scrollWidth === clientWidth (L29).

   The partially-visible next tab is the affordance -- deliberately no mask or
   fade, which would dim a real tab label to hint at something the user can
   already see. */
.hq-tabs {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  min-width: 0;                 /* or it refuses to shrink inside a flex header */
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain; /* a swipe past the end must not navigate back */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.hq-tabs::-webkit-scrollbar { display: none; }
/* Tabs size to their label and never squash: shrinking them to fit is what
   produces four illegible stubs instead of two readable tabs and a hint. */
.hq-tabs > * { flex: none; }

/* 11px tracked caps are legible on a desktop monitor at arm's length and are
   not on a phone held at 30cm -- the letter-spacing that gives these labels
   their character also thins them. One step up below the tablet breakpoint,
   which is the only place --fs-label is used for anything a guest must read. */
@media (max-width: 767px) {
  :root { --fs-label: .75rem; }   /* 12px */
}

/* A stat tile is a centred column of label-over-number, which needs roughly
   90px of content width to hold a two-word label. Three of them across a 320px
   phone leaves 32px each, and "CHECKED" is a single 60px word -- one word
   cannot wrap, so it overflowed its box and read as "CHEC". Below the tablet
   breakpoint each tile becomes one compact row instead: label left, number
   right, full width. Nothing is squeezed and the three read as a short list.

   Scoped to the dt/dd form on purpose. The landing page's countdown uses
   .hq-stat too, but as three plain spans (label / value / suffix) sized to sit
   three-across -- flattening THAT into a row puts "Days 0 to go" on one line
   and pushes the card 172px past a 320px viewport. :has(> dt) is the structure
   this rule is actually about. */
@media (max-width: 639px) {
  .hq-stat:has(> dt) {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    text-align: left;
  }
  .hq-stat:has(> dt) > dd {
    display: flex;
    align-items: baseline;
    gap: var(--s-2);
    margin: 0;
  }
  .hq-stat:has(> dt) .hq-stat__value { margin: 0; }
}

/* Controls a finger has to hit. 44px is the floor from every platform's own
   guidance; the visual size of a text link is unchanged, the HIT AREA grows.
   Applied on coarse pointers only so a mouse-driven admin screen keeps its
   compact rhythm. */
@media (pointer: coarse) {
  .hq-taplink {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* A checkbox is 20px by design and must stay 20px to look right in a dense
   row, so the TARGET is grown with a pseudo-element rather than the box.
   Needs a positioned ancestor, which the row already is. */
@media (pointer: coarse) {
  .hq-checkbox-tap { position: relative; }
  .hq-checkbox-tap::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 44px; height: 44px;
    transform: translate(-50%, -50%);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ENTRANCE
   A page that arrives, rather than appearing already there. Used by the guest
   sign-in at `/`, which is the first thing most guests ever see of this app.

   CSS-ONLY, AND THAT IS THE POINT. The landing page's reveals are armed by
   GSAP, so they carry a whole contract about staying visible when the library
   fails (L18, and the MOTION SAFETY note at the top of public/index.html).
   These do not: the rule that hides the element and the rule that shows it
   again are in the SAME stylesheet, so there is no state of the world where
   one loads and the other does not. No JS, no library, nothing to degrade.

   The stagger is positional, via `--i` on each child, not `nth-child`. The
   sign-in grows two fields when a name turns out to be ambiguous at a table,
   and an error line when a guest mistypes -- with nth-child every row's delay
   would shift underneath it as the form changes shape. `--i` is a property of
   the row, so a row keeps its place in the sequence whatever appears beside
   it, and anything mounted later animates in on its own.                    */

/* `translate`, NOT `transform: translateY()`. This utility is applied to
   whatever needs to arrive, and several of those already own a transform --
   .hq-logo is sheared `skewX(-6deg)`, .hq-panel-win is tilted. A keyframe on
   `transform` replaces that wholesale, so the lockup would have interpolated
   from an upright translate to a 6deg shear and un-sheared itself on the way
   in. The independent translate property composes with the transform already
   there instead of overwriting it, which is the only version of this that is
   safe to hand to an arbitrary element. */
@keyframes hq-rise {
  from { opacity: 0; translate: 0 var(--hq-rise, 14px); }
}

/* For the strip: a wipe from the edge its ink is anchored to. clip-path, not
   scaleX and not width -- scaleX squashes the heading inside it for the length
   of the animation, and width reflows it. A clip reveals the strip already at
   its final size, so the capitals inside never distort and nothing moves.

   BOTH ENDS ARE WRITTEN OUT, and that is not style. Left implicit, the `to`
   is the element's own `clip-path: none`, and an inset() does not interpolate
   with `none` -- the pair is not animatable, so the browser falls back to
   DISCRETE interpolation and flips from fully clipped to fully visible at the
   50% mark. It still reports as a running animation of the right duration,
   and every assertion about arming, settling and reduced motion passes; it
   just is not a wipe. Caught by frame-stepping it and looking (L54/L59/L60 --
   the asset is only verified when you have read the rendered pixels).

   inset(0) is visually identical to none here: the strip has no box-shadow to
   clip away, and it is already overflow: hidden. Check that again before
   putting this on something that does. */
@keyframes hq-wipe {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

/* `--hq-hold` holds the whole sequence back while something plays in front of
   it -- the sign-in's entry cover (.sc-* below) sets it so the form arrives as
   the cover leaves, instead of playing unseen behind it and being over before
   it lifts.

   A DELAY, never a pause. A paused animation's `finished` never settles, which
   is the same trap this file's infinite animations set for the suite's
   settleEntrance() -- it would hang every spec that measures `/` to its
   timeout, with no assertion and no message. A delayed animation is returned by
   getAnimations() and its `finished` resolves at delay + duration, so the
   entrance still settles on its own and a waiter on it transitively waits out
   the cover.

   Always declare it WITH A UNIT. A unitless `0` is not a <time> and invalidates
   the whole calc(), which takes the stagger down with it.

   Collapsing it on a RUNNING animation shifts local time rather than
   restarting, so the form jumps to where it would have been. That is what
   "I tapped Enter, get on with it" should do. */
.hq-enter {
  animation: hq-rise var(--t-enter) var(--ease-out) both;
  animation-delay: calc(var(--hq-hold, 0ms) + var(--i, 0) * 70ms);
}

/* Children of a .hq-enter-group each take their own place in the sequence
   without the parent animating as a block -- a form whose fields rise one at
   a time, inside a card that is already there. */
.hq-enter-group > * {
  animation: hq-rise var(--t-enter) var(--ease-out) both;
  animation-delay: calc(var(--hq-hold, 0ms) + var(--i, 0) * 70ms);
}

.hq-enter-wipe {
  animation: hq-wipe var(--t-enter) var(--ease-io) both;
  animation-delay: calc(var(--hq-hold, 0ms) + var(--i, 0) * 70ms);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIGN-IN ENTRY COVER
   The invitation's entry cover, on the front door at `/`.

   A VERSION OF it, not a port. On /home the cover is a static poster that a
   visitor presses to enter, and the press plays a GSAP timeline whose last
   beat is the landing's own hero entrance. Here it plays by itself and lifts
   by itself, because the guest this is in front of is standing at a door
   waiting to collect a passport, and the last beat is the form's `.hq-enter*`
   sequence instead.

   CSS, NOT GSAP, AND THAT IS THE POINT -- the same point the ENTRANCE block
   above makes. Every beat of the original is a staggered tween of
   stroke-dashoffset, opacity, scale, translate and rotate, which is keyframes
   plus delays; none of it needs a tweening engine. Keeping it in CSS means the
   React tree gains no animation library, the lift cannot be stranded by a
   failed script (see .sc-cover's animation below), and the whole thing is
   testable in the HEADLESS project -- /home's cover needs the headed one only
   because a throttled rAF clock freezes a GSAP timeline.

   Class names are deliberately NOT `.lp-gate*`. Those live in public/index.html's
   inline <style>, which the React tree never loads, and three assertions in
   tests/routing.spec.ts are scoped to the `.hq-enter*` family by exact equality
   -- a cover on its own namespace cannot disturb them.                        */

/* The halves. Each is the full viewport clipped to one side of a diagonal, so
   the two of them ARE the cover: there is no backdrop behind them. The 0.4%
   overlap (65.6 against 66) is the original's, and it stops a hairline of the
   page showing through the seam before they part. */
.sc-cover {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  overflow: hidden;                     /* clips the halves as they leave */
  color: var(--text);
  /* THE LIFT, and the reason this is a stylesheet rather than a script. A
     1ms animation held open by its delay, `forwards` so the last keyframe
     sticks. No watchdog, no teardown, no effect that can fail to run: the
     only way the cover does not leave is the stylesheet not loading, and
     then it never arrived either. /home needs two setTimeout watchdogs to
     promise this much.
     OPACITY, NOT VISIBILITY, and that is not a preference. The first version
     of this keyframe ended `visibility: hidden; pointer-events: none` and only
     the second half ever took: measured two and a half seconds after load,
     with the animation long finished and filling forwards, the root still
     computed `visibility: visible`. `visibility` has its own interpolation
     rule -- any pair involving `visible` stays visible across the transition
     -- and it does not survive a fill the way an ordinary property does. So
     the cover stayed in the hit-testing tree and `<span class="sc-w2">` went
     on intercepting clicks aimed at the name field, with JavaScript switched
     off and no way to clear it. opacity interpolates like any other number and
     fills like any other property.

     The step is effectively instant, which is right: by 1060ms the halves are
     off-screen, the type and ring have faded and there is nothing left to see
     go. The exit people watch is the plates parting, not this. */
  animation: sc-lift 1ms linear 1060ms forwards;
}

@keyframes sc-lift {
  from { opacity: 1; pointer-events: auto; }
  to   { opacity: 0; pointer-events: none; }
}

/* --ink, where /home uses --input. The parting is the signature gesture and it
   has to READ: on the invitation the hero behind the cover is busy artwork, so
   plates in --input separate visibly from it, but the sign-in behind this one
   is a near-empty --bg field (#08172d) and --input (#061224) is close enough to
   it that the halves slide apart invisibly. Measured frame by frame before
   changing it -- the halves were travelling correctly the whole time and the
   gesture still did not exist on screen. --ink is the key visual's own shadow
   colour, and dark plates opening over a lighter page is what a curtain looks
   like. */
.sc-half {
  position: absolute;
  inset: 0;
  background: var(--ink);
  will-change: translate;
}
/* --ease-out, NOT --ease-io. The halves are thrown apart BY the detonation at
   300ms, so they have to leave at their fastest and settle -- an ease-in-out
   creeps (7.8% of the way at 560ms, measured) through exactly the 200ms the
   reveal is being watched, which is the note public/index.html:1766 leaves on
   its own copy of this beat. */
.sc-half--a {
  clip-path: polygon(0 0, 100% 0, 100% 34%, 0 66%);
  animation: sc-part-a 700ms var(--ease-out) 360ms both;
}
.sc-half--b {
  clip-path: polygon(0 65.6%, 100% 33.6%, 100% 100%, 0 100%);
  animation: sc-part-b 700ms var(--ease-out) 360ms both;
}
/* The printed dot screen, same 7px grid as every other surface. */
.sc-half::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--text-muted) 1px, transparent 1.3px);
  background-size: 7px 7px;
  opacity: .1;
}

/* Thrown apart BY the impact, so they leave at their fastest and ease off.
   The independent `translate` and `rotate` properties, never `transform`: a
   transform keyframe would replace whatever the element already carries, and
   these compose instead. Percentages resolve against the element's own box,
   which is what makes -104% clear the viewport whatever its height. */
@keyframes sc-part-a {
  from { translate: 0 0;        rotate: 0deg; }
  to   { translate: -6% -104%;  rotate: -3deg; }
}
@keyframes sc-part-b {
  from { translate: 0 0;        rotate: 0deg; }
  to   { translate: 6% 104%;    rotate: 3deg; }
}

/* The seam lights as the plates are struck and goes WITH them. Animated on the
   svg rather than the line so the two do not fight over one property: without
   this the gold rule simply blinked out of existence when the cover lifted,
   drawn across a form that had already arrived. */
.sc-seamvec {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: sc-seam-out 300ms var(--ease-io) 620ms both;
}
.sc-seam {
  stroke: var(--gold);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  animation: sc-seam 140ms var(--ease-out) 180ms both;
}
@keyframes sc-seam {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes sc-seam-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.sc-sheet {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--s-5);
  padding: max(var(--s-6), env(safe-area-inset-top)) var(--gutter)
           max(var(--s-6), env(safe-area-inset-bottom));
  max-height: 100%;
  /* HIDDEN, not auto. The stroke SVG is 340% of the ring and the shockwave
     560%, both overflowing on purpose -- and both count toward a scroll
     container's scrollable overflow, so with `overflow-y: auto` every phone
     could scroll this sheet 250-375px down into empty navy, whether or not
     the content fit. On a real phone that scroll was the first thing a thumb
     found, and the ring "below the fold" was partly this. The content is made
     to FIT instead (the short-portrait tier below), and the layout test
     measures that at five phone sizes.
     `clip` rather than `hidden` where supported: hidden still scrolls
     programmatically (and the test proves the sheet cannot be scrolled by
     setting scrollTop), while clip forbids it outright. The `hidden` line is
     the fallback for a browser without `clip`. */
  overflow: hidden;
  overflow: clip;
}

.sc-id {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Type left, emblem ring right, upper right deliberately empty. */
.sc-body { display: grid; align-content: center; align-items: center; gap: var(--s-6); }
@media (min-width: 900px) {
  .sc-body { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
}

/* Leaves as one block, 18px up, so the ring is the last thing holding. */
.sc-type { animation: sc-type-out 280ms var(--ease-io) 340ms both; }
@keyframes sc-type-out {
  from { opacity: 1; translate: 0 0; }
  to   { opacity: 0; translate: 0 -18px; }
}

.sc-word { margin: 0; line-height: .82; }
.sc-word span { display: block; width: fit-content; }
.sc-w1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 9.5vw, 7rem);
  text-transform: uppercase;
  color: var(--cream);
  transform: skewX(-6deg);
  /* Misregistered printing, not a drop shadow: ivory type on navy, gold
     carrying the offset, the way .hq-logo does. In EM, unlike .hq-logo's px,
     because this line runs from 2.6rem to 7rem: the px offsets were tuned at
     the top of that range (3/4 and 5/6 at 112px, which these em values
     reproduce exactly) and at a phone's 37-42px they were a sixth of the cap
     height -- the word read as printed twice. .hq-logo never exceeds 3rem
     and keeps its px. */
  text-shadow: .027em .036em 0 var(--bg), .045em .054em 0 var(--gold);
}
/* Outlined, and FILLED AT THE DETONATION. public/index.html:750 carries that
   comment on its own copy of this rule with nothing to make it true -- the
   whole type column fades before anything fills it. Here it is real. */
.sc-w2 {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 13vw, 9.5rem);
  text-transform: uppercase;
  transform: skewX(-6deg);
  letter-spacing: .01em;
  -webkit-text-stroke: 2px var(--text);
  animation: sc-fill 160ms var(--ease-out) 260ms both;
}
@keyframes sc-fill {
  from { color: transparent; }
  to   { color: var(--cream); }
}
@supports not ((-webkit-text-stroke: 1px red)) {
  /* No stroke support: solid rather than invisible, and no fill to animate. */
  .sc-w2 { color: var(--cream); animation: none; }
}

.sc-kicker {
  margin: var(--s-5) 0 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text);
}

/* Wipes in from the left, which is what the original's `transform-origin:
   left center` was always for -- nothing on /home drives it. */
.sc-spectrum { display: flex; gap: 6px; margin-top: var(--s-4); max-width: 340px; }
.sc-spectrum i {
  flex: 1;
  height: 8px;
  background: var(--c);
  transform-origin: left center;
  animation: sc-bar 320ms var(--ease-out) calc(60ms + var(--i, 0) * 40ms) both;
}
@keyframes sc-bar {
  from { scale: 0 1; }
  to   { scale: 1 1; }
}

.sc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); margin-top: var(--s-6); }
/* A pointer shortcut, not a control: the cover leaves on its own, and the
   keyboard path is "any key", bound in SignInCover.tsx. It stays 44px because
   /home's twin is held to that and a smaller one here would be a double
   standard. touch-action drops the 300ms tap delay so the press lands with
   the finger. */
.sc-enter { font-size: var(--fs-lg); padding: var(--s-4) var(--s-6); touch-action: manipulation; }

/* The activation emblem, ringed by the four universes. */
.sc-ring {
  position: relative;
  justify-self: center;
  width: min(52vmin, 390px);
  aspect-ratio: 1;
  animation: sc-ring-out 280ms var(--ease-io) 560ms both;
}
@keyframes sc-ring-out {
  from { opacity: 1; scale: 1; }
  to   { opacity: 0; scale: 1.35; }
}

/* Arrives, then detonates. Two animations on one element, comma-separated, so
   the second starts where the first stopped -- scale 1.18 into 1.5. */
.sc-bolt {
  position: absolute;
  inset: 25%;
  display: grid;
  place-items: center;
  animation: sc-bolt-in 140ms var(--ease-out) 0ms both,
             sc-bolt-hit 160ms var(--ease-out) 300ms both;
}
@keyframes sc-bolt-in {
  from { opacity: 0; scale: .8; }
  to   { opacity: 1; scale: 1.18; }
}
@keyframes sc-bolt-hit {
  from { scale: 1.18; }
  to   { scale: 1.5; }
}
/* The colour override that used to be here is gone: .hq-logo__bolt's
   stroke-width is fixed at source now, so the shared Bolt is already the gold
   mark and re-declaring its fill here would be a third copy of the same
   workaround. What remains is this bolt's own SIZE and GLOW, which are
   particular to the cover -- a detonating bolt filling a ring, not a 0.82em
   glyph in a lockup. */
.sc-bolt svg { width: 100%; height: 100%; }
.sc-bolt svg path {
  filter: drop-shadow(3px 4px 0 var(--ink))
          drop-shadow(0 0 14px color-mix(in srgb, var(--gold) 38%, transparent));
}

/* Offsets, not transforms: 36.5% is 50% minus half the orb's own 27% width,
   which leaves `scale` free to animate without scattering the ring. */
.sc-orb {
  position: absolute;
  width: 27%;
  aspect-ratio: 1;
  animation: sc-orb 260ms var(--ease-out) calc(160ms + var(--i, 0) * 30ms) both;
}
.sc-orb img { width: 100%; height: 100%; display: block; }
.sc-orb--anime     { top: 0;     left: 36.5%; }
.sc-orb--real-life { top: 36.5%; right: 0; }
.sc-orb--movie     { bottom: 0;  left: 36.5%; }
.sc-orb--game      { top: 36.5%; left: 0; }
@keyframes sc-orb {
  from { opacity: .66; scale: .92; }
  to   { opacity: 1;   scale: 1.06; }
}

/* Four strokes converging on the emblem. Their SVG is 340% of the ring so the
   strokes have room to travel, and it is SQUARE, which is what lets
   pathLength="1" dashing work in user units. */
.sc-vec {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 340%;
  height: 340%;
  transform: translate(-50%, -50%);
  overflow: visible;
}
.sc-stroke {
  stroke: var(--c);
  stroke-width: 1.1;
  fill: none;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-dasharray: 1;
  animation: sc-draw 340ms var(--ease-out) calc(80ms + var(--i, 0) * 40ms) both;
}
@keyframes sc-draw {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}

/* Centred on the EMBLEM, not the viewport: the impact comes from the thing
   that was struck. `inset: 0; margin: auto` rather than a centring
   translate -- the independent `scale` property composes AFTER `transform`,
   so a `translate(-50%,-50%)` would be scaled along with the element and the
   shockwave would crawl off the bolt as it grew. */
.sc-shock {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 560%;
  height: 560%;
  border-radius: 50%;
  background-image: radial-gradient(circle,
    transparent 40%,
    color-mix(in srgb, var(--gold) 30%, transparent) 56%,
    color-mix(in srgb, var(--gold) 10%, transparent) 64%,
    transparent 72%);
  animation: sc-shock 500ms var(--ease-out) 300ms both;
}
@keyframes sc-shock {
  from { opacity: .9; scale: .2; }
  to   { opacity: 0;  scale: 1; }
}

/* Every decorative layer is click-through. The stroke SVG is 340% of the ring
   and sits over the button; without this it silently eats the press and the
   control does nothing, which is exactly what happened on /home once. The
   ROOT keeps its own pointer-events, so a tap anywhere is caught by the cover
   and dismisses it rather than landing in the invisible form behind. */
.sc-half,
.sc-seamvec,
.sc-vec,
.sc-shock,
.sc-ring { pointer-events: none; }

/* Landscape phones: the ring goes first, exactly as on /home. Below the fold
   it is not part of the poster anyone sees, and the strokes go with it. */
@media (max-width: 899px) {
  .sc-ring { width: min(52vmin, 260px); }
}
/* SHORT PORTRAIT PHONES. The frames this cover was tuned on were 390x844,
   the device's nominal size; a real phone shows its browser chrome, and the
   page gets 553px on an iPhone SE and ~660px on most others. At those
   heights the eyebrow, the two-line headline, the kicker, the bars, the
   button and a 203px ring add up to more than the viewport, and the ring --
   the last thing in the column -- went below the fold, where the sheet
   scrolls to it and nobody knows to. Everything in the column gives a little
   so the poster fits as a poster. tests/signin-cover.spec.ts measures this
   at five phone sizes rather than trusting the arithmetic. */
@media (max-width: 899px) and (max-height: 700px) and (orientation: portrait) {
  .sc-sheet { padding-top: max(var(--s-5), env(safe-area-inset-top)); gap: var(--s-4); }
  .sc-body { gap: var(--s-5); }
  .sc-ring { width: min(40vmin, 180px); }
  .sc-w1 { font-size: clamp(2.1rem, 9.5vw, 7rem); }
  .sc-w2 { font-size: clamp(2.8rem, 13vw, 9.5rem); }
  .sc-kicker { margin-top: var(--s-4); }
  .sc-spectrum { margin-top: var(--s-3); }
  .sc-actions { margin-top: var(--s-5); }
}
@media (max-height: 540px) and (orientation: landscape) {
  .sc-ring { display: none; }
  .sc-word { line-height: .78; }
  .sc-kicker { margin-top: var(--s-4); }
  .sc-actions { margin-top: var(--s-4); }
}

/* The hold that keeps the form's entrance behind the cover. Set only where
   motion is wanted, so `reduce` never pays it -- and routing.spec.ts requires
   animation-delay to compute to exactly 0s on every .hq-enter* element under
   reduce, which this satisfies by never setting it rather than by unsetting
   it later. 620ms puts the form arriving at ~58% of the lift, the same
   overlap /home uses between its halves and its hero. */
@media (prefers-reduced-motion: no-preference) {
  .sc-stage { --hq-hold: 620ms; }
}

/* Dismissed, or seeded as seen. The cover goes, and the hold goes with it --
   collapsing a delay on a RUNNING animation shifts its local time rather than
   restarting it, so the form jumps to where it would have been by now. That
   is what "I tapped, get on with it" should do. */
html[data-cover='done'] .sc-cover { display: none; }
html[data-cover='done'] .sc-stage { --hq-hold: 0ms; }

/* THE PHONE HOLD  html[data-cover='wait'] -> html[data-cover='go']

   On a coarse pointer the pre-paint script in app/play/SignInCover.tsx sets
   `wait` before this element is parsed, and the button (or any key, or a
   five-second timer armed by that same script) flips it to `go`. Nothing here
   applies without a script, so a page with JavaScript off keeps the auto-play
   above and still lifts at 1060ms.

   HOW IT HOLDS. The INTRO beats -- bolt, bars, strokes, orbs, the fill, the
   shockwave -- are untouched and play on load, so the poster arrives alive.
   The EXIT beats are `animation-play-state: paused`, which on an animation
   that has not started holds it at local time 0, delay and all. `both` fill
   means each sits on its `from` keyframe: the plates closed, the type and
   ring at full opacity, the cover in the hit-testing tree.

   HOW IT RELEASES. `go` sets play-state back to running and NOTHING ELSE: the
   delays below are declared for `wait` and `go` together, so they are already
   in force while the animation is paused at 0, and the release never edits a
   delay on a live animation (L66's cousin: a changed delay on a running
   animation shifts its local time, and a jump is not a parting). The timings
   are the auto-play's minus the 340ms it spends before the type leaves, so a
   tap is answered within a frame and the plates part 20ms later.

   THE SEAM is an intro beat on a laptop and an exit beat here, deferred to the
   release. On a 390px-wide phone the diagonal runs straight through the
   button, and lit for a five-second hold it read as a line drawn across the
   poster; as the plates part it is the gesture again.

   Inside `no-preference` only, because under `reduce` the cover does not
   render and the pre-paint script never enters `wait` -- belt and braces, so
   a paused form entrance cannot survive either guard failing. All THREE
   .hq-enter* selectors are listed (L29).                                   */
@media (prefers-reduced-motion: no-preference) {
  html[data-cover='wait'] .sc-type,
  html[data-cover='wait'] .sc-half,
  html[data-cover='wait'] .sc-ring,
  html[data-cover='wait'] .sc-seamvec,
  html[data-cover='wait'] .sc-seam,
  html[data-cover='wait'] .sc-cover,
  html[data-cover='wait'] .sc-stage .hq-enter,
  html[data-cover='wait'] .sc-stage .hq-enter-group > *,
  html[data-cover='wait'] .sc-stage .hq-enter-wipe { animation-play-state: paused; }

  html[data-cover='wait'] .sc-seam,    html[data-cover='go'] .sc-seam    { animation-delay: 0ms; }
  html[data-cover='wait'] .sc-type,    html[data-cover='go'] .sc-type    { animation-delay: 0ms; }
  html[data-cover='wait'] .sc-half,    html[data-cover='go'] .sc-half    { animation-delay: 20ms; }
  html[data-cover='wait'] .sc-ring,    html[data-cover='go'] .sc-ring    { animation-delay: 220ms; }
  html[data-cover='wait'] .sc-seamvec, html[data-cover='go'] .sc-seamvec { animation-delay: 280ms; }
  html[data-cover='wait'] .sc-cover,   html[data-cover='go'] .sc-cover   { animation-delay: 720ms; }
  html[data-cover='wait'] .sc-stage,   html[data-cover='go'] .sc-stage   { --hq-hold: 280ms; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   THE LUCKY DRAW STAGE  .ld-*
   The cinematic the room watches, and the console chrome around it.

   SIX THINGS TO KNOW BEFORE EDITING ANY OF IT:

   1. ONE ATTRIBUTE DRIVES EVERYTHING. `data-mode` on .ld-stage selects the
      screen; React sets it and does not drive a single frame. Same division as
      the sign-in cover above, for the same reason -- a stage whose motion is
      JavaScript is a stage that freezes when a script throws, in front of a
      thousand people.

   2. EVERY SIZE IS IN `cqw`. .ld-stage is a container, so the whole thing
      scales from a 360px phone preview to a 4K wall with no breakpoints and
      no per-viewport tuning. `--ld-scale` multiplies it for a projector at
      the back of a ballroom.

   3. BOTH ENDS OF EVERY KEYFRAME ARE WRITTEN OUT. An implicit `to` resolves
      to the element's own computed value, and half the interesting properties
      -- clip-path, transform, filter -- do not interpolate with their resting
      value and degrade to a discrete flip at 50%. That is an animation that
      passes every ends-only assertion and is not an animation (L66).

   4. REMOVAL IS `opacity`, NEVER `visibility`. Any interpolation involving
      `visible` stays visible and does not survive a fill, which once left a
      full-screen cover in the hit-testing tree with no way to clear it (L69).

   5. EVERY DECORATIVE LAYER IS `pointer-events: none` FROM THE LINE IT IS
      WRITTEN ON. A transparent overflowing decoration is a full-size
      invisible click target (L44).

   6. MOTION USES THE INDEPENDENT `translate`/`rotate`/`scale` PROPERTIES, not
      `transform`. A transform keyframe REPLACES whatever the element already
      carries, so animating a skewed line would un-skew it on the way in
      (L65/L66). Where `transform` does appear it is a static skew that
      nothing animates.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── The stage ─────────────────────────────────────────────────────────────── */

.ld-stage {
  /* THE CONTAINER, and the reason there is not a single media query below. */
  container-type: inline-size;
  container-name: stage;

  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  color: var(--text);

  /* Set by the Show panel's type scale. A plain multiplier so one control
     moves the whole ramp instead of seven role sizes drifting apart. */
  --ld-scale: 1;

  /* The current beat's duration, written by the scheduler. Every phase-length
     animation below reads it, so a preset change needs no CSS. */
  --ld-phase: 2000ms;

  /* The accent of whichever universe is scanning. */
  --ld-accent: var(--yellow);
}

/* Fullscreen, and the fallback. `:fullscreen` covers the real thing;
   `[data-fs]` is the class the component sets as well, because
   requestFullscreen can be refused (an iframe without allowfullscreen, a
   browser policy) and a presentation that silently stayed 400px wide would be
   worse than one that fills the window instead. */
.ld-stage:fullscreen,
.ld-stage[data-fs='1'] {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  width: 100vw;
  height: 100dvh;
  aspect-ratio: auto;
  border: 0;
}

/* The audience route: the stage IS the page. */
.ld-stage[data-bare='1'] {
  aspect-ratio: auto;
  width: 100vw;
  height: 100dvh;
  border: 0;
}

.ld-stage__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* The key visual behind the holding screen. A file, not an upload: the whole
   point of the background-mode control is that every option is already on
   brand. */
.ld-stage[data-bg='keyvisual']::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/art/hero.webp') center / cover no-repeat;
  opacity: .34;
  pointer-events: none;
}
.ld-stage[data-bg='plain'] { background: var(--ink); }

/* ── Decoration ────────────────────────────────────────────────────────────── */

/* The printed dot screen, on the same 7px grid as every other surface in the
   system. Scaled with the stage so it stays a halftone rather than becoming
   wallpaper on a 4K wall. */
.ld-grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--text-muted) 1px, transparent 1.4px);
  background-size: .55cqw .55cqw;
  opacity: .09;
  pointer-events: none;
}

/* A broadcast scanline, which is the one piece of decoration here that is not
   from the print register -- it belongs to the LED wall this is shown on. */
.ld-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 .22cqw,
    color-mix(in srgb, var(--ink) 34%, transparent) .22cqw .44cqw
  );
  opacity: .5;
  pointer-events: none;
}

.ld-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 72% 62% at 50% 46%, transparent 42%, var(--ink) 130%);
  opacity: .78;
  pointer-events: none;
}

/* The two corner wedges the key visual puts on every plate.
   SMALL, and that is a correction rather than a preference. At 14cqw the
   top-left wedge reached under the brand lockup, and .hq-logo is cream --
   cream on gold measures about 1.8:1, so the event's own name became
   unreadable on its own stage. A text shadow does not rescue a contrast
   ratio; the wedge has to be a corner accent and the furniture has to clear
   it. Both halves of that are below (see .ld-brand's inset). */
.ld-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ld-corners::before,
.ld-corners::after {
  content: '';
  position: absolute;
  width: 4.5cqw;
  height: 4.5cqw;
  background: var(--yellow);
}
.ld-corners::before { top: 0; left: 0; clip-path: polygon(0 0, 100% 0, 0 100%); }
.ld-corners::after  { right: 0; bottom: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%); }

/* ── Furniture ─────────────────────────────────────────────────────────────── */

/* Inset to clear the corner wedge above it. The wedge is a right triangle, so
   the lockup only has to start below its hypotenuse -- 4.5cqw down and across
   puts it on plain ground at every stage width, because both are in the same
   container unit. */
.ld-brand {
  position: absolute;
  top: 5.2cqw;
  left: 3cqw;
  display: flex;
  align-items: center;
  gap: .5cqw;
  font-size: calc(1.5cqw * var(--ld-scale));
  transition: opacity var(--t-enter) var(--ease-out);
  pointer-events: none;
}
/* Sized here rather than inheriting .hq-logo svg's `width: .82em`, which at a
   projector's type scale would be a hundred-pixel indent in front of the
   wordmark (workspace lesson L65). This selector is (0,1,1) like the one it
   overrides and comes later in the file, so it wins. */
.ld-brand svg { width: 2cqw; height: 2cqw; }

.ld-protocol {
  position: absolute;
  top: 3cqw;
  right: 3cqw;
  max-width: 24cqw;
  font-family: var(--font-mono);
  font-size: calc(.95cqw * var(--ld-scale));
  letter-spacing: .22em;
  text-transform: uppercase;
  text-align: right;
  color: var(--text-muted);
  transition: opacity var(--t-enter) var(--ease-out);
  pointer-events: none;
}

/* Both quieten while a sequence runs: during the show the room looks at the
   middle of the screen and chrome at full strength competes with it. */
.ld-stage[data-sequence='playing'] .ld-brand { opacity: .45; }
.ld-stage[data-sequence='playing'] .ld-protocol { opacity: .4; }

.ld-foot {
  position: absolute;
  bottom: 2.4cqw;
  left: 0;
  right: 0;
  padding-inline: 3cqw;
  display: flex;
  justify-content: space-between;
  gap: 2cqw;
  font-family: var(--font-mono);
  font-size: calc(1cqw * var(--ld-scale));
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
}

/* The five-phase rail. Shows the room how far through the summoning it is,
   which is the difference between suspense and wondering if it has frozen. */
.ld-hud {
  position: absolute;
  bottom: 6cqw;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1cqw;
  font-family: var(--font-mono);
  font-size: calc(.95cqw * var(--ld-scale));
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-enter) var(--ease-out);
}
.ld-stage[data-sequence='playing'] .ld-hud { opacity: 1; }
/* Hidden once the answer is on screen: the rail has done its job and the
   winner's name should have the frame to itself. */
.ld-stage[data-mode='reveal'] .ld-hud,
.ld-stage[data-mode='grid'] .ld-hud { opacity: 0; }

.ld-hud i {
  width: 2.4cqw;
  height: 1px;
  background: currentColor;
  opacity: .4;
}
.ld-hud span { transition: color var(--t-hover) ease, opacity var(--t-hover) ease; }
.ld-hud span.is-done { color: var(--amber); opacity: .7; }
.ld-hud span.is-active {
  color: var(--yellow);
  opacity: 1;
  text-shadow: .12cqw .12cqw 0 var(--ink);
}

/* ── Shared type ───────────────────────────────────────────────────────────── */

.ld-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 7cqw 6cqw 10cqw;
  text-align: center;
}
/* Only the layer that is on screen receives anything, and nothing decorative
   ever does. */
.ld-layer > * { max-width: 100%; }

.ld-kicker {
  font-family: var(--font-mono);
  font-size: calc(1.15cqw * var(--ld-scale));
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--yellow);
}

/* Display type, and the ONE place the lockup's lean is applied.
   skewX on the LINE, not on the block: a -6deg shear on a three-line box
   leans the top and bottom edges by +-(height * tan6)/2, which at stage sizes
   is a visible staircase rather than an italic (L65). Each line is its own
   fit-content block, so every one of them starts on the same rule. */
.ld-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1em;
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: calc(7cqw * var(--ld-scale));
  line-height: .95;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--cream);
}
.ld-head > span {
  display: block;
  width: fit-content;
  transform: skewX(-6deg);
  text-shadow: .22cqw .26cqw 0 var(--ink);
}
.ld-head em {
  font-style: normal;
  color: var(--yellow);
}

.ld-caption {
  margin-top: 1.6cqw;
  font-size: calc(1.3cqw * var(--ld-scale));
  letter-spacing: .1em;
  color: var(--text-muted);
}

/* ── 1. Holding ────────────────────────────────────────────────────────────── */

.ld-holding { display: grid; gap: 2cqw; justify-items: center; }

.ld-universes {
  display: flex;
  justify-content: center;
  gap: 2.4cqw;
  margin-top: 1cqw;
}
.ld-universe {
  display: grid;
  justify-items: center;
  gap: .7cqw;
  width: 13cqw;
  padding: 1.2cqw .6cqw;
  background: color-mix(in srgb, var(--u) 12%, var(--surface));
  border: .18cqw solid var(--ink);
  border-top: .5cqw solid var(--u);
  box-shadow: .3cqw .35cqw 0 var(--ink);
  /* The diagonal cut the landing page's faction panels carry. STATIC: a
     clip-path percentage that animates re-rasters the box every frame. */
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 1.4cqw), calc(100% - 1.4cqw) 100%, 0 100%);
}
.ld-universe img { width: 5.4cqw; height: 5.4cqw; }
.ld-universe strong {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: calc(1.5cqw * var(--ld-scale));
  letter-spacing: .04em;
  text-transform: uppercase;
  /* The accent as a misregistered print offset: the house device. */
  text-shadow: .14cqw .14cqw 0 var(--u), .26cqw .26cqw 0 var(--ink);
}
.ld-universe small {
  font-family: var(--font-mono);
  font-size: calc(.85cqw * var(--ld-scale));
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── 2. System activation ──────────────────────────────────────────────────── */

@keyframes ld-open {
  from { opacity: 0; translate: 0 2.5cqw; scale: 1.1; filter: blur(.5cqw); }
  to   { opacity: 1; translate: 0 0;      scale: 1;   filter: blur(0); }
}
.ld-stage[data-mode='online'] .ld-layer {
  animation: ld-open 800ms cubic-bezier(.12, .8, .2, 1) both;
}

/* ── 3. Portal charging ────────────────────────────────────────────────────── */

/* The diamond plate the bolt charges inside. A 45deg static rotation on the
   plate with the glyph counter-rotated, so the bolt stays upright. */
.ld-core {
  display: grid;
  place-items: center;
  width: 9cqw;
  height: 9cqw;
  margin-bottom: 2cqw;
  background: var(--surface);
  border: .18cqw solid var(--yellow);
  box-shadow: .3cqw .35cqw 0 var(--ink);
  rotate: 45deg;
}
.ld-core svg { width: 4.6cqw; height: 4.6cqw; rotate: -45deg; }

@keyframes ld-charge {
  from { opacity: .25; scale: .7;  rotate: 45deg; }
  to   { opacity: 1;   scale: 1.1; rotate: 225deg; }
}
.ld-stage[data-mode='charge'] .ld-core {
  animation: ld-charge var(--ld-phase) var(--ease-io) both;
}
.ld-stage[data-mode='charge'] .ld-core svg {
  /* Counter-rotates against the plate's 225deg so the bolt lands upright. */
  animation: ld-charge-glyph var(--ld-phase) var(--ease-io) both;
}
@keyframes ld-charge-glyph {
  from { rotate: -45deg; }
  to   { rotate: -225deg; }
}

/* The charge meter: four accents filling left to right. */
.ld-meter {
  width: 34cqw;
  height: .7cqw;
  margin-top: 2cqw;
  background: color-mix(in srgb, var(--ink) 70%, transparent);
  border: .1cqw solid var(--border);
  overflow: hidden;
  transform: skewX(-12deg);
}
.ld-meter i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--blue), var(--yellow));
  transform-origin: left center;
}
@keyframes ld-fill {
  from { scale: 0 1; }
  to   { scale: 1 1; }
}
.ld-stage[data-mode='charge'] .ld-meter i {
  animation: ld-fill var(--ld-phase) var(--ease-io) both;
}

/* ── 4. The four universe scans ────────────────────────────────────────────── */

.ld-scanrow {
  display: flex;
  justify-content: center;
  gap: 1.8cqw;
  margin-top: 2.4cqw;
}
.ld-scanpanel {
  position: relative;
  display: grid;
  justify-items: center;
  gap: .6cqw;
  width: 15cqw;
  padding: 1.4cqw .8cqw;
  overflow: hidden;
  background: color-mix(in srgb, var(--u) 14%, var(--surface));
  border: .18cqw solid var(--ink);
  border-top: .5cqw solid var(--u);
  /* Three states, three distances from the viewer. The not-yet-scanned panels
     sit back and desaturated; the active one steps forward. */
  opacity: .34;
  scale: .93;
  transition: opacity 300ms var(--ease-out), scale 300ms var(--ease-out),
              box-shadow 300ms var(--ease-out);
}
.ld-scanpanel.is-done { opacity: .72; scale: .96; }
.ld-scanpanel.is-active {
  opacity: 1;
  scale: 1.05;
  box-shadow: .35cqw .4cqw 0 var(--ink),
              0 0 2.4cqw color-mix(in srgb, var(--u) 45%, transparent);
}
.ld-scanpanel img { width: 6cqw; height: 6cqw; }
.ld-scanpanel strong {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: calc(1.6cqw * var(--ld-scale));
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ld-scanpanel small {
  font-family: var(--font-mono);
  font-size: calc(.85cqw * var(--ld-scale));
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* The beam that sweeps the active panel. */
.ld-beam {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 30%,
    color-mix(in srgb, var(--u) 40%, transparent) 48%,
    var(--u) 50%,
    transparent 53%
  );
  opacity: 0;
  pointer-events: none;
}
@keyframes ld-beam {
  from { translate: 0 -66%; }
  to   { translate: 0 66%; }
}
.ld-scanpanel.is-active .ld-beam {
  opacity: .55;
  animation: ld-beam 1300ms var(--ease-io) infinite;
}

/* The code ticker under the panels. Duplicated content and a -50% shift, so
   the loop is seamless. */
.ld-ticker {
  margin-top: 2cqw;
  width: 46cqw;
  overflow: hidden;
  border-block: .1cqw solid var(--border);
  padding-block: .4cqw;
}
.ld-ticker div {
  display: flex;
  width: max-content;
  gap: 2cqw;
  font-family: var(--font-mono);
  font-size: calc(1cqw * var(--ld-scale));
  letter-spacing: .2em;
  color: var(--amber);
}
@keyframes ld-ticker {
  from { translate: 0 0; }
  to   { translate: -50% 0; }
}
.ld-stage[data-mode='search'] .ld-ticker div {
  animation: ld-ticker 2600ms linear infinite;
}

/* ── 5. Collision ──────────────────────────────────────────────────────────── */

/* The four orbs, out at the corners of an orbit, driven inward. Positions come
   from --ld-x/--ld-y per orb so one keyframe serves all four. */
.ld-orbit {
  position: relative;
  width: 56cqw;
  height: 30cqw;
}
.ld-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9cqw;
  height: 9cqw;
  margin: -4.5cqw 0 0 -4.5cqw;
  pointer-events: none;
}
.ld-orb img { width: 100%; height: 100%; }

@keyframes ld-converge {
  from { translate: var(--ld-x) var(--ld-y); scale: 1;   rotate: 0deg;   opacity: 1; }
  to   { translate: 0 0;                    scale: .06; rotate: 130deg; opacity: 0; }
}
.ld-stage[data-mode='collision'] .ld-orb {
  animation: ld-converge var(--ld-phase) cubic-bezier(.65, .05, .8, .65) both;
}
/* Resting state outside the collision beat, so the orbs are in place the
   instant the beat starts rather than snapping outward on frame one. */
.ld-orb { translate: var(--ld-x) var(--ld-y); }

/* The pressure vignette that closes in as the worlds meet. */
@keyframes ld-pressure {
  from { opacity: 0; }
  to   { opacity: .8; }
}
.ld-press {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 7cqw color-mix(in srgb, var(--yellow) 30%, transparent);
  opacity: 0;
  pointer-events: none;
}
.ld-stage[data-mode='collision'] .ld-press {
  animation: ld-pressure var(--ld-phase) ease-in both;
}

/* ── 6. Warp ───────────────────────────────────────────────────────────────── */

@keyframes ld-warp {
  0%   { opacity: 0; scale: .45; filter: blur(.7cqw); }
  25%  { opacity: 1; scale: .8;  filter: blur(0); }
  75%  { opacity: 1; scale: 1;   filter: blur(0); }
  100% { opacity: 0; scale: 1.14; filter: blur(.2cqw); }
}
.ld-stage[data-mode='warp'] .ld-layer {
  animation: ld-warp var(--ld-phase) var(--ease-io) both;
}

/* ── 7. Target lock ────────────────────────────────────────────────────────── */

/* Four corner brackets closing on the headline. Drawn with borders on two
   pseudo-elements rather than four divs. */
.ld-lock {
  position: relative;
  padding: 3cqw 6cqw;
}
.ld-lock::before,
.ld-lock::after {
  content: '';
  position: absolute;
  width: 6cqw;
  height: 4cqw;
  border: .22cqw solid var(--yellow);
  pointer-events: none;
}
.ld-lock::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.ld-lock::after { right: 0; bottom: 0; border-left: 0; border-top: 0; }

@keyframes ld-lock-in {
  from { opacity: 0; scale: 1.4; }
  to   { opacity: 1; scale: 1; }
}
.ld-stage[data-mode='lock'] .ld-lock {
  animation: ld-lock-in 650ms var(--ease-out) both;
}

/* ── 8. Countdown ──────────────────────────────────────────────────────────── */

.ld-count {
  position: relative;
  display: grid;
  place-items: center;
  width: 30cqw;
  height: 30cqw;
}
.ld-count::before,
.ld-count::after {
  content: '';
  position: absolute;
  inset: 0;
  border: .22cqw solid var(--yellow);
  border-radius: 50%;
  pointer-events: none;
}
.ld-count::after {
  inset: 12%;
  border-style: dashed;
  border-color: var(--amber);
}
@keyframes ld-ring {
  from { scale: .65; opacity: 1; }
  to   { scale: 1.5; opacity: 0; }
}
.ld-stage[data-mode='countdown'] .ld-count::before { animation: ld-ring var(--ld-phase) ease-out both; }
.ld-stage[data-mode='countdown'] .ld-count::after {
  animation: ld-ring var(--ld-phase) ease-out both;
  animation-direction: reverse;
}

.ld-count b {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: calc(22cqw * var(--ld-scale));
  line-height: .9;
  color: var(--yellow);
  transform: skewX(-8deg);
  text-shadow: .5cqw .5cqw 0 var(--ink);
}
@keyframes ld-count-num {
  0%   { opacity: 0; scale: 1.8; }
  25%  { opacity: 1; scale: 1; }
  80%  { opacity: 1; scale: 1; }
  100% { opacity: 0; scale: .8; }
}
.ld-stage[data-mode='countdown'] .ld-count b {
  animation: ld-count-num var(--ld-phase) var(--ease-out) both;
}

/* ── 9. Suspense ──────────────────────────────────────────────────────────── */

@keyframes ld-suspense {
  from { opacity: 0; scale: .95; }
  to   { opacity: 1; scale: 1; }
}
.ld-stage[data-mode='suspense'] .ld-layer {
  animation: ld-suspense 450ms var(--ease-out) both;
}
/* The room darkens for the held breath. */
.ld-stage[data-mode='suspense'] .ld-vignette { opacity: .94; }

/* ── 10. Impact ───────────────────────────────────────────────────────────── */

.ld-burst {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: calc(12cqw * var(--ld-scale));
  line-height: .95;
  text-transform: uppercase;
  color: var(--yellow);
  transform: skewX(-9deg);
  text-shadow: .6cqw .6cqw 0 var(--red), -.16cqw -.16cqw 0 var(--ink);
}
@keyframes ld-smash {
  0%   { opacity: 0; scale: 3;    rotate: -12deg; }
  45%  { opacity: 1; scale: .94;  rotate: -5deg; }
  70%  { opacity: 1; scale: 1.05; rotate: -5deg; }
  100% { opacity: 1; scale: 1;    rotate: -5deg; }
}
.ld-stage[data-mode='burst'] .ld-burst {
  animation: ld-smash 700ms cubic-bezier(.14, .75, .2, 1) both;
}

/* The gold sweep across the frame, and the camera shake. */
@keyframes ld-sweep {
  0%   { opacity: 0;   translate: -100% 0; }
  30%  { opacity: .55; translate: -30% 0; }
  100% { opacity: 0;   translate: 100% 0; }
}
.ld-sweep {
  position: absolute;
  inset: 0;
  background: linear-gradient(118deg, transparent 25%, color-mix(in srgb, var(--yellow) 24%, transparent) 48%, transparent 66%);
  opacity: 0;
  pointer-events: none;
}
.ld-stage[data-mode='burst'] .ld-sweep { animation: ld-sweep 750ms ease-out both; }

@keyframes ld-recoil {
  0%, 100% { translate: 0 0; }
  20%      { translate: -.35% .2%; }
  45%      { translate: .25% -.15%; }
  70%      { translate: -.1% .1%; }
}
.ld-stage[data-mode='burst'] .ld-layer { animation: ld-recoil 440ms ease-out both; }

/* ── 11. The winner ───────────────────────────────────────────────────────── */

/* The plate. Built on the same device as .hq-panel-win -- gold keyline, gold
   halftone, hard ink offset -- at stage scale. */
.ld-winner {
  position: relative;
  width: min(78cqw, 100%);
  padding: 4cqw 5cqw;
  background:
    radial-gradient(color-mix(in srgb, var(--gold) 13%, transparent) 1px, transparent 1.5px) 0 0 / .6cqw .6cqw,
    var(--surface);
  border: .28cqw solid var(--gold);
  box-shadow: .5cqw .6cqw 0 var(--ink);
  overflow: visible;
}

/* Lands like a plate dropped on a table: rotateX is the one place a
   `transform` keyframe is used, on an element that carries no other
   transform of its own. */
@keyframes ld-land {
  0%   { opacity: 0; transform: perspective(90cqw) translateY(16%) rotateX(28deg) scale(.78); }
  70%  { opacity: 1; transform: perspective(90cqw) translateY(-1%) rotateX(0deg)  scale(1.02); }
  100% { opacity: 1; transform: perspective(90cqw) translateY(0)   rotateX(0deg)  scale(1); }
}
.ld-stage[data-mode='reveal'] .ld-winner {
  animation: ld-land 850ms cubic-bezier(.16, .85, .22, 1) both;
}

/* The specular pass over the plate. */
@keyframes ld-shine {
  0%   { opacity: 0; translate: -100% 0; }
  30%  { opacity: 1; translate: -20% 0; }
  100% { opacity: 0; translate: 100% 0; }
}
.ld-winner__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 20%, color-mix(in srgb, var(--cream) 18%, transparent) 48%, transparent 65%);
  opacity: 0;
  pointer-events: none;
}
.ld-stage[data-mode='reveal'] .ld-winner__shine {
  animation: ld-shine 1300ms 650ms ease-out both;
}

/* The medal, hung off the corner. */
.ld-winner__medal {
  position: absolute;
  top: -3cqw;
  right: -2cqw;
  width: 9cqw;
  height: 9cqw;
  pointer-events: none;
}
.ld-winner__medal img { width: 100%; height: 100%; filter: drop-shadow(.3cqw .3cqw 0 var(--ink)); }
@keyframes ld-medal {
  0%   { opacity: 0; scale: .1;  rotate: -180deg; }
  70%  { opacity: 1; scale: 1.15; rotate: 0deg; }
  100% { opacity: 1; scale: 1;   rotate: 0deg; }
}
.ld-stage[data-mode='reveal'] .ld-winner__medal {
  animation: ld-medal 1100ms 600ms cubic-bezier(.2, .8, .2, 1) both;
}

.ld-winner__eyebrow {
  display: inline-block;
  padding: .5cqw 1.4cqw;
  background: var(--yellow);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: calc(1.1cqw * var(--ld-scale));
  letter-spacing: .22em;
  text-transform: uppercase;
  box-shadow: .22cqw .26cqw 0 var(--ink);
  transform: rotate(-2deg);
}
@keyframes ld-ribbon {
  from { opacity: 0; translate: -25% 0; }
  to   { opacity: 1; translate: 0 0; }
}
.ld-stage[data-mode='reveal'] .ld-winner__eyebrow {
  animation: ld-ribbon 650ms 250ms var(--ease-out) both;
}

/* The name. Auto-fit is done in JS from the character count, because a
   fourteen-character name and a thirty-character one cannot share a size at
   this scale. The skew is static and the wipe is a clip-path, so the two do
   not fight: a transform keyframe here would un-skew it (L66). */
.ld-winner__name {
  margin-top: 1.6cqw;
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: calc(var(--ld-name, 9cqw) * var(--ld-scale));
  line-height: .98;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: var(--cream);
  transform: skewX(-6deg);
  text-shadow: .3cqw .34cqw 0 var(--ink);
}
@keyframes ld-name {
  from { opacity: 0; clip-path: inset(0 100% 0 0); }
  /* -5% on the sides, not inset(0): skewed display type overflows its own box
     and a clip at exactly 0 shaves the lean off the first and last glyph. */
  to   { opacity: 1; clip-path: inset(0 -5% 0 -5%); }
}
.ld-stage[data-mode='reveal'] .ld-winner__name {
  animation: ld-name 850ms 350ms var(--ease-out) both;
}

.ld-winner__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1cqw 2.4cqw;
  margin-top: 1.8cqw;
  font-family: var(--font-mono);
  font-size: calc(1.5cqw * var(--ld-scale));
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ld-winner__meta b { color: var(--cream); font-weight: 400; }

.ld-winner__prize {
  margin-top: 2.2cqw;
  padding-top: 1.8cqw;
  border-top: .12cqw solid var(--border);
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: calc(2.8cqw * var(--ld-scale));
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--yellow);
}
.ld-winner__sponsor {
  margin-top: .6cqw;
  font-family: var(--font-mono);
  font-size: calc(1.1cqw * var(--ld-scale));
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

@keyframes ld-detail {
  from { opacity: 0; translate: 0 1.2cqw; }
  to   { opacity: 1; translate: 0 0; }
}
.ld-stage[data-mode='reveal'] .ld-winner__meta    { animation: ld-detail 600ms 800ms both; }
.ld-stage[data-mode='reveal'] .ld-winner__prize   { animation: ld-detail 700ms 1150ms both; }
.ld-stage[data-mode='reveal'] .ld-winner__sponsor { animation: ld-detail 700ms 1300ms both; }

/* ── 12. The winner grid ──────────────────────────────────────────────────── */

.ld-grid {
  display: grid;
  grid-template-columns: repeat(var(--ld-cols, 5), minmax(0, 1fr));
  gap: 1.2cqw;
  width: 100%;
  margin-top: 2cqw;
}
.ld-wcard {
  padding: 1.4cqw 1cqw;
  background: var(--surface);
  border: .16cqw solid var(--gold);
  box-shadow: .26cqw .3cqw 0 var(--ink);
  text-align: center;
}
.ld-wcard b {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: calc(1.9cqw * var(--ld-scale));
  line-height: 1.02;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--cream);
  /* Long names wrap rather than being clipped: on a wall, a truncated name is
     worse than a two-line one. */
  overflow-wrap: anywhere;
}
.ld-wcard small {
  display: block;
  margin-top: .5cqw;
  font-family: var(--font-mono);
  font-size: calc(1cqw * var(--ld-scale));
  letter-spacing: .14em;
  color: var(--text-muted);
}

/* Flips up in sequence. The stagger is capped so a page of forty does not
   take four seconds to finish arriving. */
@keyframes ld-flip {
  from { opacity: 0; transform: perspective(60cqw) translateY(26%) rotateX(-55deg) scale(.84); }
  to   { opacity: 1; transform: perspective(60cqw) translateY(0)   rotateX(0deg)   scale(1); }
}
.ld-stage[data-mode='grid'] .ld-wcard {
  animation: ld-flip 800ms var(--ease-out) both;
  animation-delay: calc(min(var(--i, 0) * 90ms, 2200ms));
}

.ld-pager {
  margin-top: 1.8cqw;
  font-family: var(--font-mono);
  font-size: calc(1.1cqw * var(--ld-scale));
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── 13. Leaderboard ──────────────────────────────────────────────────────── */

.ld-board {
  display: grid;
  gap: .7cqw;
  width: min(66cqw, 100%);
  margin-top: 2cqw;
}
.ld-board li {
  display: flex;
  justify-content: space-between;
  gap: 2cqw;
  padding: .9cqw 1.4cqw;
  background: var(--surface-2);
  border: .12cqw solid var(--border);
  font-size: calc(1.6cqw * var(--ld-scale));
  text-align: left;
}
.ld-board b { font-weight: 400; color: var(--cream); }
.ld-board span { color: var(--yellow); font-family: var(--font-mono); letter-spacing: .1em; }

/* ── Blackout and freeze ──────────────────────────────────────────────────── */

/* Opacity, never visibility -- and never `display`, because the stage behind
   it keeps playing and must come back where it left off. */
.ld-black {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms linear;
}
.ld-stage[data-blackout='1'] .ld-black { opacity: 1; }

/* Holds every descendant animation exactly where it is. `!important` because
   it has to beat the per-mode rules above, all of which are more specific. */
.ld-stage[data-frozen='1'] *,
.ld-stage[data-frozen='1'] *::before,
.ld-stage[data-frozen='1'] *::after {
  animation-play-state: paused !important;
}

/* The rehearsal watermark. Deliberately unmissable: the single worst outcome
   in this whole feature is somebody believing a rehearsal was the real draw. */
.ld-rehearsal {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 40;
  translate: -50% -50%;
  rotate: -18deg;
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: calc(11cqw * var(--ld-scale));
  letter-spacing: .08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--red) 34%, transparent);
  -webkit-text-stroke: .14cqw color-mix(in srgb, var(--red) 55%, transparent);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LUCKY DRAW CONSOLE  (the operator's side, not the room's)
   ═══════════════════════════════════════════════════════════════════════════ */

/* The one enormous button. Bigger than .hq-btn on purpose: it is pressed once
   per prize, in a dark room, by somebody holding a microphone. */
.ld-go {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  width: 100%;
  min-height: 76px;
  padding: var(--s-5);
  background: linear-gradient(174deg, var(--cream) 0%, #ffce57 28%, var(--yellow) 65%, var(--amber) 100%);
  color: var(--on-accent);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard), 0 0 0 1px var(--gold);
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: var(--fs-lg);
  letter-spacing: .03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out),
              filter var(--t-hover) ease;
}
@media (hover: hover) and (pointer: fine) {
  .ld-go:hover:not([disabled]) { filter: brightness(1.05); box-shadow: var(--shadow-lift), 0 0 0 1px var(--cream); }
}
.ld-go:active:not([disabled]) { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink), 0 0 0 1px var(--gold); }
.ld-go[disabled] { opacity: .4; cursor: not-allowed; transform: none; filter: none; }

/* Armed. The accent flips to scarlet, because the next press is the one that
   costs something. */
.ld-go[data-armed='1'] {
  background: linear-gradient(174deg, #ff8b85 0%, var(--red) 55%, #c22e28 100%);
  color: var(--text);
  box-shadow: var(--shadow-hard), 0 0 0 1px var(--red);
}

/* A queue line. Draggable, and operable from a keyboard -- a drag-only
   reorder is a control a keyboard user simply does not have. */
.ld-qitem {
  display: grid;
  grid-template-columns: auto 2.5rem 1fr auto auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent, var(--border));
}
/* On a phone the five tracks do not fit, and because the name column is the
   only `1fr` it is the one that gives way: at 390px it collapsed to about
   twenty pixels, so the row showed an ellipsis where the prize should be,
   under two buttons whose labels had wrapped to three lines each. Nothing
   overflowed, so no page-level probe saw it (L48 -- a box that shrinks
   obediently and destroys its contents is the commoner failure than one that
   refuses to shrink).

   The controls drop below the name instead of competing with it. Not a
   horizontal scroller (L49) because these are not a row of peers: the name is
   the content and the buttons act on it. */
@media (max-width: 30rem) {
  .ld-qitem { row-gap: var(--s-3); }
  .ld-qitem > :nth-child(4),
  .ld-qitem > :nth-child(5) {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.ld-qitem.is-current { border-color: var(--yellow); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 35%, transparent); }
.ld-qitem.is-dragging { opacity: .4; }
.ld-qitem__grip {
  color: var(--text-muted);
  cursor: grab;
  font-family: var(--font-mono);
  user-select: none;
}
.ld-qitem__index { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-muted); }

/* A thin progress bar for "n of m awarded". */
.ld-bar {
  position: relative;
  height: 8px;
  background: var(--input);
  border: 1px solid var(--border);
  overflow: hidden;
}
.ld-bar i {
  display: block;
  height: 100%;
  background: var(--yellow);
}

/* The fairness record: a monospace block that looks like a receipt, because
   that is what it is. */
.ld-receipt {
  padding: var(--s-4);
  background: var(--input);
  border: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.ld-receipt b { color: var(--cream); font-weight: 400; }

/* ═══════════════════════════════════════════════════════════════════════════
   MOTION SAFETY
   Reduced motion means fewer and gentler animations, not none: opacity and
   colour survive because they aid comprehension; movement does not.
   ═══════════════════════════════════════════════════════════════════════════ */

/* The one fade the lucky-draw stage falls back to under `reduce`. Opacity
   only: it interpolates like any other number, it fills like any other
   property, and it is the half of every beat below that aids comprehension
   rather than merely being exciting. */
@keyframes ld-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  /* ── The lucky-draw stage ──────────────────────────────────────────────────
     Every selector that sets an animation on the stage is listed again here,
     at the SAME specificity and LATER in the file, which is what makes these
     win (L29 -- a single-class utility cannot override a compound selector
     written for the same element, and quietly does nothing instead).

     The sequence itself also shortens: useSequence plays reducedBeats() rather
     than buildBeats(), so this is three beats and about a second and a half,
     not fifteen beats and twenty-three seconds. Both halves are needed. This
     one alone would leave a guest sitting through a twenty-three second
     slideshow of static frames; the JS one alone would leave the frames
     themselves flying in.

     The result still ARRIVES and still HOLDS for the full reveal span. Reduced
     motion is not reduced information, and somebody who asked for less
     movement needs exactly as long to read their own name. */

  /* Movement replaced by a fade. */
  .ld-stage[data-mode='online'] .ld-layer,
  .ld-stage[data-mode='warp'] .ld-layer,
  .ld-stage[data-mode='suspense'] .ld-layer,
  .ld-stage[data-mode='lock'] .ld-lock,
  .ld-stage[data-mode='countdown'] .ld-count b,
  .ld-stage[data-mode='burst'] .ld-burst,
  .ld-stage[data-mode='reveal'] .ld-winner,
  .ld-stage[data-mode='reveal'] .ld-winner__medal,
  .ld-stage[data-mode='reveal'] .ld-winner__eyebrow,
  .ld-stage[data-mode='reveal'] .ld-winner__name,
  .ld-stage[data-mode='reveal'] .ld-winner__meta,
  .ld-stage[data-mode='reveal'] .ld-winner__prize,
  .ld-stage[data-mode='reveal'] .ld-winner__sponsor,
  .ld-stage[data-mode='grid'] .ld-wcard {
    animation: ld-fade 260ms linear both;
    animation-delay: 0s;
  }

  /* Gone entirely: a rotating plate, two expanding rings, a light sweep, a
     camera shake, a filling bar, and the two INFINITE ones -- the scan beam
     and the code ticker -- which are the worst of the set, because an endless
     animation under `reduce` is the thing somebody turned the setting on to
     stop. */
  .ld-stage[data-mode='charge'] .ld-core,
  .ld-stage[data-mode='charge'] .ld-core svg,
  .ld-stage[data-mode='charge'] .ld-meter i,
  .ld-stage[data-mode='collision'] .ld-orb,
  /* `collision` is unreachable under reduce today, because reducedBeats()
     emits only online/lock/reveal — but the comment above claims EVERY
     animation-setting selector is listed here, and this was the one that was
     not. A claim that is true of 23 of 24 selectors is the kind that stops
     being checked (L29). */
  .ld-stage[data-mode='collision'] .ld-press,
  .ld-stage[data-mode='countdown'] .ld-count::before,
  .ld-stage[data-mode='countdown'] .ld-count::after,
  .ld-stage[data-mode='burst'] .ld-layer,
  .ld-stage[data-mode='burst'] .ld-sweep,
  .ld-stage[data-mode='reveal'] .ld-winner__shine,
  .ld-stage[data-mode='search'] .ld-ticker div,
  .ld-scanpanel.is-active .ld-beam {
    animation: none;
  }

  /* The charge plate and the meter still read as "charged" rather than sitting
     at their start values -- the animation is gone, so the resting state has
     to BE the finished state. */
  .ld-stage[data-mode='charge'] .ld-core { rotate: 45deg; opacity: 1; }
  .ld-stage[data-mode='charge'] .ld-core svg { rotate: -45deg; }
  .ld-scanpanel.is-active .ld-beam { opacity: 0; }

  /* The panels still change state, by colour and depth rather than by moving. */
  .ld-scanpanel { transition-property: opacity, box-shadow; }

  /* The sign-in cover does not render at all, which is a DIFFERENT answer from
     the one /home gives, deliberately. There the cover is a thing the visitor
     chooses to dismiss, so presence without motion still means something and
     the invitation keeps it. Here it is unrequested decoration in front of a
     form, carrying nothing the form does not already say -- so `reduce` gets
     the sign-in, immediately, and no hold either (--hq-hold is only ever set
     under `no-preference`, so there is nothing to unset).

     One `display: none` rather than switching each beat off: twelve keyframes
     would be twelve chances to miss one, and L29 is precisely the bug of
     disabling a family and leaving a variant running. */
  .sc-cover { display: none; }

  .hq-pill__dot { animation: none; }

  .hq-btn, .hq-btn-cream, .hq-btn-danger, .hq-tile, .hq-dots__dot {
    transition-property: background-color, border-color, color, box-shadow, filter, opacity;
  }
  .hq-btn:active, .hq-btn-cream:active, .hq-btn-danger:active, .hq-tile:hover {
    transform: none;
  }
  .hq-panel-win { transform: none; }

  /* The game layer's own moving parts. Listed individually rather than with a
     blanket `* { transition: none }`: colour and opacity changes still help,
     and L29 is exactly the failure of switching off ONE selector and missing
     its enhanced variant. .hq-toast and .hq-sheet keep their centring
     transform -- it is layout, not animation. */
  .hq-group > summary::before { transition: none; }

  /* The entrance keeps its fade and loses its movement, which is this file's
     standing rule rather than a special case. All THREE selectors are listed:
     L29 is exactly the bug of switching off one of a family and leaving its
     variant running, and `.hq-enter-wipe` in particular animates a transform
     that nothing above would have caught.

     Each is rewritten at the same specificity as its original and after it,
     so it wins on source order. `--hq-rise: 0` empties the translate out of
     the shared keyframe instead of re-declaring one, and the wipe is swapped
     onto that same now-movement-free keyframe. The stagger goes too: a
     sequence a reader cannot see the point of is just a slow page. */
  .hq-enter,
  .hq-enter-group > *,
  .hq-enter-wipe {
    --hq-rise: 0px;
    animation-name: hq-rise;
    animation-delay: 0s;
  }
}
