/* ==========================================================================
   Presentation system — standalone stylesheet.

   Used by the audience shell (audience.html) and reused as-is by the
   presenter console (presenter.html + presenter.css).

   BRAND — JE Advisory
   -------------------
   TOKEN AUTHORITY: the personal site's styles.css, specifically its :root block. Every
   colour, font, easing and gradient token below is mirrored verbatim from
   there. If this file and the personal site's styles.css :root ever disagree,
   the personal site's styles.css is right and this file is stale — fix this file. (Neither
   STYLE_GUIDE.md nor anything under _archive/ is normative; the guide is a
   description of styles.css, not its source.)

   The brand: oxblood on slate, shell type, Newsreader for everything
   readable, Zen Old Mincho ("twist") as the display accent, Lucida Console
   for labels/eyebrows/controls, and glacier as the quiet secondary accent.

   The site's own usage pattern, mirrored here:
     --serif  Newsreader        body copy AND headings (there is no sans)
     --twist  Zen Old Mincho    single accent words/glyphs, in oxblood-light
     --mono   Lucida Console    eyebrows, labels, chips, control buttons —
                                always uppercase with wide letter-spacing
   Content-bearing pills (answer options) follow the site's .chip pattern
   (serif, pill) rather than .btn, because they carry sentences, not labels.

   NOTE FOR MAINTAINERS: this stylesheet is deliberately standalone (it must
   render with no site bundle), so the tokens are MIRRORED from
   the personal site's styles.css rather than imported.

   FONTS: both brand faces are self-hosted from /assets/fonts/ and declared
   with @font-face immediately below — the same two files and the same
   font-display: swap that the personal site's styles.css uses. This is deliberate: the
   presentation runs in a venue, and a Google Fonts <link> in
   audience.html/presenter.html made the deck's typography depend on the
   venue's wifi at exactly the wrong moment. presenter.html loads this file
   too, so these declarations cover the console as well.

   TYPE SCALE
   ----------
   Slide typography is expressed as multiples of --su ("slide unit"), using
   fixed step ratios so the proportions are identical on every surface:

     step--1  0.83x    step-0  1x      step-1  1.20x
     step-2   1.62x    step-3  2.27x   step-4  3.19x    step-5  4.44x

   --su is what lets the same engine.js markup render as a projector
   headline, a faithful miniature inside the presenter's 1280x720 canvas,
   and a readable next-slide preview panel — with no duplicated markup:

     .audience-shell   --su: fluid, 15px -> 26px  (phone -> projector)
     .stage-*-inner    --su: 17px  (presenter's 1280x720 design canvas)
     .next-preview     --su: 14px  (presenter's readable NEXT panel)
   ========================================================================== */

/* Self-hosted brand faces — same files, weights and font-display as the
   @font-face block at the top of the personal site's styles.css. No network dependency
   beyond this origin. */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/newsreader-latin-62981321d9.woff2") format("woff2");
}
@font-face {
  font-family: "Zen Old Mincho";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/zen-old-mincho-latin-600.d1d3978d9b.woff2") format("woff2");
}

:root {
  /* --- palette (the personal site's styles.css :root) --------------------------------- */
  --slate: #0B0D0E;
  --slate-surface: #111619;
  --slate-raised: #171D20;
  --slate-line: #2D363B;
  --line-strong: #647078;
  --shell: #F6F4EF;
  --shell-soft: #D7D1C6;
  --oxblood: #9A3340;
  --oxblood-light: #C8606C;
  --glacier: #6FA8C6;
  --blue-deep: #315F78;
  --muted: #B9B4AA;
  --muted-dim: #7D8588;

  --bg-gradient-start: #0D1013;
  --bg-gradient-end: #08090A;
  --radial-glow-1: rgba(154, 51, 64, 0.10);
  --radial-glow-2: rgba(111, 168, 198, 0.07);
  --oxblood-glow: rgba(154, 51, 64, 0.32);
  --oxblood-wash: rgba(154, 51, 64, 0.18);
  --glacier-wash: rgba(111, 168, 198, 0.14);
  --surface: rgba(246, 244, 239, 0.035);
  --surface-strong: rgba(246, 244, 239, 0.06);
  --surface-glass: linear-gradient(180deg, rgba(246, 244, 239, 0.07), rgba(246, 244, 239, 0.025));
  --panel-ground: rgba(17, 22, 25, 0.9);

  /* The page/stage ground, reused by every surface that renders a slide. */
  --brand-ground:
    radial-gradient(circle at 50% 6%, var(--radial-glow-1), transparent 38%),
    radial-gradient(circle at 16% 88%, var(--radial-glow-2), transparent 30%),
    linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--slate) 52%, var(--bg-gradient-end) 100%);

  /* The one accent gradient allowed: oxblood -> shell. */
  --accent-rule: linear-gradient(90deg, transparent, var(--oxblood), var(--shell-soft));

  /* --- type ------------------------------------------------------------ */
  --serif: "Newsreader", Georgia, serif;
  --twist: "Zen Old Mincho", "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
  --mono: "Lucida Console", Consolas, "Andale Mono", monospace;

  --step--1: clamp(0.82rem, 0.79rem + 0.12vw, 0.9rem);
  --step-0: clamp(0.98rem, 0.94rem + 0.2vw, 1.08rem);
  --step-1: clamp(1.12rem, 1.04rem + 0.36vw, 1.3rem);
  --step-2: clamp(1.35rem, 1.18rem + 0.7vw, 1.75rem);

  /* --- spacing --------------------------------------------------------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --shadow-card: 0 10px 30px rgba(8, 9, 10, 0.55), inset 0 1px 0 rgba(246, 244, 239, 0.03);
  --shadow-glow: 0 0 0 1px rgba(154, 51, 64, 0.28), 0 24px 48px rgba(8, 9, 10, 0.6), 0 0 32px rgba(154, 51, 64, 0.12);

  /* --- motion ---------------------------------------------------------- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 180ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-base: 260ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-slow: 500ms cubic-bezier(0.22, 1, 0.36, 1);

  /* Default slide unit; every surface that renders a slide overrides it. */
  --su: 18px;
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Component rules below set display:flex/grid on elements that also get the
   `hidden` attribute (banners, chips, the popup), and an author rule always
   beats the UA sheet's [hidden] — so this has to be explicit, or "hidden"
   would not actually hide them. (Stepped reveals use `visibility` instead,
   further down, so the list's geometry stays fixed.) */
[hidden] { display: none !important; }

/* Screen-reader-only: visually hidden but still announced. Used for status
   text that has no on-page equivalent (e.g. "a new question opened"). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  color: var(--shell);
  font-family: var(--serif);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: -0.005em;
  background: var(--brand-ground);
  background-color: var(--slate);
  background-attachment: fixed;
  overflow-x: hidden;
}

a { color: inherit; }
::selection { color: var(--shell); background: var(--oxblood); }

/* Accessibility: never omit this. */
:focus-visible {
  outline: 2px solid var(--shell);
  outline-offset: 3px;
}

img { max-width: 100%; display: block; }

/* ==========================================================================
   SECTION BACKGROUNDS

   A deck can declare "sections" (see PRESENTATIONS.md and
   tools/validate-deck.mjs); each section names a `mood`, and engine.js's
   applySectionBackground() crossfades the page/stage ground to that mood as
   the talk moves from one act to the next. Every act of the talk gets its
   own atmosphere without leaving the brand.

   ONE BRAND, DIFFERENT WEATHER. A mood is nothing but the house ground with
   the two brand radial glows re-mixed and re-placed and the base gradient
   re-angled: oxblood rgba(154,51,64,*) high and warm, glacier
   rgba(111,168,198,*) low and cool, over the same
   bg-gradient-start -> slate -> bg-gradient-end ramp. No new hues, no new
   tokens, and every alpha stays at or under the 0.18 the site's own
   --radial-glow-1 sits beneath, so slide copy keeps the contrast it had.

     ember       oxblood-forward, glow high and centred (an opener, a close)
     ember-deep  oxblood-forward, glow low and tight (pressure, boundaries)
     dusk        neutral dark, both glows quiet
     drift-1..4  a four-step progression, oxblood receding as glacier gains
     frost       glacier-forward

   Two stacked layers do the crossfade: the incoming mood is painted on the
   idle layer and the two swap `is-active`, so opacity (which animates)
   carries the change instead of background-image (which does not). The
   fade runs on --transition-slow, i.e. the house curve. The
   prefers-reduced-motion block at the end of this file collapses it to an
   instant swap.
   ========================================================================== */
.section-bg {
  position: fixed;
  inset: 0;
  /* Behind everything the page paints, but still above the canvas, which is
     where body's own --brand-ground ends up (html has no background, so
     body's propagates to the canvas and nothing paints in between). */
  z-index: -1;
  pointer-events: none;
}

.section-bg-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-color: var(--slate);
  /* --transition-slow already carries the house easing (500ms + the curve),
     so it is the whole shorthand value. Appending var(--ease) here would
     make the declaration invalid and drop it silently. */
  transition: opacity var(--transition-slow);
}
.section-bg-layer.is-active { opacity: 1; }

