/* Layout: night bands (the 3D scene and page headers) hand over to cool "paper"
   reading surfaces, joined by an amber lane-marking rule. Left-aligned editorial column. */
:root {
  --night: #0b1117;
  --night-2: #121b24;
  --night-line: #243340;
  --night-fg: #e7edf2;
  --night-muted: #93a1ad;
  --paper: #f2f3f0;
  --paper-2: #e6e9e6;
  --ink: #12171c;
  --ink-muted: #545e68;
  --rule: #cdd3d4;
  --signal: #f0a63a;
  --signal-ink: #8f5300;
  --sensor: #7fc8dc;

  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-read: "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.2rem + 2vw, 2.4rem);
  --step-4: clamp(2.3rem, 1.3rem + 4.4vw, 4.4rem);

  --wrap: 72rem;
  --nav-h: 4rem;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 1rem); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-display);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 60; background: var(--night);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.wrap.narrow { max-width: 46rem; }

.mono { font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: 0.02em; }
.eyebrow {
  font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; margin: 0 0 1rem; color: var(--ink-muted);
}
.display {
  font-family: var(--f-display); font-stretch: 116%; font-weight: 650;
  letter-spacing: -0.02em; line-height: 1.04; text-wrap: balance; margin: 0;
}
.section-title {
  font-stretch: 110%; font-weight: 620; font-size: var(--step-3);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0; text-wrap: balance;
}

/* Lane-marking rule: the hand-over from night to paper */
.lane-rule, .page-head::after, .story::after {
  content: ""; display: block; height: 4px;
  background: repeating-linear-gradient(90deg, var(--signal) 0 34px, transparent 34px 62px);
}

/* ── Navigation ─────────────────────────────── */
.site-nav {
  position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 50;
  background: color-mix(in srgb, var(--night) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--night-line);
  color: var(--night-fg);
}
.site-nav.is-overlay { background: linear-gradient(var(--night), color-mix(in srgb, var(--night) 0%, transparent)); border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.site-nav.is-overlay.is-scrolled { background: color-mix(in srgb, var(--night) 82%, transparent); border-bottom-color: var(--night-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.nav-inner {
  max-width: var(--wrap); margin-inline: auto; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px; border: 2px solid var(--night-fg); border-radius: 50%;
  position: relative; flex: none;
}
.brand-mark::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--signal); }
.brand-name { font-stretch: 118%; font-weight: 650; letter-spacing: -0.01em; font-size: 1.05rem; }
.nav-links { display: flex; gap: 0.25rem; }
.nav-links a {
  text-decoration: none; font-size: 0.9375rem; padding: 0.5rem 0.8rem; border-radius: 2px;
  color: var(--night-muted); transition: color .2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--night-fg); }
.nav-links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--signal); }
.nav-toggle {
  display: none; font: inherit; font-family: var(--f-mono); font-size: 0.8125rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--night-fg); background: transparent;
  border: 1px solid var(--night-line); padding: 0.45rem 0.8rem; border-radius: 2px; cursor: pointer;
}
@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--night); border-bottom: 1px solid var(--night-line);
    padding: 0.5rem max(20px, env(safe-area-inset-right, 0px)) 1rem max(20px, env(safe-area-inset-left, 0px));
  }
  .nav-links:not(.is-open) { display: none; }
  .nav-links a { padding: 0.85rem 0; font-size: 1.05rem; border-bottom: 1px solid var(--night-line); }
  .nav-links a[aria-current="page"] { box-shadow: none; color: var(--signal); }
}

/* ── Buttons & links ─────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none;
  font-weight: 600; font-size: 0.9375rem; padding: 0.8rem 1.2rem; border-radius: 2px;
  border: 1px solid transparent; transition: transform .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-signal { background: var(--signal); color: var(--ink); }
.btn-ghost { border-color: color-mix(in srgb, var(--night-fg) 40%, transparent); color: var(--night-fg); }
.btn-ghost:hover { border-color: var(--night-fg); }
.btn-ink { background: var(--ink); color: var(--paper); }
.text-link {
  font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px;
  white-space: nowrap;
}
.text-link:hover { color: var(--signal-ink); }

/* ── Home: 3D scene + story ──────────────────── */
.scene { position: fixed; inset: 0; z-index: 0; background: var(--night); }
.scene canvas { width: 100%; height: 100%; display: block; }
.scene::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--night) 78%, transparent) 0%, color-mix(in srgb, var(--night) 20%, transparent) 48%, transparent 70%);
}
.scene-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.scene-label {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--night-fg); padding: 4px 8px 4px 8px; background: color-mix(in srgb, var(--night) 78%, transparent);
  border-left: 2px solid var(--sensor); opacity: 0; transition: opacity .35s;
  will-change: transform;
}
.scene-label.is-signal { border-left-color: var(--signal); }
.scene-label.is-muted { border-left-color: var(--night-muted); }
.scene-label b { font-weight: 500; color: var(--signal); }

