/* ==========================================================================
   MEW · MYWU Labs™ — mywulabs.com
   Hand-written CSS. No framework, no CDN, no tracking.
   Faces are self-hosted (see assets/fonts) so the page makes zero third-party
   requests: a portfolio about data sovereignty should not phone home.
   ========================================================================== */

/* --------------------------------------------------------------- faces --- */

@font-face {
  font-family: "MEW Display";
  src: url("../fonts/playfair-display-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MEW Display";
  src: url("../fonts/playfair-display-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MEW Serif";
  src: url("../fonts/merriweather-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MEW Serif";
  src: url("../fonts/merriweather-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MEW Sans";
  src: url("../fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MEW Sans";
  src: url("../fonts/atkinson-hyperlegible-next-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MEW Sans";
  src: url("../fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* -------------------------------------------------------------- tokens --- */

:root {
  color-scheme: light;

  --font-display: "MEW Display", Georgia, "Times New Roman", serif;
  --font-serif: "MEW Serif", Georgia, "Times New Roman", serif;
  --font-sans: "MEW Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --paper: #f7f2e9;
  --paper-deep: #efe7d9;
  --card: #fffdf9;
  --ink: #191310;
  --ink-soft: #4b423a;
  --muted: #675c50;
  --faint: #726759;
  --line: #e2d8c7;
  --line-strong: #cfc1ab;

  --ginger: #b8471e;
  --ginger-ink: #a03d16;
  --ginger-wash: #f7e6da;
  --teal: #0f766e;
  --teal-wash: #dff1ed;
  --gold: #9a6a08;

  --shadow-sm: 0 1px 2px rgba(25, 19, 16, 0.05), 0 4px 14px rgba(25, 19, 16, 0.04);
  --shadow-md: 0 2px 4px rgba(25, 19, 16, 0.05), 0 18px 40px -18px rgba(25, 19, 16, 0.28);
  --ring: color-mix(in srgb, var(--teal) 55%, transparent);

  --shell: 1180px;
  --gutter: clamp(1.15rem, 4vw, 2.75rem);
  --radius: 14px;
  --radius-lg: 22px;
  --hair: 1px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --paper: #0c0f14;
    --paper-deep: #090c11;
    --card: #12171f;
    --ink: #f2ece2;
    --ink-soft: #c8c0b4;
    --muted: #a49b8b;
    --faint: #948b7e;
    --line: #222a34;
    --line-strong: #2f3947;

    --ginger: #f0894f;
    --ginger-ink: #f5a877;
    --ginger-wash: #2a1a12;
    --teal: #2dd4bf;
    --teal-wash: #0c2724;
    --gold: #e0b357;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 18px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.5), 0 28px 60px -28px rgba(0, 0, 0, 0.9);
    --ring: color-mix(in srgb, var(--teal) 65%, transparent);
  }
}

/* Explicit choices from the theme button override the media query. */
html[data-theme="light"] {
  color-scheme: light;
  --paper: #f7f2e9;
  --paper-deep: #efe7d9;
  --card: #fffdf9;
  --ink: #191310;
  --ink-soft: #4b423a;
  --muted: #675c50;
  --faint: #726759;
  --line: #e2d8c7;
  --line-strong: #cfc1ab;
  --ginger: #b8471e;
  --ginger-ink: #a03d16;
  --ginger-wash: #f7e6da;
  --teal: #0f766e;
  --teal-wash: #dff1ed;
  --gold: #9a6a08;
  --shadow-sm: 0 1px 2px rgba(25, 19, 16, 0.05), 0 4px 14px rgba(25, 19, 16, 0.04);
  --shadow-md: 0 2px 4px rgba(25, 19, 16, 0.05), 0 18px 40px -18px rgba(25, 19, 16, 0.28);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0c0f14;
  --paper-deep: #090c11;
  --card: #12171f;
  --ink: #f2ece2;
  --ink-soft: #c8c0b4;
  --muted: #a49b8b;
  --faint: #948b7e;
  --line: #222a34;
  --line-strong: #2f3947;
  --ginger: #f0894f;
  --ginger-ink: #f5a877;
  --ginger-wash: #2a1a12;
  --teal: #2dd4bf;
  --teal-wash: #0c2724;
  --gold: #e0b357;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 18px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.5), 0 28px 60px -28px rgba(0, 0, 0, 0.9);
}

/* ---------------------------------------------------------------- base --- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
  line-height: 1.62;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Paper grain: a hair of warmth so large flat fields do not read as plastic. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(
    circle at 1px 1px,
    color-mix(in srgb, var(--ink) 9%, transparent) 1px,
    transparent 0
  );
  background-size: 4px 4px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.022em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 1rem;
  text-wrap: pretty;
}

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}

a:hover {
  text-decoration-color: currentColor;
}

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

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

hr {
  border: 0;
  border-top: var(--hair) solid var(--line);
  margin: 0;
}

/* --------------------------------------------------------------- shell --- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Edge-to-edge band (the stats strip) where the gutter must not apply. */
.shell--flush {
  padding-inline: 0;
}

main {
  position: relative;
  z-index: 1;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 60;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 0 0 8px 8px;
  font-weight: 500;
  transition: top 0.18s ease;
}

.skip-link:focus {
  top: 0;
}

/* -------------------------------------------------------------- header --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: var(--hair) solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px -24px rgba(0, 0, 0, 0.55);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 4.25rem;
}

/* ==========================================================================
   MYWU Labs™ lockup — one piece of finished artwork per theme

   The supplied logo is already a complete lockup: the interlocked MYWU
   monogram, the wordmark (MYWU … LS), the cat, and the μ / ✦ / ruler / brain /
   RNA / Σ glyph rail along the bottom rule. So the old assembly of "mark image
   + live MYWU / Labs™ text" is gone — there is nothing left to set in type, and
   no stack of webfonts could match the artwork's letterforms anyway.

   Two files, same geometry, one per theme. The light artwork's navy (#142c4a)
   has ~75% of its ink below L45, so it disappears on #0c0f14; the dark artwork
   is that drawing with only the navy strokes lifted along a slate→periwinkle
   ramp, which keeps the monogram legible while the gold rail stays identical.
   The light master is hand-authored; the dark sibling is generated from it by
   scripts/make-brand-icons.py, so a rebrand replaces one file.
   ========================================================================== */

.lockup {
  /* One knob: width drives height through the artwork's aspect ratio. */
  --lockup-w: 260px;
  /* native artwork size — 1024 x 576 */
  --lockup-ratio: 1024 / 576;

  display: block;
  width: var(--lockup-w);
  flex: none;
  aspect-ratio: var(--lockup-ratio);
  background-image: url("../img/logo-lockup.png");
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: contain;
  text-decoration: none;
}

/* Dark surfaces swap to the lightened-navy artwork. `data-theme="auto"` (the
   default) follows the OS setting, mirroring the palette switch above. */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .lockup,
  html:not([data-theme]) .lockup {
    background-image: url("../img/logo-lockup-dark.png");
  }
}

html[data-theme="dark"] .lockup {
  background-image: url("../img/logo-lockup-dark.png");
}

/* Header. The artwork is a full lockup, so the bar is sized to let it read
   rather than shrinking it into illegibility. */
.site-lockup {
  --lockup-w: 244px;
}

.site-header__inner {
  min-height: 6.5rem;
}

/* Footer: a touch larger. */
.lockup--footer {
  --lockup-w: 250px;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav a:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.4rem;
}

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.62rem 1.05rem;
  border: var(--hair) solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

/* The ginger is dark in light mode and light in dark mode, so the label has to
   flip with it: cream on deep ginger, near-black on bright ginger. */
.btn--accent {
  --btn-bg: var(--ginger);
  --btn-fg: #fff8f2;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .btn--accent,
  html:not([data-theme]) .btn--accent {
    --btn-fg: #1a0c05;
  }
}

html[data-theme="dark"] .btn--accent {
  --btn-fg: #1a0c05;
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--line-strong);
}

.btn--ghost:hover {
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}

.btn--sm {
  padding: 0.48rem 0.85rem;
  font-size: 0.84rem;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: var(--hair) solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.icon-btn svg {
  width: 1.05rem;
  height: 1.05rem;
}

/* Theme button shows only the glyph for the state it will switch *to*. */
.theme-btn [data-when] {
  display: none;
}

html[data-theme="auto"] .theme-btn [data-when="auto"],
html[data-theme="light"] .theme-btn [data-when="light"],
html[data-theme="dark"] .theme-btn [data-when="dark"],
html:not([data-theme]) .theme-btn [data-when="auto"] {
  display: block;
}

.menu {
  display: none;
}

/* ---------------------------------------------------------------- hero --- */

.hero {
  position: relative;
  padding-block: clamp(2.5rem, 6vw, 4.75rem) clamp(2rem, 4vw, 3.25rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 1.9rem;
  height: 1px;
  background: var(--line-strong);
}

.eyebrow--ginger {
  color: var(--ginger-ink);
}

.eyebrow--ginger::before {
  background: currentColor;
  opacity: 0.5;
}

/* Sized from measured text widths so both halves of the pun stay on one line
   each. "Mine bring it back." is the long half; above ~66px it wraps and the
   joke lands on four lines instead of two. */
.hero h1 {
  font-size: clamp(2.1rem, 1.55rem + 2.55vw, 4rem);
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin-bottom: 1.25rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--ginger);
  position: relative;
  white-space: nowrap;
}

/* The "/" in RAG/t stays ink so the pun is legible, the t is the token. */
.hero h1 .slash {
  color: var(--line-strong);
  font-weight: 500;
}

.hero h1 .tok {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72em;
  font-weight: 700;
  color: var(--teal);
  transform: translateY(-0.06em);
}

.hero__lede {
  font-family: var(--font-serif);
  font-size: clamp(1.02rem, 0.95rem + 0.42vw, 1.22rem);
  line-height: 1.66;
  color: var(--ink-soft);
  max-width: 33ch;
  margin-bottom: 1.9rem;
}

.hero__lede strong {
  color: var(--ink);
  font-weight: 700;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 1.9rem;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.hero__meta .pip {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--teal) 60%, transparent);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--teal) 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --------------------------------------------------------------- stage --- */

.stage-wrap {
  position: relative;
}

.stage {
  position: relative;
  border: var(--hair) solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 78% 8%, color-mix(in srgb, var(--ginger) 13%, transparent), transparent 62%),
    radial-gradient(90% 80% at 10% 100%, color-mix(in srgb, var(--teal) 12%, transparent), transparent 60%),
    var(--card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 760 / 330;
  touch-action: pan-y;
}

/* Faint plotter grid — reads as a lab bench, not a chat app. */
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(120% 120% at 50% 40%, #000 20%, transparent 78%);
  opacity: 0.85;
  pointer-events: none;
}

.stage__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.stage__hud {
  position: absolute;
  inset: auto 0 auto 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.62rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  pointer-events: none;
  z-index: 2;
}

.stage__hud code {
  font: inherit;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage__hud .prompt {
  color: var(--teal);
  font-weight: 700;
}

.caret {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 1px;
  background: var(--teal);
  vertical-align: -0.16em;
  animation: blink 1.15s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.stage__badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.12rem 0.5rem;
  border: var(--hair) solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.stage-caption {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
}

.stage-caption strong {
  color: var(--ink-soft);
  font-weight: 500;
}

.stage-caption__glyph {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ginger);
}

/* --------------------------------------------------------------- strip --- */

.strip {
  border-top: var(--hair) solid var(--line);
  border-bottom: var(--hair) solid var(--line);
  background: color-mix(in srgb, var(--paper-deep) 55%, transparent);
}

.strip__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.stat {
  background: var(--paper);
  padding: 1.5rem 1.35rem;
}

html[data-theme="light"] .stat,
html:not([data-theme]) .stat {
  background: color-mix(in srgb, var(--paper-deep) 45%, var(--paper));
}

.stat__num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}

.stat__num span {
  color: var(--ginger);
}

.stat__label {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ------------------------------------------------------------- section --- */

.section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
  scroll-margin-top: 4.75rem;
}

.section + .section {
  border-top: var(--hair) solid var(--line);
}

.section__head {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(1.25rem, 4vw, 3.5rem);
  align-items: end;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.9rem);
}

.section__head h2 {
  font-size: clamp(1.9rem, 1.3rem + 2.7vw, 3.05rem);
  letter-spacing: -0.03em;
}

.section__head h2 em {
  font-style: normal;
  color: var(--ginger);
}

.section__head p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 1.02rem;
  line-height: 1.68;
  max-width: 46ch;
}

.section__head p strong {
  font-weight: 700;
  color: var(--ink);
}

/* ---------------------------------------------------------------- work --- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.5rem 1.4rem 1.35rem;
  background: var(--card);
  border: var(--hair) solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.card__idx {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.card h3 {
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.015em;
}

.card p {
  margin: 0;
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.card__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.38rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.card__list li {
  position: relative;
  padding-left: 1.05rem;
  line-height: 1.5;
}

.card__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--ginger) 70%, transparent);
}

.card--accent {
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--ginger) 7%, var(--card)), var(--card) 55%);
}

.card__tag {
  margin-top: auto;
  padding-top: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ginger-ink);
}

/* -------------------------------------------------------------- steps --- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 2.2rem;
  background: var(--line);
  border: var(--hair) solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.step {
  background: var(--card);
  padding: 1.4rem 1.35rem 1.5rem;
}

.step__n {
  display: inline-grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--ginger-wash);
  color: var(--ginger-ink);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.step h3 {
  font-size: 1.02rem;
  margin-bottom: 0.35rem;
}

.step p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
}

/* --------------------------------------------------------------- work --- */

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

.work {
  display: grid;
  gap: 0.55rem;
  align-content: start;
  padding: 1.5rem 1.45rem;
  background: var(--card);
  border: var(--hair) solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.work:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.work__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.work h3 {
  font-size: 1.16rem;
  letter-spacing: -0.012em;
}

.work__kind {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.work p {
  margin: 0;
  font-size: 0.915rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin-top: 0.2rem;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.2rem 0.5rem;
  border: var(--hair) solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-deep) 60%, transparent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
}

/* ----------------------------------------------------------- expertise --- */

.spec {
  display: grid;
  gap: 0;
  border-top: var(--hair) solid var(--line);
}

.spec__row {
  display: grid;
  grid-template-columns: minmax(9rem, 15rem) minmax(0, 1fr);
  gap: 0.75rem 2rem;
  padding: 1.15rem 0;
  border-bottom: var(--hair) solid var(--line);
}

.spec__row dt {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.spec__row dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
}

.chip {
  padding: 0.2rem 0.56rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.chip--warm {
  background: var(--ginger-wash);
  color: var(--ginger-ink);
}

.chip--cool {
  background: var(--teal-wash);
  color: var(--teal);
}

.pullquote {
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding: clamp(1.4rem, 3vw, 2.1rem) clamp(1.3rem, 3vw, 2.2rem);
  border-left: 3px solid var(--ginger);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.pullquote p {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.1rem, 1rem + 0.75vw, 1.5rem);
  line-height: 1.45;
  letter-spacing: -0.018em;
  color: var(--ink);
  max-width: 52ch;
}

.pullquote footer {
  margin-top: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* -------------------------------------------------------------- lists --- */

.record {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: var(--hair) solid var(--line);
}

.record li {
  display: grid;
  grid-template-columns: 4.4rem minmax(0, 1fr);
  gap: 0.3rem 1.2rem;
  padding: 0.85rem 0;
  border-bottom: var(--hair) solid var(--line);
  font-size: 0.93rem;
  line-height: 1.55;
}

.record__year {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 0.18rem;
}

.record__body {
  color: var(--ink-soft);
}

.record__body b {
  color: var(--ink);
  font-weight: 500;
}

.record__body i {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-soft);
}

.record__venue {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3.25rem);
}

.split > div > h3 {
  font-size: 1.28rem;
  margin-bottom: 1rem;
  letter-spacing: -0.015em;
}

.two-col-note {
  margin-top: 1.5rem;
  font-size: 0.87rem;
  color: var(--muted);
  max-width: 58ch;
}

/* -------------------------------------------------------------- courses -- */

.courses {
  display: grid;
  gap: 0;
  border-top: var(--hair) solid var(--line);
  margin: 0;
  padding: 0;
  list-style: none;
}

.course {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.35rem 1.1rem;
  padding: 0.85rem 0;
  border-bottom: var(--hair) solid var(--line);
  font-size: 0.93rem;
}

.course__code {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  color: var(--ginger-ink);
  white-space: nowrap;
}

.course__title {
  color: var(--ink-soft);
}

/* The "(graduate)" aside must stay quieter than the course name. This is a
   class rather than a style="" attribute because inline styles are blocked by
   the site's style-src 'self' policy. */
.course__note {
  color: var(--muted);
}

.course__n {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* -------------------------------------------------------------- contact -- */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
}

.contact h2 {
  font-size: clamp(1.95rem, 1.3rem + 2.9vw, 3.15rem);
  letter-spacing: -0.032em;
  margin-bottom: 1rem;
}

.contact h2 em {
  font-style: normal;
  color: var(--ginger);
}

.contact__lede {
  font-family: var(--font-serif);
  color: var(--ink-soft);
  line-height: 1.68;
  max-width: 40ch;
}

.direct {
  display: grid;
  gap: 0.55rem;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
}

.direct a,
.direct span {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
  text-decoration: none;
}

.direct a:hover {
  color: var(--teal);
}

.direct svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--faint);
}

.form {
  display: grid;
  gap: 0.85rem;
  padding: clamp(1.25rem, 2.5vw, 1.9rem);
  background: var(--card);
  border: var(--hair) solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

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

.field {
  display: grid;
  gap: 0.32rem;
}

.field label {
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.62rem 0.72rem;
  border: var(--hair) solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.45;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  resize: vertical;
  min-height: 6.2rem;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent);
}

.form__hint {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--muted);
}

.form__status {
  margin: 0;
  font-size: 0.82rem;
  color: var(--teal);
  min-height: 1.2em;
}

.form__status[data-state="err"] {
  color: var(--ginger-ink);
}

/* --------------------------------------------------------------- footer -- */

.site-footer {
  margin-top: clamp(2rem, 5vw, 4rem);
  border-top: var(--hair) solid var(--line);
  background: color-mix(in srgb, var(--paper-deep) 45%, transparent);
  padding-block: 2.5rem 2.75rem;
}

.footer__grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}