.section-bg-layer[data-mood="ember"] {
  background:
    radial-gradient(circle at 50% 4%, rgba(154, 51, 64, 0.16), transparent 44%),
    radial-gradient(circle at 14% 92%, rgba(111, 168, 198, 0.05), transparent 26%),
    linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--slate) 52%, var(--bg-gradient-end) 100%);
}
.section-bg-layer[data-mood="ember-deep"] {
  background:
    radial-gradient(circle at 50% 96%, rgba(154, 51, 64, 0.17), transparent 46%),
    radial-gradient(circle at 88% 10%, rgba(111, 168, 198, 0.05), transparent 28%),
    linear-gradient(158deg, var(--bg-gradient-start) 0%, var(--slate) 52%, var(--bg-gradient-end) 100%);
}
.section-bg-layer[data-mood="dusk"] {
  background:
    radial-gradient(circle at 50% 6%, rgba(154, 51, 64, 0.07), transparent 36%),
    radial-gradient(circle at 16% 88%, rgba(111, 168, 198, 0.06), transparent 30%),
    linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--slate) 52%, var(--bg-gradient-end) 100%);
}
.section-bg-layer[data-mood="drift-1"] {
  background:
    radial-gradient(circle at 26% 8%, rgba(154, 51, 64, 0.14), transparent 42%),
    radial-gradient(circle at 84% 86%, rgba(111, 168, 198, 0.06), transparent 30%),
    linear-gradient(128deg, var(--bg-gradient-start) 0%, var(--slate) 52%, var(--bg-gradient-end) 100%);
}
.section-bg-layer[data-mood="drift-2"] {
  background:
    radial-gradient(circle at 34% 10%, rgba(154, 51, 64, 0.11), transparent 40%),
    radial-gradient(circle at 78% 82%, rgba(111, 168, 198, 0.09), transparent 34%),
    linear-gradient(140deg, var(--bg-gradient-start) 0%, var(--slate) 52%, var(--bg-gradient-end) 100%);
}
.section-bg-layer[data-mood="drift-3"] {
  background:
    radial-gradient(circle at 44% 12%, rgba(154, 51, 64, 0.08), transparent 38%),
    radial-gradient(circle at 70% 78%, rgba(111, 168, 198, 0.12), transparent 38%),
    linear-gradient(152deg, var(--bg-gradient-start) 0%, var(--slate) 52%, var(--bg-gradient-end) 100%);
}
.section-bg-layer[data-mood="drift-4"] {
  background:
    radial-gradient(circle at 56% 14%, rgba(154, 51, 64, 0.05), transparent 34%),
    radial-gradient(circle at 62% 74%, rgba(111, 168, 198, 0.15), transparent 42%),
    linear-gradient(164deg, var(--bg-gradient-start) 0%, var(--slate) 52%, var(--bg-gradient-end) 100%);
}
.section-bg-layer[data-mood="frost"] {
  background:
    radial-gradient(circle at 50% 92%, rgba(111, 168, 198, 0.16), transparent 46%),
    radial-gradient(circle at 18% 8%, rgba(154, 51, 64, 0.05), transparent 28%),
    linear-gradient(145deg, var(--bg-gradient-start) 0%, var(--slate) 52%, var(--bg-gradient-end) 100%);
}

/* ==========================================================================
   Motion — fadeInUp reveals, 70-80ms staggers, the house ease-out curve.
   Neutralised wholesale by the prefers-reduced-motion block at the end.
   ========================================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUpSmall {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ruleWipe {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes figureIn {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes popOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(10px) scale(0.99); }
}
@keyframes scrimIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------------------------------------------------------------------
   Buttons — the site's .btn: pill, Lucida Console, uppercase, wide
   tracking. .btn-primary is the site's .btn.primary (flat oxblood,
   oxblood-light border, inverting to slate-on-oxblood-light on hover).
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  min-height: 44px;
  padding: 0.8rem 1.15rem;
  border: 1px solid var(--slate-line);
  border-radius: var(--radius-pill);
  background: var(--slate-surface);
  color: var(--shell);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition-base), border-color var(--transition-base),
              background var(--transition-base), box-shadow var(--transition-base),
              color var(--transition-base), opacity var(--transition-base);
}
.btn:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--oxblood-light); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary,
.copy-btn {
  background: var(--oxblood);
  border-color: var(--oxblood-light);
  color: var(--shell);
  box-shadow: 0 10px 24px rgba(8, 9, 10, 0.45);
}
.btn-primary:hover:not(:disabled),
.copy-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--oxblood-light);
  color: var(--slate);
  box-shadow: var(--shadow-glow);
}
.copy-btn--done {
  background: var(--slate-raised);
  border-color: var(--line-strong);
  color: var(--shell);
}

/* ---------------------------------------------------------------------
   Audience shell
   --------------------------------------------------------------------- */
.audience-shell {
  --su: clamp(15px, 0.85vw + 9px, 26px);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* fallback for engines without dvh */
  min-height: 100dvh;
}
/* Grain sits above the gradient, below the slide content. */
.audience-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}
.audience-shell > * { position: relative; z-index: 1; }

/* Progress bar — the oxblood->shell accent gradient, the only gradient
   allowed on an accent. */
.progress-track {
  flex: none;
  height: 2px;
  background: rgba(246, 244, 239, 0.08);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent-rule);
  transition: width var(--transition-slow);
}

.audience-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) clamp(1rem, 4vw, var(--space-7));
  border-bottom: 1px solid var(--slate-line);
}

.audience-head-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
}

/* Eyebrow pattern — the site's .label. */
.deck-title {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-chip {
  flex: none;
  padding: 6px 13px;
  border: 1px solid var(--slate-line);
  border-radius: var(--radius-pill);
  background: var(--slate-surface);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-dim);
  white-space: nowrap;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.mode-chip[data-mode="live"] { color: var(--shell); border-color: var(--oxblood-light); background: var(--oxblood-wash); }
.mode-chip[data-mode="paused"] { color: var(--muted); }
.mode-chip[data-mode="self_paced"] { color: var(--shell-soft); border-color: var(--line-strong); }
.mode-chip[data-mode="ended"] { color: var(--muted-dim); }

/* ---------------------------------------------------------------------
   Sync banner — `kind` is a left-edge accent stripe, not a text-colour
   change, so banner text always stays shell/muted.
   --------------------------------------------------------------------- */
.sync-banner {
  padding: var(--space-3) clamp(1rem, 4vw, var(--space-7));
  background: var(--panel-ground);
  border-bottom: 1px solid var(--slate-line);
  border-left: 3px solid transparent;
  color: var(--muted);
  font-family: var(--serif);
  font-size: var(--step--1);
  letter-spacing: 0.01em;
  line-height: 1.5;
  text-align: center;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.sync-banner[hidden] { display: none; }
.sync-banner--info { border-left-color: var(--glacier); }
.sync-banner--warning { border-left-color: var(--oxblood); color: var(--shell); }
.sync-banner--ended { border-left-color: var(--shell-soft); color: var(--shell); }

/* ---------------------------------------------------------------------
   Privacy notice — shown once at QR-join / first load, before anyone can
   type anything into a question. Required by the interaction spec.
   --------------------------------------------------------------------- */
.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3) clamp(1rem, 4vw, var(--space-7));
  border-bottom: 1px solid var(--slate-line);
  border-left: 3px solid var(--glacier);
  background: var(--panel-ground);
  color: var(--muted);
  font-family: var(--serif);
  font-size: var(--step--1);
  line-height: 1.5;
  text-align: center;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.privacy-note[hidden] { display: none; }
.privacy-note .btn {
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  font-size: 0.72rem;
}

/* ==========================================================================
   Slide stage — shared by the audience view and every presenter surface.
   ========================================================================== */
.slide-container {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 4vw, var(--space-8)) clamp(1rem, 5vw, var(--space-8));
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* auto margins (not justify-content) centre the slide vertically WITHOUT
   clipping the top when the content is taller than the stage. */
.slide {
  width: 100%;
  max-width: calc(var(--su) * 52);
  margin: auto;
  animation: fadeInUp 0.8s var(--transition-base) both;
}
.slide--title { max-width: calc(var(--su) * 46); }
.slide--image,
.slide--embed,
.slide--resources,
.slide--visual { max-width: calc(var(--su) * 64); }

/* Per-slide backdrop variant (engine.js's SLIDE_BACKDROPS / the deck's
   "backdrop" field). Independent of a section's own mood: this is a single
   slide asking for a deeper, redder wash than whatever its act is already
   painting — used on the deck's "clippable" beats so a standalone video
   clip of that one slide reads as its own visual moment.

   Full-bleed on purpose: engine.js mirrors the attribute onto `container`
   itself (#slide-container on the audience shell, #stage-current-inner /
   #fullscreen-stage-inner on the presenter console, each print
   .print-slide) rather than onto the slide's own centred text column, so
   the wash covers the whole stage edge to edge instead of reading as a
   floating smudge behind the heading. Shape copies the title slide's
   existing bottom-anchored glow: a warm base tint over the whole stage
   plus a symmetric glow anchored to the bottom edge, present even behind
   the text column. Deliberately still a wash, not a block: shell text over
   it stays AA-readable. */
/* position/z-index: 0 gives every surface that can carry the attribute its
   own local stacking context, so the ::before's z-index: -1 below is
   scoped to sit behind that surface's own children and nothing further up
   the tree. On .slide-container (audience) nothing else sets position, so
   this is the only declaration; on #stage-current-inner / #fullscreen-
   stage-inner (presenter) presenter.css's own position: absolute loads
   after this file and wins on equal specificity, so this rule only ever
   contributes the z-index there — the canvas's own absolute positioning
   for its scale transform is untouched. */
[data-backdrop="ember"] { position: relative; z-index: 0; }
[data-backdrop="ember"]::before {
  content: "";
  /* inset: 0 on purpose — a negative inset here would extend past the
     container's own box and add to a scrollable ancestor's scrollHeight
     (.slide-container / .stage-current-inner are overflow-y: auto for
     dense slides), producing a phantom scrollbar with nothing new to see
     at the bottom. Staying flush keeps the wash out of scroll math. */
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 50% 100%, rgba(154, 51, 64, 0.38) 0%, rgba(154, 51, 64, 0.10) 55%, transparent 78%),
    linear-gradient(180deg, #140A0C 0%, #170B0E 100%);
}
/* The slide's own card-like surfaces (bullet items, spec/lane entries,
   prompt blocks — anything using the --surface tokens) sit on a neutral
   grey wash by default; on an ember backdrop that reads as ash-grey cards
   floating on a red ground. Warm the tokens locally so rows sit naturally
   on the new ground instead of clashing with it. */
[data-backdrop="ember"] {
  --surface: rgba(154, 51, 64, 0.10);
  --surface-strong: rgba(154, 51, 64, 0.16);
}
/* Ember slides print on plain white, like every other slide — a printed
   oxblood field is unreadable and a toner bill. */
@media print {
  [data-backdrop="ember"]::before { display: none !important; }
}

.slide-inner {
  display: flex;
  flex-direction: column;
  gap: calc(var(--su) * 1.15);
}

/* Heading rules from the site: Newsreader 500, tight leading, -0.02em,
   shell, text-wrap: balance. */
.slide-heading {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--shell);
  text-wrap: balance;
  overflow-wrap: break-word;
}

