/* =============================================
   BP Data — Style
   Refined engineering minimalism · gold on near-black
   Marcellus (display) · DM Sans (body) · IBM Plex Mono (data)
   ============================================= */

/* ---------- Variables ---------- */
:root {
  /* Light — default theme: warm engineering-paper */
  color-scheme: light;
  --bg: #f6f4ee;
  --bg-alt: #eeebe1;
  --bg-panel: #f1eee6;
  --text: #211f19;
  --text-muted: #5a564a;
  --text-dim: #837e6f;
  --gold: #846921;
  --gold-bright: #96792c;
  --gold-glow: rgba(132, 105, 33, 0.18);
  --gold-dim: rgba(132, 105, 33, 0.08);
  --green: #2e7d4f;
  --red: #a83e3e;
  --line: #dcd5c3;
  --line-gold: rgba(132, 105, 33, 0.35);
  --nav-bg: rgba(246, 244, 238, 0.85);
  --nav-bg-solid: rgba(246, 244, 238, 0.97);
  --stage-bg: #f2efe7;
  --stage-border: #ded7c5;
  --stage-grid: #e4ddca;
  --ink: #2a2820;
  --ink-soft: #6e6857;
  --ink-faint: #98917d;
  --ink-line: #a49c86;
  --ink-line-soft: #beb6a0;
  --shell-stroke: #8d8570;
  --shell-stroke-strong: #746b4f;
  --shell-stroke-soft: #a59d87;
  --cell-fill: #fbf9f3;
  --cell-dot: #8f8672;
  --placeholder: #a39d8d;
  --btn-bg: #26231b;
  --btn-fg: #eee1b8;
  --btn-bg-hover: #3a3528;
  --panel-shadow: 0 1px 3px rgba(48, 41, 22, 0.06), 0 10px 28px rgba(48, 41, 22, 0.06);
  --radius: 2px;
  --font-display: 'Marcellus', serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --max-w: 1140px;
  --nav-h: 64px;
  --auto-ms: 8s;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08080c;
  --bg-alt: #0d0d14;
  --bg-panel: #10101a;
  --text: #e8e8ee;
  --text-muted: #a8a8b6;
  --text-dim: #82828f;
  --gold: #cbb06a;
  --gold-bright: #dcc37e;
  --gold-glow: color-mix(in srgb, var(--gold) 16%, transparent);
  --gold-dim: color-mix(in srgb, var(--gold) 8%, transparent);
  --green: #5eb87f;
  --red: #c05252;
  --line: #262636;
  --line-gold: color-mix(in srgb, var(--gold) 32%, transparent);
  --nav-bg: rgba(8, 8, 12, 0.82);
  --nav-bg-solid: rgba(8, 8, 12, 0.96);
  --stage-bg: #0a0a11;
  --stage-border: #191929;
  --stage-grid: #1b1b2c;
  --ink: #dedee6;
  --ink-soft: #9797ab;
  --ink-faint: #6e6e84;
  --ink-line: #4e4e6e;
  --ink-line-soft: #3e3e5a;
  --shell-stroke: #5c5c80;
  --shell-stroke-strong: #62628a;
  --shell-stroke-soft: #4c4c6a;
  --cell-fill: #0d0d15;
  --cell-dot: #6a6a92;
  --placeholder: #62626e;
  --btn-bg: var(--gold);
  --btn-fg: #0a0a08;
  --btn-bg-hover: var(--gold-bright);
  --panel-shadow: none;
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: color-mix(in srgb, var(--gold) 30%, transparent);
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
ul { list-style: none; }

/* ---------- Keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%, 100% { opacity: 0.12; } 50% { opacity: 0.6; } }
@keyframes beat { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes drawIn { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dashFlow { to { stroke-dashoffset: -0.05; } }
@keyframes dashFlowPx { to { stroke-dashoffset: -14; } }
@keyframes ringFill { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes blinkSoft { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes scrollPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ---------- Utility ---------- */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.section-tag::before,
.section-tag::after {
  content: '';
  width: 36px;
  height: 1px;
  opacity: 0.4;
}
.section-tag::before { background: linear-gradient(90deg, transparent, var(--gold)); }
.section-tag::after { background: linear-gradient(90deg, var(--gold), transparent); }

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  line-height: 1.18;
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 620px;
  line-height: 1.75;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.9rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.btn--primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
}
.btn--primary:hover {
  background: var(--btn-bg-hover);
  box-shadow: 0 2px 24px var(--gold-glow);
}

