:root {
  color-scheme: light;
  --font-display: Inter, "Noto Sans SC", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --font-body: Inter, "Noto Sans SC", "Segoe UI Variable Text", "Segoe UI", sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --paper: #f7f8f6;
  --paper-solid: #f7f8f6;
  --surface: rgba(255, 255, 255, .78);
  --ink: #161a20;
  --muted: #66707d;
  --line: rgba(22, 26, 32, .14);
  --grid: rgba(30, 55, 101, .035);
  --math: #2483e2;
  --stats: #20a278;
  --cs: #ed5d72;
  --header-height: 76px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.16, 1, .3, 1);
  --shadow: 0 30px 80px rgba(27, 44, 72, .09);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d1014;
  --paper-solid: #0d1014;
  --surface: rgba(21, 25, 31, .82);
  --ink: #f3f6f8;
  --muted: #9aa5b2;
  --line: rgba(240, 245, 250, .15);
  --grid: rgba(145, 180, 220, .035);
  --math: #58a6ec;
  --stats: #54c79d;
  --cs: #f27d8e;
  --shadow: 0 30px 90px rgba(0, 0, 0, .36);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  min-height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: var(--font-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 14px;
  z-index: 100;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  background: var(--paper-solid);
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus { transform: translateY(0); }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--math);
  outline-offset: 3px;
}

.site-header {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(22px, 5vw, 76px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-solid) 78%, transparent);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  transition: background 220ms ease, box-shadow 220ms ease;
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--paper-solid) 91%, transparent);
  box-shadow: 0 12px 38px color-mix(in srgb, var(--ink) 7%, transparent);
}

.brand {
  width: fit-content;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -.045em;
}

.brand-orbit {
  width: 24px;
  height: 24px;
  display: block;
  flex: 0 0 auto;
  overflow: visible;
}

.brand-mark-arcs path {
  fill: none;
  stroke-width: 2.35;
  stroke-linecap: round;
}

.brand-mark-arcs .arc-blue { stroke: var(--math); }
.brand-mark-arcs .arc-green { stroke: var(--stats); }
.brand-mark-arcs .arc-coral { stroke: var(--cs); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.5vw, 36px);
}

.nav a {
  position: relative;
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 520;
}

.nav a::after {
  content: "";
  position: absolute;
  right: 100%;
  bottom: 2px;
  left: 0;
  height: 1px;
  background: var(--ink);
  transition: right 220ms var(--ease);
}

.nav a:hover,
.nav a[aria-current="page"] { color: var(--ink); }
.nav a:hover::after,
.nav a[aria-current="page"]::after { right: 0; }

.site-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.control,
.glass-control {
  min-width: 38px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.control:hover,
.glass-control:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 42%, transparent); }