main { position: relative; z-index: 2; display: block; }
.story { position: relative; color: var(--night-fg); }
.story::after { position: relative; z-index: 2; }
.chapter {
  min-height: 100vh; min-height: 100svh; display: flex; align-items: center;
  padding-block: calc(var(--nav-h) + 2rem) 3rem;
}
.chapter .wrap { display: flex; }
.chapter-card {
  max-width: 30rem; padding: 1.75rem 1.75rem 1.5rem;
  background: color-mix(in srgb, var(--night) 80%, transparent);
  border: 1px solid var(--night-line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.chapter.is-hero .chapter-card { max-width: 40rem; background: none; border: 0; padding: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.chapter .eyebrow, .chapter-index { color: var(--night-muted); }
.chapter-index { margin: 0 0 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; }
.hero-title { font-size: var(--step-4); margin-bottom: 1.25rem; }
.lede { font-size: var(--step-1); line-height: 1.55; color: color-mix(in srgb, var(--night-fg) 86%, var(--night)); margin: 0 0 1.75rem; max-width: 34rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.scroll-cue { margin: 2.5rem 0 0; color: var(--night-muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; }
.scroll-cue span { display: inline-block; animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 50% { transform: translateY(4px); } }
.chapter-title { font-stretch: 114%; font-weight: 640; font-size: var(--step-3); line-height: 1.1; margin: 0 0 0.8rem; letter-spacing: -0.015em; }
.chapter-card p { margin: 0 0 1.1rem; }
.readout { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--night-line); border: 1px solid var(--night-line); }
.readout div { background: var(--night-2); padding: 0.7rem 0.85rem; }
.readout dt { font-family: var(--f-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--night-muted); }
.readout dd { margin: 0.2rem 0 0; font-weight: 600; font-size: 0.95rem; }
.readout dd.is-signal { color: var(--signal); }
.scenario-note { margin: 0.9rem 0 0 !important; color: var(--night-muted); font-size: 0.7rem; }

@media (max-width: 720px) {
  .scene::after { background: linear-gradient(0deg, color-mix(in srgb, var(--night) 85%, transparent) 0%, transparent 55%); }
  .chapter { align-items: flex-end; padding-block: calc(var(--nav-h) + 1rem) 1.5rem; }
  .chapter.is-hero { align-items: flex-end; }
  .chapter-card { padding: 1.2rem 1.2rem 1rem; }
  .chapter.is-hero .chapter-card { padding-bottom: 1rem; }
  .readout { grid-template-columns: 1fr; }
}

/* ── Paper bands (home) ─────────────────────── */
.band { position: relative; padding-block: clamp(3.5rem, 8vw, 6.5rem); background: var(--paper); }
.band.is-alt { background: var(--paper-2); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 5vw, 5rem); }
.split-body { min-width: 0; }
.split-body p { margin: 0 0 1.1rem; font-family: var(--f-read); font-size: 1.125rem; line-height: 1.65; color: var(--ink); }
.timeline { list-style: none; margin: 2rem 0; padding: 0; border-top: 1px solid var(--rule); }
.timeline li {
  display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.25rem 1rem;
  padding: 0.9rem 0; border-bottom: 1px solid var(--rule); color: var(--ink-muted);
}
.timeline li span { color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; padding-top: 0.2rem; }
.timeline li strong { color: var(--ink); font-weight: 600; }
.band-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: 2.5rem; flex-wrap: wrap; }
.band-head > div { max-width: 40rem; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.25rem; }
.project-card {
  display: flex; flex-direction: column; gap: 0.8rem; text-decoration: none; min-width: 0;
  background: var(--paper); border: 1px solid var(--rule); padding: 1.5rem; transition: border-color .2s, transform .2s;
}
.project-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.project-card h3 { font-stretch: 108%; font-weight: 620; font-size: 1.25rem; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
.project-card p { margin: 0; color: var(--ink-muted); }
.project-card .stack { margin-top: auto; padding-top: 0.5rem; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; color: var(--ink-muted); margin: 0; flex-wrap: wrap; }
.pill {
  font-family: var(--f-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem; border: 1px solid var(--signal-ink); color: var(--signal-ink); border-radius: 2px; white-space: nowrap;
}
.stack { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; }
.stack span { font-size: 0.72rem; padding: 0.2rem 0.5rem; background: var(--paper-2); color: var(--ink); border-radius: 2px; }
.band.is-alt .project-card .stack span { background: var(--paper-2); }

.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.post-list li { border-bottom: 1px solid var(--rule); }
.post-list li[hidden] { display: none; }
.post-list a {
  display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.3rem 2rem;
  padding: 1.5rem 0; text-decoration: none;
}
.post-list-meta { grid-row: span 2; color: var(--ink-muted); padding-top: 0.3rem; }
.post-list-title { font-stretch: 108%; font-weight: 620; font-size: 1.35rem; line-height: 1.22; letter-spacing: -0.01em; text-wrap: balance; }
.post-list-summary { color: var(--ink-muted); max-width: 44rem; }
.post-list a:hover .post-list-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
@media (max-width: 720px) {
  .post-list a { grid-template-columns: 1fr; }
  .post-list-meta { grid-row: auto; }
}

/* ── Inner pages ─────────────────────────────── */
.page-head {
  background-color: var(--night); color: var(--night-fg);
  background-image:
    linear-gradient(color-mix(in srgb, var(--night-line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--night-line) 55%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + clamp(3rem, 8vw, 6rem));
}
.page-head .wrap { padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.page-head .eyebrow { color: var(--night-muted); }
.page-head .display { font-size: var(--step-4); }
.page-intro { font-size: var(--step-1); color: color-mix(in srgb, var(--night-fg) 82%, var(--night)); max-width: 40rem; margin: 1.25rem 0 0; line-height: 1.55; }
.paper { background: var(--paper); padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(4rem, 8vw, 6rem); }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.about-facts { position: sticky; top: calc(var(--nav-h) + 2rem); }
.about-facts dl { margin: 0; border-top: 1px solid var(--ink); }
.about-facts div { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
.about-facts dt { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }
.about-facts dd { margin: 0.25rem 0 0; font-weight: 500; }
.about-body > h2:first-child { margin-top: 0; }
.kicker { color: var(--signal-ink); margin: -0.4rem 0 1rem !important; font-size: 0.8rem !important; line-height: 1.5 !important; font-family: var(--f-mono) !important; }
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-facts { position: static; }
}

/* Projects */
.project-index { display: grid; grid-template-columns: 1fr; max-width: 46rem; border-top: 1px solid var(--ink); margin-bottom: 3rem; }
.project-index a { display: flex; gap: 0.9rem; padding: 0.85rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; font-weight: 500; line-height: 1.35; }
.project-index a:hover { color: var(--signal-ink); }
.project-index .mono { color: var(--ink-muted); padding-top: 0.1rem; }
.case { padding-block: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--rule); }
.case-head { max-width: 46rem; display: grid; gap: 0.9rem; }
.case-title { font-stretch: 112%; font-weight: 640; font-size: var(--step-3); line-height: 1.1; margin: 0; letter-spacing: -0.015em; text-wrap: balance; }
.case-summary { font-family: var(--f-read); font-size: 1.2rem; line-height: 1.55; margin: 0; }
.case-figure { margin: 2rem 0 0; max-width: 46rem; }
.case-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--rule); }
.case-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 2.5rem); margin-top: 2.25rem; }
.case-cols section { border-top: 2px solid var(--ink); padding-top: 0.9rem; }
.case-cols h3 { margin: 0 0 0.6rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; color: var(--ink-muted); }
.case-cols p { margin: 0; line-height: 1.6; }
.case-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; margin-top: 2rem; align-items: center; }
.case-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; }
.case-links a { font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; }
.case-links a:hover { color: var(--signal-ink); }
@media (max-width: 820px) { .case-cols { grid-template-columns: 1fr; } }

