/* ==========================================================================
   moogclyde.com
   ==========================================================================
   An editorial CV, after hauser.io/about-me: a big picture, a serif title, a
   grey callout that says what I do now, then one short entry per
   organisation, with a figure only where one earns its place.

   Everything is written against tokens. Dark mode is its own set of values,
   not an inversion: once for the OS setting (unless the page has been told
   "light"), once for the toggle.

   Type: Instrument Serif for the few big words, Newsreader for reading,
   Geist for interface and figures, Geist Mono for labels and anything that
   has to line up.
   ========================================================================== */

:root {
  color-scheme: light;
  --paper: #faf9f6;
  --paper-2: #f1efe9;
  --card: #ffffff;
  --ink: #16171a;
  --ink-2: #45484e;
  --muted: #6b6e75;
  --line: #e4e1d9;
  --line-strong: #cdc9bf;
  --accent: #2150d4;
  --accent-ink: #ffffff;
  --hero-a: #e8eefa;
  --hero-b: #f7f5ef;
  --shadow: 0 1px 2px rgb(22 23 26 / 0.04), 0 18px 48px -20px rgb(22 23 26 / 0.18);

  --font-display: "Instrument Serif", ui-serif, Georgia, serif;
  --font-body: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --font-ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --measure: 42rem;
  --wide: 66rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 18px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0f1112;
    --paper-2: #181b1d;
    --card: #141719;
    --ink: #ecebe6;
    --ink-2: #bdbdb6;
    --muted: #8d9093;
    --line: #262a2d;
    --line-strong: #383d41;
    --accent: #7ea6ff;
    --accent-ink: #0a1b40;
    --hero-a: #111c33;
    --hero-b: #141719;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 18px 48px -20px rgb(0 0 0 / 0.7);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f1112;
  --paper-2: #181b1d;
  --card: #141719;
  --ink: #ecebe6;
  --ink-2: #bdbdb6;
  --muted: #8d9093;
  --line: #262a2d;
  --line-strong: #383d41;
  --accent: #7ea6ff;
  --accent-ink: #0a1b40;
  --hero-a: #111c33;
  --hero-b: #141719;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 18px 48px -20px rgb(0 0 0 / 0.7);
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.1875rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

img, svg, canvas { display: block; max-width: 100%; }
figure { margin: 0; }
button { font: inherit; color: inherit; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentColor 38%, transparent);
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

strong, b { font-weight: 600; }

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

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper);
  font: 500 0.9rem/1 var(--font-ui);
  padding: 0.75rem 1rem; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 1rem; }

.print-only { display: none; }

/* ---------- Layout ---------- */