.footer__brand .lockup {
  margin-bottom: 0.35rem;
}

.footer__note {
  margin: 0.5rem 0 0;
  max-width: 34ch;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  font-size: 0.84rem;
}

.footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.footer__nav a:hover {
  color: var(--teal);
}

.footer__legal {
  margin: 1.75rem 0 0;
  padding-top: 1.1rem;
  border-top: var(--hair) solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* ------------------------------------------------------------ reveal ----- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------ responsive - */

@media (max-width: 1000px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .hero__lede {
    max-width: 46ch;
  }

  .stage {
    aspect-ratio: 760 / 300;
  }

  .section__head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .section__head p {
    max-width: 60ch;
  }

  .contact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .site-nav,
  .header-tools .btn--cta {
    display: none;
  }

  /* Full-lockup artwork: give the nav/menu room instead of a wall-to-wall logo. */
  .site-lockup {
    --lockup-w: 196px;
  }

  .site-header__inner {
    min-height: 5.5rem;
  }

  .menu {
    display: block;
    position: relative;
    margin-left: auto;
  }

  .menu > summary {
    list-style: none;
    cursor: pointer;
  }

  .menu > summary::-webkit-details-marker {
    display: none;
  }

  .menu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.6rem);
    min-width: 13rem;
    padding: 0.45rem;
    background: var(--card);
    border: var(--hair) solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: grid;
    gap: 0.1rem;
    z-index: 40;
  }

  .menu__panel a {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    color: var(--ink-soft);
    font-size: 0.92rem;
    text-decoration: none;
  }

  .menu__panel a:hover {
    background: color-mix(in srgb, var(--ink) 6%, transparent);
    color: var(--ink);
  }

  .strip__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-grid,
  .split,
  .steps,
  .form__row {
    grid-template-columns: 1fr;
  }

  .spec__row {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .course {
    grid-template-columns: 1fr auto;
  }

  .course__title {
    grid-column: 1 / -1;
    order: 3;
  }
}

