:root {
  --story-copy-duration: 220ms;
  --story-film-duration: 140ms;
  --story-hold: 15svh;
  --story-gutter: clamp(2rem, 5.5vw, 5rem);
}

/*
 * Static first: every step remains a normal article with its authored poster.
 * The sticky overlay below is enabled only by the runtime capability class.
 */
.story-chapter {
  --story-canvas-top: #fdf4e7;
  --story-canvas-bottom: #b3cfdb;
  position: relative;
  background: var(--surface);
}

/* Contained films extend their own flat edge colors into the spare stage bands. */
.story-chapter[data-current-step="request"],
.story-chapter[data-current-step="request-context"],
.story-chapter[data-current-step="request-consequence"] {
  --story-canvas-top: #fef3e7;
  --story-canvas-bottom: #dce5e8;
}

.story-chapter[data-current-step="owners"],
.story-chapter[data-current-step="unowned"] {
  --story-canvas-top: #fcf2e8;
  --story-canvas-bottom: #fcf2e7;
}

.story-chapter[data-current-step="missing-role"],
.story-chapter[data-current-step="officer"] {
  --story-canvas-top: #fbf2e8;
  --story-canvas-bottom: #e1e7e9;
}

.story-chapter[data-current-step="prompt"],
.story-chapter[data-current-step="tool-action"],
.story-chapter[data-current-step="model-cost"],
.story-chapter[data-current-step="runtime"],
.story-chapter[data-current-step="policy"] {
  --story-canvas-top: #fcf2e7;
  --story-canvas-bottom: #fbf1e7;
}

.story-chapter[data-current-step="scenario-tool"] {
  --story-canvas-top: #fdf1e3;
  --story-canvas-bottom: #e1e7e9;
}

.story-chapter[data-current-step="scenario-context"] {
  --story-canvas-top: #fef3e6;
  --story-canvas-bottom: #e2e8ea;
}

.story-chapter[data-current-step="scenario-model"] {
  --story-canvas-top: #fcf0e2;
  --story-canvas-bottom: #e5e9ea;
}

.story-chapter[data-current-step="outcomes"] {
  --story-canvas-top: #f9eee2;
  --story-canvas-bottom: #dbe4e5;
}

.story-chapter[data-current-step="agent-tool"] {
  --story-canvas-top: #faf4ee;
  --story-canvas-bottom: #faf5ee;
}

.story-chapter[data-current-step="agent-data"] {
  --story-canvas-top: #f7f1ec;
  --story-canvas-bottom: #f6f0eb;
}

.story-chapter[data-current-step="agent-consequence"] {
  --story-canvas-top: #f8f3ee;
  --story-canvas-bottom: #f9f3ee;
}

.story-chapter[data-current-step="convergence"],
.story-chapter[data-current-step="invitation"] {
  --story-canvas-top: #f6f0eb;
  --story-canvas-bottom: #f5f0eb;
}

/*
 * One ground for the whole ribbon. The films, the story chapters and the trust
 * interludes all sit on the ivory paper surface, so nothing reads as a stripe
 * and no seam appears where a film ends. Section separation is carried by
 * space and by rule weight instead of by a change of ground.
 */
#evidence {
  background: var(--surface);
}

#evidence {
  border-block-color: var(--rule-strong);
}

#team {
  border-bottom-color: var(--rule-strong);
}

.story-rail {
  position: relative;
}

.story-stage {
  display: none;
}

.story-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.story-step {
  display: grid;
  width: min(calc(100% - clamp(2rem, 8vw, 7rem)), 68rem);
  min-height: 72svh;
  margin-inline: auto;
  padding-block: clamp(3.5rem, 8vw, 7rem);
  border-top: 1px solid var(--rule);
  align-content: center;
}

.story-step:first-child {
  border-top: 0;
}

.story-copy {
  max-width: 38rem;
}

.story-copy h1 {
  font-size: clamp(3rem, 7vw, 5rem);
}

.story-copy h2,
.story-copy h3 {
  font-size: clamp(2rem, 5vw, 3.8rem);
}

.story-copy > p {
  max-width: 68ch;
  margin-top: var(--space-4);
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.25vw, 1.12rem);
  font-weight: 550;
}

