/* hx+ site styles. No dependencies, no external requests, system fonts.
 *
 * Visual language, all derived from the mark:
 *   - corner "ticks": registration marks on panels, the plus in the mark
 *   - a faint blueprint grid behind the page
 *   - one source radiating to every target (the hero diagram)
 *   - numbered section indexes, as in a spec
 */

:root {
  --bg: #0b0e14;
  --bg-alt: #0f131c;
  --panel: #131826;
  --panel-2: #171d2c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e7eaf0;
  --muted: #9aa3b2;
  --faint: #6b7484;
  --accent: #ff9d2e;
  --accent-2: #ffb054;
  --accent-soft: rgba(255, 157, 46, 0.12);
  --accent-line: rgba(255, 157, 46, 0.45);
  --ink: #ff9d2e;              /* structure: labels, marks, rules. Same as the accent in dark */
  --ink-soft: rgba(255, 157, 46, 0.12);
  --ink-line: rgba(255, 157, 46, 0.45);
  --green: #5fd39a;
  --blue: #6fb7ff;
  --grid: rgba(255, 255, 255, 0.045);
  --tick: rgba(255, 255, 255, 0.22);
  --header-bg: rgba(11, 14, 20, 0.82);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  /* Drafting paper, not cream: a white sheet ruled in faint blue, navy ink for structure,
     and orange held back for the mark, the main actions and whatever is live. */
  --bg: #ffffff;
  --bg-alt: #f3f6fb;
  --panel: #ffffff;
  --panel-2: #f8fafd;
  --border: rgba(18, 42, 86, 0.13);
  --border-strong: rgba(18, 42, 86, 0.22);
  --text: #0e1a2e;
  --muted: #475468;
  --faint: #7d8aa0;
  --accent: #e2620a;
  --accent-2: #f07a1f;
  --accent-soft: rgba(226, 98, 10, 0.09);
  --accent-line: rgba(226, 98, 10, 0.45);
  --ink: #1d46b0;
  --ink-soft: rgba(29, 70, 176, 0.07);
  --ink-line: rgba(29, 70, 176, 0.35);
  --green: #0f8a55;
  --blue: #1d46b0;
  --grid: rgba(29, 70, 176, 0.055);
  --tick: rgba(29, 70, 176, 0.5);
  --header-bg: rgba(255, 255, 255, 0.86);
  --shadow: 0 18px 44px rgba(14, 26, 46, 0.12);
  color-scheme: light;
}

/* Graph paper rather than the dark theme's dot grid: fine rules on the same 28px pitch. */
:root[data-theme="light"] body {
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}

:root[data-theme="light"] .hero::before {
  background: radial-gradient(closest-side, rgba(29, 70, 176, 0.06), transparent 72%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  /* blueprint grid: fine dots on a 28px pitch */
  background-image: radial-gradient(var(--grid) 1px, transparent 1.2px);
  background-size: 28px 28px;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #16100a; }

a { color: var(--ink); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #16100a;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 0 0 8px 0;
}

.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--ink-soft);
  color: var(--ink);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

/* ---------- Corner ticks ----------
 * Registration marks at each corner of a panel. Eight 1px strokes drawn as
 * background layers on a pseudo-element, so they sit over the border and
 * cost no markup. They brighten to the accent on hover. */

/* Registered so the tick colour can transition on hover. */
@property --t {
  syntax: "<color>";
  inherits: false;
  initial-value: transparent;
}

.ticks { position: relative; }

.ticks::after {
  --t: var(--tick);
  --l: 10px;
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(var(--t) 0 0) 0 0 / var(--l) 1px,
    linear-gradient(var(--t) 0 0) 0 0 / 1px var(--l),
    linear-gradient(var(--t) 0 0) 100% 0 / var(--l) 1px,
    linear-gradient(var(--t) 0 0) 100% 0 / 1px var(--l),
    linear-gradient(var(--t) 0 0) 0 100% / var(--l) 1px,
    linear-gradient(var(--t) 0 0) 0 100% / 1px var(--l),
    linear-gradient(var(--t) 0 0) 100% 100% / var(--l) 1px,
    linear-gradient(var(--t) 0 0) 100% 100% / 1px var(--l);
  background-repeat: no-repeat;
  transition: --t 0.2s;
}

.ticks:hover::after { --t: var(--ink); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo { width: 22px; height: 22px; display: block; margin-right: 9px; }

.brand .plus { color: var(--accent); }

.site-nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.15s;
}

.site-nav a:hover,
.site-nav a.current { color: var(--text); }

.site-nav a.current::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -19px;
  height: 2px;
  background: var(--ink);
}

