/* Limidus — limidus.com
   Dark-first, with a full light palette. Tokens are declared once on :root and
   only re-pointed per theme, so nothing has its sole definition inside a media
   query. */

:root {
  --bg:        #0a0c0f;
  --bg-soft:   #0e1216;
  --panel:     #11161c;
  --panel-2:   #151b22;
  --line:      rgba(255,255,255,.09);
  --line-2:    rgba(255,255,255,.16);
  --fg:        #e9eef5;
  --fg-dim:    #b9c4d1;
  --muted:     #8593a4;
  --accent:    #6ea8fe;
  --code-bg:   #0c1015;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 18px 50px -24px rgba(0,0,0,.85);
  --glow-a:    rgba(110,168,254,.16);
  --glow-b:    rgba(34,211,238,.11);
  --grid-ink:  rgba(255,255,255,.045);

  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1120px;
  --pad: clamp(20px, 5vw, 40px);
  --radius: 16px;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:        #fbfcfe;
  --bg-soft:   #f4f7fa;
  --panel:     #ffffff;
  --panel-2:   #f7f9fc;
  --line:      rgba(16,26,40,.11);
  --line-2:    rgba(16,26,40,.2);
  --fg:        #101720;
  --fg-dim:    #37424f;
  --muted:     #5d6b7c;
  --accent:    #2f6fdb;
  --code-bg:   #f2f5f9;
  --shadow:    0 1px 2px rgba(16,26,40,.06), 0 20px 44px -28px rgba(16,26,40,.4);
  --glow-a:    rgba(110,168,254,.22);
  --glow-b:    rgba(34,211,238,.18);
  --grid-ink:  rgba(16,26,40,.05);

  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.1; letter-spacing: -0.028em; margin: 0; font-weight: 640; }
p { margin: 0 0 1.05em; }
a { color: inherit; }

::selection { background: color-mix(in oklab, var(--accent) 32%, transparent); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--panel); color: var(--fg); border: 1px solid var(--line-2);
  padding: 10px 16px; border-radius: 10px; text-decoration: none;
  transition: top .18s ease;
}
.skip:focus { top: 12px; }

:where(a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ── backdrop ─────────────────────────────────────────────── */

.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }

.grid-lines {
  position: absolute; inset: -10%;
  background-image:
    linear-gradient(to right, var(--grid-ink) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-ink) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 72%);
}

.glow { position: absolute; border-radius: 50%; filter: blur(90px); }
.glow-a {
  width: 60vw; height: 60vw; max-width: 820px; max-height: 820px;
  top: -22vw; left: 50%; translate: -50% 0;
  background: var(--glow-a);
  animation: drift-a 26s ease-in-out infinite alternate;
}
.glow-b {
  width: 44vw; height: 44vw; max-width: 620px; max-height: 620px;
  top: 46vh; right: -12vw;
  background: var(--glow-b);
  animation: drift-b 32s ease-in-out infinite alternate;
}
@keyframes drift-a { to { translate: -46% 5vh; scale: 1.12; } }
@keyframes drift-b { to { translate: -6vw 8vh; scale: .9; } }

/* ── header ───────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; height: 68px;
}

.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 650; letter-spacing: -0.03em; font-size: 18px;
  text-decoration: none;
}
.mark-box { fill: none; stroke: var(--line-2); stroke-width: 1.6; }
.mark-l   { fill: none; stroke: var(--fg); stroke-width: 2.4; stroke-linecap: square; }
.mark-dot { fill: var(--accent); }
.wordmark:hover .mark-dot { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  text-decoration: none; color: var(--muted); font-size: 14.5px;
  padding: 8px 12px; border-radius: 9px;
  transition: color .16s ease, background .16s ease;
}
.site-nav a:hover { color: var(--fg); background: var(--panel-2); }
.nav-gh { display: inline-flex; align-items: center; gap: 7px; }

.theme-toggle {
  display: grid; place-items: center;
  width: 36px; height: 36px; margin-left: 6px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--line-2); background: var(--panel-2); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ── hero ─────────────────────────────────────────────────── */

.hero {
  padding: clamp(72px, 15vh, 152px) var(--pad) clamp(64px, 11vh, 120px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}
.hero-main { min-width: 0; }

.eyebrow {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 20px; display: flex; align-items: center; gap: 12px;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--accent); opacity: .8;
}