.btn--ghost {
  border: 1px solid var(--line-gold);
  color: var(--gold);
  background: transparent;
}
.btn--ghost:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: border-color 0.3s;
}

.nav--scrolled { border-bottom-color: var(--line-gold); }

.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}

.nav__logo-mark {
  color: var(--gold);
  transition: transform 0.7s ease;
}
.nav__logo:hover .nav__logo-mark { transform: rotate(120deg); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
}
.nav__toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: 0.3s;
}
.nav__toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav__toggle.active span:nth-child(2) { opacity: 0; }
.nav__toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

.nav__links {
  display: flex;
  gap: 2.25rem;
}

.nav__links a {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.3s;
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.3s;
}

.nav__links a:hover,
.nav__links a.active { color: var(--gold); }
.nav__links a:hover::after,
.nav__links a.active::after { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 6rem 1.5rem 4rem;
}

.hero__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero__layer {
  position: absolute;
  inset: -50px;
  will-change: transform;
  transition: transform 0.4s ease-out;
}
.hero__layer svg { width: 100%; height: 100%; }

.geo-spin {
  transform-box: fill-box;
  transform-origin: center;
  animation: spin 160s linear infinite;
}
.geo-spin--slow { animation-duration: 260s; }
.geo-spin--rev { animation-direction: reverse; animation-duration: 110s; }

.tw { animation: twinkle 5s ease-in-out infinite; }
.tw:nth-of-type(2n) { animation-delay: 1.6s; }
.tw:nth-of-type(3n) { animation-delay: 2.8s; }
.tw:nth-of-type(5n) { animation-delay: 3.7s; }

.hero__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 45% at 50% 46%, color-mix(in srgb, var(--gold) 6%, transparent), transparent 70%);
  pointer-events: none;
}

.hero__noise {
  position: absolute;
  inset: 0;
  opacity: 0.014;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--line-gold);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  margin-bottom: 1.5rem;
}

.hero__accent { color: var(--gold); }

.hero__sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero__scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0.5;
}

.hero__scroll-line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: scrollPulse 2.4s ease-in-out infinite;
}