.site-nav .nav-out { color: var(--accent); }
.site-nav .nav-out:hover { color: var(--accent-2); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 0.96rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: transparent;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn:hover { transform: translateY(-1px); border-color: var(--muted); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #16100a;
  box-shadow: 0 10px 30px rgba(255, 157, 46, 0.22);
}

.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

.btn-small { padding: 7px 14px; font-size: 0.86rem; }

[aria-disabled="true"] { opacity: 0.55; cursor: default; pointer-events: none; }

/* ---------- Header controls ---------- */

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  width: 34px; height: 34px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
}

.theme-toggle:hover { color: var(--text); border-color: var(--muted); }

.tt-moon { display: none; }
:root[data-theme="light"] .tt-sun { display: none; }
:root[data-theme="light"] .tt-moon { display: inline; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 76px 0 64px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -180px;
  right: -120px;
  width: 820px;
  height: 820px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 72%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-grid > * { min-width: 0; }

.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  background: var(--bg);
}

.badge-live {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-line);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-line); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
  font-size: clamp(2.5rem, 5.4vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin-bottom: 22px;
}

.accent { color: var(--accent); }

.lede {
  color: var(--muted);
  font-size: 1.06rem;
  margin-bottom: 30px;
  max-width: 34em;
}

.lede strong { color: var(--text); }

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

.cta-center { justify-content: center; }

/* ---------- Hero diagram ---------- */

.hero-visual { position: relative; }

