/* ==========================================================================
   Strategies Database — Institutional Design System
   Dark-first obsidian palette + Apple-grade alabaster light mode.
   Token-driven surfaces, 1px structural hairlines, tabular numerals,
   and strict reduced-motion parity.
   ========================================================================== */

:root {
  /* Typography */
  --font-sans: "Segoe UI Variable Text", "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-display: "Segoe UI Variable Display", "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "JetBrains Mono", "SF Mono", Consolas, ui-monospace, monospace;

  /* Spacing & Radii */
  --wrap-max: 1220px;
  --header-h: 60px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 9999px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-ui: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 160ms;
  --dur-base: 260ms;
  --dur-slow: 680ms;

  /* Dark Theme Tokens (default) */
  --bg: #07080a;
  --bg-elevated: #0d0f13;
  --bg-surface: #12151b;
  --bg-surface-hover: #171b22;
  --bg-glass: rgba(7, 8, 10, 0.78);
  --bg-code: #0a0c10;

  --text: #f2f4f8;
  --text-2: #9aa2b1;
  --text-3: #68707f;

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --line-subtle: rgba(255, 255, 255, 0.05);

  --btn-primary-bg: #f2f4f8;
  --btn-primary-fg: #090a0d;
  --btn-primary-hover: #ffffff;

  --btn-ghost-bg: rgba(255, 255, 255, 0.03);
  --btn-ghost-hover: rgba(255, 255, 255, 0.07);

  --signal: #3b82f6;
  --signal-soft: rgba(59, 130, 246, 0.16);
  --live: #22c55e;

  --specular: rgba(255, 255, 255, 0.42);
  --spotlight: rgba(255, 255, 255, 0.06);
  --spotlight-border: rgba(255, 255, 255, 0.24);
  --horizon-line: rgba(255, 255, 255, 0.34);
  --horizon-wash: rgba(255, 255, 255, 0.08);
  --shadow-frame: 0 30px 90px -24px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.09);
  --focus-ring: 0 0 0 2px #07080a, 0 0 0 4px #3b82f6;

  /* Interior-clipped colorless db loader tokens */
  --db-base: rgba(255, 255, 255, 0.14);
  --db-edge: rgba(255, 255, 255, 0.18);
  --db-bloom: rgba(255, 255, 255, 0.54);
  --db-core: rgba(255, 255, 255, 0.96);

  /* Syntax highlight */
  --tok-com: #6e7787;
  --tok-kw: #d2d7e2;
  --tok-str: #9eb3d1;
  --tok-num: #f2f4f8;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-elevated: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f0f2f5;
  --bg-glass: rgba(246, 247, 249, 0.82);
  --bg-code: #f3f4f7;

  --text: #121418;
  --text-2: #525966;
  --text-3: #6c7483;

  --line: rgba(15, 18, 24, 0.09);
  --line-strong: rgba(15, 18, 24, 0.18);
  --line-subtle: rgba(15, 18, 24, 0.05);

  --btn-primary-bg: #121418;
  --btn-primary-fg: #f8f9fb;
  --btn-primary-hover: #252932;

  --btn-ghost-bg: rgba(18, 20, 24, 0.03);
  --btn-ghost-hover: rgba(18, 20, 24, 0.07);

  --signal: #005fd1;
  --signal-soft: rgba(0, 95, 209, 0.1);
  --live: #15803d;

  --specular: rgba(18, 20, 24, 0.35);
  --spotlight: rgba(18, 20, 24, 0.035);
  --spotlight-border: rgba(18, 20, 24, 0.2);
  --horizon-line: rgba(18, 20, 24, 0.24);
  --horizon-wash: rgba(18, 20, 24, 0.045);
  --shadow-frame: 0 28px 80px -24px rgba(15, 18, 24, 0.18), 0 0 0 1px rgba(15, 18, 24, 0.1);
  --focus-ring: 0 0 0 2px #f6f7f9, 0 0 0 4px #005fd1;

  /* Light mode loader: matte charcoal letterforms with bright colorless internal light */
  --db-base: rgba(24, 27, 34, 0.88);
  --db-edge: rgba(255, 255, 255, 0.12);
  --db-bloom: rgba(255, 255, 255, 0.64);
  --db-core: rgba(255, 255, 255, 0.98);

  --tok-com: #778091;
  --tok-kw: #121418;
  --tok-str: #3e4e68;
  --tok-num: #005fd1;

  color-scheme: light;
}

