/* Valitio introduction film — page and player chrome.
   Tokens sampled from the product itself (the validation recording): deep green sidebar #004c46,
   mint accent #05d9b1 (primary buttons #01d2a5 with dark green text), teal actions #4ab09d,
   paper #f7f7f5 and near-white cards. The film's stage is the product's green. */
:root {
  color-scheme: dark;
  --green-900: #00302c; --green-800: #003b36; --green-700: #004c46; --green-600: #125952;
  --mint: #05d9b1; --mint-btn: #01d2a5; --mint-hover: #2fe3c2; --teal: #4ab09d; --paper: #f7f7f5;
  --bg: var(--green-900); --stage: var(--green-700);
  --fg: #f7f7f5; --fg-muted: #d3e3df; --fg-dim: #a6c6c0; --fg-faint: #7ca9a2;
  --border: rgb(5 217 177 / 20%); --border-soft: rgb(247 247 245 / 22%); --accent: var(--mint); --accent-soft: #8fe9d5;
  --glass: rgb(0 59 54 / 74%); --glass-hover: rgb(18 89 82 / 88%);
  --grad-emphasis: linear-gradient(115deg, #05d9b1 8%, #c6f5ea 96%);
  --font-sans: 'Inter', 'Arial', 'Helvetica Neue', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'Menlo', monospace;
  --shadow-card: 0 28px 70px -24px rgb(0 20 18 / 70%);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
.page { min-height: 100dvh; display: grid; place-items: center; padding: 28px 16px; }
.film { width: min(100%, 1240px); container-type: inline-size; }

.film-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 2px 12px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-faint); }

/* ── Stage ─────────────────────────────────────────────────────────────── */
.stage { position: relative; aspect-ratio: 16 / 9; background: var(--stage); border: 1px solid var(--border-soft); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-card); }
.film.is-narrow .stage { aspect-ratio: 1 / 1; }
.film-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.film-svg text { user-select: none; }

/* HUD: progress marker (top-left) and wordmark (top-right), HTML so they stay in the corners at every crop */
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud-progress { position: absolute; left: 3.2cqi; top: 3.6cqi; display: flex; gap: .6cqi; width: 22cqi; --seg-track: rgba(247,247,245,.16); }   /* the track is tweened darker on the light section */
.hud-progress .seg { flex: 1; height: 4px; border-radius: 2px; background: var(--seg-track); overflow: hidden; }
.hud-progress .fill { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--grad-emphasis); }
.film.is-narrow .hud-progress { width: 40cqi; top: 4cqi; }
.hud-brand { position: absolute; right: 3.2cqi; top: 2.6cqi; height: clamp(14px, 2cqi, 26px); width: auto; opacity: .9; }
.hud-brand-dark { opacity: 0; }   /* the dark wordmark, cross-faded in by the timeline on the light sections */

/* Subtitles */
.subs { position: absolute; left: 50%; bottom: 3.6cqi; transform: translateX(-50%); max-width: 86%; padding: .42em .9em; border-radius: 12px; border: 1px solid var(--border); background: rgb(0 48 44 / 88%); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--fg); font-weight: 500; font-size: clamp(14px, 2.3cqi, 30px); line-height: 1.35; text-align: center; text-wrap: balance; opacity: 0; transition: opacity .16s var(--ease-out); pointer-events: none; }
.subs.on { opacity: 1; }
.film.is-narrow .subs { font-size: clamp(14px, 4.6cqi, 20px); bottom: 4cqi; max-width: 92%; }

