/* XSI Rapture — explainer film
   Fixed 1920x1080 stage, scaled to the window. Every animation is driven
   from one clock in engine.js, so the film can be paused, scrubbed and
   stepped chapter by chapter. */

/* Fonts are self-hosted (fonts/), so the film makes no outside requests. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Tokens live on body so a theme class can override the base values and
   everything derived from them (--line uses --tint) follows. */
body {
  /* Dark (default): neutral near-black, brand blue only as accent */
  --night: #050608;
  --night-2: #0c0e13;
  --night-3: #15181f;
  --tint: 196 206 230;
  --surface: 8 9 12;
  --surface-2: 14 16 21;
  --glow-1: rgba(11, 77, 255, 0.08);
  --glow-2: rgba(0, 200, 255, 0.035);
  --orb: rgba(11, 77, 255, 0.4);
  --paper: linear-gradient(180deg, #13161d, #0d0f14);
  --paper-ink: #f2f4f8;
  --paper-sub: #8e97aa;
  --paper-card: rgba(255, 255, 255, 0.045);
  --paper-card-ink: #e6e9f0;
  --paper-track: rgba(255, 255, 255, 0.08);
  --paper-accent: #8fb0ff;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.06);
  --line: rgb(var(--tint) / 0.16);
  --line-2: rgb(var(--tint) / 0.28);
  --blue: #0b4dff;
  --blue-deep: #0636b8;
  --blue-mid: #2f6bff;
  --blue-soft: #6f9bff;
  --blue-pale: #a9c3ff;
  --cyan: #00c8ff;
  --ink: #f2f4f8;
  --ink-2: #a4acbd;
  --ink-3: #6b7386;
  --commercial: #4c8dff;
  --customer: #a78bfa;
  --operational: #f5b83d;
  --opportunity: #34d399;
  --risk: #f87171;
  --ok: #34d399;
  --warn: #f5b83d;
  --bad: #f87171;
  --radius: 18px;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* Midnight: the navy-tinted look of the first cut, with a white report page */
body.theme-midnight {
  --night: #070c16;
  --night-2: #0e1626;
  --night-3: #131d33;
  --tint: 143 176 255;
  --surface: 7 12 22;
  --surface-2: 14 22 38;
  --glow-1: rgba(11, 77, 255, 0.16);
  --glow-2: rgba(0, 200, 255, 0.07);
  --orb: rgba(11, 77, 255, 0.55);
  --paper: linear-gradient(180deg, #f7f9ff, #e9eefb);
  --paper-ink: #070c16;
  --paper-sub: #4a5878;
  --paper-card: #fff;
  --paper-card-ink: #1d2740;
  --paper-track: #e2e8f6;
  --paper-accent: #0b4dff;
  --ink: #eef3ff;
  --ink-2: #aab7d4;
  --ink-3: #6b7a99;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.record, body.record * { cursor: none !important; }

/* ── Stage ─────────────────────────────────────────────── */

#stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 78% 18%, var(--glow-1), transparent 60%),
    radial-gradient(900px 600px at 10% 90%, var(--glow-2), transparent 60%),
    var(--night);
}

.bg-grid {
  position: absolute;
  inset: -80px;
  background-image:
    linear-gradient(rgb(var(--tint) / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--tint) / 0.05) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at 50% 45%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 30%, transparent 75%);
}

.bg-orb {
  position: absolute;
  width: 900px;
  height: 900px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  background: radial-gradient(circle, var(--orb), transparent 65%);
}

/* ── HUD (persistent brand + chapter) ──────────────────── */

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

.hud-brand {
  position: absolute;
  left: 72px;
  top: 52px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.02em;
}
.hud-brand svg { width: 34px; height: 34px; }
.hud-brand .sep { width: 1px; height: 22px; background: var(--line-2); }
.hud-brand .prod { font-weight: 500; color: var(--ink-2); }

.hud-chapter {
  position: absolute;
  right: 72px;
  top: 50px;
  text-align: right;
}
.hud-chapter .num {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--blue-soft);
  letter-spacing: 0.12em;
}
.hud-chapter .name {
  font-size: 18px;
  color: var(--ink-2);
  margin-top: 4px;
}
.hud-segs {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 12px;
}
.hud-segs i {
  display: block;
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: rgb(var(--tint) / 0.18);
  overflow: hidden;
  position: relative;
}
.hud-segs i b {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--cyan), var(--blue-mid));
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* One subtitle line in the strip below every scene's content (scenes end
   above ~940px, the caption sits at ~1010px), so it never covers a card. */