.orbit {
  display: block;
  width: 100%;
  max-width: 540px;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

.orbit-ring {
  fill: none;
  stroke: var(--border-strong);
  stroke-dasharray: 2 6;
}

.orbit-ring-inner { stroke: var(--accent-line); stroke-dasharray: none; opacity: 0.5; }

.ray {
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* Tier 1 and in-progress rays carry "flow" outward from the source. */
.ray-t1, .ray-go {
  stroke: var(--accent);
  stroke-dasharray: 3 9;
  animation: flow 1.6s linear infinite;
  animation-delay: calc(var(--i) * -0.13s);
}

.ray-go { stroke: var(--green); }

.ray-plan {
  stroke: var(--border-strong);
  stroke-dasharray: 2 6;
}

@keyframes flow { to { stroke-dashoffset: -24; } }

.core circle {
  fill: var(--panel);
  stroke: var(--accent);
  stroke-width: 1.5;
}

.core-arm { fill: var(--accent); }

.node rect {
  fill: var(--panel);
  stroke: var(--border-strong);
  stroke-width: 1;
}

.node text {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  text-anchor: middle;
  fill: var(--muted);
}

.node-t1 rect { stroke: var(--accent-line); }
.node-t1 text { fill: var(--text); }
.node-go rect { stroke: var(--green); }
.node-go text { fill: var(--green); }

.orbit-legend {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.orbit-legend li { display: inline-flex; align-items: center; gap: 7px; }

.key {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  flex: none;
}

.key-t1   { background: var(--accent); }
.key-go   { background: var(--green); }
.key-plan { background: transparent; border: 1.5px solid var(--muted); }
.key-cons { background: transparent; border: 1.5px dashed var(--faint); }
.key-t2   { background: var(--blue); }

/* ---------- Spec strip ---------- */

.spec {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

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

.spec-item {
  padding: 26px 22px;
  border-left: 1px solid var(--border);
}

.spec-item:last-child { border-right: 1px solid var(--border); }

.spec-num {
  display: block;
  font-family: var(--mono);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}

.spec-label {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 8px;
  max-width: 20em;
}

/* ---------- Sections ---------- */

.section { padding: 92px 0; }

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 14px;
}

.eyebrow-center { justify-content: center; }

.idx {
  color: var(--faint);
  letter-spacing: 0.04em;
  padding-right: 12px;
  border-right: 1px solid var(--border-strong);
}

.section h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.section-lede {
  color: var(--muted);
  max-width: 46em;
  margin-bottom: 40px;
  font-size: 1.03rem;
}

.section-lede strong { color: var(--text); }

.section-lede-tight { margin-top: -26px; margin-bottom: 30px; }

/* ---------- Cards ---------- */

.cards { display: grid; gap: 18px; }

.cards-2 { grid-template-columns: repeat(2, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.15s, transform 0.15s;
}

.card:hover { transform: translateY(-2px); }

.card-wide { grid-column: 1 / -1; }

.card h3 { font-size: 1.04rem; margin-bottom: 10px; letter-spacing: -0.005em; }

.card p { color: var(--muted); font-size: 0.94rem; }

/* ---------- Code windows ---------- */

/* Code windows stay dark in both themes. */
.code-window {
  background: #11151f;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.code-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
}

.code-filename {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #9aa3b2;
}

.code-tag {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: #ff9d2e;
  border: 1px solid rgba(255, 157, 46, 0.4);
  border-radius: 999px;
  padding: 1px 8px;
}

.code-window pre {
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
}

.code-window pre code,
.pm-code code {
  background: none;
  padding: 0;
  color: #d7dce6;
  font-size: 1em;
}

.k { color: #ff9d2e; }   /* keywords */
.c { color: #6b7484; }   /* comments */
.s { color: #5fd39a; }   /* strings */
.n { color: #6fb7ff; }   /* numbers */
.f { color: #c792ea; }   /* function names */

.code-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.code-caption {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- Lineage (self-hosting precedent) ---------- */

.precedent {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 48px;
}

.precedent-title {
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 18px;
}

.lineage { list-style: none; }

.lineage li {
  display: grid;
  grid-template-columns: 96px 150px 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.92rem;
}

.lineage li:last-child { border-bottom: none; }

.plang { font-weight: 700; }

.pfrom {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--faint);
}

.pto { color: var(--muted); }

.lineage-now {
  margin: 6px -14px 0;
  padding: 11px 14px !important;
  border: 1px solid var(--accent-line) !important;
  border-radius: 8px;
  background: var(--accent-soft);
}

.lineage-now .plang,
.lineage-now .pto { color: var(--accent); font-weight: 700; }

.precedent-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Compiler section ---------- */

.compiler-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
}

.compiler-grid > * { min-width: 0; }

.checklist { list-style: none; }

.checklist li {
  position: relative;
  padding: 0 0 18px 30px;
  color: var(--muted);
  font-size: 0.97rem;
}

.checklist li:last-child { padding-bottom: 0; }

.checklist li::before {
  content: "+";
  position: absolute;
  left: 0; top: -1px;
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--ink);
  font-weight: 700;
}

.checklist strong { color: var(--text); }

/* ---------- Browser band ---------- */

.browser-band { overflow: hidden; }

.browser-grid {
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  gap: 56px;
  align-items: center;
}

.browser-grid > * { min-width: 0; }

.playground-mock {
  background: #0d1119;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
}

.pm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.pm-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #e7eaf0;
}

.pm-brand img { width: 15px; height: 15px; }

.pm-brand .plus { color: #ff9d2e; }

.pm-run {
  font-size: 0.74rem;
  font-weight: 700;
  color: #16100a;
  background: #ff9d2e;
  border-radius: 6px;
  padding: 4px 10px;
}

.pm-body {
  display: grid;
  grid-template-columns: 1fr;
}

.pm-code {
  margin: 0;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.7;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.pm-out {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px 16px;
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--mono);
  font-size: 0.74rem;
}

.pm-out-head {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b7484;
  margin-bottom: 4px;
}

.pm-line { color: #d7dce6; }

.pm-meta {
  margin-top: 8px;
  color: #5fd39a;
  font-size: 0.68rem;
}

/* ---------- Language ---------- */

.language-intro {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 44px;
}

.language-intro > * { min-width: 0; }

.language-intro .section-lede { margin-bottom: 0; }

/* ---------- Pipeline chips ---------- */

.pipeline {
  margin-top: 52px;
  padding-top: 44px;
  border-top: 1px dashed var(--border-strong);
}

.pipeline-title { font-size: 1.1rem; margin-bottom: 24px; }

.chip-group {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.chip-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 7px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 11px;
  transition: color 0.15s, border-color 0.15s;
}

.chip:hover { color: var(--ink); border-color: var(--ink-line); }

.chip-deep { border-style: dashed; border-color: var(--border-strong); background: transparent; }

.pipeline-note {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 52em;
}

/* ---------- Target board ---------- */

.board {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 18px;
}

.board-col {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
}

.board-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1rem;
  padding-bottom: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.board-sub {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--faint);
}

.board ul { list-style: none; }

.board li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.94rem;
  border-bottom: 1px dashed var(--border);
}

.board li:last-child { border-bottom: none; }

.aside {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--faint);
}

.board li.going { color: var(--green); font-weight: 600; }
.board li.going .aside { color: var(--green); }

.board-foot {
  display: flex;
  gap: 9px;
  align-items: baseline;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}

.board-foot .key { transform: translateY(1px); }

/* ---------- Target notes ---------- */

.notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 30px;
}

.note-card {
  border-left: 2px solid var(--ink);
  padding: 4px 0 4px 18px;
}

.note-card h4 { font-size: 0.98rem; margin-bottom: 6px; }

.note-card p { color: var(--muted); font-size: 0.92rem; }

/* ---------- How a target plugs in ---------- */

.plug {
  margin-top: 60px;
  padding-top: 52px;
  border-top: 1px dashed var(--border-strong);
}

.plug-title {
  font-size: 1.4rem;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}

.plug-lede {
  color: var(--muted);
  font-size: 0.97rem;
  max-width: 48em;
  margin-bottom: 30px;
}

/* the pipeline: core stages muted, target-owned stages in the accent */
.flow {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 22px;
  margin-bottom: 30px;
  counter-reset: stage;
}

.flow li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 12px 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
}

/* connector arrow between stages */
.flow li + li::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 50%;
  width: 12px;
  height: 1px;
  background: var(--border-strong);
}

.flow li + li::after {
  content: "";
  position: absolute;
  left: -8px;
  top: calc(50% - 3px);
  border: 3px solid transparent;
  border-left: 4px solid var(--border-strong);
}

.flow-name {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.flow-who {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--faint);
}

.flow-target {
  border-color: var(--accent-line) !important;
  background: var(--accent-soft) !important;
}

.flow-target .flow-who { color: var(--accent); }

.flow-mixed { border-style: dashed !important; border-color: var(--accent-line) !important; }

.flow-mixed .flow-who { color: var(--accent); }

.plug-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 28px;
}

.plug-item h4 {
  font-size: 0.98rem;
  margin-bottom: 6px;
}

.plug-item p { color: var(--muted); font-size: 0.92rem; }

.plug-note { max-width: 52em; }

@media (max-width: 980px) {
  .flow { grid-template-columns: repeat(4, 1fr); }
  .flow li:nth-child(5)::before, .flow li:nth-child(5)::after { display: none; }
  .plug-grid { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 640px) {
  .flow { grid-template-columns: 1fr 1fr; gap: 10px 22px; }
  .flow li:nth-child(odd)::before, .flow li:nth-child(odd)::after { display: none; }
}

/* ---------- Shader block ---------- */

.shader-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: center;
  margin-top: 60px;
  padding-top: 52px;
  border-top: 1px dashed var(--border-strong);
}

.shader-block > * { min-width: 0; }

.shader-kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 10px;
}

