/* toni.im design system: cinematic dark. Tokens and rules are documented in design-system/MASTER.md.
   Fonts (Bricolage Grotesque, Iosevka Charon) come from Google Fonts via the <link> in each page head. */

/* ---------- tokens: dark (default) ---------- */
:root {
  color-scheme: dark;
  --bg0: #07080c;
  --bg1: #0b0d14;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --header-bg: rgba(7, 8, 12, 0.72);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #ededef;
  --muted: #9ba0aa;
  --primary: #5e6ad2;
  --primary-text: #a9b0ff;
  --cyan: #22d3ee;
  --cyan-text: #22d3ee;
  --ember: #f97316;
  --ember-text: #fb9a4b;
  --cta-bg: #f97316;
  --cta-ink: #140a03;
  --cta-hover: #fb8a3c;
  --focus: #22d3ee;
  --blob-a: 94, 106, 210;
  --blob-b: 34, 211, 238;
  --blob-c: 249, 115, 22;
  --blob-op: 0.14;
  --glow: 0 0 0 1px rgba(34, 211, 238, 0.25), 0 12px 48px rgba(94, 106, 210, 0.25);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -18px rgba(0, 0, 0, 0.6);
  --spot: rgba(94, 106, 210, 0.2);
  --name-1: linear-gradient(100deg, #ededef 0%, #22d3ee 100%);
  --name-2: linear-gradient(100deg, #a9b0ff 0%, #fb9a4b 100%);

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --body: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Iosevka Charon", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 40px; --s6: 64px; --s7: 96px;
  --r: 16px;
  --r-sm: 10px;
  --wrap: 72rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 220ms;
  --header-h: 64px;
}

/* ---------- tokens: light ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg0: #f5f6fb;
  --bg1: #eceef7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-2: #ffffff;
  --header-bg: rgba(245, 246, 251, 0.8);
  --line: rgba(18, 20, 28, 0.13);
  --line-strong: rgba(18, 20, 28, 0.3);
  --text: #12141c;
  --muted: #4a5060;
  --primary: #4350c4;
  --primary-text: #3a46b8;
  --cyan: #0891b2;
  --cyan-text: #0e7490;
  --ember: #ea580c;
  --ember-text: #b8400a;
  --cta-bg: #c2410c;
  --cta-ink: #ffffff;
  --cta-hover: #a8380a;
  --focus: #3a46b8;
  --blob-op: 0.16;
  --glow: 0 0 0 1px rgba(67, 80, 196, 0.25), 0 12px 40px rgba(67, 80, 196, 0.18);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 14px 30px -16px rgba(30, 40, 90, 0.25);
  --spot: rgba(67, 80, 196, 0.14);
  --name-1: linear-gradient(100deg, #12141c 0%, #0e7490 100%);
  --name-2: linear-gradient(100deg, #3a46b8 0%, #b8400a 100%);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg0: #f5f6fb; --bg1: #eceef7;
    --surface: rgba(255, 255, 255, 0.72); --surface-2: #ffffff;
    --header-bg: rgba(245, 246, 251, 0.8);
    --line: rgba(18, 20, 28, 0.13); --line-strong: rgba(18, 20, 28, 0.3);
    --text: #12141c; --muted: #4a5060;
    --primary: #4350c4; --primary-text: #3a46b8;
    --cyan: #0891b2; --cyan-text: #0e7490;
    --ember: #ea580c; --ember-text: #b8400a;
    --cta-bg: #c2410c; --cta-ink: #ffffff; --cta-hover: #a8380a;
    --focus: #3a46b8; --blob-op: 0.16;
    --glow: 0 0 0 1px rgba(67, 80, 196, 0.25), 0 12px 40px rgba(67, 80, 196, 0.18);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 14px 30px -16px rgba(30, 40, 90, 0.25);
    --spot: rgba(67, 80, 196, 0.14);
    --name-1: linear-gradient(100deg, #12141c 0%, #0e7490 100%);
    --name-2: linear-gradient(100deg, #3a46b8 0%, #b8400a 100%);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 100%) fixed, var(--bg0);
  color: var(--text);
  font: 400 1rem/1.6 var(--body);
  font-optical-sizing: auto;
  overflow-wrap: break-word;
  overflow-x: clip;
}
main { flex: 1; }
a { color: var(--primary-text); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -0.015em; }
.page-head h1, .cv-head h1, .nf h1 { font-weight: 700; }
p { margin: 0 0 var(--s3); }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s3); }
.i { width: 1.15em; height: 1.15em; flex: none; }
.label { font: 500 0.8250rem/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--s3); top: -4rem; z-index: 60; background: var(--cta-bg); color: var(--cta-ink); padding: var(--s2) var(--s3); border-radius: var(--r-sm); }
.skip:focus { top: var(--s3); }

/* ---------- ambient light ---------- */
.ambient { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; opacity: var(--blob-op); will-change: transform; }
.blob.a { left: -18vmax; top: -22vmax; background: radial-gradient(closest-side, rgb(var(--blob-a)), transparent); animation: drift-a 36s ease-in-out infinite alternate; }
.blob.b { right: -22vmax; top: 6vmax; background: radial-gradient(closest-side, rgb(var(--blob-b)), transparent); animation: drift-b 44s ease-in-out infinite alternate; }
.blob.c { left: 22vmax; bottom: -34vmax; width: 52vmax; height: 52vmax; background: radial-gradient(closest-side, rgb(var(--blob-c)), transparent); opacity: calc(var(--blob-op) * 0.7); animation: drift-c 52s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate3d(10vmax, 8vmax, 0) scale(1.1); } }
@keyframes drift-b { to { transform: translate3d(-12vmax, 10vmax, 0) scale(0.92); } }
@keyframes drift-c { to { transform: translate3d(-8vmax, -10vmax, 0) scale(1.12); } }
body > header, body > main, body > footer { position: relative; z-index: 1; }
body > header { z-index: 40; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; background: var(--header-bg); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 44px; font: 600 1.05rem var(--display); color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.brand svg { width: 30px; height: 30px; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; font: 500 0.8938rem var(--mono); }
.nav a { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding-inline: 12px; color: var(--muted); text-decoration: none; border-radius: var(--r-sm); transition: color var(--dur) var(--ease); }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--cyan), var(--ember)); }
.theme-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: var(--s1); color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.theme-toggle:hover { border-color: var(--line-strong); transform: rotate(14deg); }
.theme-toggle .i { width: 20px; height: 20px; }
.theme-toggle .moon { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-toggle .sun { display: none; }
  :root:not([data-theme]) .theme-toggle .moon { display: block; }
}

