/* ==========================================================================
   AppUp motion layer: pipeline, SVG scenes, scroll stories, connectors,
   rail train, next stop, and the product demos. Tokens come from site.css.
   ========================================================================== */

/* segmented controls (shared by every demo) */
.seg { display: flex; flex-wrap: wrap; gap: 2px; background: var(--track); width: fit-content; max-width: 100%; }
.seg button {
  font: 600 0.9375rem/1 var(--font); color: var(--ink); background: var(--paper);
  border: 0; padding: 0.8rem 1rem 0.7rem; min-height: 2.75rem; cursor: pointer;
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
@media (hover: hover) and (pointer: fine) { .seg button[aria-pressed="false"]:hover { background: var(--paper-2); } }
.seg button:active { transform: scale(0.97); }
.field-night .seg { background: var(--night-2); }
.field-night .seg button { background: var(--night); color: var(--night-ink); }
.field-night .seg button[aria-pressed="true"] { background: var(--night-ink); color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .field-night .seg button[aria-pressed="false"]:hover { background: var(--night-2); } }

/* ---- home pipeline ----------------------------------------------------- */
.pipeline { --dim: 0.32; }
.pipeline svg { width: 100%; min-width: 680px; height: auto; overflow: visible; }
.pipeline .grp path { fill: none; stroke: var(--ink); stroke-width: 3; }
.pipeline .grp .lbl { font-size: 14px; }
.pipeline .ln { fill: none; stroke-width: 12; stroke-linejoin: round; transition: opacity var(--t-ui) ease; }
.pipeline .ln-out { stroke-width: 10; }
.pipeline .st circle { fill: var(--paper); stroke: var(--ink); stroke-width: 4; }
.pipeline .st text { font: 600 12px var(--font); fill: var(--ink); }
.pipeline .lbl { font: 800 15px var(--font); fill: var(--ink); }
.pipeline .hub rect { fill: var(--paper); stroke: var(--ink); stroke-width: 5; }
.pipeline .hub text { font: 800 15px var(--font); fill: var(--ink); }
.pipeline .hub__pulse { fill: none; stroke: var(--ink); stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; }
.pipeline g[data-line], .pipeline .out { transition: opacity var(--t-ui) ease; }
.pipeline[data-focus] g[data-line] { opacity: var(--dim); }
.pipeline[data-focus="build"] g[data-line="build"],
.pipeline[data-focus="deploy"] g[data-line="deploy"],
.pipeline[data-focus="hire"] g[data-line="hire"] { opacity: 1; }
.pipeline .out.is-off { opacity: 0.18; }
.pipeline .out.is-off .train { display: none; }
.pipeline__ctl { display: grid; gap: 1rem; margin-top: 1.25rem; }
.pipeline__ctl .seg button { font-size: 0.875rem; }
.pause {
  justify-self: start; display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem;
  background: none; border: 0; padding: 0; font: 700 0.9375rem var(--font); color: var(--ink); cursor: pointer;
  text-decoration: underline; text-underline-offset: 0.25em;
}
.pause::before { content: ""; width: 0.75rem; height: 0.85rem; box-shadow: inset 0.25rem 0 0 currentColor, inset -0.25rem 0 0 currentColor; }
.pause[aria-pressed="true"]::before { width: 0; height: 0; box-shadow: none; border-left: 0.8rem solid currentColor; border-top: 0.45rem solid transparent; border-bottom: 0.45rem solid transparent; }
@media (prefers-reduced-motion: no-preference) {
  .pipeline:not(.is-paused) .hub__pulse { animation: hub-pulse 2.4s var(--ease-out) infinite; }
  @keyframes hub-pulse { 0% { opacity: 0.6; transform: scale(0.7); } 100% { opacity: 0; transform: scale(1.6); } }
  .js .pipeline .ln { stroke-dasharray: var(--len) var(--len); stroke-dashoffset: var(--len); }
  .js .pipeline .st, .js .pipeline .train { opacity: 0; }
  .pipeline.is-drawn .ln { stroke-dashoffset: 0; transition: stroke-dashoffset 1200ms var(--ease-expo) var(--d, 0ms), opacity var(--t-ui) ease; }
  .pipeline.is-drawn .ln-out { transition-delay: 600ms; }
  .pipeline.is-drawn .st { opacity: 1; transition: opacity 400ms ease calc(var(--d, 0ms) + 500ms); }
  .pipeline.is-drawn .train { opacity: 1; transition: opacity 400ms ease 1400ms; }
}

/* ---- SVG scenes -------------------------------------------------------- */
.scene { width: 100%; height: auto; display: block; overflow: visible; }
.scene .sc-track { fill: none; stroke: var(--track); stroke-width: 12; }
.scene .sc-line { fill: none; stroke-width: 12; stroke-linejoin: round; }
.scene .sc-dash { fill: none; stroke: var(--ink); stroke-width: 5; stroke-dasharray: 10 10; }
.scene .sc-lbl { font: 600 15px var(--font); fill: var(--ink); }
.scene .sc-strong { font-weight: 800; }
.scene .sc-inv { fill: #fff; font-weight: 800; }
.scene [data-along] { display: none; }
.js .scene [data-along] { display: inline; }
.scene-wrap { background: var(--field, var(--paper)); padding: clamp(1rem, 2vw, 2rem); }
.split__media--scene .scene-wrap { aspect-ratio: 4 / 5; display: grid; align-items: center; background: var(--paper-2); }
.field-paper2 .split__media--scene .scene-wrap { background: var(--paper); }
@media (max-width: 900px) { .split__media--scene .scene-wrap { aspect-ratio: auto; } }

/* ---- pinned scroll story ----------------------------------------------- */
.scrub { padding: 0; height: 320vh; }
.scrub > .stop__dot { top: calc(50vh - 13px); }
.scrub__stage { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; align-items: center; padding: 4.5rem var(--margin) 2.5rem var(--content-x); overflow: clip; }
.scrub__stage > .in { width: 100%; max-width: calc(var(--max) - 6rem); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 6rem); align-items: center; }
.scrub .sign { margin-bottom: 2rem; }
.scrub__steps { list-style: none; display: grid; gap: 0.25rem; max-width: 34rem; }
.scrub__steps li { padding: 0.85rem 0 0.85rem 1.25rem; box-shadow: inset 4px 0 0 var(--track); color: var(--ink-2); font-size: 1.125rem; line-height: 1.4; transition: color var(--t-ui) ease, box-shadow var(--t-ui) ease; }
.scrub__steps li.is-on { color: var(--ink); box-shadow: inset 6px 0 0 var(--line); font-weight: 600; }
.scrub__count { display: block; font-size: var(--step-small); font-weight: 700; margin-bottom: 0.15rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.scrub__scene { position: relative; }
.scrub__scene .scene-wrap { padding: 0; background: none; }
.scrub__video { width: 100%; height: auto; display: block; }
.scrub.has-video.video-ready .scrub__scene .scene-wrap { display: none; }
.scrub:not(.video-ready) .scrub__video { display: none; }
.scrub__bar { position: absolute; left: var(--content-x); right: var(--margin); bottom: 1.25rem; height: 6px; background: var(--track); }
.scrub__bar span { display: block; height: 100%; background: var(--line); transform-origin: 0 50%; transform: scaleX(var(--p, 1)); }
@media (max-width: 900px) {
  .scrub { height: 280vh; }
  .scrub__stage { padding-top: 5rem; align-items: start; }
  .scrub__stage > .in { grid-template-columns: 1fr; gap: 1rem; }
  .scrub .sign { margin-bottom: 0.75rem; }
  .scrub .sign .lead { display: none; }
  .scrub .head { font-size: clamp(1.75rem, 1.2rem + 3vw, 2.5rem); }
  .js .scrub__steps li { display: none; padding: 0.4rem 0 0.4rem 1rem; font-size: 1rem; }
  .js .scrub__steps li.is-on { display: block; }
  .scrub__scene .scene { max-height: 46svh; }
}

/* ---- connectors between chapters --------------------------------------- */
.connector { position: relative; height: clamp(5rem, 9vw, 8rem); padding: 0 var(--margin) 0 var(--content-x); display: flex; align-items: center; overflow: clip; }
.connector__bar { position: absolute; left: calc(var(--rail-x) + var(--rail-w)); right: var(--margin); top: 50%; height: 8px; margin-top: -4px; background: var(--line); transform-origin: 0 50%; transform: scaleX(var(--p, 1)); }
.connector__xchg { position: absolute; z-index: 3; left: calc(var(--rail-x) + var(--rail-w) / 2 - 15px); top: 50%; width: 30px; height: 44px; margin-top: -22px; border-radius: 15px; background: var(--field, var(--paper)); border: 5px solid var(--ink); }
.connector__xchg::before, .connector__xchg::after { content: ""; position: absolute; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; }
.connector__xchg::before { top: 4px; background: var(--from); }
.connector__xchg::after { bottom: 4px; background: var(--line); }
.connector.field-night { color: var(--night-ink); }
.connector.field-night .connector__xchg { border-color: var(--night-ink); }
.connector__lbl { position: relative; z-index: 2; transform: translateY(-1.6rem); font-weight: 700; font-size: var(--step-small); opacity: var(--p, 1); }

/* ---- rail train + next stop -------------------------------------------- */
.rail__train { position: absolute; z-index: 4; left: 50%; top: 0; width: 20px; height: 36px; margin: -18px 0 0 -10px; border-radius: 10px; background: var(--paper); border: 5px solid var(--ink); transform: translateY(var(--train-y, 0px)); display: none; }
.js .rail__train { display: block; }
.nextstop {
  position: fixed; z-index: 40; left: calc(var(--margin) + 2.5rem); bottom: 1rem;
  display: inline-flex; align-items: baseline; gap: 0.5rem; padding: 0.7rem 1rem 0.55rem;
  background: var(--ink); color: var(--paper); text-decoration: none; font-size: 0.9375rem;
  box-shadow: 0 10px 30px -10px rgba(11, 29, 54, 0.5);
  transition: transform var(--t-ui) var(--ease-out), opacity var(--t-ui) ease;
}
.nextstop::before { content: ""; align-self: center; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--ns, var(--build)); }
.nextstop__k { color: var(--night-muted); font-weight: 600; }
.nextstop.is-hidden { opacity: 0; transform: translateY(150%); pointer-events: none; }
@media (max-width: 640px) { .nextstop { left: var(--margin); bottom: 0.75rem; font-size: 0.875rem; } }

/* ---- background video in a window -------------------------------------- */
.bg-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vid-toggle { margin-top: 1.25rem; background: none; border: 2px solid currentColor; color: inherit; font: 700 0.9375rem var(--font); padding: 0.6rem 0.9rem; min-height: 2.75rem; cursor: pointer; }

/* ---- demos ------------------------------------------------------------- */
.demo { display: grid; gap: 1.25rem; }
.demo figcaption { margin-top: 0.25rem; }
.demo__row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.demo__log { color: var(--ink-2); min-height: 1.5em; }
.field-night .demo__log { color: var(--night-muted); }
.hero--widget .in { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.hero--widget .display { font-size: clamp(2.4rem, 0.6rem + 3.7vw, 4.4rem); }
@media (max-width: 900px) { .hero--widget .in { grid-template-columns: 1fr; } }

/* builder: assemble */
.assemble { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.5rem; align-items: start; }
.assemble__screen { width: 100%; height: auto; background: var(--paper); box-shadow: 0 0 0 2px var(--track); }
.assemble__side h3 { font-weight: 700; color: var(--ink-2); margin: 0 0 0.5rem; }
.assemble__side ol, .assemble__side ul { margin-bottom: 1.25rem; }
.assemble__model { list-style: none; display: grid; gap: 0.4rem; }
.assemble__model li { padding: 0.55rem 0.8rem 0.45rem; background: var(--paper-2); box-shadow: inset 6px 0 0 var(--build); font-weight: 700; }
.assemble__tests { list-style: none; display: grid; gap: 0.35rem; }
.assemble__tests li { padding-left: 1.6rem; position: relative; }
.assemble__tests li::before { content: ""; position: absolute; left: 0; top: 0.3em; width: 0.9rem; height: 0.9rem; border-radius: 50%; background: var(--build); }
@media (max-width: 640px) { .assemble { grid-template-columns: 1fr; } }

/* cloud: events */
.demo--events svg { width: 100%; max-width: 820px; height: auto; }
.demo--events .sc-track { fill: none; stroke: var(--night-2); stroke-width: 10; }
.demo--events .sc-lbl { font: 600 15px var(--font); fill: var(--ink); }
.demo--events .sc-strong { font-weight: 800; }
.demo--events .nt-subject { fill: var(--night-muted); font-size: 13px; }
.demo--events .nt-sub rect { transition: fill var(--t-ui) ease, stroke var(--t-ui) ease; }
.demo--events .nt-sub.is-hit rect { fill: var(--deploy); stroke: var(--deploy); }
.demo--events .nt-sub.is-hit text { fill: #fff; }

/* cloud: targets */
.targets { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2rem; align-items: center; margin-top: 1.25rem; }
.targets__stack { list-style: none; display: grid; gap: 2px; background: var(--track); }
.targets__stack li { background: var(--paper); padding: 1rem 1.25rem 0.85rem; display: grid; gap: 0.15rem; }
.targets__stack b { font-size: 1.125rem; font-weight: 800; }
.targets__stack span { color: var(--ink-2); }
.targets__infra { box-shadow: inset 8px 0 0 var(--deploy); transition: background-color var(--t-ui) ease; }
.targets__infra.is-swap { background: var(--paper-2) !important; }
.targets__icon { width: 100%; max-width: 260px; justify-self: center; }
@media (max-width: 760px) { .targets { grid-template-columns: 1fr; } .targets__icon { max-width: 160px; } }

/* marketplace: match */
.demo--match .seg button { font-size: 0.875rem; }
.match__scan { height: 6px; background: var(--track); overflow: hidden; }
.match__scan span { display: block; height: 100%; width: 100%; background: var(--hire); transform-origin: 0 50%; transform: scaleX(0); }
.match__scan.is-run span { transform: scaleX(1); transition: transform 700ms var(--ease-in-out); }
.match__list { list-style: none; display: grid; gap: 2px; background: var(--track); }
.match__card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: center; background: var(--paper); padding: 1rem 1.1rem 0.9rem; }
.match__card > span:nth-child(2) { display: grid; gap: 0.15rem; }
.match__av { width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--hire); color: #fff; font-weight: 800; }
.match__tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.match__tags i { font-style: normal; font-size: var(--step-small); font-weight: 600; background: var(--paper-2); padding: 0.15rem 0.5rem 0.05rem; }
.match__fit { font-weight: 800; font-size: var(--step-small); color: var(--hire); white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .match__card { animation: card-in 500ms var(--ease-expo) both; animation-delay: calc(var(--i, 0) * 80ms); }
  @keyframes card-in { from { opacity: 0; transform: translateY(12px); } }
}
@media (max-width: 480px) { .match__card { grid-template-columns: auto minmax(0, 1fr); } .match__fit { grid-column: 2; } }

/* Reduced motion: stories become ordinary sections showing their final frame */
@media (prefers-reduced-motion: reduce) {
  .scrub { height: auto; }
  .scrub > .stop__dot { top: calc(var(--section-y) + 0.1rem); }
  .scrub__stage { position: static; height: auto; padding-top: var(--section-y); padding-bottom: var(--section-y); }
  .scrub__steps li, .js .scrub__steps li { display: block; color: var(--ink); }
  .scrub__bar, .rail__train { display: none !important; }
  .connector__bar { transform: none; }
  .connector__lbl { opacity: 1; }
}

/* phones: scenes scale down, so their labels scale up */
@media (max-width: 640px) {
  .scene .sc-lbl { font-size: 24px; }
  .scene .sc-lbl.sc-inv { font-size: 22px; }
}

/* builder: what you tell AIBA */
.assemble__ask { margin: 0; display: grid; gap: 0.35rem; padding: 1rem 1.25rem 0.9rem; background: var(--ink); color: var(--paper); }
.assemble__ask .small { color: var(--build); font-weight: 700; }
.assemble__ask q { font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem); font-weight: 600; quotes: "“" "”"; }

/* ---- features that have not launched yet ----------------------------- */
button.text-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; min-height: 2.75rem; }
.soon-toast {
  position: fixed; z-index: 60; left: 50%; bottom: 4.5rem; margin: 0; width: min(34rem, calc(100vw - 2rem));
  display: grid; gap: 0.2rem; padding: 0.9rem 1.2rem 0.8rem; background: var(--ink); color: var(--paper);
  box-shadow: inset 6px 0 0 var(--hire), 0 16px 40px -16px rgba(11, 29, 54, 0.6);
  transform: translate(-50%, 160%); opacity: 0; pointer-events: none;
  transition: transform var(--t-ui) var(--ease-out), opacity var(--t-ui) ease;
}
.soon-toast b { color: var(--build); }
.soon-toast.is-shown { transform: translate(-50%, 0); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .soon-toast { transition: opacity var(--t-ui) ease; transform: translate(-50%, 0); } }