/* ==========================================================================
   Base & Accessibility
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.58 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
p { margin: 0; }
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text);
}
h2 { font-size: clamp(28px, 3.8vw, 46px); line-height: 1.08; }
h3 { font-size: clamp(18px, 1.8vw, 22px); line-height: 1.24; letter-spacing: -0.02em; }
code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--btn-ghost-hover);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 6px;
  word-break: break-all;
}

.mono { font-family: var(--font-mono); }
.tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  font-weight: 500;
  transition: top var(--dur-fast) var(--ease-ui);
}
.skip-link:focus { top: 14px; }

.wrap {
  width: min(var(--wrap-max), 100% - 40px);
  margin-inline: auto;
}

.section { padding: 112px 0; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}
.section-lead {
  color: var(--text-2);
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.6;
  max-width: 60ch;
  margin-top: 16px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--r-pill);
  font-weight: 500;
  white-space: nowrap;
  transition:
    background var(--dur-fast) var(--ease-ui),
    border-color var(--dur-fast) var(--ease-ui),
    color var(--dur-fast) var(--ease-ui),
    transform var(--dur-fast) var(--ease-ui);
}
.btn:active { transform: scale(0.97); }
.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--dur-fast) var(--ease-ui);
}
.btn.small { height: 34px; padding: 0 15px; font-size: 13.5px; }
.btn.large { height: 46px; padding: 0 22px; font-size: 15px; }

.btn.primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
}
.btn.primary:hover { background: var(--btn-primary-hover); }

.btn.ghost {
  background: var(--btn-ghost-bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn.ghost:hover {
  background: var(--btn-ghost-hover);
  border-color: var(--specular);
}
.btn.ghost:hover svg { transform: translateX(2px); }

/* ==========================================================================
   Sticky Frosted Header & One-Shot Hover Brand Mark
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-sm);
  padding: 4px 2px;
}

/* Product name in the header: plain text in the headline font (.hero-title). */
.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--text);
}
.wordmark span {
  font-weight: 600;
  color: var(--text-2);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}
.nav-links a {
  font-size: 13.5px;
  color: var(--text-2);
  padding: 6px 2px;
  transition: color var(--dur-fast) var(--ease-ui);
}
.nav-links a:hover { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 12px;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--btn-ghost-bg);
}
.theme-switch button {
  width: 28px;
  height: 26px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  color: var(--text-3);
  transition: background var(--dur-fast) var(--ease-ui), color var(--dur-fast) var(--ease-ui);
}
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-checked="true"] {
  background: var(--bg-surface-hover);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.theme-switch svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--specular);
  transform-origin: left center;
  transform: scaleX(0);
}

/* ==========================================================================
   Hero Band — custom Mouse-Reactive Field
   ========================================================================== */
.hero-band {
  position: relative;
  min-height: min(760px, calc(100svh - var(--header-h)));
  display: grid;
  place-items: center;
  padding: 88px 0 64px;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(62% 52% at 50% 44%, color-mix(in srgb, var(--bg) 56%, transparent) 0%, transparent 72%),
    linear-gradient(180deg, transparent 74%, var(--bg) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  backdrop-filter: blur(12px);
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 28px;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
}
.badge-sep {
  width: 1px;
  height: 11px;
  background: var(--line-strong);
}

.hero-title {
  font-size: clamp(38px, 5vw, 66px);
  line-height: 1.05;
  letter-spacing: -0.036em;
  max-width: 22ch;
  font-weight: 500;
  text-wrap: balance;
}

.hero-lead {
  margin-top: 24px;
  font-size: clamp(16px, 1.55vw, 19px);
  line-height: 1.58;
  color: var(--text-2);
  max-width: 56ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}

.hero-meta {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  font-size: 12.5px;
  color: var(--text-3);
}
.hero-meta li {
  position: relative;
}
.hero-meta li + li::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--text-3);
  transform: translateY(-50%);
}