.shader-copy h3 {
  font-size: 1.4rem;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
}

.shader-copy p {
  color: var(--muted);
  font-size: 0.96rem;
  margin-bottom: 12px;
}

/* ---------- Engines ---------- */

.engines { margin-top: 60px; }

.engines-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}

.engines-lede {
  color: var(--muted);
  max-width: 46em;
  margin-bottom: 24px;
  font-size: 0.98rem;
}

.engine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.engine {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.engine h4 { font-size: 1.02rem; margin-bottom: 8px; }

.engine p { color: var(--muted); font-size: 0.92rem; }

/* ---------- Status box ---------- */

.status-box {
  border: 1px solid var(--border);
  border-left: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px 24px;
  margin-bottom: 32px;
}

.status-box p { color: var(--muted); font-size: 0.95rem; }

.status-box strong { color: var(--text); }

/* ---------- Timeline ---------- */

.timeline {
  list-style: none;
  position: relative;
  margin-left: 6px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  border-left: 1px dashed var(--border-strong);
}

.timeline li {
  position: relative;
  padding: 0 0 34px 34px;
}

.timeline li:last-child { padding-bottom: 0; }

/* each phase is marked with a small plus, solid while underway */
.timeline li::before {
  content: "+";
  position: absolute;
  left: -8px;
  top: 2px;
  width: 17px; height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  color: var(--faint);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
}

.timeline li.is-active::before {
  color: #16100a;
  background: var(--accent);
  border-color: var(--accent);
}

.phase-state {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}

.timeline li.is-active .phase-state { color: var(--accent); }

.timeline h3 { font-size: 1.1rem; margin-bottom: 6px; }

.timeline p { color: var(--muted); font-size: 0.95rem; max-width: 46em; }

/* ---------- Whitepaper CTA ---------- */

.whitepaper-cta { text-align: center; }

.whitepaper-cta .section-lede { margin-left: auto; margin-right: auto; }

/* ---------- Invitation ---------- */

.invitation { margin-top: 60px; text-align: left; }

.invitation-title {
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 26px;
}

.invite-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.invite {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.invite-num {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}

.invite h4 { font-size: 1.02rem; margin-bottom: 8px; }

.invite p { color: var(--muted); font-size: 0.92rem; }

.invitation-close {
  text-align: center;
  margin-top: 30px;
  font-size: 1.05rem;
  color: var(--text);
}

/* ---------- FAQ ---------- */

/* Questions read best narrow, but the heading keeps the page's left edge. */
.faq details { max-width: 860px; }

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.faq details[open] { border-color: var(--ink-line); }

.faq summary {
  cursor: pointer;
  padding: 17px 20px;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 48px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  font-family: var(--mono);
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 400;
  transition: transform 0.2s;
}

.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }

.faq details p {
  padding: 0 20px 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 44px 0;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.brand-footer { font-size: 1.12rem; }

.footer-tag { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }

.footer-links { display: flex; gap: 20px; }

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover { color: var(--ink); }

.footer-meta { text-align: right; }

.footer-meta p { color: var(--muted); font-size: 0.84rem; }

/* ---------- Whitepaper page ---------- */

.doc-page { padding: 56px 0 84px; }

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) 220px;
  gap: 56px;
  justify-content: center;
  align-items: start;
}