/* ---- isometric scenes dropped into assets/ai/<slot>.svg ----------------- */
.iso-scene { background: var(--paper-2); }
.iso-scene svg { display: block; width: 100%; height: auto; }
.split__media .iso-scene svg, .hero__media .iso-scene svg { aspect-ratio: 4 / 5; }
.window__img .iso-scene { position: absolute; inset: 0; }
.window__img .iso-scene svg { width: 100%; height: 100%; }
.iso-scene.is-offscreen svg *, .iso-scene.is-offscreen svg { animation-play-state: paused !important; }
/* A light illustrated scene in a window: no photo scrim, ink type on a paper band */
.window__img:has(.iso-scene)::after { display: none; }
.window:has(.iso-scene) .window__copy { color: var(--ink); background: linear-gradient(to top, var(--paper) 55%, transparent); padding-top: 6rem; }
.window:has(.iso-scene) .window__copy .lead { color: var(--ink-2); }

/* "Illustration" caption under drawn scenes */
.iso-scene { position: relative; }
.iso-cap { margin: 0; padding: 0.4rem 0.75rem 0.3rem; font-size: var(--step-small); color: var(--ink-2); background: var(--paper-2); }
.window__img .iso-cap { position: absolute; right: var(--margin); top: 5rem; background: none; }