/* ---------------------------------------------------------------------
   STEPPED REVEALS

   Unrevealed fragments are hidden with `visibility`, not removed from the
   flow: the list's final geometry is therefore fixed from the first step,
   so an element that has landed NEVER moves again as later ones arrive.
   visibility:hidden also takes them out of the accessibility tree and out
   of tab order (engine.js adds aria-hidden as well).

   Two independent properties do two independent jobs, so they can animate
   at the same time without fighting:
     translate  the small rise each element makes as it appears in place
     transform  the hero travel — element one enters centred in the content
                area (engine.js sets translateY) and, on the next advance,
                the transform is dropped so it glides to its real position.
   The per-item entrance staggers are switched off here; in stepped mode
   the presenter's clicks provide the timing.
   --------------------------------------------------------------------- */
.slide.is-stepped [data-fragment] {
  animation: none;
  /* The --transition-* tokens ALREADY carry the house curve (duration + the
     cubic-bezier), so each one is a complete shorthand value on its own.
     Appending var(--ease) after them puts two easing functions in one
     transition, which is invalid — the whole declaration is then dropped and
     every reveal snaps instead of animating. Durations here are
     260ms / 260ms / 500ms on cubic-bezier(0.22, 1, 0.36, 1). */
  transition:
    opacity var(--transition-base),
    translate var(--transition-base),
    transform var(--transition-slow);
}
.slide.is-stepped [data-fragment][data-revealed="false"] {
  visibility: hidden;
  opacity: 0;
  translate: 0 14px;
  pointer-events: none;
}
.slide.is-stepped [data-fragment][data-revealed="true"] {
  visibility: visible;
  opacity: 1;
  translate: 0 0;
}

/* Decks that opt into stable fragment geometry reveal only with opacity.
   Every fragment occupies its final position from the first paint. */
.slide.slide--stable-fragments.is-stepped [data-fragment],
.slide.slide--stable-fragments.is-stepped [data-fragment][data-revealed="false"],
.slide.slide--stable-fragments.is-stepped [data-fragment][data-revealed="true"] {
  transform: none !important;
  translate: none !important;
  transition: opacity var(--transition-base);
}

/* Stable audience decks already reveal each card in its final geometry.
   Suppress the inherited whole-slide 24px lift as well: otherwise the card
   itself is stable while its ancestor still rises, recreating the rejected
   "starts in the middle" effect. Reveal Stage has its own motion system. */
.audience-shell .slide--stable-fragments.is-stepped { animation: none; }
/* Applied for exactly one frame while a freshly rendered slide (or a
   resize) is primed, so the hero appears already centred instead of
   animating into the centre. */
.slide.is-priming [data-fragment] { transition: none !important; }

/* ---------------------------------------------------------------------
   TITLE — one statement, nothing else competing with it.
   --------------------------------------------------------------------- */
.slide-title { gap: calc(var(--su) * 0.85); }

/* Eyebrow/kicker — the site's .kicker.label, with the accent rule under it. */
.slide-kicker {
  position: relative;
  align-self: flex-start;
  padding-bottom: calc(var(--su) * 0.6);
  font-family: var(--mono);
  font-weight: 400;
  font-size: max(0.7rem, calc(var(--su) * 0.66));
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--shell-soft);
  /* --transition-slow is 500ms + the house curve; adding var(--ease) after it
     would be a second easing function and drop the declaration. */
  animation: fadeInUpSmall var(--transition-slow) both;
}
.slide-kicker::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 72px;
  height: 2px;
  background: var(--accent-rule);
  transform-origin: left center;
  animation: ruleWipe 0.6s var(--ease) 140ms both;
}

.slide-title .slide-heading {
  font-size: calc(var(--su) * 4.44);
  font-weight: 500;
  line-height: 1;
  animation: fadeInUp 0.7s var(--ease) 70ms both;
}

.slide-subheading {
  max-width: 44ch;
  color: var(--muted);
  font-family: var(--serif);
  font-size: calc(var(--su) * 1.2);
  line-height: 1.55;
  animation: fadeInUp 0.7s var(--ease) 150ms both;
}

/* An optional small picture under the words — the closing slide's QR code.
   Sized to be scannable from the back of a room without competing with the
   statement above it, and left-aligned with the rest of the title stack. */
.slide-title-figure {
  display: flex;
  flex-direction: column;
  gap: calc(var(--su) * 0.4);
  align-items: flex-start;
  margin-top: calc(var(--su) * 0.6);
  animation: fadeInUp 0.7s var(--ease) 230ms both;
}

/* clamp(), not min(): a QR below roughly 9rem stops being scannable from a
   seat, so the floor is a hard floor even on a short viewport. The shell
   plate keeps the code dark-on-light — inverted QR codes fail on some
   Android scanners, so normal polarity is non-negotiable here. */
.slide-title-img {
  width: clamp(9rem, 26vh, 13rem);
  height: auto;
  border: 0;
  background: var(--shell, #F6F4EF);
  padding: 0.6rem;
  border-radius: 12px;
}

.slide-title-caption {
  max-width: 44ch;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: max(0.72rem, calc(var(--su) * 0.7));
  line-height: 1.6;
  letter-spacing: 0.04em;
}

/* Section headings (every non-title type). */
.slide-bullets .slide-heading,
.slide-image .slide-heading,
.slide-embed .slide-heading,
.slide-resources .slide-heading,
.slide-prompt .slide-heading,
.slide-exercise .slide-heading,
.slide-question-results .slide-heading,
.slide-visual .slide-heading {
  font-size: calc(var(--su) * 2.27);
}

/* ---------------------------------------------------------------------
   BULLETS — glass cards, one loud headline line with a quieter detail line
   beneath, the house oxblood->shell bullet dot, and a 70ms stagger.
   --------------------------------------------------------------------- */
.bullet-list {
  display: flex;
  flex-direction: column;
  gap: calc(var(--su) * 0.6);
  list-style: none;
}

.bullet-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: calc(var(--su) * 0.22);
  padding: calc(var(--su) * 0.85) calc(var(--su) * 1) calc(var(--su) * 0.9) calc(var(--su) * 2.4);
  border: 1px solid var(--slate-line);
  border-radius: var(--radius-lg);
  background: var(--surface-glass), var(--panel-ground);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: fadeInUp 0.7s var(--transition-base) both;
  backdrop-filter: blur(14px) saturate(0.9);
  -webkit-backdrop-filter: blur(14px) saturate(0.9);
}
/* The card highlight sweep. */
.bullet-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(246, 244, 239, 0.07), transparent 42%);
  opacity: 0.45;
  pointer-events: none;
}
/* 7px gradient bullet dot with an oxblood halo. */
.bullet-item::before {
  content: '';
  position: absolute;
  left: calc(var(--su) * 1.05);
  top: calc(var(--su) * 1.35);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--shell-soft), var(--oxblood));
  box-shadow: 0 0 0 4px rgba(154, 51, 64, 0.14);
}

.bullet-text {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-weight: 500;
  font-size: calc(var(--su) * 1.35);
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: var(--shell);
  text-wrap: balance;
}
.bullet-detail {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: max(14px, calc(var(--su) * 0.93));
  line-height: 1.55;
  color: var(--muted);
}

/* ---------------------------------------------------------------------
   BULLETS, "split" variant — two columns facing each other across an
   oxblood divider, for slides that are an opposition rather than a list.
   The divider carries the accent treatment; the right column mirrors its
   bullet dot and alignment so the two sides genuinely face each other.
   --------------------------------------------------------------------- */
.slide[data-slide-variant="split"] { max-width: calc(var(--su) * 64); }

.bullet-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  gap: calc(var(--su) * 1.15);
  align-items: start;
}

.bullet-split-rule {
  align-self: stretch;
  width: 1px;
  min-height: calc(var(--su) * 4);
  background: linear-gradient(180deg, transparent, var(--oxblood) 22%, var(--oxblood-light) 50%, var(--oxblood) 78%, transparent);
}

.bullet-col { min-width: 0; }

.bullet-col--right .bullet-item {
  padding: calc(var(--su) * 0.85) calc(var(--su) * 2.4) calc(var(--su) * 0.9) calc(var(--su) * 1);
  text-align: right;
  align-items: flex-end;
}
.bullet-col--right .bullet-item::before {
  left: auto;
  right: calc(var(--su) * 1.05);
  background: linear-gradient(135deg, var(--oxblood), var(--shell-soft));
}
.bullet-col--right .bullet-item::after {
  background: linear-gradient(225deg, rgba(246, 244, 239, 0.07), transparent 42%);
}

