/* gemeinwert — site stylesheet
 * Brand palette + structure. Single source of CSS truth for all pages.
 * Tokens locked to BRAND.md (don't change without ADR).
 */

@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-Latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-LatinExt.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surface ladder (BRAND.md fixed) */
  --bg: #0f1419;
  --panel: #1a2027;
  --panel-2: #232b35;
  --line: #2a3440;
  --line-strong: #3a4654;

  /* Text */
  --ink: #e8e8e8;
  --ink-2: #b8c5d2;
  --muted: #8a9aab;
  --dim: #5a6878;

  /* Accents */
  --gold: #f4c430;
  --gold-ember: #fbd970;
  --gold-soft: rgba(244, 196, 48, 0.12);
  --gold-line: rgba(244, 196, 48, 0.35);
  --blue: #5b9bd5;
  --blue-soft: rgba(91, 155, 213, 0.12);

  /* Status */
  --ok: #4ade80;
  --warn: #f87171;
  --demo: #a78bfa;

  /* Type */
  --font-display: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Type scale */
  --fs-display: clamp(56px, 8.5vw, 132px);
  --fs-h1: clamp(36px, 4.5vw, 64px);
  --fs-h2: clamp(28px, 3.2vw, 44px);
  --fs-h3: 22px;
  --fs-body: 16px;
  --fs-body-l: 18px;
  --fs-label: 11px;
  --fs-micro: 10px;

  /* Spacing (4px base) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;  --sp-4: 16px;
  --sp-6: 24px; --sp-8: 32px; --sp-12: 48px; --sp-16: 64px;
  --sp-24: 96px; --sp-32: 128px;

  /* Grid */
  --container: 1320px;
  --margin: 48px;
  --gutter: 24px;

  /* Motion */
  --t-fast: 120ms;
  --t-base: 180ms;
  --t-slow: 320ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
  overflow-x: hidden;
}

/* faint orthogonal grid overlay — applied to body via ::before */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(232,232,232,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,232,232,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }

/* ============ TYPE PRIMITIVES ============ */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-display);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
.display em {
  font-style: italic;
  color: var(--gold);
  font-feature-settings: 'ss01';
}

.h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h1);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
.h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h2);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h3);
  line-height: 1.25;
  margin: 0;
}

.lede {
  font-size: var(--fs-body-l);
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0;
  text-wrap: pretty;
}

.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.label--gold { color: var(--gold); }
.label--ink  { color: var(--ink); }
.label--dim  { color: var(--dim); }

.micro {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

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

/* ============ LAYOUT ============ */

.shell {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--margin);
  position: relative;
  z-index: 1;
}
@media (max-width: 720px) {
  .shell { padding: 0 24px; }
  :root { --margin: 24px; }
}

/* ============ TOP BAR ============ */

.topbar {
  position: sticky;
  top: 0; z-index: 50;
  height: 60px;
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  display: flex; align-items: center;
  height: 100%;
  gap: var(--sp-8);
}
.brand {
  display: flex; align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}
.brand__monogram {
  display: block;
  width: 28px; height: 38px;
}
.brand__word {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
  margin-top: 4px;
}
.brand__sub .cvp { color: var(--blue); }
.nav {
  display: flex; gap: var(--sp-6);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav a {
  color: var(--muted);
  transition: color var(--t-fast) var(--ease-out);
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--gold); }
.topbar__meta {
  margin-left: auto;
  display: flex; align-items: center;
  gap: var(--sp-4);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
.topbar__meta .sep { color: var(--line-strong); }
.pulse {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink);
}
.pulse__dot {
  width: 7px; height: 7px;
  background: var(--gold);
  border-radius: 50%;
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0.25; }
}
body.no-pulse .pulse__dot { animation: none; }

@media (max-width: 820px) {
  .topbar {
    height: auto;
    min-height: 60px;
  }
  .topbar__inner {
    gap: var(--sp-4);
    height: auto;
    min-width: 0;
  }
  .nav {
    gap: var(--sp-4);
    min-width: 0;
    overflow-x: auto;
    padding: 20px 0;
    scrollbar-width: none;
    white-space: nowrap;
  }
  .nav::-webkit-scrollbar { display: none; }
  .topbar__meta { display: none; }
}

@media (max-width: 520px) {
  .brand__word { font-size: 17px; }
  .brand__monogram { width: 25px; height: 34px; }
  .nav { font-size: 10px; }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .topbar__meta .geo { display: none; }
}
@media (max-width: 540px) {
  .topbar__meta .date { display: none; }
}

/* ============ SECTION HEADER PATTERN ============ */

.sec {
  position: relative;
  padding: var(--sp-24) 0;
  z-index: 1;
}
.sec--tight { padding: var(--sp-16) 0; }
.sec + .sec { border-top: 1px solid var(--line); }

