/*
  ASTERIA — The Briefing Room (D28). Styles on top of shared/tokens.css:
  full-bleed chapters, a progress rail, scene graphics (inline SVG + CSS
  animation + one canvas), chapter transitions, and reduced-motion
  equivalents for every one of them. Same tokens, same voice as the consoles.
*/

/* ── page ──────────────────────────────────────── */
html.learn, body.learn { height: 100%; }
body.learn { overflow: hidden; background: var(--bg); }
.skyhost { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.skyhost canvas.sky { display: block; }

.gate { position: relative; z-index: 2; }
.gate h1 { font-size: 16px; }
.gate .gatelink { color: var(--accent); font: 600 11px/1.6 var(--disp); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid var(--accent-dim); }
.gate .gatelink:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 2px; }

.sr-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── frame: rail · stage · controls ────────────── */
.briefing { position: relative; z-index: 1; display: grid; grid-template-columns: 250px 1fr; grid-template-rows: 1fr auto; height: 100vh; height: 100dvh; }
.briefing[hidden] { display: none; }
.rail { grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 18px; padding: 22px 18px; border-right: 1px solid var(--line); background: rgba(11, 17, 24, .72); backdrop-filter: blur(6px); min-width: 0; }
.railhead .wordmark { display: block; }
.railrole { display: block; margin-top: 8px; font: 600 12px/1.35 var(--disp); letter-spacing: .08em; color: var(--ink); text-transform: uppercase; }
.raillist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.railbtn { display: grid; grid-template-columns: 12px 26px 1fr; gap: 8px; align-items: start; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 4px; padding: 7px 8px; color: var(--ink3); cursor: pointer; font: 12px/1.3 'Segoe UI', system-ui, sans-serif; }
.railbtn .raildot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--ink3); background: transparent; transition: background .3s, border-color .3s; }
.railbtn .railnum { font-size: 10.5px; color: var(--ink3); }
.railbtn .raildot { margin-top: 4px; }
.railbtn .railnum { margin-top: 1px; }
.railbtn .railtitle { color: var(--ink3); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; text-wrap: pretty; }
.railbtn.visited .raildot { background: var(--ink3); border-color: var(--ink3); }
.railbtn.visited .railtitle { color: var(--ink2); }
.railbtn[aria-current="step"] { border-color: var(--accent-dim); background: rgba(232, 196, 106, .06); }
.railbtn[aria-current="step"] .raildot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px rgba(232, 196, 106, .6); }
.railbtn[aria-current="step"] .railtitle, .railbtn[aria-current="step"] .railnum { color: var(--accent); }
.railbtn:hover { border-color: var(--line2); }
.railbtn:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 1px; }
.railmeter { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.railmeter .railfill { display: block; height: 100%; width: calc(var(--fraction, 0) * 100%); background: var(--accent); transition: width .5s ease; }
.railtag { margin: auto 0 0; font: italic 12px/1.55 'Segoe UI'; color: var(--ink2); }
.rail .skip { align-self: flex-start; font: 600 10.5px/1 var(--disp); letter-spacing: .12em; padding: 8px 12px; cursor: pointer; color: var(--ink3); }
.rail .skip:hover { color: var(--ink2); }

.stage { grid-column: 2; grid-row: 1; overflow: auto; min-width: 0; scroll-behavior: smooth; }
.controls { grid-column: 2; grid-row: 2; display: flex; align-items: center; gap: 12px; padding: 10px 26px; border-top: 1px solid var(--line); background: rgba(11, 17, 24, .8); backdrop-filter: blur(6px); flex-wrap: wrap; }
.controls .counter { color: var(--ink3); font-size: 11px; }
.controls .submit { font: 700 11.5px/1 var(--disp); letter-spacing: .14em; padding: 10px 18px; border-radius: 4px; cursor: pointer; }
.controls .submit.seat { margin-left: 4px; }
.controls .ghost { font: 600 11px/1 var(--disp); letter-spacing: .12em; padding: 9px 14px; cursor: pointer; }
.controls .ghost:disabled { opacity: .4; cursor: not-allowed; }
.controls .keyhint { margin: 0 0 0 auto; font-size: 10.5px; color: var(--ink3); }

/* ── chapter ───────────────────────────────────── */
.chapter { position: relative; min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; padding: 26px 0 40px; opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.chapter.is-in { opacity: 1; transform: none; }
/* Reading order on every chapter: the title anchors it, the graphic follows, the practice surface last. */
.chapter .copy { order: 1; }
.chapter .scene { order: 2; position: relative; display: flex; flex-direction: column; justify-content: flex-start; padding: 18px 30px 0; min-width: 0; }
.chapter .scene:empty, .chapter[data-scene="none"] .scene { display: none; }
.chapter .interactive { order: 3; }
/* The arena chapter is composed as a spread: the title and the situation on the left, the arena drawing itself on the right. */
@media (min-width: 1260px) {
  .chapter[data-scene="arena"] { grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); column-gap: 6px; align-items: center; align-content: center; }
  .chapter[data-scene="arena"] .copy { grid-column: 1; grid-row: 1; padding-right: 6px; }
  .chapter[data-scene="arena"] .scene { grid-column: 2; grid-row: 1; padding: 0 30px 0 0; }
  .chapter[data-scene="arena"] .interactive { grid-column: 1 / -1; }
}
.chapter .copy { max-width: 780px; padding: 0 34px; text-wrap: pretty; }
.chapter .copy .eyebrow { color: var(--accent-dim); }
.chapter .copy h1 { margin: 8px 0 8px; font: 700 clamp(26px, 3.6vw, 40px)/1.08 var(--disp); letter-spacing: .06em; color: var(--ink); text-transform: uppercase; }
.chapter .copy h1:focus { outline: none; }
/* Keyboard focus lands on the title on every chapter change: a gold rule under it, never a box round it. */
.chapter .copy h1:focus-visible { outline: none; text-decoration: underline; text-decoration-color: var(--accent-dim); text-decoration-thickness: 2px; text-underline-offset: 9px; }
.chapter .copy .lead { margin: 0 0 12px; font: 500 16px/1.45 'Segoe UI'; color: var(--accent); }
.chapter .copy .body { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--ink); }
.chapter .interactive { padding: 18px 34px 0; min-width: 0; }
/* The recap chapter's lines ARE its body; the paragraph would only repeat them under the list. */
.chapter[data-scene="recap"] .copy .body { display: none; }
.chapter .interactive:empty { display: none; }