/* V3's stable deck uses editorial rows on every surface. This leaves the
   legacy deck's glass-card treatment intact while making the current deck's
   remaining true lists match the projector instead of becoming a second
   design system on audience phones. */
.slide--stable-fragments .bullet-item {
  border: 0;
  border-top: 1px solid rgba(246, 244, 239, 0.16);
  border-radius: 0;
  padding: calc(var(--su) * 0.68) calc(var(--su) * 0.7) calc(var(--su) * 0.72) calc(var(--su) * 2.7);
  background: linear-gradient(90deg, rgba(246, 244, 239, 0.035), transparent 74%);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.slide--stable-fragments .bullet-item::before {
  content: attr(data-fragment);
  top: calc(var(--su) * 0.78);
  left: calc(var(--su) * 0.72);
  width: auto;
  height: auto;
  border-radius: 0;
  color: rgba(246, 244, 239, 0.48);
  background: none;
  box-shadow: none;
  font: 500 calc(var(--su) * 0.68)/1 var(--mono);
  letter-spacing: 0.08em;
}
.slide--stable-fragments .bullet-item::after { display: none; }
.slide--stable-fragments .bullet-col--right .bullet-item {
  padding: calc(var(--su) * 0.68) calc(var(--su) * 2.7) calc(var(--su) * 0.72) calc(var(--su) * 0.7);
}
.slide--stable-fragments .bullet-col--right .bullet-item::before {
  right: calc(var(--su) * 0.72);
  left: auto;
}

/* Phone portrait: the columns stack, left group above right group, and the
   divider becomes the horizontal rule between them. */
@media (max-width: 768px) {
  .bullet-split { grid-template-columns: minmax(0, 1fr); gap: calc(var(--su) * 0.6); }
  .bullet-split-rule {
    width: 100%;
    height: 1px;
    min-height: 0;
    align-self: auto;
    margin: calc(var(--su) * 0.3) 0;
    background: linear-gradient(90deg, transparent, var(--oxblood) 22%, var(--oxblood-light) 50%, var(--oxblood) 78%, transparent);
  }
  .bullet-col--right .bullet-item {
    padding: calc(var(--su) * 0.85) calc(var(--su) * 1) calc(var(--su) * 0.9) calc(var(--su) * 2.4);
    text-align: left;
    align-items: stretch;
  }
  .bullet-col--right .bullet-item::before {
    left: calc(var(--su) * 1.05);
    right: auto;
  }
  .bullet-col--right .bullet-item::after {
    background: linear-gradient(135deg, rgba(246, 244, 239, 0.07), transparent 42%);
  }
  .slide--stable-fragments .bullet-col--right .bullet-item {
    padding: calc(var(--su) * 0.68) calc(var(--su) * 0.7) calc(var(--su) * 0.72) calc(var(--su) * 2.7);
    text-align: left;
    align-items: stretch;
  }
  .slide--stable-fragments .bullet-col--right .bullet-item::before {
    left: calc(var(--su) * 0.72);
    right: auto;
  }
}

/* workshop-start-v3: a plain "bullets" slide (no split variant — the
   items array is just the four exercises, so its own numbering stays
   1-4), turned into a two-column hero-left / list-right layout for this
   slide only. The heading (the "now we build yours" moment) and the
   bullet list are already adjacent siblings in source order, so a plain
   2-column grid with no explicit grid-column assignment puts the heading
   in column 1 and the list in column 2 with no markup change — and on
   phones the grid collapses back to one column, heading above list,
   because that's the same source order. */
.slide[data-slide-id="workshop-start-v3"] .slide-bullets {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: calc(var(--su) * 2);
  align-items: center;
}
.slide[data-slide-id="workshop-start-v3"] .slide-heading {
  font-size: calc(var(--su) * 3.1);
}
.slide[data-slide-id="workshop-start-v3"] .bullet-list {
  gap: calc(var(--su) * 0.45);
}
@media (max-width: 768px) {
  .slide[data-slide-id="workshop-start-v3"] .slide-bullets {
    grid-template-columns: minmax(0, 1fr);
    row-gap: calc(var(--su) * 0.9);
  }
  .slide[data-slide-id="workshop-start-v3"] .slide-heading {
    font-size: calc(var(--su) * 1.9);
  }
}

/* 70-80ms staggers. */
.bullet-item:nth-child(1)   { animation-delay: 70ms; }
.bullet-item:nth-child(2)   { animation-delay: 145ms; }
.bullet-item:nth-child(3)   { animation-delay: 220ms; }
.bullet-item:nth-child(4)   { animation-delay: 295ms; }
.bullet-item:nth-child(5)   { animation-delay: 370ms; }
.bullet-item:nth-child(6)   { animation-delay: 445ms; }
.bullet-item:nth-child(7)   { animation-delay: 510ms; }
.bullet-item:nth-child(n+8) { animation-delay: 570ms; }

/* ---------------------------------------------------------------------
   IMAGE / FIGURE — built for full-bleed local SVG diagrams as well as
   raster images. No frame, no card fill: the figure sits directly on the
   brand ground so a brand-drawn SVG reads as part of the slide.
   --------------------------------------------------------------------- */
.slide-image { gap: calc(var(--su) * 0.9); }

.slide-figure {
  display: flex;
  flex-direction: column;
  gap: calc(var(--su) * 0.65);
  align-items: center;
  width: 100%;
  animation: figureIn 0.7s var(--ease) 90ms both;
}

.slide-img {
  width: 100%;
  height: auto;
  max-height: min(62vh, 46rem);
  object-fit: contain;
  border: 0;
  background: transparent;
}
/* A figure slide with no heading gets the full stage height to itself. */
.slide-image > .slide-figure:only-child .slide-img { max-height: min(74vh, 52rem); }

.slide-caption {
  max-width: 66ch;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: max(0.72rem, calc(var(--su) * 0.7));
  line-height: 1.6;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Shown instead of .slide-img when a deck's "src" fails safeHref()'s
   allowlist (blocked, not just missing). */
.slide-img-blocked {
  display: block;
  width: 100%;
  padding: var(--space-6);
  border: 1px dashed var(--oxblood);
  border-radius: var(--radius-lg);
  background: var(--panel-ground);
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: var(--step--1);
  text-align: center;
}

/* ---------------------------------------------------------------------
   EMBED
   --------------------------------------------------------------------- */
.embed-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--slate-line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--slate-surface);
  box-shadow: var(--shadow-card);
  animation: figureIn 0.7s var(--ease) 90ms both;
}
.embed-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.embed-fallback.link-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 8rem;
  padding: var(--space-6);
  border: 1px solid var(--slate-line);
  border-radius: var(--radius-lg);
  background: var(--surface-glass), var(--panel-ground);
  box-shadow: var(--shadow-card);
  color: var(--shell);
  text-align: center;
  font-family: var(--serif);
  font-weight: 500;
  font-size: calc(var(--su) * 1.2);
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
  backdrop-filter: blur(14px) saturate(0.9);
  -webkit-backdrop-filter: blur(14px) saturate(0.9);
}
.embed-fallback.link-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--oxblood-light);
  box-shadow: var(--shadow-glow);
}

/* ---------------------------------------------------------------------
   RESOURCES — glass link cards with the house read-more arrow.
   --------------------------------------------------------------------- */
.resource-list {
  display: flex;
  flex-direction: column;
  gap: calc(var(--su) * 0.6);
  list-style: none;
}
@media (min-width: 680px) {
  .resource-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: calc(var(--su) * 0.55);
  }
}
.resource-item {
  position: relative;
  padding: calc(var(--su) * 0.75) calc(var(--su) * 0.95);
  border: 1px solid var(--slate-line);
  border-radius: var(--radius-lg);
  background: var(--surface-glass), var(--panel-ground);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
  animation: fadeInUp 0.7s var(--transition-base) both;
  backdrop-filter: blur(14px) saturate(0.9);
  -webkit-backdrop-filter: blur(14px) saturate(0.9);
}
.resource-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(246, 244, 239, 0.07), transparent 42%);
  opacity: 0.45;
  pointer-events: none;
}
.resource-item:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--oxblood-light);
  box-shadow: var(--shadow-glow);
}
.resource-item:nth-child(1)   { animation-delay: 70ms; }
.resource-item:nth-child(2)   { animation-delay: 145ms; }
.resource-item:nth-child(3)   { animation-delay: 220ms; }
.resource-item:nth-child(4)   { animation-delay: 295ms; }
.resource-item:nth-child(5)   { animation-delay: 370ms; }
.resource-item:nth-child(n+6) { animation-delay: 440ms; }

.resource-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  color: var(--shell);
  font-family: var(--serif);
  font-weight: 500;
  font-size: calc(var(--su) * 1.35);
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--oxblood-light);
  text-underline-offset: 0.2em;
  transition: color var(--transition-base), text-decoration-color var(--transition-base);
}
.resource-link::after {
  content: '\2192';
  text-decoration: none;
  transition: transform var(--transition-base);
}
.resource-item:hover .resource-link { color: var(--shell); text-decoration-color: var(--shell); }
.resource-item:hover .resource-link::after { transform: translateX(4px); }

.resource-description {
  position: relative;
  z-index: 1;
  margin-top: calc(var(--su) * 0.3);
  max-width: 66ch;
  color: var(--muted);
  font-family: var(--serif);
  font-size: max(14px, calc(var(--su) * 0.93));
  line-height: 1.55;
}

