/* ============================================================
   NIGHT NOTEBOOK
   a lab notebook read by lamplight: blueprint grid, one amber
   glow, one cyan ink, serif display, a handwriting margin.
   ============================================================ */

:root {
  --ink: #0D0F14;                          /* page ground */
  --panel: #151821;                        /* taped-in cards */
  --panel-deep: #0B0D11;                   /* film stock behind photos */
  --sprocket: #262A35;
  --glow: #FFB547;                         /* the one accent: amber lamp */
  --glow-soft: rgba(255, 181, 71, 0.35);
  --cyan: #8FD3E8;                         /* blueprint ink */
  --cyan-soft: rgba(143, 211, 232, 0.18);
  --paper: #F7F2E8;                        /* display text */
  --bright: #F2EEE6;
  --text: #E4DFD4;                         /* body */
  --lede: #D6D1C6;
  --soft: #C9C4B9;
  --muted: #B3AFA6;
  --dim: #A6A299;
  --faint: #8E8A82;
  --line: rgba(236, 231, 220, 0.18);
  --line-soft: rgba(236, 231, 220, 0.14);
  --tape: rgba(236, 231, 220, 0.16);
  --grid: rgba(143, 211, 232, 0.05);
  --display: "Bodoni Moda", Didot, "Times New Roman", serif;
  --hand: "Kalam", "Comic Sans MS", cursive;
  --body: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; background: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--ink);
  background-image:
    radial-gradient(1200px 900px at 8% 0, rgba(255, 181, 71, 0.13), transparent 70%),
    radial-gradient(900px 700px at 95% 260px, rgba(143, 211, 232, 0.10), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-repeat: no-repeat, no-repeat, repeat, repeat;
  background-size: 100% 100%, 100% 100%, 24px 24px, 24px 24px;
  color: var(--text);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { max-width: 100%; }

a {
  color: #ECE7DC;
  text-decoration-color: rgba(255, 181, 71, 0.6);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}
a:hover { color: var(--glow); }

:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 4px;
}

::selection { background: rgba(255, 181, 71, 0.35); color: var(--paper); }

.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: 1rem; top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--glow);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
}
.skip:focus { top: 1rem; color: var(--ink); }

/* ---------- the margin rule ---------- */
/* a single glowing pencil line down the left edge, like a notebook margin */
.nb-margin {
  position: absolute;
  top: 0; bottom: 0;
  left: 56px;
  width: 1px;
  background: var(--glow-soft);
  box-shadow: 0 0 12px var(--glow-soft);
  pointer-events: none;
}
@media (max-width: 1199px) { .nb-margin { left: 12px; } }

/* ---------- page shell ---------- */
.nb-page {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px clamp(24px, 5vw, 88px) 120px;
}
.nb-page--narrow { max-width: 1180px; }
main { display: flex; flex-direction: column; gap: clamp(88px, 10vw, 132px); }

/* ---------- shared type ---------- */
.nb-hand { font-family: var(--hand); }
.nb-kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--glow);
}
.nb-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}
.nb-h2 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(44px, 6vw, 60px);
  line-height: 1;
  color: var(--paper);
}
/* handwritten margin note, tilted, lit by the lamp */
.nb-aside {
  align-self: flex-start;
  font-family: var(--hand);
  font-size: 20px;
  line-height: 1.3;
  color: var(--glow);
  text-shadow: 0 0 14px rgba(255, 181, 71, 0.3);
  transform: rotate(-2deg);
}

/* ---------- buttons ---------- */
.nb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  background: var(--glow);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 0 30px var(--glow-soft);
}
.nb-btn:hover { color: var(--ink); background: #FFC56E; box-shadow: 0 0 40px rgba(255, 181, 71, 0.5); }

/* ---------- top strip ---------- */
.nb-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.nb-top__where, .nb-top__who { display: flex; flex-direction: column; gap: 2px; }
.nb-top__who { text-align: right; }
.nb-top__clock { color: var(--glow); }
.nb-top__name { color: var(--cyan); }
.nb-top__nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; }
.nb-top__nav a,
.nb-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--dim);
  text-decoration: none;
}
.nb-top__nav a:hover,
.nb-back:hover { color: var(--glow); text-shadow: 0 0 12px rgba(255, 181, 71, 0.6); }
@media (max-width: 720px) {
  .nb-top { flex-direction: column; align-items: flex-start; }
  .nb-top__who { order: -1; text-align: left; }
}

/* ---------- hero ---------- */
.nb-hero { display: flex; flex-direction: column; gap: 56px; margin-top: 64px; }
.nb-hero__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr));
  gap: 56px;
  align-items: center;
}
.nb-hero__copy { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.nb-hero__kicker {
  align-self: flex-start;
  font-size: 22px;
  color: var(--glow);
  text-shadow: 0 0 16px var(--glow-soft);
  transform: rotate(-3deg);
}
.nb-hero__name {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(80px, 11.5vw, 176px);
  line-height: 0.88;
  letter-spacing: -0.03em;
  color: var(--paper);
  text-shadow: 0 0 40px rgba(255, 181, 71, 0.3), 0 0 110px rgba(255, 181, 71, 0.14);
}
.nb-hero__tagline { position: relative; align-self: flex-start; }
.nb-hero__tagline p {
  font-family: var(--hand);
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.2;
  color: var(--bright);
}
.nb-hero__tagline svg {
  position: absolute;
  left: 0; bottom: -14px;
  width: 100%;
  height: 14px;
  overflow: visible;
}
.nb-hero__tagline path {
  fill: none;
  stroke: var(--glow);
  stroke-width: 2.6;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(255, 181, 71, 0.6));
}
.nb-hero__intro {
  margin-top: 10px;
  max-width: 31em;
  font-size: 20px;
  font-weight: 300;
  color: var(--lede);
}
.nb-hero__intro strong { font-weight: 600; color: var(--bright); }
.nb-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.nb-hero__flip {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 6px;
  font-size: 22px;
  color: var(--cyan);
  text-decoration: none;
}
.nb-hero__flip:hover { color: var(--glow); }