.story-eyebrow {
  margin: 0 0 var(--space-4) !important;
  color: var(--signal-deep) !important;
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-subhead {
  max-width: 60ch !important;
  font-weight: 650 !important;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.story-step-fallback {
  width: 100%;
  margin-top: var(--space-6);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--surface);
}

.story-step-fallback img {
  width: 100%;
  height: auto;
  max-height: 58dvh;
  border: 0;
  border-radius: 0;
  object-fit: contain;
}

/* Static story: a measured editorial spread, never a cinematic rail dump. */
@media (min-width: 768px) {
  html:not(.story-capable) .story-step {
    width: min(calc(100% - clamp(3rem, 8vw, 8rem)), 76rem);
    grid-template-columns: minmax(0, 0.88fr) minmax(22rem, 1.12fr);
    gap: clamp(2.5rem, 6vw, 6.5rem);
    align-items: center;
  }

  html:not(.story-capable) [data-story-step="boundary"] .story-copy,
  html:not(.story-capable) [data-story-step="owners"] .story-copy,
  html:not(.story-capable) [data-story-step="officer"] .story-copy,
  html:not(.story-capable) [data-story-step="tool-action"] .story-copy,
  html:not(.story-capable) [data-story-step="runtime"] .story-copy,
  html:not(.story-capable) [data-story-step="scenario-context"] .story-copy,
  html:not(.story-capable) [data-story-step="outcomes"] .story-copy,
  html:not(.story-capable) [data-story-step="agent-data"] .story-copy,
  html:not(.story-capable) [data-story-step="invitation"] .story-copy {
    grid-column: 2;
  }

  html:not(.story-capable) [data-story-step="boundary"] .story-step-fallback,
  html:not(.story-capable) [data-story-step="owners"] .story-step-fallback,
  html:not(.story-capable) [data-story-step="officer"] .story-step-fallback,
  html:not(.story-capable) [data-story-step="tool-action"] .story-step-fallback,
  html:not(.story-capable) [data-story-step="runtime"] .story-step-fallback,
  html:not(.story-capable) [data-story-step="scenario-context"] .story-step-fallback,
  html:not(.story-capable) [data-story-step="outcomes"] .story-step-fallback,
  html:not(.story-capable) [data-story-step="agent-data"] .story-step-fallback,
  html:not(.story-capable) [data-story-step="invitation"] .story-step-fallback {
    grid-row: 1;
    grid-column: 1;
  }

  html:not(.story-capable) .story-step-fallback {
    margin-top: 0;
  }
}

@media (min-width: 768px) and (max-height: 649px) {
  html:not(.story-capable) [data-story-chapter="threshold"] .story-step:first-child {
    min-height: calc(100svh - var(--header-height));
    padding-block: var(--space-4);
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.9fr);
    gap: var(--space-7);
  }

  html:not(.story-capable) [data-story-chapter="threshold"] .story-copy h1 {
    font-size: clamp(2.6rem, 5vw, 3.5rem);
  }

  html:not(.story-capable) [data-story-chapter="threshold"] .story-copy > p {
    font-size: 0.95rem;
    line-height: 1.48;
  }

  html:not(.story-capable) [data-story-chapter="threshold"] .hero-actions {
    margin-top: var(--space-3);
  }

  html:not(.story-capable) [data-story-chapter="threshold"] .story-step-fallback img {
    max-height: calc(100svh - var(--header-height) - 2rem);
  }
}

html:not(.story-capable) [data-story-chapter="officer-decision"] .story-steps {
  counter-reset: decision-state;
}

html:not(.story-capable) [data-story-chapter="officer-decision"] [data-story-step="prompt"],
html:not(.story-capable) [data-story-chapter="officer-decision"] [data-story-step="tool-action"],
html:not(.story-capable) [data-story-chapter="officer-decision"] [data-story-step="model-cost"],
html:not(.story-capable) [data-story-chapter="officer-decision"] [data-story-step="runtime"],
html:not(.story-capable) [data-story-chapter="officer-decision"] [data-story-step="policy"] {
  counter-increment: decision-state;
}