.hero h1 {
  font-size: clamp(40px, 7.6vw, 82px);
  letter-spacing: -0.042em;
  font-weight: 660;
  margin: 0 0 26px;
  max-width: 16ch;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(96deg, var(--accent), color-mix(in oklab, var(--accent) 40%, #22d3ee));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.lede {
  font-size: clamp(17px, 2.1vw, 20.5px);
  color: var(--fg-dim); max-width: 60ch; margin-bottom: 34px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--fg-dim); text-decoration: none; font-size: 15px; font-weight: 520;
  transition: transform .16s ease, border-color .16s ease, color .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-2px); border-color: var(--line-2); color: var(--fg); }
.btn-primary {
  background: var(--fg); color: var(--bg); border-color: var(--fg); font-weight: 580;
}
.btn-primary:hover { color: var(--bg); background: color-mix(in oklab, var(--fg) 88%, var(--accent)); }

.hero-index {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--panel) 72%, transparent);
  padding: 8px;
  margin-top: 6px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}
.hero-index-head {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .15em;
  text-transform: uppercase; color: var(--muted);
  margin: 10px 12px 12px;
}
.hero-index ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hero-index a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "dot name" ". role" ". tag";
  column-gap: 10px; row-gap: 2px;
  padding: 11px 12px; border-radius: 11px;
  text-decoration: none;
  transition: background .16s ease;
}
.hero-index a:hover { background: var(--panel-2); }
.hi-dot {
  grid-area: dot; align-self: center;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}
.hi-name { grid-area: name; font-size: 15px; font-weight: 580; letter-spacing: -.015em; color: var(--fg); }
.hi-role { grid-area: role; font-size: 13px; color: var(--muted); line-height: 1.4; }
.hi-tag {
  grid-area: tag; justify-self: start; margin-top: 6px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 999px; padding: 2px 8px;
}

/* ── the promise band, directly under the hero ────────────── */

.promise {
  padding-block: clamp(44px, 7vh, 72px);
  border-block: 1px solid var(--line);
  background: var(--bg-soft);
}
.promise-head {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .15em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
  margin-bottom: 28px;
}
.promise-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(24px, 4vw, 44px);
}
.promise-grid li { min-width: 0; }
.promise-grid svg { color: var(--accent); display: block; margin-bottom: 14px; }
.promise-grid h3 {
  font-size: 17.5px; letter-spacing: -.022em; margin-bottom: 9px; color: var(--fg);
}
.promise-grid p { color: var(--muted); font-size: 15px; margin: 0; max-width: 40ch; }

/* ── sections ─────────────────────────────────────────────── */

.section-head { margin-bottom: clamp(40px, 7vh, 64px); max-width: 62ch; }
.section-head h2 { font-size: clamp(28px, 4.2vw, 40px); margin-bottom: 14px; }
.section-head p { color: var(--muted); margin: 0; font-size: 17px; }

.projects { padding-block: clamp(56px, 9vh, 96px); }

.project {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  padding-block: clamp(44px, 7vh, 72px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 96px;
}
.project:first-of-type { border-top: 0; padding-top: 0; }
.project:focus { outline: none; }

.project-rail { position: relative; }
@media (min-width: 900px) {
  .project-rail { position: sticky; top: 108px; align-self: start; }
}

.project-index {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em;
  color: var(--accent); display: block; margin-bottom: 14px;
}
.project-rail h3 {
  font-size: clamp(30px, 4.4vw, 42px);
  margin-bottom: 8px;
  letter-spacing: -.035em;
}
.project-role { color: var(--muted); font-size: 15px; margin-bottom: 22px; }

.project-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.project-links a {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; font-size: 14.5px; color: var(--fg-dim);
  transition: color .16s ease, gap .16s ease;
}
.project-links a:hover { color: var(--accent); gap: 11px; }
.link-page { color: var(--accent) !important; font-weight: 540; }
.link-live .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}
.link-live { font-family: var(--font-mono); font-size: 13.5px !important; }

.project-body { max-width: 68ch; min-width: 0; }
.project-lead {
  font-size: clamp(19px, 2.4vw, 23px);
  line-height: 1.42; letter-spacing: -.022em;
  color: var(--fg); margin-bottom: 20px; font-weight: 520;
}
.project-body p { color: var(--fg-dim); }
.project-body em { color: var(--fg); font-style: italic; }
.project-body strong { color: var(--fg); font-weight: 600; }

