:root {
  --ground: #0a0b0c;
  --panel: #101214;
  --ink: #f2f3f3;
  --muted: #9aa0a2;
  --faint: #585e61;
  --line: #232729;
  --line-hi: #3c4245;
  --grid-dot: rgba(255,255,255,0.045);
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --sans: "Helvetica Neue", "Segoe UI", "Liberation Sans", Arial, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --ground: #f6f7f7;
    --panel: #ffffff;
    --ink: #101314;
    --muted: #4f5659;
    --faint: #8d9497;
    --line: #d8dcdd;
    --line-hi: #aab0b3;
    --grid-dot: rgba(0,0,0,0.055);
  }
}

* { box-sizing: border-box; }
h1, h2, h3, h4, p, dl, ul { margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ground);
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.62;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--ground); }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; width: 100%; }

/* ---------- header ---------- */
header {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  backdrop-filter: blur(10px);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 0; }
.wordmark {
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.3em;
  text-transform: uppercase; text-decoration: none; font-weight: 700;
}
.wordmark span { color: var(--faint); }
nav.links { display: flex; gap: 24px; flex-wrap: wrap; }
nav.links a {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em;
  text-transform: uppercase; text-decoration: none; color: var(--muted);
}
nav.links a:hover { color: var(--ink); }
nav.links a[aria-current="page"] { color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 2px; }

/* ---------- hero (index) ---------- */
.hero { padding: 96px 0 56px; display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: center; }
@media (max-width: 840px) { .hero { grid-template-columns: 1fr; padding-top: 56px; } }
.eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 26px;
  display: flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: var(--ink); }
.hero h1 {
  font-family: var(--mono);
  font-size: clamp(30px, 4.6vw, 50px); line-height: 1.14; font-weight: 600;
  margin: 0 0 24px; letter-spacing: -0.03em; text-wrap: balance;
}
.hero h1 .dim { color: var(--faint); }
.hero .lede { color: var(--muted); font-size: 18px; max-width: 33em; }
.hero .lede b { color: var(--ink); font-weight: 600; }

/* the loop — instrument style */
.loopbox { display: flex; justify-content: center; user-select: none; }
.loopbox svg { width: min(330px, 82%); height: auto; display: block; }
.loop-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.22em; fill: var(--muted); text-transform: uppercase; }
.loop-ring { fill: none; stroke: var(--line-hi); stroke-width: 1; }
.loop-ticks { fill: none; stroke: var(--line); stroke-width: 6; stroke-dasharray: 1 10.5; }
.loop-comet { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 56 507; animation: orbit 8s linear infinite; }
.loop-node { fill: var(--ink); }
.crosshair { stroke: var(--line); stroke-width: 1; }
.mirrorline { stroke: var(--line-hi); stroke-width: 1; }
.reflection { opacity: 0.18; }
@keyframes orbit { to { stroke-dashoffset: -563; } }
@media (prefers-reduced-motion: reduce) {
  .loop-comet { animation: none; stroke-dasharray: none; opacity: 0.4; }
  html { scroll-behavior: auto; }
}

