/* Agent Forge 3D story page. Tokens from the approved story page (SOURCE_story_v3.dc.html). */
.scene-block {
  --bg: #0a0502;
  --band: #0d0703;
  --band-border: #2a1c10;
  --text: #f0e8e0;
  --muted: #d9cbbd;
  --hair: #5a4636;
  --panel: #140b05;
  --panel2: #1c0f06;
  --ember: #ff4500;
  --ember-l: #ff7a33;
  --ember-p: #ffb38a;
  --dim: #b9a48f;
  --display: 'Bebas Neue', sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
}


/* ---------- section frame ---------- */
.band { background: var(--band); border-top: 1px solid var(--band-border); }
.row {
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  align-items: center;
}
.row.rev { flex-wrap: wrap-reverse; }
.copy { flex: 1 1 340px; min-width: 0; }
.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 1.5px;
  color: var(--ember-l);
  text-transform: uppercase;
}
.lede { margin: 18px 0 0; color: var(--muted); max-width: 30em; }
.source { margin: 6px 0 0; font-family: var(--mono); font-size: 13px; color: var(--dim); }

/* A label inside a scene is placed from its left edge and centred by the scene's script when the scene first plays.
   Until then it can reach past the right edge of a phone screen, which made the whole page wider than the screen
   (Platform laid out 532px wide on a 390px phone). Nothing inside a scene may widen the page. */
.scene-block { overflow-x: clip; }

/* ---------- 3D visual box: fixed aspect-ratio, poster under canvas ---------- */
.viz {
  flex: 1 1 540px;
  min-width: 0;
  position: relative;
  aspect-ratio: 5 / 4;
}
.viz--43 { aspect-ratio: 4 / 3; }
.viz--32 { aspect-ratio: 3 / 2; }
.viz-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
html:not(.no-webgl) .viz-media {
  /* Feather the box edges into the page: canvas background = section background, so a
     masked edge shows the same color and the scene has no visible rectangle. One radial
     layer (no mask-composite). Without WebGL the poster is shown unmasked: its edges are
     the section color anyway, and it keeps the fallback path as plain as possible. */
  -webkit-mask-image: radial-gradient(ellipse 62% 64% at 50% 50%, #000 72%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 64% at 50% 50%, #000 72%, transparent 100%);
}
.viz-media > .poster,
.viz-media > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.viz-media > .poster { object-fit: cover; transition: opacity 0.6s ease; }
.viz-media > canvas { opacity: 0; transition: opacity 0.6s ease; }
.viz-media.is-live > canvas { opacity: 1; }
.viz-media.is-live > .poster { opacity: 0; }
/* With WebGL and motion, the poster never shows (it is the FINAL frame; showing it before
   the beats would give the story away). It returns on context loss, and serves as the
   still under reduced motion and without WebGL. */
html:not(.no-webgl):not(.reduced) .viz-media:not(.is-lost) > .poster { visibility: hidden; }
.overlay { position: absolute; inset: 0; pointer-events: none; margin: 0; }

/* pause control (WCAG 2.2.2): visible, focusable, 40px target */
.pause {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--hair);
  background: rgba(20, 11, 5, 0.72);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0.55;
  transition: opacity 0.2s, border-color 0.2s;
}
.pause:hover, .pause:focus-visible { opacity: 1; border-color: var(--ember-l); }
.pause:focus-visible { outline: 2px solid var(--ember-l); outline-offset: 3px; }
.pause::before,
.pause::after {
  content: '';
  grid-area: 1 / 1;
  width: 3px;
  height: 12px;
  background: currentColor;
  border-radius: 1px;
}
.pause::before { transform: translateX(-3px); }
.pause::after { transform: translateX(3px); }
.pause.is-paused::after { display: none; }
.pause.is-paused::before {
  width: 0;
  height: 0;
  background: none;
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent currentColor;
  transform: translateX(1px);
}
.reduced .viz .pause, .poster-mode .pause, .no-webgl .viz .pause { display: none; }
.pause--hero { right: 0; bottom: 0; }
.hero-viz.is-paused * { animation-play-state: paused !important; }