/* Research */
.research-block { padding-block: 0 clamp(2.5rem, 5vw, 4rem); margin-bottom: clamp(2.5rem, 5vw, 4rem); border-bottom: 1px solid var(--rule); }
.research-block:last-child { border-bottom: 0; margin-bottom: 0; }
.research-block .section-title { max-width: 52rem; }
.research-cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(1.5rem, 4vw, 4rem); margin-top: 1.5rem; }
.research-cols > p { font-family: var(--f-read); font-size: 1.125rem; line-height: 1.65; margin: 0; }
.facts-inline { margin: 0; border-top: 1px solid var(--ink); }
.facts-inline div { padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.facts-inline dt { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }
.facts-inline dd { margin: 0.2rem 0 0; font-weight: 500; }
.poster { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 2rem; align-items: start; }
.poster-thumb img { border: 1px solid var(--rule); transition: transform .25s; }
.poster-thumb:hover img { transform: translateY(-3px); }
.poster-title { font-stretch: 108%; font-weight: 620; font-size: 1.35rem; line-height: 1.2; margin: 0 0 0.5rem; }
.poster p { margin: 0 0 1rem; max-width: 40rem; }
.pub-meta { color: var(--ink-muted); }
.pub-list { margin: 0; padding-left: 1.25rem; }
.pub-list li { margin-bottom: 1.25rem; }
.pub-title { font-weight: 600; margin: 0 0 0.2rem; }
@media (max-width: 720px) {
  .research-cols { grid-template-columns: 1fr; }
  .poster { grid-template-columns: 1fr; }
  .poster-thumb img { max-width: 14rem; }
}

/* Insights */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.chip {
  font: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer;
  padding: 0.5rem 0.9rem; border: 1px solid var(--rule); background: transparent; color: var(--ink); border-radius: 2px;
  display: inline-flex; gap: 0.5rem; align-items: center;
}
.chip .mono { font-size: 0.72rem; color: var(--ink-muted); }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip[aria-pressed="true"] .mono { color: color-mix(in srgb, var(--paper) 70%, var(--ink)); }

/* ── Posts & long-form prose ─────────────────── */
.post-title { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.3rem); }
.post-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin: 1.5rem 0 0; color: var(--night-muted); }
.prose { font-family: var(--f-read); font-size: 1.125rem; line-height: 1.72; color: var(--ink); }
.prose > * { max-width: 68ch; }
.prose h2, .prose h3 { font-family: var(--f-display); letter-spacing: -0.01em; line-height: 1.2; text-wrap: balance; }
.prose h2 { font-stretch: 110%; font-weight: 640; font-size: 1.65rem; margin: 3rem 0 1rem; }
.prose h3 { font-weight: 620; font-size: 1.25rem; margin: 2.25rem 0 0.75rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.25rem; }
.prose li { margin-bottom: 0.4rem; }
.prose a { color: var(--ink); text-decoration-color: var(--signal-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--signal-ink); }
.prose img { border: 1px solid var(--rule); margin: 0.5rem 0 0; background: var(--paper-2); }
.prose p:has(> img) { margin: 2rem 0; max-width: none; }
.prose p img + em, .prose p a + em {
  display: block; margin-top: 0.6rem; font-style: normal; font-family: var(--f-mono);
  font-size: 0.78rem; line-height: 1.5; color: var(--ink-muted);
}
.prose blockquote {
  margin: 1.75rem 0; padding: 0.9rem 1.2rem; border-left: 3px solid var(--signal);
  background: var(--paper-2); font-family: var(--f-display); font-size: 1rem; line-height: 1.6;
}
.prose blockquote p { margin: 0; }
.prose code {
  font-family: var(--f-mono); font-size: 0.86em; background: var(--paper-2);
  padding: 0.12em 0.35em; border-radius: 2px; overflow-wrap: anywhere;
}
.prose pre {
  max-width: 100%; overflow-x: auto; background: var(--night); color: var(--night-fg);
  padding: 1rem 1.2rem; border-radius: 2px; margin: 1.25rem 0 1.75rem; line-height: 1.55;
  border-left: 3px solid var(--sensor);
}
.prose pre code { background: none; padding: 0; font-size: 0.85rem; overflow-wrap: normal; color: inherit; }
.prose div.highlighter-rouge { max-width: 68ch; }
.prose strong { font-weight: 600; }
.abstract {
  background: var(--paper-2); border-top: 2px solid var(--ink); padding: 1.5rem; margin: 0 0 2.5rem;
  font-family: var(--f-display); font-size: 1.05rem; line-height: 1.6;
}
.abstract p { margin: 0 0 1rem; }
.post-nav { display: flex; justify-content: space-between; gap: 1.5rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--ink); }
.post-nav a { text-decoration: none; font-weight: 600; display: grid; gap: 0.25rem; max-width: 22rem; }
.post-nav a .mono { font-weight: 400; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.7rem; }
.post-nav a.is-next { text-align: right; margin-left: auto; }
.back-link { margin-top: 1.5rem; }
.back-link a { font-weight: 600; text-decoration: none; }