/* ==========================================================================
   Scroll-Driven Sticky Product Stage (Apple Mac Studio + reference)
   ========================================================================== */
.stage-section {
  position: relative;
  padding: 12px 0 40px;
  overflow-x: clip;
}

.stage-track {
  position: relative;
  min-height: clamp(780px, 128vh, 1160px);
}

.stage-sticky {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  padding: 20px 0 32px;
}

.stage-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.stage-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.stage-tabs {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
}

.stage-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  border-radius: var(--r-pill);
  background: var(--btn-primary-bg);
  transition: transform 320ms var(--ease-out), width 320ms var(--ease-out);
  pointer-events: none;
}

.stage-tab {
  position: relative;
  z-index: 1;
  height: 34px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--dur-fast) var(--ease-ui);
}
.stage-tab:hover { color: var(--text); }
.stage-tab.is-active { color: var(--btn-primary-fg); }

.stage-caption {
  font-size: 14.5px;
  color: var(--text-2);
  max-width: 58ch;
}

.stage-viewport {
  position: relative;
  width: 100%;
  display: grid;
  place-items: center;
  perspective: 1600px;
}

.stage-callout {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  pointer-events: none;
  opacity: var(--callout-opacity, 0);
  transition: opacity 220ms ease;
}
.stage-callout.left { left: -12px; transform: translate(-100%, -50%); }
.stage-callout.right { right: -12px; transform: translate(100%, -50%); }
.callout-line {
  width: 28px;
  height: 1px;
  background: var(--line-strong);
}

.window-frame {
  width: 100%;
  max-width: 1100px;
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-frame);
  overflow: hidden;
  transform:
    translate3d(0, var(--stage-y, 20px), 0)
    rotateX(var(--stage-rx, 8deg))
    scale(var(--stage-scale, 0.94));
  transform-origin: center top;
  will-change: transform;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  flex: none;
}

.window-screen {
  position: relative;
  background: var(--bg);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.window-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 240ms var(--ease-ui);
}
.window-screen.is-switching img { opacity: 0.25; }

.stage-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bg) 56%, transparent);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease-ui);
}
.window-screen.is-switching .stage-loader { opacity: 1; }

/* ==========================================================================
   Colorless Strictly Interior-Clipped "db" Loader
   ========================================================================== */
.db-loader {
  display: block;
  flex: none;
  overflow: hidden;
}
.db-loader .db-base { fill: var(--db-base); }
.db-loader .db-edge { fill: none; stroke: var(--db-edge); stroke-width: 1.4; }
.db-loader .db-bloom,
.db-loader .db-core {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation-play-state: paused;
}
.db-loader .db-bloom {
  stroke: var(--db-bloom);
  stroke-width: 20;
  stroke-dasharray: 108 252;
  animation: db-orbit-bloom 1.75s linear infinite;
  animation-play-state: paused;
}
.db-loader .db-core {
  stroke: var(--db-core);
  stroke-width: 6.5;
  stroke-dasharray: 58 302;
  animation: db-orbit-core 1.75s linear infinite;
  animation-play-state: paused;
}
.window-screen.is-switching .db-loader .db-bloom,
.window-screen.is-switching .db-loader .db-core,
.compiler-demo.is-compiling .db-loader .db-bloom,
.compiler-demo.is-compiling .db-loader .db-core {
  animation-play-state: running;
}

@keyframes db-orbit-bloom {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -360; }
}
@keyframes db-orbit-core {
  from { stroke-dashoffset: -34; }
  to   { stroke-dashoffset: -394; }
}

/* ==========================================================================
   Scroll-Scrubbed Statement
   ========================================================================== */
