@charset "UTF-8";

/* =========================================================================
   1. Tokens
   Dark theme  = slate-green chalkboard, chalk-white text, yellow-chalk accent.
   Light theme = glossy whiteboard, black-marker text, blue-marker accent,
                 red-marker highlights. Every text token is ≥ 4.5:1 on its surface.
   ========================================================================= */
:root {
  color-scheme: dark;

  /* Board */
  --board-center: #1d2a24;
  --board-edge: #121a16;
  /* Ink roles: 1 main, 2 second hand, 3 highlight, 4 accent.
     Chalk is mostly white; colour is kept to the highlights. */
  --board-ink-1: #ecebe2;           /* white chalk        */
  --board-ink-2: #dde4e8;           /* cooler white chalk */
  --board-ink-3: #f0d98a;           /* yellow chalk       */
  --board-ink-4: #eaa9a3;           /* pink chalk         */
  --board-opacity: .6;              /* gutters at full chalk; clusters behind the content column are scaled ×.72 (≈ .43) in script.js */
  --board-ghost-opacity: .08;
  --board-filter: url(#chalk);
  --draw-ink: #ecebe2;

  /* Surfaces (≈ 12.9 : 1 for --ink on --surface) */
  --page: #141c18;
  --surface: #121814;
  --surface-solid: #121814;
  --surface-2: #19211d;
  --surface-3: #222c27;
  --surface-line: rgba(228, 232, 217, .13);
  --surface-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 1.5rem 3.75rem -1.9rem rgba(0, 0, 0, .85), 0 0 0 1px rgba(0, 0, 0, .35);

  /* Text */
  --ink: #e6e9e1;                   /* 14.2 : 1 */
  --muted: #b7beb3;                 /*  9.1 : 1 */
  --quiet: #959d91;                 /*  6.0 : 1 */
  --em: #efdca3;                    /* soft chalk yellow, 13 : 1 */
  --accent: #e6be66;                /*  9.6 : 1 */
  --accent-strong: #f0cd7c;
  --on-accent: #1a1609;             /* 10.3 : 1 on accent */
  --accent-2: #eaa9a3;
  --line: rgba(220, 228, 212, .12);
  --line-strong: rgba(220, 228, 212, .24);
  --control-border: #66726a;        /* 3.6 : 1 — WCAG 1.4.11 non-text contrast */
  --focus: #f0cd7c;
  --lobe-a: #a9cbe8;
  --lobe-b: #f0d98a;

  /* Type */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --hand: "Caveat", "Playpen Sans", "Segoe Print", "Comic Sans MS", cursive;

  --step--2: clamp(.75rem, .73rem + .1vw, .8125rem);     /* 12–13  labels       */
  --step--1: clamp(.875rem, .85rem + .12vw, .9375rem);   /* 14–15  UI/secondary */
  --step-0:  clamp(1rem, .96rem + .2vw, 1.125rem);       /* 16–18  body         */
  --step-1:  clamp(1.125rem, 1.06rem + .3vw, 1.3125rem); /* 18–21  lede         */
  --step-2:  clamp(1.375rem, 1.2rem + .7vw, 1.75rem);    /* 22–28  small h3     */
  --step-3:  clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);     /* 28–40  h3           */
  --step-4:  clamp(2.25rem, 1.6rem + 2.6vw, 3.75rem);    /* 36–60  h2           */
  --step-5:  clamp(2.75rem, 1.8rem + 3.8vw, 4.75rem);    /* 44–76  contact h2   */
  --step-6:  clamp(3.5rem, 2rem + 6vw, 6.5rem);          /* 56–104 h1           */

  /* Layout */
  --shell: 1160px;                  /* px on purpose: A+ enlarges text, not the page width */
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --header-height: 4.5rem;
  --radius: 1rem;
  --radius-sm: .625rem;
  --panel-pad-block: clamp(3rem, 7vw, 6rem);
  --panel-pad-inline: clamp(1.25rem, 5vw, 4.5rem);
  --panel-gap: clamp(2.5rem, 6vw, 4.5rem);

  font-family: var(--sans);
  font-size: 100%;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html[data-theme="light"] {
  color-scheme: light;

  --board-center: #fbfcfd;
  --board-edge: #e9edf1;
  --board-ink-1: #1b1f2a;           /* black marker */
  --board-ink-2: #1f4fbf;           /* blue marker  */
  --board-ink-3: #c62828;           /* red marker   */
  --board-ink-4: #1b7a3e;           /* green marker */
  --board-opacity: .62;
  --board-ghost-opacity: .06;
  --board-filter: url(#marker);
  --draw-ink: #1f4fbf;

  --page: #f3f5f8;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f5f7fa;
  --surface-3: #eaeef3;
  --surface-line: rgba(26, 30, 36, .09);
  --surface-shadow: 0 1px 0 rgba(26, 30, 36, .04), 0 1.75rem 3.5rem -2rem rgba(31, 41, 60, .28);

  --ink: #1a1e24;                   /* 16.4 : 1 on white */
  --muted: #444b55;                 /*  8.9 : 1 */
  --quiet: #59616c;                 /*  6.2 : 1 */
  --em: #1f4fa3;                    /*  7.9 : 1 blue marker */
  --accent: #1f4fa3;
  --accent-strong: #173d80;
  --on-accent: #ffffff;             /*  7.9 : 1 */
  --accent-2: #b3232d;              /*  6.6 : 1 red marker */
  --line: rgba(26, 30, 36, .12);
  --line-strong: rgba(26, 30, 36, .24);
  --control-border: #848b96;        /* 3.4 : 1 on white */
  --focus: #1f4fa3;
  --lobe-a: #1f4fbf;
  --lobe-b: #c62828;
}

html[data-text-size="sm"] { font-size: 87.5%; }
html[data-text-size="lg"] { font-size: 112.5%; }
html[data-text-size="xl"] { font-size: 125%; }

/* =========================================================================
   2. Base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); scroll-padding-top: calc(var(--header-height) + 1.5rem); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--page); color: var(--ink); font-size: var(--step-0); line-height: 1.65; transition: background-color .35s ease, color .35s ease; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
img { display: block; width: 100%; height: auto; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; text-wrap: balance; }
p { text-wrap: pretty; }
em { font-style: italic; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.shell { width: min(var(--shell), calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-header, main, .site-footer { position: relative; z-index: 1; }
.skip-link { position: fixed; z-index: 90; top: .75rem; left: .75rem; padding: .75rem 1rem; border-radius: var(--radius-sm); transform: translateY(-200%); background: var(--accent); color: var(--on-accent); font-weight: 700; }
.skip-link:focus { transform: none; }

/* =========================================================================
   3. The board (fixed background)
   ========================================================================= */
.formula-board {
  position: fixed; z-index: 0; inset: 0; overflow: hidden; pointer-events: none;
  contain: strict; will-change: transform;
  background:
    radial-gradient(ellipse 70% 60% at 30% 30%, rgba(255, 255, 255, .035), transparent 70%),
    radial-gradient(ellipse 90% 90% at 50% 45%, var(--board-center), var(--board-edge));
}
/* Dark: slate grain + horizontal eraser wipes */
.formula-board::before, .formula-board::after { position: absolute; inset: 0; content: ""; pointer-events: none; }
.formula-board::before {
  opacity: .42;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2000' height='1200'%3E%3Cfilter id='e'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.002 .02' numOctaves='3' seed='5' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .93 0 0 0 0 .92 0 0 0 0 .88 0 0 0 1.4 -1.02'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23e)'/%3E%3C/svg%3E");
  background-size: 220px 220px, 2000px 1200px;
}
.formula-board::after { background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .32) 100%); }