html:not(.story-capable) [data-story-chapter="officer-decision"] [data-story-step="prompt"] .story-copy::after,
html:not(.story-capable) [data-story-chapter="officer-decision"] [data-story-step="tool-action"] .story-copy::after,
html:not(.story-capable) [data-story-chapter="officer-decision"] [data-story-step="model-cost"] .story-copy::after,
html:not(.story-capable) [data-story-chapter="officer-decision"] [data-story-step="runtime"] .story-copy::after,
html:not(.story-capable) [data-story-chapter="officer-decision"] [data-story-step="policy"] .story-copy::after {
  display: block;
  margin-top: var(--space-5);
  color: var(--signal-deep);
  content: "Decision " counter(decision-state) " of 5";
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* JS-static modes expose a direct art index while retaining all source articles. */
.has-js:not(.story-capable) [data-story-chapter="officer-decision"] .story-stage,
.has-js:not(.story-capable) [data-story-chapter="scenario-outcomes"] .story-stage,
.has-js:not(.story-capable) [data-story-chapter="agentic-escalation"] .story-stage {
  position: relative;
  display: grid;
  width: min(calc(100% - clamp(2rem, 7vw, 7rem)), 76rem);
  min-height: 88dvh;
  margin-inline: auto;
  padding-block: clamp(2rem, 6dvh, 4.5rem);
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.42fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  border-block: 1px solid var(--rule);
  background: var(--surface);
  overflow: visible;
  isolation: isolate;
}

.has-js:not(.story-capable) .story-stage .story-media {
  display: none;
}

.has-js:not(.story-capable) .story-control-panels {
  min-width: 0;
  min-height: min(62dvh, 42rem);
  grid-row: 1;
  grid-column: 1;
}

.story-control-panel[hidden] {
  display: none !important;
}

.has-js:not(.story-capable) .story-control-panel {
  width: 100%;
  outline-offset: 6px;
}

.has-js:not(.story-capable) .story-control-panel-art,
.has-js:not(.story-capable) .story-control-panel-art img {
  width: 100%;
  height: min(62dvh, 42rem);
  border: 0;
  border-radius: 0;
  background: var(--surface);
  object-fit: contain;
}

.has-js:not(.story-capable) .story-director {
  display: grid;
  min-width: 0;
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  border-block: 1px solid var(--rule-strong);
  background: transparent;
}

.has-js:not(.story-capable) .story-director button {
  position: relative;
  min-width: 0;
  min-height: 44px;
  padding: 0.8rem 0.9rem;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: left;
}

.has-js:not(.story-capable) .story-director button:last-child {
  border-bottom: 0;
}

.has-js:not(.story-capable) .story-director button[aria-selected="true"] {
  color: var(--signal-deep);
  background: var(--field);
  box-shadow: inset 4px 0 0 var(--signal-deep);
}

.story-director-result {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.has-js.story-capable .story-control-panels,
.has-js.story-capable .story-director-result {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/*
 * The synchronous seed reserves the capable rail geometry without suppressing
 * authored content. Every copy block and fallback poster remains the usable
 * presentation until the module director projects coherent semantic state.
 */
html.has-js:is(.story-preflight, .story-static-shell) .story-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

html.has-js:is(.story-preflight, .story-static-shell) [data-story-chapter] .story-stage {
  position: sticky;
  top: var(--header-height);
  z-index: var(--z-art);
  display: block;
  width: 100%;
  min-height: 0;
  height: calc(100svh - var(--header-height));
  margin: 0;
  padding: 0;
  grid-area: 1 / 1;
  align-self: start;
  border: 0;
  overflow: clip;
  isolation: isolate;
  background: var(--surface);
}

html.has-js.story-static-shell .story-stage .story-media,
html.has-js:is(.story-preflight, .story-static-shell) .story-control-panels,
html.has-js:is(.story-preflight, .story-static-shell) .story-director {
  display: none;
}

html.has-js.story-preflight .story-stage .story-media,
html.has-js.story-preflight .story-stage .story-media picture,
html.has-js.story-preflight .story-stage .story-media img,
html.has-js.story-preflight .story-stage .story-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

html.has-js.story-preflight .story-stage .story-media {
  z-index: var(--z-art);
  display: block;
  margin: 0;
  overflow: hidden;
  background: var(--surface);
  pointer-events: none;
}

html.has-js.story-preflight .story-stage .story-media img,
html.has-js.story-preflight .story-stage .story-media video {
  max-width: none;
  object-fit: cover;
  object-position: var(--scene-focus, 50% 55%);
}

html.has-js.story-preflight .story-stage .story-poster,
html.has-js.story-preflight .story-stage [data-story-video] {
  opacity: 0;
}

html.has-js.story-preflight
  [data-story-chapter="threshold"] .story-stage [data-story-poster="question"] {
  opacity: 1;
}

html.has-js:is(.story-preflight, .story-static-shell) .story-steps {
  position: relative;
  z-index: var(--z-story);
  width: 100%;
  min-width: 0;
  grid-area: 1 / 1;
  padding: 0 0 var(--story-hold);
}

html.has-js:is(.story-preflight, .story-static-shell) .story-step {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 64svh;
  margin: 0;
  padding: clamp(1.5rem, 4svh, 2.75rem) var(--story-gutter);
  border: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

html.has-js:is(.story-preflight, .story-static-shell) .story-step:last-child,
html.has-js:is(.story-preflight, .story-static-shell) [data-story-chapter="officer-decision"] .story-step {
  min-height: 72svh;
}

/*
 * The opening beat carries less centring slack than the beats that follow, so
 * the first line of the hero sits nearer the header instead of drifting toward
 * the middle of the frame. The value is shared with the promoted rule below so
 * promotion moves nothing.
 */
html.has-js:is(.story-preflight, .story-static-shell)
  [data-story-chapter="threshold"] [data-story-step="question"] {
  min-height: 60svh;
}

html.has-js:is(.story-preflight, .story-static-shell) .story-step .story-step-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--surface);
}

html.has-js:is(.story-preflight, .story-static-shell) .story-step-fallback img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

html.has-js:is(.story-preflight, .story-static-shell) .story-step .story-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 38rem);
  max-width: 38rem;
  padding: clamp(1.2rem, 2.6vw, 2.25rem) clamp(1.25rem, 3.5vw, 3rem);
  grid-row: auto;
  grid-column: auto;
  background: rgb(251 245 236 / 92%);
  isolation: isolate;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

html.has-js:is(.story-preflight, .story-static-shell) .story-copy h1 {
  font-size: clamp(2.4rem, 3.6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.02;
  text-wrap: balance;
}

html.has-js:is(.story-preflight, .story-static-shell) .story-copy h2,
html.has-js:is(.story-preflight, .story-static-shell) .story-copy h3 {
  font-size: clamp(1.9rem, 2.35vw, 2.15rem);
  line-height: 1.08;
  text-wrap: balance;
}

html.has-js:is(.story-preflight, .story-static-shell) .story-copy > p {
  max-width: 65ch;
  font-size: clamp(0.96rem, 1.1vw, 1.08rem);
  line-height: 1.58;
}

html.has-js:is(.story-preflight, .story-static-shell)
  [data-story-chapter="officer-decision"] .story-step .story-copy::after {
  display: none;
}

/* The shared cinematic plane */
.has-js.story-capable .story-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.has-js.story-capable .story-stage {
  position: sticky;
  top: var(--header-height);
  z-index: var(--z-art);
  display: block;
  width: 100%;
  height: calc(100svh - var(--header-height));
  grid-area: 1 / 1;
  align-self: start;
  overflow: clip;
  isolation: isolate;
  background: var(--surface);
}

.has-js.story-capable .story-media,
.has-js.story-capable .story-media picture,
.has-js.story-capable .story-media img,
.has-js.story-capable .story-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.has-js.story-capable .story-media {
  z-index: var(--z-art);
  margin: 0;
  overflow: hidden;
  background: var(--story-canvas-top);
  pointer-events: none;
}

.has-js.story-capable .story-media::before,
.has-js.story-capable .story-media::after {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 0;
  height: 50%;
  content: "";
  pointer-events: none;
}

.has-js.story-capable .story-media::before {
  top: 0;
  background: var(--story-canvas-top);
}

.has-js.story-capable .story-media::after {
  bottom: 0;
  background: var(--story-canvas-bottom);
}

/*
 * The film fills the whole stage edge to edge (founder request, 2026-08-31):
 * cover, never letterbox bands. The authored focal point keeps the request
 * signal inside the crop at every aspect ratio.
 */
.has-js.story-capable .story-media img,
.has-js.story-capable .story-media video {
  max-width: none;
  object-fit: cover;
  object-position: var(--scene-focus, 50% 55%);
  filter: none;
  transform: none;
}

.has-js.story-capable .story-poster,
.has-js.story-capable [data-story-video] {
  opacity: 0;
  transition: opacity var(--story-film-duration) var(--ease-out);
}

.has-js.story-capable .story-poster {
  z-index: 1;
  transition: none;
}

.has-js.story-capable [data-media-state="loading"] .story-poster:first-child {
  opacity: 1;
  transition: none;
}

.has-js.story-capable .story-poster img[data-src]:not([src]) {
  visibility: hidden;
}

.has-js.story-capable [data-story-video] {
  z-index: 2;
}

.story-video[data-current-film="true"][data-media-state="ready"] {
  opacity: 1;
}

.has-js.story-capable [data-current-step="question"] [data-story-poster="question"],
.has-js.story-capable [data-current-step="boundary"] [data-story-poster="boundary"],
.has-js.story-capable [data-current-step="request"] [data-story-poster="request"],
.has-js.story-capable [data-current-step="request-context"] [data-story-poster="request-context"],
.has-js.story-capable [data-current-step="request-consequence"] [data-story-poster="request-consequence"],
.has-js.story-capable [data-current-step="owners"] [data-story-poster="owners"],
.has-js.story-capable [data-current-step="unowned"] [data-story-poster="unowned"],
.has-js.story-capable [data-current-step="missing-role"] [data-story-poster="missing-role"],
.has-js.story-capable [data-current-step="officer"] [data-story-poster="officer"],
.has-js.story-capable [data-current-step="prompt"] [data-story-poster="prompt"],
.has-js.story-capable [data-current-step="tool-action"] [data-story-poster="tool-action"],
.has-js.story-capable [data-current-step="model-cost"] [data-story-poster="model-cost"],
.has-js.story-capable [data-current-step="runtime"] [data-story-poster="runtime"],
.has-js.story-capable [data-current-step="policy"] [data-story-poster="policy"],
.has-js.story-capable [data-current-step="scenario-tool"] [data-story-poster="scenario-tool"],
.has-js.story-capable [data-current-step="scenario-context"] [data-story-poster="scenario-context"],
.has-js.story-capable [data-current-step="scenario-model"] [data-story-poster="scenario-model"],
.has-js.story-capable [data-current-step="outcomes"] [data-story-poster="outcomes"],
.has-js.story-capable [data-current-step="agent-tool"] [data-story-poster="agent-tool"],
.has-js.story-capable [data-current-step="agent-data"] [data-story-poster="agent-data"],
.has-js.story-capable [data-current-step="agent-consequence"] [data-story-poster="agent-consequence"],
.has-js.story-capable [data-current-step="convergence"] [data-story-poster="convergence"],
.has-js.story-capable [data-current-step="invitation"] [data-story-poster="invitation"] {
  opacity: 1;
}

.has-js.story-capable [data-media-state="loading"] .story-poster:not(:first-child) {
  opacity: 0;
}

.has-js.story-capable .story-poster[data-story-continuity-poster="true"] {
  opacity: 1;
  transition: none;
}

.has-js.story-capable [data-story-continuity-plane] {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  pointer-events: none;
  transition: none;
}

/* Ordered beats share the stage plane and create the physical scroll rail. */
.has-js.story-capable .story-steps {
  position: relative;
  z-index: var(--z-story);
  width: 100%;
  min-width: 0;
  grid-area: 1 / 1;
  padding: 0 0 var(--story-hold);
  pointer-events: none;
}

/*
 * Beat length follows the film. Every beat declares the seconds of film it
 * owns (mirroring story-timing.js) and its scroll distance is derived from
 * that, so a 6 second scenario film and a 1.6 second decision state no longer
 * get the same 64svh ride. About 19svh per film second keeps a deliberate
 * 300 px/s scroll near 1.8x film speed on a 900 px viewport.
 */
.has-js.story-capable .story-step {
  --beat-seconds: 3;
  --beat-floor: 60svh;
  display: grid;
  width: 100%;
  min-height: max(var(--beat-floor), calc(var(--beat-seconds) * 19svh));
  margin: 0;
  padding: 0 var(--story-gutter);
  border: 0;
  align-content: start;
  align-items: start;
}

/*
 * Beats that share one film keep EQUAL heights: the director switches beats at
 * the midpoint of their centres, and the scrub tween switches where the beats
 * touch. Those two points coincide only when the pair is the same height;
 * unequal pairs open a dead stretch where the film pins at the seam.
 */
.has-js.story-capable [data-story-step="question"] { --beat-seconds: 4.6; --beat-floor: 100svh; }
.has-js.story-capable [data-story-step="boundary"] { --beat-seconds: 3.4; --beat-floor: 100svh; }
.has-js.story-capable [data-story-step="request"] { --beat-seconds: 2.7; }
.has-js.story-capable [data-story-step="request-context"] { --beat-seconds: 2.7; }
.has-js.story-capable [data-story-step="request-consequence"] { --beat-seconds: 2.7; }
.has-js.story-capable [data-story-step="owners"] { --beat-seconds: 3.1; --beat-floor: 80svh; }
.has-js.story-capable [data-story-step="unowned"] { --beat-seconds: 2.9; --beat-floor: 80svh; }
.has-js.story-capable [data-story-step="missing-role"] { --beat-seconds: 6.9; }
.has-js.story-capable [data-story-step="officer"] { --beat-seconds: 6.85; --beat-floor: 80svh; }
.has-js.story-capable [data-story-step="prompt"],
.has-js.story-capable [data-story-step="tool-action"],
.has-js.story-capable [data-story-step="model-cost"],
.has-js.story-capable [data-story-step="runtime"],
.has-js.story-capable [data-story-step="policy"] { --beat-seconds: 1.6; --beat-floor: 60svh; }
.has-js.story-capable [data-story-step="scenario-tool"],
.has-js.story-capable [data-story-step="scenario-context"],
.has-js.story-capable [data-story-step="scenario-model"] { --beat-seconds: 5.6; }
.has-js.story-capable [data-story-step="outcomes"] { --beat-seconds: 8; }
.has-js.story-capable [data-story-step="agent-tool"],
.has-js.story-capable [data-story-step="agent-data"],
.has-js.story-capable [data-story-step="agent-consequence"] { --beat-seconds: 5.6; }
.has-js.story-capable [data-story-step="convergence"] { --beat-seconds: 3.1; --beat-floor: 100svh; }
.has-js.story-capable [data-story-step="invitation"] { --beat-seconds: 2.9; --beat-floor: 100svh; }

.has-js.story-capable .story-step-fallback {
  display: none;
}

.has-js.story-capable .story-copy {
  --story-paper-wash: linear-gradient(
    90deg,
    transparent 0%,
    rgb(251 245 236 / 95%) 10%,
    rgb(251 245 236 / 92%) 64%,
    rgb(251 245 236 / 54%) 82%,
    transparent 100%
  );
  /*
   * The copy is pinned inside its own beat. It arrives at a fixed offset under
   * the header, holds there while the beat's film segment plays, and leaves
   * with the beat. It never rides the rail under the header. Non-current copy
   * is faded with opacity only so all 23 beats stay in the accessibility tree.
   */
  position: sticky;
  top: calc(var(--header-height) + 4svh);
  width: min(100%, 38rem);
  max-width: 38rem;
  padding: clamp(1.2rem, 2.6vw, 2.25rem) clamp(1.25rem, 3.5vw, 3rem);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  isolation: isolate;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity var(--story-copy-duration) var(--ease-out) 90ms,
    transform var(--story-copy-duration) var(--ease-out) 90ms;
}

.has-js.story-capable .story-copy::before {
  position: absolute;
  inset: -2.25rem -3rem;
  z-index: -1;
  content: "";
  background: var(--story-paper-wash);
  -webkit-mask-image: linear-gradient(0deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
  mask-image: linear-gradient(0deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
  pointer-events: none;
}

/*
 * Only the beat the director is currently projecting is painted. Every beat
 * stays in the accessibility tree and in the tab order; a focus landing inside
 * an unpainted beat centres that beat, so nothing is ever focused unseen.
 */
.has-js.story-capable .story-step[aria-current="step"] .story-copy {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition-delay: 90ms;
}

.has-js.story-capable .story-copy h1 {
  font-size: clamp(2.6rem, 4vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.02;
  text-wrap: balance;
}

.has-js.story-capable .story-copy h2,
.has-js.story-capable .story-copy h3 {
  font-size: clamp(2rem, 2.9vw, 2.7rem);
  letter-spacing: -0.03em;
  line-height: 1.06;
  text-wrap: balance;
}

.has-js.story-capable .story-copy > p {
  max-width: 65ch;
  font-size: clamp(0.96rem, 1.1vw, 1.08rem);
  line-height: 1.58;
}

/* Left and upper-third placements follow each film's authored negative space. */
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="question"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="boundary"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="request"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="request-context"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="request-consequence"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="missing-role"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="officer"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="prompt"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="agent-tool"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="agent-data"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="agent-consequence"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="convergence"] .story-copy {
  justify-self: start;
  align-self: start;
}

:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="question"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="boundary"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="request"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="request-context"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="request-consequence"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="missing-role"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="officer"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="convergence"] .story-copy {
  margin-top: clamp(0.75rem, 2svh, 1.5rem);
}

:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="owners"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="unowned"] .story-copy {
  --story-paper-wash: linear-gradient(
    90deg,
    transparent 0%,
    rgb(251 245 236 / 90%) 14%,
    rgb(251 245 236 / 97%) 50%,
    rgb(251 245 236 / 90%) 86%,
    transparent 100%
  );
  justify-self: center;
  align-self: start;
  text-align: center;
}

:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="tool-action"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="model-cost"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="runtime"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="policy"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="scenario-tool"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="scenario-context"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="scenario-model"] .story-copy {
  --story-paper-wash: linear-gradient(
    270deg,
    transparent 0%,
    rgb(251 245 236 / 95%) 10%,
    rgb(251 245 236 / 92%) 64%,
    rgb(251 245 236 / 54%) 82%,
    transparent 100%
  );
  justify-self: end;
  align-self: start;
}

:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="model-cost"] .story-copy,
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="policy"] .story-copy {
  --story-paper-wash: linear-gradient(
    90deg,
    transparent 0%,
    rgb(251 245 236 / 95%) 10%,
    rgb(251 245 236 / 92%) 64%,
    rgb(251 245 236 / 54%) 82%,
    transparent 100%
  );
  justify-self: start;
}