.statement-section {
  padding: 132px 0;
  border-top: 1px solid var(--line-subtle);
  border-bottom: 1px solid var(--line-subtle);
}
.statement-inner {
  max-width: 980px;
}
.statement-copy {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.1vw, 52px);
  line-height: 1.16;
  letter-spacing: -0.032em;
  font-weight: 500;
}
.statement-copy .w {
  display: inline;
  opacity: var(--w-opacity, 0.18);
  transition: opacity 90ms linear;
}

/* ==========================================================================
   Asymmetric Institutional Bento (1px Hairlines + Specular Border)
   ========================================================================== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.bento-cell {
  position: relative;
  background: var(--bg-elevated);
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
}
.bento-cell.span-7 { grid-column: span 7; }
.bento-cell.span-5 { grid-column: span 5; }

/* Pointer-reactive monochrome specular glow (active only on pointer move) */
[data-spotlight]::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(460px circle at var(--mx, 50%) var(--my, 50%), var(--spotlight), transparent 62%);
  transition: opacity 280ms var(--ease-ui);
}
[data-spotlight]:hover::before { opacity: 1; }

.cell-head {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cell-head p {
  color: var(--text-2);
  font-size: 15px;
  max-width: 52ch;
}
.cell-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}
.cell-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Telemetry Inspector */
.telemetry-panel {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-code);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.telemetry-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}
.chip-row { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 28px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.is-active {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  border-color: transparent;
}

.telemetry-readout {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.telemetry-readout dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.telemetry-readout dd {
  margin: 5px 0 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

/* Interactive Compiler Demo + Interior-Clipped db Loader */
.compiler-demo {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-code);
  overflow: hidden;
}
.compiler-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
}
.btn-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  font-size: 12px;
  font-weight: 500;
  transition: transform var(--dur-fast), background var(--dur-fast);
}
.btn-inline:hover { background: var(--btn-primary-hover); }
.btn-inline:active { transform: scale(0.96); }
.btn-inline:disabled { opacity: 0.55; cursor: wait; }
.btn-inline svg { width: 11px; height: 11px; fill: currentColor; }

.compiler-stage {
  position: relative;
  min-height: 152px;
}
.compiler-code {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  overflow-x: auto;
  color: var(--text-2);
}
.compiler-code code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  word-break: normal;
}
.c-com { color: var(--tok-com); }
.c-kw { color: var(--tok-kw); font-weight: 500; }
.c-str { color: var(--tok-str); }
.c-num { color: var(--tok-num); }

.compiler-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: color-mix(in srgb, var(--bg-code) 86%, transparent);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease-ui);
}
.compiler-demo.is-compiling .compiler-overlay {
  opacity: 1;
  pointer-events: auto;
}
.compiler-caption {
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

.compiler-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
}

/* Edge Score Preview */
.edge-preview {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-code);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.edge-score-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.edge-num {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
}
.edge-meta { display: flex; flex-direction: column; gap: 3px; }
.edge-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--text-3);
}
.edge-sub { font-size: 12.5px; color: var(--text-2); }

.edge-bars { display: flex; flex-direction: column; gap: 9px; }
.edge-row {
  display: grid;
  grid-template-columns: 96px 1fr 30px;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}
.edge-row .tabular { text-align: right; color: var(--text); }
.meter {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--line);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--text);
  opacity: 0.82;
}

/* Local Alert Pipeline */
.pipeline-viz {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.pipe-node {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-code);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color var(--dur-fast) var(--ease-ui);
}
.pipe-node:hover { border-color: var(--line-strong); }
.pipe-step { font-size: 10.5px; color: var(--text-3); }
.pipe-node strong { font-size: 13.5px; font-weight: 500; color: var(--text); }
.pipe-node span:last-child { font-size: 12px; color: var(--text-2); }
.pipe-connector {
  width: 18px;
  height: 1px;
  background: var(--line-strong);
}

.bento-subnote {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-3);
}