/* ==== Prototype A: stage, a split promoted to a full-screen pinned scene ==== */
.stage { padding: 0; height: calc((var(--n, 4) + 1.2) * 70vh); }
.stage > .stop__dot { top: 6rem; }
.stage__pin { position: sticky; top: 0; height: 100vh; height: 100svh; padding: 4.75rem var(--margin) 1.25rem var(--content-x); overflow: clip; }
.stage__pin > .in { height: 100%; max-width: calc(var(--max) - 6rem); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 4vw, 5rem); align-items: center; }
.stage--flip .stage__media { order: 2; }
.stage__media { margin: 0; height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.stage__media .iso-scene { height: 100%; max-width: 100%; aspect-ratio: 4 / 5; display: flex; flex-direction: column; }
.stage__media .iso-scene svg { flex: 1; min-height: 0; width: 100%; height: 100%; }
.stage .sign { margin-bottom: 1.5rem; }
.stage .head { font-size: clamp(1.75rem, 1.2rem + 2vw, 3rem); }
.stage__steps { list-style: none; display: grid; gap: 0.2rem; }
.stage__steps li { padding: 0.7rem 0 0.7rem 1.25rem; box-shadow: inset 4px 0 0 var(--track); color: var(--ink-2); transition: color var(--t-ui) ease, box-shadow var(--t-ui) ease; }
.stage__steps h3 { font-size: 1.125rem; font-weight: 800; line-height: 1.25; }
.stage__steps p { font-size: 1rem; margin-top: 0.3rem; }
.js .stage__steps p { max-height: 0; overflow: hidden; opacity: 0; margin-top: 0; transition: max-height 400ms var(--ease-out), opacity 300ms ease, margin-top 300ms ease; }
.stage__steps li.is-on { color: var(--ink); box-shadow: inset 6px 0 0 var(--line); }
.js .stage__steps li.is-on p { max-height: 8rem; opacity: 1; margin-top: 0.3rem; }
@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  .stage { height: auto; padding: var(--section-y) var(--margin) var(--section-y) var(--content-x); }
  .stage > .stop__dot { top: calc(var(--section-y) + 0.1rem); }
  .stage__pin { position: static; height: auto; padding: 0; overflow: visible; }
  .stage__pin > .in { height: auto; grid-template-columns: 1fr; }
  .stage--flip .stage__media { order: 0; }
  .stage__media .iso-scene { height: auto; width: 100%; aspect-ratio: auto; }
  .js .stage__steps p { max-height: none; opacity: 1; margin-top: 0.3rem; }
  .stage__steps li { color: var(--ink); }
}