/* ---------------------------------------------------------------------
   PROMPT — the screenshot artifact. Raised-slate ground, Lucida Console,
   a labelled bar, and the Copy button welded across the bottom edge.
   --------------------------------------------------------------------- */
.prompt-instruction {
  max-width: 66ch;
  color: var(--muted);
  font-family: var(--serif);
  font-size: calc(var(--su) * 1.18);
  line-height: 1.6;
}

.prompt-block {
  --prompt-pad: calc(var(--su) * 1);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 1px solid var(--slate-line);
  border-radius: var(--radius-lg);
  background: var(--slate-raised);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: figureIn 0.7s var(--ease) 90ms both;
}
.prompt-block::before {
  content: 'PROMPT';
  display: block;
  padding: calc(var(--su) * 0.5) var(--prompt-pad);
  border-bottom: 1px solid var(--slate-line);
  background: var(--surface);
  color: var(--shell-soft);
  font-family: var(--mono);
  font-weight: 400;
  font-size: max(0.72rem, calc(var(--su) * 0.6));
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.prompt-text {
  margin: 0;
  padding: calc(var(--prompt-pad) * 1.15);
  max-height: 46vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: max(14px, calc(var(--su) * 0.9));
  /* Roomier than a code block: this is prose the room reads live, and the
     deck's own blank lines between numbered sections need enough line-
     height to read as a paragraph break, not just a slightly taller row. */
  line-height: 1.85;
  color: var(--shell);
  tab-size: 2;
}

/* Typographic hierarchy inside the prompt block (engine.js's
   buildPromptCode()): styling only, the exact same characters as
   slide.text, just wrapped so the room can scan a long prompt without
   reading every line at the same weight. */
.prompt-line-head {
  color: var(--oxblood-light);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.prompt-line-rule { color: var(--muted); }
.prompt-var {
  color: var(--glacier);
  font-style: italic;
}

.prompt-block .copy-btn {
  align-self: stretch;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-top: 1px solid var(--line-strong);
  border-radius: 0;
  box-shadow: none;
}
.prompt-block .copy-btn:hover:not(:disabled) { transform: none; }

/* ---------------------------------------------------------------------
   EXERCISE — glass card, numbered steps, the minutes shown as an oxblood
   timer pill, links as pill buttons.
   --------------------------------------------------------------------- */
.exercise-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: calc(var(--su) * 0.95);
  padding: calc(var(--su) * 1.35);
  border: 1px dashed var(--oxblood);
  border-radius: var(--radius-xl);
  background: var(--surface-glass), var(--panel-ground);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  backdrop-filter: blur(14px) saturate(0.9);
  -webkit-backdrop-filter: blur(14px) saturate(0.9);
}
.exercise-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(246, 244, 239, 0.07), transparent 42%);
  opacity: 0.45;
  pointer-events: none;
}
.exercise-card > * { position: relative; z-index: 1; }

.exercise-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.minutes-chip {
  flex: none;
  padding: calc(var(--su) * 0.34) calc(var(--su) * 0.85);
  border: 1px solid var(--oxblood-light);
  border-radius: var(--radius-pill);
  background: var(--oxblood);
  box-shadow: 0 10px 24px rgba(8, 9, 10, 0.45);
  color: var(--shell);
  font-family: var(--mono);
  font-weight: 400;
  font-size: max(0.72rem, calc(var(--su) * 0.7));
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.exercise-instruction {
  max-width: 66ch;
  color: var(--muted);
  font-family: var(--serif);
  font-size: calc(var(--su) * 1.18);
  line-height: 1.6;
}

.exercise-steps {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: calc(var(--su) * 0.6);
  padding: 0;
  list-style: none;
}
.exercise-steps li {
  counter-increment: step;
  position: relative;
  padding-left: calc(var(--su) * 2.5);
  min-height: calc(var(--su) * 1.8);
  font-family: var(--serif);
  font-weight: 400;
  font-size: calc(var(--su) * 1.18);
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--shell);
  animation: fadeInUpSmall 0.6s var(--transition-base) both;
}
.exercise-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--su) * 1.8);
  height: calc(var(--su) * 1.8);
  border: 1px solid var(--slate-line);
  border-radius: 50%;
  background: var(--oxblood-wash);
  color: var(--shell);
  font-family: var(--twist);
  font-weight: 600;
  font-size: max(0.8rem, calc(var(--su) * 0.88));
  line-height: 1;
}
.exercise-steps li:nth-child(1)   { animation-delay: 140ms; }
.exercise-steps li:nth-child(2)   { animation-delay: 215ms; }
.exercise-steps li:nth-child(3)   { animation-delay: 290ms; }
.exercise-steps li:nth-child(4)   { animation-delay: 365ms; }
.exercise-steps li:nth-child(n+5) { animation-delay: 430ms; }

.exercise-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  list-style: none;
  border-top: 1px solid var(--slate-line);
  padding-top: var(--space-4);
}
.exercise-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.65rem 1.15rem;
  border: 1px solid var(--slate-line);
  border-radius: var(--radius-pill);
  background: var(--slate-surface);
  color: var(--shell);
  font-family: var(--mono);
  font-weight: 400;
  font-size: max(0.7rem, calc(var(--su) * 0.68));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform var(--transition-base), background var(--transition-base), border-color var(--transition-base);
}
.exercise-links a:hover {
  transform: translateY(-2px);
  border-color: var(--oxblood-light);
}

.slide-unknown {
  padding: var(--space-6);
  border: 1px dashed var(--oxblood);
  border-radius: var(--radius-lg);
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: var(--step--1);
}

/* ---------------------------------------------------------------------
   Bottom nav
   --------------------------------------------------------------------- */
.audience-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  padding: var(--space-4);
  padding-bottom: max(var(--space-4), env(safe-area-inset-bottom));
  border-top: 1px solid var(--slate-line);
}
.nav-btn { min-width: 52px; padding: 0.8rem 1.15rem; font-size: 0.9rem; }
.slide-position {
  min-width: 8ch;
  text-align: center;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------
   Friendly / error pages (unknown slug, malformed deck, no slug, waiting)
   --------------------------------------------------------------------- */
.audience-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  max-width: 40rem;
  margin: auto;
  text-align: center;
  animation: fadeInUp 0.8s var(--transition-base) both;
}
.audience-message-title {
  font-family: var(--serif);
  font-size: calc(var(--su) * 2.27);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--shell);
  text-wrap: balance;
}
.audience-message-body {
  color: var(--muted);
  font-family: var(--serif);
  font-size: calc(var(--su) * 1.18);
  line-height: 1.65;
}
.audience-waiting .btn-primary { margin-top: var(--space-2); }

/* Presence-style pulsing dot on the waiting screen. */
@keyframes waitingPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1); }
}
.audience-waiting .audience-message-body::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.65em;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--shell-soft), var(--oxblood));
  box-shadow: 0 0 0 4px rgba(154, 51, 64, 0.14);
  animation: waitingPulse 2.4s ease-in-out infinite;
}

/* ---------------------------------------------------------------------
   Toast
   --------------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: clamp(1.5rem, 6vw, var(--space-7));
  transform: translate(-50%, 8px);
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--slate-line);
  border-radius: var(--radius-pill);
  background: var(--slate-surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  /* Above .q-scrim (60) and everything else that overlays the slide: the
     confirmation toast must be readable even while the question popup is
     open, or a phone answering a question never sees its own "saved" /
     "will send when reconnected" state. */
  z-index: 70;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.toast[hidden] { display: none; }
.toast--visible { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   INTERACTION LAYER
   Room-synced timer, "I'm stuck" signal, popup questions and their results.
   Born in the JE Advisory token set: oxblood is the emphasis, glacier is the
   quiet secondary state, shell is the type, slate is the ground.
   ========================================================================== */

/* ---------------------------------------------------------------------
   Exercise timer chip — glacier while there's time, oxblood-emphasised in
   the final minute so a glance across the room reads "wrap up".
   --------------------------------------------------------------------- */
.timer-chip {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  padding: 6px 13px;
  border: 1px solid var(--glacier);
  border-radius: var(--radius-pill);
  background: var(--glacier-wash);
  color: var(--shell);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.timer-chip[hidden] { display: none; }
.timer-chip .timer-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.timer-chip .timer-value { font-size: 0.86rem; }

@keyframes timerUrgent {
  0%, 100% { border-color: var(--oxblood-light); }
  50%      { border-color: var(--oxblood); }
}
.timer-chip[data-urgency="final"] {
  border-color: var(--oxblood-light);
  background: var(--oxblood);
  color: var(--shell);
  animation: timerUrgent 2s ease-in-out infinite;
}
.timer-chip[data-urgency="final"] .timer-label { color: var(--shell-soft); }
.timer-chip[data-urgency="done"] {
  border-color: var(--line-strong);
  background: var(--slate-surface);
  color: var(--muted);
  animation: none;
}

/* ---------------------------------------------------------------------
   "I'm stuck" — small, persistent, only while a timer runs. Latched state
   is oxblood so the presenter and the person both know it's raised.
   --------------------------------------------------------------------- */
.stuck-btn {
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}
.stuck-btn[hidden] { display: none; }
.stuck-btn[aria-pressed="true"] {
  background: var(--oxblood);
  border-color: var(--oxblood-light);
  color: var(--shell);
}

/* ---------------------------------------------------------------------
   Question popup — a modal card OVER the current slide. Never blocks deck
   navigation: the shell keeps its own keyboard handlers, and Escape
   dismisses the popup back to a re-openable pill.
   --------------------------------------------------------------------- */
.q-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, var(--space-6));
  padding-bottom: max(clamp(0.75rem, 3vw, var(--space-6)), env(safe-area-inset-bottom));
  background: rgba(8, 9, 10, 0.72);
  /* Token already carries the curve — see the note on .slide-kicker. */
  animation: scrimIn var(--transition-base) both;
}
.q-scrim[hidden] { display: none; }
@media (min-width: 720px) {
  .q-scrim { align-items: center; }
}