/* the two blueprint sketches, taped in at a slant */
.nb-hero__figs { display: flex; flex-direction: column; position: relative; min-width: 0; }
.nb-fig { position: relative; display: flex; flex-direction: column; gap: 12px; }
.nb-fig--hw { width: 88%; align-self: flex-start; }
.nb-fig--sw { width: 84%; align-self: flex-end; margin-top: 40px; }
@media (max-width: 560px) { .nb-fig--hw, .nb-fig--sw { width: 100%; } }
.nb-fig__card {
  padding: 22px 22px 14px;
  background: var(--panel);
  border: 1px solid var(--cyan-soft);
  box-shadow: var(--shadow);
}
.nb-fig--hw .nb-fig__card { transform: rotate(-1.2deg); }
.nb-fig--sw .nb-fig__card { transform: rotate(1.4deg); }
.nb-fig__card svg { display: block; width: 100%; height: auto; }
.nb-fig figcaption {
  padding-left: 12px;
  font-family: var(--hand);
  font-size: 18px;
  color: var(--dim);
  transform: rotate(-1deg);
}
.nb-tape {
  position: absolute;
  z-index: 2;
  top: -14px;
  width: 120px;
  height: 30px;
  background: var(--tape);
}
.nb-fig--hw .nb-tape { right: 30%; transform: rotate(5deg); }
.nb-fig--sw .nb-tape { left: 38%; transform: rotate(-4deg); }

.nb-ink { fill: none; stroke: var(--cyan); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 3px rgba(143, 211, 232, 0.5)); }
.nb-glow-ink { fill: none; stroke: var(--glow); stroke-width: 1.4; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(255, 181, 71, 0.5)); }
.nb-svg-note { fill: var(--glow); font-family: var(--hand); font-size: 17px; }
.nb-svg-title { fill: var(--bright); font-family: var(--hand); font-size: 20px; font-weight: 700; }
.nb-rotor, .nb-lock { transform-box: fill-box; transform-origin: center; }
.nb-lock { transform: scale(1.25); opacity: 0.45; }
.nb-core { opacity: 0.2; }
.nb-loop { transform-origin: 372px 172px; }

/* start → finish route line under the hero */
.nb-route { display: flex; flex-direction: column; gap: 6px; }
.nb-route__line { position: relative; }
.nb-route svg { display: block; width: 100%; height: 96px; overflow: visible; }
.nb-route__path { fill: none; stroke: rgba(236, 231, 220, 0.5); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 10; vector-effect: non-scaling-stroke; }
/* the end dots sit outside the stretched svg so they stay round at any width */
.nb-route__dot { position: absolute; width: 16px; height: 16px; border-radius: 50%; transform: translate(-50%, -50%); }
.nb-route__dot--start { left: 1.17%; top: 70.9%; background: var(--glow); box-shadow: 0 0 10px rgba(255, 181, 71, 0.9); }
.nb-route__dot--end { left: 98.83%; top: 60%; background: var(--cyan); box-shadow: 0 0 10px rgba(143, 211, 232, 0.9); }
.nb-route__labels { display: flex; justify-content: space-between; gap: 16px; font-family: var(--hand); font-size: 20px; }
.nb-route__labels :first-child { color: var(--glow); }
.nb-route__labels :last-child { color: var(--cyan); }