/* ── Footer ─────────────────────────────────── */
.site-footer { position: relative; z-index: 2; background: var(--night); color: var(--night-fg); padding-block: clamp(3rem, 7vw, 5rem) 2rem; }
.site-footer .eyebrow { color: var(--night-muted); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 2rem 4rem; align-items: end; }
.footer-statement { font-stretch: 112%; font-weight: 600; font-size: var(--step-3); line-height: 1.15; margin: 0; letter-spacing: -0.015em; text-wrap: balance; max-width: 36rem; }
.footer-links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--night-line); }
.footer-links li { border-bottom: 1px solid var(--night-line); }
.footer-links a, .footer-links span { display: block; padding: 0.85rem 0; text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--signal); }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; margin-top: 3.5rem; color: var(--night-muted); font-size: 0.85rem; }
.footer-base .mono { font-size: 0.75rem; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 720px) { .scene-label .lb-extra { display: none; } }

/* ── Hand-drawn layer: DIVE intro, handwritten notes, logo stickers ── */
.hand { font-family: "Caveat", "Segoe Print", "Bradley Hand", cursive; font-weight: 600; letter-spacing: 0; text-transform: none; }
.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; }

.brand-logo { height: 36px; width: auto; display: block; }
.brand-mark { display: none; }

.dive-mark {
  position: fixed; left: 50%; top: 45%; z-index: 1; width: min(78vw, 560px);
  transform: translate(-50%, -50%); text-align: center; pointer-events: none;
}
.dive-logo { position: relative; }
.dive-mark::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 170%; height: 210%; transform: translate(-50%, -50%); z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--night) 92%, transparent) 35%, color-mix(in srgb, var(--night) 55%, transparent) 65%, transparent 100%);
}
.dive-logo img { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.55)); }
.dive-logo .dive-rider {
  position: absolute; left: 83%; top: 63.4%; width: 15%; height: auto; filter: none;
  transform-origin: 50% 0; animation: zipline 2.6s cubic-bezier(0.55, 0, 0.85, 0.35) 0.6s both;
}
@keyframes zipline {
  0% { transform: translate(-367%, -250%) rotate(-14deg); }
  80% { transform: translate(0, 0) rotate(12deg); }
  90% { transform: translate(0, 0) rotate(-6deg); }
  100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .dive-logo .dive-rider { animation: none; } }