.q-card {
  position: relative;
  width: min(100%, 34rem);
  max-height: min(88vh, 46rem); /* fallback for engines without dvh */
  max-height: min(88dvh, 46rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: clamp(1.25rem, 4vw, 1.9rem);
  border: 1px solid var(--slate-line);
  border-radius: var(--radius-xl);
  background: var(--surface-glass), var(--panel-ground);
  box-shadow: var(--shadow-glow);
  overflow: hidden;
  animation: popIn 0.42s var(--ease) both;
  backdrop-filter: blur(14px) saturate(0.9);
  -webkit-backdrop-filter: blur(14px) saturate(0.9);
}
.q-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(246, 244, 239, 0.07), transparent 42%);
  opacity: 0.45;
  pointer-events: none;
}
.q-card > * { position: relative; z-index: 1; }
/* 260ms, matching the hide timeout in audience.html. Token carries the curve. */
.q-scrim.is-leaving .q-card { animation: popOut var(--transition-base) both; }

.q-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

/* Eyebrow above the question, with the accent rule. */
.q-eyebrow {
  position: relative;
  padding-bottom: var(--space-2);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--shell-soft);
}
.q-eyebrow::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 2px;
  background: var(--accent-rule);
}

.q-count {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.q-text {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.35rem, 1.1rem + 1.4vw, 1.95rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--shell);
  text-wrap: balance;
}

.q-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
  overflow-y: auto;
}

/* Choice options — the site's .chip pattern (serif in a pill), scaled up to
   a comfortable thumb target. Content, not a control label, so not mono. */
.q-choice {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--slate-line);
  border-radius: var(--radius-pill);
  background: var(--slate-surface);
  color: var(--shell);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.35;
  letter-spacing: -0.005em;
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition-base), border-color var(--transition-base),
              background var(--transition-base), color var(--transition-base);
}
.q-choice:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--oxblood-light); }
.q-choice:disabled { cursor: default; opacity: 0.55; }
.q-choice[aria-pressed="true"] {
  background: var(--oxblood);
  border-color: var(--oxblood-light);
  color: var(--shell);
  opacity: 1;
}

/* Free-text — the site's chat input treatment. */
.q-input {
  width: 100%;
  min-height: 56px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--slate);
  color: var(--shell);
  font-family: var(--serif);
  font-size: 16px; /* 16px keeps iOS from zooming the page on focus */
  line-height: 1.45;
  resize: vertical;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.q-input::placeholder { color: var(--muted-dim); }
.q-input:focus-visible {
  border-color: var(--oxblood-light);
  box-shadow: 0 0 0 4px rgba(154, 51, 64, 0.18);
}
textarea.q-input { min-height: 8.5rem; }

.q-hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted-dim);
  text-transform: uppercase;
}

.q-error {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--oxblood-light);
  border-radius: var(--radius-md);
  background: var(--oxblood-wash);
  color: var(--shell);
  font-family: var(--serif);
  font-size: var(--step--1);
  line-height: 1.5;
}
.q-error[hidden] { display: none; }

.q-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.q-actions .q-spacer { margin-right: auto; }

/* A small chip next to the LIVE chip that brings back a dismissed but still
   open question, so the popup never traps anyone and never sits over the slide. */
.q-reopen {
  flex: none;
  min-height: 0;
  padding: 6px 13px;
  border: 1px solid var(--oxblood-light);
  border-radius: var(--radius-pill);
  background: var(--oxblood);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--shell);
  white-space: nowrap;
}
.q-reopen[hidden] { display: none; }

/* ---------------------------------------------------------------------
   Dedicated room-results slide. It is intentionally a small data display,
   not a dashboard: one question, one status and one distribution per card.
   --------------------------------------------------------------------- */
.slide--question-results { max-width: calc(var(--su) * 64); }
.slide-question-results { gap: calc(var(--su) * 0.72); }

.results-subheading,
.results-interpretation {
  max-width: 70ch;
  color: var(--muted);
  font-family: var(--serif);
  font-size: calc(var(--su) * 0.99);
  line-height: 1.45;
}

/* ---------------------------------------------------------------------
   VISUAL STORY GRAMMAR

   Five layouts share one hierarchy and one mobile fallback. They are not
   dashboard cards: each expresses a relationship — sequence, evidence,
   boundary, decision or operating specification — that a plain list would
   hide. The same markup renders on audience, presenter and Reveal Stage.
   --------------------------------------------------------------------- */
.slide-visual { gap: calc(var(--su) * 0.78); }

.visual-intro,
.visual-footer {
  max-width: 76ch;
  color: var(--muted);
  font-family: var(--serif);
  font-size: calc(var(--su) * 0.97);
  line-height: 1.46;
}

.visual-footer {
  position: relative;
  padding: calc(var(--su) * 0.58) 0 0 calc(var(--su) * 0.92);
  border-top: 1px solid var(--slate-line);
  color: var(--shell-soft);
}
.visual-footer::before {
  content: '';
  position: absolute;
  left: 0;
  top: calc(var(--su) * 0.82);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--oxblood-light);
}

.visual-entry-label,
.visual-panel-label,
.visual-ledger-column {
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: max(0.72rem, calc(var(--su) * 0.52));
  line-height: 1.35;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.visual-entry-title {
  color: var(--shell);
  font-family: var(--serif);
  font-size: calc(var(--su) * 1.03);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.visual-entry-detail {
  color: var(--muted);
  font-family: var(--serif);
  font-size: max(0.72rem, calc(var(--su) * 0.75));
  line-height: 1.42;
}

/* Process: one continuous trail, numbered in reading order. */
.visual-process {
  display: grid;
  grid-template-columns: repeat(var(--visual-step-count, 5), minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--slate-line);
}
.visual-process-step {
  position: relative;
  min-width: 0;
  padding: calc(var(--su) * 1.55) calc(var(--su) * 0.72) calc(var(--su) * 0.78);
  border-right: 1px solid var(--slate-line);
}
.visual-process-step:last-child { border-right: 0; }
.visual-process-step::before {
  content: attr(data-step);
  position: absolute;
  left: calc(var(--su) * 0.72);
  top: calc(var(--su) * 0.5);
  color: var(--oxblood-light);
  font-family: var(--mono);
  font-size: max(0.7rem, calc(var(--su) * 0.58));
  letter-spacing: 0.08em;
}
.visual-process-step::after {
  content: '\2192';
  position: absolute;
  right: calc(var(--su) * -0.34);
  top: calc(var(--su) * 0.42);
  z-index: 2;
  color: var(--shell-soft);
  font-family: var(--mono);
  font-size: calc(var(--su) * 0.72);
}
.visual-process-step:last-child::after { display: none; }
.visual-process-step .visual-entry-title { margin-bottom: calc(var(--su) * 0.24); }
.visual-process-step[data-tone="stop"] { background: rgba(154, 51, 64, 0.1); }

/* Ledger: requirement, evidence and status remain aligned like a control
   record on stage, then stack with repeated labels on a phone. */
.visual-ledger {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--slate-line);
}
.visual-ledger-head,
.visual-ledger-row {
  display: grid;
  grid-template-columns: repeat(var(--ledger-columns, 3), minmax(0, 1fr));
}
.visual-ledger-head { background: rgba(246, 244, 239, 0.035); }
.visual-ledger-column,
.visual-ledger-cell { padding: calc(var(--su) * 0.48) calc(var(--su) * 0.68); }
.visual-ledger-row { border-top: 1px solid var(--slate-line); }
.visual-ledger-cell {
  min-width: 0;
  border-right: 1px solid var(--slate-line);
  color: var(--shell-soft);
  font-family: var(--serif);
  font-size: calc(var(--su) * 0.74);
  line-height: 1.35;
}
.visual-ledger-cell:last-child { border-right: 0; }
.visual-ledger-cell-label { display: none; }
.visual-ledger-row[data-status="supported"] .visual-ledger-cell:last-child,
.visual-ledger-row[data-status="verified"] .visual-ledger-cell:last-child { color: var(--glacier); }
.visual-ledger-row[data-status="gap"] .visual-ledger-cell:last-child,
.visual-ledger-row[data-status="stop"] .visual-ledger-cell:last-child { color: var(--oxblood-light); }

/* Boundary and decision: one rule, two sides. */
.visual-boundary,
.visual-lanes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(var(--su) * 1.15);
}
.visual-boundary-panel,
.visual-lane {
  position: relative;
  min-width: 0;
  padding: calc(var(--su) * 0.8) 0;
  border-top: 2px solid var(--slate-line);
  border-bottom: 1px solid var(--slate-line);
}
.visual-boundary-panel[data-boundary="inside"],
.visual-lane[data-tone="go"],
.visual-lane[data-tone="human"] { border-top-color: var(--glacier); }
.visual-boundary-panel[data-boundary="outside"],
.visual-lane[data-tone="stop"] { border-top-color: var(--oxblood-light); }
.visual-boundary-entry,
.visual-lane-entry {
  padding: calc(var(--su) * 0.55) 0;
  border-top: 1px solid rgba(100, 112, 120, 0.35);
}
.visual-panel-label + .visual-boundary-entry,
.visual-panel-label + .visual-lane-entry { margin-top: calc(var(--su) * 0.46); }
.visual-boundary-entry .visual-entry-title,
.visual-lane-entry .visual-entry-title { margin-bottom: calc(var(--su) * 0.12); }