.sec-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: var(--sp-8);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--sp-12);
}
.sec-head .idx { color: var(--gold); }
.sec-head .ttl { font-family: var(--font-display); font-size: var(--fs-h2); line-height: 1; letter-spacing: -0.01em; }
.sec-head .cap { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-align: right; max-width: 320px; }

@media (max-width: 720px) {
  .sec { padding: var(--sp-16) 0; }
  .sec-head { grid-template-columns: 1fr; gap: var(--sp-3); }
  .sec-head .cap { text-align: left; }
}

/* ============ HERO ============ */

.hero {
  position: relative;
  padding: var(--sp-24) 0 var(--sp-32);
  border-bottom: 1px solid var(--line);
}
.hero__grid {
  display: grid;
  grid-template-columns: 80px 1fr 280px;
  gap: var(--sp-12);
  align-items: start;
}
.hero__index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  margin-top: 8px;
}
.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-6);
  display: flex; align-items: center; gap: var(--sp-3);
}
.hero__eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px; height: 1px;
  background: var(--gold);
}
.hero__title {
  margin: 0 0 var(--sp-6);
  max-width: 13ch;
}
.hero__sub {
  font-size: var(--fs-body-l);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0 0 var(--sp-8);
}
.hero__cta {
  display: flex; flex-wrap: wrap; gap: var(--sp-3);
}
.hero__rail {
  border-left: 1px solid var(--line);
  padding-left: var(--sp-4);
  position: relative;
}
.hero__rail::before {
  content: '';
  position: absolute;
  top: 0; left: -1px;
  width: 1px; height: 40px;
  background: var(--gold);
}
.hero__rail-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-3);
}
.hero__rail-list {
  list-style: none; padding: 0; margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.hero__rail-list li {
  display: flex; justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
}
.hero__rail-list li:last-child { border-bottom: 1px solid var(--line); }
.hero__rail-list li span:last-child { color: var(--dim); }

/* crosshair brackets on the hero rail */
.hero__rail {
  position: relative;
}

@media (max-width: 1000px) {
  .hero__grid { grid-template-columns: 40px 1fr; }
  .hero__rail { grid-column: 1 / -1; border-left: none; padding-left: 0; margin-top: var(--sp-8); }
  .hero__rail::before { display: none; }
}
@media (max-width: 720px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .hero__index { writing-mode: horizontal-tb; transform: none; }
}

/* ============ BUTTONS ============ */

.btn {
  display: inline-flex; align-items: center;
  gap: var(--sp-2);
  height: 44px;
  padding: 0 var(--sp-6);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background var(--t-base) var(--ease-out),
              color var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out);
  white-space: nowrap;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn--primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1208;
}
.btn--primary:hover {
  background: var(--gold-ember);
  border-color: var(--gold-ember);
  color: #1a1208;
}
.btn--ghost {
  border-color: var(--line-strong);
  color: var(--muted);
}
.btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: transparent;
}
.btn .arrow { transition: transform var(--t-base) var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

/* ============ CARD ============ */

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: var(--sp-8) var(--sp-6) var(--sp-6);
  transition: border-color var(--t-base) var(--ease-out),
              background var(--t-base) var(--ease-out);
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40px; height: 1px;
  background: var(--gold);
}
.card:hover { border-color: var(--line-strong); background: var(--panel-2); }
a.card:hover { border-color: var(--gold-line); }
.card__idx {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-3);
  display: block;
}
.card__ttl {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 var(--sp-3);
  color: var(--ink);
}
.card__body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}
.card__meta {
  margin-top: var(--sp-6);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}

/* ============ BADGES ============ */

.badge {
  display: inline-flex; align-items: center;
  height: 20px;
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  background: transparent;
}
.badge--demo { color: var(--demo); background: rgba(167,139,250,0.08); }
.badge--plan { color: var(--blue); background: rgba(91,155,213,0.08); }
.badge--live { color: var(--ok); background: rgba(74,222,128,0.08); }
.badge--draft { color: var(--warn); background: rgba(248,113,113,0.08); }
.badge--gold { color: var(--gold); background: var(--gold-soft); }

/* ============ PROBLEM SECTION ============ */

.vendor-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-right: none;
  background: var(--panel);
}
.vendor {
  border-right: 1px solid var(--line);
  padding: var(--sp-6);
  position: relative;
}
.vendor__cc {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--dim);
  margin-bottom: var(--sp-3);
}
.vendor__name {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 var(--sp-2);
  letter-spacing: -0.005em;
}
.vendor__prods {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}