blockquote {
  margin: 26px 0; padding: 4px 0 4px 22px;
  border-left: 2px solid var(--accent);
  color: var(--fg); font-size: 18px; line-height: 1.5; letter-spacing: -.015em;
}

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 26px 0 0; }
.chips li {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .02em;
  color: var(--muted); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
}

.snippet {
  margin: 26px 0 0;
  min-width: 0;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.snippet figcaption {
  font-size: 12.5px; color: var(--muted);
  padding: 11px 18px; border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--panel) 60%, transparent);
}
.snippet pre {
  margin: 0; padding: 18px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.75;
  color: var(--fg-dim);
}
.snippet .c { color: var(--muted); }
.snippet .s { color: var(--accent); }

.note {
  margin-top: 20px; font-size: 14.5px; color: var(--muted);
  padding-left: 14px; border-left: 1px solid var(--line-2);
}

/* ── calcq ────────────────────────────────────────────────── */

.calcq {
  padding-block: clamp(80px, 14vh, 148px);
  border-block: 1px solid var(--line);
  background:
    radial-gradient(80% 120% at 78% 50%, color-mix(in oklab, var(--accent) 9%, transparent) 0%, transparent 62%),
    var(--bg-soft);
}
.calcq-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: clamp(32px, 6vw, 72px); align-items: center;
}
.calcq-copy { max-width: 54ch; }
.calcq h2 {
  font-size: clamp(38px, 6vw, 62px); letter-spacing: -.045em; margin-bottom: 16px;
}
.calcq-lead {
  font-size: clamp(22px, 3.2vw, 32px); color: var(--fg);
  letter-spacing: -.03em; margin-bottom: 20px; font-weight: 560;
  background: linear-gradient(96deg, var(--fg), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.calcq-note { color: var(--fg-dim); max-width: 48ch; }
.calcq-note + .calcq-note { color: var(--muted); font-size: 15.5px; }
.calcq-note a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in oklab, var(--accent) 40%, transparent); }
.calcq-note a:hover { border-bottom-color: var(--accent); }
.calcq-meta {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin: 24px 0 0;
}

.calcq-art { display: grid; place-items: center; }
.keypad { width: 100%; max-width: 420px; height: auto; overflow: visible; }