/* V09's request crosses the upper left; the triad pins to the lower left instead. */
:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="outcomes"] .story-copy {
  top: auto;
  bottom: 15svh;
  justify-self: start;
  align-self: end;
}

:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="invitation"] .story-copy {
  --story-paper-wash: linear-gradient(
    90deg,
    transparent 0%,
    rgb(251 245 236 / 92%) 13%,
    rgb(251 245 236 / 98%) 50%,
    rgb(251 245 236 / 92%) 87%,
    transparent 100%
  );
  justify-self: center;
  align-self: start;
  text-align: center;
}

:is(.story-preflight, .story-static-shell, .has-js.story-capable) [data-story-step="invitation"] .contact-action {
  justify-items: center;
}

/* Direct scenario and agentic controls remain above the art plane. */
/*
 * The tablist stays in the tab order at every scroll position. Only paint is
 * withheld, never focusability, so a keyboard or switch user can reach the
 * eleven direct state controls without first scrolling a chapter to centre.
 */
/*
 * Direct controls are request chips: choosing one scrolls the story to that
 * beat, so scroll stays the only clock and film and copy always agree. They
 * sit on the paper at the foot of the stage, ruled, never boxed.
 */
.has-js.story-capable .story-director {
  position: absolute;
  right: var(--story-gutter);
  bottom: clamp(1.5rem, 5svh, 3.5rem);
  left: var(--story-gutter);
  z-index: var(--z-controls);
  display: flex;
  max-width: none;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  border-top: 1px solid var(--rule-strong);
  background: rgb(251 245 236 / 94%);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity var(--story-copy-duration) var(--ease-out),
    transform var(--story-copy-duration) var(--ease-out);
}