/* ==========================================================================
   Apple Mac Studio-Style Interactive Engine Benchmarks
   ========================================================================== */
.engine-card {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--bg-elevated);
  padding: 44px;
}

.engine-top {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.engine-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.engine-tab {
  position: relative;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-3);
  padding: 6px 0;
  transition: color var(--dur-fast) var(--ease-ui);
}
.engine-tab:hover { color: var(--text-2); }
.engine-tab.is-active { color: var(--text); }
.engine-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  background: var(--text);
}

.engine-body {
  padding-top: 34px;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 48px;
  align-items: start;
}

.engine-copy p {
  margin-top: 12px;
  color: var(--text-2);
  max-width: 48ch;
  font-size: 15.5px;
}

.engine-kpis {
  margin: 28px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.engine-kpis dt {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.engine-kpis dd {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.engine-bars {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.bench-row {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.bench-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-2);
}
.bench-meta strong { font-weight: 500; color: var(--text); }
.bench-track {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--line);
  overflow: hidden;
}
.bench-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--text-2);
  transition: width 520ms var(--ease-out);
}
.bench-fill.primary { background: var(--text); }
.bench-fill.muted { background: var(--text-3); opacity: 0.55; }

/* ==========================================================================
   Asymmetric Editorial Chapters (5fr / 8fr alternating)
   ========================================================================== */
.editorial-row {
  display: grid;
  grid-template-columns: 5fr 7.5fr;
  gap: 56px;
  align-items: center;
}
.editorial-row.reverse {
  grid-template-columns: 7.5fr 5fr;
}
.editorial-row.reverse .editorial-copy { order: 2; }
.editorial-row.reverse .editorial-media { order: 1; }

.spec-grid {
  margin: 32px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 28px;
}
.spec-grid dt {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.spec-grid dd {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.editorial-media {
  margin: 0;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-strong);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-frame);
  transform: translate3d(0, var(--px-y, 0px), 0);
  will-change: transform;
}

.horizon-divider {
  height: 1px;
  margin: 96px 0;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

/* ==========================================================================
   Scroll-Progressive Workflow Rail
   ========================================================================== */
.workflow-track { position: relative; }
.workflow-rail {
  position: relative;
  height: 1px;
  background: var(--line);
  margin-bottom: 32px;
}
.workflow-rail span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--text);
  transform-origin: left center;
  transform: scaleX(0.15);
  transition: transform 80ms linear;
}

.workflow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}
.step-num {
  display: inline-block;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 14px;
}
.workflow-steps h3 { font-size: 18px; }
.workflow-steps p {
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.58;
}

/* ==========================================================================
   Pricing Bento (reference Hairline + Specular Edge)
   ========================================================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  max-width: 940px;
}

.plan-card {
  position: relative;
  background: var(--bg-elevated);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.plan-card.featured { background: var(--bg-surface); }

.plan-specular {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--specular), transparent);
  pointer-events: none;
}

.plan-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.plan-title-row { display: flex; align-items: center; gap: 10px; }
.plan-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
}
.plan-sub { margin-top: 6px; font-size: 14px; color: var(--text-2); }
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text-2);
  font-size: 14px;
  white-space: nowrap;
  flex: none;
}
.plan-price b {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.plan-list {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
  flex: 1;
}
.plan-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
  color: var(--text);
}
.plan-list li.muted-item { color: var(--text-3); }
.plan-list svg {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plan-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.plan-card > .btn { position: relative; z-index: 1; align-self: flex-start; }
.fineprint { font-size: 13px; color: var(--text-3); line-height: 1.5; }

/* ==========================================================================
   Download Vault
   ========================================================================== */
.download-vault {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  background: var(--bg-elevated);
  padding: 44px;
  overflow: hidden;
}

.download-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.app-icon {
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
}
.download-copy { flex: 1; min-width: 0; }
.download-copy h2 { font-size: clamp(24px, 3vw, 34px); }
.download-copy > p { margin-top: 8px; color: var(--text-2); }
.download-action { flex: none; }