/* ---------- chapters ---------- */
.nb-chapter { display: flex; flex-direction: column; gap: 48px; scroll-margin-top: 24px; }
.nb-chapter__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 28px; }
.nb-chapter__row .nb-aside { align-self: auto; padding-bottom: 6px; }
.nb-chapter__head { display: flex; flex-direction: column; gap: 8px; }
.nb-chapter--split { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 32px 64px; }
.nb-chapter--split > .nb-chapter__head { flex: 1 1 260px; }
.nb-chapter--split > .nb-chapter__body { flex: 3 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.nb-chapter--split .nb-aside { margin-top: 10px; font-size: 19px; }

/* education */
.nb-edu__line { font-size: 28px; line-height: 1.35; font-weight: 300; color: var(--bright); }
.nb-edu__courses { color: var(--muted); }
.nb-edu__note {
  align-self: flex-start;
  font-family: var(--hand);
  font-size: 20px;
  color: var(--cyan);
  transform: rotate(-1.5deg);
}

/* experience: the road */
.nb-road {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding-left: 32px;
  border-left: 1px solid rgba(236, 231, 220, 0.22);
}
.nb-stop { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 48px; }
.nb-stop::before {
  content: "";
  position: absolute;
  left: -38px; top: 15px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--glow);
  box-shadow: 0 0 12px var(--glow);
}
.nb-stop__year { flex: 0 0 180px; font-family: var(--display); font-size: 44px; line-height: 1; color: var(--glow); }
.nb-stop__what { flex: 1 1 380px; display: flex; flex-direction: column; gap: 4px; }
.nb-stop__org { align-self: flex-start; position: relative; font-size: 30px; font-weight: 500; line-height: 1.15; color: var(--paper); }
.nb-stop__meta { font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.nb-stop__note { flex: 1 1 240px; font-family: var(--hand); font-size: 19px; line-height: 1.3; color: var(--glow); }
/* the stop you're standing at: cyan, pulsing, circled in pen */
.nb-stop--now::before {
  left: -39px; top: 14px;
  width: 13px; height: 13px;
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
}
.nb-stop--now .nb-stop__year { color: var(--cyan); }
.nb-stop--now .nb-stop__meta { margin-top: 6px; }
.nb-stop--now .nb-stop__org::after {
  content: "";
  position: absolute;
  inset: -10px -18px -8px -16px;
  border: 1.5px solid var(--glow);
  border-radius: 50%;
  transform: rotate(-2deg);
  box-shadow: 0 0 12px var(--glow-soft);
  pointer-events: none;
}
@media (max-width: 560px) {
  .nb-road { padding-left: 24px; }
  .nb-stop::before { left: -30px; }
  .nb-stop--now::before { left: -31px; }
  .nb-stop__year { flex-basis: 100%; font-size: 36px; }
  .nb-stop__org { font-size: 26px; }
}

/* projects: frames of film */
.nb-frames {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr));
  gap: 56px 40px;
}
.nb-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 16px 22px;
  background: var(--panel);
  border: 1px solid rgba(236, 231, 220, 0.08);
  box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.9);
  cursor: pointer;
  transform: rotate(var(--tilt, -1deg));
}
.nb-frame::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -12px;
  left: var(--tape-x, 30px);
  width: 90px;
  height: 26px;
  background: var(--tape);
  transform: rotate(var(--tape-tilt, -4deg));
}
.nb-frame:nth-child(6n + 1) { --tilt: -1.1deg; --tape-x: 30px; --tape-tilt: -6deg; }
.nb-frame:nth-child(6n + 2) { --tilt: 0.9deg; --tape-x: calc(100% - 130px); --tape-tilt: 5deg; }
.nb-frame:nth-child(6n + 3) { --tilt: -0.6deg; --tape-x: 45%; --tape-tilt: -2deg; }
.nb-frame:nth-child(6n + 4) { --tilt: 1.1deg; --tape-x: 24px; --tape-tilt: 4deg; }
.nb-frame:nth-child(6n + 5) { --tilt: -1deg; --tape-x: calc(100% - 120px); --tape-tilt: -5deg; }
.nb-frame:nth-child(6n + 6) { --tilt: 0.7deg; --tape-x: 40%; --tape-tilt: 3deg; }
.nb-frame:hover,
.nb-frame:focus-visible {
  border-color: rgba(255, 181, 71, 0.45);
  box-shadow: 0 0 40px rgba(255, 181, 71, 0.14), 0 40px 60px -30px rgba(0, 0, 0, 0.9);
}
/* film stock: sprocket holes top and bottom */
.nb-frame__film {
  position: relative;
  padding: 14px 0;
  background-color: var(--panel-deep);
  background-image:
    repeating-linear-gradient(90deg, var(--sprocket) 0 8px, transparent 8px 18px),
    repeating-linear-gradient(90deg, var(--sprocket) 0 8px, transparent 8px 18px);
  background-size: 100% 6px, 100% 6px;
  background-position: 0 4px, 0 calc(100% - 4px);
  background-repeat: no-repeat;
}
.nb-frame__photo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.04);
}
.nb-frame:hover .nb-frame__photo { filter: saturate(1.1) contrast(1.06) brightness(1.08); }
.nb-frame__stamp {
  position: absolute;
  right: -16px; bottom: -22px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px; height: 92px;
  padding: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--glow);
  background: var(--ink);
  box-shadow: 0 0 14px rgba(255, 181, 71, 0.4);
  color: var(--glow);
  text-align: center;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.1;
  transform: rotate(8deg);
}
.nb-frame__label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--cyan); }
.nb-frame__title { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.1; color: var(--paper); }
.nb-frame__desc { font-size: 16px; color: var(--muted); }
.nb-frame__note { font-family: var(--hand); font-size: 18px; color: var(--glow); }

/* projects: everything else, as a checklist in the margin */
.nb-margins { display: flex; flex-direction: column; gap: 18px; padding-top: 12px; }
.nb-margins__title { font-family: var(--hand); font-weight: 400; font-size: 26px; color: var(--bright); }
.nb-margins__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 4px 32px;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--soft);
}
.nb-tick {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
}
.nb-tick::before {
  content: "";
  flex: none;
  width: 14px; height: 14px;
  border: 1.5px solid var(--glow);
  transform: rotate(var(--tick-tilt, -3deg));
}
.nb-tick:nth-child(3n + 1) { --tick-tilt: -4deg; }
.nb-tick:nth-child(3n + 2) { --tick-tilt: 3deg; }
.nb-tick:nth-child(3n + 3) { --tick-tilt: -2deg; }
.nb-tick:hover, .nb-tick:focus-visible { color: var(--glow); }
.nb-tick:hover::before, .nb-tick:focus-visible::before { box-shadow: 0 0 10px var(--glow-soft); }