/* ── decision cards + recap (engine scenes) ────── */
.cardgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px; width: 100%; }
.dcard { position: relative; background: var(--panel); border: 1px solid var(--line2); border-radius: 6px; padding: 16px 16px 14px; animation: rise .6s ease both; animation-delay: calc(var(--i, 0) * 120ms); }
.dcard .dcard-win { display: inline-block; margin-bottom: 10px; color: var(--accent); font-size: 11px; border: 1px solid var(--accent-dim); border-radius: 3px; padding: 3px 7px; }
.dcard h3 { margin: 0 0 8px; text-wrap: balance; font: 700 13px/1.3 var(--disp); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.dcard p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink2); }
.recap { counter-reset: line; list-style: none; margin: 0; padding: 0; max-width: 820px; }
.recap li { position: relative; padding: 12px 0 12px 54px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.6; color: var(--ink); animation: rise .6s ease both; animation-delay: calc(var(--i, 0) * 160ms); }
.recap li::before { counter-increment: line; content: counter(line, decimal-leading-zero); position: absolute; left: 0; top: 12px; font: 700 18px/1.4 var(--mono); color: var(--accent); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── arena scene (SVG, drawn on) ───────────────── */
svg.arena { width: 100%; max-height: 62vh; height: auto; display: block; overflow: visible; }
svg.arena .limb { opacity: .9; }
svg.arena .crater { fill: #06090d; stroke: #223140; stroke-width: 1; }
svg.arena .ground { fill: none; stroke: #2C3E50; stroke-width: 1.4; stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawon 1.6s ease-out forwards; }
svg.arena .arena-cap { font: 600 10.5px var(--disp); letter-spacing: .14em; fill: var(--ink3); }
svg.arena .beamline { stroke: var(--l2); stroke-width: 1.6; stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawon 1.1s ease-out forwards, beampulse 3.2s ease-in-out infinite; animation-delay: calc(.5s + var(--i, 0) * .22s), calc(2s + var(--i, 0) * .4s); }
svg.arena .beamlabel { font: 700 13px var(--mono); fill: var(--l3); opacity: 0; animation: fadein .6s ease forwards; animation-delay: calc(1.3s + var(--i, 0) * .22s); }
svg.arena .node .glyph, svg.arena .node .halo, svg.arena .node .dish, svg.arena .window .tick { fill: none; stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawon .9s ease-out forwards; animation-delay: calc(.3s + var(--i, 0) * .18s); }
svg.arena .node.asset .glyph { stroke: var(--accent); stroke-width: 2; fill: rgba(232, 196, 106, .18); }
svg.arena .node.relay .glyph { stroke: var(--l3); stroke-width: 2; fill: rgba(121, 175, 217, .2); }
svg.arena .node.relay .halo { stroke: var(--line2); stroke-width: 1; stroke-dasharray: .04 .04; animation: drawon 1.2s ease-out forwards, spin 40s linear infinite; }
svg.arena .node.site .glyph { stroke: var(--l2); stroke-width: 1.8; fill: rgba(78, 128, 168, .2); }
svg.arena .node.site .dish { stroke: var(--l2); stroke-width: 1.2; }
svg.arena .nodelabel { font: 700 15px var(--disp); letter-spacing: .08em; fill: var(--ink); opacity: 0; animation: fadein .5s ease forwards; animation-delay: calc(.9s + var(--i, 0) * .18s); }
svg.arena .nodesub { font: 12px 'Segoe UI'; fill: var(--ink2); opacity: 0; animation: fadein .5s ease forwards; animation-delay: calc(1.1s + var(--i, 0) * .18s); }
svg.arena .timeline { stroke: var(--line2); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawon 1.4s ease-out forwards; animation-delay: 1.6s; }
svg.arena .window .tick { stroke: var(--accent); stroke-width: 1.6; fill: rgba(232, 196, 106, .15); }
svg.arena .ticklabel { font: 700 13px var(--mono); fill: var(--accent); opacity: 0; animation: fadein .5s ease forwards; animation-delay: calc(1.9s + var(--i, 0) * .12s); }
svg.arena .ticksub { font: 11px 'Segoe UI'; fill: var(--ink3); opacity: 0; animation: fadein .5s ease forwards; animation-delay: calc(2s + var(--i, 0) * .12s); }
@keyframes drawon { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }
@keyframes beampulse { 0%, 100% { stroke-opacity: .55; } 50% { stroke-opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.arena-legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 10.5px; color: var(--ink3); }
.arena-legend li { white-space: nowrap; }
.arena-legend li .eyebrow { font-size: 9px; color: var(--accent-dim); }

/* ── fog scene ─────────────────────────────────── */
.fog { display: grid; grid-template-columns: 1fr 44px 1fr; gap: 10px; align-items: stretch; width: 100%; }
.fogboard { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; min-width: 0; }
.fogboard.truth { border-color: var(--line2); }
.fogboard.told { border-color: var(--accent-dim); }
.fogboard h3 { margin: 0 0 8px; font: 700 13px/1.3 var(--disp); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.fogboard h3 .eyebrow { display: block; margin-bottom: 2px; }
.fogboard.told h3 .eyebrow { color: var(--accent-dim); }
.fogrows { display: flex; flex-direction: column; gap: 4px; }
.fogrow { display: grid; grid-template-columns: minmax(56px, 150px) repeat(3, 34px) 1fr; gap: 6px; align-items: center; padding: 4px 0; transition: opacity .6s ease; }
.fogrow.head { color: var(--ink3); }
.fogrow .foglabel { font: 700 11.5px/1.3 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.fogrow .fogdim { text-align: center; }
.fogrow .fogchip { justify-self: end; }
.fogrow .fogcell .lv { min-width: 30px; text-align: center; padding: 4px 0; display: inline-block; }
.fogboard.told .fogrow.blanked { opacity: .78; }
.fogboard.told .fogrow[data-label="inferred"] .foglabel { color: var(--ink3); }
.fogstale { font-size: 10.5px; color: var(--warn); margin: -4px 0 8px; }
.fogcap { margin: 10px 0 0; font-size: 10.5px; color: var(--ink3); line-height: 1.5; }
.fogdissolve { position: relative; }
.fogdissolve::before { content: ""; position: absolute; left: 50%; top: 10%; bottom: 10%; width: 1px; background: linear-gradient(to bottom, transparent, var(--accent-dim), transparent); }
.fogdissolve::after { content: "▶"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--accent-dim); font-size: 14px; background: var(--bg); padding: 4px; animation: nudge 2.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { opacity: .5; transform: translate(-50%, -50%); } 50% { opacity: 1; transform: translate(-30%, -50%); } }
.fog[data-epoch="0"] .fogboard.told { box-shadow: none; }
.fog[data-epoch="3"] .fogboard.told { box-shadow: inset 0 0 0 1px rgba(224, 113, 76, .35); }
.foglegend { margin-top: 14px; }
.foglegend-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 8px; }
.fogchipbtn { background: none; border: 1px solid transparent; border-radius: 4px; padding: 4px; cursor: pointer; }
.fogchipbtn[aria-pressed="true"] { border-color: var(--accent-dim); background: rgba(232, 196, 106, .06); }
.fogchipbtn:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 1px; }
.fogmeaning { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink); max-width: 900px; min-height: 2.6em; text-wrap: pretty; }

/* ── pipeline scene ────────────────────────────── */
svg.pipeline { width: 100%; max-height: 40vh; height: auto; display: block; overflow: visible; }
svg.pipeline .rail { stroke: var(--line2); stroke-width: 2; }
svg.pipeline .fan { fill: none; stroke: var(--line2); stroke-width: 1.2; stroke-dasharray: 4 5; transition: stroke .4s; }
svg.pipeline .fan.lit { stroke: var(--l2); }
svg.pipeline .fan.own.lit { stroke: var(--accent); }
svg.pipeline .lanelabel { font: 11px 'Segoe UI'; fill: var(--ink3); }
svg.pipeline .lanelabel.own { font: 700 12px var(--disp); letter-spacing: .06em; fill: var(--accent); }
svg.pipeline .stage .ring { fill: var(--panel); stroke: var(--line2); stroke-width: 1.5; transition: stroke .35s, filter .35s; }
svg.pipeline .stage .core { fill: var(--line2); transition: fill .35s; }
svg.pipeline .stage .stagenum { font: 700 10px var(--mono); fill: var(--bg); }
svg.pipeline .stage.lit .ring { stroke: var(--accent); filter: drop-shadow(0 0 8px rgba(232, 196, 106, .5)); }
svg.pipeline .stage.lit .core { fill: var(--accent); }
svg.pipeline .stagelabel { font: 700 12px var(--disp); letter-spacing: .1em; fill: var(--ink2); }
svg.pipeline .stage.lit .stagelabel { fill: var(--ink); }
svg.pipeline .stagesub { font: 10px 'Segoe UI'; fill: var(--ink3); }
svg.pipeline .packet { fill: var(--accent); filter: drop-shadow(0 0 6px rgba(232, 196, 106, .8)); }
svg.pipeline .fanpacket { fill: var(--l3); }
svg.pipeline .fanpacket.own { fill: var(--accent); }

/* ── console replica ───────────────────────────── */
.replica.console { padding: 0; max-width: none; font-size: 13px; }
.replica .grid { grid-template-columns: 1fr 1.2fr 1fr; }
.replica .cmdbar { margin-bottom: 8px; }
.replica .hotspot { transition: box-shadow .4s, border-color .4s, opacity .4s; }
/* The console's 44px window-id column cannot carry a package label such as
   "Coalition contract"; in the replica the id column sizes to its text (seen live on the commercial seat). */
.replica .swrow .swid { width: auto; min-width: 44px; max-width: 160px; flex: 0 0 auto; }
.replica .panel.hotspot { cursor: pointer; }
.replica .panel.hotspot:focus-visible, .replica .nowhost:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 2px; }
.replica .hotspot.spot { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 196, 106, .18), 0 0 26px rgba(232, 196, 106, .2); }
.replica:not(.static) .hotspot:not(.spot) { opacity: .72; }
.replica .nowhost { display: block; width: 100%; background: none; border: 0; padding: 0; margin: 0 0 8px; text-align: left; cursor: pointer; color: inherit; font: inherit; border-radius: 6px; }
.replica .nowhost .nowbar { margin: 0; }
.replica .replica-dim { padding: 5px 0; border-bottom: 1px solid var(--line); gap: 6px; }
.replica .replica-dim .echip { margin-left: auto; }
.replica .epilegend { margin-bottom: 8px; }
.spotintro { margin-top: 12px; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 6px 6px 0; max-width: 820px; }
.spotintro .eyebrow { color: var(--accent); }
.spotintro p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--ink); }