.has-js.story-capable [data-story-chapter][data-proximity="active"] .story-director,
.has-js.story-capable .story-director:focus-within {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.has-js.story-capable .story-director button {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 48px;
  flex: 0 1 auto;
  align-content: center;
  padding: 0.7rem 1.1rem 0.7rem 0;
  margin-right: clamp(1rem, 2.4vw, 2rem);
  border: 0;
  border-radius: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.25;
  text-align: left;
  transition: color var(--duration-fast) var(--ease-out);
}

.has-js.story-capable .story-director button::before {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--graphite);
  content: counter(story-chip, decimal-leading-zero);
  counter-increment: story-chip;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.has-js.story-capable .story-director {
  counter-reset: story-chip;
}

.has-js.story-capable .story-director button::after {
  position: absolute;
  top: -1px;
  right: 0;
  left: 0;
  height: 2px;
  content: "";
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-ui) var(--ease-out);
}

.has-js.story-capable .story-director button:hover {
  color: var(--ink);
}

.has-js.story-capable .story-director button[aria-selected="true"] {
  color: var(--ink);
}

.has-js.story-capable .story-director button[aria-selected="true"]::after {
  transform: scaleX(1);
}

/*
 * The overlay is a proportion of the frame, not a fixed slab. At 1440 it is
 * unchanged at roughly 605px; at 1024 it narrows to roughly 430px so the left
 * and right scene safe zones stay cleanly separated.
 */