/* ---------- Reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Story / Lifecycle ---------- */
.story {
  padding: 7rem 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.story__header {
  text-align: center;
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.story__canvas-wrap {
  box-shadow: var(--panel-shadow);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
}

.story__svg {
  width: 100%;
  height: auto;
  background: var(--stage-bg);
  border: 1px solid var(--stage-border);
}

.story__svg text { font-family: var(--font-mono); }

/* ===== stage type ===== */
.t-cap { fill: var(--ink-faint); font-size: 8px; letter-spacing: 0.2em; }
.t-hud { fill: var(--gold); font-size: 8.5px; letter-spacing: 0.2em; opacity: 0; transition: opacity 0.6s; }
.t-hud--warn { fill: var(--red); }
.t-name { fill: var(--ink); font-size: 9.5px; letter-spacing: 0.18em; }
.t-name--gold { fill: var(--gold); }
.t-sub { fill: var(--ink-soft); font-size: 6.8px; letter-spacing: 0.18em; }
.t-zone { fill: var(--gold); font-size: 8px; letter-spacing: 0.26em; }
.t-row { fill: var(--ink-soft); font-size: 6.8px; letter-spacing: 0.24em; }
.t-cellname { fill: var(--ink-soft); font-size: 6.8px; letter-spacing: 0.14em; }
.t-plus { fill: var(--gold); font-size: 15px; }

#storyStage[data-scene="1"] .hud-1,
#storyStage[data-scene="2"] .hud-2,
#storyStage[data-scene="3"] .hud-3,
#storyStage[data-scene="4"] .hud-4 { opacity: 0.9; }

/* ===== stage linework ===== */
.conduit {
  stroke: var(--ink-line);
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transition: stroke 0.8s;
}

.cell-ext {
  fill: var(--cell-fill);
  stroke: var(--shell-stroke);
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.cl-bound {
  fill: none;
  stroke: color-mix(in srgb, var(--gold) 55%, transparent);
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.cl-bus {
  stroke: var(--ink-line-soft);
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.cell {
  fill: var(--cell-fill);
  stroke: var(--shell-stroke);
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transition: stroke 0.7s;
}

.cell--standby {
  fill: none;
  stroke: color-mix(in srgb, var(--gold) 65%, transparent);
  stroke-dasharray: 4 4;
}

.cell-dot {
  fill: var(--cell-dot);
  transition: fill 0.7s;
}

.db-line {
  fill: var(--cell-fill);
  stroke: var(--shell-stroke);
  stroke-width: 1;
}

.datalink {
  stroke: var(--ink-line-soft);
  stroke-width: 0.8;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.prod-shell {
  fill: var(--cell-fill);
  stroke: var(--gold);
  stroke-width: 1.2;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.prod-halo {
  fill: none;
  stroke: color-mix(in srgb, var(--gold) 45%, transparent);
  stroke-width: 0.6;
  stroke-dasharray: 2 7;
  transform-box: fill-box;
  transform-origin: center;
  animation: spin 40s linear infinite;
}
.prod-beat {
  fill: var(--gold);
  animation: beat 2.6s ease-in-out infinite;
}

.pl { fill: var(--gold); }
.pl--dim { fill: var(--ink-line); opacity: 0.7; }

/* ===== scene 1 — draw the system ===== */
#storyStage[data-scene="1"] .cl-bound { animation: drawIn 1.3s 0.2s ease both; }
#storyStage[data-scene="1"] .cl-bus { animation: drawIn 0.6s 1.3s ease both; }
#storyStage[data-scene="1"] .t-zone,
#storyStage[data-scene="1"] .t-row { animation: fadeIn 0.7s 1.4s ease both; }
#storyStage[data-scene="1"] .w1 .cell { animation: drawIn 0.5s 1.5s ease both; }
#storyStage[data-scene="1"] .w2 .cell { animation: drawIn 0.5s 1.65s ease both; }
#storyStage[data-scene="1"] .w3 .cell { animation: drawIn 0.5s 1.8s ease both; }
#storyStage[data-scene="1"] .pf1 .cell { animation: drawIn 0.5s 1.95s ease both; }
#storyStage[data-scene="1"] .pf2 .cell { animation: drawIn 0.5s 2.1s ease both; }
#storyStage[data-scene="1"] .cell-dot,
#storyStage[data-scene="1"] .t-cellname { animation: fadeIn 0.5s 2.2s ease both; }
#storyStage[data-scene="1"] .dbcell,
#storyStage[data-scene="1"] .sg-cluster .t-sub { animation: fadeIn 0.6s 2.2s ease both; }
#storyStage[data-scene="1"] .datalink { animation: drawIn 0.5s 2.4s ease both; }
#storyStage[data-scene="1"] .sg-git,
#storyStage[data-scene="1"] .sg-ci { animation: fadeIn 0.6s 0.1s ease both; }
#storyStage[data-scene="1"] .sg-ingress,
#storyStage[data-scene="1"] .sg-prod { animation: fadeIn 0.6s 2.5s ease both; }
#storyStage[data-scene="1"] .sg-conduits .conduit:nth-child(1) { animation: drawIn 0.5s 2.6s ease both; }
#storyStage[data-scene="1"] .sg-conduits .conduit:nth-child(2) { animation: drawIn 0.5s 2.75s ease both; }
#storyStage[data-scene="1"] .sg-conduits .conduit:nth-child(3) { animation: drawIn 0.5s 2.9s ease both; }
#storyStage[data-scene="1"] .sg-conduits .conduit:nth-child(4) { animation: drawIn 0.5s 3.05s ease both; }

/* ===== scene 2 — connect & deploy ===== */
.pulse-set { opacity: 0; transition: opacity 0.8s; }
#storyStage:is([data-scene="2"], [data-scene="3"], [data-scene="4"]) .pulse-set { opacity: 1; }

#storyStage:is([data-scene="2"], [data-scene="3"], [data-scene="4"]) .cell-dot {
  fill: var(--gold);
  animation: beat 2.2s ease-in-out infinite;
}
#storyStage:is([data-scene="2"], [data-scene="3"], [data-scene="4"]) .w2 .cell-dot { animation-delay: 0.7s; }
#storyStage:is([data-scene="2"], [data-scene="3"], [data-scene="4"]) .w3 .cell-dot { animation-delay: 1.4s; }

#storyStage:is([data-scene="2"], [data-scene="3"], [data-scene="4"]) .conduit { stroke: #3a3a56; }

/* ===== scene 3 — absorb & adapt ===== */
.w2-fail { opacity: 0; transition: opacity 0.4s; }
.fail-x {
  stroke: var(--red);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
#storyStage[data-scene="3"] .w2-fail { opacity: 1; }
#storyStage[data-scene="3"] .fail-x:nth-of-type(1) { animation: drawIn 0.3s 0.4s ease forwards; }
#storyStage[data-scene="3"] .fail-x:nth-of-type(2) { animation: drawIn 0.3s 0.55s ease forwards; }

#storyStage[data-scene="3"] .w2 .cell { stroke: var(--red); }
#storyStage[data-scene="3"] .w2 .cell-dot {
  fill: var(--red);
  animation: blinkSoft 0.9s ease-in-out infinite;
}

.sg-shift { opacity: 0; transition: opacity 0.5s 0.6s; }
.shift-arc {
  stroke: color-mix(in srgb, var(--gold) 70%, transparent);
  stroke-width: 0.9;
  stroke-dasharray: 3 4;
}
#storyStage[data-scene="3"] .sg-shift { opacity: 1; }
#storyStage[data-scene="3"] .shift-arc { animation: dashFlowPx 0.9s linear infinite; }

/* ===== scene 4 — repair & strengthen ===== */
.w-standby { opacity: 0; transition: opacity 0.7s 0.9s; }
#storyStage[data-scene="4"] .w-standby { opacity: 1; }

#storyStage[data-scene="4"] .cell { stroke: color-mix(in srgb, var(--gold) 65%, transparent); }
#storyStage[data-scene="4"] .conduit { stroke: color-mix(in srgb, var(--gold) 55%, transparent); }
#storyStage[data-scene="4"] .cl-bound { stroke: color-mix(in srgb, var(--gold) 70%, transparent); }

.sg-ring {
  fill: none;
  stroke: color-mix(in srgb, var(--gold) 50%, transparent);
  stroke-width: 0.8;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  transition: opacity 0.6s 0.3s;
}
#storyStage[data-scene="4"] .sg-ring {
  opacity: 1;
  animation: drawIn 1.6s 0.4s ease both;
}

/* ===== story chrome ===== */
.story__context {
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-muted);
  padding: 1.4rem 0.5rem 0;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.75;
  min-height: 3.5em;
  transition: opacity 0.4s ease;
}

.story__labels {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.5rem 0.25rem 0;
}

.story__label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: all 0.4s ease;
  cursor: pointer;
}

.story__label:hover { border-color: var(--line); }
.story__label:focus-visible { outline: none; border-color: var(--line-gold); }
.story__label.active {
  background: var(--gold-dim);
  border-color: var(--line-gold);
}

.story__label-num {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--gold);
  opacity: 0.55;
}
.story__label.active .story__label-num { opacity: 1; }

.story__label-text {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.3s;
}
.story__label.active .story__label-text { color: var(--gold); }

.story__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding-top: 1.1rem;
}

.story__btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--text-muted);
  transition: all 0.3s;
  flex-shrink: 0;
}
.story__btn:hover { border-color: var(--gold); color: var(--gold); }