.tally {
  margin-top: var(--sp-8);
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex; gap: var(--sp-8); justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  flex-wrap: wrap;
}
.tally strong {
  display: block;
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: -0.02em;
  color: var(--gold);
  font-weight: 400;
}
.tally span { display: block; text-align: center; }

@media (max-width: 800px) {
  .vendor-grid { grid-template-columns: 1fr 1fr; border-bottom: none; }
  .vendor { border-bottom: 1px solid var(--line); }
}

/* ============ LAYER (principles + diagram) ============ */

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
  margin-bottom: var(--sp-12);
}
@media (max-width: 800px) { .principles { grid-template-columns: 1fr; } }

.diagram {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: var(--sp-12);
  position: relative;
}
.diagram::before, .diagram::after,
.diagram > .ch-tl, .diagram > .ch-tr, .diagram > .ch-bl, .diagram > .ch-br {
  /* crosshair brackets */
}
.diagram .ch {
  position: absolute;
  width: 16px; height: 16px;
  border-color: var(--gold);
  border-style: solid;
  border-width: 0;
}
.diagram .ch-tl { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.diagram .ch-tr { top: -1px; right: -1px; border-top-width: 1px; border-right-width: 1px; }
.diagram .ch-bl { bottom: -1px; left: -1px; border-bottom-width: 1px; border-left-width: 1px; }
.diagram .ch-br { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }

.tier {
  display: flex; flex-direction: column;
  gap: var(--sp-3);
  text-align: center;
}
.tier__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.tier__row {
  display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap;
}
.tier-pill {
  border: 1px solid var(--line-strong);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: rgba(0,0,0,0.2);
}
.tier-pill--active {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-soft);
}
.tier-pill--center {
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #1a1208;
  font-weight: 600;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -0.005em;
  text-transform: none;
}
.tier-pill--provider {
  border: 1px solid var(--blue);
  color: var(--blue);
}
.tier-pill--empty {
  border: 1px dashed var(--line-strong);
  color: var(--dim);
}
.tier-link {
  width: 1px;
  background: var(--line-strong);
  margin: 0 auto;
  height: var(--sp-6);
}

/* ============ STANDARDS GRID ============ */

.standards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--line);
}
.std {
  padding: var(--sp-6);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
  background: var(--panel);
  transition: background var(--t-base) var(--ease-out);
}
.std:hover { background: var(--panel-2); }
.std:nth-child(4n) { border-right: none; }
.std:nth-last-child(-n+4):nth-child(4n+1),
.std:nth-last-child(-n+4):nth-child(4n+1) ~ .std { border-bottom: none; }
.std__num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin-bottom: var(--sp-2);
}
.std__title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: var(--sp-2);
}
.std__ver {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  margin-bottom: var(--sp-3);
}
.std__desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 var(--sp-4);
}
.std__status {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ok);
  display: inline-flex; align-items: center; gap: 6px;
}
.std__status::before {
  content: '●';
  font-size: 8px;
}

@media (max-width: 900px) { .standards-grid { grid-template-columns: 1fr 1fr; } .std:nth-child(2n) { border-right: none; } .std:nth-child(4n) { border-right: 1px solid var(--line); } }
@media (max-width: 540px) { .standards-grid { grid-template-columns: 1fr; } .std { border-right: none !important; } }

/* ============ AUDIENCES ============ */

.aud-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}
.aud {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: var(--sp-8) var(--sp-6) var(--sp-6);
  position: relative;
  display: flex; flex-direction: column;
  min-height: 280px;
  transition: border-color var(--t-base) var(--ease-out);
}
.aud:hover { border-color: var(--gold-line); }
.aud::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40px; height: 1px;
  background: var(--gold);
}
.aud__role {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-3);
}
.aud__ttl {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 var(--sp-3);
  text-wrap: balance;
}
.aud__body {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 var(--sp-6);
  flex: 1;
}
.aud__entry {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.aud__entry .arrow { transition: transform var(--t-base) var(--ease-out); }
.aud:hover .aud__entry .arrow { transform: translateX(4px); }
@media (max-width: 900px) { .aud-grid { grid-template-columns: 1fr; } }

/* ============ TOOLS ============ */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}
@media (max-width: 1000px) { .tools-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .tools-grid { grid-template-columns: 1fr; } }

/* ============ ROADMAP ============ */

.roadmap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  position: relative;
}
.phase {
  padding: var(--sp-8) var(--sp-6) var(--sp-6);
  border-right: 1px solid var(--line);
  position: relative;
  background: var(--panel);
}
.phase:last-child { border-right: none; }
.phase__bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--line);
}
.phase--now .phase__bar { background: var(--gold); }
.phase__index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-3);
  display: flex; justify-content: space-between;
}
.phase__index .when { color: var(--dim); }
.phase__ttl {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 var(--sp-4);
}
.phase__lede { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 var(--sp-4); }
.phase__list { list-style: none; padding: 0; margin: 0; }
.phase__list li {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  padding: 8px 0;
  border-top: 1px solid var(--line);
  display: flex; align-items: baseline; gap: var(--sp-2);
}
.phase__list li::before {
  content: '·';
  color: var(--gold);
}