@media (min-width: 1024px) {
  html:is(.story-preflight, .story-static-shell, .has-js.story-capable) .story-step .story-copy {
    width: min(38rem, 42vw);
    max-width: min(38rem, 42vw);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --story-gutter: clamp(1.75rem, 4vw, 2.75rem);
  }

  html:is(.story-preflight, .story-static-shell, .has-js.story-capable) .story-step .story-copy {
    --story-paper-wash: linear-gradient(
      0deg,
      transparent 0%,
      rgb(251 245 236 / 96%) 14%,
      rgb(251 245 236 / 91%) 78%,
      transparent 100%
    );
    width: min(100%, 36rem);
  }

  html:is(.story-preflight, .story-static-shell, .has-js.story-capable) .story-step .story-copy {
    justify-self: start;
    align-self: start;
    margin: 0;
    text-align: left;
  }

  .has-js.story-capable .story-director {
    right: var(--story-gutter);
    left: var(--story-gutter);
    max-width: none;
  }

}

@media (max-width: 767px) {
  /* The static deck (reduced motion, Save Data, user pause) stays compact. */
  .story-step {
    width: min(calc(100% - 2rem), 40rem);
    min-height: 56svh;
    padding-block: var(--space-8);
  }

  .story-step-fallback img {
    max-height: 44svh;
  }

  .story-copy h1 {
    font-size: clamp(2.15rem, 10vw, 2.75rem);
  }

  .story-copy h2,
  .story-copy h3 {
    font-size: clamp(2rem, 9vw, 3.1rem);
  }

  .story-step-fallback {
    margin-top: var(--space-5);
  }

  .hero-actions,
  .contact-action {
    align-items: stretch;
  }

  .hero-actions .button,
  .contact-action .button {
    width: 100%;
  }

  .story-director {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-5);
  }

  .story-director button {
    min-height: 44px;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--rule-strong);
    border-radius: 0;
    color: var(--ink);
    background: var(--surface);
  }

  .has-js:not(.story-capable) [data-story-chapter="officer-decision"] .story-stage,
  .has-js:not(.story-capable) [data-story-chapter="scenario-outcomes"] .story-stage,
  .has-js:not(.story-capable) [data-story-chapter="agentic-escalation"] .story-stage {
    width: min(calc(100% - 2rem), 40rem);
    padding-block: var(--space-8);
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
    align-content: center;
  }

  .has-js:not(.story-capable) .story-control-panels {
    min-height: min(52dvh, 31rem);
    grid-row: 1;
    grid-column: 1;
  }

  .has-js:not(.story-capable) .story-control-panel-art,
  .has-js:not(.story-capable) .story-control-panel-art img {
    height: min(52dvh, 31rem);
  }

  /* One column means item count equals cell count, so no cell is ever empty. */
  .has-js:not(.story-capable) .story-director {
    grid-row: 2;
    grid-column: 1;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-top: 0;
  }

  .has-js:not(.story-capable) .story-director button {
    border: 0;
    border-bottom: 1px solid var(--rule);
  }

  .has-js:not(.story-capable) .story-director button:last-child {
    border-bottom: 0;
  }

  .has-js:not(.story-capable) .story-director button[aria-selected="true"] {
    box-shadow: inset 0 -3px 0 var(--signal-deep);
  }
}