.dive-sub { margin: 0.6rem 0 0; font-size: clamp(1.3rem, 1rem + 1.2vw, 1.9rem); color: var(--night-muted); }
.chapter.is-intro { align-items: flex-end; }
.chapter .intro-foot { flex-direction: column; align-items: center; gap: 0.4rem; text-align: center; }
.intro-name { margin: 0; font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--night-muted); }
.chapter.is-intro .scroll-cue { margin: 0; font-size: 1.6rem; letter-spacing: 0; text-transform: none; color: var(--signal); }

.scribble { position: relative; white-space: nowrap; display: inline-block; }
.scribble svg { position: absolute; left: -2%; bottom: -0.1em; width: 104%; height: 0.3em; overflow: visible; }
.scribble path { fill: none; stroke: var(--signal); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 240; stroke-dashoffset: 0; transition: stroke-dashoffset 0.9s 0.2s ease; vector-effect: non-scaling-stroke; }
html.pop-ready .scribble:not(.is-in) path { stroke-dashoffset: 240; transition: none; }

.card-note { font-size: 1.45rem; line-height: 1.2; color: var(--signal); margin: 0.2rem 0 0 !important; transform: rotate(-2deg); transform-origin: left; }
.margin-note { display: inline-block; margin-left: 0.6rem; font-size: 1.35rem; color: var(--signal-ink); transform: rotate(-3deg) translateY(3px); }