.facts-grid {
  position: relative;
  z-index: 1;
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 32px;
}
.facts-wide { grid-column: 1 / -1; }
.facts-grid dt {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}
.facts-grid dd {
  margin: 6px 0 0;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
}
.checksum-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.btn-copy {
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--btn-ghost-bg);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.btn-copy:hover {
  background: var(--btn-ghost-hover);
  color: var(--text);
  border-color: var(--specular);
}

.smartscreen-note {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--text-2);
  max-width: 78ch;
}

/* ==========================================================================
   2-Column Hairline FAQ
   ========================================================================== */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
  border-top: 1px solid var(--line);
}
.faq-grid details {
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}
.faq-grid summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}
.faq-grid summary::-webkit-details-marker { display: none; }
.faq-grid summary::after {
  content: "+";
  flex: none;
  font-weight: 300;
  font-size: 22px;
  line-height: 1;
  color: var(--text-3);
  transition: transform 200ms var(--ease-ui), color 200ms var(--ease-ui);
}
.faq-grid details[open] summary::after {
  transform: rotate(45deg);
  color: var(--text);
}
.faq-grid details p {
  margin-top: 12px;
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.62;
  max-width: 58ch;
}

/* ==========================================================================
   Monumental Pre-Footer Horizon (reference + Antigravity)
   ========================================================================== */
.horizon-band {
  position: relative;
  padding-top: 72px;
  overflow: hidden;
  background: radial-gradient(64% 160px at 50% 100%, var(--horizon-wash), transparent 72%);
}
.horizon-inner {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 220px;
  padding-bottom: clamp(28px, 3.4vw, 48px);
  overflow: hidden;
}
.monolith-lockup {
  display: inline-flex;
  align-items: baseline;
  gap: 0.045em;
  font-size: clamp(38px, 10.6vw, 148px);
  line-height: 1;
  transform: translateY(var(--mono-y, 36px));
  transition: transform 240ms var(--ease-out);
  will-change: transform;
  user-select: none;
}
/* One word, one font: "strategies" and "db" share every text property. */
.monolith-word {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.042em;
  color: var(--line-strong);
  pointer-events: none;
}
:root[data-theme="light"] .monolith-word {
  color: rgba(18, 20, 24, 0.16);
}
/* The light exists only inside the letters "db": a second copy of the text on top, painted with a
   radial gradient clipped to the glyphs, shown while the pointer is over them (site.js). */