/* ==== Prototype B: spotlight camera (no zoom; dim everything but the focus) ==== */
.spot-hole, .spot-ring { transform-box: view-box; transform-origin: 0 0; transition: transform 800ms var(--ease-in-out); }
.spot-dim { opacity: 0; transition: opacity 500ms ease; }
.spot-ring { opacity: 0; transition: transform 800ms var(--ease-in-out), opacity 400ms ease; }
svg.is-spot .spot-dim { opacity: 0.7; }
svg.is-spot .spot-ring { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .spot-hole, .spot-ring, .spot-dim { transition: none; } }

/* ==== Scenes are always shown whole ==========================================
   A drawn scene keeps its own proportions and shrinks to fit the screen and
   its box; it is never cropped by a photo frame, a max-height or a zoom. */
.iso-scene, .iso-scene.hero__photo { aspect-ratio: auto !important; max-height: none !important; height: auto; overflow: visible; background: none; }
.iso-scene svg,
.split__media .iso-scene svg,
.hero__media .iso-scene svg { aspect-ratio: auto; width: 100%; height: auto; max-height: calc(100svh - 9rem); margin: 0 auto; }
.split__media:has(.iso-scene), .hero__media:has(.iso-scene) { overflow: visible; }
.split__media:has(.iso-scene) { top: max(5.5rem, calc(50svh - 50% + 2rem)); }
.stage__media .iso-scene svg { max-height: 100%; }
@media (max-width: 900px) { .iso-scene svg { max-height: 80svh; } }
/* stage: the scene takes the pinned area's height, not the column's width */
.stage__media .iso-scene { height: 100% !important; display: flex; flex-direction: column; align-items: center; }
.stage__media .iso-scene svg { flex: 1 1 auto; min-height: 0; height: 100%; max-height: none; width: 100%; }
/* heroes: leave room for the header and the hero's own padding */
.hero__media .iso-scene svg { max-height: calc(100svh - 14rem); }
/* full-bleed window: the scene starts below the fixed header */
.window__img .iso-scene { inset: 4.5rem 0 0 0; }
.window__img .iso-scene svg { max-height: none; }
@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  .stage__media .iso-scene { height: auto !important; }
  .stage__media .iso-scene svg { height: auto; max-height: 80svh; }
}
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .stage__pin > .in { grid-template-rows: minmax(0, 1fr); }
  .stage__media { height: 100%; max-height: 100%; overflow: hidden; }
  .stage__media .iso-scene { display: block; height: 100% !important; width: 100%; }
  .stage__media .iso-scene svg { display: block; width: 100%; height: calc(100% - 2.2rem); }
}