/* ---------- buttons, pills, chips, badges ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; font: 600 0.95rem var(--body); border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.btn:active { transform: scale(0.98); }
.btn-cta { background: var(--cta-bg); color: var(--cta-ink); box-shadow: 0 8px 28px -8px rgba(249, 115, 22, 0.55); }
.btn-cta:hover { background: var(--cta-hover); transform: translateY(-2px); }
.btn-glass { background: var(--surface); color: var(--text); border-color: var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.btn-glass:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; font: 500 0.8938rem var(--mono); color: var(--muted); text-decoration: none; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.pill:hover { color: var(--text); border-color: var(--line-strong); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chips li { padding: 4px 12px; font: 500 0.8250rem/1.6 var(--mono); color: var(--text); border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; font: 500 0.7563rem/1.7 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; border-radius: 999px; border: 1px solid currentColor; }
.badge.live { color: var(--cyan-text); }
.badge.oss { color: var(--primary-text); }
.badge.plat { color: var(--muted); }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- glass, spotlight ---------- */
.glass { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.spot { position: relative; overflow: hidden; transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.spot::before { content: ""; position: absolute; inset: 0; background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), var(--spot-c, var(--spot)), transparent 62%); opacity: 0; transition: opacity var(--dur) var(--ease); pointer-events: none; }
.spot > * { position: relative; z-index: 1; }
.spot:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--glow); }
.spot:hover::before { opacity: 1; }
a.spot { color: inherit; text-decoration: none; }

