/* Google Ads deck: shared scene styles. Tokens come from /assets/tokens.css, runtime from /deck/deck.css,
 * Google Ads interface pieces from gads.css. Chapter styles live in ch-*.css and prefix every selector with their own class.
 * Layout classes (FORMAT section 7): desktop = at least 960 x 600; compact = landscape below that, down to 640 x 360
 * (rules under @media (max-width: 959px), (max-height: 599px)); phone = portrait and narrower than 760
 * (@media (max-width: 759px) and (orientation: portrait)). The engine also sets .deck[data-layout]. */

/* ---------- extra worlds ---------- */
.theme-gads { --s-bg: #F1F3F4; --s-fg: #202124; --s-muted: #5F6368; --s-line: #DADCE0; --s-accent: #1A73E8; background: radial-gradient(120% 90% at 70% 40%, #FFFFFF 0%, #F1F3F4 62%, #E8EAED 100%), #F1F3F4; color: var(--s-fg); }
.theme-claude { --s-bg: #F5F4EE; --s-fg: #1f1e1d; --s-muted: #6b6a66; --s-line: #E3E0D6; --s-accent: #D97757; background: var(--s-bg); color: var(--s-fg); }
.deck[data-theme="gads"], .deck[data-theme="claude"] { --hud-fg: #111; }
.theme-paper, .theme-white { --s-muted: var(--ink-2, #555); }
.theme-night .ga-src, .theme-ryze .ga-src { opacity: .9; }

/* ---------- the reserved HUD zones: content padding follows the engine's --hud-top / --hud-bottom ---------- */
.scene .scene__inner.ga { padding: calc(var(--hud-top, 64px) + clamp(8px, 2.2vh, 28px)) clamp(24px, 6vw, 112px) calc(var(--hud-bottom, 100px) + clamp(4px, 1.4vh, 18px)); }

/* ---------- layout: every scene is built with shell() ---------- */
.scene .ga { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); row-gap: clamp(14px, 2.8vh, 34px); align-items: start; }
.ga-t { grid-column: 1 / -1; grid-row: 1; max-width: min(100%, 23em); font-size: clamp(28px, 3.05vw, 50px); line-height: 1.08; letter-spacing: -.028em; font-weight: 500; color: var(--s-fg); text-wrap: balance; position: relative; z-index: 2; }
.ga-vis { position: relative; min-width: 0; min-height: 0; }
.ga-side { position: relative; z-index: 2; display: grid; gap: 16px; align-content: start; min-width: 0; }

/* round 5: supporting text always sits directly under the title; the visual goes beside it (split, right) or below it (stage, full) */
/* split: side text left under the title, visual right */
.scene .ga--split { grid-template-columns: minmax(0, .36fr) minmax(0, .64fr); grid-template-rows: auto minmax(0, 1fr); column-gap: clamp(28px, 4.5vw, 80px); }
.ga--split .ga-side { grid-column: 1; grid-row: 2; align-self: start; max-width: 25em; }
.ga--split .ga-vis { grid-column: 2; grid-row: 2; align-self: stretch; height: 100%; }

/* stage: side text directly under the title, the visual full width below it */
.ga--stage .ga-vis { grid-row: 3; align-self: stretch; height: 100%; }
.ga--stage .ga-side { grid-row: 2; grid-auto-flow: row; gap: 8px; align-items: start; max-width: 46em; }

/* full and right: the visual is a full-bleed layer behind the grid (3D worlds) */
.scene > .ga-vis { position: absolute; inset: 0; z-index: 0; }
.scene .ga--full, .scene .ga--right { pointer-events: none; z-index: 1; }
.ga--full > *, .ga--right > * { pointer-events: auto; }
.ga--full .ga-t, .ga--right .ga-t { max-width: min(100%, 19em); }
/* full: the side text sits right under the title, over the 3D on a scrim */
.ga--full .ga-side { grid-row: 2; max-width: min(27em, 100%); align-self: start; }
.scene .ga--right { grid-template-columns: minmax(0, 1fr) minmax(0, 24em); }
.ga--right .ga-t { grid-column: 1 / -1; }
.ga--right .ga-side { grid-column: 2; grid-row: 2 / 4; align-self: start; }

/* scrims inside a 3D host (scrimIn) and on the layer (class ga-scrimmed on the scene) */
.ga-scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.ga-scrim--top { background: linear-gradient(180deg, color-mix(in srgb, var(--s-bg) 88%, transparent) 0, color-mix(in srgb, var(--s-bg) 60%, transparent) 28%, transparent 50%); }
.ga-scrim--bottom { background: linear-gradient(0deg, color-mix(in srgb, var(--s-bg) 86%, transparent) 0, color-mix(in srgb, var(--s-bg) 30%, transparent) 26%, transparent 40%); }
.ga-scrim--top.ga-scrim--bottom { background: linear-gradient(180deg, color-mix(in srgb, var(--s-bg) 88%, transparent) 0, color-mix(in srgb, var(--s-bg) 55%, transparent) 28%, transparent 48%), linear-gradient(0deg, color-mix(in srgb, var(--s-bg) 86%, transparent) 0, transparent 36%); }
.ga-scrim--right { background: linear-gradient(270deg, color-mix(in srgb, var(--s-bg) 88%, transparent) 0, color-mix(in srgb, var(--s-bg) 40%, transparent) 30%, transparent 46%); }
.ga-scrim--left { background: linear-gradient(90deg, color-mix(in srgb, var(--s-bg) 88%, transparent) 0, color-mix(in srgb, var(--s-bg) 40%, transparent) 30%, transparent 46%); }

/* a DOM label pinned to a 3D point (place() positions it); keep it readable on any 3D background */
.ga-label { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; white-space: nowrap; font-size: 15px; font-weight: 500; line-height: 1.25; will-change: transform; color: var(--s-fg); text-shadow: 0 1px 12px rgb(0 0 0 / .65); }
.theme-paper .ga-label, .theme-gads .ga-label { text-shadow: 0 1px 10px rgb(255 255 255 / .9); }
.ga-label--chip { padding: 5px 10px; border-radius: 4px; background: color-mix(in srgb, var(--s-bg) 72%, transparent); backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px var(--s-line); text-shadow: none; }

/* an orange annotation bracket for product mocks: <div class="ga-ann" style="--side:right">text</div> */
.ga-ann { position: absolute; z-index: 4; display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; line-height: 1.25; color: var(--s-fg); white-space: nowrap; pointer-events: none; }
.ga-ann::before { content: ""; flex: none; width: 10px; height: var(--ah, 28px); border: 2px solid var(--cta); border-right: 0; border-radius: 4px 0 0 4px; }
.ga-ann--left { flex-direction: row-reverse; }
.ga-ann--left::before { border: 2px solid var(--cta); border-left: 0; border-radius: 0 4px 4px 0; }
.ga-ann--rose::before { border-color: var(--c-rose-d); }

/* ---------- copy blocks ---------- */
.scene .ga-note { font-size: clamp(16px, 1.32vw, 21px); line-height: 1.5; color: var(--s-muted); max-width: 30em; }
.ga-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ga-steps li { position: relative; padding-left: 22px; font-size: clamp(16px, 1.3vw, 20px); line-height: 1.4; color: var(--s-fg); }
.ga-steps li::before { content: ""; position: absolute; left: 2px; top: .52em; width: 8px; height: 8px; border-radius: 50%; background: var(--cta); }
.scene .ga-pit { display: flex; gap: 10px; align-items: flex-start; font-size: clamp(15px, 1.2vw, 18px); line-height: 1.45; color: var(--c-rose-t); max-width: 30em; }
.ga-pit__i { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: -1px; border-radius: 4px; background: color-mix(in srgb, var(--c-rose) 45%, transparent); color: var(--c-rose-t); }
.theme-ink .ga-pit, .theme-night .ga-pit { color: var(--c-rose); }
.theme-ink .ga-pit__i, .theme-night .ga-pit__i { background: rgb(225 181 168 / .16); color: var(--c-rose); }
.ga-src { display: inline-block; font-size: 14px; line-height: 1.4; font-weight: 500; color: var(--s-muted); opacity: .82; }
.ga-src--line { display: block; margin-top: 4px; }
.ga-stat { display: grid; gap: 4px; align-content: start; }
.ga-stat__v { font-size: clamp(38px, 4.6vw, 80px); line-height: 1; letter-spacing: -.035em; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--s-fg); }
.ga-stat--sm .ga-stat__v { font-size: clamp(28px, 2.8vw, 46px); }
.ga-stat--xl .ga-stat__v { font-size: clamp(56px, 8vw, 140px); }
.ga-stat--orange .ga-stat__v { color: var(--cta); }
.ga-stat--rose .ga-stat__v { color: var(--c-rose-t); }
.theme-ink .ga-stat--rose .ga-stat__v, .theme-night .ga-stat--rose .ga-stat__v { color: var(--c-rose); }
.ga-stat__l { font-size: clamp(14px, 1.1vw, 17px); line-height: 1.4; color: var(--s-fg); max-width: 26em; }
.ga-tag { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 4px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.ga-tag--line { box-shadow: inset 0 0 0 1px var(--s-line); color: var(--s-fg); }
.ga-tag--orange { background: var(--cta); color: #fff; }
.ga-tag--rose { background: var(--c-rose); color: var(--c-rose-t); }
.ga-tag--aqua { background: var(--c-aqua); color: var(--c-aqua-t); }
.ga-tag--ink { background: #111; color: #fff; }

/* ---------- surfaces ---------- */
.ga-card { position: relative; background: #fff; border-radius: 8px; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ll-line), 0 1px 2px rgba(17,17,17,.04), 0 8px 22px -14px rgba(17,17,17,.12); }
.ga-dark { position: relative; background: #111; color: #fff; border-radius: 8px; box-shadow: 0 18px 40px -26px rgba(28,106,96,.4); }
/* the accent stroke: a gradient ring that starts orange top-left and melts (hero objects only) */
.ga-stroke::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none; background: var(--accent-stroke);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; }
.ga-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene canvas { display: block; }
.ga-label { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; white-space: nowrap; font-size: 14px; font-weight: 500; line-height: 1.2; will-change: transform; }

/* halftone bars: --v from 0 to 1 */
.ga-ht { position: relative; height: 18px; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--s-line); overflow: hidden; --dot: #A9A6A0; }
.ga-ht i { position: absolute; left: 3px; top: 3px; bottom: 3px; width: calc(100% - 6px); background: radial-gradient(circle, var(--dot) 1.5px, transparent 1.9px) 0 0 / 5px 5px; clip-path: inset(0 calc((1 - var(--v, 0)) * 100%) 0 0); transition: clip-path 1.2s var(--ease); }
.ga-ht--v { width: 22px; height: auto; }
.ga-ht--v i { left: 3px; right: 3px; top: 3px; bottom: 3px; width: auto; clip-path: inset(calc((1 - var(--v, 0)) * 100%) 0 0 0); }
.ga-ht--orange { --dot: var(--cta); }
.ga-ht--rose { --dot: var(--c-rose-d); }
.ga-ht--aqua { --dot: var(--c-aqua-d); }
.ga-ht--lilac { --dot: #A996D8; }
.ga-ht--grey { --dot: #A9A6A0; }
.theme-ink .ga-ht--grey, .theme-night .ga-ht--grey { --dot: rgb(255 255 255 / .42); }

/* departure board */
.flap { display: inline-flex; gap: 2px; font: 600 clamp(16px, 1.6vw, 24px)/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.flap__c { position: relative; display: inline-block; width: .8em; height: 1.32em; overflow: hidden; background: #0a0a0b; color: #fff; border-radius: 2px; text-align: center; box-shadow: inset 0 -1px 0 rgb(255 255 255 / .05); }
.flap__c::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgb(0 0 0 / .7); }
.flap__s { display: flex; flex-direction: column; transition: transform 1.3s cubic-bezier(.2, .8, .2, 1); }
.flap__s span { display: block; height: 1.32em; line-height: 1.32em; }

/* typing caret */
.ga-typing::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -0.12em; background: currentColor; animation: rz-blink 1s steps(1) infinite; }

/* sliders */
.scene input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; --trk: rgb(0 0 0 / .16); }
.theme-ink input[type="range"], .theme-night input[type="range"] { --trk: rgb(255 255 255 / .3); }
.scene input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--trk); }
.scene input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--trk); }
.scene input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--cta), 0 4px 10px rgb(0 0 0 / .25); }
.scene input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--cta), 0 4px 10px rgb(0 0 0 / .25); }
.scene input[type="range"]:focus-visible { outline: 2px solid var(--cta); outline-offset: 4px; border-radius: 4px; }