/* ── practice chapter (chapter 4) ──────────────── */
.practice-composer .composer { background: var(--panel); border: 1px solid var(--line2); border-radius: 6px; padding: 14px 16px; }
.practice-composer .composer h2 { margin: 0 0 4px; font: 600 11.5px/1 var(--disp); letter-spacing: .14em; text-transform: uppercase; color: var(--ink2); }
.practice-composer .panelintro { margin: 0 0 10px; font-size: 11.5px; color: var(--ink2); }
.practice-why p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink); line-height: 1.5; }
.practice-composer .typestep { margin: 0 0 10px; }
.practice-composer .typegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; margin-top: 6px; }
.practice-composer .otype { text-align: left; background: var(--panel2); border: 1px solid var(--line2); border-radius: 4px; color: var(--ink); cursor: pointer; font: 12px/1.45 'Segoe UI'; padding: 7px 10px; }
.practice-composer .otype b { font: 600 10px/1.4 var(--mono); color: var(--ink2); display: block; }
.practice-composer .otype small { display: block; color: var(--ink3); font-size: 10.5px; margin-top: 2px; }
.practice-composer .otype:hover { border-color: var(--accent-dim); }
.practice-composer .otype:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 1px; }
.practice-composer .otype[aria-pressed="true"] { border-color: var(--accent); }
.practice-composer .otype[aria-pressed="true"] b { color: var(--accent); }
.practice-composer .otype.is-practice { border-style: dashed; }
.practice-composer .otype .st { margin-left: 6px; }
.practice-composer .compform .exline { grid-column: 2; margin-top: -4px; }
.practice-composer .exline .eyebrow { color: var(--accent-dim); }
.practice-composer .exbtn { display: block; width: 100%; box-sizing: border-box; text-align: left; background: none; border: 1px dashed var(--line2); border-radius: 4px; color: var(--ink2); cursor: pointer; font: 11.5px/1.45 'Segoe UI'; padding: 6px 9px; margin-top: 3px; }
.practice-composer .exbtn:hover { border-color: var(--accent-dim); color: var(--ink); }
.practice-composer .exbtn:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 1px; }
.practice-composer .comprow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; }
.practice-composer .submit { font: 700 11.5px/1 var(--disp); letter-spacing: .14em; padding: 10px 16px; cursor: pointer; }
.practice-composer .ghost { font: 600 11px/1 var(--disp); letter-spacing: .12em; padding: 9px 12px; cursor: pointer; }
.practice-composer .orders { display: flex; flex-direction: column; gap: 8px; }
.practice-composer .order .st-gold { margin-left: auto; }
.flowcap { margin: 16px 0 4px; color: var(--accent-dim); }
.practice-flow { opacity: .55; transition: opacity .5s; }
.flowing .practice-flow, .delivered .practice-flow { opacity: 1; }
.practice-proposal { margin: 10px 0 0; max-width: 720px; }
.practice-proposal .eyebrow { display: block; margin-bottom: 6px; color: var(--accent-dim); }
.practice-proposal .order { animation: rise .5s ease both; }
.practice-inbox { margin-top: 14px; }
.practice-inbox .msg.delivery { animation: rise .6s ease both; border-color: var(--accent-dim); }
.msg .headline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg .headline b { font-weight: 600; color: var(--ink); }
.msg .provenance { margin-top: 8px; font-size: 11px; color: var(--ink2); border-left: 2px solid var(--accent-dim); padding-left: 8px; font-style: italic; }
.msg .provenance b { color: var(--ink3); font-style: normal; font-weight: 600; font-size: 9.5px; letter-spacing: .08em; }
.msg .vcard { margin-top: 6px; }
.practice-feedback { margin: 12px 0 0; padding: 10px 14px; border-left: 3px solid var(--good); background: var(--panel); border-radius: 0 6px 6px 0; font-size: 13px; line-height: 1.55; color: var(--ink); max-width: 820px; }

