/* =====================================================================
   Waybill — shared stylesheet
   One source of truth for tokens, chrome, scene grid, captions, elf.
   Per-scene CSS lives under `.scene[data-scene="..."] .demo` and only
   styles the *inside* of the demo column — never the grid itself.
   ===================================================================== */

:root {
  /* Color */
  --bg: #F5F3EE;
  --surface: #FFFFFF;
  --border: #E8E4DC;
  --border-strong: #D5CFC3;
  --text: #2E2A26;
  --text-secondary: #7A736C;
  --text-dim: #B8B1A8;
  --good: #2E8F52;
  --good-soft: #E4EFE3;
  --alert: #C4593B;
  --alert-soft: #F4E4DD;
  --accent: #C4593B;
  --elf: #1C1915;

  /* Chrome — heights physically equal the reserved space */
  --chrome-top: 72px;
  --chrome-left: 64px;

  /* Scene layout — one grid, every scene uses it.
     Upper clamps are tuned so on a 27" monitor (~3000px) the composition
     fills ~80% of the canvas instead of stranding a narrow centered column.
     Lower clamps preserve the laptop layout (1280-1440px wide). */
  --scene-pad-x: clamp(32px, 4vw, 200px);
  --scene-pad-y: clamp(24px, 3vh, 64px);
  --caption-col: clamp(280px, 24vw, 560px);
  --scene-gap:   clamp(48px, 6vw, 220px);
  --demo-col-max: clamp(640px, 60vw, 1480px);

  /* Fluid type — vw-driven with min/max anchors. Caption + body sizes scale
     up on big screens so text doesn't look small against larger demos.
     Mono labels stay small (12-13px max) since they're chrome, not content. */
  --fs-caption-title: clamp(22px, 2.1vw, 42px);
  --fs-caption-sub:   clamp(13px, 1.05vw, 18px);
  --fs-caption-kicker: clamp(10px, 0.8vw, 13px);
  --fs-body:          clamp(13px, 0.95vw, 17px);
  --fs-body-sm:       clamp(11px, 0.82vw, 15px);
  --fs-label:         clamp(10px, 0.76vw, 13px);
  --fs-mono-sm:       clamp(10px, 0.78vw, 13px);

  /* Radii / shadow */
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-card: 0 1px 2px rgba(30,25,20,0.04), 0 8px 24px -12px rgba(30,25,20,0.08);
  --shadow-lift: 0 2px 4px rgba(30,25,20,0.05), 0 18px 40px -18px rgba(30,25,20,0.18);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Mobile gate ----------
   Hides the entire desktop experience below 900px and shows a calm notice.
   Pure CSS — fires before any JS runs, so no flash of broken content.
   Reversing this is a one-block delete. */

.mobile-notice { display: none; }

@media (max-width: 899px) {
  /* Hide every direct child of body except the notice */
  body > *:not(.mobile-notice) { display: none !important; }

  /* Also kill the cursor-none rule the desktop page applies, so the
     visitor's normal cursor / touch behaviour is restored */
  body { cursor: auto !important; }

  .mobile-notice {
    display: flex;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--bg, #F5F3EE);
    color: var(--text, #2E2A26);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    text-align: center;
    z-index: 9999;
  }

  .mobile-notice-inner {
    max-width: 320px;
  }

  .mobile-notice .wordmark {
    font-family: 'Fraunces', 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-size: 56px;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text, #2E2A26);
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
    margin-bottom: 32px;
  }
  .mobile-notice .wordmark .baseline {
    position: absolute;
    left: 0; right: 0;
    bottom: 2px; height: 1px;
    background: var(--text, #2E2A26);
  }

  .mobile-notice-message {
    font-size: 17px;
    line-height: 1.5;
    color: var(--text, #2E2A26);
    margin: 0 0 12px;
  }

  .mobile-notice-hint {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary, #7A736C);
    margin: 0;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  /* Scroll length — opening hero (78vh) + scene timeline (960vh) */
  min-height: 1038vh;
  cursor: none;
  overflow-x: hidden;
}

/* =====================================================================
   Chrome — top horizontal stage tracker + left vertical scene rail
   ===================================================================== */

.chrome-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--chrome-top);
  z-index: 40;
  background: rgba(245,243,238,0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 clamp(24px, 3vw, 40px) 0 calc(var(--chrome-left) + clamp(16px, 2vw, 32px));
  gap: clamp(16px, 2vw, 28px);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
}

.chrome-top .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: clamp(16px, 2vw, 24px);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.chrome-top .brand .wordmark {
  font-family: 'Fraunces', 'Times New Roman', ui-serif, serif;
  font-weight: 300;
  font-style: normal;
  /* Force high optical-size so the small header matches the hero's fine terminals. */
  font-variation-settings: "opsz" 144;
  font-size: clamp(19px, 1.5vw, 22px);
  letter-spacing: -0.02em;
  color: var(--text);
  position: relative;
  display: inline-block;
  padding-bottom: 0;
}
.chrome-top .brand .wordmark .baseline {
  display: none;
}

.stages {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.8vw, 12px);
  flex: 1;
  min-width: 0;
}
.stage-item {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.8vw, 10px);
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  flex-shrink: 1;
  min-width: 0;
  transition: background 0.4s var(--ease);
}
.stage-item .icon {
  width: 26px; height: 26px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-dim);
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
.stage-item .icon svg { width: 15px; height: 15px; }
.stage-item .label {
  font-size: var(--fs-label);
  letter-spacing: 0.01em;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.4s var(--ease);
}
.stage-item.active .icon { background: var(--text); color: var(--bg); }
.stage-item.active .label { color: var(--text); font-weight: 500; }
.stage-item.done .icon { background: var(--good); color: #fff; }
.stage-item.done .label { color: var(--text-secondary); }

.stage-arrow {
  width: 14px; height: 1px;
  background: var(--border);
  flex-shrink: 0;
}

/* Left rail — quiet vertical progress column.
   Shows numbered ticks + a filling progress line, no overlapping labels.
   Full label only revealed as a left-anchored hover tooltip. */
.chrome-left {
  position: fixed;
  top: var(--chrome-top);
  left: 0; bottom: 0;
  width: var(--chrome-left);
  z-index: 39;
  background: rgba(245,243,238,0.5);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
}
.chrome-left .rail-title {
  position: absolute;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
.chrome-left .rail-title::after {
  content: "";
  display: block;
  width: 18px;
  height: 1px;
  background: var(--border-strong);
  margin: 8px auto 0;
}
/* Footer count at the bottom of rail, e.g. "03/09" */
.chrome-left .rail-count {
  position: absolute;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chrome-left .rail-count .cur { color: var(--text); }
.chrome-left .rail-count::before {
  content: "";
  display: block;
  width: 18px;
  height: 1px;
  background: var(--border-strong);
  margin: 0 auto 8px;
}

.rail-track {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 1.6vh, 22px);
  padding: 20px 0;
}
/* The dim background line */
.rail-track::before {
  content: '';
  position: absolute;
  top: 26px; bottom: 26px;
  left: 50%; transform: translateX(-50%);
  width: 1px;
  background: var(--border);
}
/* The filled progress line, height set via JS */
.rail-track::after {
  content: '';
  position: absolute;
  top: 26px;
  left: 50%; transform: translateX(-50%);
  width: 1px;
  height: var(--rail-progress, 0%);
  background: var(--text);
  transition: height 0.25s linear;
}

.rail-step {
  position: relative;
  width: 28px; height: 22px;
  display: grid;
  grid-template-columns: 14px 1fr;
  align-items: center;
  justify-items: start;
  gap: 6px;
  z-index: 1;
  cursor: none;
}
.rail-step .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  transition: all 0.35s var(--ease);
  justify-self: center;
  grid-column: 1;
}
/* The 01 02 03 ... counter sits quietly to the right of each tick. */
.rail-step .num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  opacity: 0.55;
  transition: opacity 0.25s var(--ease), color 0.25s var(--ease);
  grid-column: 2;
  white-space: nowrap;
}
/* Full label only as a hover-revealed tooltip tucked to the LEFT of the rail,
   floating over a subtle cream chip. Never overlaps scene captions. */
.rail-step .label {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 5px 10px;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.25s var(--ease);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  z-index: 5;
}
.rail-step:hover .label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.rail-step:hover .num { opacity: 1; color: var(--text); }

/* Done state: completed step */
.rail-step.done .dot { background: var(--text); border-color: var(--text); }
.rail-step.done .num { opacity: 0.75; color: var(--text-secondary); }

/* Live state: the current scene — hollow ring with accent fill, no pulse-halo
   (the halo was visually loud and drew attention to the rail). */
.rail-step.live .dot {
  width: 9px; height: 9px;
  background: var(--accent);
  border-color: var(--accent);
}
.rail-step.live .num {
  opacity: 1;
  color: var(--text);
  font-weight: 500;
}

/* Chrome fades during the closing section */
body.closing-mode .chrome-top { opacity: 0; pointer-events: none; transform: translateY(-100%); }
body.closing-mode .chrome-left { opacity: 0; pointer-events: none; transform: translateX(-100%); }

/* Closing section hands control back to the user — hide the waybill cursor,
   restore the native pointer everywhere. */
body.closing-mode .elf-wrap { opacity: 0; pointer-events: none; }
body.closing-mode,
body.closing-mode a,
body.closing-mode button,
body.closing-mode input,
body.closing-mode textarea,
body.closing-mode select { cursor: auto; }
body.closing-mode a,
body.closing-mode button,
body.closing-mode .closing .waitlist button { cursor: pointer; }
body.closing-mode input,
body.closing-mode textarea { cursor: text; }

/* =====================================================================
   Scene canvas + grid
   Every scene plugs into this grid. No per-scene overrides.
   ===================================================================== */

.scene-canvas {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10;
  transition: opacity 0.5s var(--ease);
}

.scene {
  position: absolute;
  top: var(--chrome-top);
  left: var(--chrome-left);
  right: 0;
  bottom: 0;
  padding: var(--scene-pad-y) var(--scene-pad-x);
  display: grid;
  grid-template-columns: var(--caption-col) var(--scene-gap) 1fr;
  grid-template-rows: 1fr;
  align-items: center;
  justify-items: start;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
  overflow: hidden; /* never let a scene grow beyond the viewport cell */
}
.scene.active {
  opacity: 1;
  pointer-events: auto;
}
.scene > .caption {
  grid-column: 1;
  grid-row: 1;
  align-self: start; /* consistent vertical anchor across every scene */
  padding-top: clamp(120px, 22vh, 320px);
}
.scene > .demo    {
  grid-column: 3;
  grid-row: 1;
  max-width: var(--demo-col-max);
  width: 100%;
  justify-self: start;
  align-self: center;
  /* Cap visual height so every scene is uniform. Demos that are natively
     taller than this scale down via transform (applied per-scene below). */
  max-height: calc(100vh - var(--chrome-top) - var(--scene-pad-y) * 2 - 32px);
  min-height: 0;
  overflow: hidden; /* last-resort clip so overflow never escapes the scene cell */
  /* Round the clip so inner cards' rounded corners aren't sheared off flat. */
  border-radius: var(--radius);
}

/* Skeleton placeholder — visible during Step 1 before scene content ships */
.demo-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 66vh;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(135deg,
      transparent 0, transparent 14px,
      rgba(184,177,168,0.08) 14px, rgba(184,177,168,0.08) 15px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* =====================================================================
   Caption — editorial two-line with kicker + state dot
   ===================================================================== */

.caption {
  max-width: clamp(320px, 26vw, 540px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s var(--ease), transform 0.55s var(--ease);
}
/* Captions show whenever their scene is active (Step 1 default);
   individual scenes may override with scroll-driven show/hide later. */
.scene.active > .caption { opacity: 1; transform: translateY(0); }
.caption.show {
  opacity: 1;
  transform: translateY(0);
}
.caption .kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--fs-caption-kicker);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.caption .kicker .state-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(46,143,82,0.18);
  animation: dotPulse 2.6s ease-in-out infinite;
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.caption.alert .kicker .state-dot {
  background: var(--alert);
  box-shadow: 0 0 0 4px rgba(196,89,59,0.18);
  animation: dotPulse 2.6s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(46,143,82,0.14); }
  50%      { box-shadow: 0 0 0 7px rgba(46,143,82,0.06); }
}
.caption.alert .kicker .state-dot {
  animation-name: dotPulseAlert;
}
@keyframes dotPulseAlert {
  0%, 100% { box-shadow: 0 0 0 4px rgba(196,89,59,0.16); }
  50%      { box-shadow: 0 0 0 7px rgba(196,89,59,0.06); }
}

.caption .title {
  font-size: var(--fs-caption-title);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--text);
  text-wrap: pretty;
  margin-bottom: 10px;
}
.caption .title em {
  font-style: normal;
  color: var(--accent);
}
.caption .sub {
  font-size: var(--fs-caption-sub);
  color: var(--text-secondary);
  line-height: 1.5;
  text-wrap: pretty;
}
.caption .sub b {
  color: var(--text);
  font-weight: 500;
}

/* =====================================================================
   Elf cursor — ONE element at document root
   ===================================================================== */

.elf-wrap {
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(50vw, 50vh, 0);
  transition: opacity 0.45s var(--ease);
}
.elf-cursor {
  position: absolute;
  left: -2px; top: -2px;
  width: 24px; height: 26px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.22));
  transform-origin: 3px 3px;
  will-change: transform;
}
.elf-cursor svg {
  width: 100%; height: 100%;
  display: block;
}
.elf-wrap.clicking .elf-cursor { animation: elfClick 0.34s var(--ease); }
@keyframes elfClick {
  0%   { transform: scale(1); }
  50%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}

