/* Layout idea: six pages routed by hash. The home page carries the one loud element, a live core power map;
   inner pages are a big condensed title over quiet left-aligned content. Motion: page entrances, the core map,
   and a few moments that answer the pointer or the scroll. */
:root {
  --paper: #EDF1F3;
  --surface: #F8FAFB;
  --ink: #0B2030;
  --muted: #4A6070;
  --line: #C6D1D9;
  --mono: #C2CED7;       /* core block */
  --accent: #0B5FD8;      /* Cherenkov blue */
  --heat: #C97F00;        /* control rod / failure marker */
  --flux-lo: #DCE6EE;
  --flux-mid: #5B9BEA;
  --flux-hi: #0A2E6E;
  --display: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #071A26; --surface: #0C2535; --ink: #E6F0F6; --muted: #93ABBA; --line: #1E3D50; --mono: #17384B;
    --accent: #5CB6FF; --heat: #F5B43C; --flux-lo: #11304A; --flux-mid: #1F7AE0; --flux-hi: #C4ECFF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #071A26; --surface: #0C2535; --ink: #E6F0F6; --muted: #93ABBA; --line: #1E3D50; --mono: #17384B;
  --accent: #5CB6FF; --heat: #F5B43C; --flux-lo: #11304A; --flux-mid: #1F7AE0; --flux-hi: #C4ECFF;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
p { margin: 0; max-width: 64ch; }
ul, ol, dl, dd, figure { margin: 0; padding: 0; }
li { list-style: none; }

/* Background: blueprint of a generic microreactor unit, hexagonal lattice and a low horizon glow */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; color: var(--accent); }
.bg svg { display: block; width: 100%; height: 100%; transform: translateY(calc(var(--scroll, 0) * -36px)) scale(1.08); transform-origin: 50% 0; }
.bg-orbit { transform-origin: 250px 760px; animation: orbit 160s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
main, footer { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .bg-orbit { animation: none; } .bg svg { transform: scale(1.08); } }
@media (max-width: 700px) { .bg-unit, .bg-orbit { opacity: 0.18; } }

/* Scroll progress */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 10; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--scroll, 0)); }

/* Top bar */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 2rem;
  padding: 0.75rem var(--gutter) 0.6rem;
  background: color-mix(in srgb, var(--paper) 84%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.top-name { font-family: var(--display); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.02em; color: var(--ink); text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.4rem; font-size: 0.95rem; }
.top nav a { position: relative; color: var(--ink); text-decoration: none; padding: 0.15rem 0 0.3rem; }
.top nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.35s var(--ease); }
.top nav a:hover::after, .top nav a[aria-current="page"]::after { transform: scaleX(1); }
.top nav a[aria-current="page"] { font-weight: 600; }

/* Pages */
.page { padding: 0 var(--gutter) clamp(3rem, 7vw, 6rem); }
.js .page[hidden] { display: none; }
.page + .page { border-top: 1px solid var(--line); }
.js .page + .page { border-top: 0; }
.page-head { padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(1.5rem, 4vw, 3rem); }
.page-head h1 { font-weight: 800; font-size: clamp(3.4rem, 10vw, 8.5rem); line-height: 0.86; text-transform: uppercase; }
.page-head p { margin-top: 1.25rem; font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.45; max-width: 48ch; color: var(--muted); }
.block { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.25rem clamp(1.5rem, 4vw, 4rem); padding: clamp(1.75rem, 4vw, 3rem) 0; border-top: 1px solid var(--line); }
.block > h2 { font-weight: 700; font-size: clamp(1.7rem, 2.6vw, 2.2rem); line-height: 1.05; }
.stack { display: grid; gap: 1.1rem; min-width: 0; }

@keyframes rise { from { opacity: 0; transform: translateY(1.4rem); } to { opacity: 1; transform: none; } }
@keyframes letter { from { transform: translateY(105%); } to { transform: none; } }
@keyframes wipe { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.js .page:not([hidden]) [data-in] { animation: rise 0.75s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 80ms); }