/* ==== A drawn scene in a full-bleed window: no photo "window" effect =========
   The photo treatment (inset frame that opens, scale, late text fade, 220vh pin)
   crops a drawing, so a window holding a scene is one plain screen: the whole
   scene below the header, and the headline in the left column the scene keeps empty. */
.window:has(.iso-scene) { height: auto; }
.window:has(.iso-scene) .window__stage { position: relative; height: 100vh; height: 100svh; min-height: 36rem; }
.window:has(.iso-scene) .window__img { clip-path: none !important; }
.window:has(.iso-scene) .window__copy { opacity: 1 !important; background: none; padding-top: 0; max-width: calc(40% - var(--content-x)); box-sizing: content-box; }
.window:has(.iso-scene) .window__copy .head { font-size: clamp(1.75rem, 1rem + 2.2vw, 3.25rem); }
@media (max-width: 900px) {
  .window:has(.iso-scene) .window__stage { height: auto; min-height: 0; display: block; padding-top: 4.5rem; }
  .window:has(.iso-scene) .window__img { position: relative; inset: auto; }
  .window:has(.iso-scene) .window__img .iso-scene { position: relative; inset: auto; }
  .window:has(.iso-scene) .window__img .iso-scene svg { height: auto; }
  .window:has(.iso-scene) .window__img .iso-cap { position: static; }
  .window:has(.iso-scene) .window__copy { max-width: none; padding-top: 1.5rem; }
}
@media (min-width: 901px) {
  /* the header covers the top 4.5rem, so the window is one screen minus the header */
  .window:has(.iso-scene) .window__stage { height: calc(100vh - 4.5rem); height: calc(100svh - 4.5rem); }
  .window:has(.iso-scene) .window__img .iso-scene { inset: 0; }
  .window:has(.iso-scene) .window__img .iso-cap { top: 1rem; }
  .window:has(.iso-scene) .window__copy { max-width: calc(36% - var(--content-x)); padding-right: 0; }
}