/* awards: medals */
.nb-medals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 40px 32px;
}
.nb-medal__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  text-decoration: none;
  color: var(--bright);
}
.nb-medal__ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 148px; height: 148px;
  border-radius: 50%;
  border: 1.5px solid var(--glow);
  box-shadow: 0 0 22px rgba(255, 181, 71, 0.3), inset 0 0 22px rgba(255, 181, 71, 0.12);
  outline: 1px dashed rgba(236, 231, 220, 0.3);
  outline-offset: 7px;
  font-family: var(--display);
  font-style: italic;
  font-size: 50px;
  color: var(--paper);
  transform: rotate(var(--ring-tilt, -4deg));
}
.nb-medal:nth-child(4n + 1) { --ring-tilt: -4deg; }
.nb-medal:nth-child(4n + 2) { --ring-tilt: 3deg; }
.nb-medal:nth-child(4n + 3) { --ring-tilt: -2deg; }
.nb-medal:nth-child(4n + 4) { --ring-tilt: 5deg; }
.nb-medal__name { font-size: 19px; line-height: 1.35; color: var(--bright); }
.nb-medal__sub { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
a.nb-medal__body:hover { color: var(--bright); }
a.nb-medal__body:hover .nb-medal__ring,
a.nb-medal__body:focus-visible .nb-medal__ring {
  box-shadow: 0 0 44px rgba(255, 181, 71, 0.5), inset 0 0 30px rgba(255, 181, 71, 0.25);
}

/* research: late night reading */
.nb-reading { display: flex; flex-direction: column; }
.nb-chapter--split > .nb-reading { gap: 0; }
.nb-paper {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
}
.nb-paper:last-child { border-bottom: 1px solid var(--line-soft); }
.nb-paper__no { font-family: var(--display); font-style: italic; font-size: 34px; color: var(--glow); }
.nb-paper__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nb-paper__link { font-size: 23px; line-height: 1.3; color: var(--bright); text-decoration: none; }
.nb-paper__link:hover { color: var(--glow); }
.nb-paper__arrow { display: inline-block; font-family: var(--hand); font-size: 18px; color: var(--cyan); white-space: nowrap; }
.nb-paper__meta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.nb-reading-empty { font-family: var(--hand); font-size: 20px; color: var(--muted); }
@media (max-width: 560px) { .nb-paper { grid-template-columns: 40px 1fr; } .nb-paper__link { font-size: 20px; } }

/* contact: open channel */
.nb-channel {
  gap: 30px;
  align-items: flex-start;
  padding-top: 64px;
  border-top: 1px solid var(--line);
  background: radial-gradient(50% 70% at 85% 60%, rgba(143, 211, 232, 0.10), transparent 70%);
}
.nb-channel__title {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(64px, 10vw, 144px);
  line-height: 0.9;
  color: var(--paper);
  text-shadow: 0 0 50px rgba(143, 211, 232, 0.28);
}
.nb-channel__hand {
  margin-top: -8px;
  font-family: var(--hand);
  font-size: clamp(26px, 3vw, 36px);
  color: var(--glow);
  text-shadow: 0 0 16px var(--glow-soft);
  transform: rotate(-2deg);
}
.nb-channel__line { max-width: 30em; font-size: 21px; font-weight: 300; color: var(--lede); }
.nb-channel__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 32px;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nb-channel__links a { display: inline-flex; align-items: center; min-height: 44px; }

.nb-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- dialogs: project detail + photo lightbox ---------- */
.nb-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: visible;
  color: var(--text);
  background: transparent;
  border: 0;
}
.nb-dialog::backdrop { background: rgba(5, 6, 9, 0.78); }
.nb-dialog__panel {
  position: relative;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: clamp(22px, 4vw, 36px);
  background: var(--panel);
  border: 1px solid var(--cyan-soft);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.95), 0 0 50px rgba(255, 181, 71, 0.08);
}
.nb-dialog__close {
  position: absolute;
  top: 10px; right: 10px;
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  font: 400 24px/1 var(--body);
  cursor: pointer;
}
.nb-dialog__close:hover { color: var(--glow); border-color: var(--glow); }

/* project detail: a two-page spread. The photo sits whole (never cropped)
   in a taped film frame on the left; the notes run down the right. */
.nb-dialog--project { width: min(1000px, calc(100vw - 32px)); }
.nb-dialog--project.is-textonly { width: min(640px, calc(100vw - 32px)); }
.nb-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: start;
  gap: 40px;
  padding: 44px clamp(22px, 4vw, 40px) clamp(26px, 4vw, 40px);
  background-color: var(--panel);
  background-image:
    linear-gradient(rgba(143, 211, 232, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 211, 232, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
}
.is-textonly .nb-sheet { grid-template-columns: minmax(0, 1fr); }
.nb-sheet__media[hidden], .nb-sheet__thumbs[hidden] { display: none; }
.nb-sheet__media { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.nb-sheet__film {
  position: relative;
  margin: 0;
  padding: 16px 0;
  background-color: var(--panel-deep);
  background-image:
    repeating-linear-gradient(90deg, var(--sprocket) 0 8px, transparent 8px 18px),
    repeating-linear-gradient(90deg, var(--sprocket) 0 8px, transparent 8px 18px);
  background-size: 100% 6px, 100% 6px;
  background-position: 0 5px, 0 calc(100% - 5px);
  background-repeat: no-repeat;
  border: 1px solid rgba(236, 231, 220, 0.08);
  box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.9);
  transform: rotate(-0.8deg);
}
.nb-sheet__film::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -13px; left: 50%;
  width: 104px; height: 26px;
  margin-left: -52px;
  background: var(--tape);
  transform: rotate(3deg);
}
.nb-sheet__photo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--panel-deep);
}
.nb-sheet__count {
  position: absolute;
  right: 10px; bottom: 22px;
  padding: 3px 8px;
  background: rgba(11, 13, 17, 0.85);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--cyan);
}
.nb-sheet__count:empty { display: none; }
.nb-sheet__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.nb-sheet__thumb {
  aspect-ratio: 4 / 3;
  min-height: 44px;
  padding: 0;
  overflow: hidden;
  background: var(--panel-deep);
  border: 1px solid rgba(236, 231, 220, 0.14);
  opacity: 0.55;
  cursor: pointer;
}
.nb-sheet__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nb-sheet__thumb:hover { opacity: 0.85; }
.nb-sheet__thumb[aria-pressed="true"] { opacity: 1; border-color: var(--glow); box-shadow: 0 0 12px var(--glow-soft); }

.nb-sheet__text { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding-top: 4px; }
.nb-sheet__kicker { padding-right: 48px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); }
.nb-sheet__title {
  padding-right: 48px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 50px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--paper);
  text-shadow: 0 0 30px rgba(255, 181, 71, 0.2);
}
.nb-sheet__title::after {
  content: "";
  display: block;
  width: 72px;
  height: 2px;
  margin-top: 16px;
  background: var(--glow);
  box-shadow: 0 0 10px var(--glow-soft);
}
.nb-sheet__desc { font-size: 17px; line-height: 1.7; color: var(--soft); }
.nb-sheet__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.nb-sheet__links:empty { display: none; }
.nb-sheet__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 181, 71, 0.55);
  color: var(--glow);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nb-sheet__links a:first-child { background: var(--glow); color: var(--ink); box-shadow: 0 0 24px var(--glow-soft); }
