:root {
  color-scheme: light dark;
  /* base = light (star chart on cool paper) */
  --ground:   #e9ecf2;
  --surface:  #f6f7fb;
  --surface-2:#ffffff;
  --ink:      #161c30;
  --muted:    #55607b;
  --faint:    #808aa4;
  --line:     #d2d8e4;
  --line-strong:#c0c7d6;
  --accent:   #8f6d12;
  --accent-2: #a9822a;
  --good:     #2f7d5b;
  --good-bg:  rgba(47,125,91,.12);
  --plan:     #46568a;
  --plan-bg:  rgba(70,86,138,.12);
  /* the celestial plate stays dark in both themes (a framed atlas plate) */
  --plate:    #0a0f1e;
  --plate-2:  #121a30;
  --plate-ink:#ece8dd;
  --plate-muted:#9aa2ba;
  --plate-line:rgba(216,206,181,.14);
  --plate-accent:#e0b34f;
  --shadow:   0 1px 2px rgba(20,26,48,.06), 0 10px 30px -12px rgba(20,26,48,.18);
  --radius:   14px;
  --measure:  66ch;
  --serif: "Iowan Old Style","Palatino Linotype",Palatino,"URW Palladio L",P052,Georgia,"Times New Roman",serif;
  --sans: ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mono: ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground:   #070a14;
    --surface:  #0e1424;
    --surface-2:#141c30;
    --ink:      #ece8dd;
    --muted:    #9aa2ba;
    --faint:    #6f7893;
    --line:     rgba(216,206,181,.12);
    --line-strong:rgba(216,206,181,.20);
    --accent:   #e0b34f;
    --accent-2: #ca9d3e;
    --good:     #58b98a;
    --good-bg:  rgba(88,185,138,.14);
    --plan:     #8b9ad2;
    --plan-bg:  rgba(139,154,210,.14);
    --shadow:   0 1px 2px rgba(0,0,0,.4), 0 24px 48px -20px rgba(0,0,0,.7);
  }
}
/* explicit toggle wins in both directions */
:root[data-theme="light"] {
  --ground:#e9ecf2; --surface:#f6f7fb; --surface-2:#ffffff; --ink:#161c30;
  --muted:#55607b; --faint:#808aa4; --line:#d2d8e4; --line-strong:#c0c7d6;
  --accent:#8f6d12; --accent-2:#a9822a; --good:#2f7d5b; --good-bg:rgba(47,125,91,.12);
  --plan:#46568a; --plan-bg:rgba(70,86,138,.12);
  --shadow:0 1px 2px rgba(20,26,48,.06), 0 10px 30px -12px rgba(20,26,48,.18);
}
:root[data-theme="dark"] {
  --ground:#070a14; --surface:#0e1424; --surface-2:#141c30; --ink:#ece8dd;
  --muted:#9aa2ba; --faint:#6f7893; --line:rgba(216,206,181,.12); --line-strong:rgba(216,206,181,.20);
  --accent:#e0b34f; --accent-2:#ca9d3e; --good:#58b98a; --good-bg:rgba(88,185,138,.14);
  --plan:#8b9ad2; --plan-bg:rgba(139,154,210,.14);
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 24px 48px -20px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
a { color: var(--accent); text-underline-offset: 3px; }
h1,h2,h3 { font-family: var(--serif); font-weight: 600; text-wrap: balance; letter-spacing: -.01em; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.prose { max-width: var(--measure); }
.eyebrow {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent-2); margin: 0 0 14px;
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content:""; width: 22px; height: 1px; background: var(--accent-2); opacity:.6;
}

/* ---- top bar ---- */
header.bar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.bar .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: .02em; text-decoration: none; color: var(--ink); }
.brand b { color: var(--accent); font-weight: 600; }
.bar-right { display: flex; align-items: center; gap: 18px; }
.bar-nav { font-family: var(--mono); font-size: 11.5px; letter-spacing:.14em; text-transform:uppercase; color: var(--muted); text-decoration: none; }
.bar-nav:hover { color: var(--accent); }
.bar-tag { font-family: var(--mono); font-size: 11.5px; letter-spacing:.14em; text-transform:uppercase; color: var(--faint); }
@media (max-width: 680px) { .bar-tag { display: none; } }
.toggle {
  appearance:none; cursor:pointer; border:1px solid var(--line-strong);
  background: var(--surface); color: var(--muted);
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; transition: color .2s, border-color .2s;
}
.toggle:hover { color: var(--accent); border-color: var(--accent); }
.toggle svg { width: 17px; height: 17px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-size: .98rem; font-weight: 600;
  padding: 12px 20px; border-radius: 999px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .2s, color .2s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: linear-gradient(180deg, var(--plate-accent), var(--accent-2)); color: #1a1405; border-color: rgba(0,0,0,.12); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 30px -12px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ---- hero ---- */
.hero { padding: 68px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 46px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 34px; } }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.5rem); line-height: 1.04; margin: 0 0 22px; }
.hero h1 .em { color: var(--accent); font-style: italic; }
.lede { font-size: 1.16rem; color: var(--muted); max-width: 46ch; margin: 0 0 26px; }
.lede b { color: var(--ink); font-weight: 600; }
.stats { display: flex; flex-wrap: wrap; gap: 26px 34px; margin-top: 30px; }
.stat .n { font-family: var(--serif); font-size: 1.7rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .l { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-top: 2px; }

/* ---- celestial plate (always dark) ---- */
.plate {
  position: relative; aspect-ratio: 1/1; border-radius: 18px; overflow: hidden;
  background:
    radial-gradient(120% 120% at 30% 20%, #16203a 0%, var(--plate) 60%, #05080f 100%);
  border: 1px solid var(--plate-line);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.02);
}
.plate .cap {
  position:absolute; left:16px; bottom:14px; z-index:3;
  font-family: var(--mono); font-size: 10.5px; letter-spacing:.16em; text-transform: uppercase;
  color: var(--plate-muted);
}
.plate .cap b { color: var(--plate-accent); font-weight: 400; }
.orrery { position:absolute; inset:0; width:100%; height:100%; display:block; }
.ring { fill:none; stroke: var(--plate-line); stroke-width: 1; }
.ring.dash { stroke-dasharray: 2 7; opacity:.8; }
.star { fill: var(--plate-ink); }
.spin { transform-origin: 300px 300px; }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes orbitr { to { transform: rotate(-360deg); } }
.o1 { animation: orbit 48s linear infinite; }
.o2 { animation: orbitr 78s linear infinite; }
.o3 { animation: orbit 116s linear infinite; }
.o4 { animation: orbitr 150s linear infinite; }
.world { fill: var(--plate-accent); }
.world.dim { fill: #c9d2e6; }
.core { fill: url(#coreg); }
.corepulse { transform-box: fill-box; transform-origin: center; animation: pulse 6s ease-in-out infinite; }
@keyframes pulse { 0%,100%{ opacity:.28; } 50%{ opacity:.55; } }
.wlabel { font-family: var(--mono); font-size: 11px; fill: var(--plate-muted); letter-spacing:.04em; }

/* ---- sections ---- */
section { padding: 52px 0; border-top: 1px solid var(--line); }
section > .wrap > h2 { font-size: clamp(1.6rem, 3.4vw, 2.15rem); margin: 0 0 8px; max-width: 22ch; }
.section-intro { color: var(--muted); max-width: var(--measure); margin: 0 0 34px; }

.problem { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 14px; margin-top: 8px; }
.problem li { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.problem b { display:block; font-family: var(--serif); font-size: 1.08rem; margin-bottom: 6px; }
.problem span { color: var(--muted); font-size: .95rem; }

/* capability grid */
.caps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 980px){ .caps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px){ .caps { grid-template-columns: 1fr; } }
.cap-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 24px 22px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px; position: relative;
}
.cap-head { display:flex; align-items:center; gap: 14px; }
.cap-ico { flex: none; width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.cap-ico svg { width: 22px; height: 22px; }
.cap-card h3 { font-size: 1.18rem; margin: 0; line-height: 1.15; }
.cap-card p { margin: 0; color: var(--muted); font-size: .97rem; }
.cap-card .proof { font-size: .9rem; color: var(--ink); }
.cap-card .proof b { color: var(--accent-2); font-weight: 600; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; margin-top: 2px;
}
.chip.ok { color: var(--good); background: var(--good-bg); }
.chip.plan { color: var(--plan); background: var(--plan-bg); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* the cosmos centerpiece */
.cosmos { background:
    radial-gradient(140% 90% at 80% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%); }
.cosmos-lead {
  font-family: var(--serif); font-size: clamp(1.35rem,3vw,1.9rem); line-height: 1.35;
  max-width: 30ch; margin: 0 0 12px;
}
.cosmos-lead .em { color: var(--accent); font-style: italic; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; }
@media (max-width: 820px){ .two { grid-template-columns: 1fr; gap: 26px; } }
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 13px; }
.list li { position: relative; padding-left: 30px; color: var(--muted); }
.list.done li::before {
  content:""; position:absolute; left: 3px; top: 8px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--good); box-shadow: 0 0 0 4px var(--good-bg);
}
.list li b { color: var(--ink); font-weight: 600; }
.note {
  margin-top: 26px; border-left: 3px solid var(--accent); background: var(--surface);
  padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; font-size: .95rem; color: var(--muted);
}
.note b { color: var(--ink); }
.bridge { margin-top: 34px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 28px;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--plan);
  border-radius: var(--radius); padding: 24px 28px; box-shadow: var(--shadow); }
.bridge h3 { font-family: var(--serif); margin: 12px 0 8px; font-size: 1.3rem; }
.bridge p { margin: 0; color: var(--muted); max-width: 58ch; }
.bridge p b { color: var(--ink); font-weight: 600; }
.bridge .chip { margin: 0; }
.bridge-svg { width: 200px; height: 80px; flex: none; }
@media (max-width: 720px){ .bridge { grid-template-columns: 1fr; } .bridge-svg { width: 100%; max-width: 220px; } }

/* differentiators */
.diffs { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px 30px; }
@media (max-width: 760px){ .diffs { grid-template-columns: 1fr; } }
.diff { display: flex; gap: 16px; }
.diff .mark { flex:none; width: 30px; height: 30px; color: var(--accent); }
.diff h3 { margin: 2px 0 6px; font-size: 1.12rem; }
.diff p { margin: 0; color: var(--muted); font-size: .96rem; }

/* roadmap + tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 560px; background: var(--surface); }
caption { text-align: left; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 500; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
td b { color: var(--ink); }
.rm-name { font-family: var(--serif); font-size: 1.02rem; }
.cell-y { color: var(--good); font-weight: 600; }
.cell-n { color: var(--faint); }
.cell-r { color: var(--plan); }
.pkg td:first-child { color: var(--muted); }
.pkg th:not(:first-child) { text-align: center; }
.pkg td:not(:first-child) { text-align: center; font-variant-numeric: tabular-nums; }
.tier { font-family: var(--serif); font-size: 1.08rem; color: var(--ink); }

/* closing */
.close { border-top: 1px solid var(--line); }
.close .big { font-family: var(--serif); font-size: clamp(1.4rem, 3.2vw, 2rem); line-height: 1.32; max-width: 26ch; margin: 0 0 18px; }
.close .big .em { color: var(--accent); font-style: italic; }
.close p { color: var(--muted); max-width: var(--measure); }
footer { padding: 30px 0 60px; color: var(--faint); font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; }
footer .wrap { display:flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-top: 1px solid var(--line); padding-top: 22px; }
footer a { color: var(--faint); text-decoration: none; }
footer a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .o1,.o2,.o3,.o4,.corepulse { animation: none; }
}