/* poster-mode: hide every DOM overlay so the poster is the bare scene */
.poster-mode .overlay { visibility: hidden; }


/* ---------- HERO v2: the wow moment ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
.hero2 { max-width: 1320px; margin: 0 auto; padding: 8px 24px 72px; }
.hero2-grid { display: grid; grid-template-columns: minmax(300px, 1fr) 2fr; gap: 32px; align-items: center; }
.hero2-h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(56px, 6.2vw, 92px);
  line-height: 0.95;
}
.hl { display: block; color: #5a4636; transition: color 0.5s ease; }
.hl.is-on { color: var(--text); }
.hl-2.is-on { color: var(--ember); }
.reduced .hl, .no-webgl .hl { color: var(--text); }
.reduced .hl-2, .no-webgl .hl-2 { color: var(--ember); }
.hero2-lede { margin: 20px 0 0; font-size: 20px; color: var(--muted); max-width: 22em; }
.hero2-cta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.viz--hero { aspect-ratio: 4 / 3; flex: none; }
.hero-ui .hero-meta {
  position: absolute; top: 2%; left: 3%; margin: 0;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.5px; color: var(--dim);
}
.hero-step { margin-left: 10px; color: var(--ember-l); text-transform: uppercase; letter-spacing: 1.5px; }
.team-count {
  position: absolute; top: 2%; right: 3%; margin: 0;
  font-family: var(--mono); font-size: 12px; color: var(--dim); visibility: hidden;
}
.team-count b { color: var(--ember-p); font-weight: 500; font-size: 15px; }
.hd-draft {
  position: absolute; left: 3%; bottom: 4%; width: min(370px, 48%);
  box-sizing: border-box; padding: 14px 16px;
  background: rgba(16, 9, 4, 0.78);
  border: 1px solid #3a2a1a; border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  font-size: 14px; line-height: 1.4;
  visibility: hidden;
}
.hd-draft p { margin: 0; }
.hd-draft-h { font-family: var(--mono); font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); margin-bottom: 8px !important; }
.hd-draft .hd-claim { position: relative; padding: 4px 6px; border-radius: 6px; margin: 2px -6px !important; }
.hd-c-rel .hd-ct { position: relative; }
.hd-c-rel .hd-strike { position: absolute; left: 6px; top: 13px; width: calc(100% - 12px); max-width: 270px; height: 10px; overflow: visible; }
.hd-c-rel .hd-strike path { stroke: #ff3b2f; stroke-width: 2.5; fill: none; vector-effect: non-scaling-stroke; }
.hd-ok, .hd-tag { display: flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 11px; margin: 3px 0 0; }
.hd-ok { color: #9fd38a; visibility: hidden; }
.hd-ok svg { width: 13px; height: 13px; }
.hd-ok path { stroke: #9fd38a; stroke-width: 2.6; fill: none; }
.hd-tag { display: flex; color: #ff8a66; margin: 3px 0 0; visibility: hidden; }
.hd-receipt {
  margin: 6px 0 0 !important; padding: 6px 8px;
  font-family: var(--mono); font-size: 11.5px; color: var(--ember-p);
  border: 1px solid #6b2a2e; border-radius: 6px; background: rgba(40, 10, 12, 0.7);
  visibility: hidden;
}
.hd-receipt b { color: #ff8f9a; font-weight: 500; }
.hd-stamp {
  margin: 10px 0 0 !important; padding-top: 8px; border-top: 1px solid #3a2a1a;
  font-family: var(--mono); font-size: 12px; color: var(--ember-p); visibility: hidden;
}
.hero-controls { position: absolute; right: 2%; bottom: 3%; z-index: 3; display: flex; gap: 8px; align-items: center; }
.hero-controls .pause { position: static; }
.hero-replay {
  font: inherit; font-family: var(--mono); font-size: 12px; color: var(--muted);
  background: rgba(20, 11, 5, 0.72); border: 1px solid var(--hair); border-radius: 20px;
  padding: 8px 14px; min-height: 40px; cursor: pointer;
}
.hero-replay:hover, .hero-replay:focus-visible { border-color: var(--ember-l); color: var(--text); }
.hero-replay:focus-visible { outline: 2px solid var(--ember-l); outline-offset: 3px; }
.catch-still { display: none; margin: 0; }
/* Reduced motion (and no WebGL): final frame plus the catch frame, all text present. */
.reduced .hero2 .hd-draft, .reduced .hero2 .hd-ok, .reduced .hero2 .hd-tag, .reduced .hero2 .hd-receipt,
.reduced .hero2 .hd-stamp, .reduced .hero2 .team-count, .reduced .hero2 .hero2-cta a,
.no-webgl .hero2 .hd-draft, .no-webgl .hero2 .hd-ok, .no-webgl .hero2 .hd-tag, .no-webgl .hero2 .hd-receipt,
.no-webgl .hero2 .hd-stamp, .no-webgl .hero2 .team-count, .no-webgl .hero2 .hero2-cta a { visibility: visible !important; opacity: 1 !important; }
.reduced .hero-controls, .no-webgl .hero-controls { display: none; }
/* Reduced motion: the catch frame and the final frame side by side as stills, the draft
   card (in its final state, all text present) below them. */