.site-actions .control { min-width: 44px; height: 44px; border-radius: 10px; }
.site-actions .control:active { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.theme-icon { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-moon, .theme-sun { transform-origin: 12px 12px; transition: opacity 220ms ease, transform 220ms ease; }
.theme-moon { opacity: 1; transform: rotate(0deg); }
.theme-sun { opacity: 0; transform: rotate(-35deg); }
:root[data-theme="dark"] .theme-moon { opacity: 0; transform: rotate(35deg); }
:root[data-theme="dark"] .theme-sun { opacity: 1; transform: rotate(0deg); }
@media (prefers-reduced-motion: reduce) {
  .theme-moon, .theme-sun { transition: none; transition-duration: 0s !important; }
}

.space-viewport,
.space-shell { width: 100%; }

.space-panel {
  position: relative;
  width: 100%;
  scroll-margin-top: var(--header-height);
}

.hero-system {
  position: relative;
  width: min(1200px, 96vw);
  height: min(760px, calc(100svh - 88px));
  min-height: 590px;
  margin-top: var(--header-height);
  isolation: isolate;
}

.orbit-field {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.orbit-path,
.orbit-echo {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.orbit-path {
  stroke-width: .9;
  stroke-dasharray: 2 8;
  stroke-linecap: round;
  opacity: .28;
  animation: none;
}

.orbit-math { stroke: var(--math); }
.orbit-stats { stroke: var(--stats); stroke-dasharray: 1 9; animation-direction: reverse; animation-duration: 30s; }
.orbit-cs { stroke: var(--cs); stroke-dasharray: 3 12; animation-duration: 36s; }

.orbit-echo {
  stroke: color-mix(in srgb, var(--ink) 14%, transparent);
  stroke-width: 1;
  stroke-dasharray: 1 7;
}

.moving-token .token-surface,
.static-tokens .token-surface {
  stroke: color-mix(in srgb, white 82%, transparent);
  stroke-width: 3;
  filter: drop-shadow(0 9px 12px rgba(28, 39, 55, .15));
}

.math-token .token-surface { fill: var(--math); }
.stats-token .token-surface { fill: var(--stats); }
.cs-token .token-surface { fill: var(--cs); }

.moving-token text,
.static-tokens text {
  fill: #fff;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .03em;
  text-anchor: middle;
  dominant-baseline: middle;
}

.static-tokens { display: none; }

.transformer-core {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: min(480px, 48vw);
  min-height: 244px;
  display: grid;
  place-items: center;
  padding: 56px 42px 44px;
  border: 1px solid color-mix(in srgb, var(--ink) 27%, transparent);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transform: translate(-50%, -50%);
}

.transformer-core::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid color-mix(in srgb, var(--ink) 7%, transparent);
  border-radius: 11px;
  pointer-events: none;
}

.transformer-core::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--math) 8%, transparent), transparent 66%);
  animation: none;
}

.core-label {
  position: absolute;
  top: 24px;
  left: 50%;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-50%);
}

.attention-matrix {
  position: absolute;
  inset: 29px;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  overflow: hidden;
  opacity: .1;
}

.attention-matrix i {
  width: 4px;
  height: 4px;
  place-self: center;
  border-radius: 50%;
  background: var(--ink);
  animation: none;
}

.attention-matrix i:nth-child(3n) { animation-delay: -.8s; }
.attention-matrix i:nth-child(4n) { animation-delay: -1.6s; }
.attention-matrix i:nth-child(5n) { animation-delay: -2.4s; }

.core-port {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper-solid);
  transform: translateY(-50%);
}

.core-port::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid var(--line);
  border-radius: inherit;
  animation: none;
}

.port-in { left: -6px; }
.port-out { right: -6px; }
.port-out::after { animation-delay: 1.35s; }

.identity { position: relative; z-index: 2; text-align: center; }

.identity h1 {
  margin: 0;
  font-size: clamp(36px, 4.7vw, 66px);
  font-weight: 720;
  letter-spacing: -.065em;
  line-height: 1;
  white-space: nowrap;
}

.identity-rule {
  display: block;
  width: 44px;
  height: 1px;
  margin: 24px auto 18px;
  background: var(--ink);
  animation: none;
}

.identity p { margin: 0; color: var(--muted); font-size: 12px; letter-spacing: .04em; }

.hero-note {
  position: absolute;
  z-index: 4;
  bottom: 8%;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .13em;
  line-height: 1.7;
  text-transform: uppercase;
}

.note-left { left: 1.5%; }
.note-right { right: 1.5%; text-align: right; }

.scroll-cue {
  position: absolute;
  bottom: 3%;
  left: 50%;
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .13em;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.scroll-cue i {
  position: relative;
  width: 1px;
  height: 26px;
  overflow: hidden;
  background: var(--line);
}

.scroll-cue i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  animation: none;
}