@media (max-width: 560px) {
  :root {
    --radius-lg: 16px;
  }

  .site-lockup {
    --lockup-w: 158px;
  }

  .site-header__inner {
    min-height: 4.75rem;
  }

  .lockup--footer {
    --lockup-w: 200px;
  }

  .stage {
    aspect-ratio: 760 / 380;
  }

  .stage__badge {
    display: none;
  }

  .record li {
    grid-template-columns: 3.3rem minmax(0, 1fr);
    gap: 0.2rem 0.8rem;
    font-size: 0.89rem;
  }

  .hero__actions .btn {
    flex: 1 1 auto;
  }

  .footer__nav {
    gap: 0.35rem 1rem;
  }
}

/* ---------------------------------------------------------------- print -- */

@media print {
  :root {
    --paper: #fff;
    --card: #fff;
    --ink: #000;
    --ink-soft: #222;
    --muted: #444;
    --line: #ccc;
  }

  body::before,
  .site-header,
  .stage-wrap,
  .form,
  .hero__actions,
  .hero__meta,
  .skip-link,
  .footer__nav {
    display: none !important;
  }

  body {
    font-size: 10pt;
    line-height: 1.35;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  .section {
    padding-block: 0.6rem;
    break-inside: avoid;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .cards,
  .work-grid,
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .card,
  .work,
  .step {
    break-inside: avoid;
    box-shadow: none;
  }

  @page {
    size: letter;
    margin: 0.55in;
  }
}

/* --------------------------------------------------------- a11y / motion - */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .caret,
  .live-dot {
    animation: none;
  }
}

/* ==========================================================================
   Hero illustration — the cat, the token, the corpus.
   Everything is CSS-coloured so the whole scene re-themes with the page.
   ========================================================================== */

.chunk rect {
  fill: color-mix(in srgb, var(--ink) 10%, transparent);
}

.chunk {
  animation: chunkDrift 7s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  transform-box: fill-box;
  transform-origin: center;
}

/* Offsets live in classes, not style="" attributes: the site ships
   style-src 'self' with no 'unsafe-inline', so an inline style attribute is
   dropped by the browser and the stagger silently collapses to one beat.
   (Ask me how I know. Measured: all three drift delays came back 0s.) */
.chunk--b { --d: 1.6s; }
.chunk--c { --d: 3.1s; }

@keyframes chunkDrift {
  0%, 100% { opacity: 0.5; transform: translateY(0); }
  50% { opacity: 0.85; transform: translateY(-5px); }
}

/* ---- token ------------------------------------------------------------- */

.token-halo {
  fill: color-mix(in srgb, var(--teal) 16%, transparent);
  animation: haloPulse 3.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes haloPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.86); }
  50% { opacity: 0.85; transform: scale(1.08); }
}