.nb-sheet__links a:hover { border-color: var(--glow); background: rgba(255, 181, 71, 0.12); color: var(--glow); }
.nb-sheet__links a:first-child:hover { background: #FFC56E; color: var(--ink); }

@media (max-width: 819px) {
  .nb-sheet { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 64px; }
  .nb-sheet__film { transform: rotate(-0.5deg); }
}

.nb-lightbox__img { display: block; width: 100%; max-height: calc(100vh - 200px); object-fit: contain; background: var(--panel-deep); }
.nb-lightbox__caption { margin-top: 14px; padding-right: 52px; font-family: var(--hand); font-size: 20px; color: var(--glow); }
.nb-dialog--photo .nb-dialog__panel { padding-top: 64px; }

/* ---------- inner pages: research overviews, the feed, 404 ---------- */
.nb-sub-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.nb-sub { display: flex; flex-direction: column; gap: 72px; }
.nb-sub-hero { display: flex; flex-direction: column; gap: 24px; }
.nb-sub-hero .nb-kicker { letter-spacing: 0.2em; }
.nb-sub-title {
  max-width: 17em;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(42px, 5.4vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--paper);
  text-shadow: 0 0 40px rgba(255, 181, 71, 0.25);
}
.nb-sub-lede { max-width: 40em; font-size: 22px; font-weight: 300; color: var(--soft); }
.nb-sub-hero .nb-aside { font-size: 22px; text-shadow: 0 0 14px rgba(255, 181, 71, 0.3); }
.nb-sub-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 56px 72px; }
.nb-sub-main { flex: 3 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 64px; }
.nb-sub-side { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 36px; }
.nb-block { display: flex; flex-direction: column; gap: 16px; }
.nb-abstract { font-size: 20px; line-height: 1.7; color: #E9E4D9; }
.nb-h3 { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 40px; line-height: 1.1; color: var(--paper); }
.nb-quiet { color: var(--muted); }
.nb-body { color: var(--soft); }

/* a figure taped onto the page */
.nb-pinned {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px 28px 22px;
  background: var(--panel);
  border: 1px solid var(--cyan-soft);
  box-shadow: var(--shadow);
  transform: rotate(var(--tilt, -0.6deg));
}
.nb-pinned::before {
  content: "";
  position: absolute;
  top: -14px;
  left: var(--tape-x, 40%);
  width: 120px;
  height: 30px;
  background: var(--tape);
  transform: rotate(-3deg);
}
.nb-pinned__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.nb-pinned__title { font-family: var(--display); font-style: italic; font-size: 28px; line-height: 1.15; color: var(--paper); }
.nb-pinned__unit { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.nb-pinned figcaption { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--hand); font-size: 18px; color: var(--dim); }
.nb-pinned figcaption :last-child { color: var(--cyan); }

/* bar charts: label | track | value */
.nb-bars { display: flex; flex-direction: column; gap: 16px; }
.nb-bar { display: grid; grid-template-columns: var(--bar-label, 76px) 1fr var(--bar-value, 64px); gap: 14px; align-items: center; }
.nb-bar__label { font-size: 15px; }
.nb-bar__label--mono, .nb-bar__value { font-family: var(--mono); font-size: 13px; }
.nb-bar__value { text-align: right; }
.nb-bar__track { position: relative; height: 16px; background: rgba(236, 231, 220, 0.06); }
.nb-bar__fill {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--from, 0);
  width: var(--w);
  background: var(--glow);
  box-shadow: 0 0 14px rgba(255, 181, 71, 0.45);
}
.nb-bar__fill--cyan { background: var(--cyan); box-shadow: 0 0 14px rgba(143, 211, 232, 0.45); }
.nb-bars--tall .nb-bar__track { height: 22px; }
@media (max-width: 560px) {
  .nb-bar { grid-template-columns: 1fr var(--bar-value, 64px); gap: 6px 12px; }
  .nb-bar__track { grid-column: 1 / -1; grid-row: 2; }
}

.nb-before-after { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.nb-before-after__from { font-family: var(--display); font-size: 44px; line-height: 1; color: var(--dim); }
.nb-before-after__arrow { font-family: var(--hand); font-size: 24px; color: var(--dim); }
.nb-before-after__to { font-family: var(--display); font-size: 56px; line-height: 1; color: var(--glow); text-shadow: 0 0 24px rgba(255, 181, 71, 0.4); }
.nb-two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 28px; }
.nb-stack { display: flex; flex-direction: column; gap: 8px; }
.nb-stack--loose { gap: 12px; }
.nb-small { font-size: 15px; color: var(--muted); }

/* three-up columns topped with an amber rule */
.nb-trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 20px; }
.nb-trio > div { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--glow); }
.nb-trio__key { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--glow); }
.nb-trio__letter { font-family: var(--display); font-style: italic; font-size: 40px; line-height: 1; color: var(--glow); }
.nb-trio__text { font-size: 16px; color: var(--soft); }

/* numbered contents list */
.nb-toc { display: flex; flex-direction: column; }
.nb-toc li { display: grid; grid-template-columns: 48px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line-soft); }
.nb-toc li:last-child { border-bottom: 1px solid var(--line-soft); }
.nb-toc__no { font-family: var(--mono); font-size: 13px; color: var(--glow); }
.nb-toc strong { font-weight: 600; color: var(--bright); }
.nb-toc__text { color: var(--muted); }