.story__btn--play {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  color: var(--gold);
}

.story__ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.story__ring-bg { fill: none; stroke: var(--line); stroke-width: 1.5; }
.story__ring-fg {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}
.story__ring-fg.is-anim { animation: ringFill var(--auto-ms) linear forwards; }
.story__btn--play.paused .story__ring-fg { animation: none; stroke-dashoffset: 100; }

.story__play-glyph {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  fill: currentColor;
}
.story__play-glyph--play { display: none; }
.story__btn--play.paused .story__play-glyph--pause { display: none; }
.story__btn--play.paused .story__play-glyph--play { display: block; }

.story__progress { display: flex; gap: 0.5rem; }

.story__progress-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
  transition: all 0.4s ease;
  cursor: pointer;
}
.story__progress-dot.active {
  background: var(--gold);
  width: 22px;
  border-radius: 4px;
}

/* ---------- Services ---------- */
.services {
  padding: 7rem 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.services__header {
  text-align: center;
  margin-bottom: 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.services__index {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 4rem;
}

.service-row {
  display: flex;
  gap: 1.5rem;
  padding: 1.9rem 0.25rem;
  border-top: 1px solid var(--line);
  transition: border-color 0.5s ease;
}

.service-row:hover { border-top-color: var(--line-gold); }

.service-row__num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gold);
  opacity: 0.65;
  padding-top: 0.35rem;
  transition: opacity 0.4s;
}
.service-row:hover .service-row__num { opacity: 1; }