html.reduced:not(.no-webgl):not(.poster-mode) .hero2-grid { grid-template-columns: 1fr; }
html.reduced:not(.no-webgl):not(.poster-mode) .viz--hero {
  aspect-ratio: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
html.reduced:not(.no-webgl):not(.poster-mode) .viz--hero .viz-media {
  position: relative; inset: auto; aspect-ratio: 4 / 3; grid-column: 2; grid-row: 1;
}
html.reduced:not(.no-webgl):not(.poster-mode) .catch-still {
  display: block; position: relative; aspect-ratio: 4 / 3; grid-column: 1; grid-row: 1;
}
html.reduced:not(.no-webgl):not(.poster-mode) .viz--hero .hero-ui {
  position: relative; inset: auto; grid-column: 1 / -1; grid-row: 2;
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: flex-start;
}
html.reduced:not(.no-webgl):not(.poster-mode) .viz--hero .hero-ui > * { position: static; }
html.reduced:not(.no-webgl):not(.poster-mode) .viz--hero .hd-draft { width: min(560px, 100%); }
.catch-still img { width: 100%; height: 100%; object-fit: cover; display: block; }
.catch-still figcaption { position: absolute; left: 3%; top: 2%; font-family: var(--mono); font-size: 12px; color: var(--dim); }
@media (max-width: 900px) {
  .hero2-grid { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 760px) {
  .hero2 { padding: 4px 16px 48px; }
  .hero2-h1 { font-size: 52px; }
  .hero2-lede { font-size: 17px; margin-top: 12px; }
  .viz--hero { aspect-ratio: 1 / 1; margin-bottom: 16px; }
  /* the draft card sits under the stage, full width */
  .viz--hero .hd-draft { position: absolute; top: 100%; bottom: auto; left: 0; width: 100%; margin-top: 10px; font-size: 14px; }
  .viz--hero { margin-bottom: 230px; }
  .hero-ui .hero-meta, .team-count { font-size: 12px; }
  .team-count { top: auto; bottom: 3%; left: 3%; right: auto; }
  .hero-ui .hero-meta { right: 3%; }
  .viz--hero { margin-bottom: 300px; }
  .hd-ok, .hd-tag, .hd-receipt { font-size: 12px; }
  html.reduced:not(.no-webgl):not(.poster-mode) .viz--hero { grid-template-columns: 1fr; margin-bottom: 16px; }
  html.reduced:not(.no-webgl):not(.poster-mode) .viz--hero .viz-media { grid-column: 1; grid-row: 2; }
  html.reduced:not(.no-webgl):not(.poster-mode) .viz--hero .hero-ui { grid-row: 3; }
}

/* ---------- proof strip under the hero ---------- */
.proof { max-width: 1320px; margin: 0 auto; padding: 40px 24px 72px; border-top: 1px solid var(--band-border); }
.proof header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 10px 28px; margin-bottom: 22px; }
.proof h2 { margin: 0; font-size: clamp(34px, 4vw, 52px); }
.proof header p { margin: 0; max-width: 56ch; color: var(--muted); font-size: 16px; }
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.shots figure { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.shots img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--band-border); display: block; background: #0d0d10; }
.shots figcaption { font-size: 15px; color: var(--muted); }
.shots figcaption b { display: block; color: var(--text); font-weight: 600; font-size: 16px; }
@media (max-width: 900px) { .shots { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .proof { padding: 32px 16px 56px; } }

/* ---------- 2: captions ---------- */
.caps .cap {
  position: absolute;
  left: 4%;
  margin: 0;
  font-size: 17px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.cap--top { top: 3%; }
.cap--bottom { bottom: 3%; }
.cap-k {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--dim);
  min-width: 64px;
}
.cap-k--hot { color: #ff8a66; }
.cap-hot { color: #ffb39c; }

/* ---------- 3: claim over the two presences (x centering is set by GSAP xPercent) ---------- */
.check .who {
  position: absolute;
  transform: translate(-50%, 0);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  white-space: nowrap;
}
.who--a { left: 22.6%; top: 63%; }
.who--b { left: 77.4%; top: 63%; }
.who--c { left: 50%; top: 87%; }
.claim {
  position: absolute;
  left: 22.6%;
  top: 7%;
  font-size: 22px;
  white-space: nowrap;
  padding: 4px 6px;
}
.claim-text { position: relative; z-index: 1; }
.claim-strike {
  position: absolute;
  left: 2%;
  top: 46%;
  width: 96%;
  height: 10px;
  overflow: visible;
}
.claim-strike path { stroke: var(--ember); stroke-width: 3; fill: none; vector-effect: non-scaling-stroke; }
.claim-scan {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 0;
  width: 3px;
  background: var(--ember-p);
  box-shadow: 0 0 14px 3px rgba(255, 122, 51, 0.7);
  opacity: 0;
}
.stamp {
  position: absolute;
  left: 77.4%;
  top: 18%;
  border: 2px solid var(--ember);
  color: #ff8a66;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  background: rgba(10, 5, 2, 0.6);
}
.verified {
  position: absolute;
  left: 50%;
  top: 40%;
  display: flex;
  gap: 10px;
  align-items: center;
  white-space: nowrap;
  font-size: 16px;
  background: rgba(15, 26, 12, 0.85);
  border: 1px solid #3d6b2e;
  border-radius: 10px;
  padding: 8px 14px;
}
.verified svg { width: 20px; height: 20px; flex: none; }
.verified path { stroke: #9fd38a; stroke-width: 2.5; fill: none; }
.verified strong { color: #9fd38a; }

/* ---------- 6: approval card (real, focusable DOM) ---------- */
.approve { display: grid; place-items: center; }
.approve-card {
  pointer-events: auto;
  width: min(360px, 82%);
  box-sizing: border-box;
  background: rgba(20, 11, 5, 0.9);
  border: 1px solid #3a2a1a;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.approve-status { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--dim); }
.approve-title { margin: 10px 0 0; font-size: 24px; font-weight: 600; }
.approve-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }
.approve-actions button {
  font: inherit;
  font-size: 17px;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-approve { background: var(--ember); color: var(--bg); font-weight: 600; border: 1px solid var(--ember); }
.btn-decline { background: transparent; color: var(--text); border: 1px solid var(--hair); }
.approve-actions button:focus-visible { outline: 2px solid var(--ember-p); outline-offset: 3px; }
.btn-decline[aria-pressed='true'] { border-color: var(--ember-l); color: var(--ember-p); }
.approve-card[data-state='approved'] { border-color: #6b3a1a; }
.approve-card[data-state='approved'] .btn-approve { background: var(--panel2); color: var(--ember-p); }
.approve-card[data-state='approved'] .approve-status { color: var(--ember-p); }

/* ---------- 7: note ---------- */
.note {
  inset: auto auto 2% 3%;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

/* ---------- 8: labels under chat / tools / loop ---------- */
.flow-labels .fl {
  position: absolute;
  bottom: 4%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  white-space: nowrap;
}
.fl--chat { left: 15%; }
.fl--tools { left: 44%; }
.fl--loop { left: 77%; }

/* ---------- pinned stages (storyboard v2): beats, caption, beat list ---------- */
.stage { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; }
.stage > .row { width: 100%; box-sizing: border-box; padding-top: 48px; padding-bottom: 48px; }
.stage .viz { flex-basis: 600px; }
.beats .beat-step {
  position: absolute;
  top: 3%;
  left: 4%;
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--dim);
}
.beat-n { color: var(--ember-l); }
.beat-name { margin-left: 10px; color: var(--muted); }
.beats .beat-cap {
  position: absolute;
  left: 4%;
  right: 12%;
  bottom: 3%;
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.beats .budget {
  position: absolute;
  top: 3%;
  right: 4%;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  visibility: hidden;
}
.budget i { display: block; width: 18px; height: 6px; border-radius: 2px; background: var(--ember); transform-origin: left center; }
.budget b { font-weight: 500; color: var(--ember-p); margin-left: 4px; }
.beat-list {
  margin: 24px 0 0;
  padding: 0 0 0 1.4em;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--dim);
}
.beat-list li { margin: 4px 0; }
.beat-list li::marker { color: var(--ember-l); }
/* With motion, the beats are told by the scene and its caption; the list stays for screen
   readers. Without motion (or without WebGL) the list is shown. */
html:not(.reduced):not(.no-webgl) .beat-list {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.reduced .beats .beat-cap, .no-webgl .beats .beat-cap { display: none; }

/* ---------- 9: closing over an ember field ---------- */
.closing { position: relative; min-height: 560px; display: grid; place-items: center; overflow: hidden; }
.viz--bg { position: absolute; inset: 0; aspect-ratio: auto; flex: none; }
.viz--bg .viz-media {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
}
.closing-inner { position: relative; z-index: 2; max-width: 900px; padding: 140px 24px; text-align: center; }
.closing h2 { font-size: clamp(54px, 8vw, 84px); margin: 0; }
.closing-cta { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.btn {
  background: var(--ember);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  padding: 16px 30px;
  border-radius: 6px;
}
.btn:hover { color: var(--bg); background: var(--ember-l); }

/* ---------- mobile: stacked, 16px gutter, lighter type ---------- */
@media (max-width: 760px) {
  .row { padding: 80px 16px; gap: 32px; }
  .viz { flex-basis: 100%; }
  .caps .cap { font-size: 14px; gap: 8px; }
  .cap-k { font-size: 10px; min-width: 0; }
  .claim { font-size: 15px; }
  .check .who { font-size: 11px; }
  .stamp { font-size: 10px; padding: 3px 6px; }
  .verified { font-size: 13px; padding: 6px 10px; gap: 6px; }
  .verified svg { width: 16px; height: 16px; }
  .approve-card { padding: 16px; width: 86%; }
  .approve-title { font-size: 19px; }
  .approve-actions button { font-size: 15px; padding: 8px 16px; }
  .flow-labels .fl { font-size: 11px; }
  .closing { min-height: 460px; }
  .stage > .row { padding-top: 24px; padding-bottom: 24px; gap: 20px; }
  .stage h2 { font-size: 44px; }
  .stage .lede { margin-top: 10px; font-size: 16px; }
  /* Caption moves under the stage on phones: >= 13px and clear of the scene. */
  .stage .viz { margin-bottom: 5.2em; }
  .beats .beat-cap { top: 100%; bottom: auto; left: 0; right: 0; margin-top: 10px; font-size: 13px; }
  .beats .beat-step, .beats .budget { font-size: 10px; }
  .closing-inner { padding: 110px 16px; }
}

/* Scenes visiting another page: headings come from that page, the sky behind them is its own background. */
.scene-block { position:relative; color:var(--text); }
.scene-block .copy h2 { margin:0; }
.scene-block .lede { font-size:19px; line-height:1.5; }
.scene-block .source { font-family:var(--mono); }