/* ── responsive ────────────────────────────────── */
@media (max-width: 900px) {
  .briefing { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .rail { grid-row: 1; flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .raillist { flex-direction: row; }
  .railbtn .railtitle { display: none; }
  .railmeter, .railtag { display: none; }
  .rail .skip { align-self: center; margin-left: auto; flex: none; }
  .stage, .controls { grid-column: 1; }
  .stage { grid-row: 2; }
  .controls { grid-row: 3; }
  .replica .grid { grid-template-columns: 1fr; }
  .fog { grid-template-columns: 1fr; }
  .fogdissolve { display: none; }
  .chapter .copy, .chapter .interactive { padding-left: 18px; padding-right: 18px; }
}

/* ── reduced motion: every scene has its static equivalent ───────────── */
@media (prefers-reduced-motion: reduce) {
  .chapter { transform: none; transition: opacity .2s linear; }
  .stage { scroll-behavior: auto; }
  .railmeter .railfill { transition: none; }
  .dcard, .recap li, .practice-proposal .order, .practice-inbox .msg.delivery { animation: none; }
  svg.arena *, svg.arena .node .halo { animation: none !important; stroke-dashoffset: 0 !important; opacity: 1 !important; }
  .fogdissolve::after { animation: none; }
  .replica .hotspot { transition: none; }
}
.reduced-motion .chapter { transform: none; transition: opacity .2s linear; }
.reduced-motion svg.arena *, .reduced-motion svg.arena .node .halo { animation: none !important; stroke-dashoffset: 0 !important; opacity: 1 !important; }
.reduced-motion .fogdissolve::after { animation: none; }
.reduced-motion .dcard, .reduced-motion .recap li { animation: none; }

/* ── arena: pulsing link levels (the link matrix's own ramp) ─── */
svg.arena .beam.lv0 { --beam: var(--l0); --beam-glow: rgba(30, 48, 64, .5); --pulse: 4.6s; }
svg.arena .beam.lv1 { --beam: var(--l1); --beam-glow: rgba(46, 82, 113, .55); --pulse: 4s; }
svg.arena .beam.lv2 { --beam: var(--l2); --beam-glow: rgba(78, 128, 168, .6); --pulse: 3.2s; }
svg.arena .beam.lv3 { --beam: var(--l3); --beam-glow: rgba(121, 175, 217, .7); --pulse: 2.4s; }
svg.arena .beam .beamline { stroke: var(--beam, var(--l2)); animation-duration: 1.1s, var(--pulse, 3.2s); }
svg.arena .beam .beamglow { stroke: var(--beam-glow, transparent); stroke-width: 6; stroke-linecap: round; stroke-dasharray: .06 .94; stroke-dashoffset: 1; opacity: 0; animation: beamtravel var(--pulse, 3.2s) linear infinite, fadein .4s ease forwards; animation-delay: calc(1.8s + var(--i, 0) * .3s), calc(1.8s + var(--i, 0) * .3s); }
svg.arena .beam.lv0 .beamglow, svg.arena .beam.lv1 .beamglow { stroke-dasharray: .03 .97; }
svg.arena .beamtag { fill: var(--bg); stroke: var(--beam, var(--line2)); stroke-width: 1; opacity: 0; animation: fadein .6s ease forwards; animation-delay: calc(1.3s + var(--i, 0) * .22s); }
svg.arena .beamlevel { font: 700 12px var(--mono); fill: var(--beam, var(--l3)); opacity: 0; animation: fadein .6s ease forwards; animation-delay: calc(1.3s + var(--i, 0) * .22s); }
svg.arena .beam.lv3 .beamlevel, svg.arena .beam.lv2 .beamlevel { fill: var(--beam); }
svg.arena .arena-empty { font: 600 12px var(--disp); letter-spacing: .12em; fill: var(--ink3); }
@keyframes beamtravel { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.arena-links { margin: 14px 0 0; }
.arena-links .eyebrow { display: block; margin-bottom: 4px; }
.arena-linkrow { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.arena-link { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.arena-link b { font: 700 11px var(--mono); color: var(--ink); }
.arena-link .lv { min-width: 26px; text-align: center; padding: 4px 0; animation: cellpulse 3.2s ease-in-out infinite; animation-delay: calc(2s + var(--i, 0) * .4s); }
.arena-link.lv3 .lv { animation-duration: 2.4s; } .arena-link.lv1 .lv { animation-duration: 4s; } .arena-link.lv0 .lv { animation-duration: 4.6s; }
@keyframes cellpulse { 0%, 100% { filter: brightness(.85); } 50% { filter: brightness(1.2); } }

/* ── fog: the dissolve wipe, the ticking age, the legend spotlight ─ */
.fogboard.told { position: relative; overflow: hidden; }
.fogwipe { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(100deg, transparent 0%, rgba(232, 196, 106, .16) 45%, rgba(11, 17, 24, .85) 50%, transparent 100%); background-size: 260% 100%; }
.fogwipe.wipe-a { animation: fogwipe .9s ease-out forwards; }
.fogwipe.wipe-b { animation: fogwipe-b .9s ease-out forwards; }
@keyframes fogwipe { 0% { opacity: 1; background-position: 120% 0; } 100% { opacity: 0; background-position: -60% 0; } }
@keyframes fogwipe-b { 0% { opacity: 1; background-position: 120% 0; } 100% { opacity: 0; background-position: -60% 0; } }
.fogrow .fogage { margin-left: 6px; font: 700 9.5px var(--mono); color: var(--warn); }
.fogrow .fogage:empty { display: none; }
.fogstale[data-stale="1"] { color: var(--warn); }
.fogstale[data-stale="2"] { color: var(--serious); }
.fogstale::before { content: "◔ "; }
.fogstale[data-stale="0"]::before { content: "● "; color: var(--good); }
.fogstale[data-stale="2"]::before { content: "○ "; }
.fog[data-spot] .fogboard.told .fogrow:not(.head) { transition: opacity .3s, background .3s; }
.fog[data-spot="known"] .fogboard.told .fogrow:not(.head):not([data-label="known"]),
.fog[data-spot="assessed"] .fogboard.told .fogrow:not(.head):not([data-label="assessed"]),
.fog[data-spot="reported"] .fogboard.told .fogrow:not(.head):not([data-label="reported"]),
.fog[data-spot="inferred"] .fogboard.told .fogrow:not(.head):not([data-label="inferred"]) { opacity: .35; }
.fog[data-spot="known"] .fogboard.told .fogrow[data-label="known"],
.fog[data-spot="assessed"] .fogboard.told .fogrow[data-label="assessed"],
.fog[data-spot="reported"] .fogboard.told .fogrow[data-label="reported"],
.fog[data-spot="inferred"] .fogboard.told .fogrow[data-label="inferred"] { background: rgba(232, 196, 106, .07); border-radius: 3px; }

/* ── pipeline: per-cell landing pads ───────────── */
svg.pipeline .lanepad { fill: var(--panel); stroke: var(--line2); stroke-width: 1.2; transition: fill .3s, stroke .3s, filter .3s; }
svg.pipeline .lanepad.landed { fill: var(--l2); stroke: var(--l3); }
svg.pipeline .lanepad.own.landed { fill: var(--accent); stroke: var(--accent); filter: drop-shadow(0 0 8px rgba(232, 196, 106, .7)); }
svg.pipeline .lanepad.control.landed { fill: var(--panel2); stroke: var(--warn); }

/* ── decisions: how the console would prompt you ── */
.interactive .seeprompt { font: 600 11px/1 var(--disp); letter-spacing: .12em; padding: 9px 14px; cursor: pointer; }
.interactive .seeprompt[aria-expanded="true"] { border-color: var(--accent-dim); color: var(--accent); }
.practice-situation { margin: 12px 0 0; max-width: 860px; animation: rise .5s ease both; }
.practice-situation .eyebrow { display: block; margin-bottom: 6px; }
.practice-situation .situation-list { display: flex; flex-direction: column; gap: 6px; }
.practice-situation .scard { display: flex; gap: 10px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 7px 10px; animation: rise .5s ease both; }
.practice-situation .scard p { flex: 1; margin: 0; font-size: 12px; color: var(--ink); line-height: 1.45; }
.practice-situation .scard small { display: block; font: 600 9.5px/1.4 var(--mono); color: var(--ink3); }
.practice-situation .scard .ghost { flex: none; padding: 6px 12px; font-size: 10px; cursor: pointer; }
.practice-situation .practice-feedback { margin-top: 10px; }
.practice-situation .fogcap { margin-top: 8px; }

/* ── recap: the trail of what was shown ────────── */
.recapwrap { max-width: 860px; }
.trail { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.trailstop { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 10px 12px; animation: rise .5s ease both; animation-delay: calc(var(--i, 0) * 90ms); }
.trailstop.seen { border-color: var(--accent-dim); }
.trailstop.skipped { border-style: dashed; opacity: .75; }
.trailstop .trailnum { font: 700 13px var(--mono); color: var(--accent); }
.trailstop.skipped .trailnum { color: var(--ink3); }
.trailstop .trailtext b { display: block; font: 700 11px/1.3 var(--disp); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.trailstop .trailtext span { display: block; font-size: 11.5px; line-height: 1.45; color: var(--ink2); margin-top: 2px; }
.trailstop .trailmark { grid-column: 2; font-size: 9px; color: var(--accent-dim); }
.trailstop.skipped .trailmark { color: var(--warn); }
.trailcap { margin: 0 0 14px; font-size: 11.5px; color: var(--ink3); }
@media (prefers-reduced-motion: reduce) {
  .arena-link .lv, .trailstop, .practice-situation, .practice-situation .scard { animation: none; }
  .fogwipe { display: none; }
  svg.arena .beamglow { display: none; }
}
.reduced-motion .arena-link .lv, .reduced-motion .trailstop, .reduced-motion .practice-situation .scard { animation: none; }
.reduced-motion .fogwipe { display: none; }
.reduced-motion svg.arena .beamglow { display: none; }
