/* Viral short-form video deck: shared scene styles. Tokens come from /assets/tokens.css, runtime from /deck/deck.css,
 * the phone frame from kit.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-studio { --s-bg: #EEEFF1; --s-fg: #111111; --s-muted: #55575C; --s-line: #D9DADF; --s-accent: #FF7F32; background: radial-gradient(120% 90% at 72% 42%, #FFFFFF 0%, #F1F2F4 58%, #E6E7EA 100%), #EEEFF1; 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="studio"], .deck[data-theme="claude"] { --hud-fg: #111; }
.theme-paper, .theme-white { --s-muted: var(--ink-2, #555); }
.theme-night .vv-src, .theme-ryze .vv-src { opacity: .9; }

/* ---------- the reserved HUD zones: content padding follows the engine's --hud-top / --hud-bottom ---------- */
.scene .scene__inner.vv { 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 .vv { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); row-gap: clamp(14px, 2.8vh, 34px); align-items: start; }
.vv-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; }
.vv-vis { position: relative; min-width: 0; min-height: 0; }
.vv-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 .vv--split { grid-template-columns: minmax(0, .36fr) minmax(0, .64fr); grid-template-rows: auto minmax(0, 1fr); column-gap: clamp(28px, 4.5vw, 80px); }
.vv--split .vv-side { grid-column: 1; grid-row: 2; align-self: start; max-width: 25em; }
.vv--split .vv-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 */
.vv--stage .vv-vis { grid-row: 3; align-self: stretch; height: 100%; }
.vv--stage .vv-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 > .vv-vis { position: absolute; inset: 0; z-index: 0; }
.scene .vv--full, .scene .vv--right { pointer-events: none; z-index: 1; }
.vv--full > *, .vv--right > * { pointer-events: auto; }
.vv--full .vv-t, .vv--right .vv-t { max-width: min(100%, 19em); }
/* full: the side text sits right under the title, over the 3D on a scrim */
.vv--full .vv-side { grid-row: 2; max-width: min(27em, 100%); align-self: start; }
.scene .vv--right { grid-template-columns: minmax(0, 1fr) minmax(0, 24em); }
.vv--right .vv-t { grid-column: 1 / -1; }
.vv--right .vv-side { grid-column: 2; grid-row: 2 / 4; align-self: start; }

/* scrims inside a 3D host (scrimIn) and on the layer (class vv-scrimmed on the scene) */
.vv-scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.vv-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%); }
.vv-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%); }
.vv-scrim--top.vv-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%); }
.vv-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%); }
.vv-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 */
.vv-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 .vv-label, .theme-studio .vv-label { text-shadow: 0 1px 10px rgb(255 255 255 / .9); }
.vv-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="vv-ann" style="--side:right">text</div> */
.vv-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; }
.vv-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; }
.vv-ann--left { flex-direction: row-reverse; }
.vv-ann--left::before { border: 2px solid var(--cta); border-left: 0; border-radius: 0 4px 4px 0; }
.vv-ann--rose::before { border-color: var(--c-rose-d); }

/* ---------- copy blocks ---------- */
.scene .vv-note { font-size: clamp(16px, 1.32vw, 21px); line-height: 1.5; color: var(--s-muted); max-width: 30em; }
.vv-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.vv-steps li { position: relative; padding-left: 22px; font-size: clamp(16px, 1.3vw, 20px); line-height: 1.4; color: var(--s-fg); }
.vv-steps li::before { content: ""; position: absolute; left: 2px; top: .52em; width: 8px; height: 8px; border-radius: 50%; background: var(--cta); }
.scene .vv-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; }
.vv-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 .vv-pit, .theme-night .vv-pit { color: var(--c-rose); }
.theme-ink .vv-pit__i, .theme-night .vv-pit__i { background: rgb(225 181 168 / .16); color: var(--c-rose); }
.vv-src { display: inline-block; font-size: 14px; line-height: 1.4; font-weight: 500; color: var(--s-muted); opacity: .82; }
.vv-src--line { display: block; margin-top: 4px; }
.vv-stat { display: grid; gap: 4px; align-content: start; }
.vv-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); }
.vv-stat--sm .vv-stat__v { font-size: clamp(28px, 2.8vw, 46px); }
.vv-stat--xl .vv-stat__v { font-size: clamp(56px, 8vw, 140px); }
.vv-stat--orange .vv-stat__v { color: var(--cta); }
.vv-stat--rose .vv-stat__v { color: var(--c-rose-t); }
.theme-ink .vv-stat--rose .vv-stat__v, .theme-night .vv-stat--rose .vv-stat__v { color: var(--c-rose); }
.vv-stat__l { font-size: clamp(14px, 1.1vw, 17px); line-height: 1.4; color: var(--s-fg); max-width: 26em; }
.vv-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; }
.vv-tag--line { box-shadow: inset 0 0 0 1px var(--s-line); color: var(--s-fg); }
.vv-tag--orange { background: var(--cta); color: #fff; }
.vv-tag--rose { background: var(--c-rose); color: var(--c-rose-t); }
.vv-tag--aqua { background: var(--c-aqua); color: var(--c-aqua-t); }
.vv-tag--ink { background: #111; color: #fff; }

/* ---------- surfaces ---------- */
.vv-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); }
.vv-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) */
.vv-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; }
.vv-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene canvas { display: block; }
.vv-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 */
.vv-ht { position: relative; height: 18px; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--s-line); overflow: hidden; --dot: #A9A6A0; }
.vv-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); }
.vv-ht--v { width: 22px; height: auto; }
.vv-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); }
.vv-ht--orange { --dot: var(--cta); }
.vv-ht--rose { --dot: var(--c-rose-d); }
.vv-ht--aqua { --dot: var(--c-aqua-d); }
.vv-ht--lilac { --dot: #A996D8; }
.vv-ht--grey { --dot: #A9A6A0; }
.theme-ink .vv-ht--grey, .theme-night .vv-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 */
.vv-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 .vv-side [data-show]:not(.is-on), .scene .vv-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.vv { 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 .vv { row-gap: 12px; }
  .vv-t { font-size: clamp(24px, 3.3vw, 32px); line-height: 1.12; letter-spacing: -.022em; }
  .scene .vv--split { column-gap: 28px; }
  .vv-side { gap: 10px; }
  .scene .vv-note { font-size: 15px; line-height: 1.42; }
  .vv-steps { gap: 8px; }
  .vv-steps li { font-size: 15px; }
  .scene .vv-pit { font-size: 14px; }
  .vv-stat__v { font-size: clamp(30px, 4.4vw, 48px); }
  .vv-stat__l { font-size: 14px; }
  .vv-label, .vv-ann { font-size: 14px; }
  .vv--full .vv-side { max-width: min(30em, 100%); }
}
@media (max-height: 439px) {
  .vv-t { font-size: 24px; }
  .scene .vv-note { font-size: 14px; }
}

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

/* the Example / Illustrative tag on made-up values and drawn shapes */
.vv-example { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 14px; font-weight: 500; line-height: 1; color: #576F76; background: rgb(255 255 255 / .86); box-shadow: inset 0 0 0 1px #DFE4E7; white-space: nowrap; }
.theme-night .vv-example, .theme-ink .vv-example { color: rgb(255 255 255 / .74); background: rgb(255 255 255 / .06); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .18); }
/* a beat-driven word block: several texts in one grid cell (stack() in lib.js) */
.vv-stack { display: grid; }
.vv-stack > * { grid-area: 1 / 1; }