/* Light: glossy whiteboard — cool white, a diagonal sheen, faint erased-marker haze, no grain */
html[data-theme="light"] .formula-board::before {
  opacity: 1;
  background-image:
    linear-gradient(103deg, transparent 28%, rgba(255, 255, 255, .85) 40%, rgba(255, 255, 255, .2) 47%, transparent 54%),
    linear-gradient(103deg, transparent 62%, rgba(255, 255, 255, .55) 68%, transparent 74%),
    radial-gradient(ellipse 34% 7% at 26% 34%, rgba(110, 122, 140, .06), transparent 70%),
    radial-gradient(ellipse 28% 6% at 72% 62%, rgba(110, 122, 140, .05), transparent 70%),
    radial-gradient(ellipse 40% 8% at 48% 86%, rgba(110, 122, 140, .05), transparent 70%);
  background-size: auto;
}
html[data-theme="light"] .formula-board::after { background: radial-gradient(ellipse at center, transparent 60%, rgba(60, 72, 90, .08) 100%); }

.board-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.board-ink { opacity: var(--board-opacity); filter: var(--board-filter); transition: opacity .35s ease; }
.board-ghost { opacity: var(--board-ghost-opacity); filter: url(#ghost); }
.board-svg text { font-family: var(--hand); font-weight: 500; }
.board-svg .ink-1 { fill: var(--board-ink-1); stroke: var(--board-ink-1); }
.board-svg .ink-2 { fill: var(--board-ink-2); stroke: var(--board-ink-2); }
.board-svg .ink-3 { fill: var(--board-ink-3); stroke: var(--board-ink-3); }
.board-svg .ink-4 { fill: var(--board-ink-4); stroke: var(--board-ink-4); }
.board-svg text { stroke-width: .75px; stroke-linejoin: round; paint-order: stroke fill; font-feature-settings: "calt" 1, "liga" 1; }
.board-svg path.stroke { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2px; }
.board-svg path.stroke.thin { stroke-width: 1.5px; }
.board-svg path.stroke.bold { stroke-width: 2.8px; }
html[data-theme="light"] .board-svg text { stroke-width: .6px; }
html[data-theme="light"] .board-svg path.stroke { stroke-width: 2.6px; }
html[data-theme="light"] .board-svg path.stroke.thin { stroke-width: 1.9px; }
html[data-theme="light"] .board-svg path.stroke.bold { stroke-width: 3.2px; }
html[data-theme="light"] .board-svg circle.dot { opacity: .9; }

.chalk-drawing-canvas { position: fixed; z-index: 30; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* The whole page is a board: no text selection or image dragging gets in the way of writing.
   Form fields stay fully selectable and editable. */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img, svg, a { -webkit-user-drag: none; user-drag: none; }
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* Writing cursors: a stick of chalk on the chalkboard, a marker on the whiteboard (hotspot = the tip). */
body.pen-down, body.pen-down * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg transform='rotate(45 16 16)'%3E%3Crect x='12.6' y='2' width='6.8' height='25' rx='2.2' fill='%23f5f2e7' stroke='%232b302c' stroke-width='1.2'/%3E%3Cpath d='M12.6 22.5h6.8' stroke='%23c9c3b0' stroke-width='1.2'/%3E%3Cpath d='M14 6.5v12' stroke='%23ffffff' stroke-width='1.3' stroke-linecap='round' opacity='.8'/%3E%3C/g%3E%3C/svg%3E") 7 25, crosshair;
}
html[data-theme="light"] body.pen-down, html[data-theme="light"] body.pen-down * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg transform='rotate(45 16 16)'%3E%3Crect x='12' y='1.5' width='8' height='8' rx='2' fill='%231f4fbf' stroke='%23122a66' stroke-width='1'/%3E%3Crect x='12.3' y='9' width='7.4' height='12.5' rx='1.2' fill='%23f4f6fa' stroke='%2333415a' stroke-width='1'/%3E%3Cpath d='M12.3 13h7.4' stroke='%231f4fbf' stroke-width='2.2'/%3E%3Cpath d='M13 21.5h6l-1.6 5.2h-2.8z' fill='%231a1f2b' stroke='%231a1f2b' stroke-width='.8' stroke-linejoin='round'/%3E%3Cpath d='M15.3 26.7h1.4l-.7 1.8z' fill='%231f4fbf'/%3E%3C/g%3E%3C/svg%3E") 7 25, crosshair;
}

/* Appears once something has been written: wipes all strokes. */
.clear-board { position: fixed; z-index: 45; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: 0 1rem 0 .85rem; border: 1px solid var(--control-border); border-radius: 999px; background: var(--surface-solid); color: var(--ink); font: 600 var(--step--1) var(--sans); box-shadow: var(--surface-shadow); cursor: pointer; transition: transform .2s ease, border-color .2s ease; }
.clear-board[hidden] { display: none; }
.clear-board:hover { border-color: var(--accent); transform: translateY(-2px); }
.clear-board svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.scroll-progress { position: fixed; z-index: 50; inset: 0 0 auto 0; height: 3px; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; transform: scaleX(0); transform-origin: 0 50%; background: var(--accent); }

/* =========================================================================
   4. Header + controls
   ========================================================================= */
.site-header { position: sticky; z-index: 40; top: 0; min-height: var(--header-height); border-bottom: 1px solid var(--surface-line); background: var(--surface-solid); }
@supports (backdrop-filter: blur(1px)) {
  @media (prefers-reduced-transparency: no-preference) {
    .site-header { background: color-mix(in srgb, var(--surface-solid) 92%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
  }
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: var(--header-height); }
.wordmark { display: inline-flex; align-items: baseline; font: 600 1.375rem/1 var(--sans); letter-spacing: -.04em; }
.wordmark span { color: var(--em); }
.wordmark i { color: var(--accent-2); font-style: normal; }
html[data-theme="dark"] .wordmark i { color: var(--accent); }
.primary-nav { display: flex; align-items: center; gap: clamp(1rem, 2.6vw, 2.25rem); font-size: var(--step--1); font-weight: 500; color: var(--muted); }
.primary-nav a { position: relative; padding-block: .5rem; transition: color .2s ease; }
.primary-nav a::after { position: absolute; right: 0; bottom: .2rem; left: 0; height: 2px; border-radius: 2px; background: var(--accent); content: ""; transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.primary-nav a:hover { color: var(--ink); }
.primary-nav a:hover::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: .625rem; }

.icon-button { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 1px solid var(--control-border); border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; transition: background-color .2s ease, border-color .2s ease, transform .2s ease; }
.icon-button:hover { background: var(--surface-3); border-color: var(--line-strong); }
.theme-toggle svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon { fill: var(--accent); stroke: none; }
html[data-theme="dark"] .theme-toggle .icon-moon, html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
.theme-toggle:hover svg { transform: rotate(-12deg); transition: transform .3s ease; }

.text-size { display: inline-flex; align-items: stretch; height: 2.75rem; padding: .1875rem; border: 1px solid var(--control-border); border-radius: 999px; }
.text-size button { display: grid; place-items: center; min-width: 2.375rem; padding: 0 .5rem; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-family: var(--serif); font-weight: 600; line-height: 1; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
/* Glyph sizes are fixed px so the control does not jump when the text size changes. */
.text-size button:nth-child(1) { font-size: 13px; }
.text-size button:nth-child(2) { font-size: 16px; }
.text-size button:nth-child(3) { font-size: 19px; }
.text-size sup { font-family: var(--sans); font-size: .85em; font-weight: 700; line-height: 0; vertical-align: .3em; margin-left: 1px; }
/* Show the current level with a quiet ring (not a loud fill that competes with the wordmark). */
html:not([data-text-size]) .text-size [data-text-step="0"],
html[data-text-size="sm"] .text-size [data-text-step="-1"],
html[data-text-size="lg"] .text-size [data-text-step="1"],
html[data-text-size="xl"] .text-size [data-text-step="1"] { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); opacity: 1; }
html[data-text-size="xl"] .text-size [data-text-step="1"] { box-shadow: inset 0 0 0 2.5px var(--accent); }
.text-size button:hover { background: var(--surface-3); color: var(--ink); }
.text-size button[aria-disabled="true"] { opacity: .38; cursor: default; }
.text-size button[aria-disabled="true"]:hover { background: transparent; color: var(--muted); }

.menu-toggle { display: none; gap: .3rem; align-content: center; }
.menu-toggle span { display: block; width: 1.125rem; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .25s ease; }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(.2rem) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-.2rem) rotate(-45deg); }

/* =========================================================================
   5. Buttons & links
   ========================================================================= */
.button { display: inline-flex; min-height: 3rem; align-items: center; justify-content: center; gap: .875rem; padding: 0 1.375rem; border: 1px solid transparent; border-radius: 999px; font-size: var(--step--1); font-weight: 600; transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease; }
.button span { font-size: 1.1em; line-height: 0; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 .75rem 1.75rem -1rem color-mix(in srgb, var(--accent) 80%, transparent); }
.button-primary:hover { background: var(--accent-strong); }
.button-ghost { border-color: var(--control-border); background: color-mix(in srgb, var(--surface-solid) 70%, transparent); color: var(--ink); }
.button-ghost:hover { border-color: var(--accent); }
.button-ghost span { color: var(--accent); }
.arrow-link { display: inline-flex; align-items: center; gap: .625rem; margin-top: 1.25rem; padding-block: .375rem; color: var(--ink); font-size: var(--step--1); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-strong); text-decoration-thickness: 1px; text-underline-offset: .3em; transition: color .2s ease, gap .2s ease, text-decoration-color .2s ease; }
.arrow-link span { color: var(--accent); text-decoration: none; }
.arrow-link:hover { gap: .9rem; text-decoration-color: var(--accent); }
.chip-button { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.5rem; padding: 0 1rem; border: 1px solid var(--control-border); border-radius: 999px; background: var(--surface-solid); color: var(--accent); font: 500 var(--step--2) var(--mono); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: border-color .2s ease, background-color .2s ease; }
.chip-button:hover { border-color: var(--accent); }
.chip-button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* Shared label styles */
.eyebrow, .work-type, .strip-label, .path-kicker, .lab-topline, .cat-note-top > span, .feature-art-top, .feature-art-foot {
  margin: 0; font: 500 var(--step--2)/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: .625rem; color: var(--muted); }