@keyframes orbit-dash { to { stroke-dashoffset: -120; } }
@keyframes core-breathe { 0%, 100% { opacity: .4; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes attend { 0%, 34%, 72%, 100% { opacity: .28; transform: scale(.8); } 48%, 58% { opacity: 1; transform: scale(1.9); } }
@keyframes rule-pulse { 0%, 38%, 100% { transform: scaleX(1); opacity: .85; } 52% { transform: scaleX(2.4); opacity: .3; } 62% { transform: scaleX(.82); opacity: 1; } }
@keyframes port-ping { 0% { transform: scale(.45); opacity: 0; } 28% { opacity: .7; } 100% { transform: scale(1.75); opacity: 0; } }
@keyframes scroll-cue { 0% { transform: translateY(-100%); } 55%, 100% { transform: translateY(100%); } }

/* Long-page sections */
.space-panel:not([data-panel="home"]) {
  min-height: 100svh;
  padding: calc(var(--header-height) + 48px) clamp(22px, 5vw, 76px) 80px;
  border-top: 1px solid var(--line);
}

.space-panel[data-panel="blog"] { background: color-mix(in srgb, var(--math) 1.7%, transparent); }
.space-panel[data-panel="notes"] { background: color-mix(in srgb, var(--stats) 1.7%, transparent); }
.space-panel[data-panel="contact"] { background: color-mix(in srgb, var(--cs) 1.7%, transparent); }

.space-panel:not([data-panel="home"]) .section-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.space-panel:not([data-panel="home"]) .section-heading {
  min-width: 0;
  padding: 0;
  border: 0;
}

.space-panel:not([data-panel="home"]) .section-heading .kicker {
  margin: 0 0 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.space-panel:not([data-panel="home"]) .section-heading h1 {
  margin: 0 0 14px;
  font-size: clamp(40px, 4vw, 48px);
  font-weight: 680;
  letter-spacing: -.055em;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.space-panel:not([data-panel="home"]) .section-heading p:last-child {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(15px, 1.35vw, 16px);
  line-height: 1.65;
}

.space-panel:not([data-panel="home"]) .section-orbit { display: none; }

.space-panel:not([data-panel="home"]) .section-count {
  display: block;
  margin-top: 16px;
  color: var(--muted);
  font: 10px/1.4 var(--font-mono);
  letter-spacing: .08em;
}

.archive-shell { margin-top: 32px; }

.topic-panel {
  position: sticky;
  top: var(--header-height);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-solid) 90%, transparent);
  backdrop-filter: blur(16px);
  scrollbar-width: none;
}

.topic-panel::-webkit-scrollbar { display: none; }

.topic-panel > span {
  margin-right: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.topic-panel button {
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
  cursor: pointer;
}

.topic-panel button:hover,
.topic-panel button[aria-pressed="true"],
.topic-panel button.is-copied { border-color: var(--line); color: var(--ink); background: var(--surface); }

.archive-list { border-bottom: 1px solid var(--line); }

.archive-item {
  position: relative;
  border-top: 1px solid var(--line);
  transition: background 220ms ease;
}

.archive-item[hidden] { display: none; }
.archive-item:hover { background: color-mix(in srgb, var(--surface) 62%, transparent); }

.archive-item a {
  min-height: 132px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  grid-template-rows: auto auto 1fr;
  gap: 8px 20px;
  align-items: start;
  padding: 24px 8px 24px 0;
}

.post-visual {
  grid-column: 1;
  grid-row: 1 / 4;
  align-self: center;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.post-visual.blue { color: var(--math); background: color-mix(in srgb, var(--math) 11%, transparent); }
.post-visual.green { color: var(--stats); background: color-mix(in srgb, var(--stats) 11%, transparent); }
.post-visual.coral { color: var(--cs); background: color-mix(in srgb, var(--cs) 11%, transparent); }

.post-visual svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.archive-item .tag {
  grid-column: 2;
  grid-row: 1;
  color: var(--muted);
  font: 700 9px/1.3 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.archive-item h2 {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 640;
  letter-spacing: -.04em;
  line-height: 1.15;
}

.archive-item p {
  grid-column: 2;
  grid-row: 3;
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.archive-item time {
  grid-column: 3;
  grid-row: 1;
  color: var(--muted);
  font: 10px/1.3 var(--font-mono);
}

.archive-entry-arrow {
  grid-column: 3;
  grid-row: 3;
  align-self: end;
  justify-self: end;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  transition: transform 200ms var(--ease);
}

.archive-item:hover .archive-entry-arrow { transform: translateX(5px); }

.notes-grid { margin-top: 32px; border-top: 1px solid var(--line); }

.note-category { --note-color: var(--math); border-bottom: 1px solid var(--line); }
.note-stats { --note-color: var(--stats); }
.note-cs { --note-color: var(--cs); }

.note-category-link {
  min-height: 104px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 18px;
  padding: 20px 8px 20px 0;
}

.note-token {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--note-color) 45%, var(--line));
  border-radius: 50%;
  background: color-mix(in srgb, var(--note-color) 10%, transparent);
  color: var(--note-color);
  font-size: 10px;
  font-weight: 720;
  transition: color 260ms ease, background 260ms ease, transform 360ms var(--spring);
}

.note-line { display: none; }

.note-category-link > span:nth-child(3) { display: grid; gap: 7px; }
.note-category small { color: var(--muted); font: 9px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.note-category strong { font-size: clamp(18px, 2.2vw, 27px); font-weight: 600; letter-spacing: -.035em; }
.note-category i { font-style: normal; color: var(--muted); transition: transform 200ms ease; }

.note-category:hover .note-token { color: #fff; background: var(--note-color); transform: translateX(8px) rotate(10deg); }
.note-category:hover i { transform: translate(3px, -3px); }

.contact-shell { padding-bottom: 30px; }
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 42px; margin-top: 32px; border-top: 1px solid var(--line); }

.contact-card {
  width: 100%;
  min-height: 92px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 18px;
  padding: 22px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 200ms ease;
}

.contact-card:hover { background: color-mix(in srgb, var(--surface) 64%, transparent); }
.contact-card > span:nth-child(2) { min-width: 0; display: grid; gap: 7px; }
.contact-card small { color: var(--muted); font: 9px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.contact-card strong { overflow-wrap: anywhere; font-size: 14px; font-weight: 560; }
.contact-card > i { color: var(--muted); font-style: normal; transition: transform 180ms ease; }
.contact-card:hover > i { transform: translate(3px, -3px); }

.contact-dot { width: 14px; height: 14px; margin-left: 9px; border-radius: 50%; background: var(--math); box-shadow: 0 0 0 6px color-mix(in srgb, var(--math) 10%, transparent); }
.stats-dot { background: var(--stats); box-shadow: 0 0 0 6px color-mix(in srgb, var(--stats) 10%, transparent); }
.cs-dot { background: var(--cs); box-shadow: 0 0 0 6px color-mix(in srgb, var(--cs) 10%, transparent); }

/* Contact dialog */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 220ms ease; }
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal-scrim { position: absolute; inset: 0; border: 0; background: color-mix(in srgb, var(--ink) 22%, transparent); backdrop-filter: blur(14px); }
.modal-panel { position: relative; width: min(500px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper-solid); box-shadow: var(--shadow); text-align: center; transform: translateY(18px) scale(.98); transition: transform 260ms var(--spring); }
.modal.is-open .modal-panel { transform: none; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); font-size: 20px; cursor: pointer; }
.modal-orbit { display: flex; justify-content: center; gap: 7px; margin: 0 auto 25px; }
.modal-orbit i { width: 9px; height: 9px; border-radius: 50%; background: var(--math); }
.modal-orbit i:nth-child(2) { background: var(--stats); }
.modal-orbit i:nth-child(3) { background: var(--cs); }
.modal-panel h2 { margin: 0 0 12px; font-size: 28px; letter-spacing: -.04em; }
.modal-panel p { margin: 0; color: var(--muted); line-height: 1.65; }
.modal-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.modal-action { display: inline-flex; min-height: 38px; align-items: center; padding: 0 15px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); font-size: 12px; cursor: pointer; }

/* Generated article and note pages */
.article-main { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding: calc(var(--header-height) + 28px) 0 96px; }
.article { position: relative; }
.article::before { display: none; }
.back-link { display: inline-flex; align-items: center; min-height: 36px; margin-bottom: 24px; color: var(--muted); font: 10px/1.4 var(--font-mono); letter-spacing: .08em; }
.back-link::before { content: "←"; margin-right: 9px; }
.article-header { padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.article-header .tag { display: inline-block; margin-bottom: 12px; color: var(--muted); font: 700 9px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.article-title-row { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.article-header h1 { min-width: 0; flex: 1 1 auto; max-width: 760px; margin: 0; font-size: clamp(40px, 4vw, 48px); font-weight: 680; letter-spacing: -.045em; line-height: 1.16; overflow-wrap: anywhere; word-break: normal; hyphens: auto; }
.article-header p { max-width: 70ch; margin: 20px 0 0; color: var(--muted); font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
.article-header time { display: inline-block; margin-top: 18px; color: var(--muted); font: 10px/1 var(--font-mono); }
.article-github-button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; }
.article-github-icon { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.article-body { width: min(100%, 70ch); margin-inline: auto; padding-top: 32px; font-size: clamp(17px, 1.35vw, 18px); line-height: 1.8; overflow-wrap: anywhere; }
.article-body h2 { margin: 2.2em 0 .7em; font-size: clamp(26px, 3vw, 32px); font-weight: 650; letter-spacing: -.04em; line-height: 1.2; }
.article-body h2:first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.35em; }
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body li { margin: .45em 0; }
.article-body a { text-decoration: underline; text-decoration-color: var(--math); text-underline-offset: 4px; }
.article-body code { padding: .16em .36em; border-radius: 3px; background: color-mix(in srgb, var(--ink) 7%, transparent); font-family: var(--font-mono); font-size: .88em; }
.article-body pre { max-width: 100%; margin: 28px 0; padding: 22px; overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; line-height: 1.7; overscroll-behavior-inline: contain; }
.article-body pre code { padding: 0; background: none; }
.article-body blockquote { margin: 30px 0; padding-left: 22px; border-left: 2px solid var(--stats); color: var(--muted); }
.article-body img,
.article-body svg { height: auto; }
.article-body table { display: block; max-width: 100%; overflow-x: auto; }
.note-empty-state { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 32px; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.note-empty-index { display: none; }
.note-empty-state h2 { margin: 0 0 8px; }
.note-empty-state p { max-width: 54ch; margin: 0; color: var(--muted); line-height: 1.75; }

.footer { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 clamp(22px, 5vw, 76px); border-top: 1px solid var(--line); color: var(--muted); font: 10px/1 var(--font-mono); letter-spacing: .08em; }

.not-found { position: relative; width: min(560px, calc(100% - 40px)); min-height: 100svh; display: grid; align-content: center; margin: auto; }
.not-found-orbit { position: absolute; top: 20%; right: 4%; width: 150px; height: 86px; border: 1px solid var(--line); border-radius: 50%; transform: rotate(-12deg); }
.not-found-orbit::before, .not-found-orbit::after { content: ""; position: absolute; inset: 10px -6px; border: 1px dashed var(--line); border-radius: 50%; transform: rotate(28deg); }
.not-found-orbit::after { inset: 22px -14px; transform: rotate(-24deg); }
.not-found-orbit i { position: absolute; z-index: 1; width: 10px; height: 10px; border-radius: 50%; background: var(--math); }
.not-found-orbit i:nth-child(1) { top: 7px; left: 22px; }
.not-found-orbit i:nth-child(2) { top: 56px; right: 7px; background: var(--stats); }
.not-found-orbit i:nth-child(3) { bottom: 0; left: 62px; background: var(--cs); }
.not-found .kicker { color: var(--cs); font: 11px/1 var(--font-mono); }
.not-found h1 { margin: 18px 0 34px; font-size: clamp(50px, 10vw, 96px); line-height: .95; letter-spacing: -.07em; }

.reveal-on-scroll { opacity: 0; transform: translateY(28px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal-on-scroll.is-visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .hero-system { width: 100%; height: calc(100svh - 68px); min-height: 600px; margin-top: 68px; }
  .orbit-field { width: 820px; max-width: none; left: 50%; transform: translateX(-50%); }
  .transformer-core { width: min(86vw, 430px); min-height: 218px; padding-inline: 24px; }
  .identity h1 { font-size: clamp(34px, 10vw, 48px); }
  .identity p { max-width: 240px; margin-inline: auto; line-height: 1.6; }
  .hero-note { display: none; }
  .scroll-cue { bottom: 5%; }
  .modal-panel { padding: 38px 24px 30px; }
}

@media (max-width: 760px) {
  :root { --header-height: 104px; }

  .site-header {
    height: var(--header-height);
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 56px 48px;
    align-items: center;
    padding: 0 12px;
  }

  .brand {
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
    gap: 8px;
    font-size: 15px;
  }

  .brand-orbit { flex: 0 0 auto; }

  .site-actions {
    grid-column: 2;
    grid-row: 1;
    gap: 4px;
  }

  .control,
  .glass-control {
    min-width: 44px;
    height: 44px;
    padding-inline: 8px;
  }

  .site-header > .nav {
    width: 100%;
    height: 48px;
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--line);
  }

  .site-header > .nav a {
    min-width: 0;
    min-height: 44px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    font-size: 12px;
    text-align: center;
  }

  .site-header > .nav a::after { bottom: 0; }

  .space-panel:not([data-panel="home"]) {
    padding: calc(var(--header-height) + 40px) 16px 64px;
  }

  .space-panel:not([data-panel="home"]) .section-heading h1 {
    font-size: clamp(32px, 10vw, 36px);
    line-height: 1.12;
  }

  .space-panel:not([data-panel="home"]) .section-heading p:last-child {
    font-size: 15px;
  }

  .topic-panel { padding-block: 8px; }
  .topic-panel > span { display: none; }
  .topic-panel button { min-height: 44px; padding-inline: 12px; }

  .archive-item a {
    min-height: 132px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding-block: 20px;
  }

  .post-visual { width: 32px; height: 32px; align-self: start; }
  .post-visual svg { width: 20px; height: 20px; }
  .archive-item p { display: none; }
  .archive-item h2 { grid-row: 2 / 4; font-size: clamp(21px, 6.6vw, 24px); line-height: 1.22; overflow-wrap: anywhere; }
  .archive-item time { font-size: 9px; }

  .note-category-link {
    min-height: 96px;
    grid-template-columns: 44px minmax(0, 1fr) 20px;
    gap: 14px;
  }

  .note-token { width: 40px; height: 40px; }
  .note-category strong { font-size: clamp(20px, 6vw, 24px); line-height: 1.25; }

  .contact-grid { gap: 0; }
  .contact-card { min-height: 88px; grid-template-columns: 36px minmax(0, 1fr) 20px; gap: 14px; padding-inline: 4px; }

  .article-main {
    width: min(calc(100% - 32px), 760px);
    padding-top: calc(var(--header-height) + 28px);
    padding-bottom: 72px;
  }

  .back-link { min-height: 44px; margin-bottom: 20px; }
  .article-header { padding-bottom: 28px; }
  .article-title-row { display: grid; gap: 16px; }
  .article-header h1 { max-width: 100%; font-size: clamp(28px, 9.5vw, 32px); letter-spacing: -.035em; line-height: 1.18; }
  .article-header p { margin-top: 18px; font-size: 16px; }
  .article-github-button { width: fit-content; min-height: 44px; }
  .article-body { padding-top: 28px; font-size: 16px; line-height: 1.8; }
  .article-body h2 { margin-top: 2em; font-size: clamp(24px, 7.5vw, 28px); }
  .article-body pre { margin-inline: 0; padding: 16px; font-size: 12px; }
  .article-body blockquote { margin-inline: 0; padding-left: 16px; }
  .note-empty-state { margin-top: 28px; padding-block: 24px; }

  .footer { min-height: 96px; flex-wrap: wrap; padding: 20px 16px; }
}

.section-heading,
.article-header { position: relative; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .moving-token { display: none; }
  .static-tokens { display: block; }
}

/* D01: center the complete hero identity stack, including its discipline label. */
body[data-page="home"] .story-panel .system .core {
  grid-template-rows: auto auto;
  align-content: center;
  justify-items: center;
  row-gap: 32px;
  padding-block: 24px;
}

body[data-page="home"] .story-panel .system .core-label {
  position: relative;
  inset: auto;
  grid-row: 1;
  transform: none;
}

body[data-page="home"] .story-panel .system .identity { grid-row: 2; }

/* Remaining modules: long-page structure and generated detail continuity. */
.project-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}

.project-entry {
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
}
.project-entry:last-child { border-right: 0; }
.project-card-link {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 26px 24px 22px;
  color: var(--ink);
}
.project-card-link > :not(.article-transition-surface),
.article-header > :not(.article-transition-surface),
.note-row > :not(.article-transition-surface) { position: relative; z-index: 1; }
.article-transition-surface { position: absolute; inset: 0; z-index: 0; display: block; background: var(--paper-solid); pointer-events: none; }
.note-row { position: relative; }
.note-transition-surface { background: transparent; }
.project-type-row,
.archive-type-row,
.article-type-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font: 700 10px/1.3 var(--font-mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}
.card-type-orb {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 50%;
  background: var(--math);
}
.card-green .card-type-orb,
.card-green.card-type-orb { background: var(--stats); }
.card-coral .card-type-orb,
.card-coral.card-type-orb { background: var(--cs); }
.project-entry h3 { margin: 24px 0 14px; font-size: clamp(22px, 2vw, 27px); line-height: 1.18; letter-spacing: -.035em; }
.project-entry p { margin: 0 0 26px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.project-entry footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; color: var(--muted); font: 10px/1 var(--font-mono); }
.project-entry h3,
.project-entry footer span { transition: color 180ms ease, transform 180ms ease; }
.project-entry:hover h3 { color: var(--math); }
.project-entry.card-green:hover h3 { color: var(--stats); }
.project-entry.card-coral:hover h3 { color: var(--cs); }
.project-entry:hover footer span { transform: translate(2px, -2px); }

.projects-archive-link {
  width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  padding: 0 4px;
  border-block: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-height) + 20px);
  font-weight: 650;
}
.projects-archive-link::before { content: "↳"; width: 20px; color: var(--muted); font: 16px/1 var(--font-mono); }
.projects-archive-link [data-post-count] { margin-left: auto; color: var(--muted); font: 10px/1 var(--font-mono); }
.projects-archive-arrow { color: var(--muted); transition: transform 200ms var(--ease), color 200ms ease; }
.projects-archive-link:hover .projects-archive-arrow,
.projects-archive-link:focus-visible .projects-archive-arrow { color: var(--ink); transform: translate(3px, -3px); }

.blog-main {
  width: min(1120px, calc(100% - 44px));
  min-height: calc(100svh - 84px);
  margin: 0 auto;
  padding: calc(var(--header-height) + 64px) 0 104px;
}
.blog-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  gap: 18px 56px;
  align-items: end;
  padding-bottom: 42px;
  border-bottom: 1px solid var(--line);
}
.blog-kicker {
  grid-column: 1 / -1;
  color: var(--muted);
  font: 10px/1.4 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.blog-intro h1 { margin: 0; font-size: clamp(48px, 7vw, 86px); font-weight: 680; letter-spacing: -.065em; line-height: .98; }
.blog-intro p { max-width: 52ch; margin: 0 0 6px; color: var(--muted); font-size: 15px; line-height: 1.75; }
.blog-archive { padding-top: 22px; }
.archive-tools { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.blog-main .archive-tools { min-height: 64px; padding: 10px 0 18px; border-top: 0; }
.archive-tools .topic-panel { position: static; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; border: 0; background: none; backdrop-filter: none; }
.archive-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 14px; }
.archive-actions > a,
.archive-actions > button { min-height: 34px; padding: 0; border: 0; background: none; color: var(--muted); font: 10px/1 var(--font-mono); cursor: pointer; }
.archive-actions > a:hover,
.archive-actions > button:hover { color: var(--ink); }
.archive-list { width: 100%; display: block; border-top: 1px solid var(--line); font-family: var(--font-body); letter-spacing: normal; text-transform: none; }
.archive-item { border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.archive-item > a { width: 100%; min-height: 142px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; padding: 24px 4px; color: var(--ink); font-family: var(--font-body); letter-spacing: normal; text-transform: none; }
.archive-item > a { position: relative; }
.archive-item > a > :not(.article-transition-surface) { position: relative; z-index: 1; }
.archive-type-row { grid-column: 1; }
.archive-item h2 { grid-column: 1; margin: 0; font-size: clamp(21px, 2vw, 26px); line-height: 1.2; letter-spacing: -.03em; }
.archive-item p { grid-column: 1; max-width: 70ch; margin: 0; color: var(--muted); line-height: 1.65; }
.archive-item h2,
.archive-item p { text-transform: none; }
.archive-item time { grid-column: 2; grid-row: 1; color: var(--muted); font: 10px/1 var(--font-mono); }
.archive-entry-arrow { grid-column: 2; grid-row: 2 / 4; align-self: center; color: var(--muted); }

[data-content-figure] svg { fill: none; stroke: currentColor; }
.focus-path .content-figure { width: 76px; height: 42px; margin-bottom: 14px; color: var(--muted); }
.project-figures { display: flex; align-items: center; gap: 12px; margin-left: auto; color: var(--muted); opacity: .72; }
.project-process-figure { margin: 0; display: grid; justify-items: center; gap: 4px; }
.project-process-figure svg { width: 58px; height: 42px; }
.project-process-figure figcaption { color: var(--muted); font: 8px/1 var(--font-mono); letter-spacing: .04em; }
.note-index-figure { width: 42px; height: 38px; color: var(--muted); opacity: .65; }
.contact-route { position: relative; width: min(260px, 30vw); min-height: 112px; margin-left: auto; color: var(--muted); }
.contact-route > svg { width: 100%; height: 88px; }
.contact-sphere-dock { position: absolute; top: 18px; left: 18px; display: flex; align-items: center; gap: 8px; }
.contact-sphere-dock .sphere-slot { position: relative; width: 16px; height: 16px; display: block; border-radius: 50%; }
.contact-links { grid-column: 1 / -1; }

.reveal-ready .is-reveal-pending { opacity: .55; transform: translateY(10px); }
.reveal-ready .reveal-item { transition: opacity 420ms ease, transform 420ms ease; }
.reveal-ready .is-visible { opacity: 1; transform: none; }

.article-header[data-article-surface] { position: relative; contain: layout paint; }
.article-type-row { margin-bottom: 18px; }
.article-type-row time { margin: 0 0 0 auto; }
.article-type-orb { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; background: var(--math); }
.article-type-orb.card-green { background: var(--stats); }
.article-type-orb.card-coral { background: var(--cs); }
.article-body-section { min-width: 0; }
.compat-main { min-height: 100svh; display: grid; place-items: center; padding: 32px; }

@media (max-width: 760px) {
  .project-ledger { grid-template-columns: 1fr; }
  .project-entry { border-right: 0; border-bottom: 1px solid var(--line); }
  .project-entry:last-child { border-bottom: 0; }
  .project-card-link { padding: 24px 4px; }
  .project-figures { display: none; }
  .projects-archive-link { min-height: 62px; gap: 10px; }
  .blog-main { width: min(100% - 28px, 680px); padding: calc(var(--header-height) + 36px) 0 72px; }
  .blog-intro { grid-template-columns: 1fr; gap: 18px; padding-bottom: 30px; }
  .blog-kicker { grid-column: 1; }
  .blog-intro h1 { font-size: clamp(44px, 14vw, 62px); }
  .blog-intro p { margin: 0; font-size: 14px; }
  .blog-archive { padding-top: 12px; }
  .archive-tools { align-items: flex-start; flex-wrap: wrap; }
  .archive-tools .topic-panel { width: 100%; }
  .archive-actions { width: 100%; justify-content: flex-end; }
  .archive-item > a { min-height: 132px; grid-template-columns: minmax(0, 1fr) auto; padding-block: 20px; }
  .archive-item p { display: none; }
  .blog-main .archive-type-row { grid-row: 1; }
  .blog-main .archive-item h2 { grid-row: 2; }
  .blog-main .archive-item p { display: block; font-size: 13px; line-height: 1.6; }
  .blog-main .archive-item p { grid-row: 3; }
  .archive-item h2 { font-size: clamp(21px, 6vw, 24px); }
  .note-index-figure { width: 36px; }
  .contact-route { width: 180px; margin: 8px 0 14px; }
  .reveal-ready .is-reveal-pending { transform: translateY(6px); }
}

@media (max-width: 760px) {
  body[data-page="home"] .story-panel .system .core {
    row-gap: 22px;
    padding-block: 22px;
  }
}