.prose {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wide {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Masthead ---------- */

.masthead {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.masthead.is-scrolled { border-bottom-color: var(--line); }

.masthead-inner {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 4.25rem;
  display: flex; align-items: center; gap: 2.25rem;
}

.brand {
  display: inline-flex; align-items: center; gap: 0.7rem;
  color: var(--ink); text-decoration: none;
}
.brand:hover { color: var(--ink); }

.avatar {
  width: 2.25rem; height: 2.25rem; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  overflow: hidden;
  background: var(--accent); color: var(--accent-ink);
  font: 400 1.02rem/1 var(--font-display);
  letter-spacing: 0.02em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.brand-name { font: 400 1.6rem/1 var(--font-display); letter-spacing: -0.005em; }

.nav { display: flex; gap: 1.75rem; font: 400 0.95rem/1 var(--font-ui); }
.nav a { position: relative; padding: 0.4rem 0; color: var(--ink-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current="true"] { color: var(--ink); }
.nav a[aria-current="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.2rem;
  height: 2px; border-radius: 2px; background: var(--accent);
}

.masthead-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

@media (max-width: 760px) {
  .nav { display: none; }
  .brand-name { font-size: 1.4rem; }
}
@media (max-width: 400px) {
  .masthead .btn-accent { padding-inline: 0.9rem; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: 500 0.95rem/1 var(--font-ui);
  padding: 0.72rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.btn svg { width: 1.05em; height: 1.05em; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-lg { font-size: 1.02rem; padding: 0.95rem 1.4rem; }

.icon-btn {
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; border: 1px solid transparent;
  color: var(--ink-2); cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.icon-btn svg { width: 1.2rem; height: 1.2rem; }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; }
}

/* ---------- Hero ----------
   The picture is the free-particle path integral, sampled: a bundle of
   Brownian bridges from x_a to x_b. The pointer moves x_b and every path
   re-bends, so the bundle widens as the time between the ends grows, exactly
   as the propagator does. Drawn by scripts/physics.js. */

.hero-wrap { padding-top: clamp(0.75rem, 2.5vw, 1.75rem); }

/* No min-height here or on .sim-stage: with aspect-ratio, a minimum height
   is carried across into a minimum width, and the box overflows a phone. */
.hero {
  position: relative;
  aspect-ratio: 2.15 / 1;
  border-radius: 22px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(90% 120% at 50% 110%, var(--hero-a), transparent 70%),
    var(--hero-b);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  touch-action: pan-y;
  cursor: crosshair;
}

.hero-caption {
  position: absolute; inset: auto 0 0 0;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem;
  padding: 1rem 1.25rem 1.05rem;
  pointer-events: none;
}
.formula {
  font: italic 400 1.02rem/1 var(--font-body);
  color: var(--ink-2);
  white-space: nowrap;
}
.formula sub, .formula sup { font-size: 0.68em; }
.hint {
  font: 400 0.75rem/1.3 var(--font-mono);
  color: var(--muted);
  text-align: right;
  transition: opacity 0.6s;
}
.hint i { font-family: var(--font-body); font-size: 1.1em; }
.hero.is-touched .hint { opacity: 0; }

/* With a portrait, the photo sits in the card like a print and every path
   starts at its edge: x_a is where I am. The formula moves to the corner. */
.hero-portrait {
  position: absolute; z-index: 1;
  top: 7%; left: 3.4%;
  height: 86%; width: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 14px;
  background: var(--paper-2);
  box-shadow: 0 1px 2px rgb(22 23 26 / 0.08), 0 22px 44px -24px rgb(22 23 26 / 0.55);
  pointer-events: none;
}
.hero > .formula {
  position: absolute; z-index: 1;
  top: 1.1rem; right: 1.3rem;
  pointer-events: none;
}
.has-portrait .hero-caption { justify-content: flex-end; }

@media (max-width: 640px) {
  .hero { aspect-ratio: 5 / 4; border-radius: 18px; }
  .hero.has-portrait { aspect-ratio: 4 / 3; }
  .hero-portrait { top: 9%; height: 82%; left: 4.5%; border-radius: 12px; }
  .hint, .hero > .formula { display: none; }
  .formula { font-size: 0.92rem; }
}

/* ---------- Intro ---------- */

h1 {
  font: 400 clamp(3rem, 8.4vw, 5.5rem)/0.98 var(--font-display);
  letter-spacing: -0.018em;
  margin: clamp(2rem, 5.5vw, 3.4rem) 0 1.75rem;
  text-wrap: balance;
}

.callout {
  background: var(--paper-2);
  border-radius: 14px;
  padding: 1.45rem 1.75rem;
  margin: 0 0 2.5rem;
  font-size: 1.3rem;
  line-height: 1.6;
}
.prose .callout p { margin: 0; }

@media (max-width: 640px) {
  body { font-size: 1.125rem; }
  .callout { font-size: 1.16rem; padding: 1.15rem 1.25rem; margin-bottom: 2rem; }
}

.prose p, .prose ul, .prose ol { margin: 0 0 1.35rem; }
.prose ul { padding-left: 1.3rem; }
.prose li { margin: 0.5rem 0; padding-left: 0.3rem; }
.prose li::marker { color: var(--muted); }
.lead-in { margin-bottom: 0.4rem !important; }

/* ---------- Sections ---------- */

.section { padding-top: clamp(3.75rem, 9vw, 6.5rem); }

.kicker {
  display: flex; align-items: center; gap: 0.9rem;
  font: 500 0.78rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.75rem;
}
.kicker::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.kicker-num { color: var(--accent); }

/* ---------- Entries (one per organisation) ---------- */

.entry { padding-top: clamp(1.25rem, 3vw, 2rem); }
.entry + .entry { margin-top: clamp(2rem, 5vw, 3rem); }
.entry + .entry::before {
  content: ""; display: block;
  max-width: var(--wide);
  margin: 0 auto clamp(2rem, 5vw, 3rem);
  height: 1px; background: var(--line);
}
@media (max-width: 1120px) {
  .entry + .entry::before { margin-inline: var(--gutter); }
}

.entry-title {
  font: 400 clamp(2.4rem, 5.2vw, 3.4rem)/1.02 var(--font-display);
  letter-spacing: -0.012em;
  margin: 0 0 0.45rem;
}
.entry-sub {
  font: italic 400 clamp(1.35rem, 2.6vw, 1.7rem)/1.2 var(--font-display);
  color: var(--ink-2);
  margin: 0 0 1rem !important;
}
.entry-meta { font-size: 1.1rem; color: var(--ink-2); margin: 0 0 1.9rem !important; }
.entry-meta strong { color: var(--ink); }
.entry-meta a { white-space: nowrap; }
/* The space after each separator in the HTML is the line's break point. */
.sep { color: var(--muted); margin: 0 0.2rem 0 0.45rem; }
.nw { white-space: nowrap; }
.entry-meta.sub-role { margin-top: 2.25rem !important; margin-bottom: 0.9rem !important; }

.figure { margin: 0 auto clamp(1.9rem, 4vw, 2.5rem); }
.figure figcaption, .fig-caption {
  font-size: 0.95rem; line-height: 1.5;
  color: var(--muted);
  text-align: center;
  margin: 0.95rem auto 0;
  max-width: 44rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- MRCM: the browser-framed screenshot ---------- */

.browser {
  display: block;
  overflow: hidden;
  color: inherit; text-decoration: none;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.browser:hover { color: inherit; transform: translateY(-3px); }
.browser-bar {
  display: flex; align-items: center; gap: 0.75rem;
  height: 2.5rem; padding: 0 0.9rem;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.dots { display: flex; gap: 6px; flex: none; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.url {
  margin-inline: auto;
  min-width: min(40%, 16rem);
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  background: var(--card); border: 1px solid var(--line);
  font: 400 0.78rem/1.2 var(--font-ui); color: var(--muted);
  text-align: center;
}
.url-spacer { width: 42px; flex: none; }
.browser img { width: 100%; height: auto; }
:root[data-theme="dark"] .browser img { filter: brightness(0.92); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .browser img { filter: brightness(0.92); }
}

/* ---------- Durham: the path-integral simulation ---------- */

.sim { padding: clamp(0.9rem, 2.5vw, 1.4rem); }

.sim-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 0.9rem;
}
.seg {
  display: inline-flex; padding: 3px;
  border-radius: 999px;
  background: var(--paper-2); border: 1px solid var(--line);
}
.seg button {
  border: 0; background: transparent; cursor: pointer;
  font: 500 0.85rem/1 var(--font-ui); color: var(--ink-2);
  padding: 0.55rem 0.95rem; border-radius: 999px;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] {
  background: var(--card); color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 0 0 1px var(--line);
}
.sim-actions { display: flex; gap: 0.5rem; }
.sim-actions .btn { padding: 0.55rem 0.9rem; font-size: 0.85rem; }

.sim-stage { position: relative; aspect-ratio: 16 / 7.2; }
@media (max-width: 900px) { .sim-stage { aspect-ratio: 16 / 9; } }
.sim-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sim-stage canvas:focus-visible { outline-offset: 2px; border-radius: 8px; }

.sim-readout {
  position: absolute; z-index: 2;
  pointer-events: none;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: var(--ink); color: var(--paper);
  font: 400 0.76rem/1.4 var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.sim-readout strong { font-weight: 600; }
.sim-readout span { color: color-mix(in srgb, var(--paper) 70%, transparent); }

.sim-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 0.5rem 1.5rem; margin-top: 0.85rem;
}
.sim-legend {
  display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem;
  margin: 0; padding: 0; list-style: none;
  font: 400 0.8rem/1.2 var(--font-ui); color: var(--ink-2);
}
.sim-legend li { display: inline-flex; align-items: center; gap: 0.45rem; }
.key { display: inline-block; flex: none; }
.key-path { width: 1rem; height: 2px; border-radius: 2px; background: var(--accent); }
.key-hist { width: 0.7rem; height: 0.7rem; border-radius: 2px; background: color-mix(in srgb, var(--accent) 45%, var(--card)); }
.key-exact { width: 1rem; height: 2px; border-radius: 2px; background: var(--ink); }
.sim-stats {
  margin: 0; font: 400 0.76rem/1.3 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.sim-stats b { font-weight: 500; color: var(--ink); }

@media (max-width: 640px) {
  .sim-stage { aspect-ratio: 4 / 3.4; }
  .seg button { padding: 0.5rem 0.7rem; }
}

/* ---------- Royal Grammar School ---------- */

.grades { padding-inline: var(--gutter); max-width: calc(var(--measure) + 2 * var(--gutter)); }
.grade-row {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65rem;
}
.grade-row li {
  background: var(--paper-2);
  border-radius: 14px;
  padding: 1.05rem 0.5rem 0.95rem;
  text-align: center;
}
.grade { display: block; font: 400 clamp(2.6rem, 7vw, 3.6rem)/1 var(--font-display); }
.subject { display: block; margin-top: 0.4rem; font: 400 0.78rem/1.25 var(--font-ui); color: var(--ink-2); }
.grade-note { margin: 0.8rem 0 0 !important; font: 400 0.9rem/1.45 var(--font-ui); color: var(--ink-2); text-align: center; }
.grade-note strong { color: var(--ink); }

@media (max-width: 520px) {
  .grade-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.pull {
  margin: 0 0 1.9rem;
  padding: 0.1rem 0 0.1rem 1.25rem;
  border-left: 2px solid var(--accent);
  font: italic 400 clamp(1.45rem, 3vw, 1.9rem)/1.25 var(--font-display);
}
.pull p { margin: 0 !important; }
.pull footer { margin-top: 0.7rem; font: 400 0.85rem/1.3 var(--font-ui); color: var(--muted); font-style: normal; }

/* ---------- Interests ---------- */

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

.card {
  position: relative;
  overflow: hidden;
  padding: 1.5rem 1.55rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
/* A soft light that follows the pointer (scripts/site.js sets --mx/--my). */
.card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(22rem circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 11%, transparent), transparent 65%);
  opacity: 0; transition: opacity 0.35s;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; }
.card svg { width: 1.7rem; height: 1.7rem; color: var(--accent); }
.card h3 { font: 400 1.85rem/1.1 var(--font-display); margin: 0.9rem 0 0.45rem; }
.card p { margin: 0; font-size: 1.07rem; line-height: 1.55; color: var(--ink-2); }
.card .fact {
  margin-top: 1.05rem;
  font: 400 0.74rem/1.2 var(--font-mono);
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.chips li {
  font: 400 0.74rem/1 var(--font-mono);
  padding: 0.38rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-2);
  background: var(--paper);
}

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

/* ---------- Logos ----------
   Organisations' marks sit on white tiles so they read the same in both
   themes; some arrive with a white background of their own. */

.logo-tile {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  height: 4rem;
  padding: 0.6rem 0.85rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.logo-tile img { height: 100%; width: auto; }
a.logo-tile { transition: border-color 0.15s, transform 0.15s; }
a.logo-tile:hover { border-color: var(--line-strong); transform: translateY(-1px); }

.logo-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.15rem; }

.partner { display: flex; align-items: center; gap: 1.1rem; margin: 0 0 1.35rem; }
.prose .partner p { margin: 0; }
@media (max-width: 460px) {
  .partner { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
}

/* ---------- Contact ---------- */

.contact { padding: clamp(5rem, 12vw, 8rem) 0 clamp(3.5rem, 8vw, 5.5rem); }
.contact-title {
  font: 400 clamp(3.2rem, 10vw, 6rem)/0.95 var(--font-display);
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.9rem; }

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--line); }
.footer-inner {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 2.25rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 1.5rem;
  font: 400 0.85rem/1.4 var(--font-ui);
  color: var(--muted);
}
.footer p { margin: 0; }
.footer a { color: var(--ink-2); }

/* ---------- 404 ---------- */

.lost { padding-bottom: clamp(4rem, 10vw, 7rem); }
.lost-code {
  font: 500 0.78rem/1 var(--font-mono);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
  margin: clamp(2rem, 5.5vw, 3.4rem) 0 0 !important;
}
.lost h1 { margin-top: 1rem; }

/* ---------- Motion ----------
   Sections rise in as they arrive. Only once scripts/site.js has checked
   what is already on screen (html.reveal-ready), so nothing visible ever
   blinks out, and nothing stays hidden if the script never runs. */

.reveal-ready .reveal:not(.is-in) { opacity: 0; transform: translateY(16px); }
.reveal { transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-ready .reveal:not(.is-in) { opacity: 1; transform: none; }
  .reveal, .browser { transition: none; }
}

/* ---------- Print: the page becomes a two-page CV ---------- */

@media print {
  @page { size: A4; margin: 13mm 15mm; }

  :root, :root[data-theme="dark"] {
    color-scheme: light;
    --paper: #fff; --paper-2: #fff; --card: #fff;
    --ink: #000; --ink-2: #222; --muted: #555;
    --line: #bbb; --accent: #000;
  }

  html { scroll-behavior: auto; }
  body { font-size: 10pt; line-height: 1.42; background: #fff; color: #000; }
  a { text-decoration: none; }

  .masthead, .skip, .hero-wrap, .screen-only, .figure, .card svg,
  .contact, .footer, .logo-row, .partner .logo-tile { display: none !important; }
  .grades { display: block !important; margin: 0 0 6pt; padding: 0; max-width: none; }

  .print-only { display: block; }
  .print-head { margin: 0 0 10pt; padding-bottom: 8pt; border-bottom: 1px solid #000; }
  .print-head p { margin: 0; font: 400 9.5pt/1.3 var(--font-ui); }
  .print-head .print-name { font: 400 26pt/1 var(--font-display); margin: 0 0 5pt; }

  .intro h1 { display: none; }
  .prose, .wide { max-width: none; padding: 0; }
  .callout { background: none; padding: 0; margin: 0 0 8pt; font-size: 10.5pt; }

  .section { padding-top: 12pt; }
  .kicker { font-size: 7.5pt; margin: 0 0 6pt; color: #000; }
  .entry { padding-top: 4pt; break-inside: avoid; }
  .entry + .entry { margin-top: 8pt; }
  .entry + .entry::before { display: none; }
  .entry-title { font-size: 15pt; margin: 0; }
  .entry-sub { font-size: 10.5pt; margin: 1pt 0 2pt !important; color: #222; }
  .entry-meta { font-size: 9.5pt; margin: 0 0 4pt !important; }
  .entry-meta.sub-role { margin-top: 6pt !important; }
  .prose p, .prose ul { margin: 0 0 4pt; }
  .prose li { margin: 1.5pt 0; }

  .grade-row { display: flex; gap: 10pt; }
  .grade-row li { background: none; padding: 0; text-align: left; }
  .grade { display: inline; font-size: 11pt; }
  .subject { display: inline; margin-left: 3pt; font-size: 9pt; }
  .grade-note { text-align: left; font-size: 9pt; margin-top: 3pt !important; }
  .pull { font-size: 11pt; margin: 4pt 0 6pt; padding-left: 8pt; border-left-width: 1px; }
  .pull footer { font-size: 8.5pt; margin-top: 2pt; }

  .cards { grid-template-columns: 1fr 1fr; gap: 6pt 14pt; }
  .card { border: 0; padding: 0; border-radius: 0; break-inside: avoid; }
  .card::before { display: none; }
  .card h3 { font-size: 11.5pt; margin: 0 0 1pt; }
  .card p { font-size: 9.5pt; color: #222; }
  .card .fact, .chips { display: none; }

  .reveal, .reveal-ready .reveal:not(.is-in) { opacity: 1 !important; transform: none !important; }
}