.nb-chips { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--soft); }
.nb-chips li { padding: 4px 10px; border: 1px solid rgba(236, 231, 220, 0.25); }
.nb-desk { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.nb-desk a { font-size: 17px; text-decoration: none; }
.nb-side-note { align-self: flex-start; font-family: var(--hand); font-size: 19px; color: var(--glow); transform: rotate(-2deg); }

/* ---------- full papers ---------- */
.paper-shell { display: block; max-width: 1180px; margin: 0 auto; padding: 28px clamp(24px, 5vw, 88px) 120px; }
.paper-nav { margin-bottom: 56px; }
.paper-card > header { display: flex; flex-direction: column; gap: 18px; }
.paper-kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--glow); }
.paper-title {
  max-width: 17em;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(40px, 5.4vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--paper);
  text-shadow: 0 0 40px rgba(255, 181, 71, 0.25);
}
.paper-subtitle { max-width: 34em; font-size: clamp(19px, 2.4vw, 22px); font-weight: 300; line-height: 1.4; color: var(--soft); }
.paper-byline { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.paper-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
  margin-top: 40px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.paper-toc a { display: inline-flex; align-items: center; min-height: 44px; color: var(--dim); text-decoration: none; }
.paper-toc a:hover { color: var(--glow); }
.paper-article { max-width: 70ch; margin: 64px auto 0; font-size: 18px; line-height: 1.75; color: var(--text); }
.paper-section { scroll-margin-top: 24px; }
.paper-section + .paper-section { margin-top: 72px; }
.paper-section h2 {
  margin-bottom: 20px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(32px, 4vw, 40px);
  line-height: 1.1;
  color: var(--paper);
}
.paper-section h3 { margin: 40px 0 12px; font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.2; color: var(--paper); }
.paper-section p + p { margin-top: 18px; }
.paper-section ul, .paper-section ol:not(.paper-references) { margin: 18px 0 0; padding-left: 1.3em; list-style: disc; }
.paper-section ol:not(.paper-references) { list-style: decimal; }
.paper-section li + li { margin-top: 8px; }
.paper-section strong { color: var(--bright); }
.paper-keywords { margin-top: 18px; font-size: 16px; color: var(--muted); }
.paper-keywords strong { color: var(--bright); }
.paper-wide { width: min(100vw - 48px, 1000px); margin: 40px 50%; transform: translateX(-50%); }
.paper-figure {
  padding: clamp(18px, 3vw, 28px);
  background: var(--panel);
  border: 1px solid var(--cyan-soft);
  box-shadow: var(--shadow);
  font-size: 16px;
  line-height: 1.55;
}
.paper-figure-title { font-family: var(--display); font-style: italic; font-size: 24px; line-height: 1.2; color: var(--paper); }
.paper-figure-sub, .paper-figure-note, .paper-table-note { font-size: 14px; line-height: 1.55; color: var(--muted); }
.paper-figure-sub { margin-top: 6px; }
.paper-figure-note, .paper-table-note { margin-top: 14px; }
.paper-article code {
  padding: 1px 5px;
  background: rgba(143, 211, 232, 0.08);
  border: 1px solid var(--cyan-soft);
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--cyan);
}
.paper-references { margin: 20px 0 0; padding-left: 1.4em; list-style: decimal; font-size: 15px; line-height: 1.6; color: var(--soft); }
.paper-references li + li { margin-top: 10px; }
.paper-footer {
  max-width: 70ch;
  margin: 72px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.paper-table-wrap { overflow-x: auto; margin-top: 20px; }
.paper-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.paper-table th, .paper-table td { padding: 10px; border: 1px solid var(--line); vertical-align: top; text-align: left; }
.paper-table th { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cyan); background: rgba(143, 211, 232, 0.06); }
.paper-table tbody tr:nth-child(even) { background: rgba(236, 231, 220, 0.03); }

/* paper diagrams (ported from the old theme, re-inked for the dark page) */
.workflow-inputs, .workflow-outcomes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.workflow-step, .workflow-outcome {
  display: grid;
  place-items: center;
  min-height: 4.2rem;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}