.service-row__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.12rem;
  letter-spacing: 0.01em;
  margin-bottom: 0.5rem;
}

.service-row__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ===== Topology ===== */
.services__topology {
  margin-top: 5rem;
  box-shadow: var(--panel-shadow);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.5rem 2rem 2rem;
}

.services__topo-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--gold);
  text-align: center;
  margin-bottom: 2rem;
}

.services__topo-svg { width: 100%; height: auto; }
.services__topo-svg text { font-family: var(--font-mono); }

.services__topo-caption {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  margin-top: 1.25rem;
}

.n-shell {
  fill: var(--cell-fill);
  stroke: var(--shell-stroke);
  stroke-width: 1;
  transition: stroke 0.3s;
}
.n-shell--gold { stroke: var(--gold); stroke-width: 1.2; }
.n-shell--app { stroke: var(--shell-stroke-strong); }
.n-shell--pf { stroke: var(--shell-stroke-soft); }
.n-shell--data { stroke: color-mix(in srgb, var(--gold) 60%, transparent); stroke-dasharray: 3 3; }

.n-bound {
  fill: none;
  stroke: color-mix(in srgb, var(--gold) 50%, transparent);
  stroke-width: 1;
}

.n-halo {
  fill: none;
  stroke: color-mix(in srgb, var(--gold) 40%, transparent);
  stroke-width: 0.6;
  stroke-dasharray: 2 7;
  transform-box: fill-box;
  transform-origin: center;
  animation: spin 44s linear infinite reverse;
}

.n-name { fill: var(--ink); font-size: 9.5px; letter-spacing: 0.18em; }
.n-name--gold { fill: var(--gold); }
.n-sub { fill: var(--ink-soft); font-size: 6.8px; letter-spacing: 0.16em; }
.n-zone { fill: var(--gold); font-size: 8px; letter-spacing: 0.26em; }
.n-row { fill: var(--ink-soft); font-size: 6.8px; letter-spacing: 0.24em; }
.n-cellname { fill: var(--ink-soft); font-size: 6.8px; letter-spacing: 0.12em; }
.n-dot { fill: var(--gold); animation: beat 2.6s ease-in-out infinite; }
.n-dot:nth-of-type(2) { animation-delay: 0.8s; }
.n-dot:nth-of-type(3) { animation-delay: 1.6s; }

.topo-path { fill: none; stroke: var(--ink-line); stroke-width: 1; }
.topo-path--fine { stroke: var(--ink-line-soft); stroke-width: 0.7; }

.topo-node:hover .n-shell { stroke: var(--gold); }

.obs-line {
  fill: none;
  stroke: color-mix(in srgb, var(--gold) 42%, transparent);
  stroke-width: 0.8;
  stroke-dasharray: 1 6;
}
.obs-tick { stroke: color-mix(in srgb, var(--gold) 55%, transparent); stroke-width: 0.8; }

/* ---------- Process ---------- */
.process {
  padding: 6rem 1.5rem 7rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.process__header {
  text-align: center;
  margin-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.process__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.process-step {
  padding: 0.5rem 1.75rem;
  border-left: 1px solid var(--line);
}
.process-step:first-child { border-left-color: transparent; }

.process-step__num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--gold);
  opacity: 0.7;
  margin-bottom: 1rem;
}

.process-step__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}