.scene-note {
  position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap; pointer-events: none;
  font-family: "Caveat", "Segoe Print", cursive; font-weight: 600; font-size: 1.55rem; line-height: 1.05;
  color: var(--night-fg); text-shadow: 0 1px 10px var(--night), 0 0 2px var(--night); will-change: transform;
}
.scene-note.is-amber { color: var(--signal); }

/* Logo "stickers": taped on, with a hand-drawn circle that draws itself */
.org-badge { position: relative; display: block; width: 11rem; margin: 0.4rem 0 1.4rem 0.4rem; transform: rotate(-3deg); transition: transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease; }
.org-badge.is-lincoln { width: 8.5rem; }
.org-logo { position: relative; display: flex; align-items: center; justify-content: center; background: #ffffff; padding: 0.8rem 1rem; border-radius: 2px; box-shadow: 0 10px 26px rgba(4, 8, 12, 0.28); border: 1px solid rgba(18, 23, 28, 0.08); }
.org-logo::before { content: ""; position: absolute; top: -9px; left: 50%; width: 52px; height: 17px; background: color-mix(in srgb, var(--signal) 55%, transparent); transform: translateX(-50%) rotate(-5deg); }
.org-logo img { display: block; width: 100%; height: auto; }
.org-badge.is-lincoln .org-logo img { width: auto; height: 5.2rem; }
.hand-circle { position: absolute; left: -16%; top: -22%; width: 132%; height: 144%; overflow: visible; pointer-events: none; }
.hand-circle path { fill: none; stroke: var(--signal); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 760; stroke-dashoffset: 0; transition: stroke-dashoffset 1.1s 0.45s ease; vector-effect: non-scaling-stroke; }
html.pop-ready .org-badge:not(.is-in) { opacity: 0; transform: translateY(14px) scale(0.55) rotate(-16deg); }
html.pop-ready .org-badge:not(.is-in) .hand-circle path { stroke-dashoffset: 760; transition: none; }
.prose .org-badge, .research-block .org-badge { float: right; margin: 0.2rem 0.6rem 1rem 1.8rem; }
.prose .org-badge img { border: 0; margin: 0; background: none; }

.timeline li > div { min-width: 0; }
.tl-logo { display: block; height: 1.7rem; width: auto; margin-top: 0.6rem; padding: 0.3rem 0.5rem; background: #ffffff; border: 1px solid var(--rule); transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease; transform-origin: left center; }
.tl-logo[alt="University of Lincoln"] { height: 3rem; }
html.pop-ready .tl-logo:not(.is-in) { opacity: 0; transform: scale(0.6) rotate(-6deg); }

.footer-dive { display: inline-flex; align-items: center; gap: 0.7rem; }
.footer-dive img { height: 34px; width: auto; }
.footer-dive .hand { font-size: 1.25rem; color: var(--night-muted); }

@media (max-width: 720px) {
  .dive-mark { top: 38%; width: 86vw; }
  .org-badge { width: 9.5rem; }
  .org-badge.is-lincoln { width: 7.5rem; }
  .org-badge.is-lincoln .org-logo img { height: 4.2rem; }
  .prose .org-badge, .research-block .org-badge { float: none; margin: 0.6rem 0 1.4rem 0.4rem; }
  .chapter-card .org-badge { width: 8.5rem; margin-bottom: 1rem; }
  .chapter-card .org-badge.is-lincoln { width: 6.5rem; }
  .chapter-card .org-badge.is-lincoln .org-logo img { height: 3.6rem; }
}
@media (prefers-reduced-motion: reduce) {
}
@media (max-width: 720px) {
  .chapter.is-hero .chapter-card { background: color-mix(in srgb, var(--night) 84%, transparent); border: 1px solid var(--night-line); padding: 1.2rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
}

/* highlighter swipe on the key points of a post */
.prose strong {
  background-image: linear-gradient(100deg, color-mix(in srgb, var(--signal) 0%, transparent) 0, color-mix(in srgb, var(--signal) 42%, transparent) 4%, color-mix(in srgb, var(--signal) 34%, transparent) 94%, color-mix(in srgb, var(--signal) 0%, transparent) 100%);
  background-repeat: no-repeat; background-position: 0 85%; background-size: 100% 58%;
  padding: 0 0.12em; margin: 0 -0.06em; border-radius: 0.25em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size 0.9s ease 0.15s;
}
html.pop-ready .prose strong:not(.is-in) { background-size: 0% 58%; transition: none; }