.workflow-inputs > *:nth-child(1), .workflow-outcomes > *:nth-child(3) { background: #7FB5DC; }
.workflow-inputs > *:nth-child(2), .workflow-outcomes > *:nth-child(2) { background: var(--cyan); }
.workflow-inputs > *:nth-child(3), .workflow-outcomes > *:nth-child(1) { background: var(--glow); }
.workflow-step { max-width: 25rem; margin: 12px auto; background: #7FD8C8; }
.workflow-arrow { margin: 6px auto; color: var(--dim); text-align: center; font-family: var(--mono); }
.fertility-chart { margin-top: 22px; }
.fertility-row { display: grid; grid-template-columns: minmax(7rem, 0.8fr) minmax(12rem, 2fr) auto; align-items: center; gap: 12px; min-height: 2.25rem; font-size: 14px; }
.fertility-label { text-align: right; color: var(--text); }
.fertility-track {
  position: relative;
  height: 0.55rem;
  border-left: 1px solid var(--line);
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc(9.09% - 1px), var(--line-soft) calc(9.09% - 1px), var(--line-soft) 9.09%);
}
.fertility-range { position: absolute; top: 0.07rem; left: var(--start); width: max(0.6rem, calc(var(--end) - var(--start))); height: 0.42rem; border-radius: 999px; background: var(--range, var(--cyan)); }
.fertility-range::after {
  content: "";
  position: absolute;
  top: -0.12rem; left: 50%;
  width: 0.52rem; height: 0.52rem;
  border: 2px solid var(--range, var(--cyan));
  border-radius: 50%;
  background: var(--panel);
  transform: translateX(-50%);
}
.fertility-value { min-width: 4.7rem; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.paper-figure-scroll { overflow-x: auto; padding-bottom: 6px; }
.tradeoff-plot {
  position: relative;
  width: 43rem;
  height: 25rem;
  margin: 20px 0 2.4rem 3.4rem;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to right, var(--line-soft) 1px, transparent 1px), linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 25% 100%, 100% 25%;
}
.tradeoff-axis-x, .tradeoff-axis-y { position: absolute; color: var(--muted); font-size: 12px; }
.tradeoff-axis-x { right: 0; bottom: -1.65rem; }
.tradeoff-axis-y { top: 50%; left: -3.2rem; width: 14rem; transform: rotate(-90deg); transform-origin: left top; }
.tradeoff-dot { position: absolute; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--dot, var(--cyan)); box-shadow: 0 0 0 2px var(--panel), 0 0 10px var(--dot, var(--cyan)); }
.tradeoff-dot span { position: absolute; top: 0.75rem; left: 0.45rem; width: 8rem; color: var(--text); font-size: 12px; font-style: normal; line-height: 1.2; }
.tradeoff-dot--up span { top: auto; bottom: 0.85rem; }
.forgetting-chart {
  display: grid;
  grid-template-columns: repeat(2, minmax(10rem, 1fr));
  align-items: end;
  gap: 2rem;
  height: 18rem;
  margin-top: 24px;
  padding: 0 1rem 2.8rem;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0, transparent calc(20% - 1px), var(--line-soft) calc(20% - 1px), var(--line-soft) 20%);
}
.forgetting-group { display: flex; align-items: end; justify-content: center; gap: 0.55rem; height: 100%; position: relative; }
.forgetting-group > span:last-child { position: absolute; top: calc(100% + 0.55rem); width: 11rem; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.2; }
.forgetting-bar { position: relative; width: min(4rem, 34%); min-height: 1.2rem; background: var(--glow); box-shadow: 0 0 14px rgba(255, 181, 71, 0.35); }
.forgetting-bar--alt { background: var(--cyan); box-shadow: 0 0 14px rgba(143, 211, 232, 0.35); }
.forgetting-bar b { position: absolute; top: -1.45rem; left: 50%; transform: translateX(-50%); font-size: 13px; font-style: normal; white-space: nowrap; color: var(--bright); }
.memory-flow { display: grid; grid-template-columns: repeat(3, minmax(8.5rem, 1fr) auto) minmax(8.5rem, 1fr); align-items: stretch; gap: 10px; margin-top: 20px; }
.memory-node { display: grid; align-content: center; min-height: 7.5rem; padding: 14px; border: 1px solid var(--cyan-soft); background: rgba(143, 211, 232, 0.06); text-align: center; }
.memory-node strong { font-family: var(--display); font-size: 17px; font-weight: 400; color: var(--paper); }
.memory-node span { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.memory-node--headroom { border-color: rgba(255, 181, 71, 0.5); background: rgba(255, 181, 71, 0.07); }
.memory-plus { align-self: center; color: var(--dim); font-family: var(--mono); font-size: 18px; }
.tier-map { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 20px; }
.tier-card { display: grid; align-content: center; min-height: 10rem; padding: 16px; border: 1px solid var(--line); border-top: 3px solid #7FD8C8; background: rgba(236, 231, 220, 0.03); text-align: center; }
.tier-card--mid { border-top-color: var(--cyan); }
.tier-card--high { border-top-color: var(--glow); }
.tier-card strong { margin-top: 6px; font-family: var(--display); font-size: 18px; font-weight: 400; color: var(--paper); }
.tier-card > span:last-child { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.tier-label { color: var(--cyan); font-family: var(--mono); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; }
.tier-arrow { color: var(--dim); font-family: var(--mono); }
.benchmark-chart { margin-top: 22px; }
.benchmark-chart h3 { margin: 22px 0 10px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.benchmark-chart h3:first-child { margin-top: 0; }
.benchmark-row { display: grid; grid-template-columns: 2.3rem minmax(10rem, 1fr) 6.4rem; align-items: center; gap: 12px; min-height: 2.15rem; font-size: 13px; }
.benchmark-row > span:first-child { font-family: var(--mono); }
.benchmark-row strong { color: var(--muted); font-family: var(--mono); font-size: 12px; font-weight: 400; text-align: right; }
.benchmark-track { height: 0.85rem; background: rgba(236, 231, 220, 0.06); }
.benchmark-track i { display: block; width: var(--bar); min-width: 0.35rem; height: 100%; background: var(--bar-color, var(--cyan)); box-shadow: 0 0 12px var(--bar-color, var(--cyan)); }
.boundary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.boundary-card { display: grid; align-content: start; min-height: 12rem; padding: 16px; border: 1px solid rgba(127, 216, 200, 0.45); background: rgba(127, 216, 200, 0.05); }
.boundary-card--hybrid { border-color: rgba(143, 211, 232, 0.5); background: rgba(143, 211, 232, 0.05); }
.boundary-card--frontier { border-color: rgba(255, 181, 71, 0.5); background: rgba(255, 181, 71, 0.05); }
.boundary-card > span { color: var(--cyan); font-family: var(--mono); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; }
.boundary-card strong { margin-top: 8px; font-family: var(--display); font-size: 18px; font-weight: 400; color: var(--paper); }
.boundary-card p { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.boundary-card b { align-self: end; margin-top: 16px; font-size: 13px; line-height: 1.4; color: var(--bright); }
.decision-flow { margin-top: 20px; }

@media (max-width: 820px) {
  .memory-flow { grid-template-columns: 1fr; }
  .memory-plus { justify-self: center; }
  .tier-map { grid-template-columns: 1fr; }
  .tier-arrow { justify-self: center; transform: rotate(90deg); }
  .boundary-grid { grid-template-columns: 1fr; }
  .boundary-card { min-height: 0; }
}
@media (max-width: 620px) {
  .paper-wide { width: 100%; margin-left: 0; margin-right: 0; transform: none; }
  .workflow-inputs, .workflow-outcomes { grid-template-columns: 1fr; }
  .workflow-step { max-width: none; }
  .fertility-row { grid-template-columns: 6.5rem minmax(8rem, 1fr); gap: 6px; }
  .fertility-value { grid-column: 2; min-width: 0; }
  .benchmark-row { grid-template-columns: 2.3rem minmax(7rem, 1fr); gap: 6px; }
  .benchmark-row strong { grid-column: 2; text-align: left; }
  .forgetting-chart { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding-inline: 0.5rem; }
  .forgetting-group > span:last-child { width: 100%; }
}

/* ---------- the feed archive (signal.html) ---------- */
.archive-meta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); }
.archive-meta[hidden] { display: none; }
.signal-list { margin: 0; padding: 0; list-style: none; }
.signal-list.signal-cards,
.signal-list.signal-archive-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 40px 32px;
}
.signal-card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.signal-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 20px 18px;
  color: var(--text);
  text-decoration: none;
  background: var(--panel);
  border: 1px solid rgba(236, 231, 220, 0.08);
  box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.9);
}
a.signal-card__link:hover,
.signal-card__link:focus-visible {
  color: var(--text);
  border-color: rgba(255, 181, 71, 0.45);
  box-shadow: 0 0 40px rgba(255, 181, 71, 0.12), 0 40px 60px -30px rgba(0, 0, 0, 0.9);
}
.signal-card__head { display: flex; align-items: center; gap: 12px; }
.signal-card__avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px; height: 40px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--cyan-soft);
  background: var(--panel-deep);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 14px;
}
.signal-card__avatar-img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.signal-card__who { display: flex; flex-direction: column; gap: 4px; min-width: 0; line-height: 1.25; }
.signal-card__account { overflow: hidden; font-size: 15px; font-weight: 600; color: var(--bright); text-overflow: ellipsis; white-space: nowrap; }
.signal-card__details { display: flex; align-items: center; gap: 8px; min-width: 0; }
.signal-card__badge { flex: none; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--glow); }
.signal-card__date { overflow: hidden; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--dim); text-overflow: ellipsis; white-space: nowrap; }
.signal-card__network { margin-left: auto; display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; color: var(--dim); }
.signal-card__network-logo { display: block; width: 15px; height: 15px; fill: currentColor; }
.signal-card__title { margin: 18px 0 0; font-family: var(--display); font-weight: 400; font-size: 23px; line-height: 1.2; color: var(--paper); }
.signal-card__summary { margin: 10px 0 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.signal-card__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 18px; }
.signal-card__tags { font-family: var(--mono); font-size: 11px; line-height: 1.5; color: var(--dim); }
.signal-card__action { flex: none; font-family: var(--hand); font-size: 17px; color: var(--cyan); }
.signal-card > .signal-img-btn { margin-top: 10px; }
.signal-img-btn { display: block; width: 100%; padding: 0; background: none; border: 0; cursor: zoom-in; }
.signal-img { display: block; width: 100%; max-height: 360px; object-fit: cover; border: 1px solid rgba(236, 231, 220, 0.08); }
.signal-img-btn:hover .signal-img,
.signal-img-btn:focus-visible .signal-img { border-color: var(--glow); }
.signal-loading, .signal-error { font-family: var(--hand); font-size: 20px; color: var(--muted); }
html:not(.js) .signal-loading { display: none; }
.signal-noscript { font-size: 16px; color: var(--muted); }

