/* PokerBotsArena homepage · full-screen story (2026-10-24)
   Loaded after site.css on index.html only. Palette from the PBA logo: black, electric lime,
   white, with red and yellow sparks used sparingly.
   html.story-js (set by home-boot.js before first paint) turns the page into one portrait story
   that fills a phone screen, or sits centred on a dark stage on wider screens. Without scripts the
   scenes stack as cards in normal flow, so every word and link stays reachable.
   Rules from site.css still apply: text >= 12px, visible focus, no motion on request. */

.home {
  --pba-black: #000;
  --pba-lime: #4ff606;
  --pba-lime-2: #9dff6b;
  --pba-lime-ink: #041000;
  --pba-red: #ff5a3c;
  --pba-yellow: #ffe94a;
  --pba-line: rgba(79, 246, 6, .26);
  background: #000;
}
.home .site-footer { background: #030503; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border: 1px solid; border-radius: 999px; font: 700 12px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.chip-pilot { color: var(--pba-yellow); border-color: rgba(255, 233, 74, .55); }
.chip-off { color: var(--pba-red); border-color: rgba(255, 90, 60, .6); }
.chip-concept { color: var(--white); border-style: dashed; border-color: rgba(255, 255, 255, .55); }

/* ---------- story chrome: bars, name, pause, menu ---------- */
.story { position: relative; width: min(560px, 100%); margin-inline: auto; }
.story-top { position: relative; z-index: 5; padding: calc(env(safe-area-inset-top) + 6px) 12px 8px; background: #000; }
.story-bars { display: none; gap: 4px; }
.story-bar { position: relative; flex: 1; height: 18px; padding: 0; border: 0; background: none; }
.story-bar::before, .story-bar-fill { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 3px; border-radius: 2px; }
.story-bar::before { background: rgba(255, 255, 255, .28); }
.story-bar-fill { display: block; background: #fff; transform: scaleX(0); transform-origin: left; will-change: transform; }
.story-bar[aria-current="step"] .story-bar-fill { background: var(--pba-lime); }
.story-bar:hover::before { background: rgba(255, 255, 255, .45); }
.story-head { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.story-who { display: grid; min-width: 0; margin-right: auto; line-height: 1.2; }
.story-name { color: var(--white); font-size: 15.5px; font-weight: 750; letter-spacing: -.01em; line-height: 1.2; }
.story-chapter { margin: 0; color: var(--text-2); font: 500 12.5px/1.3 var(--mono); white-space: nowrap; }
.story-icon { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; border: 1px solid rgba(255, 255, 255, .22); border-radius: 50%; background: rgba(0, 0, 0, .45); color: var(--white); cursor: pointer; list-style: none; }
.story-icon::-webkit-details-marker { display: none; }
.story-icon:hover { border-color: var(--pba-lime); }
.story-pause { display: none; }
.story-pause .icon { width: 4px; height: 14px; margin-left: -7px; background: currentColor; box-shadow: 7px 0 0 currentColor; }
.story[data-state="paused"] .story-pause .icon { width: 0; height: 0; margin-left: 3px; background: none; box-shadow: none; border-left: 13px solid currentColor; border-block: 8px solid transparent; }
.story[data-state="paused"] .story-pause { border-color: var(--pba-lime); color: var(--pba-lime); }
.story[data-state="ended"] .story-pause .icon { width: auto; height: auto; margin: 0; background: none; box-shadow: none; }
.story[data-state="ended"] .story-pause .icon::before { content: "↺"; font: 700 20px/1 var(--font); }
.icon-menu { width: 16px; height: 12px; border-block: 2px solid currentColor; background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat; }
.story-menu { position: relative; }
.story-menu[open] > .story-icon { border-color: var(--pba-lime); color: var(--pba-lime); }
.story-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; display: grid; width: min(240px, calc(100vw - 32px)); padding: 8px; border: 1px solid var(--pba-line); border-radius: 12px; background: rgba(4, 8, 4, .97); box-shadow: 0 24px 60px rgba(0, 0, 0, .7); }
.story-menu-panel nav { display: grid; }
.story-menu-panel a { padding: 12px 14px; border-radius: 8px; color: var(--white); font-weight: 650; text-decoration: none; }
.story-menu-panel a:hover { background: rgba(79, 246, 6, .1); color: var(--pba-lime); }
.story-menu-doc { margin-top: 4px; border-top: 1px solid rgba(255, 255, 255, .08); font-family: var(--mono); font-size: 14.5px; }
.story-menu-x { display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.story-menu-x img { width: 16px; height: 16px; flex: none; }

/* Follow on X: a plain link card (no embedded feed, no third-party request). */
.x-card { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 12px; padding: 6px 14px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px; color: var(--white); font-size: 15px; font-weight: 700; text-decoration: none; }
.x-card img { width: 18px; height: 18px; flex: none; }
.x-card-text { white-space: nowrap; }
.x-card .x-handle { margin-left: auto; min-width: 0; overflow: hidden; color: var(--text-2); font: 500 12.5px/1 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 379px) { .x-card .x-handle { display: none; } }
.x-card:hover { border-color: var(--pba-lime); color: var(--pba-lime); }

/* ---------- scenes (no-script fallback: stacked cards in normal flow) ---------- */
/* Text first: each scene reads top to bottom as copy (headline, one line or a few short points),
   then a supporting figure, then its button. Scene A has no figure at all.
   Every figure's base style is complete and static. Only B (an agent's path from its owner's
   computer to a table) and C (a brief becoming a range) have authored motion, which runs under
   .scene.is-playing; home-story.js puts that class back every time a scene starts, so revisiting
   replays it. Their first frames are already readable pictures; without scripts, or with reduced
   motion, they show their final frame. */
.story-viewport { padding: 0 var(--gutter) 24px; }
.story-step, .story-replay { display: none; }
.scene { display: flex; flex-direction: column; margin-bottom: 18px; overflow: hidden; border: 1px solid var(--pba-line); border-radius: 18px; background: var(--pba-black); }
.scene-visual { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px; overflow: hidden; }
/* The figure comes first in the source (it is aria-hidden) but is shown below the copy. */
.scene-copy { order: -1; padding: 22px 20px 6px; }
.scene-foot { padding: 12px 20px 20px; }
.scene-status { margin: 0 0 12px; }
.scene-title { margin-bottom: 12px; font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.1rem); line-height: 1.06; letter-spacing: -.035em; font-weight: 850; text-wrap: balance; }
.scene-title:focus { outline: none; }
.scene-title:focus-visible { outline: 2px solid var(--pba-lime); outline-offset: 4px; }
.scene-title em { font-style: normal; color: var(--pba-lime); }
.scene-copy > .scene-line { margin: 0; color: var(--text-2); font-size: 16.5px; line-height: 1.45; text-wrap: pretty; }
/* Scene A: a large headline and three numbered facts, nothing else. */
.scene-a .scene-copy { counter-reset: point; }
.scene-a .scene-title { margin-bottom: 18px; font-size: clamp(2.6rem, 2rem + 3vw, 3.4rem); line-height: 1; }
.scene-point { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: baseline; margin: 0; padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, .14); color: var(--white); font-size: 17.5px; font-weight: 550; line-height: 1.35; text-wrap: pretty; }
.scene-point:last-child { border-bottom: 1px solid rgba(255, 255, 255, .14); }
.scene-point::before { counter-increment: point; content: "0" counter(point); color: var(--pba-lime); font: 700 12.5px/1 var(--mono); }
.scene-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.scene-actions .btn-volt { background: var(--pba-lime); color: var(--pba-lime-ink); }
.scene-actions .btn-volt:hover { background: var(--pba-lime-2); }
.scene-actions .btn-line:hover { border-color: var(--pba-lime); color: var(--pba-lime); }
.viz-note { margin: 0; color: var(--text-3); font: 500 12px/1.2 var(--mono); }

/* B · computer → queue → table */
.seat-flow { display: block; width: 100%; max-width: 380px; height: auto; overflow: visible; }
.sf-label { fill: var(--text-2); font: 700 13px var(--mono); text-anchor: middle; letter-spacing: .04em; }
.sf-box, .sf-queue, .sf-table { fill: #030803; stroke-width: 2; }
.sf-box { stroke: var(--pba-lime); }
.sf-stand { stroke: var(--pba-lime); stroke-width: 3; stroke-linecap: round; }
.sf-ecg { fill: none; stroke: var(--pba-lime); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sf-queue { stroke: rgba(255, 255, 255, .45); }
.sf-wait { fill: rgba(255, 255, 255, .3); }
.sf-table { fill: #0b2506; stroke: var(--pba-lime); filter: drop-shadow(0 0 10px rgba(79, 246, 6, .35)); }
.sf-link { fill: none; stroke: rgba(79, 246, 6, .55); stroke-width: 2; stroke-dasharray: 4 5; }
.sf-pair { fill: none; stroke: var(--pba-yellow); stroke-width: 1.5; stroke-dasharray: 1 0; }
.sf-op { fill: var(--pba-yellow); font: 600 12.5px var(--mono); text-anchor: middle; }
.sf-tok circle { stroke: #000; stroke-width: 2; }
.sf-tok-me circle { fill: var(--pba-lime); }
.sf-tok-opp circle { fill: var(--pba-yellow); }
.sf-tok-me { transform: translate(234px, 80px); }
.sf-tok-opp { transform: translate(302px, 80px); }
.sf-badge rect { fill: var(--pba-lime); }
.sf-badge text { fill: var(--pba-lime-ink); font: 750 13px var(--font); text-anchor: middle; }
.sf-models-note { fill: var(--text-2); font: 600 12px var(--mono); text-anchor: middle; }

/* C · a brief becomes an opening range */
.brief { display: grid; gap: 6px; justify-items: end; width: min(100%, 300px); }
.brief-msg { margin: 0; padding: 7px 12px; border-radius: 14px 14px 4px 14px; background: #f3f8ef; color: #050805; font: 700 14.5px/1.25 var(--font); }
.brief-2 { background: var(--pba-yellow); }
.range { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 2px; width: min(100%, 280px); aspect-ratio: 1; flex: none; }
.range:empty { display: none; }
.range i { border-radius: 2px; background: rgba(255, 255, 255, .07); }
.range .is-pair { background: rgba(255, 255, 255, .13); }
.range .t1 { background: var(--pba-lime); box-shadow: 0 0 8px rgba(79, 246, 6, .45); }
.range .t2 { background: var(--pba-yellow); }
.range:empty + .viz-note { display: none; }
.key { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 0; border-radius: 2px; vertical-align: -1px; }
.key-1 { background: var(--pba-lime); }
.key-2 { margin-left: 6px; background: var(--pba-yellow); }

/* D · ranking mock-up: fictional bots, net chips over hands */
.demo-tag { flex: none; margin: 0; padding: 3px 10px; border: 1px dashed rgba(255, 233, 74, .7); border-radius: 999px; color: var(--pba-yellow); font: 700 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.race { display: block; width: 100%; max-width: 440px; height: auto; overflow: visible; }
.race-zero { stroke: rgba(255, 255, 255, .22); stroke-dasharray: 3 4; }
.race-axis { fill: var(--text-3); font: 500 12px var(--mono); }
.race-axis-end { text-anchor: end; }
.race-ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1 1; }
.race-ln-1 { stroke: var(--pba-lime); stroke-width: 3; filter: drop-shadow(0 0 6px rgba(79, 246, 6, .6)); }
.race-ln-2 { stroke: var(--pba-yellow); }
.race-ln-3 { stroke: rgba(243, 248, 239, .8); }
.race-ln-4 { stroke: #8fa597; }
.race-ln-5 { stroke: var(--pba-red); }
.race-row text { fill: var(--white); font: 750 12.5px var(--font); letter-spacing: .02em; }
.race-row .race-val { fill: var(--text-2); font: 600 12px var(--mono); text-anchor: end; }
.race-rk { fill: var(--text-3); }
.race-mark { opacity: .95; }
.race-row-1 .race-rk, .race-row-1 .race-val { fill: var(--pba-lime); }
.race-row-1 circle { fill: var(--pba-lime); }
.race-row-2 circle { fill: var(--pba-yellow); }
.race-row-3 circle { fill: var(--white); }
.race-row-4 circle { fill: #8fa597; }
.race-row-5 circle { fill: var(--pba-red); }
.chip-demo { color: var(--pba-yellow); border-style: dashed; border-color: rgba(255, 233, 74, .7); }

/* E · two separate things an agent may use on its own side; neither is a PokerBotsArena feature */
.viz-e { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; align-content: center; gap: 10px; }
.idea { min-width: 0; max-width: 220px; width: 100%; padding: 12px; border: 1px solid rgba(79, 246, 6, .45); border-radius: 12px; background: rgba(79, 246, 6, .05); }
.idea-track { justify-self: end; }
.idea-solve { justify-self: start; border: 1px dashed rgba(255, 233, 74, .6); background: rgba(255, 233, 74, .04); }
.idea p { margin: 0; }
.idea-head { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
.idea-head b { color: var(--white); font: 800 14.5px/1.15 var(--font); letter-spacing: -.01em; }
.idea-tag { padding: 1px 7px; border: 1px solid; border-radius: 999px; color: var(--pba-lime); font: 700 12px/1.3 var(--mono); text-transform: uppercase; }
.idea-solve .idea-tag { color: var(--pba-yellow); border-style: dashed; }
.idea .idea-sub { margin: 4px 0 12px; color: var(--text-3); font: 500 12px/1.3 var(--mono); }
.tstat { display: grid; grid-template-columns: 40px minmax(0, 1fr) 30px; align-items: center; gap: 6px; margin-top: 7px; color: var(--text-2); font: 600 12px/1 var(--mono); }
.tstat b { color: var(--white); text-align: right; }
.tstat-bar { display: block; height: 8px; overflow: hidden; border-radius: 4px; background: rgba(255, 255, 255, .09); }
.tstat-bar i { display: block; height: 100%; border-radius: inherit; background: var(--pba-lime); transform-origin: left; }
.tstat-1 .tstat-bar i { transform: scaleX(.38); }
.tstat-2 .tstat-bar i { transform: scaleX(.21); }
.tstat-3 .tstat-bar i { transform: scaleX(.64); }
.ask { display: flex; align-items: center; gap: 8px; margin-top: 7px; color: var(--text-2); font: 600 12px/1.2 var(--mono); }
.ask i { display: grid; flex: none; place-items: center; width: 20px; height: 20px; border: 1px dashed rgba(255, 233, 74, .6); border-radius: 50%; color: var(--pba-yellow); font-style: normal; }
.idea .ask-3 { color: var(--white); }
.ask-3 i { border-style: solid; background: var(--pba-yellow); color: #000; }

/* F · the honest path for people who only use a chat app: a coding assistant on their own computer */
.setup-no { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 12px; border: 1px dashed rgba(255, 90, 60, .6); border-radius: 999px; color: var(--text-2); font: 600 12px/1.3 var(--mono); }
.setup-no b { color: var(--pba-red); }
.term { width: min(100%, 320px); overflow: hidden; border: 1px solid rgba(79, 246, 6, .45); border-radius: 12px; background: #050a05; font: 600 12.5px/1.3 var(--mono); }
.term p { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 12px 8px; color: var(--text-2); }
.term .term-bar { gap: 5px; margin-bottom: 10px; padding: 7px 10px; border-bottom: 1px solid rgba(255, 255, 255, .1); color: var(--text-3); font-size: 12px; }
.term-bar i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .25); }
.term-bar span { margin-left: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term .term-you { color: var(--white); }
.term-ok b { color: var(--pba-lime); }
.term .term-live { margin-top: 2px; padding-bottom: 12px; color: var(--pba-lime); }
.term-live b { font-size: 12px; }

@container (min-height: 340px) {
  .idea { max-width: 240px; padding: 16px 14px; }
  .idea-head b { font-size: 17px; }
  .tstat, .ask { margin-top: 12px; }
}
/* Tall, narrow phones: the two ideas stack as full-width panels, so each bar has room.
   A media query, since .viz-e is itself the size container its own queries measure. */
@media (max-width: 479px) and (min-height: 700px) {
  .story-js .viz-e { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .story-js .viz-e .idea { justify-self: center; max-width: 340px; padding: 14px 16px; }
  .story-js .idea-head { flex-direction: row; align-items: center; justify-content: space-between; }
  .story-js .idea .idea-sub { margin: 2px 0 4px; }
  .story-js .tstat { grid-template-columns: 52px minmax(0, 1fr) 74px; align-items: center; gap: 8px; margin-top: 10px; }
  .story-js .ask { display: inline-flex; margin: 8px 10px 0 0; }
}

/* ---------- motion: only B and C, once per visit, in about five seconds ---------- */
/* A, D, E and F are static. B: the owner's client shows a heartbeat, joins the queue, an operator
   pairs it with another live agent and both take their seats. C: a style brief lights a tight
   opening range, then a second instruction widens it. */
.is-playing .sf-ecg { animation: trace 1.4s linear infinite; }
.is-playing .sf-tok-me { animation: tok-me 4.2s var(--ease) both; }
.is-playing .sf-tok-opp { animation: tok-opp 4.2s var(--ease) both; }
.is-playing .sf-pair { animation: draw .8s 2.1s var(--ease) both; }
.is-playing .sf-op { animation: viz-in .4s 2.5s var(--ease) both; }
.is-playing .sf-table { animation: seat-glow .8s 3.3s var(--ease) both; }
.is-playing .sf-badge { animation: viz-in .45s 3.6s var(--ease) both; }

.is-playing .brief-1 { animation: rise .4s var(--ease) both; }
.is-playing .brief-2 { animation: msg-in .4s 2.6s var(--ease) both; }
.is-playing .range .t1 { animation: cell-on .3s calc(.8s + var(--d, 0s)) var(--ease) both; }
.is-playing .range .t2 { animation: cell-on .3s calc(3s + var(--d, 0s)) var(--ease) both; }

/* Paused or held (button, finger, menu, hidden tab): the graphic freezes with the progress bar. */
.story[data-state="paused"] .scene-visual *, .story.is-held .scene-visual *,
.story[data-state="paused"] .scene-visual *::before, .story.is-held .scene-visual *::before { animation-play-state: paused !important; }

@keyframes viz-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes rise { from { transform: translateY(8px); } }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(.94); } }
@keyframes trace { from { stroke-dasharray: 1 1; stroke-dashoffset: 0; } to { stroke-dasharray: 1 1; stroke-dashoffset: -2; } } /* drawn, wipes, redraws */
@keyframes tok-me {
  0%, 20% { transform: translate(52px, 79px); }
  38%, 52% { transform: translate(182px, 80px); }
  64% { transform: translate(210px, 54px); }
  78%, 100% { transform: translate(234px, 80px); }
}
@keyframes tok-opp {
  0%, 52% { transform: translate(167px, 80px); }
  64% { transform: translate(250px, 108px); }
  78%, 100% { transform: translate(302px, 80px); }
}
@keyframes seat-glow { from { filter: none; } }
@keyframes draw { from { stroke-dasharray: 1 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1 1; stroke-dashoffset: 0; } }
@keyframes cell-on { from { background: rgba(255, 255, 255, .07); box-shadow: none; } }

/* ---------- full-screen story (html.story-js) ---------- */
/* The document is exactly one screen: no footer and nothing to scroll past the story, like an
   IG story. Site links stay in the story's menu and scene buttons; without scripts (no
   html.story-js) the footer and normal scrolling come back. */
html.story-js, .story-js .home { height: 100%; overflow: hidden; overscroll-behavior: none; }
.story-js .home { min-height: 0; }
.story-js .home .site-footer { display: none; }
.story-js .home main {
  display: grid; place-items: center; height: 100vh; height: 100dvh; overflow: hidden;
  background:
    radial-gradient(600px 420px at 18% 12%, rgba(255, 90, 60, .10), transparent 65%),
    radial-gradient(760px 520px at 84% 88%, rgba(79, 246, 6, .12), transparent 65%),
    #000;
}
.story-js .story {
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  width: 100%; height: 100vh; height: 100dvh; margin: 0; background: #000;
}
.story-js .story-top { padding-left: calc(12px + env(safe-area-inset-left)); padding-right: calc(12px + env(safe-area-inset-right)); }
.story-js .story-bars { display: flex; }
.story-js .story-pause { display: grid; }
.story-js .story-replay { display: inline-flex; }
.story-js .story-viewport { position: relative; overflow: hidden; padding: 0; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.story-js .scene { position: absolute; inset: 0; display: none; flex-direction: column; margin: 0; border: 0; border-radius: 0; }
/* Before home-story.js takes over: show scene A, or the deep-linked scene, so the first paint is already the story. */
.story-js .story:not(.is-ready) .scene-a, .story-js .story:not(.is-ready) .scene:target { display: flex; }
.story-js .story:not(.is-ready) .story-viewport:has(.scene:target) .scene-a:not(:target) { display: none; }
/* Cut like a story: the old scene leaves at once, the new one eases in (never two scenes overlaid). */
.story-js .story.is-ready .scene { display: flex; visibility: hidden; }
.story-js .story.is-ready .scene.is-active { visibility: visible; animation: scene-in .24s var(--ease) both; }
.story-js .story.is-ready .scene.is-active.is-back { animation-name: scene-in-back; }
@keyframes scene-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes scene-in-back { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
/* Copy on top, the figure in the middle, the button at the bottom. The figure takes the height the
   copy leaves, up to its natural size; any space beyond that is shared above and below the whole
   stack, so tall screens get a centred page instead of a gap. Container units size each figure,
   and container queries drop secondary pieces as the space gets shorter. Scene A is copy only. */
.story-js .scene { justify-content: center; }
.story-js .scene-copy {
  flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px calc(22px + env(safe-area-inset-right)) 8px calc(22px + env(safe-area-inset-left));
}
.story-js .scene-visual { flex: 1 1 0; min-height: 0; max-height: 300px; padding: 8px calc(16px + env(safe-area-inset-right)) 8px calc(16px + env(safe-area-inset-left)); container-type: size; }
.story-js .viz-c { max-height: 420px; }
.story-js .viz-e { max-height: 380px; }
.story-js .viz-f { max-height: 270px; }
.story-js .scene-foot { flex: none; padding: 12px calc(22px + env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) calc(22px + env(safe-area-inset-left)); }
.story-js .scene-title { font-size: 2.05rem; }
.story-js .scene-a .scene-title { font-size: min(3.4rem, 13.5vw); }
.story-js .scene-point { padding: 14px 0; font-size: 19px; }
.story-js .seat-flow { width: min(100%, 380px, calc(100cqh * 1.44)); }
.story-js .range { width: min(100%, 280px, calc(100cqh - 124px)); }
.story-js .race { width: min(100%, 460px, calc((100cqh - 40px) * 1.74)); }
.story-js .scene-actions { flex-wrap: nowrap; gap: 8px; }
.story-js .scene-actions .btn { flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 6px 14px; font-size: 15px; line-height: 1.15; text-align: center; }
.story-js .scene-actions .btn-line { flex: 0 0 auto; }
.story-js .story-step { position: absolute; top: 50%; z-index: 6; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px; padding: 0; border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; background: rgba(0, 0, 0, .7); color: var(--white); font: 700 26px/1 var(--font); }
.story-js .story-step:hover:not(:disabled) { border-color: var(--pba-lime); color: var(--pba-lime); }
.story-js .story-step:disabled { opacity: .3; cursor: default; }
/* On phones the arrows only appear for keyboard focus; taps and swipes do the work. */
.story-js .story-step:not(:focus-visible) { opacity: 0; pointer-events: none; }
.story-step-prev { left: 8px; }
.story-step-next { right: 8px; }

@container (max-height: 300px) {
  .viz-note { display: none; }
}
@container (max-height: 240px) {
  .brief-1, .sf-op, .idea .idea-sub, .tstat-3 { display: none; }
  .idea { padding: 10px 12px; }
  .setup-no { display: none; }
  .story-js .range { width: min(100%, 280px, calc(100cqh - 64px)); }
}
@container (max-height: 180px) {
  .ask-2, .term-bar { display: none; }
}
@container (max-height: 150px) {
  .brief, .demo-tag, .sf-label { display: none; }
  .story-js .range { width: min(100%, 280px, 100cqh); }
  .idea { padding: 8px 10px; }
  .tstat-2, .ask-1, .term-you + .term-ok { display: none; }
}
@container (max-height: 90px) {
  .scene-visual > * { display: none; }
}

/* Short screens (small phones, landscape laptops): a tighter type scale so copy still fits. */
@media (max-height: 740px) {
  .story-js .story-head { min-height: 40px; }
  .story-js .story-icon { width: 40px; height: 40px; }
  .story-js .scene-copy { padding-top: 10px; }
  .story-js .scene-title { font-size: 1.55rem; margin-bottom: 8px; }
  .story-js .scene-a .scene-title { font-size: min(2.6rem, 12vw); margin-bottom: 14px; }
  .story-js .scene-copy > .scene-line { font-size: 15px; line-height: 1.4; }
  .story-js .scene-point { padding: 9px 0; font-size: 16px; }
  .story-js .scene-status { margin-bottom: 8px; }
  .story-js .scene-foot { padding-top: 8px; }
  .story-js .scene-actions .btn { min-height: 44px; }
  .story-js .x-card { margin-top: 10px; }
}
@media (max-height: 560px) {
  .story-js .scene-title { font-size: 1.3rem; }
  .story-js .scene-a .scene-title { font-size: 2rem; }
  .story-js .scene-point { padding: 6px 0; font-size: 15px; }
  .story-js .scene-status { display: none; }
}
@media (max-height: 560px) and (min-width: 600px) {
  /* Landscape phones: copy and button centred on the left, the figure on the right. The same
     selectors that show a scene switch it to a grid here. Scene A is one centred column. */
  .story-js .story.is-ready .scene, .story-js .story:not(.is-ready) .scene-a, .story-js .story:not(.is-ready) .scene:target {
    display: grid; grid-template: minmax(0, 1fr) minmax(0, auto) auto minmax(0, 1fr) / 1fr 1fr;
    grid-template-areas: ". visual" "copy visual" "foot visual" ". visual";
  }
  .story-js .story .scene.scene-a { grid-template-areas: "." "copy" "foot" "."; grid-template-columns: min(100%, 640px); }
  .story-js .scene-copy { grid-area: copy; }
  .story-js .scene-foot { grid-area: foot; }
  .story-js .scene-visual { grid-area: visual; max-height: none; }
  .story-js .scene-status { display: block; }
}

/* Wider screens: a centred portrait story on a dark stage, with arrows beside it. */
@media (min-width: 600px) and (min-height: 560px) {
  .story-js .home main { padding: 16px; }
  .story-js .story {
    width: min(480px, max(380px, calc((100dvh - 32px) * .5625)));
    height: min(940px, calc(100dvh - 32px));
    border: 1px solid var(--pba-line); border-radius: 18px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, .8), 0 0 90px rgba(79, 246, 6, .1);
  }
  .story-js .story-top { border-radius: 18px 18px 0 0; padding-top: 8px; }
  .story-js .story-viewport { border-radius: 0 0 18px 18px; }
  .story-js .story-step, .story-js .story-step:not(:focus-visible) { opacity: 1; pointer-events: auto; }
  .story-step-prev { left: -64px; }
  .story-step-next { right: -64px; }
}

@media (prefers-reduced-motion: reduce) {
  /* No movement: each scene shows its graphic's final frame and stays a little longer (home-story.js). */
  .story-js .story.is-ready .scene.is-active { animation: none; }
  .scene-visual *, .scene-visual *::before, .scene-visual *::after { animation: none !important; }
}
@media (forced-colors: active) {
  .chip, .scene, .story-icon, .story-step, .idea, .demo-tag, .x-card, .term, .setup-no { border: 1px solid CanvasText; }
  .x-card img, .story-menu-x img, .sf-models image, .race-mark { forced-color-adjust: none; }
  .story-bar::before { background: GrayText; }
  .story-bar-fill, .story-bar[aria-current="step"] .story-bar-fill { background: Highlight; forced-color-adjust: none; }
}
@media print {
  .story-top, .story-step { display: none !important; }
  html.story-js, .story-js .home, .story-js .home main { height: auto; overflow: visible; }
  .story-js .story { height: auto; }
  .story-js .story-viewport { overflow: visible; }
  .story-js .scene, .story-js .story.is-ready .scene { position: static; display: flex; visibility: visible; animation: none; }
  .scene-visual * { animation: none !important; }
}