/* Agent label pill — trails the cursor, identifies the agent as Waybill */
.elf-label {
  position: absolute;
  left: 14px;
  top: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  /* Warm cream — the only non-monochrome surface in the hero. Travels with
     the cursor; intentionally subtle so it never competes with scene 5's
     accent (where colour is the event, not the texture). */
  background: #EFE7D6;
  border: 1px solid #E0D8C4;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(30, 25, 20, 0.05);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.01em;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.elf-label-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good, #2E8F52);
  box-shadow: 0 0 0 3px rgba(46, 143, 82, 0.18);
  animation: elfLabelDot 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes elfLabelDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(46,143,82,0.18); }
  50%      { box-shadow: 0 0 0 5px rgba(46,143,82,0.26); }
}
.elf-label-text {
  letter-spacing: 0.02em;
}
/* Subtle squeeze on click — same rhythm as cursor */
.elf-wrap.clicking .elf-label { transform: scale(0.94); }
/* Alert/warning mode switches the dot to the accent rust */
.elf-wrap.alert .elf-label-dot {
  background: var(--accent, #C9622E);
  box-shadow: 0 0 0 3px rgba(196,89,59,0.18);
  animation: none;
}

/* Hide the native cursor on interactive elements too */
a, button, input, textarea, select { cursor: none; }

/* =====================================================================
   Closing section
   ===================================================================== */

/* =====================================================================
   Closing — editorial outro. Full-bleed cream canvas, large editorial
   typesetting, hand-set wordmark, subtle beat constellation, clean waitlist.
   Everything fades + lifts in sequence when `.closing.visible` is set.
   ===================================================================== */

.closing {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto 1fr auto;
  /* Vertical padding is vh-driven so it shrinks on short laptops and grows
     on tall monitors — always proportional to the canvas. */
  padding: clamp(14px, 2.4vh, 48px) clamp(32px, 6vw, 104px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s var(--ease);
  background:
    radial-gradient(80% 60% at 50% 110%, rgba(196,89,59,0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  /* No scroll. The composition is engineered to fit one viewport at every
     size — every vertical element below is clamped against vh. */
  overflow: hidden;
}
.closing.visible {
  opacity: 1;
  pointer-events: auto;
}

/* --- Dateline row at the top --- */
.closing .dateline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.7s var(--ease) 0.05s, transform 0.7s var(--ease) 0.05s;
}
.closing.visible .dateline { opacity: 1; transform: none; }
.closing .dateline .left,
.closing .dateline .right {
  display: flex;
  gap: 18px;
  align-items: center;
}

/* --- Central column: wordmark + tagline + waitlist --- */
.closing .inner {
  display: grid;
  grid-template-rows: auto auto auto auto;
  justify-items: center;
  align-content: center;
  text-align: center;
  gap: clamp(6px, 1.2vh, 22px);
  padding: clamp(8px, 2vh, 36px) 0;
  position: relative;
  min-height: 0; /* allow grid item to shrink below content size if needed */
}

/* Beat constellation — 9 silhouettes in a row, ends in ✓. Tiny. Subtle. */
.closing .beats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.6vw, 22px);
  margin-bottom: clamp(2px, 1vh, 16px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.7s var(--ease) 0.15s, transform 0.9s var(--ease) 0.15s;
}
.closing.visible .beats { opacity: 1; transform: none; }
.closing .beats .beat {
  width: clamp(14px, 2.2vh, 24px); height: clamp(14px, 2.2vh, 24px);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  transition: color 0.35s var(--ease), transform 0.35s var(--ease);
}
.closing .beats .beat svg { width: 100%; height: 100%; display: block; fill: currentColor; }
.closing .beats .rule {
  flex: 0 0 auto;
  width: clamp(14px, 2vw, 28px);
  height: 1px;
  background: var(--border-strong);
}
.closing .beats .tick {
  width: clamp(18px, 2.6vh, 28px); height: clamp(18px, 2.6vh, 28px);
  border-radius: 50%;
  background: var(--good-soft);
  color: var(--good);
  display: grid;
  place-items: center;
  font-size: 12px;
}

/* Waybill wordmark — large, confident, with a thin rule that IS the waybill.
   Sized off min(vw,vh) so it grows with the canvas on tall/wide monitors and
   shrinks on a short laptop, keeping the whole composition in one viewport. */
.closing .wordmark {
  position: relative;
  font-family: 'Fraunces', 'Times New Roman', ui-serif, serif;
  font-weight: 300;
  font-style: normal;
  font-variation-settings: "opsz" 144;
  font-size: clamp(48px, min(10vw, 13vh), 200px);
  letter-spacing: -0.035em;
  line-height: 0.95;
  color: var(--text);
  padding: 0 0.12em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s var(--ease) 0.28s, transform 1.1s var(--ease) 0.28s;
}
.closing.visible .wordmark { opacity: 1; transform: none; }

/* The waybill rule: a thin line under the wordmark with a small sun rising above the 'o'. */
.closing .wordmark::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.18em;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.4s var(--ease) 0.5s;
}
.closing.visible .wordmark::after { transform: scaleX(1); }

/* Wrapper around the 'i' in the wordmark so the orange dot can be positioned
   relative to that single glyph and cover (replace) the natural i-tittle. */
.closing .wordmark .i-glyph {
  position: relative;
  display: inline-block;
}
.closing .wordmark .sun {
  position: absolute;
  left: 61%;
  top: 0.26em;          /* covers the natural i-tittle exactly */
  width: 0.10em;
  height: 0.10em;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%) scale(0);
  transform-origin: center;
  transition: transform 0.7s var(--ease) 1.35s;
  box-shadow: 0 0 0 0.04em rgba(196,89,59,0.16);
}
.closing.visible .wordmark .sun { transform: translate(-50%, -50%) scale(1); }