/* The plane a calculator has always sat on … */
.keypad .cq-tile {
  fill: color-mix(in oklab, var(--accent) 7%, transparent);
  stroke: color-mix(in oklab, var(--accent) 42%, transparent);
  stroke-width: 1.1;
}
/* … the sockets where three keys used to be … */
.keypad .cq-socket {
  fill: color-mix(in oklab, var(--accent) 10%, transparent);
  stroke: color-mix(in oklab, var(--accent) 34%, transparent);
  stroke-width: 1.1;
  stroke-dasharray: 3 4;
}
/* … and the keys that left it. */
.keypad .cq-top {
  fill: url(#cq-lift);
  stroke: var(--accent);
  stroke-width: 1.2;
  stroke-linejoin: round;
}
.keypad .cq-side {
  fill: url(#cq-face);
  stroke: color-mix(in oklab, var(--accent) 55%, transparent);
  stroke-width: 1;
  stroke-linejoin: round;
}
.keypad .cq-side-r { fill: color-mix(in oklab, var(--accent) 16%, transparent); }

.keypad .cq-key { animation: cq-float 6s ease-in-out infinite; }
.keypad .cq-key-1 { animation-delay: -2s; }
.keypad .cq-key-2 { animation-delay: -4s; }
@keyframes cq-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* ── open source ──────────────────────────────────────────── */

.oss { padding-block: clamp(64px, 10vh, 108px) clamp(40px, 6vh, 64px); }
.oss-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.oss-list a {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto auto;
  align-items: center; gap: 18px;
  padding: 20px 22px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.oss-list a:hover {
  border-color: color-mix(in oklab, var(--accent) 55%, var(--line));
  background: var(--panel-2);
  transform: translateY(-2px);
}
.oss-name {
  font-family: var(--font-mono); font-size: 15px; color: var(--fg);
  letter-spacing: -.01em;
}
.oss-desc { color: var(--muted); font-size: 15px; }
.oss-license {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  border-radius: 999px; padding: 4px 11px; white-space: nowrap;
}
.oss-license.tbd {
  color: var(--muted);
  border-color: var(--line-2);
}
.oss-arrow { color: var(--muted); transition: transform .18s ease, color .18s ease; }
.oss-list a:hover .oss-arrow { color: var(--accent); transform: translateX(4px); }

/* ── support / sponsorship ────────────────────────────────── */

.support {
  margin-top: 40px;
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
  gap: clamp(24px, 4vw, 48px);
  padding: clamp(26px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.support h3 { font-size: clamp(20px, 2.6vw, 25px); letter-spacing: -.028em; margin-bottom: 12px; }
.support-copy p { color: var(--muted); font-size: 15.5px; margin: 0; }
.support-paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 24px; }
.support-paths h4 {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 10px;
}
.support-paths p { color: var(--fg-dim); font-size: 14.5px; margin: 0 0 12px; }
.support-paths a {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--accent); text-decoration: none; font-size: 14.5px; font-weight: 540;
  transition: gap .16s ease;
}
.support-paths a:hover { gap: 10px; }

@media (max-width: 860px) {
  .support { grid-template-columns: minmax(0, 1fr); }
}

/* ── principles ───────────────────────────────────────────── */

.principles { padding-block: 0 clamp(72px, 12vh, 124px); }
.principle-grid {
  list-style: none; margin: 0; padding: 0;
  /* Exactly two columns: four cards form a 2x2 block instead of a row of three
     with an orphan underneath. auto-fit cannot express that. */
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.principle-grid li { background: var(--bg); padding: 32px 30px; }
.principle-grid h3 { font-size: 18px; margin-bottom: 10px; letter-spacing: -.02em; }
.principle-grid p { color: var(--muted); font-size: 15px; margin: 0; }


/* ── project pages (/kdb/, /zolik/, /qtask/) ──────────────── */

.crumbs {
  padding-top: clamp(28px, 5vh, 44px);
  font-size: 14px;
}
.crumbs a {
  color: var(--muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px;
  transition: color .16s ease, gap .16s ease;
}
.crumbs a:hover { color: var(--fg); gap: 10px; }

.page-hero { padding: clamp(32px, 6vh, 52px) 0 clamp(36px, 6vh, 56px); }
.page-hero h1 {
  font-size: clamp(44px, 8vw, 84px);
  letter-spacing: -.045em; margin: 14px 0 18px;
}
.page-hero .page-lead {
  font-size: clamp(19px, 2.5vw, 25px); line-height: 1.42;
  letter-spacing: -.024em; color: var(--fg); max-width: 30ch;
  font-weight: 520; margin-bottom: 26px;
}
.page-hero .page-sub { color: var(--fg-dim); max-width: 62ch; font-size: 17.5px; }

.page-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line);
}
.page-meta a, .page-meta span {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14.5px; padding: 9px 15px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel);
  text-decoration: none; color: var(--fg-dim);
  transition: transform .16s ease, border-color .16s ease, color .16s ease;
}
.page-meta a:hover { transform: translateY(-2px); color: var(--fg); border-color: var(--line-2); }
.page-meta .meta-primary {
  background: var(--fg); color: var(--bg); border-color: var(--fg); font-weight: 560;
}
.page-meta .meta-primary:hover { color: var(--bg); }
.page-meta .meta-static {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); background: transparent;
}

.doc { padding-bottom: clamp(56px, 9vh, 92px); }
.doc section { padding-block: clamp(28px, 4.5vh, 44px); border-top: 1px solid var(--line); }
.doc section:first-of-type { border-top: 0; }
.doc h2 {
  font-size: clamp(23px, 3vw, 29px); margin-bottom: 18px;
  display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 14px;
}
.doc h2::before {
  content: ""; width: 20px; height: 2px; background: var(--accent);
  border-radius: 2px; transform: translateY(-6px);
}
.doc h3 { font-size: 17.5px; margin: 26px 0 10px; letter-spacing: -.02em; }
.doc p, .doc li { color: var(--fg-dim); max-width: 72ch; }
.doc em { color: var(--fg); font-style: italic; }
.doc strong { color: var(--fg); font-weight: 600; }
.doc > section > p:first-of-type { margin-top: 0; }
.doc ul.bullets { padding-left: 20px; margin: 0 0 1.05em; }
.doc ul.bullets li { margin-bottom: .5em; }
.doc a:not(.btn) { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in oklab, var(--accent) 35%, transparent); }
.doc a:not(.btn):hover { border-bottom-color: var(--accent); }