/* ---------- 404 ---------- */
.nb-lost { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; padding-top: 72px; }
.nb-lost__code {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(120px, 22vw, 260px);
  line-height: 0.85;
  color: var(--paper);
  text-shadow: 0 0 40px rgba(255, 181, 71, 0.3), 0 0 110px rgba(255, 181, 71, 0.14);
}
.nb-lost__line { max-width: 30em; font-size: 21px; font-weight: 300; color: var(--lede); }

/* ============================================================
   motion: hover settles and ambient loops, never without consent
   ============================================================ */
@keyframes nb-march { to { stroke-dashoffset: -24; } }
@keyframes nb-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes nb-spin { to { transform: rotate(360deg); } }
@keyframes nb-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes nb-scan { to { stroke-dashoffset: -20; } }
@keyframes nb-sheet-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
@keyframes nb-fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: no-preference) {
  .nb-fig__card, .nb-tape, .nb-frame, .nb-frame__photo, .nb-stop, .nb-medal__ring,
  .nb-paper__arrow, .nb-lock, .nb-core, .nb-pinned {
    transition: transform 0.4s var(--ease), box-shadow 0.4s ease, border-color 0.4s ease, opacity 0.4s ease, filter 0.4s ease;
  }
  .nb-top__nav a, .nb-back, .nb-tick, .nb-paper__link { transition: color 0.25s ease, text-shadow 0.25s ease; }

  .nb-route__path { animation: nb-march 1.4s linear infinite; }
  .nb-stop--now::before { animation: nb-pulse 2.4s ease-in-out infinite; }

  /* the sketches wake up under the cursor: rotors spin, the camera scans,
     the crosshair locks, the agent loop turns */
  .nb-fig:hover .nb-fig__card { transform: rotate(0) translateY(-6px); border-color: rgba(255, 181, 71, 0.55); box-shadow: 0 0 44px rgba(255, 181, 71, 0.16), var(--shadow); }
  .nb-fig:hover .nb-tape { transform: rotate(0) translateY(-4px); }
  .nb-fig:hover .nb-rotor { animation: nb-spin 0.45s linear infinite; }
  .nb-fig:hover .nb-body { animation: nb-bob 2.6s ease-in-out infinite; }
  .nb-fig:hover .nb-scan, .nb-fig:hover .nb-flow { animation: nb-scan 0.8s linear infinite; }
  .nb-fig:hover .nb-lock { transform: scale(1); opacity: 1; }
  .nb-fig:hover .nb-core { opacity: 0.9; }
  .nb-fig:hover .nb-loop { animation: nb-spin 6s linear infinite; }

  .nb-frame:hover, .nb-frame:focus-visible { transform: rotate(0) translateY(-8px); }
  .nb-stop:hover { transform: translateX(8px); }
  a.nb-medal__body:hover .nb-medal__ring,
  a.nb-medal__body:focus-visible .nb-medal__ring { transform: rotate(0) scale(1.06); }
  .nb-paper__link:hover .nb-paper__arrow { transform: translateX(6px); }
  .nb-pinned:hover { transform: rotate(0) translateY(-4px); }

  .nb-dialog[open] .nb-dialog__panel { animation: nb-sheet-in 0.32s var(--ease); }
  .nb-dialog[open]::backdrop { animation: nb-fade-in 0.25s ease; }
  .nb-sheet__photo { transition: opacity 0.2s ease; }
  .nb-sheet__thumb { transition: opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
}

/* without the motion preference everything is still lit, just still */
@media (prefers-reduced-motion: reduce) {
  .nb-lock { transform: none; opacity: 1; }
}