.monolith-db {
  position: relative;
  display: inline-block;
  pointer-events: auto;
  --db-light-0: rgba(255, 255, 255, 0.95);
  --db-light-1: rgba(255, 255, 255, 0.32);
}
:root[data-theme="light"] .monolith-db {
  --db-light-0: rgba(18, 20, 24, 0.78);
  --db-light-1: rgba(18, 20, 24, 0.28);
}
.monolith-db::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--lx, 50%) var(--ly, 50%), var(--db-light-0) 0%, var(--db-light-1) 30%, transparent 58%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transition: opacity 280ms var(--ease-out);
  pointer-events: none;
}
.monolith-db.is-lit::after { opacity: 1; }
.mono-stop-0 { stop-color: #ffffff; stop-opacity: 0.78; }
.mono-stop-1 { stop-color: #ffffff; stop-opacity: 0.26; }
.mono-stop-2 { stop-color: #ffffff; stop-opacity: 0; }
:root[data-theme="light"] .mono-stop-0 { stop-color: #121418; stop-opacity: 0.42; }
:root[data-theme="light"] .mono-stop-1 { stop-color: #121418; stop-opacity: 0.14; }
:root[data-theme="light"] .mono-stop-2 { stop-color: #121418; stop-opacity: 0; }
.monolith-base { fill: var(--line); }
:root[data-theme="light"] .monolith-base { fill: rgba(18, 20, 24, 0.14); }
.monolith-edge { fill: none; stroke: var(--line-strong); stroke-width: 1.1; }
.monolith-sheen { opacity: var(--mono-sheen, 0.36); transition: opacity 240ms ease; }
.footer-logo { width: 20px; height: 20px; border-radius: 5px; flex: none; }
.horizon-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--horizon-line), transparent);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  padding: 32px 0 48px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  font-size: 13px;
  color: var(--text-3);
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
}
.footer-legal {
  max-width: 66ch;
}

/* ==========================================================================
   Scroll Reveals (progressive enhancement: visible by default, never traps content)
   ========================================================================== */
.reveal {
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.reveal.reveal-pending {
  opacity: 0.15;
  transform: translateY(18px);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1260px) {
  .stage-callout { display: none; }
}

@media (max-width: 980px) {
  .section { padding: 84px 0; }
  .stage-track { min-height: auto; }
  .stage-sticky { position: static; padding: 0; }
  .window-frame { transform: none; }
  .bento-cell.span-7,
  .bento-cell.span-5 { grid-column: span 12; }
  .engine-body { grid-template-columns: 1fr; gap: 32px; }
  .editorial-row,
  .editorial-row.reverse { grid-template-columns: 1fr; gap: 32px; }
  .editorial-row.reverse .editorial-copy,
  .editorial-row.reverse .editorial-media { order: 0; }
  .workflow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pricing-grid { grid-template-columns: 1fr; }
  .download-header { flex-wrap: wrap; }
  .faq-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .wrap { width: min(var(--wrap-max), 100% - 28px); }
  .nav-links { display: none; }
  .header-actions { margin-left: auto; }
  .hero-band { min-height: auto; padding: 64px 0 48px; }
  .stage-tabs { flex-wrap: wrap; justify-content: center; border-radius: var(--r-md); }
  .stage-pill { display: none; }
  .stage-tab.is-active { background: var(--btn-primary-bg); }
  .bento-cell { padding: 26px 20px; }
  .telemetry-readout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline-viz { grid-template-columns: 1fr; }
  .pipe-connector { width: 1px; height: 14px; justify-self: center; }
  .engine-card,
  .download-vault,
  .plan-card { padding: 26px 20px; }
  .engine-kpis,
  .facts-grid,
  .workflow-steps { grid-template-columns: 1fr; }
  .statement-section { padding: 80px 0; }
}

/* ==========================================================================
   Reduced Motion Parity (WCAG 2.3.3)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage-track { min-height: auto; }
  .stage-sticky { position: static; }
  .window-frame,
  .editorial-media,
  .monolith-lockup { transform: none !important; }
  .statement-copy .w { opacity: 1 !important; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .db-loader .db-bloom,
  .db-loader .db-core {
    animation: none !important;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    opacity: 0.45;
  }
}

/* ==========================================================================
   Footer links and legal pages
   ========================================================================== */
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-links a { color: var(--text-2); text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.legal-header { border-bottom: 1px solid var(--line, rgba(127,127,127,0.18)); }
.legal-header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.legal-header .brand-name { text-decoration: none; }
.legal-back { color: var(--text-2); font-size: 14px; text-decoration: none; }
.legal-back:hover { color: var(--text); }
.legal { max-width: 760px; padding-top: 48px; padding-bottom: 64px; color: var(--text-2); font-size: 15px; line-height: 1.7; }
.legal h1 { color: var(--text); font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); line-height: 1.15; margin: 0 0 6px; }
.legal h2 { color: var(--text); font-size: 18px; margin: 32px 0 8px; }
.legal p, .legal ul { margin: 0 0 12px; }
.legal ul { padding-left: 20px; }
.legal li { margin: 4px 0; }
.legal a { color: var(--text); }
.legal code { font-family: var(--font-mono); font-size: 13px; }
.legal-date { color: var(--text-3); font-size: 13px; }

.auth-page { max-width: 520px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.auth-form input { height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(127,127,127,0.3); background: transparent; color: var(--text); font: inherit; }
.auth-ok { color: #34c759; }
.auth-bad { color: #ff6b6b; }