.doc h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 18px;
}

.doc h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 48px 0 14px;
  padding-top: 26px;
  border-top: 1px dashed var(--border-strong);
  scroll-margin-top: 80px;
}

.doc h3 {
  font-size: 1.12rem;
  margin: 30px 0 10px;
  scroll-margin-top: 80px;
}

.doc p,
.doc li {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.doc p { margin-bottom: 16px; }
.doc strong { color: var(--text); }
.doc ul, .doc ol { margin: 0 0 18px 22px; }
.doc li { margin-bottom: 8px; }
.doc a { color: var(--ink); }
.doc hr { border: none; border-top: 1px solid var(--border); margin: 34px 0; }
.doc hr + h2 { border-top: none; padding-top: 0; margin-top: 0; }

.doc .table-wrap { overflow-x: auto; margin: 0 0 20px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.doc th, .doc td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.doc th { color: var(--text); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.doc td { color: var(--muted); }

.doc .qa { margin-bottom: 18px; }
.doc .qa .q { margin-bottom: 4px; }

.doc-toc { position: sticky; top: 84px; font-size: 0.88rem; }

.doc-toc-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}

.doc-toc ol { list-style: none; border-left: 1px solid var(--border); }
.doc-toc a { display: block; padding: 5px 0 5px 14px; color: var(--muted); text-decoration: none; }
.doc-toc a:hover { color: var(--ink); }

/* The whitepaper header has two links and no menu button, so they always show. */
@media (max-width: 980px) {
  .site-nav.doc-nav {
    display: flex;
    position: static;
    flex-direction: row;
    gap: 16px;
    margin-left: auto;
    padding: 0;
    background: none;
    border: none;
  }
  .site-nav.doc-nav a { padding: 0; border: none; font-size: 0.92rem; }
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { display: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .orbit { max-width: 460px; }
  .spec-grid { grid-template-columns: 1fr 1fr; }
  .spec-item:nth-child(2) { border-right: 1px solid var(--border); }
  .spec-item:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .compiler-grid,
  .browser-grid,
  .language-intro { grid-template-columns: 1fr; gap: 36px; }
  .cards-3 { grid-template-columns: 1fr 1fr; }
  .board { grid-template-columns: 1fr 1fr; }
  .board-col:nth-child(2) { grid-row: span 2; }
  .engine-grid, .invite-grid { grid-template-columns: 1fr; }
  .notes-grid { grid-template-columns: 1fr; }
  .shader-block { grid-template-columns: 1fr; gap: 30px; }

  .site-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    margin-left: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 6px 24px 14px;
  }

  .site-nav.open { display: flex; }

  .site-nav a {
    padding: 12px 0;
    font-size: 1.02rem;
    border-bottom: 1px solid var(--border);
  }

  .site-nav a:last-child { border-bottom: none; }
  .site-nav a.current::after { display: none; }

  .nav-toggle { display: flex; }

  .theme-toggle { margin-left: auto; }

  .header-inner { gap: 12px; }
}

@media (max-width: 640px) {
  .hero { padding: 48px 0 44px; }
  .section { padding: 64px 0; }
  .spec-num { font-size: 1.5rem; }
  .spec-item { padding: 20px 16px; }
  .cards-2, .cards-3 { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; }
  .board-col:nth-child(2) { grid-row: auto; }
  .lineage li { grid-template-columns: 1fr; gap: 1px; }
  .precedent { padding: 20px; }
  .chip-group { grid-template-columns: 1fr; gap: 8px; }
  .chip-label { padding-top: 0; }
  .orbit-legend { gap: 12px; flex-wrap: wrap; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-meta { text-align: left; }
}
