/* ============================================================
   MWINDA AI BUSINESS INTELLIGENCE
   Dark console for working, white document for printing.
   ============================================================ */
:root {
  --bg: #050507;
  --bg-2: #0a0a0f;
  --panel: #0d0d13;
  --panel-2: #12121a;
  --gold-1: #FFE680;
  --gold-2: #FFD700;
  --gold-3: #D4AF37;
  --line: rgba(212, 175, 55, 0.18);
  --line-strong: rgba(212, 175, 55, 0.45);
  --text: #f6f1e1;
  --mute: #a39c8b;
  --dim: #6f6a5c;
  --ok: #7dc98f;
  --warn: #e0b34c;
  --bad: #e08c8c;
  --serif: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--gold-3); color: #000; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(5, 5, 7, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 18px; padding: 14px 0; }
.brand {
  font-family: var(--serif); font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; font-size: 15px; color: var(--gold-2);
  text-decoration: none; white-space: nowrap;
}
.brand small {
  display: block; font-family: var(--sans); font-size: 9px;
  letter-spacing: .3em; color: var(--mute); font-weight: 600;
}
.topbar-spacer { flex: 1; }
.topbar a.back {
  color: var(--mute); text-decoration: none; font-size: 13px;
  border-bottom: 1px solid transparent;
}
.topbar a.back:hover { color: var(--gold-2); border-bottom-color: var(--line-strong); }

/* ---------- hero ---------- */
.hero { padding: 56px 0 34px; }
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .3em;
  text-transform: uppercase; color: var(--mute); margin: 0 0 18px;
}
.eyebrow b { color: var(--gold-3); font-weight: 600; }
h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(32px, 5.4vw, 54px); letter-spacing: .01em;
  text-transform: uppercase; line-height: 1.08; margin: 0 0 14px;
  color: var(--gold-2); text-wrap: balance;
}
h1 .thin { color: var(--text); font-weight: 500; }
.lede { color: var(--mute); max-width: 46em; margin: 0 0 8px; font-size: 17px; }

