:root {
  --bg-page: #05070d;
  --bg-grad-start: #06080f;
  --bg-grad-end: #05070d;
  --text: #f4f4f5;
  --muted: #9d9da8;
  --surface-1: rgba(14, 15, 22, 0.72);
  --surface-2: rgba(20, 20, 28, 0.66);
  --surface-3: rgba(7, 9, 14, 0.72);
  --panel-top: rgba(18, 20, 27, 0.84);
  --panel-bottom: rgba(12, 13, 19, 0.72);
  --border-soft: rgba(255, 255, 255, 0.10);
  --border-mid: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.18);
  --heading-dim: rgba(255, 255, 255, 0.53);
  --nav-link: #9d9da8;
  --nav-link-hover: #efeff1;
  --btn-primary-bg: #f3f3f4;
  --btn-primary-text: #121217;
  --btn-secondary-text: #d3d3db;
  --proof-text: #cacad2;
  --accent: #f08a32;
  --accent-soft: rgba(240, 138, 50, 0.28);
  --eyebrow-bg: rgba(35, 25, 17, 0.6);
  --eyebrow-text: #dcb18e;
  --code-bg: rgba(5, 6, 10, 0.9);
  --code-text: #ebbf99;
  --footer-text: #878791;
  --footer-title: #c2c2ca;
  --status-dot: #f15bb0;
  --logo-filter: invert(1);
  --logo-bg: rgba(255, 255, 255, 0.95);
  --logo-border: transparent;
  --maxwell-opacity: 0.56;
  --maxwell-glow: rgba(120, 170, 255, 0.11);
  --maxwell-gate: linear-gradient(to bottom, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.08));
  --maxwell-line: linear-gradient(to right, rgba(90, 180, 255, 0.28), rgba(240, 138, 50, 0.20));
  --maxwell-pass: linear-gradient(to right, rgba(90, 180, 255, 0.32), rgba(120, 210, 255, 0.28));
  --maxwell-reflect: linear-gradient(to right, rgba(240, 138, 50, 0.24), rgba(90, 180, 255, 0.12));
  --maxwell-hit: rgba(240, 138, 50, 0.65);
  --maxwell-hit-shadow: rgba(240, 138, 50, 0.45);
  --radius: 16px;
}

html[data-theme="light"] {
  --bg-page: #f6f8fc;
  --bg-grad-start: #fbfcff;
  --bg-grad-end: #f3f6fb;
  --text: #0b1220;
  --muted: #4b5568;
  --surface-1: rgba(255, 255, 255, 0.88);
  --surface-2: rgba(255, 255, 255, 0.94);
  --surface-3: rgba(255, 255, 255, 0.78);
  --panel-top: rgba(255, 255, 255, 0.94);
  --panel-bottom: rgba(248, 250, 252, 0.98);
  --border-soft: rgba(15, 23, 42, 0.10);
  --border-mid: rgba(15, 23, 42, 0.14);
  --border-strong: rgba(15, 23, 42, 0.18);
  --heading-dim: rgba(17, 24, 39, 0.45);
  --nav-link: #4b5568;
  --nav-link-hover: #0f172a;
  --btn-primary-bg: #111827;
  --btn-primary-text: #ffffff;
  --btn-secondary-text: #0f172a;
  --proof-text: #334155;
  --accent: #d97706;
  --accent-soft: rgba(245, 158, 11, 0.34);
  --eyebrow-bg: rgba(255, 251, 235, 0.92);
  --eyebrow-text: #92400e;
  --code-bg: #f8fafc;
  --code-text: #92400e;
  --footer-text: #4b5563;
  --footer-title: #334155;
  --status-dot: #be185d;
  --logo-filter: none;
  --logo-bg: rgba(255, 255, 255, 0.95);
  --logo-border: rgba(15, 23, 42, 0.12);
  --maxwell-opacity: 0.42;
  --maxwell-glow: rgba(37, 99, 235, 0.16);
  --maxwell-gate: linear-gradient(to bottom, rgba(30, 41, 59, 0.16), rgba(30, 41, 59, 0.42), rgba(30, 41, 59, 0.16));
  --maxwell-line: linear-gradient(to right, rgba(37, 99, 235, 0.30), rgba(245, 158, 11, 0.24));
  --maxwell-pass: linear-gradient(to right, rgba(37, 99, 235, 0.34), rgba(14, 165, 233, 0.28));
  --maxwell-reflect: linear-gradient(to right, rgba(245, 158, 11, 0.28), rgba(37, 99, 235, 0.18));
  --maxwell-hit: rgba(217, 119, 6, 0.88);
  --maxwell-hit-shadow: rgba(217, 119, 6, 0.38);
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    --bg-page: #f6f8fc;
    --bg-grad-start: #fbfcff;
    --bg-grad-end: #f3f6fb;
    --text: #0b1220;
    --muted: #4b5568;
    --surface-1: rgba(255, 255, 255, 0.88);
    --surface-2: rgba(255, 255, 255, 0.94);
    --surface-3: rgba(255, 255, 255, 0.78);
    --panel-top: rgba(255, 255, 255, 0.94);
    --panel-bottom: rgba(248, 250, 252, 0.98);
    --border-soft: rgba(15, 23, 42, 0.10);
    --border-mid: rgba(15, 23, 42, 0.14);
    --border-strong: rgba(15, 23, 42, 0.18);
    --heading-dim: rgba(17, 24, 39, 0.45);
    --nav-link: #4b5568;
    --nav-link-hover: #0f172a;
    --btn-primary-bg: #111827;
    --btn-primary-text: #ffffff;
    --btn-secondary-text: #0f172a;
    --proof-text: #334155;
    --accent: #d97706;
    --accent-soft: rgba(245, 158, 11, 0.34);
    --eyebrow-bg: rgba(255, 251, 235, 0.92);
    --eyebrow-text: #92400e;
    --code-bg: #f8fafc;
    --code-text: #92400e;
    --footer-text: #4b5563;
    --footer-title: #334155;
    --status-dot: #be185d;
    --logo-filter: none;
    --logo-bg: rgba(255, 255, 255, 0.95);
    --logo-border: rgba(15, 23, 42, 0.12);
    --maxwell-opacity: 0.42;
    --maxwell-glow: rgba(37, 99, 235, 0.16);
    --maxwell-gate: linear-gradient(to bottom, rgba(30, 41, 59, 0.16), rgba(30, 41, 59, 0.42), rgba(30, 41, 59, 0.16));
    --maxwell-line: linear-gradient(to right, rgba(37, 99, 235, 0.30), rgba(245, 158, 11, 0.24));
    --maxwell-pass: linear-gradient(to right, rgba(37, 99, 235, 0.34), rgba(14, 165, 233, 0.28));
    --maxwell-reflect: linear-gradient(to right, rgba(245, 158, 11, 0.28), rgba(37, 99, 235, 0.18));
    --maxwell-hit: rgba(217, 119, 6, 0.88);
    --maxwell-hit-shadow: rgba(217, 119, 6, 0.38);
  }
}

.theme-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.theme-label {
  color: var(--footer-text);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.theme-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--surface-1);
}

.theme-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.theme-btn.is-active {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