/* Home hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 2rem clamp(1.5rem, 5vw, 5rem); align-items: center; padding: clamp(2rem, 6vw, 5rem) 0 clamp(2rem, 5vw, 4rem); }
.hero h1 { font-weight: 800; font-size: clamp(3.6rem, 11.5vw, 11.5rem); line-height: 0.86; letter-spacing: -0.005em; text-transform: uppercase; }
.hero h1 .ln { display: block; overflow: hidden; padding-top: 0.04em; white-space: nowrap; }
.hero h1 .ch { display: inline-block; }
.js .page:not([hidden]) .hero h1 .ch { animation: letter 0.9s var(--ease) backwards; animation-delay: calc(var(--c, 0) * 45ms); }
.hero-lede { margin-top: 1.75rem; font-size: clamp(1.15rem, 1.6vw, 1.4rem); line-height: 1.45; max-width: 34ch; }
.hero-role { margin-top: 1rem; color: var(--muted); max-width: 42ch; }
.actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn { display: inline-block; padding: 0.65rem 1.1rem; border-radius: 3px; font-weight: 600; font-size: 0.98rem; text-decoration: none; border: 1.5px solid var(--ink); color: var(--ink); transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.btn-solid:hover { background: var(--accent); }

.core { min-width: 0; }
.core canvas { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; touch-action: none; cursor: crosshair; }
.core-read { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 1.5rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--line); font-size: 0.92rem; color: var(--muted); }
.core-read strong { font-family: var(--display); font-weight: 700; font-size: 1.7rem; color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 0.4rem; }
.scale { display: flex; align-items: center; gap: 0.5rem; }
.scale i { display: block; width: 6.5rem; height: 0.55rem; border-radius: 1px; background: linear-gradient(90deg, var(--flux-lo), var(--flux-mid), var(--flux-hi)); }
.core-read span { display: grid; }
.core-read strong { margin-left: 0; }
.bank { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; margin-top: 0.9rem; font-size: 0.95rem; }
.bank input { flex: 1 1 9rem; min-width: 0; accent-color: var(--heat); }
.bank output { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 8.5rem; }
.legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; margin-top: 0.7rem; font-size: 0.88rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 0.4rem; }
.legend i { display: block; width: 0.85rem; height: 0.85rem; border-radius: 50%; }
.lg-fuel { background: linear-gradient(90deg, var(--flux-lo), var(--flux-mid), var(--flux-hi)); width: 2.2rem !important; border-radius: 999px !important; }
.lg-hp { background: var(--paper); border: 1.5px solid var(--muted); }
.lg-rod { background: var(--heat); }
.lg-refl { background: var(--flux-mid); opacity: 0.6; }
.block.wide { grid-template-columns: minmax(0, 1fr); }
.demo-lede { max-width: 72ch; }
.demos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 0.5rem; }
.demo { display: grid; gap: 0.8rem; align-content: start; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: clamp(1rem, 2vw, 1.5rem); }
.demo h3 { font-weight: 700; font-size: 1.7rem; line-height: 1; }
.demo canvas { display: block; width: 100%; height: auto; aspect-ratio: 20 / 13; background: var(--paper); border-radius: 2px; }
.demo figcaption, .det-key { font-size: 0.93rem; color: var(--muted); }
.demo .btn { justify-self: start; cursor: pointer; background: transparent; font-family: inherit; }
.demo.map { grid-column: 1 / -1; grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); column-gap: clamp(1rem, 3vw, 2.5rem); align-items: start; }
.demo.map h3 { grid-column: 1 / -1; }
.demo.duo { grid-column: 1 / -1; }
.duo-plots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.duo-plots > div { display: grid; gap: 0.5rem; align-content: start; min-width: 0; }
.plot-t { font-weight: 600; font-size: 1rem; }
.demo.map canvas { aspect-ratio: 38 / 34; }
.map-side { display: grid; gap: 1rem; align-content: start; }
.map-read { display: grid; gap: 0; }
.map-read div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-top: 1px solid var(--line); }
.map-read dt { color: var(--muted); font-size: 0.93rem; }
.map-read dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.map-state { font-size: 0.93rem; font-weight: 600; }
.map-state.bad { color: var(--heat); }
.map-btns { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.linkbtn { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.15em; }
@media (max-width: 760px) { .demo.map, .duo-plots { grid-template-columns: minmax(0, 1fr); } }
.det-key { display: grid; gap: 0.25rem; counter-reset: ev; }
.det-key li { counter-increment: ev; position: relative; padding-left: 1.9rem; }
.det-key li::before { content: counter(ev); position: absolute; left: 0; top: 0.1rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 1.5px solid var(--ink); color: var(--ink); font-size: 0.78rem; font-weight: 600; display: grid; place-items: center; }
.det-leaves { display: grid; gap: 0; font-size: 0.93rem; }
.det-leaves li { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 0.1rem 0.8rem; padding: 0.45rem 0 0.45rem 0.7rem; border-top: 1px solid var(--line); border-left: 3px solid var(--accent); }
.det-leaves li.bad { border-left-color: var(--heat); }
.det-leaves b { font-weight: 600; font-variant-numeric: tabular-nums; grid-row: span 2; }
.det-leaves em { font-style: normal; color: var(--muted); }
.note { margin-top: 0.5rem; font-size: 0.88rem; color: var(--muted); }

/* Home: figures and doors */
.figures { display: flex; flex-wrap: wrap; gap: 1.5rem clamp(2rem, 5vw, 4.5rem); padding: clamp(1.5rem, 3vw, 2.5rem) 0; border-top: 1px solid var(--line); }
.figures div { display: grid; }
.figures dt { order: 2; color: var(--muted); font-size: 0.95rem; max-width: 16ch; }
.figures dd, .counts dd { font-family: var(--display); font-weight: 800; font-size: clamp(3rem, 6vw, 4.75rem); line-height: 0.95; font-variant-numeric: tabular-nums; }
.doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; padding-top: clamp(1.5rem, 3vw, 2.5rem); border-top: 1px solid var(--line); }
.door { position: relative; overflow: hidden; display: grid; gap: 0.6rem; align-content: start; padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; color: var(--ink); text-decoration: none; transition: transform 0.35s var(--ease), border-color 0.35s; }
.door:hover { transform: translateY(-4px); border-color: var(--accent); }
.door h2 { font-weight: 700; font-size: 1.9rem; line-height: 1; }
.door span { color: var(--muted); font-size: 0.97rem; }
.door em { font-style: normal; font-weight: 600; color: var(--accent); font-size: 0.95rem; margin-top: 0.4rem; }