.token-ring {
  fill: none;
  stroke: color-mix(in srgb, var(--teal) 40%, transparent);
  stroke-width: 1.25;
  stroke-dasharray: 4 5;
  animation: spin 14s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.token-face {
  fill: var(--card);
  stroke: var(--teal);
  stroke-width: 1.6;
}

.token-glyph {
  fill: var(--teal);
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -1px;
}

.token-body {
  animation: tokenBob 2.9s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes tokenBob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-7px) rotate(4deg); }
}

.token-spark {
  fill: var(--ginger);
  animation: sparkle 2.2s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 0.25; }
  45% { opacity: 1; }
}

/* ---- cat --------------------------------------------------------------- */

.cat-shadow {
  fill: color-mix(in srgb, var(--ink) 15%, transparent);
}

.cat-body,
.cat-face {
  fill: var(--ginger);
}

.cat-face {
  fill: color-mix(in srgb, var(--ginger) 88%, var(--card));
}

.cat-belly {
  fill: color-mix(in srgb, var(--paper) 62%, var(--ginger));
  opacity: 0.5;
}

.cat-ear {
  fill: var(--ginger);
}

.cat-ear-in {
  fill: color-mix(in srgb, var(--ginger) 45%, var(--paper));
}

.cat-ear,
.cat-ear-in,
.cat-face,
.cat-body,
.cat-legs rect,
.cat-tail path,
.cat-eyes ellipse,
.cat-nose,
.cat-mouth,
.cat-whiskers path,
.cat-stripes path,
.cat-doc rect,
.cat-doc path {
  vector-effect: non-scaling-stroke;
}