.doc :not(pre) > code, .deftable code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--code-bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 6px;
  color: var(--fg); white-space: nowrap;
}

.deftable { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 15px; }
.deftable th, .deftable td {
  text-align: left; vertical-align: top; padding: 12px 16px;
  border-bottom: 1px solid var(--line); color: var(--fg-dim);
}
.deftable th {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
  border-bottom-color: var(--line-2);
}
.deftable td:first-child { color: var(--fg); white-space: nowrap; font-weight: 540; }
.deftable tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; margin: 22px 0; }
.table-scroll .deftable { margin: 0; }

.status-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 9px; vertical-align: 1px; background: var(--muted);
}
.status-dot.done    { background: #4ade80; }
.status-dot.partial { background: #f0b429; }
.status-dot.planned { background: var(--muted); opacity: .6; }

.callout {
  margin: 24px 0; padding: 18px 22px;
  border: 1px solid var(--line); border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--panel);
}
.callout p { margin: 0; max-width: none; }
.callout p + p { margin-top: .8em; }

.page-nav {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px;
  padding-block: clamp(36px, 6vh, 60px); border-top: 1px solid var(--line);
}
.page-nav a {
  display: block; padding: 20px 22px; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.page-nav a:hover {
  border-color: color-mix(in oklab, var(--accent) 55%, var(--line));
  background: var(--panel-2); transform: translateY(-2px);
}
.page-nav .pn-label {
  display: block; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.page-nav .pn-name { display: block; font-size: 17px; font-weight: 580; color: var(--fg); letter-spacing: -.02em; }
.page-nav .pn-role { display: block; font-size: 14px; color: var(--muted); margin-top: 3px; }

/* The homepage sections link out to these pages. */
.project-more {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 26px; padding: 11px 18px;
  border: 1px solid color-mix(in oklab, var(--accent) 42%, var(--line));
  border-radius: 11px; text-decoration: none;
  color: var(--fg); font-size: 15px; font-weight: 540;
  transition: transform .16s ease, gap .16s ease, background .16s ease;
}
.project-more:hover {
  transform: translateY(-2px); gap: 13px;
  background: color-mix(in oklab, var(--accent) 12%, transparent);
}

@media (max-width: 620px) {
  .doc h2 { grid-template-columns: 1fr; gap: 0; }
  .doc h2::before { display: none; }
}

/* ── footer ───────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: clamp(32px, 6vw, 64px);
  padding-block: clamp(44px, 7vh, 68px);
}
.wordmark.static { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; }
.footer-brand p { color: var(--muted); font-size: 15px; margin: 14px 0 0; max-width: 38ch; }

.footer-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 28px; }
.footer-links h3 {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 14px;
}
.footer-links a {
  display: block; text-decoration: none; color: var(--fg-dim);
  font-size: 14.5px; padding: 4px 0;
  transition: color .16s ease;
}
.footer-links a:hover { color: var(--accent); }

.footer-base {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding-block: 22px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13.5px;
}
.footer-base p { margin: 0; }
.to-top { text-decoration: none; color: var(--muted); }
.to-top:hover { color: var(--fg); }

/* ── reveal ───────────────────────────────────────────────── */

.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1); }

/* ── responsive ───────────────────────────────────────────── */

@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-index { max-width: 420px; margin-top: 40px; }
}

@media (max-width: 900px) {
  .project { grid-template-columns: minmax(0, 1fr); }
  .calcq-inner { grid-template-columns: minmax(0, 1fr); }
  .calcq-art { order: -1; justify-items: start; }
  .keypad { max-width: 260px; }
  .oss-list a { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
  .oss-desc { grid-column: 1 / -1; order: 3; }
  .oss-arrow { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .principle-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .site-nav a:not(.nav-gh) { display: none; }
  .header-inner { height: 60px; }
  .hero h1 { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .backdrop, .site-header, .theme-toggle { display: none; }
  body { background: #fff; color: #000; }
}