/* ---------- proof line ---------- */
.proof { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 15px 0; }
.proof ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 0; justify-content: space-between; }
.proof li {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.proof li strong { color: var(--ink); font-weight: 700; }
.proof li + li::before { content: "/"; color: var(--faint); margin-right: 16px; padding-left: 16px; }
@media (max-width: 760px) {
  .proof ul { flex-direction: column; gap: 6px; }
  .proof li + li::before { content: none; padding: 0; margin: 0; }
}

/* ---------- directory (index) ---------- */
.dir { margin: 72px 0 0; }
.dir a {
  display: grid; grid-template-columns: 200px 1fr auto; align-items: baseline; gap: 28px;
  padding: 30px 6px; border-bottom: 1px solid var(--line); text-decoration: none;
  transition: background 0.15s, padding-left 0.15s;
}
.dir a:first-child { border-top: 1px solid var(--line); }
.dir a:hover { background: var(--panel); padding-left: 14px; }
.dir .name { font-family: var(--mono); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.dir .desc { color: var(--muted); font-size: 15px; }
.dir .arrow { font-family: var(--mono); color: var(--faint); font-size: 15px; }
.dir a:hover .arrow { color: var(--ink); }
.dir .ext-mark { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-left: 8px; letter-spacing: 0.1em; }
@media (max-width: 760px) {
  .dir a { grid-template-columns: 1fr auto; }
  .dir .desc { grid-column: 1 / -1; }
}

/* ---------- subpage header ---------- */
.page-head { padding: 76px 0 0; }
.crumb {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--faint); margin: 0 0 20px;
}
.crumb a { text-decoration: none; color: var(--faint); }
.crumb a:hover { color: var(--ink); }
.page-head h1 {
  font-family: var(--mono);
  font-size: clamp(28px, 4vw, 42px); font-weight: 600; margin: 0 0 20px;
  letter-spacing: -0.025em; text-wrap: balance;
}
.page-head .intro { color: var(--muted); max-width: 42em; font-size: 17.5px; margin: 0 0 48px; }
.page-head .intro b, .page-head .intro strong { color: var(--ink); font-weight: 600; }

/* ---------- sections ---------- */
section { padding: 64px 0 0; }
.sec-tag {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 16px;
  display: flex; align-items: center; gap: 14px;
}
.sec-tag::after { content: ""; flex: 1; height: 1px; background: var(--line); }
section h2 {
  font-family: var(--mono);
  font-size: clamp(22px, 3vw, 30px); font-weight: 600; margin: 0 0 18px;
  letter-spacing: -0.02em; text-wrap: balance;
}
.sec-intro { color: var(--muted); max-width: 42em; margin: 0 0 38px; font-size: 17px; }
.sec-intro b, .sec-intro strong { color: var(--ink); font-weight: 600; }

/* cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 840px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--panel); border: 1px solid var(--line);
  padding: 26px 24px 24px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--line-hi); }
.card.wide { grid-column: 1 / -1; }
.card .k {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; gap: 12px;
}
.card .k .status { color: var(--faint); letter-spacing: 0.1em; }
.card .k .status::before { content: "[ "; }
.card .k .status::after { content: " ]"; }
.card h3 { font-family: var(--mono); font-size: 18.5px; font-weight: 600; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: 15px; }
.card p b { color: var(--ink); font-weight: 600; }
.card .go {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--ink); text-decoration: none; margin-top: auto; padding-top: 10px;
}
.card .go:hover { text-decoration: underline; }

/* honesty note */
.aside-note { border-left: 2px solid var(--ink); padding: 6px 0 6px 24px; margin: 48px 0 0; max-width: 44em; }
.aside-note p { color: var(--muted); font-size: 16.5px; }
.aside-note .src {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--faint); display: block; margin-top: 10px;
}

/* origin timeline */
.timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 920px) { .timeline { grid-template-columns: 1fr; } }
.step { background: var(--panel); padding: 22px 20px 26px; }
.step .n {
  font-family: var(--mono); font-size: 11px; color: var(--faint);
  letter-spacing: 0.16em; display: block; margin-bottom: 14px;
}
.step h3 { font-family: var(--mono); font-size: 15.5px; margin: 0 0 8px; font-weight: 600; }
.step p { font-size: 14px; color: var(--muted); line-height: 1.55; }
.step p b { color: var(--ink); font-weight: 600; }

/* buttons */
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.06em;
  text-decoration: none; padding: 13px 22px; border: 1px solid var(--line-hi);
  color: var(--ink); transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--ink); }
.btn.solid { background: var(--ink); color: var(--ground); border-color: var(--ink); font-weight: 700; }
.btn.solid:hover { background: var(--muted); border-color: var(--muted); }

/* consulting */
.consult { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 48px; }
@media (max-width: 840px) { .consult { grid-template-columns: 1fr; } }
.consult .offer { border-top: 1px solid var(--line); padding: 20px 0 8px; }
.consult .offer h3 { font-family: var(--mono); font-size: 16px; margin: 0 0 8px; font-weight: 600; }
.consult .offer h3::before { content: "— "; color: var(--faint); }
.consult .offer p { color: var(--muted); font-size: 14.5px; }
.consult-cta { grid-column: 1 / -1; margin-top: 18px; }

/* about */
.about-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 840px) { .about-grid { grid-template-columns: 1fr; } }
.about-grid p { color: var(--muted); margin: 0 0 16px; max-width: 40em; }
.about-grid p b { color: var(--ink); font-weight: 600; }
.specs { background: var(--panel); border: 1px solid var(--line); padding: 22px; }
.specs dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; }
.specs dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); padding-top: 3px; }
.specs dd { margin: 0; font-size: 14px; color: var(--muted); }
.specs dd b { color: var(--ink); font-weight: 600; }

/* prose block (about origin) */
.prose { max-width: 44em; }
.prose p { color: var(--muted); margin: 0 0 18px; }
.prose p b { color: var(--ink); font-weight: 600; }

/* footer */
footer { margin-top: 110px; border-top: 1px solid var(--line); padding: 44px 0 56px; }
.foot-grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.foot-col h4 { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint); margin: 0 0 14px; font-weight: 600; }
.foot-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.foot-col a { font-size: 14px; color: var(--muted); text-decoration: none; }
.foot-col a:hover { color: var(--ink); }
.foot-col .ext { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-left: 6px; }
.colophon { margin-top: 44px; font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: 0.08em; }