/*
 * Authored focal points for the cover crops used on tablet and in mobile
 * segment mode. Each follows the request signal through its film so the crop
 * never loses the protagonist. Desktop keeps the full 16:9 frame.
 */
.story-chapter[data-current-step="question"] .story-media { --scene-focus: 44% 62%; }
.story-chapter[data-current-step="boundary"] .story-media { --scene-focus: 46% 64%; }
.story-chapter[data-current-step="request"] .story-media { --scene-focus: 28% 58%; }
.story-chapter[data-current-step="request-context"] .story-media { --scene-focus: 46% 58%; }
.story-chapter[data-current-step="request-consequence"] .story-media { --scene-focus: 62% 58%; }
.story-chapter[data-current-step="owners"] .story-media { --scene-focus: 50% 56%; }
.story-chapter[data-current-step="unowned"] .story-media { --scene-focus: 50% 56%; }
.story-chapter[data-current-step="missing-role"] .story-media { --scene-focus: 50% 58%; }
.story-chapter[data-current-step="officer"] .story-media { --scene-focus: 50% 58%; }
.story-chapter[data-current-step="prompt"] .story-media { --scene-focus: 44% 52%; }
.story-chapter[data-current-step="tool-action"] .story-media { --scene-focus: 50% 46%; }
.story-chapter[data-current-step="model-cost"] .story-media { --scene-focus: 54% 52%; }
.story-chapter[data-current-step="runtime"] .story-media { --scene-focus: 54% 56%; }
.story-chapter[data-current-step="policy"] .story-media { --scene-focus: 60% 52%; }
.story-chapter[data-current-step="scenario-tool"] .story-media,
.story-chapter[data-current-step="scenario-context"] .story-media,
.story-chapter[data-current-step="scenario-model"] .story-media { --scene-focus: 46% 60%; }
.story-chapter[data-current-step="outcomes"] .story-media { --scene-focus: 40% 56%; }
.story-chapter[data-current-step="agent-tool"] .story-media { --scene-focus: 56% 50%; }
.story-chapter[data-current-step="agent-data"] .story-media { --scene-focus: 46% 50%; }
.story-chapter[data-current-step="agent-consequence"] .story-media { --scene-focus: 60% 62%; }
.story-chapter[data-current-step="convergence"] .story-media { --scene-focus: 50% 56%; }
.story-chapter[data-current-step="invitation"] .story-media { --scene-focus: 50% 50%; }

/*
 * V09 outcome triad. The progressive reveal was removed at the founder's
 * request (2026-09-08): whenever the film clock had not advanced, all three
 * rows sat at 0.28 opacity and were effectively unreadable. Screened, Routed
 * and Visible now render at full contrast from first paint. motion.js still
 * projects data-outcome-reveal; it simply carries no visual weight.
 */

/*
 * The request dot progress marker. The desktop side rail was removed at the
 * founder's request (2026-08-31); the marker survives on the mobile strip.
 */
.story-rail-marker {
  position: absolute;
  top: 0.6rem;
  left: 0.25rem;
  z-index: 1;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--signal);
  transform: translate(calc(-50% + 0.5px), var(--rail-marker-y, 0px));
  transition: transform 520ms var(--ease-out);
  pointer-events: none;
}

.story-rail-marker::after {
  position: absolute;
  top: 50%;
  right: 100%;
  width: 0;
  height: 1px;
  content: "";
  background: var(--signal);
}

/*
 * Mobile segment mode. The stage is sticky under the header, the film is a
 * 16:9 source shown through a cover crop with an authored focal point so the
 * request signal reads at phone size, and each beat's segment plays once on
 * entry and holds its last frame. Copy sits on paper below the stage, never on
 * the film. No GSAP, no touch scrub.
 */