/* Specification: a compact operating contract, not another bullet stack. */
.visual-specification {
  display: grid;
  grid-template-columns: repeat(var(--visual-spec-count, 5), minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--slate-line);
}
.visual-spec-item {
  position: relative;
  min-width: 0;
  padding: calc(var(--su) * 1.5) calc(var(--su) * 0.7) calc(var(--su) * 0.72);
  border-right: 1px solid var(--slate-line);
}
.visual-spec-item:last-child { border-right: 0; }
.visual-spec-item::before {
  content: attr(data-index);
  position: absolute;
  top: calc(var(--su) * 0.45);
  color: var(--oxblood-light);
  font-family: var(--mono);
  font-size: max(0.7rem, calc(var(--su) * 0.55));
  letter-spacing: 0.08em;
}
.visual-spec-item .visual-entry-title { margin-bottom: calc(var(--su) * 0.2); }

/* agent-capabilities-v3's six items read as six near-illegible slivers
   under the general one-row-per-count grid above; force a 2-row x
   3-column grid for this slide only, leaving 3-5 item specification
   slides (self-review-v3, worked-decision-v4) on the general rule. */
.slide[data-slide-id="agent-capabilities-v3"] .visual-specification {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.slide[data-slide-id="agent-capabilities-v3"] .visual-spec-item:nth-child(3) { border-right: 0; }

.question-results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(var(--su) * 0.7);
  align-items: stretch;
}

.question-result-card {
  min-width: 0;
  padding: calc(var(--su) * 0.78);
  border: 1px solid var(--slate-line);
  border-top-color: rgba(200, 96, 108, 0.72);
  border-radius: var(--radius-lg);
  background: var(--surface-glass), var(--panel-ground);
  box-shadow: var(--shadow-card);
}

.question-result-label {
  min-height: 2.5em;
  color: var(--shell);
  font-family: var(--serif);
  font-size: calc(var(--su) * 0.94);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.015em;
}

.question-result-status {
  margin: calc(var(--su) * 0.28) 0 calc(var(--su) * 0.55);
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: max(0.7rem, calc(var(--su) * 0.54));
  line-height: 1.35;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.question-result-body.q-results { gap: calc(var(--su) * 0.34); }
.question-result-body .q-bar-row { gap: 3px; }
.question-result-body .q-bar-head { gap: calc(var(--su) * 0.3); }
.question-result-body .q-bar-label {
  min-width: 0;
  font-size: max(0.72rem, calc(var(--su) * 0.66));
  line-height: 1.18;
}
.question-result-body .q-bar-value {
  font-size: max(0.7rem, calc(var(--su) * 0.48));
  letter-spacing: 0.035em;
}
.question-result-body .q-bar-track { height: max(7px, calc(var(--su) * 0.48)); }
.question-result-body .q-results-empty {
  padding: calc(var(--su) * 0.9) 0;
  font-size: max(0.7rem, calc(var(--su) * 0.5));
}

/* ---------------------------------------------------------------------
   Question popup results — three renderers, one machinery.
   --------------------------------------------------------------------- */
.q-results { display: flex; flex-direction: column; gap: var(--space-3); }

.q-results-empty {
  padding: var(--space-5) 0;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}

/* choice — animated horizontal bars, oxblood -> shell fill. */
.q-bar-row { display: flex; flex-direction: column; gap: 5px; }
.q-bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}
.q-bar-label {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.3;
  color: var(--shell);
}
.q-bar-value {
  flex: none;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.q-bar-track {
  height: 12px;
  border-radius: var(--radius-pill);
  background: var(--slate-surface);
  border: 1px solid var(--slate-line);
  overflow: hidden;
}
/* The fill is a full-width bar squashed with scaleX, so the gradient's
   oxblood->shell ramp is the same length whatever the percentage is (a
   width animation would compress the ramp instead of revealing it). JS
   paints scaleX(0) first, then the real ratio on the next frame, and the
   transition does the growing — no keyframe, so the inline transform is
   never overwritten by an animation fill. */
.q-bar-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--oxblood), var(--shell-soft));
  transition: transform var(--transition-slow);
}

/* cloud — frequency-weighted, shell type, oxblood-light + twist face for
   the top terms so the loudest answers read as the brand's accent word. */
/* Terms are sized in `em` (0.95em - 2.4em by frequency), so the same
   renderer produces a phone-sized cloud in the popup and a projector-sized
   one on the stage just by changing this base. */
.q-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35em 0.75em;
  padding: var(--space-3) 0;
  font-size: 1.05rem;
}
.q-cloud-term {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--muted);
  animation: fadeInUpSmall 0.5s var(--ease) both;
}
.q-cloud-term[data-rank="mid"] { color: var(--shell-soft); }
.q-cloud-term[data-rank="top"] {
  font-family: var(--twist);
  font-weight: 600;
  color: var(--oxblood-light);
}
.q-cloud-count {
  margin-left: 0.3em;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted-dim);
  vertical-align: super;
}

/* wall — a live feed of glass cards, newest first. */
.q-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: var(--space-3);
}
.q-wall-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--slate-line);
  border-radius: var(--radius-lg);
  background: var(--surface-glass), var(--panel-ground);
  box-shadow: var(--shadow-card);
  animation: fadeInUpSmall 0.5s var(--ease) both;
  backdrop-filter: blur(14px) saturate(0.9);
  -webkit-backdrop-filter: blur(14px) saturate(0.9);
}
.q-wall-text {
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--shell);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.q-wall-card[data-hidden="true"] { border-style: dashed; border-color: var(--oxblood); }
.q-wall-card[data-hidden="true"] .q-wall-text { color: var(--muted-dim); }
.q-wall-card .q-wall-actions { display: flex; justify-content: flex-end; }
.q-wall-card .btn { min-height: 32px; padding: 0.3rem 0.75rem; font-size: 0.72rem; }

/* The room-facing results view rendered over the slide stage. */
.q-stage-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
}
.q-stage-results .q-text { font-size: calc(var(--su) * 1.9); }
.q-stage-results .q-cloud { font-size: calc(var(--su) * 1.05); }
.q-stage-results .q-cloud-term { line-height: 1.1; }
.q-stage-results .q-bar-label { font-size: calc(var(--su) * 1.1); }
.q-stage-results .q-bar-track { height: calc(var(--su) * 0.9); }
.q-stage-results .q-wall-text { font-size: calc(var(--su) * 0.95); }
/* Presenter-only escape hatch: peek back at the slide without ending the
   question for the room. Only ever appended to the console's own "Now"
   stage (see renderQuestionStage()'s pair === currentPair guard), never
   the fullscreen mirror, so this never reaches the projector. */
.q-stage-back {
  align-self: flex-start;
  min-height: 36px;
  padding: 0.4rem 1rem;
  font-size: max(0.72rem, calc(var(--su) * 0.6));
}

/* ---------------------------------------------------------------------
   Phone portrait — must stay readable at 375px and below.
   --------------------------------------------------------------------- */
@media (max-width: 560px) {
  body { line-height: 1.62; }
  .slide-container { padding: var(--space-4) var(--space-4) var(--space-5); }
  .slide-title .slide-heading { font-size: calc(var(--su) * 3.3); }
  .slide-bullets .slide-heading,
  .slide-image .slide-heading,
  .slide-embed .slide-heading,
  .slide-resources .slide-heading,
  .slide-prompt .slide-heading,
  .slide-exercise .slide-heading,
  .slide-question-results .slide-heading,
  .slide-visual .slide-heading { font-size: calc(var(--su) * 1.9); }
  .question-results-grid { grid-template-columns: minmax(0, 1fr); }
  .question-result-label { min-height: 0; }
  .visual-process,
  .visual-specification { grid-template-columns: minmax(0, 1fr); }
  .visual-process-step,
  .visual-spec-item {
    padding: calc(var(--su) * 0.72) calc(var(--su) * 0.25) calc(var(--su) * 0.72) calc(var(--su) * 2.45);
    border-right: 0;
    border-top: 1px solid var(--slate-line);
  }
  .visual-process-step:first-child,
  .visual-spec-item:first-child { border-top: 0; }
  .visual-process-step::before,
  .visual-spec-item::before {
    left: calc(var(--su) * 0.25);
    top: calc(var(--su) * 0.78);
  }
  .visual-process-step::after {
    content: '\2193';
    left: calc(var(--su) * 0.72);
    right: auto;
    top: auto;
    bottom: calc(var(--su) * -0.42);
  }
  .visual-boundary,
  .visual-lanes { grid-template-columns: minmax(0, 1fr); gap: calc(var(--su) * 0.7); }
  .visual-ledger-head { display: none; }
  .visual-ledger-row { grid-template-columns: minmax(0, 1fr); padding: calc(var(--su) * 0.35) 0; }
  .visual-ledger-cell { border-right: 0; padding: calc(var(--su) * 0.3) calc(var(--su) * 0.2); }
  .visual-ledger-cell-label {
    display: block;
    margin-bottom: 2px;
    color: var(--muted-dim);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }
  .bullet-item {
    padding: calc(var(--su) * 0.75) calc(var(--su) * 0.85) calc(var(--su) * 0.8) calc(var(--su) * 2.2);
    border-radius: 18px;
  }
  .exercise-card { padding: calc(var(--su) * 1.05); border-radius: 20px; }
  .exercise-head { flex-direction: column; align-items: flex-start; }
  .exercise-links a { flex: 1 1 auto; justify-content: center; }
  .prompt-text { max-height: 42vh; }
  .slide-img { max-height: 54vh; }
  .slide-image > .slide-figure:only-child .slide-img { max-height: 64vh; }
  .audience-head { flex-wrap: wrap; gap: var(--space-2); }
  .q-card { max-height: 92vh; /* fallback for engines without dvh */ }
  .q-card { max-height: 92dvh; }
  .q-choice { font-size: 1rem; min-height: 52px; }
}