@media (max-width: 900px) { .roadmap { grid-template-columns: 1fr; } .phase { border-right: none; border-bottom: 1px solid var(--line); } .phase:last-child { border-bottom: none; } }

/* ============ FOOTER ============ */

.footer {
  border-top: 1px solid var(--line);
  padding: var(--sp-12) 0 var(--sp-8);
  position: relative;
  z-index: 1;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-8);
  align-items: start;
  margin-bottom: var(--sp-8);
}
.footer__col h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 var(--sp-3);
  font-weight: 500;
}
.footer__col ul { list-style: none; padding: 0; margin: 0; }
.footer__col li { padding: 6px 0; }
.footer__col a {
  color: var(--ink-2);
  font-size: 14px;
  transition: color var(--t-fast) var(--ease-out);
}
.footer__col a:hover { color: var(--gold); }
.footer__bar {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: var(--sp-6);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  flex-wrap: wrap; gap: var(--sp-3);
}
.lang-switch {
  display: flex; gap: 0;
}
.lang-switch a {
  padding: 6px 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  margin-left: -1px;
  transition: all var(--t-fast) var(--ease-out);
}
.lang-switch a:first-child { margin-left: 0; }
.lang-switch a.active { color: var(--gold); border-color: var(--gold); z-index: 1; position: relative; }
.lang-switch a:hover { color: var(--ink); }

@media (max-width: 720px) { .footer__grid { grid-template-columns: 1fr; gap: var(--sp-6); } }

/* ============ TWEAKS PANEL ============ */

.tweaks {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 280px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  z-index: 100;
  display: none;
  font-family: var(--font-body);
}
.tweaks.open { display: block; animation: tw-in 180ms var(--ease-out); }
@keyframes tw-in { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

.tweaks__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.tweaks__head h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
  font-weight: 600;
}
.tweaks__close {
  background: none; border: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
}
.tweaks__close:hover { color: var(--ink); }
.tweaks__body {
  padding: var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-4);
}
.tweak-row > label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-2);
}
.tweak-row__controls {
  display: flex; gap: 0; flex-wrap: wrap;
}
.tweak-row__controls button {
  flex: 1;
  min-height: 32px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0 8px;
  margin-left: -1px;
  transition: all var(--t-fast) var(--ease-out);
}
.tweak-row__controls button:first-child { margin-left: 0; }
.tweak-row__controls button:hover { color: var(--ink); border-color: var(--line-strong); z-index: 1; position: relative; }
.tweak-row__controls button.active { color: var(--ink); border-color: var(--gold); background: var(--gold-soft); z-index: 1; position: relative; }
.swatch {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Tweaks: accent swap modifier classes */
body.accent-blue { --gold: #5b9bd5; --gold-ember: #82b6e1; --gold-soft: rgba(91,155,213,0.12); --gold-line: rgba(91,155,213,0.35); }
body.accent-cyan { --gold: #00d4ff; --gold-ember: #4ee0ff; --gold-soft: rgba(0,212,255,0.10); --gold-line: rgba(0,212,255,0.35); }
body.accent-orange { --gold: #ff5a1f; --gold-ember: #ff8a4c; --gold-soft: rgba(255,90,31,0.10); --gold-line: rgba(255,90,31,0.35); }

body.density-dense { --sp-24: 64px; --sp-32: 80px; --sp-16: 48px; --sp-12: 32px; }

/* ============ UTILITIES ============ */

.frame {
  position: relative;
  border: 1px solid var(--line);
  padding: var(--sp-12);
  background: var(--panel);
}
.frame .ch {
  position: absolute;
  width: 16px; height: 16px;
  border-color: var(--gold);
  border-style: solid;
  border-width: 0;
  pointer-events: none;
}
.frame .ch-tl { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.frame .ch-tr { top: -1px; right: -1px; border-top-width: 1px; border-right-width: 1px; }
.frame .ch-bl { bottom: -1px; left: -1px; border-bottom-width: 1px; border-left-width: 1px; }
.frame .ch-br { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }

.row { display: flex; gap: var(--sp-3); align-items: center; }
.stack > * + * { margin-top: var(--sp-3); }

.kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--bg);
}

.dim { color: var(--muted); }
.ink { color: var(--ink); }
.gold { color: var(--gold); }

::selection { background: var(--gold); color: #1a1208; }

/* ===== Page-wide node-network background canvas ===== */
body { isolation: isolate; }
.page-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
}