@media (max-width: 767px), (max-height: 649px) {
  html.has-js.story-segment .story-rail {
    display: block;
  }

  /*
   * Stage geometry on phones: header, then the 2rem chapter strip, then a
   * 36svh film stage, then the current beat's copy pinned beneath it. The copy
   * never travels under the film while it is being read; it hands off at the
   * beat boundary exactly as on desktop.
   */
  :root {
    --segment-strip: 2rem;
    --segment-stage: 36svh;
  }

  html.has-js.story-segment [data-story-chapter]:not([data-story-static]) .story-stage {
    position: sticky;
    top: calc(var(--header-height) + var(--safe-top) + var(--segment-strip));
    z-index: var(--z-art);
    display: block;
    width: 100%;
    min-height: 0;
    height: var(--segment-stage);
    margin: 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--rule);
    overflow: clip;
    isolation: isolate;
    background: var(--story-canvas-top);
  }

  html.has-js.story-segment .story-stage .story-media {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    margin: 0;
    overflow: hidden;
    background: var(--story-canvas-top);
    pointer-events: none;
  }

  html.has-js.story-segment .story-stage .story-media picture,
  html.has-js.story-segment .story-stage .story-media img,
  html.has-js.story-segment .story-stage .story-media video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    border: 0;
    border-radius: 0;
    object-fit: cover;
    object-position: var(--scene-focus, 50% 58%);
  }

  html.has-js.story-segment .story-stage .story-poster,
  html.has-js.story-segment .story-stage [data-story-video] {
    opacity: 0;
    transition: opacity var(--story-film-duration) var(--ease-out);
  }

  html.has-js.story-segment .story-stage [data-story-video] {
    z-index: 2;
  }

  html.has-js.story-segment .story-stage .story-poster[data-segment-poster="true"],
  html.has-js.story-segment .story-stage [data-story-video][data-segment-film="true"] {
    opacity: 1;
  }

  /* Request chips ride the foot of the sticky stage; labels only on phones. */
  html.has-js.story-segment .story-director {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 0 1.25rem;
    overflow-x: auto;
    border-top: 1px solid var(--rule);
    border-bottom: 0;
    background: rgb(251 245 236 / 94%);
    opacity: 1;
    transform: none;
    pointer-events: auto;
    scrollbar-width: none;
    counter-reset: none;
  }

  html.has-js.story-segment .story-director button::before,
  html.has-js.story-segment .story-chip-question {
    display: none;
  }

  html.has-js.story-segment .story-director button::after {
    content: none;
  }

  html.has-js.story-segment .story-director button {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0.6rem 0.9rem 0.6rem 0;
    margin-right: 1.1rem;
    border: 0;
    border-radius: 0;
    color: var(--ink-soft);
    background: transparent;
    font-size: 0.76rem;
    font-weight: 750;
    white-space: nowrap;
  }

  html.has-js.story-segment .story-director button[aria-selected="true"] {
    color: var(--ink);
    background: transparent;
    box-shadow: inset 0 -2px 0 var(--ink);
  }

  html.has-js.story-segment .story-step {
    padding-top: 0.75rem;
  }

  /* The chips already say which decision state this is. */
  html.has-js.story-segment [data-story-chapter="officer-decision"] .story-copy::after {
    display: none;
  }

  html.has-js.story-segment [data-story-step="prompt"],
  html.has-js.story-segment [data-story-step="tool-action"],
  html.has-js.story-segment [data-story-step="model-cost"],
  html.has-js.story-segment [data-story-step="runtime"],
  html.has-js.story-segment [data-story-step="policy"] {
    min-height: 58svh;
  }

  /*
   * A chapter's last beat has no successor to take over, so it carries its own
   * hold: the copy stays pinned under the stage until the chapter leaves.
   */
  html.has-js.story-segment .story-steps {
    position: relative;
    z-index: 0;
    padding: 0;
  }

  html.has-js.story-segment .story-step:last-child {
    min-height: 76svh;
  }

  html.has-js.story-segment [data-story-chapter]:not([data-story-static]) .story-stage {
    z-index: 2;
  }

  html.has-js.story-segment .story-step {
    display: grid;
    width: 100%;
    min-height: 66svh;
    margin: 0;
    padding: 0 1.25rem;
    border-top: 0;
    align-content: start;
  }

  html.has-js.story-segment .story-copy {
    position: sticky;
    top: calc(var(--header-height) + var(--safe-top) + var(--segment-strip) + var(--segment-stage) + 0.75rem);
    max-width: 40rem;
    opacity: 0.42;
    transition: opacity var(--duration-ui) var(--ease-out);
  }

  html.has-js.story-segment .story-step[data-segment-current="true"] .story-copy,
  html.has-js.story-segment .story-step[aria-current="step"] .story-copy {
    opacity: 1;
  }

  /* The chapter's last copy fades before the stage leaves, never under it. */
  html.has-js.story-segment [data-story-chapter][data-segment-leaving="true"] .story-step:last-child .story-copy {
    opacity: 0;
  }

  html.has-js.story-segment .story-copy h1 {
    font-size: clamp(2.1rem, 9.5vw, 2.6rem);
  }

  html.has-js.story-segment .story-copy h2,
  html.has-js.story-segment .story-copy h3 {
    font-size: clamp(1.55rem, 6.8vw, 2rem);
  }

  html.has-js.story-segment .story-copy > p {
    font-size: 0.98rem;
  }

  html.has-js.story-segment [data-story-chapter="threshold"] .story-stage {
    height: var(--segment-stage);
  }

  html.has-js.story-segment .story-rail-strip {
    position: sticky;
    top: calc(var(--header-height) + var(--safe-top));
    z-index: var(--z-controls);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    height: 2rem;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--rule);
    background: var(--surface);
    color: var(--ink);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
}

/* Segment mode never applies to the desktop cinematic plane. */
@media (min-width: 768px) and (min-height: 650px) {
  html.story-segment .story-rail-strip {
    display: none;
  }
}

.story-rail-strip {
  display: none;
}

.story-rail-strip .story-rail-track {
  position: relative;
  height: 1px;
  background: var(--rule-strong);
}

.story-rail-strip .story-rail-marker {
  top: 50%;
  left: 0;
  width: 10px;
  height: 10px;
  transform: translate(var(--rail-marker-x, 0%), -50%);
  transition: transform 520ms var(--ease-out);
}
}

@media (forced-colors: active) {
  .story-step,
  .story-director,
  .story-director button {
    border-color: CanvasText;
  }

  /*
   * Unselected tabs are told apart from their neighbours by tone alone, which
   * high contrast mode removes. Each one states a full edge in system colours;
   * the selected tab keeps its heavier Highlight edge in the rule below.
   */
  .has-js.story-capable .story-director button,
  .has-js:not(.story-capable) .story-director button,
  .has-js.story-capable .story-director button:last-child,
  .has-js:not(.story-capable) .story-director button:last-child {
    border: 1px solid ButtonText;
  }

  .has-js.story-capable .story-copy {
    background: Canvas;
  }

  .has-js.story-capable .story-director {
    background: Canvas;
  }

  .has-js.story-capable .story-director button[aria-selected="true"] {
    color: Highlight;
    background: Canvas;
  }

  .has-js:not(.story-capable) .story-director button[aria-selected="true"],
  .has-js.story-capable .story-director button[aria-selected="true"] {
    border: 2px solid Highlight;
  }

  .has-js.story-capable .story-director button::after {
    background: Highlight;
  }
}