/* ---------- step rail ---------- */
.rail {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 16px;
  border-bottom: 1px solid var(--line); margin-bottom: 30px;
  scrollbar-width: thin;
}
.rail button {
  flex: 0 0 auto; background: none; border: 1px solid var(--line);
  border-radius: 999px; color: var(--dim); cursor: pointer;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em;
  padding: 7px 14px; white-space: nowrap; transition: all .2s var(--ease);
}
.rail button:hover:not(:disabled) { color: var(--gold-1); border-color: var(--line-strong); }
.rail button.active { background: var(--gold-3); color: #000; border-color: var(--gold-3); font-weight: 600; }
.rail button.done { color: var(--ok); border-color: rgba(125,201,143,.4); }
.rail button:disabled { opacity: .32; cursor: not-allowed; }

/* ---------- panels ---------- */
.step { display: none; padding-bottom: 60px; }
.step.active { display: block; animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step.active { animation: none; } }

h2 {
  font-family: var(--serif); font-size: clamp(21px, 3vw, 27px); font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; margin: 0 0 6px; color: var(--text);
}
h2 .g { color: var(--gold-2); }
h3 {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--gold-3); margin: 0 0 12px;
}
.sub { color: var(--mute); margin: 0 0 26px; max-width: 52em; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 24px 26px; margin-bottom: 18px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 820px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- forms ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--mute); margin-bottom: 7px;
}
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--sans); font-size: 15px; padding: 11px 13px; outline: none;
  transition: border-color .2s;
}
.field textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--line-strong); }
.field .hint { font-size: 12.5px; color: var(--dim); margin-top: 6px; }
.field select {
  appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D4AF37' stroke-width='2' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chips button {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--mute); cursor: pointer; font-family: var(--sans); font-size: 14px;
  padding: 10px 16px; transition: all .2s var(--ease);
}
.chips button:hover { border-color: var(--line-strong); color: var(--text); }
.chips button.on { background: rgba(212,175,55,.14); border-color: var(--gold-3); color: var(--gold-1); font-weight: 500; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--gold-3); color: #000; border: none; border-radius: 8px;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 13px 24px; cursor: pointer; text-decoration: none;
  transition: background .2s, transform .2s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--gold-2); transform: translateY(-2px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.ghost { background: none; border: 1px solid var(--line-strong); color: var(--gold-1); }
.btn.ghost:hover:not(:disabled) { background: rgba(212,175,55,.1); }
.btn.small { font-size: 12px; padding: 9px 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 24px; }

/* ---------- status / progress ---------- */
.status {
  font-family: var(--mono); font-size: 13px; color: var(--gold-1);
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 13px 16px; margin-top: 18px;
  display: flex; align-items: center; gap: 12px;
}
.status.err { color: var(--bad); border-color: rgba(224,140,140,.35); }
.spin {
  width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid rgba(212,175,55,.25); border-top-color: var(--gold-2);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }

/* ---------- content blocks ---------- */
.kv { margin: 0 0 18px; }
.kv:last-child { margin-bottom: 0; }
.kv dt {
  font-size: 11px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold-3); margin-bottom: 5px;
}
.kv dd { margin: 0; color: var(--text); }
ul.clean { margin: 0; padding: 0; list-style: none; }
ul.clean li { padding: 6px 0 6px 20px; position: relative; color: var(--mute); }
ul.clean li::before {
  content: ''; position: absolute; left: 0; top: 15px;
  width: 9px; height: 1px; background: var(--gold-3);
}
.tag {
  display: inline-block; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--line-strong); border-radius: 4px;
  padding: 2px 8px; color: var(--gold-3); margin-left: 8px; vertical-align: middle;
}
.tag.high { color: var(--bad); border-color: rgba(224,140,140,.45); }
.tag.medium { color: var(--warn); border-color: rgba(224,179,76,.45); }
.tag.low { color: var(--ok); border-color: rgba(125,201,143,.4); }
.tag.conf-high { color: var(--ok); border-color: rgba(125,201,143,.4); }
.tag.conf-medium { color: var(--warn); border-color: rgba(224,179,76,.45); }
.tag.conf-low { color: var(--bad); border-color: rgba(224,140,140,.45); }

/* editable text areas that look like prose until focused */
.editable {
  width: 100%; background: transparent; color: var(--text);
  border: 1px solid transparent; border-radius: 6px;
  font-family: var(--sans); font-size: 15px; line-height: 1.7;
  padding: 8px 10px; resize: vertical; outline: none;
}
.editable:hover { border-color: var(--line); }
.editable:focus { border-color: var(--line-strong); background: var(--bg-2); }