/* ---------- entrance + reveal (transform/opacity only) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 250ms var(--ease) both; animation-delay: calc(var(--d, 0) * 25ms); }
html.js .reveal { opacity: 0; transform: translateY(16px); }
html.js .reveal.in { opacity: 1; transform: none; transition: opacity 280ms var(--ease), transform 280ms var(--ease); }

/* ---------- home ---------- */
.hero-home { position: relative; min-height: calc(100vh - var(--header-h)); min-height: calc(100svh - var(--header-h)); display: flex; align-items: flex-start; }
.hero-text { position: relative; z-index: 2; max-width: 38rem; padding-block: var(--s5) var(--s4); }
.prompt { font: 500 0.9625rem var(--mono); color: var(--cyan-text); margin: 0 0 var(--s3); }
.prompt::before { content: "$ "; color: var(--muted); }
.name { font-size: clamp(3.5rem, 1.5rem + 8vw, 8rem); line-height: 0.96; letter-spacing: -0.03em; font-weight: 800; margin: 0; }
.name span { display: block; width: fit-content; padding-bottom: 0.06em; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.name .n1 { background-image: var(--name-1); }
.name .n2 { background-image: var(--name-2); }
.role { font: 500 clamp(1rem, 0.9rem + 0.5vw, 1.25rem)/1.4 var(--display); color: var(--text); margin: var(--s3) 0 var(--s2); }
.lede { color: var(--muted); max-width: 32rem; font-size: 1.0625rem; margin-bottom: var(--s4); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: var(--s3); }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-canvas { position: absolute; z-index: 1; inset: auto 0 0 0; height: 42%; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 30%); mask-image: linear-gradient(to bottom, transparent 0%, #000 30%); }
.hero-canvas canvas { display: block; width: 100%; height: 100%; }
.bento { display: grid; gap: var(--s3); padding-block: var(--s4) var(--s6); }
.tile { display: flex; flex-direction: column; gap: var(--s2); min-height: 168px; padding: var(--s4); }
.tile .ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--tc, var(--cyan-text)); background: var(--surface-2); border: 1px solid var(--line); }
.tile h2 { font-size: 1.35rem; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.tile h2 .i { color: var(--muted); transition: transform var(--dur) var(--ease), color var(--dur) var(--ease); }
a.tile:hover h2 .i { transform: translate(3px, -3px); color: var(--text); }
.tile p { color: var(--muted); font-size: 0.9375rem; margin: 0; }
.t-cv { --tc: var(--cyan-text); --spot-c: rgba(34, 211, 238, 0.16); }
.t-pr { --tc: var(--primary-text); --spot-c: rgba(94, 106, 210, 0.24); }
.t-do { --tc: var(--ember-text); --spot-c: rgba(249, 115, 22, 0.16); }
.t-now { --tc: var(--primary-text); }

/* ---------- page heads ---------- */
.page-head { padding-block: var(--s6) var(--s4); }
.page-head h1 { font-size: clamp(2.5rem, 1.5rem + 5vw, 5rem); letter-spacing: -0.035em; }
.page-head .sub { color: var(--muted); font-size: 1.125rem; max-width: 36rem; margin: var(--s3) 0 0; }

/* ---------- cv ---------- */
.cv-layout { display: grid; gap: var(--s5); padding-bottom: var(--s6); }
.rail { display: none; }
.cv-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3) var(--s4); padding-block: var(--s5) var(--s4); border-bottom: 1px solid var(--line); margin-bottom: var(--s4); }
.cv-head h1 { font-size: clamp(2.75rem, 1.5rem + 5vw, 5rem); letter-spacing: -0.035em; }
.cv-role { font: 500 1.125rem/1.4 var(--display); color: var(--muted); margin: var(--s2) 0; }
.cv-contact { font: 500 0.8938rem/1.9 var(--mono); color: var(--muted); margin: 0; }
.cv-contact a { color: var(--text); }
.cv-actions { display: flex; flex-direction: column; gap: var(--s1); align-items: flex-start; }
.cv-actions .note { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.cv section { padding-block: var(--s4) 0; }
.cv h2 { font: 500 0.8938rem/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan-text); margin-bottom: var(--s3); display: flex; align-items: center; gap: var(--s2); }
.cv h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.cv p, .cv-skills { max-width: 46rem; }
.skill-group { margin-bottom: var(--s3); }
.skill-group h3 { font: 500 0.8938rem var(--mono); color: var(--text); margin-bottom: var(--s2); letter-spacing: 0; }
.tl { position: relative; padding-left: 28px; }
.tl::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 0; width: 2px; background: linear-gradient(180deg, var(--cyan), var(--primary) 60%, transparent); opacity: 0.6; }
.job { position: relative; margin-bottom: var(--s4); max-width: 46rem; }
.job::before { content: ""; position: absolute; left: -28px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg0); border: 2px solid var(--cyan); box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.14), 0 0 16px rgba(34, 211, 238, 0.7); }
.job h3 { font-size: 1.35rem; }
.job h3 span { font: 400 0.9375rem var(--body); color: var(--muted); margin-left: var(--s2); letter-spacing: 0; }
.job .meta { font: 500 0.8938rem/1.7 var(--mono); color: var(--muted); margin: 4px 0 var(--s2); }
.job ul { margin: 0; padding-left: 1.1rem; }
.job li { margin-bottom: 6px; }
.job li::marker { color: var(--cyan-text); }
.asof { display: inline-block; margin-left: var(--s2); padding: 0 8px; font-size: 0.6875rem; border: 1px solid var(--line-strong); border-radius: 999px; white-space: nowrap; }