/* ==========================================================================
   PRINT / PDF HANDOUT
   Browser print-to-PDF, no library: one slide per page, figures included,
   speaker notes excluded (they're the presenter's). The audience page
   prints the whole deck by unhiding the print-only mirror it builds.
   ========================================================================== */
@media print {
  @page { size: A4 landscape; margin: 14mm; }

  html, body {
    background: #FFFFFF !important;
    color: #14181A !important;
    font-size: 11pt;
    min-height: 0;
  }

  /* The live shell keeps a full-viewport min-height even when all its
     children are hidden, which used to cost a blank first page and push
     every slide down. The print deck is its own element; hide the shell. */
  .audience-shell { display: none !important; }

  /* Live chrome and every interaction surface are screen-only. Section
     backgrounds go with them: the handout is ink on white paper, and a
     printed oxblood field would be both unreadable and a toner bill. */
  .section-bg,
  .audience-head,
  .audience-nav,
  .progress-track,
  .sync-banner,
  .privacy-note,
  .toast,
  .q-scrim,
  .q-reopen,
  .timer-chip,
  .stuck-btn,
  .slide-container,
  .audience-shell::before { display: none !important; }

  .print-deck { display: block !important; }

  .print-slide {
    --su: 13px;
    break-after: page;
    page-break-after: always;
    padding: 0;
    border: 0;
  }
  .print-slide:last-child { break-after: auto; page-break-after: auto; }

  .print-slide-num {
    font-family: var(--mono);
    font-size: 8pt;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6B7477;
    margin-bottom: 6mm;
  }

  /* Everything is revealed on paper, whatever the live fragment position:
     the print mirror is built once, eagerly, at reveal=all, so no
     [data-fragment] node inside .print-deck ever carries `hidden`. */

  .print-deck .slide { animation: none !important; margin: 0; max-width: none; }
  .print-deck .slide-heading,
  .print-deck .bullet-text,
  .print-deck .visual-entry-title,
  .print-deck .visual-ledger-cell-value,
  .print-deck .resource-link,
  .print-deck .audience-message-title { color: #14181A !important; }
  .print-deck .slide-subheading,
  .print-deck .results-subheading,
  .print-deck .results-interpretation,
  .print-deck .visual-intro,
  .print-deck .visual-entry-detail,
  .print-deck .visual-footer,
  .print-deck .bullet-detail,
  .print-deck .resource-description,
  .print-deck .exercise-instruction,
  .print-deck .prompt-instruction,
  .print-deck .slide-caption { color: #3F474A !important; }
  .print-deck .exercise-steps li { color: #14181A !important; }

  .print-deck .bullet-item,
  .print-deck .question-result-card,
  .print-deck .resource-item,
  .print-deck .exercise-card,
  .print-deck .embed-fallback.link-card {
    background: #FFFFFF !important;
    border: 1px solid #C9CDCE !important;
    box-shadow: none !important;
    animation: none !important;
    break-inside: avoid;
  }
  .print-deck .bullet-item::after,
  .print-deck .resource-item::after,
  .print-deck .exercise-card::before { display: none !important; }
  .print-deck .bullet-item::before { background: #9A3340 !important; box-shadow: none !important; }
  .print-deck .visual-process,
  .print-deck .visual-specification,
  .print-deck .visual-ledger,
  .print-deck .visual-ledger-row,
  .print-deck .visual-boundary-panel,
  .print-deck .visual-lane,
  .print-deck .visual-footer { border-color: #C9CDCE !important; }
  .print-deck .visual-entry-label,
  .print-deck .visual-panel-label,
  .print-deck .visual-ledger-column,
  .print-deck .visual-ledger-cell-label { color: #5C6568 !important; }
  .print-deck .question-result-label,
  .print-deck .question-result-body .q-bar-label { color: #14181A !important; }
  .print-deck .question-result-status,
  .print-deck .question-result-body .q-bar-value { color: #5C6568 !important; }
  .print-deck .question-result-body .q-bar-track { background: #E4E0D8 !important; }

  .print-deck .prompt-block {
    background: #F3F1EC !important;
    border: 1px solid #C9CDCE !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  .print-deck .prompt-block::before { background: #E6E2DA !important; color: #3F474A !important; }
  .print-deck .prompt-text { color: #14181A !important; max-height: none !important; overflow: visible !important; }
  /* The on-screen hierarchy colors (oxblood-light/muted/glacier) would read
     as low-contrast or distracting in print; fold every prompt span back
     to the same dark ink as the rest of the block. Bold on headers is the
     one distinction kept, since weight still prints fine. */
  .print-deck .prompt-line-head,
  .print-deck .prompt-line-rule,
  .print-deck .prompt-var { color: inherit !important; font-style: normal !important; }
  .print-deck .copy-btn { display: none !important; }

  .print-deck .minutes-chip,
  .print-deck .exercise-steps li::before {
    background: #9A3340 !important;
    color: #FFFFFF !important;
    border-color: #9A3340 !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Figure SVGs are drawn light-on-transparent for the dark stage; on white
     paper that washes out to nothing. Invert (with a hue-rotate to undo
     invert's hue flip on the oxblood accent) turns them dark-on-transparent
     so they read on the page, the same way the QR/caption colours above are
     corrected for print. Scoped to SVG figures only — this is the single
     correction layer for both tools/make-deck-pdf.mjs (which no longer does
     its own colour remap) and a manual browser Ctrl+P, and a future raster
     photo slide must not get negative-ized by it. */
  .print-deck .slide-img[src$=".svg"] {
    filter: invert(1) hue-rotate(180deg);
  }
  .print-deck .slide-img {
    max-height: 11cm !important;
  }
  /* The QR is dark-on-shell in normal polarity, so it prints as-is, no
     inversion, or the paper copy would become the unscannable variant. */
  .print-deck .slide-title-img {
    max-height: 5cm !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .print-deck .slide-title-caption { color: #3F474A !important; }
  .print-deck .embed-frame { display: none !important; }
  .print-deck .slide-kicker { color: #6B7477 !important; }
  .print-deck .slide-kicker::after { background: #9A3340 !important; }
}

/* The print mirror never shows on screen. */
.print-deck { display: none; }

/* ---------------------------------------------------------------------
   Morph transitions — the CSS half of engine.js's runSlideTransition().
   Once a deck sets "morphTransitions": true, document.startViewTransition()
   wraps EVERY direct slide-to-slide render, not just a pair the deck has
   tagged with a matching "morph" key (engine.js enforces the deck/browser/
   motion gates, not this file) — see the MORPH TRANSITIONS comment there.
   That leaves two things for this stylesheet to draw. The "root" group
   covers every navigation, tagged or not — everything that isn't a named
   morph target falls into this one implicit group, so it stands in for
   the plain slide cut with a fast, quiet cross-fade: not a hard cut, not
   a slideshow wipe. The deck's own named groups are the flourish: only
   the specific element the deck named (see decks/*.json's "morph" keys —
   currently "figure-diagram", "task-source-of-truth", "task-assess-job")
   gets its own group, and it gets a longer, more deliberate cross-fade so
   the eye reads it as the one thing the room was invited to watch, rather
   than just more of the same base fade.

   NEITHER ever animates width/height/position. The browser's default is
   to interpolate the group's box between the outgoing and incoming
   element's rects, which sounds like the "hero travel" this file used to
   promise — but two elements with genuinely different content (a
   one-line heading crossfading into a two-line one, say) don't share a
   box size, and the browser does not clip a snapshot to the box's
   CURRENT (still-animating) size. The result, confirmed by pausing an
   actual transition mid-flight against this deck's own tagged pairs: the
   incoming snapshot's own natural size pokes straight through the
   still-small box, so for a beat both the outgoing and incoming text sit
   on screen at once, double-exposed ("TEXT WARPING"). Freezing the group
   at its final rect and only ever cross-fading opacity sidesteps the bug
   outright — and costs nothing here, because this deck's own tagged
   pairs already sit at effectively the same on-screen rect on both
   slides. ::view-transition-old/new's own UA default (inline-size:100%;
   block-size:auto) already never stretches a snapshot to fit that frozen
   box; it just sizes to the snapshot's own aspect ratio.
   --------------------------------------------------------------------- */
::view-transition-group(*) {
  animation: none !important;
}

/* The base: every navigation gets this once the deck opts in. Short and
   understated on purpose — see the flourish override below for the
   deck's own tagged pairs. */
::view-transition-old(*),
::view-transition-new(*) {
  animation-duration: 180ms;
  animation-timing-function: var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

/* The flourish — literal names, not a pattern, because CSS has no way to
   match "every view-transition-name a deck happens to choose" short of
   listing them. A future deck's own tagged pair still gets a transition —
   the base rule above already covers it — it just reads as the same
   quiet fade as everything else until its name is added here too. */
::view-transition-old(figure-diagram),
::view-transition-new(figure-diagram),
::view-transition-old(task-source-of-truth),
::view-transition-new(task-source-of-truth),
::view-transition-old(task-assess-job),
::view-transition-new(task-assess-job) {
  animation-duration: 340ms;
}

/* ---------------------------------------------------------------------
   Reduced motion — one switch that neutralises every animation and
   transition above, including the presenter console's.
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Belt and braces: engine.js already refuses to call
     document.startViewTransition() at all under reduced motion, so this
     never fires in practice — but a stray transition must never animate. */
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