.cat-legs rect {
  fill: color-mix(in srgb, var(--ginger) 78%, var(--ink));
}

.cat-legs--far rect {
  fill: color-mix(in srgb, var(--ginger) 58%, var(--ink));
}

.cat-stripes path {
  fill: none;
  stroke: color-mix(in srgb, var(--ginger) 45%, var(--ink));
  stroke-width: 2.1;
  stroke-linecap: round;
  opacity: 0.55;
}

/* Gallop cycle only while the cat is actually moving. */
.cat.is-run .cat-legs--near rect:first-child { animation: legA 0.42s ease-in-out infinite; }
.cat.is-run .cat-legs--near rect:last-child { animation: legB 0.42s ease-in-out infinite; }
.cat.is-run .cat-legs--far rect:first-child { animation: legB 0.42s ease-in-out infinite; }
.cat.is-run .cat-legs--far rect:last-child { animation: legA 0.42s ease-in-out infinite; }

@keyframes legA {
  0%, 100% { transform: translate(2px, 0) rotate(6deg); }
  50% { transform: translate(-3px, -2px) rotate(-8deg); }
}

@keyframes legB {
  0%, 100% { transform: translate(-3px, -2px) rotate(-8deg); }
  50% { transform: translate(2px, 0) rotate(6deg); }
}