.scene [data-show]:not(.is-on), .scene [data-hide]:not(.is-on) { pointer-events: none; }
/* round 5: supporting text that belongs to another beat takes no room, so the current beat's text sits right under the title */
.scene .ga-side [data-show]:not(.is-on), .scene .ga-side [data-hide]:not(.is-on) { display: none; }


/* ---------- compact: landscape below 960 x 600 (titles 24 px, body 15 px, nothing below 14 px) ---------- */
@media (max-width: 959px), (max-height: 599px) {
  .scene .scene__inner.ga { padding-left: clamp(20px, 4vw, 48px); padding-right: clamp(20px, 4vw, 48px); padding-top: calc(var(--hud-top, 52px) + 6px); padding-bottom: calc(var(--hud-bottom, 80px) + 4px); }
  .scene .ga { row-gap: 12px; }
  .ga-t { font-size: clamp(24px, 3.3vw, 32px); line-height: 1.12; letter-spacing: -.022em; }
  .scene .ga--split { column-gap: 28px; }
  .ga-side { gap: 10px; }
  .scene .ga-note { font-size: 15px; line-height: 1.42; }
  .ga-steps { gap: 8px; }
  .ga-steps li { font-size: 15px; }
  .scene .ga-pit { font-size: 14px; }
  .ga-stat__v { font-size: clamp(30px, 4.4vw, 48px); }
  .ga-stat__l { font-size: 14px; }
  .ga-label, .ga-ann { font-size: 14px; }
  .ga--full .ga-side { max-width: min(30em, 100%); }
}
@media (max-height: 439px) {
  .ga-t { font-size: 24px; }
  .scene .ga-note { font-size: 14px; }
}