/* ---------- projects ---------- */
.grid { display: grid; gap: var(--s3); }
.proj { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); background: linear-gradient(160deg, rgb(var(--tint) / 0.12), transparent 60%), var(--surface); --spot-c: rgb(var(--tint) / 0.22); }
.proj h3 { font-size: 1.6rem; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.proj p { color: var(--muted); margin: 0; }
.proj .links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: auto; }
.proj .links a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 500 0.9625rem var(--mono); color: var(--text); text-decoration: none; }
.proj .links a:hover { color: var(--primary-text); }
.proj.p-full { padding: var(--s5) var(--s4); }
.proj.p-full h3 { font-size: 2.1rem; }
.proj.p-full p { max-width: 50rem; font-size: 1.0625rem; }
.tint-cyan { --tint: 34 211 238; }
.tint-indigo { --tint: 120 132 255; }
.tint-ember { --tint: 249 115 22; }
.tint-violet { --tint: 168 85 247; }
.tint-green { --tint: 52 211 153; }
.rows { display: grid; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.rowlink { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 56px; padding: 10px var(--s4); color: var(--text); text-decoration: none; }
.rowlink span.t { font-weight: 500; }
.rowlink .tag { font: 500 0.8250rem var(--mono); color: var(--muted); }
.rowlink .i { color: var(--muted); }
.section-title { font: 500 0.8938rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan-text); margin: var(--s6) 0 var(--s3); }
.section-title:first-child { margin-top: 0; }