/* Pointer spotlight on cards */
.glow { position: relative; isolation: isolate; }
.glow::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.4s; pointer-events: none;
  background: radial-gradient(22rem circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }
.glow:hover::before { opacity: 1; }

/* About */
.who { display: flow-root; }
.who .stack { display: block; }
.who .stack p { max-width: none; }
.who .stack p + p { margin-top: 1.1rem; }
.portrait { display: block; float: right; width: min(17rem, 42%); margin: 0.35rem 0 1.2rem clamp(1.5rem, 3.5vw, 2.5rem); shape-outside: margin-box; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; border-radius: 4px; border: 1px solid var(--line); }
@media (max-width: 560px) { .portrait { float: none; width: 100%; max-width: 15rem; margin: 0 0 1.3rem; } }

.fields { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.fields li { padding: 0.3rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.93rem; background: var(--surface); transition: border-color 0.25s, transform 0.25s var(--ease); }
.fields li:hover { border-color: var(--accent); transform: translateY(-2px); }
.edu { display: grid; gap: 1.5rem; }
.edu h3, .job h3, .item h3 { font-family: var(--body); font-weight: 600; font-size: 1.1rem; line-height: 1.35; }
.org { color: var(--muted); }
.edu p { margin-top: 0.3rem; color: var(--muted); font-size: 0.97rem; }
.awards { width: 100%; max-width: 46rem; border-collapse: collapse; font-size: 0.98rem; }
.awards th, .awards td { text-align: left; vertical-align: top; padding: 0.55rem 0; border-top: 1px solid var(--line); font-weight: 400; }
.awards tr:first-child th, .awards tr:first-child td { border-top: 0; }
.awards th { width: 4.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.points { display: grid; gap: 0.4rem; max-width: 66ch; }
.points li { position: relative; padding-left: 1.1rem; }
.points li::before { content: ""; position: absolute; left: 0; top: 0.68em; width: 0.45rem; height: 2px; background: var(--accent); }

/* Career timeline */
.career { position: relative; display: grid; gap: clamp(2rem, 4vw, 3.25rem); padding: clamp(1.5rem, 3vw, 2.5rem) 0 0 clamp(1.5rem, 3vw, 2.5rem); border-top: 1px solid var(--line); }
.career::before, .career::after { content: ""; position: absolute; left: 0; top: clamp(1.5rem, 3vw, 2.5rem); bottom: 0; width: 2px; }
.career::before { background: var(--line); }
.career::after { background: var(--accent); transform-origin: 50% 0; transform: scaleY(var(--p, 1)); }
.job { position: relative; display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.5rem 2rem; }
.job::before { content: ""; position: absolute; left: calc(-1 * clamp(1.5rem, 3vw, 2.5rem) - 5px); top: 0.55rem; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); z-index: 1; }
.when { font-family: var(--display); font-weight: 700; font-size: 1.6rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.job .points { margin-top: 0.7rem; }
.job p { margin-top: 0.6rem; }
.context { margin-top: 0.8rem; padding: 0.9rem 1.1rem; background: var(--surface); border-left: 3px solid var(--accent); border-radius: 0 3px 3px 0; font-size: 0.97rem; max-width: 66ch; }

/* Software */
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.code { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: clamp(1.25rem, 2.5vw, 2rem); display: grid; gap: 1rem; align-content: start; min-width: 0; overflow: hidden; }
.code h2 { font-weight: 800; font-size: clamp(2.8rem, 5.5vw, 4.5rem); line-height: 0.9; letter-spacing: 0.01em; }
.expand { color: var(--muted); font-size: 0.95rem; margin-top: 0.4rem; }
.kernels, .also { display: grid; gap: 0; font-size: 0.97rem; }
.kernels li, .also li { display: grid; grid-template-columns: 6.4rem minmax(0, 1fr); gap: 0.75rem; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.kernels b, .also b { font-weight: 600; }
.also { max-width: 48rem; }
.limit canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); }
.limit figcaption { margin-top: 0.5rem; font-size: 0.88rem; color: var(--muted); }
.key { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin: 0 0.3rem 0 0.6rem; }
.key-ok { background: var(--accent); }
.key-fail { background: var(--heat); }

/* Research */
.counts { display: flex; flex-wrap: wrap; gap: 1.25rem 3rem; }
.counts div { display: grid; }
.counts dt { order: 2; color: var(--muted); font-size: 0.95rem; }
.metrics { width: 100%; max-width: 30rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.metrics th, .metrics td { text-align: right; padding: 0.5rem 0; border-top: 1px solid var(--line); font-weight: 400; }
.metrics th:first-child, .metrics td:first-child { text-align: left; }
.metrics thead th { border-top: 0; color: var(--muted); font-size: 0.93rem; }
.metrics tbody td:not(:first-child) { font-weight: 600; }
.metrics caption { caption-side: bottom; text-align: left; margin-top: 0.4rem; color: var(--muted); font-size: 0.88rem; }
.papers { display: grid; gap: 0; max-width: 52rem; }
.item { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 0.25rem 1rem; padding: 0.95rem 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 0; }
.item .yr { font-family: var(--display); font-weight: 700; font-size: 1.35rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.item p { color: var(--muted); font-size: 0.95rem; margin-top: 0.15rem; }
.profiles { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Publications */
.pubbar { display: grid; gap: 0.9rem; padding: 1.25rem 0 1.5rem; border-top: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { font: inherit; font-size: 0.95rem; padding: 0.4rem 0.85rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.chip b { font-weight: 600; color: var(--muted); margin-left: 0.25rem; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip[aria-pressed="true"] b { color: var(--paper); }
.search { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-size: 0.95rem; color: var(--muted); }
.search input { font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 3px; padding: 0.45rem 0.7rem; width: min(100%, 24rem); }
.search input:focus { border-color: var(--accent); outline: none; }
.jump { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.pubbar .note { margin: 0; }
.yg { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 0.75rem clamp(1rem, 3vw, 3rem); padding: clamp(1.25rem, 3vw, 2rem) 0; border-top: 1px solid var(--line); scroll-margin-top: 4.5rem; }
.yg[hidden] { display: none; }
.yg > h2 { font-weight: 800; font-size: clamp(2.4rem, 4.5vw, 3.6rem); line-height: 0.95; font-variant-numeric: tabular-nums; }
.yg > h2 span { display: block; font-family: var(--body); font-weight: 400; font-size: 0.9rem; line-height: 1.6; color: var(--muted); }
.publist { display: grid; gap: 0; min-width: 0; }
.pub { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.2rem 1rem; padding: 0.8rem 0; border-top: 1px solid var(--line); }
.pub[hidden] { display: none; }
.publist .pub:first-child { border-top: 0; padding-top: 0.2rem; }
.kind { font-size: 0.88rem; color: var(--muted); padding-top: 0.15rem; }
.pub[data-g="j"] .kind { color: var(--accent); font-weight: 600; }
.pub h3 { font-family: var(--body); font-weight: 600; font-size: 1.02rem; line-height: 1.4; }
.pub p { color: var(--muted); font-size: 0.93rem; margin-top: 0.15rem; max-width: 80ch; }
.dl { display: inline-block; margin-top: 0.45rem; padding: 0.22rem 0.7rem; border: 1.5px solid var(--accent); border-radius: 999px; font-size: 0.86rem; font-weight: 600; color: var(--accent); text-decoration: none; transition: background 0.2s, color 0.2s; }
.dl:hover { background: var(--accent); color: var(--paper); }
.pubsrc { padding-top: 1.5rem; border-top: 1px solid var(--line); max-width: 70ch; }

/* Contact */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem 3rem; padding: clamp(1.5rem, 3vw, 2.5rem) 0; border-top: 1px solid var(--line); }
.contact h2 { font-family: var(--body); font-weight: 600; font-size: 1rem; color: var(--muted); margin-bottom: 0.3rem; }
.contact address { font-style: normal; margin-top: 0.4rem; }
.mail { font-size: 1.2rem; font-weight: 500; overflow-wrap: anywhere; }
.elsewhere { display: grid; gap: 0.35rem; }

footer { padding: 2rem var(--gutter) 3rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; color: var(--muted); font-size: 0.93rem; }
footer q { font-style: italic; color: var(--ink); }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .core { max-width: 30rem; }
  .block { grid-template-columns: minmax(0, 1fr); }
  .codes, .doors, .demos { grid-template-columns: minmax(0, 1fr); }
  .job { grid-template-columns: minmax(0, 1fr); }
  .yg { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .kernels li, .also li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .item { grid-template-columns: minmax(0, 1fr); }
  .pub { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .js .page:not([hidden]) [data-in], .js .page:not([hidden]) .hero h1 .ch { animation: none; }
  .btn, .door, .fields li, .top nav a::after { transition: none; }
  .btn:hover, .door:hover, .fields li:hover { transform: none; }
}
.btn-quiet { border-color: transparent; text-decoration: underline; text-underline-offset: 0.25em; }
.acts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.45rem; }
.acts .dl { margin-top: 0; }
button.dl { font: inherit; font-size: 0.86rem; font-weight: 600; background: transparent; cursor: pointer; }
.cite { border-color: var(--line); color: var(--muted); }
.cite:hover, .cite[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.bib { margin-top: 0.6rem; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); max-width: 80ch; }
.bib pre { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.8rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.bib button { margin-top: 0.6rem; }
.selected { margin: 0 0 clamp(2.5rem, 6vw, 4rem); padding: clamp(1.2rem, 3vw, 2rem); border: 1.5px solid var(--ink); border-radius: 3px; background: var(--surface); }
.selected h2 { font-weight: 800; font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1; text-transform: uppercase; margin-bottom: 1rem; }
.pub .why { color: var(--ink); font-size: 0.98rem; margin-top: 0.35rem; }
.archive-h { font-weight: 800; font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1; text-transform: uppercase; margin-bottom: 1.2rem; }
.archive-h span { display: block; margin-top: 0.5rem; font-family: var(--body); font-weight: 400; font-size: 1rem; line-height: 1.4; text-transform: none; color: var(--muted); }
.cvrow { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
@media (max-width: 480px) { .page-head h1 { font-size: 12vw; } }
.selected, .yg, .archive-h { scroll-margin-top: 6.5rem; }
.msg { max-width: 46rem; padding: clamp(1.2rem, 3vw, 2rem); margin-bottom: clamp(1.5rem, 4vw, 2.5rem); border: 1.5px solid var(--ink); border-radius: 3px; background: var(--surface); }
.msg h2 { font-weight: 800; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1; text-transform: uppercase; }
.msg-note { color: var(--muted); margin: 0.5rem 0 1.2rem; }
.msg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 1.2rem; }
.msg label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 1rem; }
.msg input[type="text"], .msg input[type="email"], .msg textarea { display: block; width: 100%; margin-top: 0.35rem; padding: 0.65rem 0.75rem; font: inherit; font-weight: 400; font-size: 1rem; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 3px; }
.msg textarea { resize: vertical; min-height: 9rem; }
.msg input:focus-visible, .msg textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.msg .bad { border-color: #b3261e; }
.msg .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.msg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.2rem; }
.msg-foot button { cursor: pointer; font: inherit; font-weight: 600; }
.msg-foot button[disabled] { opacity: 0.6; cursor: default; }
.msg-status { flex: 1 1 14rem; font-size: 0.95rem; }
.msg-status.err { color: #b3261e; }
.disclaimer { margin-top: 0.9rem; padding: 0.7rem 0.9rem; border: 1px solid var(--heat); border-left-width: 5px; border-radius: 3px; background: color-mix(in srgb, var(--heat) 10%, var(--surface)); color: var(--ink); font-size: 0.95rem; line-height: 1.45; max-width: 72ch; }
.disclaimer b { font-weight: 700; }
.disclaimer.wide-d { margin: 1.1rem 0 0.4rem; font-size: 1rem; }

/* Text written in Markdown, or any plain text block: add class="prose" to its container. */
.prose ul, .prose ol { padding-left: 1.3rem; display: grid; gap: 0.35rem; }
.prose ul > li { list-style: disc; }
.prose ol > li { list-style: decimal; }
.prose h3 { font-weight: 600; font-size: 1.15rem; margin-top: 0.4rem; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; }
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { text-align: left; padding: 0.45rem 0.7rem 0.45rem 0; border-bottom: 1px solid var(--line); }
.prose img { max-width: 100%; height: auto; }
.prose code { font-size: 0.92em; background: var(--surface); padding: 0.1em 0.3em; border-radius: 3px; }

/* Input sliders under the demos. */
.ctls { display: grid; gap: 0.55rem; padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.ctls-t { font-weight: 600; font-size: 0.95rem; }
.ctl { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) 4.6rem; gap: 0.75rem; align-items: center; font-size: 0.95rem; }
.ctl input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 1.75rem; }
.ctl output { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 560px) { .ctl { grid-template-columns: minmax(0, 1fr) 4.6rem; } .ctl label { grid-column: 1 / -1; } }