.cat-tail {
  transform-box: fill-box;
  transform-origin: 100% 100%;
  transition: transform 0.12s linear;
}

.cat-tail path {
  fill: none;
  stroke: var(--ginger);
  stroke-width: 5.5;
  stroke-linecap: round;
}

.cat-tail-tip path,
.cat-tail .cat-tail-tip {
  stroke: color-mix(in srgb, var(--ginger) 55%, var(--paper));
}

.cat-eyes ellipse {
  fill: var(--ink);
}

.cat-nose {
  fill: color-mix(in srgb, var(--ginger) 40%, var(--ink));
}

.cat-mouth {
  fill: none;
  stroke: color-mix(in srgb, var(--ginger) 40%, var(--ink));
  stroke-width: 1.1;
  stroke-linecap: round;
  opacity: 0.8;
}

.cat-whiskers path {
  stroke: color-mix(in srgb, var(--ink) 45%, transparent);
  stroke-width: 1;
  stroke-linecap: round;
}

.cat-doc rect {
  fill: var(--card);
  stroke: color-mix(in srgb, var(--teal) 55%, transparent);
  stroke-width: 1.2;
}

.cat-doc path {
  stroke: color-mix(in srgb, var(--teal) 60%, transparent);
  stroke-width: 1.1;
  stroke-linecap: round;
  fill: none;
}