/* Overlays (start / end) */
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 4cqi; background: rgb(0 38 35 / 76%); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 3; }
.overlay[hidden] { display: none; }
.overlay-card { max-width: 46cqi; text-align: center; }
.film.is-narrow .overlay-card { max-width: 92cqi; }
.overlay-logo { height: clamp(20px, 3cqi, 40px); width: auto; margin-bottom: 2.2cqi; }
.overlay-eyebrow { margin: 0 0 1cqi; font-family: var(--font-mono); font-size: clamp(10px, .95cqi, 13px); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.overlay-title { margin: 0; font-weight: 600; font-size: clamp(20px, 3.1cqi, 44px); line-height: 1.08; letter-spacing: -.025em; text-wrap: balance; }
.overlay-title em { font-style: normal; background: var(--grad-emphasis); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.overlay-lede { margin: 1.4cqi auto 0; max-width: 42ch; font-size: clamp(12px, 1.25cqi, 17px); line-height: 1.55; color: var(--fg-muted); text-wrap: pretty; }
.film.is-narrow .overlay-lede { display: none; }
.overlay-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 2.2cqi; }
.overlay-note { margin: 1.6cqi 0 0; font-family: var(--font-mono); font-size: clamp(10px, .9cqi, 12px); letter-spacing: .08em; color: var(--fg-faint); }

/* Buttons — the product's primary button: mint pill, dark green text */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; font-family: var(--font-sans); font-weight: 600; font-size: clamp(13px, 1.1cqi, 15px); padding: .8em 1.6em; border-radius: 999px; border: 1px solid transparent; background: var(--mint-btn); color: var(--green-700); cursor: pointer; white-space: nowrap; text-decoration: none; transition: transform .14s var(--ease-out), box-shadow .22s var(--ease-out), background .14s var(--ease-out); }
.btn:hover { background: var(--mint-hover); box-shadow: 0 8px 28px rgb(0 20 18 / 30%); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--accent-soft); border-color: rgb(5 217 177 / 45%); }
.btn-ghost:hover { background: var(--glass-hover); box-shadow: none; }
.btn:focus-visible, .ctl:focus-visible, .bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Controls ──────────────────────────────────────────────────────────── */
.controls { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.ctl { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; min-width: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-soft); background: var(--glass); color: var(--fg-muted); font-family: var(--font-sans); font-weight: 500; font-size: 13px; cursor: pointer; transition: background .14s var(--ease-out), color .14s var(--ease-out), border-color .14s var(--ease-out); }
.ctl:hover { background: var(--glass-hover); color: var(--fg); }
.ctl[aria-pressed="true"] { border-color: rgb(5 217 177 / 60%); color: var(--fg); }
.ctl[aria-pressed="false"] .ctl-label { color: var(--fg-faint); }
.ico { width: 16px; height: 16px; fill: currentColor; flex: 0 0 auto; }
.ico-pause, .ico-muted { display: none; }
.film.is-playing .ico-play { display: none; } .film.is-playing .ico-pause { display: block; }
.film.is-muted .ico-sound { display: none; } .film.is-muted .ico-muted { display: block; }
.bar { flex: 1; display: flex; align-items: center; height: 38px; cursor: pointer; touch-action: none; }
.bar-track { position: relative; width: 100%; height: 4px; border-radius: 2px; background: rgb(247 247 245 / 14%); }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 2px; background: var(--grad-emphasis); }
.bar-knob { position: absolute; top: 50%; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--fg); transform: translate(-50%, -50%) scale(0); transition: transform .14s var(--ease-out); }
.bar:hover .bar-knob, .bar:focus-visible .bar-knob { transform: translate(-50%, -50%) scale(1); }
.time { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--fg-dim); min-width: 86px; text-align: right; font-variant-numeric: tabular-nums; }
.film-foot { margin: 10px 2px 0; min-height: 1.2em; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--fg-faint); }
/* Narrow player (phone): container query on .film so it follows the player's own width */
@container (max-width: 640px) {
  .ctl-label { display: none; }
  .time { min-width: 0; }
  .controls { gap: 6px; }
}

/* Fullscreen: keep the stage centred, controls underneath */
.film:fullscreen { width: 100%; height: 100%; padding: 16px; display: flex; flex-direction: column; justify-content: center; background: var(--bg); }
.film:fullscreen .stage { border-radius: 0; }
.film:fullscreen .stage { max-height: calc(100% - 120px); aspect-ratio: 16 / 9; margin: 0 auto; width: auto; }
.film:fullscreen .film-head, .film:fullscreen .film-foot { display: none; }

@media (prefers-reduced-motion: reduce) {
  .btn, .ctl, .bar-knob, .subs { transition: none; }
  .btn:hover { transform: none; }
}

/* ── Embedded in the landing's hero (?embed=1) ─────────────────────────── */
/* No page chrome, transparent ground, the host page sizes the frame (stage + controls). */
html.is-embed, html.is-embed body { background: transparent; overflow: hidden; }
html.is-embed .page { min-height: 0; display: block; padding: 0; }
html.is-embed .film { width: 100%; }
html.is-embed .film-head, html.is-embed .film-foot { display: none; }
html.is-embed .stage { border-radius: 14px; }
/* Chinese subtitles and cards (?lang=zh) fall back to the system's CJK faces, without the latin tracking */
html:lang(zh) body { font-family: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif; }
html:lang(zh) .overlay-title, html:lang(zh) .subs { letter-spacing: 0; }