/* ---------- financial table ---------- */
table.fin { width: 100%; border-collapse: collapse; font-size: 14px; }
table.fin th, table.fin td {
  text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
table.fin th:first-child, table.fin td:first-child { text-align: left; }
table.fin th {
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-3); font-weight: 600;
}
table.fin td { color: var(--mute); }
table.fin tr.total td { color: var(--text); font-weight: 600; border-top: 1px solid var(--line-strong); }
.pos { color: var(--ok); }
.neg { color: var(--bad); }
.scenario { text-align: center; padding: 20px 16px; }
.scenario .name {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mute); margin-bottom: 12px;
}
.scenario .num {
  font-family: var(--serif); font-size: 25px; font-weight: 700;
  color: var(--gold-2); letter-spacing: .02em;
}
.scenario .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--mute); margin-top: 7px; }
.metric { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.metric:last-child { border-bottom: none; }
.metric span:first-child { color: var(--mute); }
.metric span:last-child { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- compliance ---------- */
.legal-banner {
  background: rgba(224,179,76,.07); border: 1px solid rgba(224,179,76,.32);
  border-radius: 10px; padding: 16px 18px; margin-bottom: 22px;
  font-size: 14px; color: var(--text);
}
.legal-banner b { color: var(--warn); }
.check-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.check-item:last-child { border-bottom: none; }
.check-item .top { display: flex; align-items: flex-start; gap: 12px; }
.check-item input[type=checkbox] { margin-top: 5px; accent-color: var(--gold-3); width: 16px; height: 16px; flex: 0 0 auto; }
.check-item .req { color: var(--text); font-weight: 500; }
.check-item .meta { color: var(--dim); font-size: 13px; margin-top: 6px; padding-left: 28px; }
.check-item .meta b { color: var(--mute); font-weight: 600; }

/* ---------- roadmap ---------- */
.phase { margin-bottom: 22px; }
.phase-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.phase-head .n { font-family: var(--mono); font-size: 11px; color: var(--gold-3); }
.phase-head .name { font-weight: 600; color: var(--text); }
.phase-head .dur { font-size: 12px; color: var(--dim); margin-left: auto; }
.phase .obj { color: var(--mute); font-size: 14px; margin: 0 0 10px; }
.task { display: flex; align-items: flex-start; gap: 10px; padding: 5px 0; font-size: 14.5px; color: var(--mute); }
.task input { accent-color: var(--gold-3); margin-top: 4px; width: 15px; height: 15px; }
.task.done label { text-decoration: line-through; opacity: .55; }

/* ---------- dossier / print ---------- */
.doc-section { margin-bottom: 30px; }
.doc-section h4 {
  font-family: var(--serif); font-size: 17px; font-weight: 600;
  letter-spacing: .05em; color: var(--gold-2); margin: 0 0 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.doc-section p { margin: 0 0 12px; color: var(--mute); }
.doc-cover { text-align: center; padding: 30px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.doc-cover .t { font-family: var(--serif); font-size: 28px; color: var(--gold-2); letter-spacing: .05em; margin-bottom: 8px; }
.doc-cover .m { color: var(--dim); font-size: 13.5px; }

.footnote { color: var(--dim); font-size: 12.5px; margin-top: 10px; }
/* A footnote that is telling the founder something went wrong has to read as
   a notice, not as small print they will scroll past. */
.footnote.warn { color: var(--warn); }

/* Export note: the way back to the file when the browser's download landed
   somewhere the reader cannot see. See bi-pdf.js. */
#pdfNote { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 22px; }
#pdfNote:empty { margin: 0; }
.pdf-open {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(212,175,55,.14); border: 1px solid var(--gold-3);
  border-radius: 8px; color: var(--gold-1); text-decoration: none;
  font-size: 13px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; padding: 10px 16px;
  transition: background .2s var(--ease);
}
.pdf-open:hover { background: rgba(212,175,55,.24); }
.pdf-meta { font-family: var(--mono); font-size: 12px; color: var(--mute); }
.pdf-hint { flex: 1 1 100%; color: var(--dim); font-size: 12.5px; }

/* The access link, shown in full so a refused clipboard costs nothing. */
.link-out {
  display: inline-block; margin-top: 8px; cursor: pointer;
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  color: var(--gold-1); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; word-break: break-all; max-width: 100%;
}
.link-out:hover { border-color: var(--line-strong); }
footer.site { border-top: 1px solid var(--line); padding: 26px 0 40px; margin-top: 40px; color: var(--dim); font-size: 13px; }

/* saved projects */
.proj { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.proj:last-child { border-bottom: none; }
.proj .nm { flex: 1; color: var(--text); }
.proj .dt { color: var(--dim); font-size: 12px; font-family: var(--mono); }
.bar { height: 4px; background: var(--bg-2); border-radius: 2px; overflow: hidden; width: 110px; }
.bar i { display: block; height: 100%; background: var(--gold-3); }

/* ============================================================
   PRINT — the deliverable. White paper, black text, no console.
   ============================================================ */
@media print {
  @page { margin: 18mm 16mm; }
  html, body { background: #fff !important; color: #111 !important; font-size: 11pt; }
  .topbar, .rail, .hero, .actions, footer.site, .no-print, .btn,
  #pdfNote { display: none !important; }
  /* The fixed background layer — poster, ignition and a multi-megabyte video —
     has no business in a print job. Chrome has to snapshot a playing <video>
     to lay out the page, which is slow at best and has been seen to fail the
     preview outright. */
  .site-bg { display: none !important; }
  .step { display: none !important; }
  .step#step-dossier { display: block !important; padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .panel { background: #fff !important; border: none; border-radius: 0; padding: 0; margin: 0 0 16pt; }
  h2, h3, .doc-section h4, .doc-cover .t { color: #111 !important; }
  .doc-section h4 { border-bottom: 1pt solid #bbb; page-break-after: avoid; }
  .doc-section { page-break-inside: avoid; }
  .doc-cover { border-bottom: 1pt solid #bbb; }
  .doc-cover .m, .sub, .kv dd, ul.clean li, .doc-section p, table.fin td, .check-item .meta, .phase .obj, .task { color: #333 !important; }
  .kv dt, h3 { color: #666 !important; }
  table.fin th { color: #444 !important; }
  table.fin th, table.fin td { border-bottom: 0.5pt solid #ddd; }
  .tag { color: #444 !important; border-color: #999 !important; }
  .legal-banner { background: #f7f3e8 !important; border: 1pt solid #d8c78a; color: #222 !important; }
  .legal-banner b { color: #7a5c14 !important; }
  .editable { border: none !important; background: transparent !important; color: #222 !important; padding: 0; }
  .scenario .num { color: #111 !important; }
  a { color: #111 !important; text-decoration: none; }
}

/* sync indicator */
.sync {
  font-family: var(--mono); font-size: 12px; margin: 14px 0 0;
  display: flex; align-items: center; gap: 8px; color: var(--dim);
}
.sync::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
}
.sync.synced { color: var(--ok); }
.sync.syncing { color: var(--gold-3); }
.sync.error { color: var(--warn); }
/* Not a status — a warning that work will be lost on reload. */
.sync.unsaved { color: var(--bad); font-weight: 600; }
@media print { .sync { display: none !important; } }

/* ============================================================
   XXL tech hero media
   Poster image today, <video> the moment one is dropped in.
   Both animate forever; both freeze under prefers-reduced-motion.
   ============================================================ */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero-media {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.hero-media-img,
.hero-media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  will-change: transform;
}
/* A video, when present, sits on top of and replaces the poster. */
.hero-media video { z-index: 1; }
.hero-media video + .hero-media-img { display: none; }

/* Infinite slow drift — the "always animated" background. */
.hero-media-img { animation: heroDrift 32s ease-in-out infinite alternate; }
@keyframes heroDrift {
  from { transform: scale(1.06) translate3d(-1.2%, -0.8%, 0); }
  to   { transform: scale(1.16) translate3d(1.2%, 0.8%, 0); }
}

/* Legibility: the text must win over the artwork, always. */
.hero-media-veil {
  position: absolute; inset: 0; z-index: 3;
  background:
    linear-gradient(90deg, rgba(5,5,7,.96) 0%, rgba(5,5,7,.82) 42%, rgba(5,5,7,.35) 72%, rgba(5,5,7,.55) 100%),
    linear-gradient(180deg, rgba(5,5,7,.88) 0%, rgba(5,5,7,.25) 38%, rgba(5,5,7,.92) 100%);
}
@media (max-width: 900px) {
  .hero-media-veil {
    background:
      linear-gradient(180deg, rgba(5,5,7,.9) 0%, rgba(5,5,7,.72) 45%, rgba(5,5,7,.95) 100%);
  }
}

/* Engineering-blueprint overlay: fine grid + a slow scanning sweep. */
.hero-media-scan {
  position: absolute; inset: 0; z-index: 4;
  background-image:
    linear-gradient(rgba(120,190,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,190,255,.07) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px;
  mask-image: radial-gradient(ellipse 78% 68% at 50% 45%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 78% 68% at 50% 45%, #000 35%, transparent 100%);
}
.hero-media-scan::after {
  content: '';
  position: absolute; left: 0; right: 0; height: 34%;
  background: linear-gradient(180deg, transparent, rgba(120,190,255,.09), transparent);
  animation: heroScan 9s linear infinite;
}
@keyframes heroScan {
  from { transform: translateY(-40%); }
  to   { transform: translateY(300%); }
}

/* Hero content must sit above every media layer. */
.hero-content, .hero-3d, .hero-scroll, .hero > .wrap { position: relative; z-index: 5; }

@media (prefers-reduced-motion: reduce) {
  .hero-media-img { animation: none; transform: scale(1.08); }
  .hero-media-scan::after { animation: none; opacity: .35; }
  .hero-media video { display: none; }
  .hero-media video + .hero-media-img { display: block; }
}

/* ============================================================
   Bulb ignition loop — the "switching on" motion, in CSS.
   Sits over the hero artwork, centred on the bulb. Runs forever,
   slowly, because it lives behind headline text: a background that
   flickers or strobes makes the title unreadable.
   ============================================================ */
.hero-media-ignite {
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none;
  display: grid; place-items: center;
}
.hero-media-ignite::before {
  /* the filament bloom */
  content: '';
  width: min(46vw, 640px); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(180,240,255,.5) 0%,
    rgba(80,190,255,.26) 22%,
    rgba(40,140,255,.12) 42%,
    transparent 68%);
  filter: blur(14px);
  transform: translateY(-6%);
  animation: bulbIgnite 7.5s ease-in-out infinite;
}
.hero-media-ignite::after {
  /* the hot core, tighter and brighter */
  content: '';
  position: absolute;
  width: min(15vw, 190px); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,253,255,.9) 0%, rgba(120,215,255,.42) 45%, transparent 72%);
  filter: blur(8px);
  transform: translateY(-14%);
  animation: bulbCore 7.5s ease-in-out infinite;
}

/* One cycle: dark filament, a quick strike, settle into a steady burn,
   then fade back down. Mirrors how an incandescent bulb actually behaves. */
@keyframes bulbIgnite {
  0%   { opacity: .06; transform: translateY(-6%) scale(.86); }
  7%   { opacity: .85; transform: translateY(-6%) scale(1.06); }
  11%  { opacity: .45; transform: translateY(-6%) scale(.97); }
  16%  { opacity: .92; transform: translateY(-6%) scale(1.03); }
  55%  { opacity: .78; transform: translateY(-6%) scale(1.01); }
  82%  { opacity: .5;  transform: translateY(-6%) scale(.96); }
  100% { opacity: .06; transform: translateY(-6%) scale(.86); }
}
@keyframes bulbCore {
  0%   { opacity: 0;   transform: translateY(-14%) scale(.6); }
  7%   { opacity: 1;   transform: translateY(-14%) scale(1.12); }
  11%  { opacity: .55; transform: translateY(-14%) scale(.95); }
  16%  { opacity: 1;   transform: translateY(-14%) scale(1.04); }
  55%  { opacity: .9;  transform: translateY(-14%) scale(1); }
  82%  { opacity: .55; transform: translateY(-14%) scale(.92); }
  100% { opacity: 0;   transform: translateY(-14%) scale(.6); }
}

/* A video, once present, carries its own ignition — drop the CSS one. */
.hero-media video ~ .hero-media-ignite { display: none; }

@media (prefers-reduced-motion: reduce) {
  .hero-media-ignite::before { animation: none; opacity: .7; }
  .hero-media-ignite::after  { animation: none; opacity: .85; }
}

/* ============================================================
   Page-wide background artwork
   The bulb sits behind the ENTIRE page, fixed, so it stays put while
   content scrolls over it. z-index -1 paints it above the body gradient
   but below every block background and every line of text, which is what
   keeps long-form copy readable over a photograph.
   ============================================================ */
.site-bg {
  position: fixed; inset: 0; z-index: -1;
  overflow: hidden; pointer-events: none;
}
.site-bg-img,
.site-bg video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 38%;
  will-change: transform;
  animation: siteDrift 46s ease-in-out infinite alternate;
}
/* The video fades in over the poster only once it is genuinely playing —
   video-bg.js adds .video-ready on the `playing` event. Keying this off the mere
   presence of the element meant a 404, an unsupported codec or a browser
   refusing autoplay would hide the artwork and leave a black rectangle. */
/* The drift keeps a STILL background alive; a playing video already moves. The
   extra zoom only crops the framing and burns GPU on a full-viewport layer. */
.site-bg video {
  z-index: 1; opacity: 0; transition: opacity .9s ease;
  animation: none; transform: none;
}
.site-bg.video-ready video { opacity: 1; }
.site-bg.video-ready .site-bg-ignite { display: none; }

@keyframes siteDrift {
  from { transform: scale(1.08) translate3d(-1%, -0.6%, 0); }
  to   { transform: scale(1.16) translate3d(1%, 0.6%, 0); }
}

/* The filament keeps igniting behind the whole page. */
.site-bg-ignite {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
}
.site-bg-ignite::before {
  content: '';
  opacity: .42;
  width: min(52vw, 720px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle,
    rgba(180,240,255,.46) 0%, rgba(80,190,255,.22) 22%,
    rgba(40,140,255,.1) 44%, transparent 68%);
  filter: blur(18px); transform: translateY(-8%);
  animation: bulbIgnite 7.5s ease-in-out infinite;
}
.site-bg-ignite::after {
  content: ''; position: absolute;
  opacity: .38;
  width: min(16vw, 210px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(240,253,255,.85) 0%, rgba(120,215,255,.38) 45%, transparent 72%);
  filter: blur(10px); transform: translateY(-16%);
  animation: bulbCore 7.5s ease-in-out infinite;
}

/* The scrim. Strong enough that body copy stays readable anywhere on the
   page, light enough that the artwork is unmistakably present. */
.site-bg-veil {
  position: absolute; inset: 0; z-index: 3;
  background:
    radial-gradient(ellipse 85% 65% at 50% 32%, rgba(5,5,7,.76) 0%, rgba(5,5,7,.9) 55%, rgba(5,5,7,.95) 100%),
    linear-gradient(180deg, rgba(5,5,7,.6) 0%, rgba(5,5,7,.84) 55%, rgba(5,5,7,.92) 100%);
}
@media (max-width: 900px) {
  /* Small screens crop hard and carry more text per pixel — dim further. */
  .site-bg-veil {
    background:
      radial-gradient(ellipse 100% 45% at 50% 22%, rgba(5,5,7,.62) 0%, rgba(5,5,7,.9) 60%, rgba(5,5,7,.95) 100%),
      linear-gradient(180deg, rgba(5,5,7,.7) 0%, rgba(5,5,7,.9) 100%);
  }
}

/* When a video is actually playing, lift the scrim: a background loop buried
   under a 76-95% black wash is a cost with no benefit. The lift is modest and
   deliberate — headings sit exactly where the centre of this gradient falls,
   and washing them out was a real regression once before. Text contrast was
   re-checked at these values, not assumed. */
/* In the hero the video is the point, so the wash nearly disappears: the clip
   reads at roughly nine parts video to one part scrim. Only the hero — every
   section below it is transparent, so page copy scrolls directly over the
   moving image and needs the full scrim back. script.js/bi.js add
   .past-hero once the hero is scrolled away. */
.site-bg.video-ready .site-bg-veil {
  /* No wash at all: while a video plays the clip is the background, full
     strength, top to bottom. Legibility is handled entirely at the glyph
     level below — a shadow that travels with the type, so the image stays
     uncovered everywhere there is no text. */
  background: none;
  transition: background .45s ease;
}
/* Reading position: the scrim comes back so body copy stays legible. */
/* Heavier than the main site's reading scrim on purpose: this page sets its
   secondary copy in --mute (#a39c8b), which is dimmer than --text, and measured
   4.36:1 over a worst-case bright frame at the lighter values — under WCAG AA.
   Measured, not guessed, and corrected here rather than by dimming the type. */

@media (max-width: 900px) {
  /* Phones carry more text per pixel and are read in daylight — lift less. */
}

/* Same reasoning as the main site: protect the glyphs, not the whole page. */
.site-bg.video-ready ~ * h1,
.site-bg.video-ready ~ * .lede,
.site-bg.video-ready ~ * .eyebrow {
  text-shadow: 0 2px 26px rgba(5, 5, 7, .95), 0 1px 8px rgba(5, 5, 7, .9), 0 0 3px rgba(5, 5, 7, .75);
}

/* With the reading scrim thinned so the clip stays visible while scrolling,
   body copy needs its own protection. A shadow travels with the glyphs, so the
   video shows through everywhere between the words — which a darker page-wide
   curtain cannot do. Applied only when a video is actually playing. */
body.has-video-bg p,
body.has-video-bg li,
body.has-video-bg dd,
body.has-video-bg .lede,
body.has-video-bg .sub,
body.has-video-bg .req,
body.has-video-bg .meta,
body.has-video-bg h2,
body.has-video-bg h3,
body.has-video-bg h4 {
  text-shadow: 0 0 2px rgba(5,5,7,.95), 0 1px 6px rgba(5,5,7,.95), 0 2px 22px rgba(5,5,7,.9);
}

/* The scrim is thin so the clip stays visible; that leaves the DIM copy as the
   binding constraint, not the video. --mute (#a39c8b) measured 3.5:1 over a
   worst-case bright frame — under WCAG AA — so the type is brightened while a
   video plays rather than the background darkened back down. Fixing the
   contrast where it is actually weak keeps the video visible, which is the
   whole point of the change. */
body.has-video-bg .sub,
body.has-video-bg .lede,
body.has-video-bg .hint,
body.has-video-bg .footnote,
body.has-video-bg .meta {
  color: #ddd6c6;
}

/* Most MVP copy already sits inside .panel, which is opaque. These few blocks
   float directly on the background; with no global wash they need their own. */
body.has-video-bg .step > .sub,
body.has-video-bg .hero .lede,
body.has-video-bg .hero .eyebrow {
  background: linear-gradient(180deg, rgba(6, 7, 11, .66), rgba(6, 7, 11, .56));
  -webkit-backdrop-filter: blur(14px) saturate(125%);
  backdrop-filter: blur(14px) saturate(125%);
  border-radius: 14px;
  padding: 14px 18px;
}
@supports not (backdrop-filter: blur(2px)) {
  body.has-video-bg .step > .sub,
  body.has-video-bg .hero .lede,
  body.has-video-bg .hero .eyebrow {
    background: linear-gradient(180deg, rgba(6, 7, 11, .66), rgba(6, 7, 11, .56));
  }
}

/* The MVP centres its copy, so there is no clear side to spare — a straight
   vertical wash, strong at the top where the headline and lede sit. */
.site-bg.video-ready .site-bg-veil {
  background: linear-gradient(180deg,
    rgba(5,5,7,.80) 0%, rgba(5,5,7,.70) 35%, rgba(5,5,7,.62) 70%, rgba(5,5,7,.72) 100%);
  transition: background .45s ease;
}

/* Same trap as the main site: any gradient-clipped text would show the shadow
   through a transparent fill. This page's accents are solid colours already,
   but pin them bright over the clip. */
body.has-video-bg h1 .thin { color: #ffffff; }
body.has-video-bg h2 .g { color: #FFE680; }

/* Steps not yet reachable sit at 32% opacity, which reads as "dimmed" on a
   flat page and as "invisible" over a moving image. Lift them and give the rail
   its own backdrop so the whole strip stays legible. */
body.has-video-bg .rail {
  background: linear-gradient(180deg, rgba(6,7,11,.62), rgba(6,7,11,.48));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  padding-left: 10px; padding-right: 10px;
}
body.has-video-bg .rail button:disabled { opacity: .62; }
body.has-video-bg .rail button { text-shadow: 0 1px 6px rgba(5,5,7,.9); }

@media (prefers-reduced-motion: reduce) {
  .site-bg-img { animation: none; transform: scale(1.1); }
  .site-bg-ignite::before { animation: none; opacity: .3; }
  .site-bg-ignite::after  { animation: none; opacity: .3; }
  /* The video is never started under reduced motion (video-bg.js checks the same
     query); hidden here too so an over-eager browser cannot override it. */
  .site-bg video { display: none; }
}
