/* Extend the existing landing tokens; the story shares the site's paper/ink/blue palette. */
.hero-grid { display: block; }
.hero-copy { max-width: none; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); column-gap: 64px; }
.hero-preview, .hero h1, .hero-secondary, .hero-trust { grid-column: 1 / -1; }
.hero-tagline, .hero .sub, .hero-vibe, .incident-enter { grid-column: 1; }
.hero .hero-quest-card { grid-column: 2; grid-row: 3 / 7; align-self: start; margin-top: 0; }
.hero .incident-enter { justify-self: start; }
.hero h1 { max-width: 980px; font-size: clamp(2.25rem, 1.5rem + 3vw, 4.125rem); line-height: 1.2; }
.hero h1 em { display: block; }
.hero .sub, .hero .hero-vibe { max-width: 720px; }
.hero .hero-quest-card { max-width: 720px; }
.incident-enter {
  display: inline-flex; align-items: center; min-height: 44px;
  margin: 24px 0 0; padding: 12px 22px; border-radius: 999px;
  background: var(--blue); color: var(--paper); font-size: 14px; font-weight: 700;
  text-decoration: none;
}
.incident-enter:hover { background: #075197; }
.incident-story {
  --signal: var(--blue);
  padding: 64px 0 0; position: relative;
  color: var(--ink); background: var(--paper-2); border-top: 1px solid var(--line-soft);
}
.incident-intro { padding-bottom: 32px; }
.incident-story h2 { font-size: clamp(1.75rem, .5rem + 2.5vw, 2.5rem); line-height: 1.35; margin: 12px 0 16px; }
.incident-intro > p:last-child { color: var(--ink-3); font-size: 12px; line-height: 1.7; text-wrap: balance; }
.incident-kicker { color: var(--ink-3); font: 11px var(--font-mono); letter-spacing: .06em; }
.incident-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.incident-stage {
  position: sticky; top: 85px; min-width: 0; height: 570px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  box-shadow: 0 10px 30px rgba(8, 20, 37, .06);
}
.incident-stage-top {
  position: absolute; inset: 0 0 auto; padding: 16px 20px;
  display: flex; justify-content: space-between;
  color: var(--ink-3); background: var(--paper-3); font: 10px var(--font-mono);
  letter-spacing: .05em; border-bottom: 1px solid var(--line);
}
.incident-world { position: absolute; inset: 45px 0 100px; overflow: hidden; }
.incident-wires { position: absolute; width: 100%; height: 100%; }
.incident-wires > path { fill: none; stroke: var(--blue); stroke-width: 2; }
.incident-wires .wire-other { stroke: #b42318; opacity: .12; stroke-dasharray: 8 8; }
.wire-node { fill: var(--blue); }
.incident-wires .wire-gate { stroke: var(--green); stroke-width: 3; opacity: .12; }
.incident-boundary { position: absolute; left: 38%; top: 5%; color: var(--ink-3); font-size: 10px; }
.incident-request { position: absolute; top: 78px; left: 24px; display: grid; gap: 10px; font-size: 11px; color: var(--ink-3); }
.incident-request code { color: var(--ink); font: 15px var(--font-mono); }
.incident-request b { color: var(--blue); }
.incident-record {
  position: absolute; top: 180px; right: 28px; width: min(280px, 68%);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(8, 20, 37, .06); transition: border-color .3s;
}
.record-header { display: flex; justify-content: space-between; padding: 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink-3); font: 9px var(--font-mono); letter-spacing: .04em; }
.record-dot { width: 6px; height: 6px; background: var(--signal); border-radius: 50%; }
.record-person { display: flex; align-items: center; gap: 12px; padding: 24px 16px; }
.record-avatar { display: grid; place-items: center; width: 38px; height: 42px; border-radius: 5px; background: var(--paper-3); color: var(--ink-2); font-size: 23px; }
.record-person strong { display: block; color: var(--ink); font-size: 16px; }
.record-person div > span { display: block; color: var(--ink-3); font: 11px var(--font-mono); margin-top: 5px; }
.record-footer { display: flex; justify-content: space-between; padding: 12px 14px; border-top: 1px solid var(--line-soft); color: var(--ink-3); font-size: 10px; }
.record-denied { padding: 20px 15px; display: flex; align-items: center; gap: 14px; color: var(--green); font: 14px var(--font-mono); }
.record-lock { font-size: 38px; font-weight: 300; }
.incident-result { position: absolute; left: 24px; right: 24px; bottom: 142px; display: grid; gap: 8px; }
.incident-result strong { position: relative; width: fit-content; padding: 2px 6px; margin-left: -6px; background: var(--paper); color: var(--green); font: 24px var(--font-mono); }
.incident-result > span { font-size: 12px; color: var(--ink-2); min-height: 36px; }
.incident-controls { position: absolute; bottom: 18px; left: 24px; right: 24px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.incident-controls button { cursor: pointer; font: 12px var(--font-sans); border-radius: 6px; padding: 11px 12px; min-height: 44px; }
.incident-identities { display: flex; width: 100%; gap: 8px; }
.incident-identities button { background: var(--paper); border: 1px solid var(--ink-4); color: var(--ink-2); flex: 1; }
.incident-identities [aria-pressed="true"] { border-color: var(--blue); color: var(--blue); background: #eef3fb; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.incident-fix { border: 1px solid var(--blue); background: var(--blue); color: var(--paper); flex: 1; font-weight: 700; }
.incident-fix:hover { background: #075197; }
.incident-reset { border: 1px solid var(--ink-4); background: var(--paper); color: var(--ink-2); }
.incident-chapter { min-height: 74vh; min-height: 74dvh; padding: 72px 0; scroll-margin-top: 100px; }
.incident-chapter :is(h3,h4) { font-size: clamp(1.625rem, .5rem + 2vw, 2.25rem); line-height: 1.4; margin: 16px 0 20px; }
.incident-chapter p { font-size: 15px; line-height: 1.9; color: var(--ink-2); }
.incident-chapter a { display: inline-block; color: var(--blue); margin-top: 24px; text-underline-offset: 5px; }
.incident-chapter .incident-insight { margin-top: 24px; padding-left: 16px; border-left: 2px solid #b42318; color: var(--ink-2); }
.incident-rule { display: block; font-size: 11px; color: var(--ink-2); margin-top: 24px; overflow-wrap: anywhere; }
/* Only the data echo fragments. Essential text stays in the readable DOM record. */
.incident-echo { position: absolute; inset: 90px 0 0; opacity: .12; }
.incident-echo i { display: block; width: 150px; height: 16px; margin: 12px 0 0 30%; border: 1px solid var(--signal); background: var(--paper-3); }
.incident-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.incident-canvas > [drawable] { width: 250px; padding: 14px; color: var(--ink-2); background: var(--paper-3); border: 1px solid var(--line); border-radius: 6px; font: 12px var(--font-mono); }
.incident-canvas > [drawable] strong { display: block; margin-bottom: 10px; }
.incident-story[data-renderer="canvas"] .incident-canvas { opacity: .45; }
.incident-story[data-renderer="canvas"][data-phase] .incident-echo { opacity: 0; }
.incident-story[data-phase="1"][data-person="other"] { --signal: #b42318; }
[data-phase="1"][data-person="other"] .incident-wires .wire-other { opacity: 1; }
[data-phase="1"][data-person="other"] .incident-record { border-color: #b42318; transform: translateY(-6px); }
[data-phase="1"][data-person="other"] .incident-result strong { position: relative; width: fit-content; padding: 2px 6px; margin-left: -6px; background: var(--paper); color: #b42318; }
[data-phase="1"][data-person="other"] .incident-echo { opacity: .3; transform: translate(-48px, 24px); }
.incident-story[data-phase="2"] { --signal: var(--green); }
[data-phase="2"] .incident-wires .wire-other { opacity: 0; }
.incident-wires .wire-blocked { stroke: #b42318; opacity: 0; }
[data-phase="2"][data-person="other"] .incident-wires .wire-blocked { opacity: .65; }
[data-phase="2"] .incident-wires .wire-gate { opacity: 1; }
[data-phase="2"] .incident-boundary { color: var(--green); }
[data-phase="2"] .incident-record { border-color: var(--green); }
[data-phase="2"] .incident-echo { transform: translate(-48px, 0); opacity: .08; }
.incident-outro { padding-top: 64px; padding-bottom: 64px; border-top: 1px solid var(--line); }
.incident-outro > p:not(.incident-kicker) { max-width: 720px; color: var(--ink-2); line-height: 1.8; }
.incident-outro .incident-development { margin: 24px 0; padding-left: 16px; border-left: 2px solid var(--line); font-size: 13px; }
.incident-demo-link { display: inline-block; color: var(--blue); font-weight: 700; text-underline-offset: 5px; margin-bottom: 12px; }
.incident-outro .incident-demo-note { font-size: 12px; color: var(--ink-3); }
.incident-story [hidden] { display: none; }
.incident-story :focus-visible, .hero a:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
@media (max-width: 980px) {
  .hero-copy { display: block; }
  .hero .hero-quest-card { margin-top: 28px; }
  .incident-layout { grid-template-columns: 1fr; gap: 0; }
  .incident-stage { top: 110px; height: 410px; z-index: 3; }
  .incident-intro { padding-bottom: 24px; }
  .incident-world { bottom: 80px; }
  .incident-request { top: 55px; left: 16px; font-size: 10px; gap: 4px; }
  .incident-request code { font-size: 12px; }
  .incident-record { top: 110px; right: 14px; width: 220px; }
  .record-person { padding: 14px; }
  .record-denied { padding: 12px 14px; }
  .record-lock { font-size: 28px; }
  .record-header, .record-footer { padding: 8px 12px; }
  .record-person strong { font-size: 14px; }
  .incident-result { left: 16px; bottom: 118px; gap: 3px; }
  .incident-result strong { position: relative; width: fit-content; padding: 2px 6px; margin-left: -6px; background: var(--paper); font-size: 20px; }
  .incident-result > span { font-size: 11px; min-height: 20px; }
  .incident-controls { left: 16px; right: 16px; bottom: 12px; gap: 6px; }
  .incident-controls button { padding: 8px; min-height: 44px; font-size: 11px; }
  .incident-chapter { min-height: 75vh; min-height: 75dvh; padding: 40px 0; scroll-margin-top: 500px; }
  .incident-chapter :is(h3,h4) { font-size: 1.75rem; }
  .incident-chapter p { font-size: 14px; }
  .incident-boundary { top: 2%; left: 45%; font-size: 9px; }
  .incident-outro { padding-top: 48px; padding-bottom: 48px; }
}
@media (max-height: 650px) { .incident-stage { position: relative; top: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .incident-record { transition: border-color .3s, transform .5s; }
  .incident-echo { transition: transform .5s, opacity .5s; }
}
@media print {
  .incident-story { background: white; }
  .incident-stage { display: none; }
  .incident-layout { display: block; }
  .incident-chapter { min-height: 0; padding: 20px 0; break-inside: avoid; }
  .incident-outro { padding: 25px; }
}

.landing-skip { position: fixed; top: 12px; left: 12px; z-index: 100; transform: translateY(-180%); padding: 12px 18px; background: var(--blue); color: var(--paper); border-radius: 6px; }
.landing-skip:focus { transform: none; outline: 3px solid var(--ink); outline-offset: 3px; }
@media (forced-colors: active) {
  .incident-story { --signal: CanvasText; }
  .incident-stage, .incident-record, .incident-canvas > [drawable] { border-color: CanvasText; }
  .incident-controls button { border-color: ButtonText; background: ButtonFace; color: ButtonText; }
  .incident-identities [aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -4px; }
  .incident-wires > path { stroke: CanvasText; }
  .wire-node { fill: CanvasText; }
  .incident-story :focus-visible, .hero a:focus-visible { outline-color: Highlight; }
}