/* ---------- donate ---------- */
.donate { display: grid; gap: var(--s5); align-items: center; padding: var(--s4); margin-bottom: var(--s6); }
.qr-frame { position: relative; width: 260px; max-width: 100%; margin-inline: auto; padding: 10px; border-radius: 26px; background: linear-gradient(135deg, var(--cyan), var(--primary) 55%, var(--ember)); box-shadow: 0 0 60px rgba(34, 211, 238, 0.28), 0 0 120px rgba(94, 106, 210, 0.2); }
.qr-frame::after { content: ""; position: absolute; inset: -18px; z-index: -1; border-radius: 40px; background: radial-gradient(closest-side, rgba(94, 106, 210, 0.35), transparent); animation: pulse 6s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.5; transform: scale(0.96); } to { opacity: 1; transform: scale(1.04); } }
.qr { display: block; border-radius: 16px; overflow: hidden; }
.qr img { display: block; width: 100%; height: auto; }
.pay h2 { font-size: 1.75rem; margin-bottom: var(--s2); }
.pay .thanks { color: var(--muted); }
.brow { display: grid; gap: 4px var(--s3); grid-template-columns: 1fr; padding: 14px var(--s3); margin-bottom: var(--s2); }
.brow dt { font: 500 0.8250rem/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.brow dd { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); font: 500 1.1688rem var(--mono); min-width: 0; }
.brow dd span { min-width: 0; overflow-wrap: anywhere; }
.copy { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 104px; padding: 0 14px; font: 500 0.8938rem var(--mono); color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.copy:hover { border-color: var(--line-strong); }
.copy[data-state="done"] { background: var(--cta-bg); color: var(--cta-ink); border-color: var(--cta-bg); }
.copy-status { min-height: 1.5em; margin: var(--s2) 0 0; font: 500 0.8938rem var(--mono); color: var(--cyan-text); }
.note { font-size: 0.9375rem; color: var(--muted); }

/* ---------- 404 ---------- */
.nf { padding-block: var(--s7); }
.nf h1 { font-size: clamp(2.5rem, 1.2rem + 6vw, 5.5rem); letter-spacing: -0.04em; max-width: 14ch; }
.nf .trace { display: block; margin: var(--s4) 0; padding: var(--s3); font: 500 0.9625rem/1.7 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.nf .trace b { color: var(--ember-text); font-weight: 500; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: var(--s4); font: 500 0.8938rem/1.7 var(--mono); color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s1) var(--s4); }
.site-footer a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer nav { display: flex; flex-wrap: wrap; column-gap: var(--s3); }

/* ---------- breakpoints ---------- */
@media (max-width: 29.99rem) {
  .brand .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav a { padding-inline: 8px; }
  .nav a[aria-current="page"]::after { left: 8px; right: 8px; }
  .nav { font-size: 0.86rem; }
}
@media (min-width: 40rem) {
  .wrap { padding-inline: var(--s4); }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .grid.two { grid-template-columns: repeat(2, 1fr); }
  .grid.two .p-full, .grid.two .p-third:last-child { grid-column: 1 / -1; }
  .brow { grid-template-columns: 10rem 1fr; align-items: center; }
  .donate { grid-template-columns: auto 1fr; padding: var(--s5); }
  .hero-text { padding-top: var(--s6); }
}
@media (min-width: 64rem) {
  .wrap { padding-inline: var(--s5); }
  .hero-home { align-items: center; }
  .hero-text { padding-block: var(--s6); }
  .hero-canvas { inset: 0 0 0 auto; width: 56%; height: auto; -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 18%); mask-image: linear-gradient(to right, transparent 0%, #000 18%); }
  .bento { grid-template-columns: repeat(4, 1fr); }
  .cv-layout { grid-template-columns: 15rem minmax(0, 1fr); gap: var(--s6); }
  .rail { display: block; position: sticky; top: 96px; align-self: start; padding-top: var(--s5); }
  .rail ul { list-style: none; margin: 0 0 var(--s4); padding: 0; }
  .rail a { display: flex; align-items: center; min-height: 36px; padding-left: 14px; border-left: 2px solid var(--line); font: 500 0.8938rem var(--mono); color: var(--muted); text-decoration: none; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
  .rail a:hover { color: var(--text); }
  .rail a[aria-current="true"] { color: var(--text); border-left-color: var(--cyan); }
  .rail dl { margin: 0; display: grid; gap: var(--s3); }
  .rail dt { font: 500 0.7563rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
  .rail dd { margin: 2px 0 0; font-size: 0.875rem; }
  .cv-head { padding-top: var(--s6); }
  .grid.bento-p { grid-template-columns: repeat(6, 1fr); }
  .grid.bento-p .p-half { grid-column: span 3; }
  .grid.bento-p .p-third, .grid.bento-p .p-third:last-child { grid-column: span 2; }
  .grid.bento-p .p-full { grid-column: 1 / -1; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  html.js .reveal { opacity: 1; transform: none; }
  .spot:hover, .btn-cta:hover, .btn-glass:hover, .theme-toggle:hover { transform: none; }
}

/* ---------- print: always a light, clean A4 ---------- */
@media print {
  @page { size: A4; margin: 13mm 15mm; }
  :root, :root[data-theme="dark"], :root[data-theme="light"] {
    color-scheme: light;
    --bg0: #fff; --bg1: #fff; --surface: #fff; --surface-2: #fff; --line: #bbb; --line-strong: #888;
    --text: #111; --muted: #444; --cyan-text: #0b5e75; --primary-text: #2f3a99; --ember-text: #8a3407;
  }
  html, body { background: #fff !important; color: #111; }
  body { display: block; min-height: 0; font: 400 9.5pt/1.4 var(--body); overflow: visible; }
  .ambient, .site-header, .site-footer, .skip, .cv-actions, .rail { display: none !important; }
  html.js .reveal { opacity: 1 !important; transform: none !important; }
  .wrap { max-width: none; padding-inline: 0; }
  a { color: inherit; text-decoration: none; }
  .cv-layout { display: block; padding: 0; }
  .cv-head { padding: 0 0 3mm; margin-bottom: 0; }
  .cv-head h1 { font-size: 22pt; }
  .cv-role { font-size: 10.5pt; margin: 1mm 0; }
  .cv-contact { font-size: 8.5pt; line-height: 1.5; }
  .cv-contact a { color: #111; }
  .cv section { padding-top: 3.5mm; }
  .cv h2 { font-size: 8pt; margin-bottom: 1.5mm; color: #0b5e75; }
  .cv h2::after { background: #bbb; }
  .cv p, .cv-skills { max-width: none; }
  .cv p { margin-bottom: 1.5mm; }
  .skill-group { margin-bottom: 0.8mm; display: flex; flex-wrap: wrap; gap: 0 6px; }
  .skill-group h3 { font-size: 8.5pt; margin: 0; }
  .skill-group h3::after { content: ":"; }
  .chips { display: inline; }
  .chips li { display: inline; padding: 0; border: 0; background: none; font: 400 9pt var(--body); }
  .chips li:not(:last-child)::after { content: " · "; }
  .tl { padding-left: 0; }
  .tl::before, .job::before { display: none; }
  .job { margin-bottom: 2.5mm; break-inside: avoid; max-width: none; }
  .job h3 { font-size: 10.5pt; }
  .job h3 span { font-size: 9pt; }
  .job .meta { font-size: 8pt; margin: 0.5mm 0 1mm; }
  .job li { margin-bottom: 0.4mm; }
  .asof { border-color: #999; }
}