/* a drawn scene sits on the light ground, not the photo window navy */
.window:has(.iso-scene) { background: var(--paper); color: var(--ink); --field: var(--paper); }
.window:has(.iso-scene) .stop__dot { border-color: var(--ink); background: var(--paper); }

/* ==== Punch lines ============================================================ */
/* on a chapter connector: the line sweeps across, the punch line sits above it */
.connector--punch { height: auto; min-height: clamp(9rem, 14vw, 13rem); align-items: flex-end; padding-top: clamp(2.5rem, 5vw, 4.5rem); padding-bottom: clamp(3.25rem, 5vw, 4.5rem); flex-direction: column; justify-content: flex-end; align-items: flex-start; }
.connector--punch .connector__bar { top: auto; bottom: clamp(1.75rem, 3vw, 2.25rem); }
.connector--punch .connector__xchg { top: auto; bottom: calc(clamp(1.75rem, 3vw, 2.25rem) - 18px); margin-top: 0; }
.connector--punch .connector__lbl { transform: none; order: 2; margin-top: 0.75rem; }
.connector__punch { order: 1; margin: 0; max-width: 24ch; font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3.25rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance; }
.field-night .connector__punch, .connector.field-night .connector__punch { color: var(--night-ink); }
@media (prefers-reduced-motion: no-preference) {
  .js .connector__punch { opacity: calc(0.15 + var(--p, 1) * 0.85); transform: translateY(calc((1 - var(--p, 1)) * 16px)); }
}
/* hero headlines may wrap inside each authored line (long punch lines) */
.hero--widget .rise > span { white-space: normal; }
/* the comparison board: the AppUp column carries the line colour */
#two-way .board td:last-child { color: var(--build); }
#two-way .board td:nth-child(2) { color: var(--night-muted); font-weight: 600; }
#two-way .board td { white-space: normal !important; }