#caption {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 40;
  transform: translateX(-50%);
  max-width: 1760px;
  white-space: nowrap;
  padding: 8px 22px;
  border-radius: 10px;
  background: rgb(var(--surface) / 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  font-size: 22px;
  line-height: 1.35;
  color: var(--ink);
  text-align: center;
  opacity: 0;
  transition: opacity 0.35s ease;
}
#caption.on { opacity: 1; }
body.no-captions #caption { display: none; }

/* ── Scenes ────────────────────────────────────────────── */

.scene {
  position: absolute;
  inset: 0;
  display: none;
  padding: 150px 140px 160px;
}
.scene.active { display: block; }

[data-at] { opacity: 0; will-change: transform, opacity; }

.head { max-width: 1320px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-soft);
}
.eyebrow .ord {
  font-family: var(--mono);
  color: var(--cyan);
  letter-spacing: 0.08em;
}
.eyebrow .bar { width: 40px; height: 1px; background: var(--line-2); }
.title {
  margin-top: 18px;
  font-size: 60px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.title em {
  font-style: normal;
  background: linear-gradient(90deg, var(--cyan), var(--blue-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  margin-top: 20px;
  font-size: 25px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 1100px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--panel-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.icon { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.seekable { cursor: pointer; pointer-events: auto; }
.seekable:hover { filter: brightness(1.15); }

/* ── 01 Intro ──────────────────────────────────────────── */

#s-intro { display: none; padding: 0; }
#s-intro.active { display: flex; align-items: center; justify-content: center; flex-direction: column; }
.intro-logo { width: 300px; height: 300px; overflow: visible; }
.intro-logo rect { transform-box: fill-box; transform-origin: center; }
.intro-glow {
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 200, 255, 0.28), rgba(11, 77, 255, 0.12) 40%, transparent 70%);
  filter: blur(30px);
}
.intro-word {
  margin-top: 46px;
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 88px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.intro-word .sep { width: 2px; height: 70px; background: linear-gradient(var(--cyan), var(--blue)); }
.intro-word .prod { font-weight: 300; color: var(--ink-2); }
.intro-tag {
  margin-top: 22px;
  font-size: 28px;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.intro-meta {
  margin-top: 38px;
  display: flex;
  gap: 14px;
}

/* ── Rapture identity ─────────────────────────────────────
   Rapture has a look of its own, apart from the Signals film: a warm
   espresso ground with a woven texture, a serif display face with gold
   italics, centred editorial headings, gold hairlines, and progress shown
   as one gold line along the bottom edge. */

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/playfair-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/playfair-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Playfair Display";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/playfair-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Playfair Display";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/playfair-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body {
  --gold: #cca169;
  --cream: #f5e0b9;
  --wine: #690f12;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --night: #0e0a08;
  --night-2: #18120e;
  --night-3: #231a14;
  --tint: 232 205 165;
  --surface: 14 10 8;
  --surface-2: 24 18 14;
  --glow-1: rgba(204, 161, 105, 0.11);
  --glow-2: rgba(105, 15, 18, 0.24);
  --orb: rgba(204, 161, 105, 0.26);
  --ink: #f7efe3;
  --ink-2: #cbbba5;
  --ink-3: #8f7d68;
  --line: rgba(204, 161, 105, 0.2);
  --line-2: rgba(204, 161, 105, 0.34);
  --panel: rgba(245, 224, 185, 0.035);
  --panel-2: rgba(245, 224, 185, 0.06);
}

canvas.rug { display: block; image-rendering: pixelated; }
.mono { font-family: var(--mono); }

/* the ground: warm light from above, wine from below, drifting gold dust,
   and a large rug turning slowly behind everything */
#stage {
  background:
    radial-gradient(1100px 650px at 50% -5%, var(--glow-1), transparent 65%),
    radial-gradient(1000px 700px at 100% 105%, var(--glow-2), transparent 60%),
    var(--night);
}
.bg-dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bg-rug { position: absolute; right: -360px; top: 50%; width: 1300px; height: 1300px; margin-top: -650px; opacity: 0.055; image-rendering: pixelated; }
.intro-glow { background: radial-gradient(circle, rgba(204, 161, 105, 0.2), rgba(105, 15, 18, 0.14) 45%, transparent 70%); }

/* brand, chapter and progress */
.hud-brand { gap: 12px; font-size: 15px; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: var(--cream); }
.hud-brand svg { width: 26px; height: 26px; }
.hud-brand .sep { height: 16px; background: var(--gold); }
.hud-brand .prod { font-weight: 600; color: var(--gold); }
.hud-chapter .num { font-family: var(--serif); font-size: 26px; font-style: italic; letter-spacing: 0; color: var(--gold); }
.hud-chapter .name { margin-top: 2px; font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); }
/* #stage is transformed, so fixed here means pinned to the film's bottom edge */
.hud-segs { position: fixed; left: 0; right: 0; bottom: 0; gap: 2px; margin: 0; }
.hud-segs i { flex: 1; width: auto; height: 4px; border-radius: 0; background: rgba(245, 224, 185, 0.07); }
.hud-segs i b { background: linear-gradient(90deg, var(--gold), var(--cream)); }

/* captions as subtitles, not a panel */
#caption {
  bottom: 34px;
  padding: 6px 18px;
  border: 0;
  background: none;
  backdrop-filter: none;
  font-family: var(--serif);
  font-size: 27px;
  font-style: italic;
  color: var(--cream);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.9);
}

/* centred editorial headings */
.head { max-width: none; margin: 0 auto; text-align: center; }
.eyebrow { gap: 16px; font-size: 15px; letter-spacing: 0.34em; color: var(--gold); }
.eyebrow .ord { font-family: var(--serif); font-size: 21px; font-style: italic; letter-spacing: 0; color: var(--cream); }
.eyebrow .bar { width: 46px; background: linear-gradient(90deg, transparent, var(--gold)); }
.head .eyebrow::after { content: ""; width: 46px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
.title,
.outro-title { font-family: var(--serif); font-weight: 600; letter-spacing: -0.005em; line-height: 1.12; }
.title em,
.outro-title em { font-style: italic; font-weight: 500; color: transparent; background: linear-gradient(90deg, var(--cream), var(--gold)); -webkit-background-clip: text; background-clip: text; }
.lead { color: var(--ink-2); }

/* a large faint chapter numeral behind each scene */
.scene[data-ord]::before {
  content: attr(data-ord);
  position: absolute;
  left: 56px;
  bottom: 24px;
  font-family: var(--serif);
  font-size: 340px;
  font-style: italic;
  font-weight: 700;
  line-height: 0.8;
  color: rgba(204, 161, 105, 0.05);
  pointer-events: none;
}

/* sharper cards and chips with gold hairlines */
.card {
  border-radius: 6px;
  border: 1px solid rgba(204, 161, 105, 0.2);
  background: linear-gradient(180deg, rgba(245, 224, 185, 0.05), rgba(245, 224, 185, 0.015));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(245, 224, 185, 0.06);
}
.chip { border-radius: 4px; letter-spacing: 0.02em; color: var(--cream); background: rgba(204, 161, 105, 0.06); border-color: rgba(204, 161, 105, 0.3); }
.kc h4, .tc h4, .fc b, .result h3, .try h5, .ec h5, .order b, .shape, .side b, .notecard p, .file b { font-family: var(--serif); }

/* the opening: a rug weaves itself on the left, the name on the right */
#s-intro.active { flex-direction: row; gap: 120px; }
.intro-loom canvas { width: 384px; height: 576px; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.6)); }
.intro-text { text-align: left; }
.intro-by { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); }
.intro-by svg { width: 26px; height: 26px; }
.intro-name { margin-top: 20px; font-family: var(--serif); font-size: 156px; font-weight: 600; line-height: 1; letter-spacing: -0.01em; color: var(--cream); }
#s-intro .intro-tag { margin-top: 24px; font-family: var(--serif); font-size: 36px; font-style: italic; color: var(--ink-2); }
#s-intro .intro-meta { margin-top: 36px; justify-content: flex-start; flex-wrap: wrap; max-width: 760px; }