.status-dot { width: .5rem; height: .5rem; flex: none; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }

/* =========================================================================
   6. Hero
   ========================================================================= */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(16rem, .7fr); gap: clamp(2.5rem, 8vw, 7rem); align-items: center; min-height: min(46rem, calc(100vh - var(--header-height))); padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3rem, 6vw, 4.5rem); }
.hero-copy { position: relative; isolation: isolate; max-width: 40rem; }
/* Soft veil that fades to nothing — no hard edges over the board */
.hero-copy::before { position: absolute; z-index: -1; inset: -7rem -9rem -6rem -9rem; content: ""; pointer-events: none; background: radial-gradient(closest-side, color-mix(in srgb, var(--page) 94%, transparent) 55%, color-mix(in srgb, var(--page) 70%, transparent) 78%, transparent 100%); }
.hero h1 { margin: 1.5rem 0 1.25rem; font-size: var(--step-6); line-height: .95; letter-spacing: -.035em; font-variation-settings: "SOFT" 20, "WONK" 1; }
.hero h1 em { color: var(--em); }
.hero-period { color: var(--accent-2); }
html[data-theme="dark"] .hero-period { color: var(--accent); }
.hero-deck { max-width: 46ch; margin-bottom: 1.5rem; color: var(--muted); font-size: var(--step-1); line-height: 1.6; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.hero-meta li { padding: .3rem .75rem; border: 1px solid var(--line-strong); border-radius: 999px; background: color-mix(in srgb, var(--surface-solid) 60%, transparent); color: var(--muted); font: 500 var(--step--2)/1.4 var(--mono); letter-spacing: .04em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .875rem; }

/* Portrait: a print taped onto the board */
.hero-portrait { position: relative; width: min(100%, 23rem); margin: 0; justify-self: end; transform: rotate(1.2deg); }
.hero-portrait::before { position: absolute; z-index: 3; top: -.9rem; left: 50%; width: 7rem; height: 1.8rem; content: ""; transform: translateX(-50%) rotate(-3deg); background: color-mix(in srgb, #e9dfc4 72%, transparent); box-shadow: 0 1px 2px rgba(0, 0, 0, .18); clip-path: polygon(2% 8%, 98% 0, 100% 92%, 1% 100%); }
html[data-theme="light"] .hero-portrait::before { background: color-mix(in srgb, #f6efc9 80%, transparent); }
.portrait-art { position: relative; overflow: hidden; padding: .75rem .75rem 0; border-radius: 4px; background: var(--surface-solid); box-shadow: 0 1.5rem 3rem -1.5rem rgba(0, 0, 0, .55), 0 0 0 1px var(--surface-line); }
.portrait-art img { aspect-ratio: .8; border-radius: 2px; object-fit: cover; object-position: 50% 34%; transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.hero-portrait figcaption { position: relative; padding: .6rem .75rem .9rem; border-radius: 0 0 4px 4px; background: var(--surface-solid); box-shadow: 0 1.5rem 3rem -1.5rem rgba(0, 0, 0, .55), 0 0 0 1px var(--surface-line); clip-path: inset(0 -3rem -3rem -3rem); color: var(--ink); font: 600 1.5rem/1.1 var(--hand); text-align: center; }

/* Focus strip */
.focus-strip { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin-bottom: var(--panel-gap); padding: 1rem clamp(1rem, 3vw, 1.75rem); border: 1px solid var(--surface-line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--surface-shadow); }
.strip-label { color: var(--accent); }
.focus-strip ul { display: flex; flex: 1; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.focus-strip li { padding: .35rem .85rem; border-radius: 999px; background: var(--surface-3); color: var(--ink); font-size: var(--step--1); }

/* =========================================================================
   7. Panels (content always sits on a calm surface, never on the equations)
   ========================================================================= */
.panel { position: relative; margin-bottom: var(--panel-gap); padding: var(--panel-pad-block) var(--panel-pad-inline); border: 1px solid var(--surface-line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--surface-shadow); }
/* Whiteboard magnets holding each sheet */
html[data-theme="light"] .panel::before { position: absolute; top: -.55rem; left: 50%; width: 1.1rem; height: 1.1rem; border-radius: 50%; content: ""; transform: translateX(-50%); background: radial-gradient(circle at 35% 30%, #ff8a80, #c62828 60%, #8e1b1b); box-shadow: 0 2px 4px rgba(0, 0, 0, .25); }
html[data-theme="light"] .panel:nth-of-type(even)::before { background: radial-gradient(circle at 35% 30%, #8ab4ff, #1f4fbf 60%, #163a8c); }
html[data-theme="light"] .panel:nth-of-type(3n)::before { background: radial-gradient(circle at 35% 30%, #8fe0a6, #1b7a3e 60%, #11532a); }

.section-head { max-width: 42rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head h2, .concept-copy h2, .contact-inner h2 { margin: 1rem 0; font-size: var(--step-4); line-height: 1.04; letter-spacing: -.03em; }
.section-head h2 em, .concept-copy h2 em, .contact-inner h2 em { color: var(--em); }
.section-intro { max-width: 60ch; margin: 0; color: var(--muted); font-size: var(--step-0); line-height: 1.7; }
.precision-note { margin: 1rem 0 0; color: var(--quiet); font-size: var(--step--1); line-height: 1.6; }

/* Work */
.feature-work { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(16rem, .85fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; padding-block: 2rem 3rem; border-top: 1px solid var(--line); }
.feature-art { position: relative; display: flex; min-height: 21rem; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 1.25rem clamp(1rem, 3vw, 2.25rem); border: 1px solid var(--surface-line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); }
.feature-art::before, .feature-art::after { position: absolute; z-index: 0; width: 17.5rem; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 50%; content: ""; opacity: .55; pointer-events: none; }
.feature-art::before { top: -11rem; right: -4.5rem; }
.feature-art::after { right: -2rem; bottom: -15rem; width: 22.5rem; border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.feature-art-top, .feature-art-foot { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--quiet); }
.feature-art-top span:last-child { flex: none; color: var(--accent); white-space: nowrap; }
.circuit-lines { position: relative; z-index: 1; display: grid; gap: 1.5rem; padding-block: 1.5rem; }
.circuit-wire { position: relative; display: grid; grid-template-columns: 2rem minmax(1.5rem, .8fr) minmax(2.5rem, 1.3fr) minmax(2.4rem, 1.2fr) 1.6rem; align-items: center; color: var(--muted); font: var(--step--1) var(--mono); }
.circuit-wire::before { position: absolute; z-index: -1; left: 2rem; right: 1.4rem; height: 1px; background: var(--line-strong); content: ""; }
.circuit-wire > *:not(:first-child) { justify-self: center; }
.circuit-wire i, .circuit-wire b { display: grid; width: 2rem; height: 2rem; place-items: center; border: 1px solid var(--control-border); border-radius: 4px; background: var(--surface-solid); color: var(--ink); font: normal var(--step--2) var(--mono); }
.circuit-wire b { display: inline-flex; align-items: center; justify-content: center; gap: 1px; width: 2.6rem; border-radius: 999px; border-color: color-mix(in srgb, var(--accent) 70%, transparent); color: var(--accent); font-weight: 500; }
.circuit-wire > span:last-child { color: var(--accent); }
html[data-text-size="lg"] .art-equation, html[data-text-size="xl"] .art-equation { display: none; }
.amplitude-bars { position: relative; z-index: 1; display: flex; align-items: end; justify-content: center; gap: 7px; height: 1.8rem; }
.amplitude-bars i { width: 2px; height: 5px; border-radius: 2px; background: var(--quiet); }
.amplitude-bars i:nth-child(3n) { height: 14px; background: var(--accent); }
.amplitude-bars i:nth-child(4n) { height: 22px; }
.amplitude-bars i:nth-child(8n) { height: 27px; }
.feature-art-top span:first-child { text-wrap: balance; }
.feature-art-foot { z-index: 2; justify-content: center; gap: .75rem; }
.feature-art-foot span { padding-inline: .35rem; border-radius: 4px; background: var(--surface-2); }
.feature-art-foot i { width: 1.3rem; height: 1px; background: var(--accent); }
.art-equation { position: absolute; right: 1rem; bottom: 3.4rem; color: var(--quiet); font: var(--step--2) var(--mono); }
.feature-copy { max-width: 30rem; }
.work-type { margin-bottom: .875rem; color: var(--accent); }
.work-type span { color: var(--quiet); }
.work-type, .path-kicker { color: var(--accent-2) !important; }   /* pink chalk / red marker: kickers get their own role */
.feature-copy h3, .work-card-copy h3 { margin: 0 0 .875rem; font-size: var(--step-3); line-height: 1.12; letter-spacing: -.015em; }
.feature-copy > p:not(.work-type):not(.precision-note), .work-card-copy > p:not(.work-type) { color: var(--muted); font-size: var(--step-0); line-height: 1.7; }

/* Concept / Grover lab */
.concept-layout { display: grid; grid-template-columns: minmax(16rem, .85fr) minmax(20rem, 1.15fr); gap: clamp(2.5rem, 7vw, 5.5rem); align-items: center; }
.concept-copy { max-width: 30rem; }
.concept-copy h2 { font-size: clamp(2.25rem, 1.5rem + 2.3vw, 3.4rem); }
.concept-copy > p:not(.eyebrow):not(.precision-note) { color: var(--muted); font-size: var(--step-0); line-height: 1.75; }
.math-note { display: inline-block; margin-top: 1.5rem; padding: .6rem .9rem; border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; background: var(--surface-2); color: var(--ink); font: var(--step--1)/1.5 var(--mono); }
.grover-lab { padding: 1.5rem clamp(1rem, 3vw, 1.75rem) 1.25rem; border: 1px solid var(--surface-line); border-radius: var(--radius-sm); background: var(--surface-2); }
.lab-topline { display: flex; justify-content: space-between; gap: .75rem; color: var(--quiet); }
.lab-topline span:last-child { color: var(--accent); }
.grover-plot { width: 100%; margin-top: .5rem; overflow: visible; color: var(--accent); }
.plot-grid { fill: none; stroke: var(--line); stroke-width: .8; }
.plot-axis { fill: none; stroke: var(--line-strong); stroke-width: 1.2; }
.plot-arc { fill: none; stroke: var(--quiet); stroke-width: 1; stroke-dasharray: 3 6; }
.plot-vector { stroke: currentColor; stroke-width: 2.6; transition: x2 .3s ease, y2 .3s ease; }
.plot-origin { fill: var(--ink); }
.plot-label { fill: var(--quiet); font: 500 13px var(--mono); letter-spacing: .06em; }
.plot-angle { fill: var(--accent); stroke: var(--surface-2); stroke-width: 5px; paint-order: stroke fill; font: 500 15px var(--mono); }
.iteration-label, .probability-row { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: var(--step--1); }
.iteration-label output, .probability-row output { color: var(--accent); font: 500 var(--step--1) var(--mono); }
.iteration-slider { display: block; width: 100%; height: 2rem; margin: .5rem 0 1rem; accent-color: var(--accent); cursor: ew-resize; }
.probability-track { height: 6px; margin-top: .6rem; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.probability-track span { display: block; width: 6.3%; height: 100%; border-radius: inherit; background: var(--accent); transition: width .28s ease; }
.lab-note { margin: .875rem 0 0; color: var(--muted); font: var(--step--2)/1.5 var(--mono); }

/* Reading / cat note */
.reading-layout { display: grid; grid-template-columns: minmax(15rem, .75fr) minmax(20rem, 1.25fr); gap: clamp(2.5rem, 7vw, 5.5rem); align-items: center; }
.reading-layout .section-head { margin: 0; }
.cat-note { overflow: hidden; padding: 1.25rem clamp(1rem, 3vw, 1.5rem) 1rem; border: 1px solid var(--surface-line); border-radius: var(--radius-sm); background: var(--surface-2); }
.cat-note-top, .cat-note-caption { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.cat-note-top > span { color: var(--quiet); }
.cat-note-caption { flex-wrap: wrap; margin: 0; color: var(--quiet); font-size: var(--step--2); }
.cat-plot { display: block; width: 100%; margin-block: .5rem; }
.cat-grid { fill: none; stroke: var(--line); stroke-width: .8; }
.cat-axis { fill: none; stroke: var(--line-strong); stroke-width: 1.2; }
.cat-wave { fill: none; stroke-width: 1.4; opacity: .8; }
.cat-wave-a { stroke: var(--lobe-a); }
.cat-wave-b { stroke: var(--lobe-b); }
.lobe-a-stop { stop-color: var(--lobe-a); stop-opacity: .55; }
.lobe-a-edge { stop-color: var(--lobe-a); stop-opacity: 0; }
.lobe-b-stop { stop-color: var(--lobe-b); stop-opacity: .55; }
.lobe-b-edge { stop-color: var(--lobe-b); stop-opacity: 0; }
.cat-lobe { transition: transform .55s cubic-bezier(.2, .8, .2, 1), opacity .4s ease; transform-box: fill-box; transform-origin: center; }
.cat-lobe-a { fill: url(#lobeA); }
.cat-lobe-b { fill: url(#lobeB); }
.cat-point { fill: var(--ink); }
.cat-state { fill: var(--ink); font: 500 17px var(--mono); }
.cat-axis-label { fill: var(--quiet); stroke: var(--surface-2); stroke-width: 4px; paint-order: stroke fill; font: 14px var(--mono); }
.cat-note.is-observed .cat-lobe-a { opacity: .12; transform: translateX(45px); }
.cat-note.is-observed .cat-lobe-b { transform: translateX(-10px) scale(1.08); }
.observation-note { margin: .75rem 0 0; padding-top: .75rem; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--step--1); }

/* Path */
.path-layout { display: grid; grid-template-columns: minmax(14rem, .7fr) minmax(20rem, 1.3fr); gap: clamp(2.5rem, 7vw, 5.5rem); }
.path-layout > .section-head { position: sticky; top: calc(var(--header-height) + 3rem); align-self: start; margin: 0; }
.path-content { min-width: 0; }
.education-row { display: grid; grid-template-columns: 10rem 1.5rem 1fr; gap: 1.125rem; padding-bottom: 2.5rem; }
.path-date span { white-space: nowrap; }
.path-date { padding-top: .2rem; color: var(--quiet); font: 500 var(--step--2)/1.5 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.path-mark { position: relative; display: flex; justify-content: center; }
.path-mark::before { position: absolute; top: .4rem; bottom: -2.6rem; width: 1px; background: var(--line-strong); content: ""; }
.timeline > li:last-child .path-mark::before { display: none; }
.timeline > li:last-child { padding-bottom: 0; }
.path-mark i { position: relative; z-index: 1; width: .7rem; height: .7rem; margin-top: .35rem; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface-solid); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.path-kicker { margin-bottom: .6rem; color: var(--accent); }
html[data-theme="light"] .path-kicker { color: var(--accent-2); }
.path-copy h3 { margin: 0 0 .5rem; font-size: var(--step-2); line-height: 1.2; }
.path-copy h3 span { color: var(--quiet); }
.path-copy > p:last-child { max-width: 60ch; margin-bottom: 0; color: var(--muted); font-size: var(--step-0); line-height: 1.7; }
.program-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2rem; margin: 0; padding: 0; list-style: none; }
.program-list > li { display: grid; grid-template-columns: 2rem 1fr; gap: .5rem; align-items: baseline; padding: .875rem 0; border-bottom: 1px solid var(--line); }
.program-list > li > span { color: var(--accent); font: 500 var(--step--2) var(--mono); }
.program-list p { margin: 0; color: var(--ink); font-size: var(--step--1); font-weight: 500; line-height: 1.45; }
.program-list small { display: block; margin-top: .2rem; color: var(--quiet); font: 400 var(--step--2) var(--mono); }

/* About */
.about-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(16rem, .75fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.about-text p { max-width: 62ch; color: var(--muted); font-size: var(--step-0); line-height: 1.75; }
.about-text p:first-child { color: var(--ink); font-size: var(--step-1); line-height: 1.65; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; margin: 2rem 0 0; }
.facts > div { padding: .9rem 0; border-top: 1px solid var(--line); }
.facts dt { margin-bottom: .2rem; color: var(--quiet); font: 500 var(--step--2) var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.facts dd { margin: 0; color: var(--ink); font-size: var(--step--1); font-weight: 500; }
.about-photo { position: relative; margin: .5rem 0 0; transform: rotate(-1.2deg); }
.about-photo img { aspect-ratio: 4 / 4.4; border-radius: var(--radius-sm); object-fit: cover; object-position: 50% 30%; box-shadow: 0 1.25rem 2.5rem -1.5rem rgba(0, 0, 0, .55); }
.about-photo figcaption { margin-top: .75rem; color: var(--em); font: 600 1.4rem/1.1 var(--hand); text-align: center; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .5rem; padding: 0; list-style: none; }
.tags li { padding: .25rem .7rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font: 500 var(--step--2)/1.5 var(--mono); }

/* Projects: interactive demo sits under the feature project */
.demo-block { margin-top: 1rem; padding-top: 3rem; border-top: 1px solid var(--line); }
.demo-block h3 { margin: 0 0 1rem; font-size: var(--step-3); line-height: 1.1; letter-spacing: -.02em; }
.demo-block h3 em { color: var(--em); }

/* Timeline extras */
.timeline { margin: 0; padding: 0; list-style: none; }
.path-org { margin: 0 0 .75rem; color: var(--quiet); font-size: var(--step--1); font-weight: 500; }
.role-points { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: var(--step-0); line-height: 1.65; }
.role-points li + li { margin-top: .35rem; }
.role-points li::marker { color: var(--accent); }

/* Programs */
.program-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 1rem; }

/* Contact */
.contact-layout { display: grid; grid-template-columns: minmax(14rem, .7fr) minmax(0, 1.3fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.contact-photo { margin: 0 0 1.5rem; transform: rotate(1.4deg); }
.contact-photo img { aspect-ratio: 4 / 4.2; border-radius: var(--radius-sm); object-fit: cover; object-position: 50% 28%; box-shadow: 0 1.25rem 2.5rem -1.5rem rgba(0, 0, 0, .55); }
.contact-links { margin: 0; padding: 0; list-style: none; }
.contact-links li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; align-items: baseline; padding: .8rem 0; border-top: 1px solid var(--line); }
.contact-links span { color: var(--quiet); font: 500 var(--step--2) var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.contact-links a, .contact-links p { margin: 0; color: var(--ink); font-size: var(--step--1); font-weight: 500; }
.contact-links a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: .25em; }
.contact-links a:hover { text-decoration-color: var(--accent); }
.contact-links a span { color: var(--accent); text-transform: none; }
.contact-form { display: grid; gap: 1.1rem; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--surface-line); border-radius: var(--radius-sm); background: var(--surface-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field > span { color: var(--muted); font: 500 var(--step--2) var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.field input, .field textarea { width: 100%; min-height: 3rem; padding: .75rem .9rem; border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: var(--surface-solid); color: var(--ink); font-size: var(--step-0); line-height: 1.5; -webkit-user-select: text; user-select: text; transition: border-color .2s ease, box-shadow .2s ease; }
.field textarea { min-height: 9rem; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--quiet); font-style: italic; opacity: .8; }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--accent-2); }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.form-actions .button { cursor: pointer; }
.form-actions .button:disabled { opacity: .65; cursor: progress; transform: none; }
.form-note { margin: 0; color: var(--quiet); font-size: var(--step--1); }
.form-note.is-error { color: var(--accent-2); font-weight: 500; }
.form-note.is-ok { color: var(--ink); font-weight: 500; }

/* Footer */
.site-footer { border-top: 1px solid var(--surface-line); background: var(--surface-solid); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 1.5rem 3rem; align-items: center; padding-block: 2.5rem; }
.footer-brand { display: flex; flex-direction: column; gap: .5rem; }
.footer-brand p { margin: 0; color: var(--muted); font-size: var(--step--1); }
.footer-nav, .footer-actions { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; font-size: var(--step--1); }
.footer-nav a, .footer-actions a { padding-block: .4rem; color: var(--muted); transition: color .2s ease; }
.footer-nav a:hover, .footer-actions a:hover { color: var(--ink); }
.footer-actions span { color: var(--accent); }
.footer-bottom > :last-child { justify-self: end; }
.phase-note { position: absolute; z-index: 70; bottom: calc(100% + .5rem); left: 50%; padding: .6rem .9rem; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--ink); font: var(--step--1) var(--mono); white-space: nowrap; box-shadow: 0 .5rem 2rem rgba(0, 0, 0, .25); transform: translateX(-50%); }
.phase-note:empty { display: none; }
.phase-wrap { position: relative; justify-self: center; }
.footer-bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding-block: .75rem; border-top: 1px solid var(--line); color: var(--quiet); font: var(--step--2) var(--mono); }
.footer-bottom .icon-button { position: relative; border-color: transparent; color: var(--accent); font-size: 1.1rem; }
.footer-bottom .icon-button:hover { border-color: var(--line-strong); }

/* =========================================================================
   8. Observer mode (Easter egg — always dark, fixed colours)
   ========================================================================= */
.observer-mode[hidden] { display: none; }
.observer-mode { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; overflow: hidden; background: #121a16; color: #e6e9e1; isolation: isolate; }
.observer-canvas { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; }
.observer-content { width: min(44rem, calc(100% - 2.6rem)); padding-block: 4.5rem; }
.observer-kicker { display: flex; align-items: center; gap: .625rem; color: #e6be66; font: 500 var(--step--2) var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.observer-kicker span { width: .4rem; height: .4rem; border-radius: 50%; background: #e4e8d9; box-shadow: 0 0 13px #e4e8d9; }
.observer-content h2 { margin: 1.6rem 0 1.1rem; font-size: var(--step-5); line-height: 1.04; letter-spacing: -.03em; }
.observer-content h2 em { color: #efdca3; }
.observer-content > p:not(.observer-kicker) { max-width: 30rem; color: #b7beb3; font-size: var(--step-0); }
.observer-close { display: inline-flex; align-items: center; gap: 1.25rem; min-height: 2.75rem; margin-top: 1.8rem; padding: .7rem 0; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .3); background: transparent; color: #fff; font-size: var(--step--1); cursor: pointer; }
.observer-close kbd { padding: .2rem .4rem; border: 1px solid rgba(255, 255, 255, .3); border-radius: 4px; color: #c7cbbf; font: var(--step--2) var(--mono); }
.observer-equation { display: block; margin-top: 4rem; color: rgba(205, 216, 197, .6); font: var(--step--1) var(--mono); }

/* =========================================================================
   9. Reveal (with a no-JS / failed-JS fallback)
   ========================================================================= */
.js .reveal { opacity: 0; transform: translateY(1rem); transition: opacity .65s ease, transform .65s cubic-bezier(.2, .7, .2, 1); animation: reveal-fallback 0s linear 2.5s forwards; }
.js .reveal.is-visible { opacity: 1; transform: none; animation: none; }
.reveal-ready .reveal { animation: none; }   /* script.js loaded: let the scroll reveal drive it */
@keyframes reveal-fallback { to { opacity: 1; transform: none; } }
.js .facts.reveal, .js .about-photo.reveal { transition-delay: .08s; }

/* =========================================================================
   10. Responsive
   ========================================================================= */
@media (max-width: 1080px) {
  .primary-nav { gap: 1.1rem; }
  .text-size button { min-width: 2.1rem; padding: 0 .35rem; }
}

@media (max-width: 980px) {
  :root { --header-height: 4.25rem; }
  .hero { grid-template-columns: minmax(0, 1.1fr) minmax(14rem, .8fr); gap: 2.5rem; }
  .program-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-layout { grid-template-columns: 1fr; }
  .contact-side { display: grid; grid-template-columns: minmax(10rem, 14rem) 1fr; gap: 1.5rem; align-items: start; }
  .contact-photo { margin: 0; }
  .concept-layout, .reading-layout { grid-template-columns: 1fr; }
  .concept-copy, .reading-layout .section-head { max-width: 40rem; }
  .path-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .path-layout > .section-head { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .primary-nav { position: absolute; top: calc(100% + 1px); right: var(--gutter); left: var(--gutter); display: none; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: .5rem 1.25rem; border: 1px solid var(--surface-line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--surface-solid); box-shadow: var(--surface-shadow); font-size: var(--step-0); }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { padding: .9rem 0; border-bottom: 1px solid var(--line); }
  .primary-nav a::after { display: none; }
  .primary-nav a:last-child { border: 0; }
  .menu-toggle { display: grid; }
  html:not(.js) .primary-nav { position: static; display: flex; flex-flow: row wrap; gap: .75rem; padding: 0; border: 0; box-shadow: none; background: none; }
  html:not(.js) .menu-toggle { display: none; }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 3rem; min-height: auto; padding-top: 2.5rem; }
  .hero-portrait { width: min(80%, 20rem); justify-self: center; }
  .feature-work { grid-template-columns: 1fr; gap: 1.75rem; }
  .feature-art { min-height: 17rem; }
  .about-layout { grid-template-columns: 1fr; }
  .about-photo { max-width: 26rem; }
  .program-list, .program-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .contact-side { grid-template-columns: 1fr; }
  .contact-photo { max-width: 18rem; }
  .facts { grid-template-columns: 1fr; }
  .education-row { grid-template-columns: 1.25rem 1fr; }
  .education-row .path-date { grid-column: 2; grid-row: 1; }
  .education-row .path-mark { grid-column: 1; grid-row: 1 / span 2; }
  .education-row .path-copy { grid-column: 2; }
  .footer-bottom > span:first-child { visibility: hidden; max-height: 0; overflow: hidden; }
  /* Phones: skip the costly chalk filter and ghost blur; the per-word hand jitter carries the look. */
  .board-ink { filter: none; }
  .board-ghost { filter: none; }
}

@media (max-width: 560px) {
  :root { --header-height: 4rem; --gutter: 1rem; --radius: .75rem; }
  .nav-wrap { gap: .5rem; }
  .nav-actions { gap: .375rem; }
  .text-size { height: 2.5rem; }
  .text-size button { min-width: 1.95rem; padding: 0 .2rem; }
  .icon-button { width: 2.5rem; height: 2.5rem; }
  .wordmark { font-size: 1.2rem; }
  .hero-actions .button { flex: 1 1 auto; }
  .focus-strip { padding: 1rem; }
  .panel { padding-inline: 1.125rem; }
  .feature-art-top span:first-child { max-width: 15rem; }
  .art-equation { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .text-size { padding: .125rem; }
  .text-size button { min-width: 1.7rem; padding: 0 .1rem; }
  .icon-button { width: 2.375rem; height: 2.375rem; }
}

@media (pointer: coarse) {
  .board-ink, .board-ghost { filter: none; }
}

/* Larger text: give the hero copy a wider veil and quieten the board behind it. */
html[data-text-size="lg"] .board-ink, html[data-text-size="xl"] .board-ink { opacity: calc(var(--board-opacity) * .7); }
html[data-text-size="xl"] .hero-copy::before { inset: -7rem -12rem -6rem -12rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media (forced-colors: active) {
  .formula-board, .chalk-drawing-canvas { display: none; }
  .panel, .focus-strip { border: 1px solid CanvasText; }
  .chip-button[aria-pressed="true"], .text-size button { forced-color-adjust: auto; }
  .chip-button[aria-pressed="true"],
  html:not([data-text-size]) .text-size [data-text-step="0"],
  html[data-text-size="sm"] .text-size [data-text-step="-1"],
  html[data-text-size="lg"] .text-size [data-text-step="1"],
  html[data-text-size="xl"] .text-size [data-text-step="1"] { outline: 2px solid Highlight; outline-offset: -3px; }
}

@media print {
  .button { border: 1px solid #000; box-shadow: none; }
  :root, html[data-theme] { --on-accent: #000; --ink: #000; --muted: #333; --quiet: #555; --em: #000; --accent: #000; --accent-2: #000; --surface: #fff; --surface-solid: #fff; --surface-2: #fff; --page: #fff; --line: #ccc; --line-strong: #999; }
  body { background: #fff; color: #000; }
  .formula-board, .chalk-drawing-canvas, .site-header, .scroll-progress, .observer-mode, .focus-strip, .hero-portrait::before { display: none !important; }
  .panel { box-shadow: none; border: 0; padding-inline: 0; }
  html[data-theme="light"] .panel::before { display: none; }
  .js .reveal { opacity: 1; transform: none; }
}