/* ==== The pitch deck (Swiper) ================================================ */
.deck { position: relative; overflow: hidden; }
.deck .swiper-wrapper { align-items: stretch; }
.deck:not(.swiper-initialized) .swiper-wrapper { overflow-x: auto; scroll-snap-type: x mandatory; gap: 1.5rem; }
.deck:not(.swiper-initialized) .swiper-slide { flex: 0 0 min(85%, 34rem); scroll-snap-align: start; }
.deck__card { height: auto; box-sizing: border-box; display: grid; grid-template-rows: auto auto 1fr; gap: 1rem; padding: clamp(1.5rem, 3vw, 2.5rem); background: var(--paper-2); box-shadow: inset 0 6px 0 var(--line, var(--ink)); }
.deck.is-live .swiper-slide { transition: opacity 500ms ease, transform 650ms var(--ease-out); }
.deck.is-live .swiper-slide:not(.swiper-slide-active) { opacity: 0.45; transform: scale(0.96); }
.deck__scene svg { display: block; width: 100%; max-width: 380px; height: auto; }
.deck__punch { font-size: clamp(1.5rem, 1rem + 1.6vw, 2.4rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.025em; max-width: 20ch; }
.deck__proof { color: var(--ink-2); max-width: 44ch; align-self: end; }
.deck__ctl { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.deck__btn { position: relative; width: 3rem; height: 3rem; border: 2px solid var(--ink); background: var(--paper); cursor: pointer; transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.deck__btn::before { content: ""; position: absolute; left: 50%; top: 50%; width: 0.7rem; height: 0.7rem; border: solid var(--ink); border-width: 0 3px 3px 0; transform: translate(-65%, -50%) rotate(-45deg); }
.deck__prev::before { transform: translate(-35%, -50%) rotate(135deg); }
.deck__btn:active { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) { .deck__btn:hover { background: var(--paper-2); } }
.deck__btn.swiper-button-disabled { opacity: 0.35; cursor: default; }
.deck__count { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 5ch; text-align: center; }
.ds-t { font: 700 15px var(--font); fill: var(--ink); }
.ds-mute { fill: var(--ink-2); }
.ds-big { font-size: 30px; font-weight: 800; }
.ds-s { font-size: 14px; }
.ds-mono { font: 700 15px ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; fill: var(--ink); }
.ds .a-draw { stroke-dasharray: 1; fill: none; }
.ds .a-pop, .ds .a-slide, .ds .a-loop { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .deck.is-live .swiper-slide-active .a-draw { animation: ds-draw 900ms var(--ease-out) var(--d, 0s) both; }
  .deck.is-live .swiper-slide-active .a-pop { animation: ds-pop 500ms var(--ease-out) var(--d, 0s) both; }
  .deck.is-live .swiper-slide-active .a-fade { animation: ds-fade 400ms ease var(--d, 0s) both; }
  .deck.is-live .swiper-slide-active .a-slide { animation: ds-slide 700ms var(--ease-out) var(--d, 0s) both; }
  .deck.is-live .swiper-slide-active .a-rot { animation: ds-rot 900ms var(--ease-out) var(--d, 0s) both; }
  .deck.is-live .swiper-slide-active .a-loop { animation: ds-loop 2.6s linear var(--d, 0s) infinite both; }
}
@keyframes ds-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ds-pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes ds-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ds-slide { from { transform: translateX(var(--dx, -20px)); } to { transform: none; } }
@keyframes ds-rot { from { transform: rotate(-70deg); } to { transform: none; } }
@keyframes ds-loop { 0% { opacity: 0; transform: translateX(0); } 15% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(var(--dx, 100px)); } }

/* ==== Pitch banner: hero-style full-screen slides ============================ */
.deck-sec { padding: 0; background: var(--night); color: var(--night-ink); --field: var(--night); }
.deck-sec > .stop__dot { top: 3rem; border-color: var(--night-ink); background: var(--night); }
.deck-sec .deck { height: calc(100vh - 4.5rem); height: calc(100svh - 4.5rem); min-height: 34rem; }
.deck-sec .swiper-wrapper { height: 100%; }
.deck__slide { box-sizing: border-box; height: 100%; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 6rem); align-items: center; padding: clamp(2rem, 5vh, 4rem) var(--margin) 7rem var(--content-x); background: var(--night); }
.deck__copy { max-width: 40rem; }
.deck__copy::before { content: ""; display: block; width: 3rem; height: 8px; background: var(--line); margin-bottom: 1.75rem; }
.deck-sec .deck__punch { font-size: clamp(2.25rem, 1rem + 4vw, 4.75rem); font-weight: 800; line-height: 0.98; letter-spacing: -0.035em; max-width: 14ch; color: var(--night-ink); text-wrap: balance; }
.deck-sec .deck__proof { margin-top: 1.5rem; font-size: var(--step-lead); line-height: 1.35; color: var(--night-muted); max-width: 34ch; }
.deck-sec .deck__scene { background: var(--paper); padding: clamp(1.25rem, 3vw, 2.5rem); box-shadow: inset 0 6px 0 var(--line); }
.deck-sec .deck__scene svg { width: 100%; max-width: none; height: auto; }
.deck-sec .deck__card { display: none; }
.deck-sec .deck__ctl { position: absolute; z-index: 5; left: var(--content-x); right: var(--margin); bottom: 1.75rem; margin: 0; display: flex; align-items: center; gap: 0.75rem; }
.deck__segs { flex: 1; display: flex; gap: 6px; max-width: 32rem; }
.deck__seg { flex: 1; height: 2.75rem; padding: 0; border: 0; background: none; cursor: pointer; display: flex; align-items: center; }
.deck__seg span { display: block; width: 100%; height: 4px; background: var(--night-2); position: relative; overflow: hidden; }
.deck__seg span::after { content: ""; position: absolute; inset: 0; background: var(--night-ink); transform-origin: 0 50%; transform: scaleX(0); }
.deck__seg.is-active span::after { transform: scaleX(var(--seg-p, 1)); }
.deck.is-paused .deck__seg.is-active span::after, .deck:not(.is-live) .deck__seg.is-active span::after { transform: scaleX(1); }
.deck-sec .deck__count { color: var(--night-muted); }
.deck-sec .deck__btn { border-color: var(--night-ink); background: transparent; }
.deck-sec .deck__btn::before { border-color: var(--night-ink); }
@media (hover: hover) and (pointer: fine) { .deck-sec .deck__btn:hover { background: var(--night-2); } }
.deck__pause { min-height: 2.75rem; padding: 0 1rem; border: 2px solid var(--night-ink); background: transparent; color: var(--night-ink); font: 700 0.9375rem var(--font); cursor: pointer; }
.deck-sec .deck.is-live .swiper-slide:not(.swiper-slide-active) { transform: none; }
@media (max-width: 900px) {
  .deck-sec .deck { height: auto; min-height: 0; }
  .deck__slide { grid-template-columns: 1fr; align-content: start; gap: 1.5rem; padding: 2rem var(--margin) 6.5rem var(--content-x); height: auto; }
  .deck-sec .deck__ctl { left: var(--content-x); bottom: 1.25rem; flex-wrap: wrap; }
  .deck__segs { flex-basis: 100%; max-width: none; }
}

/* ==== Stories play on their own: no pinned scroll ============================ */
.scrub { height: auto; }
.scrub__stage { position: relative; height: calc(100vh - 4.5rem); height: calc(100svh - 4.5rem); min-height: 36rem; }
.scrub > .stop__dot { top: calc(var(--section-y) * 0.6); }
@media (max-width: 900px) { .scrub__stage { height: auto; min-height: 0; padding-bottom: 3.5rem; } }

/* ==== Each scroll brings the next whole section up =========================== */
html { scroll-padding-top: 4.5rem; }
@media (min-width: 901px) { html { scroll-snap-type: y mandatory; } }
@media (max-width: 900px) { html { scroll-snap-type: y proximity; } }
main > section, main > .connector, .site-foot { scroll-snap-align: start; }
main > .connector + section { scroll-snap-align: none; }

/* desktop paging is done by the section pager in site.js; CSS snap would fight it */
@media (min-width: 901px) { html { scroll-snap-type: none; } }

/* Swiper's own CSS loads after this file; keep the banner slide a two-column grid */
.deck-sec .swiper-slide.deck__slide { display: grid; }
@media (max-width: 900px) { .deck-sec .swiper-slide.deck__slide { display: grid; } }
.deck-sec .deck__scene { max-height: calc(100svh - 16rem); }
.deck-sec .deck__scene svg { max-height: calc(100svh - 21rem); }

/* banner controls sit bottom-right, clear of the fixed "Next stop" sign */
.deck-sec .deck__ctl { left: auto; right: calc(var(--margin) + 4.5rem); justify-content: flex-end; width: min(46rem, calc(100% - var(--content-x) - var(--margin) - 4.5rem)); }
.deck__seg span { background: rgba(169, 181, 199, 0.35); }
@media (max-width: 900px) { .deck-sec .deck__ctl { left: var(--content-x); right: var(--margin); width: auto; justify-content: flex-start; bottom: 4.25rem; } .deck__slide { padding-bottom: 10rem; } }

/* ==== Scroll UX: every section starts right under the menu ==================
   Sections keep their generous space at the bottom, but only a small gap at the
   top, so when a section is brought up its title sits just below the menu.
   Connectors become thin dividers and are never a stop of their own. */
:root { --section-top: clamp(1.5rem, 0.9rem + 1.4vw, 2.75rem); }
.sec { padding-top: var(--section-top); }
.sec > .stop__dot, .scrub > .stop__dot { top: calc(var(--section-top) + 0.1rem); }
.scrub__stage { padding-top: var(--section-top); }
.split__media:has(.iso-scene) { top: calc(4.5rem + var(--section-top)); }
.connector, .connector--punch { height: clamp(2.5rem, 4vw, 3.5rem); min-height: 0; padding: 0; display: block; }
.connector--punch .connector__bar, .connector__bar { top: 50%; bottom: auto; }
.connector--punch .connector__xchg, .connector__xchg { top: 50%; bottom: auto; margin-top: -22px; }
.connector__lbl, .connector__punch { display: none; }
main > .connector { scroll-snap-align: none; }
main > .connector + section { scroll-snap-align: start; }

/* every station dot sits level with its section title, so "dot under the menu" means "title under the menu" */
.window > .stop__dot { top: var(--section-top); }
.window:has(.iso-scene) .window__copy { padding-top: 0; }

/* sections end soon after their content so each one fits between two stations */
:root { --section-y: clamp(2rem, 1.25rem + 2vw, 3.5rem); }
.scrub__stage { height: auto; min-height: 0; padding-bottom: 3.5rem; }
.scrub__stage > .in { min-height: calc(100svh - 4.5rem - var(--section-top) - 3.5rem); max-height: calc(100svh - 4.5rem - var(--section-top) - 3.5rem); }
.scrub__scene .scene { max-height: calc(100svh - 12rem); }