/* player accents */
.ctl-btn.on { background: rgba(204, 161, 105, 0.3); border-color: var(--gold); }
.ctl-btn[data-act="theme"] { display: none; }
#scrub .fill { background: linear-gradient(90deg, var(--gold), var(--cream)); }

/* ── 02 Problem ───────────────────────────────────────── */

.prob-copy { position: absolute; left: 140px; top: 270px; width: 700px; }
.prob-copy .title { font-size: 64px; }
.prob-strap { position: relative; display: inline-block; margin-top: 46px; font-size: 32px; font-weight: 600; }
.prob-strap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 4px;
  border-radius: 2px;
  background: var(--risk);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
}
.order { position: absolute; right: 140px; top: 250px; width: 860px; display: flex; align-items: center; gap: 18px; padding: 18px 24px; }
.order .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: var(--gold); background: rgba(204, 161, 105, 0.12); border: 1px solid rgba(204, 161, 105, 0.35); }
.order b { display: block; font-size: 21px; }
.order small { font-size: 16px; color: var(--ink-2); }
.order .chips { margin-left: auto; display: flex; gap: 8px; }
.tries { position: absolute; right: 140px; top: 410px; width: 860px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.try { text-align: center; }
.try canvas { width: 270px; height: 270px; margin: 0 auto; }
.try h5 { margin-top: 18px; font-size: 22px; font-weight: 700; }
.try .x { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; color: var(--risk); }
.try .x .icon { width: 18px; height: 18px; }

/* ── 03 One design, every shape ───────────────────────── */

.morph { position: absolute; left: 140px; top: 280px; width: 900px; height: 640px; }
.morph canvas { width: 900px; height: 640px; }
.shapes { position: absolute; right: 140px; top: 290px; width: 660px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.shape { display: flex; align-items: center; gap: 16px; padding: 16px 20px; font-size: 21px; font-weight: 600; color: var(--ink-3); }
.shape svg { flex: none; width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.shape.on { color: var(--ink); border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 30px rgba(204, 161, 105, 0.22); }
.shape.on svg { color: var(--gold); }
.dims { position: absolute; right: 140px; top: 600px; width: 660px; padding: 22px 26px; }
.dims .row { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; border-bottom: 1px solid rgb(var(--tint) / 0.1); font-size: 19px; color: var(--ink-2); }
.dims .row:last-child { border-bottom: 0; }
.dims .row b { font-family: var(--mono); font-size: 18px; font-weight: 500; color: var(--ink); }
.dims .row .same { color: var(--ok); }

/* ── 04 Reshaped, not redrawn ─────────────────────────── */

.keep-rug { position: absolute; left: 50%; top: 270px; width: 640px; height: 640px; margin-left: -320px; }
.keep-rug canvas { width: 640px; height: 640px; }
.km {
  position: absolute;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 800;
  color: #1a1512;
  background: #fff;
  box-shadow: 0 0 0 4px #1a1512, 0 0 0 9px rgba(255, 255, 255, 0.4), 0 8px 24px rgba(0, 0, 0, 0.55);
}
/* each marker sends out a slow ripple */
.km::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  animation: ripple 2.2s ease-out infinite;
}
@keyframes ripple {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(2.4); opacity: 0; }
}
.kc { position: absolute; width: 440px; padding: 20px 22px; }
.kc.l1 { left: 140px; top: 320px; }
.kc.l2 { left: 140px; top: 600px; }
.kc.r1 { right: 140px; top: 320px; }
.kc.r2 { right: 140px; top: 600px; }
.kc h4 { display: flex; align-items: center; gap: 12px; font-size: 23px; font-weight: 700; }
.kc h4 i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 14px; font-weight: 800; color: #1a1512; background: #fff; }
.kc p { margin-top: 10px; font-size: 18px; line-height: 1.5; color: var(--ink-2); }

/* ── 05 Knot-true ─────────────────────────────────────── */

.zoom { position: absolute; left: 140px; top: 290px; width: 620px; height: 620px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.zoom canvas { width: 620px; height: 620px; }
.zoom .tag { position: absolute; left: 18px; top: 18px; padding: 8px 14px; border-radius: 999px; font-family: var(--mono); font-size: 15px; color: var(--cream); background: rgba(10, 8, 6, 0.75); border: 1px solid rgba(245, 224, 185, 0.3); }
.calc { position: absolute; right: 140px; top: 290px; width: 880px; padding: 28px 32px; }
.calc h4 { font-size: 15px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.calc .grid { margin-top: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.inp { padding: 12px 14px; border-radius: 12px; background: var(--night-2); border: 1px solid var(--line); }
.inp small { display: block; font-size: 14px; color: var(--ink-3); }
.inp b { display: block; margin-top: 4px; font-family: var(--mono); font-size: 22px; font-weight: 500; }
.calc .eq { margin-top: 22px; display: flex; align-items: baseline; gap: 16px; }
.calc .eq > span { font-size: 18px; color: var(--ink-2); }
.calc .eq strong { font-size: 54px; font-weight: 800; letter-spacing: -0.02em; color: var(--gold); font-variant-numeric: tabular-nums; }
.calc .why { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 20px; line-height: 1.55; color: var(--ink-2); }
.calc .why b { color: var(--ink); }
.cmp { position: absolute; right: 140px; top: 690px; width: 880px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cmp .card { display: flex; align-items: center; gap: 16px; padding: 14px 18px; }
.cmp canvas { flex: none; width: 150px; height: 150px; border-radius: 10px; }
.cmp b { display: block; font-size: 20px; }
.cmp small { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 16px; font-weight: 600; }
.cmp .bad small { color: var(--risk); }
.cmp .good small { color: var(--ok); }
.cmp .icon { width: 16px; height: 16px; }

/* ── 06 Palette locked ────────────────────────────────── */

.swatches { position: absolute; left: 140px; top: 290px; width: 540px; display: flex; flex-direction: column; gap: 12px; }
.sw-h { margin-bottom: 4px; font-size: 15px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.sw { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 16px; padding: 12px 16px; }
.sw i { width: 64px; height: 44px; border-radius: 10px; background: var(--c); border: 1px solid rgba(255, 255, 255, 0.15); }
.sw b { font-size: 20px; }
.sw code { font-family: var(--mono); font-size: 15px; color: var(--ink-3); }
.edges { position: absolute; right: 140px; top: 290px; width: 1020px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ec { padding: 18px; }
.ec canvas { width: 100%; height: 420px; border-radius: 12px; }
.ec h5 { margin-top: 14px; display: flex; justify-content: space-between; align-items: baseline; font-size: 21px; font-weight: 700; }
.ec h5 span { font-family: var(--mono); font-size: 17px; font-weight: 500; }
.ec.bad h5 span { color: var(--risk); }
.ec.good h5 span { color: var(--ok); }

/* ── 07 The studio ────────────────────────────────────── */

.steps { position: absolute; left: 140px; right: 140px; top: 270px; display: flex; gap: 12px; }
.st { flex: 1; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); font-size: 19px; font-weight: 600; color: var(--ink-3); }
.st i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 13px; font-style: normal; color: var(--ink-2); background: var(--night-3); }
.st.on { color: var(--ink); border-color: var(--gold); background: rgba(204, 161, 105, 0.08); }
.st.on i { color: #1a1512; background: var(--gold); }
.st.done i { color: #06210f; background: var(--ok); }
.studio { position: absolute; left: 140px; top: 360px; width: 1160px; height: 560px; overflow: hidden; }
.view { position: absolute; inset: 0; padding: 32px 36px; }
.drop { height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; border: 2px dashed rgb(var(--tint) / 0.25); border-radius: 16px; font-size: 20px; color: var(--ink-2); }
.drop .icon { width: 44px; height: 44px; color: var(--gold); }
.file { margin-top: 22px; display: flex; align-items: center; gap: 18px; padding: 14px 18px; border-radius: 14px; background: var(--night-2); border: 1px solid var(--line); }
.file canvas { width: 60px; height: 90px; }
.file b { display: block; font-size: 20px; }
.file small { font-family: var(--mono); font-size: 15px; color: var(--ink-3); }
.file .ok { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--ok); }
.cfg { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 32px; }
.cfg h6 { font-size: 14px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.picker { margin-top: 10px; display: flex; gap: 8px; }
.pk { width: 58px; height: 58px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-3); border: 1px solid var(--line); background: var(--panel); }
.pk svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.pk.on { color: var(--gold); border-color: var(--gold); background: rgba(204, 161, 105, 0.12); }
.fields { margin-top: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.chipline { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.chipline i { width: 34px; height: 34px; border-radius: 8px; background: var(--c); border: 1px solid rgba(255, 255, 255, 0.15); }
.chipline span { margin-left: 8px; font-size: 16px; color: var(--ok); font-weight: 600; }
.plines { display: flex; flex-direction: column; gap: 16px; }
.pl { display: flex; align-items: center; gap: 14px; font-size: 21px; color: var(--ink-2); }
.pl .dot { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid rgb(var(--tint) / 0.3); display: grid; place-items: center; }
.pl.done { color: var(--ink); }
.pl.done .dot { background: var(--ok); border-color: var(--ok); color: #06210f; }
.pl .dot .icon { width: 15px; height: 15px; opacity: 0; }
.pl.done .dot .icon { opacity: 1; }
.pbar { margin-top: 30px; height: 10px; border-radius: 5px; background: rgb(var(--tint) / 0.1); overflow: hidden; }
.pbar b { display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: 5px; background: linear-gradient(90deg, var(--gold), var(--cream)); }
.result { display: flex; gap: 36px; align-items: center; }
.result canvas { flex: none; width: 460px; height: 460px; }
.result .badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; font-size: 16px; font-weight: 700; color: var(--ok); background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.4); }
.result h3 { margin-top: 18px; font-size: 34px; font-weight: 700; }
.result p { margin-top: 10px; font-family: var(--mono); font-size: 18px; color: var(--ink-2); }
.side { position: absolute; right: 140px; top: 360px; width: 440px; display: flex; flex-direction: column; gap: 14px; }
.side .card { padding: 18px 20px; }
.side b { display: block; font-size: 19px; }
.side p { margin-top: 6px; font-size: 16px; line-height: 1.5; color: var(--ink-2); }

/* ── 08 Checked ───────────────────────────────────────── */

.checks { position: absolute; left: 140px; top: 290px; width: 760px; padding: 26px 32px; }
.checks h4,
.notecard h4 { font-size: 15px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.ck { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgb(var(--tint) / 0.1); font-size: 22px; color: var(--ink-2); }
.ck:last-child { border-bottom: 0; }
.ck .tick { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 2px solid rgb(var(--tint) / 0.3); }
.ck .tick .icon { width: 17px; height: 17px; opacity: 0; }
.ck .res { margin-left: auto; font-family: var(--mono); font-size: 15px; color: var(--ok); opacity: 0; }
.ck.ok { color: var(--ink); }
.ck.ok .tick { background: var(--ok); border-color: var(--ok); color: #06210f; }
.ck.ok .tick .icon,
.ck.ok .res { opacity: 1; }
.notes { position: absolute; right: 140px; top: 290px; width: 820px; display: flex; flex-direction: column; gap: 18px; }
.notecard { padding: 24px 28px; }
.notecard p { margin-top: 12px; font-size: 22px; line-height: 1.5; }
.notecard small { display: block; margin-top: 10px; font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.notecard.dl { border-color: rgba(52, 211, 153, 0.35); }

/* ── 09 Production files ──────────────────────────────── */

.files-rug { position: absolute; left: 140px; top: 290px; width: 600px; height: 600px; }
.files-rug canvas { width: 600px; height: 600px; }
.files { position: absolute; right: 140px; top: 290px; width: 920px; display: flex; flex-direction: column; gap: 14px; }
.fc { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 18px; padding: 16px 22px; }
.fc .ext { width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; font-family: var(--mono); font-size: 14px; font-weight: 700; color: #fff; background: var(--ec); }
.fc b { font-size: 22px; }
.fc p { margin-top: 4px; font-size: 17px; color: var(--ink-2); }
.fc > .icon { color: var(--gold); }

/* ── 10 Your designs stay yours ───────────────────────── */

.trust { position: absolute; left: 140px; right: 140px; top: 350px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.tc { padding: 28px 30px; min-height: 230px; }
.tc .ico { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; color: var(--gold); background: rgba(204, 161, 105, 0.1); border: 1px solid rgba(204, 161, 105, 0.3); }
.tc h4 { margin-top: 20px; font-size: 25px; font-weight: 700; }
.tc p { margin-top: 10px; font-size: 18px; line-height: 1.55; color: var(--ink-2); }

/* ── 11 Outro ─────────────────────────────────────────── */

#s-outro { display: none; padding: 0; }
#s-outro.active { display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.outro-rugs { display: flex; align-items: flex-end; gap: 34px; }
.outro-rugs canvas { filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5)); }
.outro-title { margin-top: 44px; font-size: 72px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.08; }
.outro-sub { margin-top: 20px; font-size: 27px; color: var(--ink-2); }
.outro-chips { margin-top: 34px; display: flex; gap: 14px; justify-content: center; }
.outro-chips .chip { font-size: 19px; padding: 10px 18px; }
.outro-url { margin-top: 40px; font-family: var(--mono); font-size: 22px; color: var(--gold); letter-spacing: 0.06em; }

/* ── Player controls (outside the recorded stage) ──────── */

#controls {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(1180px, calc(100vw - 32px));
  padding: 12px 16px 14px;
  border-radius: 16px;
  background: rgb(var(--surface) / 0.88);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 100;
  transition: opacity 0.3s ease, transform 0.3s ease;
  font-size: 13px;
}
#controls.idle { opacity: 0; transform: translateX(-50%) translateY(12px); pointer-events: none; }
body.record #controls { display: none; }
.ctl-row { display: flex; align-items: center; gap: 10px; }
.ctl-btn {
  height: 34px;
  min-width: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ctl-btn:hover { border-color: var(--blue-soft); }
.ctl-btn.on { background: rgba(11, 77, 255, 0.35); border-color: var(--blue-mid); }
.ctl-btn svg { width: 16px; height: 16px; }
.ctl-time { font-family: var(--mono); color: var(--ink-2); min-width: 104px; text-align: center; }
.ctl-spacer { flex: 1; }
.ctl-hold { color: var(--cyan); font-weight: 600; opacity: 0; transition: opacity 0.2s; }
.ctl-hold.on { opacity: 1; }
#scrub { position: relative; height: 22px; margin-top: 10px; cursor: pointer; }
#scrub .rail { position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 2px; background: rgb(var(--tint) / 0.15); }
#scrub .fill { position: absolute; left: 0; top: 9px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--cyan), var(--blue-mid)); }
#scrub .knob { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(11, 77, 255, 0.4); }
#scrub .tick { position: absolute; top: 6px; width: 2px; height: 10px; margin-left: -1px; background: rgb(var(--tint) / 0.35); }
#chapters { display: flex; gap: 4px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
#chapters button {
  flex: 1 0 auto;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
#chapters button:hover { color: var(--ink); background: var(--panel-2); }
#chapters button.cur { color: var(--ink); border-color: var(--line-2); background: var(--panel-2); }
#chapters button span { font-family: var(--mono); color: var(--blue-soft); margin-right: 6px; }

#help {
  position: fixed;
  right: 18px;
  top: 18px;
  padding: 16px 20px;
  border-radius: 14px;
  background: rgb(var(--surface) / 0.94);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.9;
  z-index: 101;
  display: none;
}
#help.on { display: block; }
#help kbd { font-family: var(--mono); padding: 1px 7px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--ink); margin-right: 6px; }

/* Embedded on a web page (?embed): no player bar; click the film to pause or play */
body.embed #controls { display: none; }


/* small frames: drop the chapter rail, the scrubber still has chapter ticks */
@media (max-width: 900px) {
  #chapters { display: none; }
  .ctl-time { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .typing::after { animation: none; }
}