/* Tagline — Instrument Serif italic. Narrow, editorial, not calligraphic. */
.closing .positioning {
  font-family: 'Instrument Serif', 'Times New Roman', ui-serif, serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(20px, min(2.6vw, 4vh), 52px);
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--text);
  max-width: 20ch;
  text-wrap: balance;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s var(--ease) 0.5s, transform 0.9s var(--ease) 0.5s;
  margin-top: clamp(2px, 0.8vh, 14px);
}
.closing.visible .positioning { opacity: 1; transform: none; }
.closing .positioning em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

/* Sub-copy — small, dim, one tight line */
.closing .sub-copy {
  font-family: 'Inter', sans-serif;
  font-size: clamp(12px, min(1.05vw, 1.7vh), 17px);
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 46ch;
  text-wrap: pretty;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s var(--ease) 0.7s, transform 0.9s var(--ease) 0.7s;
}
.closing.visible .sub-copy { opacity: 1; transform: none; }

/* Waitlist — single pill, mono input, arrow button. Keep it honest. */
.closing .waitlist {
  display: flex;
  align-items: center;
  gap: 0;
  width: min(460px, 90vw);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: clamp(3px, 0.6vh, 6px) 6px clamp(3px, 0.6vh, 6px) 22px;
  background: var(--surface);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  margin-top: clamp(4px, 1.2vh, 18px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s var(--ease) 0.85s, transform 0.9s var(--ease) 0.85s,
              border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.closing.visible .waitlist { opacity: 1; transform: none; }
.closing .waitlist:focus-within {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(46,42,38,0.06);
}
.closing .waitlist input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: -0.005em;
  color: var(--text);
  padding: clamp(6px, 1vh, 10px) 0;
  min-width: 0;
}
.closing .waitlist input::placeholder {
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.closing .waitlist button {
  font: inherit;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--bg);
  background: var(--text);
  border: 0;
  border-radius: 999px;
  padding: clamp(6px, 1vh, 10px) 18px clamp(6px, 1vh, 10px) 20px;
  cursor: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s var(--ease);
  white-space: nowrap;
}
.closing .waitlist button:hover {
  background: var(--accent);
}
.closing .waitlist button .arrow {
  display: inline-block;
  width: 12px; height: 1px;
  background: currentColor;
  position: relative;
  transition: transform 0.3s var(--ease);
}
.closing .waitlist button .arrow::after {
  content: "";
  position: absolute;
  right: 0; top: 50%;
  width: 6px; height: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translate(1px, -50%) rotate(45deg);
}
.closing .waitlist button:hover .arrow { transform: translateX(3px); }
.closing .waitlist.done button {
  background: var(--good);
  color: #fff;
}

/* Footer row */
.closing .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  opacity: 0;
  transition: opacity 0.8s var(--ease) 1.2s;
}
.closing.visible .foot { opacity: 1; }
.closing .foot .links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.closing .foot a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s var(--ease);
  position: relative;
}
.closing .foot a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.closing .foot a:hover { color: var(--text); }
.closing .foot a:hover::after { transform: scaleX(1); }
.closing .foot .made {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.closing .foot .flag {
  display: inline-block;
  width: 14px;
  height: 10px;
  background:
    linear-gradient(to bottom,
      #FF9933 0 33.3%,
      #FFFFFF 33.3% 66.6%,
      #128807 66.6% 100%);
  border: 1px solid var(--border-strong);
}

@media (max-width: 720px) {
  .closing { padding: 24px 20px; }
  .closing .foot { flex-direction: column; gap: 12px; align-items: center; }
}



/* =====================================================================
   Scene 01 — Inbox
   ===================================================================== */

.scene[data-scene="01"] .demo {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.inbox-frame {
  width: 100%;
  max-width: clamp(640px, 56vw, 1280px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
}
.inbox-title {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.inbox-title strong {
  color: var(--text);
  font-weight: 500;
}
.inbox-meta {
  font-size: var(--fs-body-sm);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 14px;
}
.inbox-meta .pill {
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.inbox-subheader {
  display: grid;
  grid-template-columns: 20px 180px 1fr 72px;
  gap: 14px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.inbox-list { flex: 1; }
.inbox-thread {
  display: grid;
  grid-template-columns: 20px 180px 1fr 72px;
  gap: 14px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  position: relative;
  transition: background 0.3s var(--ease);
}
.inbox-thread:last-child { border-bottom: none; }
.inbox-thread .status {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: transparent;
}
.inbox-thread .sender,
.inbox-thread .body,
.inbox-thread .time {
  font-size: var(--fs-body-sm);
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-thread .body {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.inbox-thread .body .preview { opacity: 0.7; }
.inbox-thread .time {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* Highlighted (new) thread — Acme */
.inbox-thread.highlight .status { background: var(--text); }
.inbox-thread.highlight .sender,
.inbox-thread.highlight .body .subject { color: var(--text); }
.inbox-thread.highlight .body .preview { color: var(--text-secondary); opacity: 1; }
.inbox-thread.highlight .time { color: var(--text-secondary); }
/* Elf focus state */
.inbox-thread.focused { background: #FAF8F3; }

/* =====================================================================
   Scene 05 — The catch
   ===================================================================== */

.ship-card {
  width: 100%;
  max-width: clamp(720px, 58vw, 1320px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: visible;
  position: relative;
  transition: box-shadow 0.6s var(--ease), border-color 0.6s var(--ease);
}
.ship-card.alert {
  box-shadow: var(--shadow-lift);
  border-color: #D9D2C6;
}
.ship-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--border);
  gap: 20px;
}
.ship-head .kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.ship-head .title {
  font-size: clamp(16px, 1.3vw, 19px);
  font-weight: 400;
  color: var(--text);
  margin-top: 4px;
  letter-spacing: -0.01em;
}
.ship-head .subtitle {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  margin-top: 3px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-secondary);
  background: #FBFAF6;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), color 0.5s var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}
.status-pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(46,143,82,0.14);
  animation: shipDot 1.8s ease-in-out infinite;
  transition: background 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
@keyframes shipDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(46,143,82,0.14); }
  50%      { box-shadow: 0 0 0 5px rgba(46,143,82,0.22); }
}
.ship-card.alert .status-pill {
  background: var(--alert-soft);
  border-color: #E8C3B4;
  color: #8A3A22;
}
.ship-card.alert .status-pill .dot {
  background: var(--alert);
  box-shadow: 0 0 0 3px rgba(196,89,59,0.18);
  animation: alertDot 1.4s ease-in-out infinite;
}
@keyframes alertDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(196,89,59,0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(196,89,59,0.30); }
}

.ship-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  gap: 14px;
}
.ship-summary .k {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.ship-summary .v {
  font-size: var(--fs-body-sm);
  color: var(--text);
  margin-top: 2px;
}
.ship-summary .v.hs {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.ship-summary .hs-cell.scanning .v.hs {
  background: #FBFAF6;
}
.ship-summary .hs-cell.flagged .v.hs {
  background: var(--alert-soft);
  color: #8A3A22;
  box-shadow: inset 0 0 0 1px rgba(196,89,59,0.30);
}
.ship-summary .hs-cell { position: relative; }
.ship-summary .hs-cell .caret {
  position: absolute;
  top: 22px; right: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #8A3A22;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.ship-summary .hs-cell.flagged .caret { opacity: 1; }

.check-panel {
  padding: 16px 24px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 12px;
  align-items: start;
  background: #FBFAF6;
  border-bottom: 1px solid var(--border);
}
.check-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  margin-top: 2px;
  color: var(--text-dim);
  transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.check-icon svg { width: 12px; height: 12px; }
.check-panel.flagged .check-icon {
  background: var(--alert);
  color: #fff;
  border-color: var(--alert);
}
.check-panel .ctitle {
  font-size: var(--fs-body-sm);
  color: var(--text);
}
.check-panel .cline {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  min-height: 16px;
}
.check-panel .cline b {
  color: var(--text);
  background: #F3EFE7;
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: 500;
}
.check-panel .timer {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.draft {
  padding: 18px 24px 20px;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.draft.visible { opacity: 1; transform: translateY(0); }
.draft .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}
.draft .meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.draft .meta .to { color: var(--text-secondary); }
.draft .subject {
  font-size: var(--fs-body-sm);
  color: var(--text);
  margin-top: 4px;
  letter-spacing: -0.005em;
}
.draft .body {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.6;
}
.draft .body .hs-old {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  text-decoration: line-through;
  text-decoration-color: var(--alert);
  color: var(--text-dim);
}
.draft .body .hs-new {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  background: var(--alert-soft);
  color: #8A3A22;
  padding: 1px 5px;
  border-radius: 2px;
  font-weight: 500;
}
.draft .reason {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-top: 10px;
}
.draft .actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}
.draft .btn {
  font-size: 11px;
  padding: 6px 11px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: none;
  font-family: inherit;
  letter-spacing: -0.005em;
}
.draft .btn.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* Elf alert-mode (no halo anymore — kept class hook in case anything tries to toggle it) */
.elf-wrap.alert .elf-cursor {
  filter: drop-shadow(0 2px 6px rgba(196,89,59,0.4));
}

/* =====================================================================
   Scene 02 — Invoice (email + PDF + extraction card)
   ===================================================================== */

.scene[data-scene="02"] .demo {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.invoice-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) clamp(280px, 22vw, 440px);
  gap: clamp(16px, 1.6vw, 32px);
  align-items: start;
  width: 100%;
}

.email-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.email-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.email-header .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}
.email-subject {
  font-size: var(--fs-body);
  color: var(--text);
  letter-spacing: -0.005em;
}
.email-meta {
  font-size: var(--fs-body-sm);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.email-sender {
  margin-top: 4px;
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
}
.email-sender b { color: var(--text); font-weight: 500; }

.email-body {
  padding: 14px 22px 18px;
  border-bottom: 1px solid var(--border);
}
.email-body p {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  max-width: 60ch;
  line-height: 1.55;
}
.email-body p + p { margin-top: 8px; }
.attachment {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 9px 12px 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #FBFAF6;
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
}
.attachment .icon {
  width: 26px; height: 30px;
  border: 1px solid var(--border);
  border-radius: 2px;
  position: relative;
  background: #fff;
}
.attachment .icon::after {
  content: 'PDF';
  position: absolute;
  bottom: 3px; left: 0; right: 0;
  text-align: center;
  font-size: 7px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.attachment .icon::before {
  content: '';
  position: absolute;
  top: 3px; right: 3px;
  width: 7px; height: 7px;
  background: var(--border);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.attachment b { color: var(--text); font-weight: 500; }

.invoice-doc {
  padding: 22px 22px 20px;
  background: #FBFAF6;
}
.invoice-doc-inner {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 22px 22px 20px;
  box-shadow: 0 1px 0 rgba(30,25,20,0.02);
}
.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.doc-head .who {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.doc-head .name {
  font-size: 13px;
  color: var(--text);
  margin-top: 3px;
}
.doc-head .addr {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.5;
}
.doc-head .right { text-align: right; }
.doc-head .doctype {
  font-size: 16px;
  color: var(--text);
  letter-spacing: 0.02em;
}
.doc-head .docnum {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.doc-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.doc-meta-grid .k {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.doc-meta-grid .v {
  font-size: 12.5px;
  color: var(--text);
  margin-top: 2px;
}

.line-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.line-table th, .line-table td {
  text-align: left;
  padding: 9px 6px;
  font-size: 11.5px;
  vertical-align: top;
}
.line-table th {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 400;
  border-bottom: 1px solid var(--border);
}
.line-table td {
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s var(--ease);
}
.line-table td.num, .line-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.line-table td.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--text);
}
.line-table td.desc { max-width: 240px; }
.line-table .line-row.focused td { background: #FAF8F3; }

.doc-totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 20px;
  padding: 14px 6px 2px;
  font-size: 11.5px;
  color: var(--text-secondary);
}
.doc-totals .label { text-align: right; }
.doc-totals .val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.doc-totals .grand.label, .doc-totals .grand.val {
  color: var(--text);
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 500;
}

.extract-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: sticky;
  top: calc(var(--chrome-top) + 24px);
}
.extract-head {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.extract-kicker {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.extract-title {
  font-size: 13px;
  color: var(--text);
  margin-top: 3px;
  letter-spacing: -0.005em;
}
.extract-status {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.02em;
}
.extract-status .pulse {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: extPulseDim 2s ease-in-out infinite;
}
.extract-status.working {
  color: var(--text);
}
.extract-status.working .pulse {
  background: var(--good);
  animation: extPulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 3px rgba(46,143,82,0.14);
}
@keyframes extPulse { 0%, 100% { opacity: 0.45 } 50% { opacity: 1 } }
@keyframes extPulseDim { 0%, 100% { opacity: 0.4 } 50% { opacity: 0.7 } }

.extract-body {
  padding: 6px 18px 16px;
}
.extract-field {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.extract-field:last-child { border-bottom: none; }
.extract-field .k {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.extract-field .v {
  font-size: 12.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-height: 17px;
  position: relative;
}
.extract-field .v.empty::before {
  content: '';
  display: block;
  width: 44px;
  height: 1px;
  background: var(--border);
  margin-top: 8px;
}
.extract-field .v.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
}
.extract-field .v .cursor-bar {
  display: inline-block;
  width: 1px;
  height: 12px;
  background: var(--text);
  vertical-align: -2px;
  margin-left: 1px;
  opacity: 0;
}
.extract-field.typing .v .cursor-bar {
  opacity: 1;
  animation: typeBlink 1s steps(2) infinite;
}
@keyframes typeBlink { 50% { opacity: 0; } }

/* =====================================================================
   Scene 03 — Shipment (route + grid + docs + forwarders)
   ===================================================================== */

.ship-card--build {
  transition: box-shadow 0.6s var(--ease);
}
.ship-route {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}
.ship-route .node .k {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.ship-route .node .v {
  font-size: 17px;
  color: var(--text);
  margin-top: 4px;
  letter-spacing: -0.005em;
}
.ship-route .node .sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.ship-route .node.right { text-align: right; }
.ship-route .arrow {
  position: relative;
  height: 30px;
  min-width: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ship-route .arrow .line {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 1px;
  background: repeating-linear-gradient(to right, var(--border) 0 4px, transparent 4px 8px);
}
.ship-route .arrow .plane {
  position: relative;
  z-index: 1;
  background: var(--surface);
  padding: 0 10px;
  color: var(--text-dim);
  font-size: 10.5px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
}
.ship-route .arrow .tip {
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid var(--text-dim);
}

.ship-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px 24px 18px;
}
.ship-field {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 16px;
  border-right: 1px solid var(--border);
  transition: background 0.3s var(--ease);
}
.ship-field:nth-child(3n) { border-right: none; padding-right: 0; }
.ship-field:nth-last-child(-n+3) { border-bottom: none; }
.ship-field .k {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.ship-field .v {
  font-size: 13px;
  color: var(--text);
  min-height: 19px;
  position: relative;
  letter-spacing: -0.005em;
}
.ship-field .v.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
}
.ship-field .v.empty::before {
  content: '';
  display: block;
  width: 52px;
  height: 1px;
  background: var(--border);
  margin-top: 9px;
}
.ship-field .v .cursor-bar {
  display: inline-block;
  width: 1px;
  height: 12px;
  background: var(--text);
  vertical-align: -2px;
  margin-left: 1px;
  opacity: 0;
}
.ship-field.typing .v .cursor-bar {
  opacity: 1;
  animation: typeBlink 1s steps(2) infinite;
}
.ship-field.focused { background: #FAF8F3; padding-left: 8px; margin-left: -8px; }

.ship-docs {
  display: flex;
  gap: 10px;
  padding: 14px 24px 16px;
  border-top: 1px solid var(--border);
  background: #FBFAF6;
  flex-wrap: wrap;
}
.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  font-size: 11.5px;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.doc-chip.visible { opacity: 1; transform: translateY(0); }
.doc-chip .icon {
  width: 14px; height: 18px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #fff;
  position: relative;
  flex-shrink: 0;
}
.doc-chip .icon::before {
  content: '';
  position: absolute;
  top: 2px; right: 2px;
  width: 4px; height: 4px;
  background: var(--border);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.doc-chip b { color: var(--text); font-weight: 500; }

.ship-forwarders {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px 18px;
  border-top: 1px solid var(--border);
  background: #FBFAF6;
  flex-wrap: wrap;
}
.ship-forwarders .fwd-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  white-space: nowrap;
}
.fwd-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.fwd-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.fwd-pill.visible { opacity: 1; transform: translateY(0); }
.fwd-pill svg { display: block; height: 11px; width: auto; }
.fwd-pill.more {
  color: var(--text-dim);
  font-style: italic;
  padding: 5px 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
}

/* =====================================================================
   Scene 04 — Transit (vertical timeline + FR24-style tracker)
   ===================================================================== */

.scene[data-scene="04"] .demo {
  align-items: center;
}

.transit-layout {
  display: grid;
  grid-template-columns: minmax(480px, 1fr) clamp(320px, 24vw, 480px);
  gap: clamp(16px, 1.6vw, 32px);
  align-items: start;
  width: 100%;
}

.transit-card .timeline-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 18px 24px 8px;
}
.transit-card .timeline-header .t {
  font-size: 12.5px;
  color: var(--text);
}
.transit-card .timeline-header .sub {
  font-size: 10.5px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
}
.transit-card .timeline {
  padding: 2px 24px 20px;
  position: relative;
}
.transit-card .timeline::before {
  content: '';
  position: absolute;
  left: 41px; top: 14px; bottom: 30px;
  width: 1px;
  transform: translateX(-0.5px);
  background: repeating-linear-gradient(to bottom, var(--border) 0 4px, transparent 4px 8px);
}
.transit-card .timeline .rail-fill {
  position: absolute;
  left: 41px; top: 14px;
  width: 1px;
  transform: translateX(-0.5px);
  background: var(--text);
  height: 0;
  transition: height 0.2s linear;
}
.tl-event {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 14px;
  padding: 12px 0;
  align-items: start;
  position: relative;
}
.tl-event .node {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  justify-self: center;
  margin-top: 5px;
  position: relative;
  z-index: 2;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.tl-event.done .node {
  background: var(--text);
  border-color: var(--text);
  box-shadow: 0 0 0 2px rgba(30,25,20,0.06);
}
.tl-event.active .node {
  background: var(--surface);
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(30,25,20,0.06);
}
.tl-event.live .node {
  background: var(--good);
  border-color: var(--good);
  box-shadow: 0 0 0 4px rgba(46,143,82,0.18);
  animation: tlPulse 1.8s ease-in-out infinite;
}
@keyframes tlPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(46,143,82,0.14); }
  50%      { box-shadow: 0 0 0 7px rgba(46,143,82,0.22); }
}
.tl-event .body {
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.tl-event.active .body,
.tl-event.done .body,
.tl-event.live .body { opacity: 1; transform: translateY(0); }
.tl-event .title {
  font-size: 13px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.tl-event .detail {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.tl-event .meta {
  font-size: 10.5px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.tl-event.active .meta,
.tl-event.done .meta,
.tl-event.live .meta { opacity: 1; }
.tl-event.pending .title,
.tl-event.pending .detail { color: var(--text-dim); }
.tl-event.pending .node { background: var(--bg); }

.tl-event .track-btn {
  display: none;
  margin-top: 8px;
  padding: 5px 11px;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.003em;
  cursor: none;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: transform 0.2s var(--ease);
}
.tl-event.live .track-btn { display: inline-flex; }
.tl-event .track-btn .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--good);
  animation: trackDot 1.4s ease-in-out infinite;
}
@keyframes trackDot {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* Tracker (dark flight-radar panel) */
.tracker {
  background: #0B1420;
  border: 1px solid #1A2638;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25), 0 16px 40px -18px rgba(0,0,0,0.35);
  color: #C8D3E0;
  opacity: 0;
  transform: translateX(-12px) scale(0.98);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
  margin-top: 32px;
  align-self: flex-start;
}
.tracker.shown {
  opacity: 1;
  transform: translateX(0) scale(1);
}
.tracker-head {
  padding: 10px 14px;
  border-bottom: 1px solid #1A2638;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0E1828;
}
.tracker-head .pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #5EE9A3;
  box-shadow: 0 0 0 3px rgba(94,233,163,0.18);
  animation: trackDot 1.4s ease-in-out infinite;
}
.tracker-head .callsign {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: #E9EEF5;
  letter-spacing: 0.02em;
  font-weight: 500;
}
.tracker-head .live-tag {
  margin-left: auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5EE9A3;
}
.tracker-map {
  position: relative;
  height: clamp(180px, 22vh, 320px);
  background: radial-gradient(ellipse at 55% 40%, #15243A 0%, #0B1420 80%);
  overflow: hidden;
}
.tracker-map svg.world,
.tracker-map svg.overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.tracker-map svg.world .graticule {
  stroke: rgba(255,255,255,0.03);
  stroke-width: 0.3;
  fill: none;
}
.tracker-map .flight-path {
  stroke: rgba(255,200,80,0.85);
  stroke-width: 1.4;
  fill: none;
  stroke-linecap: round;
}
.tracker-map .flight-path-future {
  stroke: rgba(255,200,80,0.22);
  stroke-width: 1.4;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 2 3;
}
.tracker-map .ap-dot {
  fill: #E9EEF5;
  stroke: #0B1420;
  stroke-width: 1.2;
}
.tracker-map .ap-label {
  fill: #8DA0BC;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tracker-map .plane {
  fill: #FFC850;
  stroke: #0B1420;
  stroke-width: 0.8;
  filter: drop-shadow(0 0 3px rgba(255,200,80,0.6));
}
.tracker-map .plane-halo {
  fill: rgba(255,200,80,0.15);
}
.tracker-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #1A2638;
}
.tracker-strip .cell {
  padding: 9px 11px;
  border-right: 1px solid #1A2638;
}
.tracker-strip .cell:last-child { border-right: none; }
.tracker-strip .k {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6D80A0;
}
.tracker-strip .v {
  font-size: 13px;
  color: #E9EEF5;
  margin-top: 3px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}
.tracker-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-top: 1px solid #1A2638;
  background: #0E1828;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9.5px;
  color: #6D80A0;
  letter-spacing: 0.06em;
}
.tracker-foot .src { color: #8DA0BC; }

/* =====================================================================
   Debug / progress (development aid, hidden in production via .hide-dev)
   ===================================================================== */

.progress {
  position: fixed;
  bottom: 14px; right: 18px;
  z-index: 110;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  opacity: 0.45;
  pointer-events: none;
}

/* =====================================================================
   Mobile / narrow fallback
   Below 1024 we stack caption above demo and collapse the left rail.
   ===================================================================== */

@media (max-width: 767px) {
  :root {
    --chrome-left: 0px;
  }
  .chrome-left { display: none; }
  .scene {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 24px;
    justify-items: stretch;
  }
  .scene > .caption { grid-column: 1; grid-row: 1; }
  .scene > .demo    { grid-column: 1; grid-row: 2; max-width: 100%; }
  body { cursor: auto; }
  .elf-wrap { display: none; }
  a, button, input, textarea, select { cursor: auto; }
}


/* =====================================================================
   Scene 06 — Filed (correction received, EUC drafted, BOE filed)
   ===================================================================== */

.scene[data-scene="06"] .demo {
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: clamp(960px, 65vw, 1480px);
}

.scene[data-scene="06"] .filed-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 24vw, 440px);
  gap: clamp(18px, 1.6vw, 36px);
  align-items: start;
  width: 100%;
}

.scene[data-scene="06"] .reply-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.scene[data-scene="06"] .reply-card.visible {
  opacity: 1;
  transform: translateX(0);
}
.scene[data-scene="06"] .reply-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.scene[data-scene="06"] .reply-head .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 10px; font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text-secondary); letter-spacing: 0.04em;
}
.scene[data-scene="06"] .reply-head .who {
  font-size: var(--fs-body-sm);
  color: var(--text);
}
.scene[data-scene="06"] .reply-head .when {
  margin-left: auto;
  font-size: var(--fs-mono-sm);
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
}
.scene[data-scene="06"] .reply-subject {
  padding: 12px 14px 4px;
  font-size: var(--fs-body-sm);
  color: var(--text);
}
.scene[data-scene="06"] .reply-body {
  padding: 4px 14px 12px;
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}
.scene[data-scene="06"] .reply-attach {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: #FBFAF6;
  display: flex;
  align-items: center;
  gap: 10px;
}
.scene[data-scene="06"] .reply-attach .icon {
  width: 16px; height: 20px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #fff;
  position: relative;
  flex-shrink: 0;
}
.scene[data-scene="06"] .reply-attach .icon::before {
  content: '';
  position: absolute;
  top: 2px; right: 2px;
  width: 4px; height: 4px;
  background: var(--border);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.scene[data-scene="06"] .reply-attach .meta {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
}
.scene[data-scene="06"] .reply-attach .meta b {
  color: var(--text);
  font-weight: 500;
}
.scene[data-scene="06"] .reply-attach .badge {
  margin-left: auto;
  font-size: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--good-soft);
  color: var(--good);
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.scene[data-scene="06"] .reply-attach .badge.visible {
  opacity: 1;
  transform: translateY(0);
}

.scene[data-scene="06"] .reply-ship {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
  background: #FBFAF6;
}
.scene[data-scene="06"] .reply-ship .rs-title {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.scene[data-scene="06"] .reply-ship .rs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.scene[data-scene="06"] .reply-ship .k {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.scene[data-scene="06"] .reply-ship .v {
  font-size: var(--fs-body-sm);
  color: var(--text);
  margin-top: 3px;
}
.scene[data-scene="06"] .reply-ship .v.status {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-secondary);
}
.scene[data-scene="06"] .filed-hs .v {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
}
.scene[data-scene="06"] .filed-hs .old {
  color: var(--text-dim);
  text-decoration: line-through;
  text-decoration-color: var(--text-dim);
  margin-right: 8px;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.scene[data-scene="06"] .filed-hs .new {
  color: var(--text);
  background: var(--good-soft);
  padding: 2px 6px;
  border-radius: 3px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), background 0.5s var(--ease), padding 0.5s var(--ease);
}
.scene[data-scene="06"] .filed-hs.swapped .old { opacity: 1; }
.scene[data-scene="06"] .filed-hs.swapped .new { opacity: 1; transform: translateX(0); }
.scene[data-scene="06"] .filed-hs.settled .old { opacity: 0; display: none; }
.scene[data-scene="06"] .filed-hs.settled .new { background: transparent; padding: 0; }

/* Waybilltal progress strip — spans both columns beneath the cards */
.scene[data-scene="06"] .filed-progress {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 22px 8px 8px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  position: relative;
  gap: 0;
}
.scene[data-scene="06"] .filed-progress .fp-rail {
  position: absolute;
  top: 28px; left: 10%; right: 10%;
  height: 1px;
  background: var(--border);
  overflow: visible;
}
.scene[data-scene="06"] .filed-progress .fp-fill {
  position: absolute;
  top: 0; left: 0; height: 100%;
  background: var(--text);
  width: 0%;
  transition: width 0.6s var(--ease);
}
.scene[data-scene="06"] .filed-progress .fp-step {
  position: relative;
  text-align: center;
  padding-top: 16px;
}
.scene[data-scene="06"] .filed-progress .fp-step .node {
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  z-index: 2;
}
.scene[data-scene="06"] .filed-progress .fp-step.done .node {
  background: var(--text);
  border-color: var(--text);
}
.scene[data-scene="06"] .filed-progress .fp-step.live .node {
  background: var(--good);
  border-color: var(--good);
  box-shadow: 0 0 0 3px rgba(46,143,82,0.18);
  animation: s06LiveDot 1.6s ease-in-out infinite;
}
@keyframes s06LiveDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(46,143,82,0.14); }
  50%      { box-shadow: 0 0 0 6px rgba(46,143,82,0.22); }
}
.scene[data-scene="06"] .filed-progress .fp-step .label {
  font-size: var(--fs-body-sm);
  color: var(--text);
  opacity: 0.45;
  transition: opacity 0.4s var(--ease);
  letter-spacing: -0.005em;
}
.scene[data-scene="06"] .filed-progress .fp-step.done .label,
.scene[data-scene="06"] .filed-progress .fp-step.live .label { opacity: 1; }
.scene[data-scene="06"] .filed-progress .fp-step .meta {
  font-size: 10px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.scene[data-scene="06"] .filed-progress .fp-step.done .meta,
.scene[data-scene="06"] .filed-progress .fp-step.live .meta { opacity: 1; }

.scene[data-scene="06"] .portal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.scene[data-scene="06"] .portal.visible {
  opacity: 1;
  transform: translateX(0);
}
.scene[data-scene="06"] .portal-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FBFAF6;
}
.scene[data-scene="06"] .portal-head .mark {
  width: 22px; height: 22px;
  background: var(--text);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
  border-radius: 3px;
}
.scene[data-scene="06"] .portal-head .name {
  font-size: var(--fs-body-sm);
  color: var(--text);
}
.scene[data-scene="06"] .portal-head .env {
  margin-left: auto;
  font-size: var(--fs-mono-sm);
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
}
.scene[data-scene="06"] .portal-body { padding: 14px 16px; }
.scene[data-scene="06"] .portal-body .section-title {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 10px;
}
.scene[data-scene="06"] .portal-body .section-title:first-child {
  margin-top: 0;
}
.scene[data-scene="06"] .portal-body .prow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
}
.scene[data-scene="06"] .portal-body .prow:last-of-type {
  border-bottom: none;
}
.scene[data-scene="06"] .portal-body .prow .k {
  color: var(--text-secondary);
}
.scene[data-scene="06"] .portal-body .prow .v {
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
}
.scene[data-scene="06"] .portal-cta {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.scene[data-scene="06"] .btn-file {
  flex: 1;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 5px;
  background: var(--text);
  color: #fff;
  border: 1px solid var(--text);
  text-align: center;
  letter-spacing: -0.005em;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
}
.scene[data-scene="06"] .portal.filed .btn-file {
  background: var(--good);
  border-color: var(--good);
}
.scene[data-scene="06"] .portal-receipt {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--good);
  border-radius: 5px;
  background: var(--good-soft);
  font-size: 11px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: #1F5C36;
  letter-spacing: 0.04em;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.scene[data-scene="06"] .portal-receipt.visible {
  opacity: 1;
  transform: translateY(0);
}
.scene[data-scene="06"] .portal-receipt b {
  color: #144226;
  font-weight: 600;
}


/* =====================================================================
   Scene 07 — Duty (payment voucher → ledger → clearance rail → OFD)
   ===================================================================== */

.scene[data-scene="07"] .demo {
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: clamp(840px, 62vw, 1400px);
}

.scene[data-scene="07"] .duty-layout {
  display: grid;
  grid-template-columns: clamp(300px, 26vw, 460px) minmax(0, 1fr);
  gap: clamp(18px, 1.8vw, 36px);
  align-items: start;
  width: 100%;
}

/* ---- Voucher ---- */
.scene[data-scene="07"] .voucher {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}
.scene[data-scene="07"] .voucher .v-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FBFAF6;
}
.scene[data-scene="07"] .voucher .mark {
  width: 22px; height: 22px;
  background: var(--text);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  display: grid;
  place-items: center;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.scene[data-scene="07"] .voucher .name {
  font-size: var(--fs-body-sm);
  color: var(--text);
}
.scene[data-scene="07"] .voucher .env {
  margin-left: auto;
  font-size: var(--fs-mono-sm);
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
}

.scene[data-scene="07"] .voucher .v-body {
  padding: 16px;
}
.scene[data-scene="07"] .voucher .v-kicker {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.scene[data-scene="07"] .voucher .challan {
  font-size: 13px;
  color: var(--text);
  margin-top: 3px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.scene[data-scene="07"] .voucher .amount-row {
  margin-top: 14px;
  padding: 12px 0 8px;
  border-top: 1px solid var(--border);
}
.scene[data-scene="07"] .voucher .amount-label {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.scene[data-scene="07"] .voucher .amount {
  font-size: clamp(26px, 2.4vw, 32px);
  color: var(--text);
  margin-top: 6px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.scene[data-scene="07"] .voucher .amount .unit {
  font-size: 14px;
  color: var(--text-secondary);
  margin-left: 4px;
}

.scene[data-scene="07"] .voucher .v-lines {
  margin-top: 8px;
}
.scene[data-scene="07"] .voucher .v-line {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-top: 1px dashed var(--border);
  font-size: 12px;
}
.scene[data-scene="07"] .voucher .v-line .k {
  color: var(--text-secondary);
}
.scene[data-scene="07"] .voucher .v-line .v {
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
}

.scene[data-scene="07"] .voucher .v-methods {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.scene[data-scene="07"] .voucher .method {
  padding: 9px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: -0.005em;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}
.scene[data-scene="07"] .voucher .method .m-k {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: block;
  margin-bottom: 3px;
}
.scene[data-scene="07"] .voucher .method.selected {
  border-color: var(--text);
  background: #FBFAF6;
  color: var(--text);
}
.scene[data-scene="07"] .voucher .method.selected .m-k {
  color: var(--text);
}

.scene[data-scene="07"] .voucher .v-pay-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.scene[data-scene="07"] .voucher .btn-pay {
  flex: 1;
  padding: 11px 14px;
  border-radius: 5px;
  background: var(--text);
  color: #fff;
  border: 1px solid var(--text);
  font-size: 13px;
  text-align: center;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
  position: relative;
  overflow: hidden;
}
.scene[data-scene="07"] .voucher .btn-pay .spin {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  animation: s07Spin 0.9s linear infinite;
  vertical-align: -1px;
  margin-right: 6px;
  opacity: 0;
}
.scene[data-scene="07"] .voucher .btn-pay.processing .spin {
  opacity: 1;
}
@keyframes s07Spin { to { transform: rotate(360deg); } }
.scene[data-scene="07"] .voucher.paid .btn-pay {
  background: var(--good);
  border-color: var(--good);
}

.scene[data-scene="07"] .voucher .v-secure {
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.scene[data-scene="07"] .voucher .v-secure::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--good);
  border-radius: 50%;
}

.scene[data-scene="07"] .voucher .receipt-stamp {
  position: absolute;
  top: 50%; right: 16px;
  transform: translateY(-50%) rotate(-8deg);
  padding: 10px 14px;
  border: 2px dashed var(--good);
  border-radius: 6px;
  background: rgba(228,239,227,0.94);
  font-size: 11px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: #144226;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
  z-index: 3;
}
.scene[data-scene="07"] .voucher .receipt-stamp b {
  display: block;
  font-size: 15px;
  letter-spacing: 0.2em;
  margin-bottom: 2px;
}
.scene[data-scene="07"] .voucher.paid .receipt-stamp {
  opacity: 1;
}

/* ---- Shipment card (right) ---- */
.scene[data-scene="07"] .duty-ship {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.scene[data-scene="07"] .duty-ship .ship-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  gap: 20px;
}
.scene[data-scene="07"] .duty-ship .ship-head .kicker {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.scene[data-scene="07"] .duty-ship .ship-head .title {
  font-size: clamp(15px, 1.2vw, 18px);
  color: var(--text);
  margin-top: 4px;
  letter-spacing: -0.01em;
}
.scene[data-scene="07"] .duty-ship .ship-head .subtitle {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  margin-top: 4px;
}
.scene[data-scene="07"] .duty-ship .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  background: #FBFAF6;
  white-space: nowrap;
}
.scene[data-scene="07"] .duty-ship .status-pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(46,143,82,0.14);
  animation: s07ShipDot 1.8s ease-in-out infinite;
}
@keyframes s07ShipDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(46,143,82,0.14); }
  50%      { box-shadow: 0 0 0 5px rgba(46,143,82,0.22); }
}

.scene[data-scene="07"] .ledger {
  padding: 16px 20px;
}
.scene[data-scene="07"] .ledger .section-title {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.scene[data-scene="07"] .ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.scene[data-scene="07"] .ledger-row .k {
  color: var(--text-secondary);
}
.scene[data-scene="07"] .ledger-row .v {
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.scene[data-scene="07"] .ledger-row.total {
  border-top: 1px solid var(--text);
  margin-top: 4px;
  padding-top: 12px;
  font-size: 14px;
}
.scene[data-scene="07"] .ledger-row.total .v {
  font-size: 15px;
  color: var(--text);
}
.scene[data-scene="07"] .ledger-row .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
  margin-left: 8px;
  background: var(--good-soft);
  color: #144226;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.scene[data-scene="07"] .ledger-row.paid .badge {
  opacity: 1;
  transform: translateX(0);
}

.scene[data-scene="07"] .rail-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.scene[data-scene="07"] .rail-block .r-title {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.scene[data-scene="07"] .rail-track-x {
  margin-top: 10px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  position: relative;
}
.scene[data-scene="07"] .rail-fill-x {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  background: var(--good);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s linear;
}
.scene[data-scene="07"] .rail-steps {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.scene[data-scene="07"] .rail-step-x {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
}
.scene[data-scene="07"] .rail-step-x.done { color: var(--text); }
.scene[data-scene="07"] .rail-step-x.live { color: #144226; }

/* OFD callout */
.scene[data-scene="07"] .ofd {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  background: #FBFAF6;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.scene[data-scene="07"] .ofd.visible {
  opacity: 1;
  transform: translateY(0);
}
.scene[data-scene="07"] .ofd-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.scene[data-scene="07"] .ofd-icon svg {
  width: 14px; height: 14px;
}
.scene[data-scene="07"] .ofd-title {
  font-size: 13px;
  color: var(--text);
}
.scene[data-scene="07"] .ofd-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.scene[data-scene="07"] .ofd-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
  white-space: nowrap;
}


/* =====================================================================
   Scene 08 — Voice (live call with multilingual agent interpreter)
   ===================================================================== */

.scene[data-scene="08"] .demo {
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: clamp(900px, 64vw, 1480px);
}

.scene[data-scene="08"] .voice-layout {
  display: grid;
  grid-template-columns: clamp(240px, 20vw, 380px) minmax(0, 1fr);
  gap: clamp(18px, 1.8vw, 36px);
  align-items: start;
  width: 100%;
}

/* ---- Phone card (left) ---- */
.scene[data-scene="08"] .phone {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}
.scene[data-scene="08"] .phone-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #FBFAF6;
  display: flex;
  align-items: center;
  gap: 10px;
}
.scene[data-scene="08"] .phone-head .mark {
  width: 22px; height: 22px;
  background: var(--text);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  display: grid;
  place-items: center;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.scene[data-scene="08"] .phone-head .name {
  font-size: var(--fs-body-sm);
  color: var(--text);
}
.scene[data-scene="08"] .phone-head .env {
  margin-left: auto;
  font-size: var(--fs-mono-sm);
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
}

.scene[data-scene="08"] .phone-body {
  padding: clamp(18px, 2vh, 28px) clamp(14px, 1.4vw, 24px) clamp(14px, 1.6vh, 22px);
  text-align: center;
  min-height: clamp(320px, 42vh, 480px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.4vh, 18px);
}

.scene[data-scene="08"] .call-status {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.scene[data-scene="08"] .call-status.live { color: var(--good); }

.scene[data-scene="08"] .callee-avatar {
  width: clamp(72px, 8vh, 120px);
  height: clamp(72px, 8vh, 120px);
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  position: relative;
  margin-top: 4px;
}
.scene[data-scene="08"] .callee-avatar .initials {
  font-size: 26px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.scene[data-scene="08"] .callee-avatar::before,
.scene[data-scene="08"] .callee-avatar::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid transparent;
  pointer-events: none;
}
.scene[data-scene="08"] .phone.ringing .callee-avatar::before {
  border-color: var(--good);
  animation: s08Ring 1.6s ease-out infinite;
}
.scene[data-scene="08"] .phone.ringing .callee-avatar::after {
  border-color: var(--good);
  animation: s08Ring 1.6s ease-out infinite 0.4s;
}
@keyframes s08Ring {
  0%   { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.3);  opacity: 0; }
}

.scene[data-scene="08"] .callee-name {
  font-size: 15px;
  color: var(--text);
  margin-top: 4px;
  letter-spacing: -0.01em;
}
.scene[data-scene="08"] .callee-role {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}
.scene[data-scene="08"] .callee-number {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.scene[data-scene="08"] .call-timer {
  font-size: 13px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  margin-top: auto;
}
.scene[data-scene="08"] .call-timer.dim { color: var(--text-dim); }

.scene[data-scene="08"] .call-controls {
  margin-top: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
}
.scene[data-scene="08"] .cc-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
}
.scene[data-scene="08"] .cc-btn svg { width: 16px; height: 16px; }
.scene[data-scene="08"] .cc-btn.hang {
  background: #B74040;
  border-color: #B74040;
  color: #fff;
}

.scene[data-scene="08"] .agent-badge {
  position: absolute;
  bottom: 12px; left: 12px; right: 12px;
  padding: 8px 12px;
  background: #FBFAF6;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: -0.005em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.scene[data-scene="08"] .phone.connected .agent-badge { opacity: 1; transform: translateY(0); }
.scene[data-scene="08"] .agent-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(46,143,82,0.18);
  animation: s08AgentDot 1.6s ease-in-out infinite;
}
@keyframes s08AgentDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(46,143,82,0.14); }
  50%      { box-shadow: 0 0 0 5px rgba(46,143,82,0.22); }
}
.scene[data-scene="08"] .agent-badge .lang {
  margin-left: auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text);
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg);
}

/* ---- Transcript panel (right) ---- */
.scene[data-scene="08"] .transcript {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: clamp(440px, 62vh, 760px);
}
.scene[data-scene="08"] .transcript-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.scene[data-scene="08"] .transcript-head .kicker {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.scene[data-scene="08"] .transcript-head .title {
  font-size: 14px;
  color: var(--text);
  margin-top: 3px;
  letter-spacing: -0.01em;
}
.scene[data-scene="08"] .lang-pair {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  background: #FBFAF6;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.scene[data-scene="08"] .lang-pair .arrow {
  color: var(--text-dim);
}
.scene[data-scene="08"] .lang-pair .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--good);
  margin-right: 2px;
}

.scene[data-scene="08"] .transcript-body {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.scene[data-scene="08"] .transcript-body::-webkit-scrollbar { width: 6px; }
.scene[data-scene="08"] .transcript-body::-webkit-scrollbar-track { background: transparent; }
.scene[data-scene="08"] .transcript-body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

.scene[data-scene="08"] .bubble {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.scene[data-scene="08"] .bubble.visible {
  opacity: 1;
  transform: translateY(0);
}
.scene[data-scene="08"] .bubble .who {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.scene[data-scene="08"] .bubble.waybill .who {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.scene[data-scene="08"] .bubble .content {
  min-width: 0;
}
.scene[data-scene="08"] .bubble .meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 10px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
}
.scene[data-scene="08"] .bubble .meta .speaker {
  color: var(--text);
  letter-spacing: -0.005em;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
}
.scene[data-scene="08"] .bubble .meta .lang-tag {
  color: var(--text-dim);
}
.scene[data-scene="08"] .bubble .original {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.45;
  letter-spacing: -0.005em;
}
.scene[data-scene="08"] .bubble .original .native {
  font-style: italic;
  color: var(--text-secondary);
}
.scene[data-scene="08"] .bubble .translation {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  padding-left: 10px;
  border-left: 2px solid var(--border);
}
.scene[data-scene="08"] .bubble.waybill .translation {
  border-left-color: var(--text);
}

.scene[data-scene="08"] .bubble .typing {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  padding: 6px 2px;
}
.scene[data-scene="08"] .bubble .typing span {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: s08Type 1s ease-in-out infinite;
}
.scene[data-scene="08"] .bubble .typing span:nth-child(2) { animation-delay: 0.15s; }
.scene[data-scene="08"] .bubble .typing span:nth-child(3) { animation-delay: 0.30s; }
@keyframes s08Type {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(-2px); }
}

/* Summary pill that appears at the end */
.scene[data-scene="08"] .call-outcome {
  padding: 12px 16px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.scene[data-scene="08"] .call-outcome.visible { opacity: 1; transform: translateY(0); }
.scene[data-scene="08"] .call-outcome .check {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--good);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  flex-shrink: 0;
}
.scene[data-scene="08"] .call-outcome .title {
  font-size: 13px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.scene[data-scene="08"] .call-outcome .meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
}

/* Language roster strip below transcript — 11 Indian languages */
.scene[data-scene="08"] .lang-strip {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
}
.scene[data-scene="08"] .lang-strip .title {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-right: 6px;
}
.scene[data-scene="08"] .lang-strip .chip {
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text-secondary);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.scene[data-scene="08"] .lang-strip .chip.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}


/* =====================================================================
   Scene 09 — Delivered (POD, file closed, summary of what Waybill did)
   ===================================================================== */

.scene[data-scene="09"] .demo {
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: clamp(900px, 64vw, 1480px);
}

.scene[data-scene="09"] .delivered-layout {
  display: grid;
  grid-template-columns: clamp(260px, 24vw, 440px) minmax(0, 1fr);
  gap: clamp(18px, 1.8vw, 36px);
  align-items: stretch;
  width: 100%;
}

/* ---- POD card ---- */
.scene[data-scene="09"] .pod {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.scene[data-scene="09"] .pod-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FBFAF6;
}
.scene[data-scene="09"] .pod-head .mark {
  width: 22px; height: 22px;
  background: var(--text);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  display: grid; place-items: center;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.scene[data-scene="09"] .pod-head .name {
  font-size: var(--fs-body-sm);
  color: var(--text);
}
.scene[data-scene="09"] .pod-head .env {
  margin-left: auto;
  font-size: var(--fs-mono-sm);
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
}

.scene[data-scene="09"] .pod-body {
  padding: 18px 18px 14px;
  flex: 1;
}
.scene[data-scene="09"] .pod-kicker {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.scene[data-scene="09"] .pod-title {
  font-size: 18px;
  color: var(--text);
  margin-top: 4px;
  letter-spacing: -0.01em;
}

.scene[data-scene="09"] .pod-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.scene[data-scene="09"] .pod-grid .k {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.scene[data-scene="09"] .pod-grid .v {
  font-size: 13px;
  color: var(--text);
  margin-top: 3px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.scene[data-scene="09"] .pod-grid .v.regular {
  font-family: 'Inter', sans-serif;
}

/* Signature pad */
.scene[data-scene="09"] .sig-frame {
  margin-top: 16px;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  background: #FBFAF6;
}
.scene[data-scene="09"] .sig-label {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.scene[data-scene="09"] .sig-svg {
  width: 100%;
  height: 64px;
  display: block;
}
.scene[data-scene="09"] .sig-path {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.scene[data-scene="09"] .pod.signed .sig-path {
  stroke-dashoffset: 0;
}
.scene[data-scene="09"] .sig-name {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.scene[data-scene="09"] .sig-name .who {
  letter-spacing: -0.005em;
}
.scene[data-scene="09"] .sig-name .when {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* Stamp */
.scene[data-scene="09"] .pod-stamp {
  position: absolute;
  top: 72px;
  right: 18px;
  padding: 9px 14px;
  border: 2px solid var(--good);
  border-radius: 4px;
  background: rgba(228,239,227,0.9);
  color: #144226;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transform: rotate(-6deg);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  z-index: 2;
}
.scene[data-scene="09"] .pod-stamp b {
  display: block;
  font-size: 15px;
  letter-spacing: 0.24em;
  margin-bottom: 2px;
}
.scene[data-scene="09"] .pod.signed .pod-stamp {
  opacity: 1;
}

/* ---- Summary panel (right) ---- */
.scene[data-scene="09"] .summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.scene[data-scene="09"] .summary-head {
  padding: 12px 20px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.scene[data-scene="09"] .summary-head .kicker {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.scene[data-scene="09"] .summary-head .title {
  font-size: clamp(16px, 1.3vw, 20px);
  color: var(--text);
  margin-top: 4px;
  letter-spacing: -0.01em;
}
.scene[data-scene="09"] .summary-head .subtitle {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  margin-top: 4px;
}
.scene[data-scene="09"] .closed-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--good);
  border-radius: 999px;
  font-size: 12px;
  color: #144226;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  background: var(--good-soft);
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.scene[data-scene="09"] .closed-pill.visible { opacity: 1; transform: translateY(0); }
.scene[data-scene="09"] .closed-pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--good);
}

/* Metrics strip */
.scene[data-scene="09"] .metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  gap: 14px;
}
.scene[data-scene="09"] .metric .k {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.scene[data-scene="09"] .metric .v {
  font-size: clamp(18px, 1.6vw, 24px);
  color: var(--text);
  margin-top: 4px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.scene[data-scene="09"] .metric .sub {
  font-size: 10px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
  margin-top: 3px;
}

/* What Waybill did — audit trail */
.scene[data-scene="09"] .actions {
  padding: 10px 20px 12px;
  flex: 1;
}
.scene[data-scene="09"] .actions .section-title {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.scene[data-scene="09"] .action {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  align-items: center;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.scene[data-scene="09"] .action.visible { opacity: 1; transform: translateX(0); }
.scene[data-scene="09"] .action .tick {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--good);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 9px;
  flex-shrink: 0;
}
.scene[data-scene="09"] .action .what {
  font-size: 12.5px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.scene[data-scene="09"] .action .meta {
  font-size: 10px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Archive footer bar */
.scene[data-scene="09"] .archive-bar {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: #FBFAF6;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.scene[data-scene="09"] .archive-bar.visible { opacity: 1; transform: translateY(0); }
.scene[data-scene="09"] .archive-bar .icon {
  width: 14px; height: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.scene[data-scene="09"] .archive-bar .meta {
  margin-left: auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.scene[data-scene="09"] .archive-bar b {
  color: var(--text);
  font-weight: 500;
}


/* =====================================================================
   Closing — capability grid (replaces the trust strip)
   ===================================================================== */
.closing .cap-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  margin: clamp(8px, 2vh, 32px) 0 clamp(8px, 2vh, 32px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.8s var(--ease) 1.0s, transform 0.9s var(--ease) 1.0s;
}
.closing.visible .cap-eyebrow { opacity: 1; transform: none; }

.closing .cap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: clamp(16px, 2.4vw, 48px);
  row-gap: clamp(10px, 2.4vh, 48px);
  width: 100%;
  max-width: clamp(880px, 64vw, 1240px);
  margin: 0 auto;
  position: relative;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s var(--ease) 1.15s, transform 0.9s var(--ease) 1.15s;
}
.closing.visible .cap-grid { opacity: 1; transform: none; }

/* Single horizontal divider between row 1 and row 2 (4-column layout) */
.closing .cap-grid::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
  transform: translateY(-50%);
}

.closing .cap-cell {
  padding: clamp(8px, 1.6vh, 24px) clamp(10px, 1.4vw, 20px);
  display: grid;
  grid-template-rows: auto auto auto;
  gap: clamp(6px, 1vh, 12px);
  align-content: start;
}
.closing .cap-icon {
  width: clamp(20px, 2.6vh, 28px); height: clamp(20px, 2.6vh, 28px);
  display: inline-grid;
  place-items: center;
  color: var(--text);
  border-radius: 6px;
  transition: background 0.2s var(--ease);
}
.closing .cap-icon svg {
  width: 100%; height: 100%;
  display: block;
}
.closing .cap-cell:hover .cap-icon {
  background: rgba(46,42,38,0.04);
}
.closing .cap-label {
  font-size: clamp(13px, min(1vw, 1.7vh), 16px);
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.closing .cap-desc {
  font-size: clamp(11px, min(0.9vw, 1.5vh), 14px);
  color: var(--text-secondary);
  line-height: 1.45;
  text-wrap: pretty;
}

/* 2 x 4 layout for medium screens */
@media (max-width: 1280px) {
  .closing .cap-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 640px;
  }
  .closing .cap-grid::before {
    display: none; /* divider doesn't make sense across 4 rows */
  }
}

/* Single column on mobile, divider every two rows */
@media (max-width: 960px) {
  .closing .cap-grid {
    grid-template-columns: 1fr;
    row-gap: 32px;
    max-width: 100%;
  }
  .closing .cap-cell {
    padding: 16px 0;
  }
  .closing .cap-cell:nth-child(2),
  .closing .cap-cell:nth-child(4),
  .closing .cap-cell:nth-child(6) {
    border-bottom: 1px solid var(--border);
    padding-bottom: 32px;
  }
}


/* =====================================================================
   Opening hero — fixed, fades out as scene 01 takes over
   ===================================================================== */
.opening {
  position: fixed;
  top: 0; left: 0; right: 0;
  /* TODO: tokenize as --opening-height once any other surface needs it. */
  height: 78vh;
  z-index: 50; /* above chrome (40) and scene-canvas (10) */
  background: var(--bg);
  pointer-events: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 40px clamp(32px, 6vw, 96px) 48px;
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease), visibility 0.4s;
}
/* Fades + slides up + releases pointer events once user has scrolled past hero */
body.past-opening .opening {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  visibility: hidden;
}
/* While opening is up, hide the chrome to keep the section calm */
body:not(.past-opening) .chrome-top,
body:not(.past-opening) .chrome-left,
body:not(.past-opening) .scene-canvas {
  opacity: 0;
  pointer-events: none;
}

.opening-dateline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Mirror of the top-left dateline strip — sits in the bottom-right corner
   of the hero. Single span by design so the copy can be swapped without
   touching markup hierarchy (e.g. EST. 2026 · DELHI, LAST UPDATED · …). */
.opening-stamp {
  position: absolute;
  right: 40px;
  bottom: 40px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

.opening-inner {
  align-self: center;
  justify-self: center;
  text-align: center;
  max-width: 920px;
  width: 100%;
  display: grid;
  gap: 24px;
  /* place headline at ~42% by nudging up from center */
  transform: translateY(-6vh);
}

.opening-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.opening-headline {
  font-family: 'Fraunces', 'Times New Roman', ui-serif, serif;
  font-weight: 300;
  font-size: clamp(36px, 4.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--text);
  text-wrap: balance;
}
.opening-headline span { display: block; }

.opening-sub {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(15px, 1.1vw, 18px);
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  text-wrap: pretty;
}

.opening-cue {
  display: grid;
  justify-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  animation: openingCueNudge 2.4s ease-in-out infinite;
}
.opening-cue-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 500;
}
.opening-cue-line {
  width: 1px;
  height: 40px;
  background: var(--text-secondary, var(--border-strong, var(--border)));
  display: block;
  position: relative;
  overflow: hidden;
}
.opening-cue-scroll {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 1;
  margin-top: 4px;
  font-weight: 500;
}
.opening-cue-scroll::after {
  content: ' ↓';
  display: inline-block;
  margin-left: 4px;
  font-weight: 400;
}
@keyframes openingCueNudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}
.opening-cue-line::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: -100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--text-dim), transparent);
  animation: openingCuePulse 1.6s ease-in-out infinite;
}
@keyframes openingCuePulse {
  0%   { top: -100%; opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

@media (max-width: 720px) {
  .opening { padding: 28px 20px 36px; }
  .opening-inner { transform: none; }
  .opening-eyebrow { margin-bottom: 16px; }
}