/* ---------- phone: portrait and narrower than 760 ---------- */
@media (max-width: 759px) and (orientation: portrait) {
  .scene .scene__inner.ga { padding: calc(var(--hud-top, 56px) + 8px) 16px calc(var(--hud-bottom, 96px) + 6px); }
  .ga-t { font-size: clamp(22px, 6.4vw, 28px); line-height: 1.15; letter-spacing: -.02em; max-width: 100%; }
  .scene .ga--split { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); row-gap: 12px; }
  .ga--split .ga-vis { grid-column: 1; grid-row: 3; }
  .ga--split .ga-side { grid-column: 1; grid-row: 2; align-self: start; max-width: none; }
  .ga--stage .ga-side { grid-auto-flow: row; gap: 10px; max-width: none; }
  .scene .ga--right { grid-template-columns: minmax(0, 1fr); }
  .ga--right .ga-side { grid-column: 1; grid-row: 2; align-self: start; }
  .ga--full .ga-side, .ga--right .ga-side { max-width: none; }
  .ga-side { gap: 10px; }
  .scene .ga-note { font-size: 15px; }
  .ga-steps { gap: 8px; }
  .ga-steps li { font-size: 15px; padding-left: 18px; }
  .ga-steps li::before { width: 7px; height: 7px; }
  .scene .ga-pit { font-size: 14px; }
  .ga-pit__i { width: 22px; height: 22px; }
  .ga-src { font-size: 14px; }
  .ga-stat__l { font-size: 14px; }
  .flap { font-size: 14px; }
  .ga-label, .ga-ann { font-size: 14px; }
}

/* an inactive scene shows nothing: some "is-on" rules (here and in /deck/ryze.css) set visibility: visible, which would
 * otherwise beat the engine's .scene { visibility: hidden } and leave their text over other slides */
.scene:not(.is-active), .scene:not(.is-active) * { visibility: hidden !important; }
/* a delayed visibility transition would otherwise keep fading text visible for up to 0.8 s after the scene has left */
.scene:not(.is-active) * { transition: none !important; }

/* no one-word last lines in body copy */
.scene .ga-note, .scene .ga-pit, .scene .ga-stat__l { text-wrap: pretty; }