.process-step__desc {
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---------- Pricing ---------- */
.pricing {
  padding: 2rem 1.5rem 7rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.pricing__header {
  text-align: center;
  margin-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pricing__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.pricing-card {
  box-shadow: var(--panel-shadow);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  transition: border-color 0.4s ease;
  display: flex;
  flex-direction: column;
}

.pricing-card:hover { border-color: var(--line-gold); }

.pricing-card--featured { border-color: var(--line-gold); }

.pricing-card__badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--line-gold);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  width: fit-content;
}

.pricing-card__head { margin-bottom: 1.5rem; }

.pricing-card__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.pricing-card__target {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

.pricing-card__price {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.pricing-card__from {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.pricing-card__amount {
  font-family: var(--font-display);
  font-size: 2.3rem;
  color: var(--gold);
  letter-spacing: 0.01em;
}

.pricing-card__period {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.pricing-card__features {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.pricing-card__features li {
  font-size: 0.86rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.55;
}

.pricing-card__features li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold);
  opacity: 0.7;
}

.pricing-card__btn { width: 100%; }

/* ---------- Contact ---------- */
.contact {
  padding: 7rem 1.5rem;
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.contact__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.contact__geometry { width: 100%; height: 100%; }

.contact__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.contact__header {
  text-align: center;
  margin-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact__columns {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem 2rem;
}

.contact__field--full { grid-column: 1 / -1; }

.contact__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.contact__input {
  width: 100%;
  padding: 0.65rem 0.1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.95rem;
  transition: border-color 0.3s;
}

.contact__input:focus {
  outline: none;
  border-bottom-color: var(--gold);
}

.contact__input::placeholder { color: var(--placeholder); }

.contact__select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%23837e6f' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.25rem center;
  padding-right: 2rem;
  cursor: pointer;
}

.contact__select option { background: var(--bg-alt); }

.contact__textarea { resize: vertical; min-height: 90px; }

.contact__submit { margin-top: 0.5rem; }
.contact__submit:disabled { opacity: 0.6; cursor: wait; }

/* Honeypot — visually removed, still in the form for bots */
.contact__field--trap {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.contact__form-status {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  text-align: center;
  padding: 0.5rem;
}
.contact__form-status.success { color: var(--green); }
.contact__form-status.error { color: #c96a6a; }

.contact__info {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding-top: 0.25rem;
}

.contact__info-block {
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}
.contact__info-block:last-child { border-bottom: none; }

.contact__info-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.contact__info-link {
  color: var(--gold);
  font-size: 0.95rem;
  transition: opacity 0.3s;
}
.contact__info-link:hover { opacity: 0.75; }

.contact__info-text {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 3rem 1.5rem 1.75rem;
  position: relative;
}

.footer__pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  pointer-events: none;
}

.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.footer__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer__mark { color: var(--gold); opacity: 0.8; }

.footer__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.footer__tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer__links { display: flex; gap: 1.75rem; }

.footer__links a {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.3s;
}
.footer__links a:hover { color: var(--gold); }

.footer__divider {
  height: 1px;
  background: var(--line);
  margin-bottom: 1.5rem;
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__copy {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.footer__meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  color: var(--text-dim);
  opacity: 0.6;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .services__index { grid-template-columns: 1fr; column-gap: 0; }
  .process__grid { grid-template-columns: 1fr 1fr; row-gap: 2.5rem; }
  .process-step:nth-child(3) { border-left-color: transparent; }
  .pricing__grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }
  .contact__columns { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 700px) {
  .nav__toggle { display: flex; }

  .nav__links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--nav-bg-solid);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.1rem;
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    border-bottom: 1px solid var(--line);
  }

  .nav__links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .story__labels { flex-wrap: wrap; justify-content: center; }
  .contact__form { grid-template-columns: 1fr; }
  .footer__top { flex-direction: column; gap: 1.5rem; }
  .process__grid { grid-template-columns: 1fr; }
  .process-step { border-left: none; padding: 0.5rem 0; }
}

@media (max-width: 500px) {
  .hero__badge { font-size: 0.55rem; }
  .story__label-text { font-size: 0.58rem; }
  .story__canvas-wrap { padding: 0.75rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- Theming plumbing ---------- */
/* CSS presentation properties override SVG attributes, so the inline-SVG
   geometry re-themes through these rules. */
#grid path { stroke: var(--stage-grid); }

[stroke="#c2a656"] { stroke: var(--gold); }
[fill="#c2a656"] { fill: var(--gold); }

#prod-glow stop { stop-color: var(--gold); }

.footer__pattern line { stroke: var(--gold); }
.footer__pattern line:nth-of-type(1) { opacity: 0.16; }
.footer__pattern line:nth-of-type(2) { opacity: 0.18; }
.footer__pattern line:nth-of-type(3) { opacity: 0.12; }

/* Dark-mode select chevron (light chevron on dark field) */
:root[data-theme="dark"] .contact__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%2382828f' stroke-width='1.2'/%3E%3C/svg%3E");
}

/* ---------- Theme toggle ---------- */
.nav__right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav__theme {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-muted);
  transition: all 0.3s;
  flex-shrink: 0;
}
.nav__theme:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.nav__theme .icon-sun { display: none; }
.nav__theme .icon-moon { display: block; }
:root[data-theme="dark"] .nav__theme .icon-sun { display: block; }
:root[data-theme="dark"] .nav__theme .icon-moon { display: none; }