.cat-doc {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.cat.is-run .cat-doc {
  opacity: 1;
}

/* ---- retrieval toast --------------------------------------------------- */

.pop {
  opacity: 0;
  transform-box: fill-box;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.pop.is-shown {
  opacity: 1;
}

.pop-bg {
  fill: var(--ink);
  opacity: 0.94;
}

.pop-text {
  font-family: var(--font-mono);
  font-size: 10.5px;
  fill: var(--paper);
  letter-spacing: 0.02em;
}

.pop-key {
  fill: color-mix(in srgb, var(--teal) 70%, var(--paper));
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

/* ---- work note + status feedback --------------------------------------- */

.work__note {
  margin: 0 !important;
  padding-left: 0.7rem;
  border-left: 2px solid var(--line-strong);
  font-size: 0.82rem !important;
  color: var(--muted) !important;
  font-style: italic;
}

.stage__badge.is-hit {
  color: var(--teal);
  border-color: color-mix(in srgb, var(--teal) 55%, transparent);
  background: var(--teal-wash);
}

@media (prefers-reduced-motion: reduce) {
  .chunk,
  .token-halo,
  .token-ring,
  .token-body,
  .token-spark,
  .cat-legs rect {
    animation: none !important;
  }

  .cat-doc {
    opacity: 1;
  }
}

.form__fallback {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--teal);
}
