/* =============================================================================
   Public site — dark "terminal" design system
   (ported from the kthedev-portfolio reference: Tailwind tokens → plain CSS, no build step)
   ========================================================================== */

/* ---------------------------------------------------------------- fonts (self-hosted, SIL OFL 1.1) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../assets/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2"); }

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --primary: #00ff88;
  --accent: #f59e0b;
  --card: #111111;
  --muted: #0e0e0e;
  --line: #1f1f1f;
  --fg: #e5e5e5;
  --dim: #8b8b8b;          /* 5.6:1 on --bg */
  --dot-r: #ff5f57;
  --dot-y: #febc2e;
  --dot-g: #28c840;
  --danger: #ff6b6b;

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --glow-sm: 0 0 12px color-mix(in srgb, var(--primary) 40%, transparent);
  --glow: 0 0 28px color-mix(in srgb, var(--primary) 25%, transparent);
  --max: 64rem;
  --gutter: 24px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; }
h1, h2, h3, h4 { font-family: var(--mono); margin: 0; line-height: 1.2; font-weight: 700; }
p { margin: 0; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--primary); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--primary) 30%, transparent); color: #fff; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; background: var(--primary); color: var(--bg);
  padding: 8px 14px; font-family: var(--mono); font-size: 14px; }
.skip-link:focus { top: 16px; }
.container { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.p-c { color: var(--primary); }
.a-c { color: var(--accent); }

/* ---------------------------------------------------------------- primitives */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; min-height: 44px;
  border: 1px solid var(--primary); background: transparent; padding: 10px 20px; font-family: var(--mono); font-size: 14px;
  color: var(--primary); transition: background-color 200ms, color 200ms, translate 300ms var(--ease); white-space: nowrap; }
.btn.mag { transition: background-color 200ms, color 200ms, translate 90ms linear; }
.btn:hover { background: var(--primary); color: var(--bg); }
.btn-solid { background: var(--primary); color: var(--bg); }
.btn-solid:hover { background: transparent; color: var(--primary); }
.btn-sm { min-height: 34px; padding: 6px 14px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.tag { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); padding: 4px 10px;
  font-family: var(--mono); font-size: 12px; color: var(--fg); line-height: 1.5;
  transition: border-color 200ms, color 200ms, box-shadow 200ms; }
.tag:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--glow-sm); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

.pill { display: inline-block; border: 1px solid var(--primary); border-radius: 999px; padding: 2px 12px; font-family: var(--mono);
  font-size: 12px; color: var(--primary); white-space: nowrap; }
.pill.amber { border-color: var(--accent); color: var(--accent); }
.pill.dimmed { border-color: var(--line); color: var(--dim); }

.card { background: var(--card); border: 1px solid var(--line); padding: 24px; position: relative;
  transition: border-color 200ms, box-shadow 200ms, transform 250ms var(--ease); }
.card:hover { border-color: var(--primary); box-shadow: var(--glow); }

.cur { display: inline-block; width: 0.6em; height: 1em; background: var(--primary); vertical-align: middle; margin-left: 4px;
  animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Terminal window */
.win { background: var(--card); border: 1px solid var(--line); }
.win-bar { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dots { display: flex; gap: 8px; flex: none; }
.dots i { width: 12px; height: 12px; border-radius: 50%; }
.dots i:nth-child(1) { background: var(--dot-r); }
.dots i:nth-child(2) { background: var(--dot-y); }
.dots i:nth-child(3) { background: var(--dot-g); }
.win-title { font-family: var(--mono); font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-body { padding: 24px; font-family: var(--mono); font-size: 14px; }
.cmd { color: var(--dim); }
.cmd + * { margin-top: 4px; }
.cmd:not(:first-child) { margin-top: 16px; }

/* Inputs */
.inp { width: 100%; background: var(--bg); border: 1px solid var(--line); padding: 10px 12px; font-family: var(--mono);
  font-size: 16px; color: var(--fg); outline: none; border-radius: 0; transition: border-color 200ms; -webkit-appearance: none; appearance: none; }
.inp:focus { border-color: var(--primary); }
.inp[aria-invalid="true"] { border-color: var(--danger); }
textarea.inp { resize: vertical; min-height: 140px; line-height: 1.5; }
.lbl { display: block; font-family: var(--mono); font-size: 12px; color: var(--dim); margin-bottom: 6px; }
.err { font-family: var(--mono); font-size: 12px; color: var(--danger); margin-top: 6px; }

/* ---------------------------------------------------------------- header */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; border-bottom: 1px solid transparent;
  transition: background-color 300ms, border-color 300ms; }
.site-header.scrolled { background: rgb(10 10 10 / 0.7); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom-color: var(--line); }
.header-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { font-family: var(--mono); font-weight: 700; color: var(--primary); white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 24px; }
.nav-links { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav-links a { font-family: var(--mono); font-size: 14px; color: var(--dim); text-transform: capitalize; transition: color 200ms; }
.nav-links a:hover, .nav-links a[aria-current="true"], .nav-links a[aria-current="page"] { color: var(--primary); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--fg); width: 40px; height: 40px;
  align-items: center; justify-content: center; cursor: pointer; }
.menu-btn svg { width: 18px; height: 18px; }
@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .nav-links { display: none; position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 0; background: var(--bg);
    border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px 0; font-size: 16px; }
  .nav .hire { display: none; }
}

.preview-banner { position: relative; z-index: 60; padding: 8px var(--gutter); text-align: center; font-family: var(--mono);
  font-size: 13px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.preview-banner ~ .site-header { top: 37px; }
@media (max-width: 760px) { .preview-banner ~ .site-header { top: 0; position: sticky; } }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
.grid-bg { position: absolute; inset: 0; opacity: 0.5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; }
.scan { position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(transparent 0 2px, color-mix(in srgb, var(--primary) 4%, transparent) 2px 3px); }
.frag { position: absolute; font-family: var(--mono); font-size: 14px; color: var(--primary); opacity: 0.07; user-select: none;
  white-space: nowrap; pointer-events: none; }
.frag:nth-of-type(1) { left: 6%; top: 18%; }
.frag:nth-of-type(2) { left: 70%; top: 14%; }
.frag:nth-of-type(3) { left: 55%; top: 70%; }
.frag:nth-of-type(4) { left: 10%; top: 75%; }
.frag:nth-of-type(5) { left: 78%; top: 45%; }
.frag:nth-of-type(6) { left: 30%; top: 88%; }
@media (max-width: 640px) { .frag { display: none; } }
/* Interactive 3D neural core (js/public/scene3d.js) + cursor spotlight on the grid */
.hero-3d { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 700ms var(--ease); }
.hero-3d.on { opacity: 1; }
.grid-glow { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 400ms;
  background-image: linear-gradient(color-mix(in srgb, var(--primary) 45%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--primary) 45%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), #000, transparent 70%);
  mask-image: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), #000, transparent 70%); }
.hero.pointer-in .grid-glow { opacity: 0.55; }
.hero.over-core { cursor: grab; }
.hero.dragging { cursor: grabbing; -webkit-user-select: none; user-select: none; }
@media (max-width: 899px) { .hero-3d.on { opacity: 0.5; } }
@media (hover: none) { .grid-glow { display: none; } }
.hero-inner { position: relative; padding: 112px 0 64px; }
.prompt { font-family: var(--mono); color: var(--dim); margin-bottom: 16px; }
.hero h1 { font-size: clamp(2.75rem, 1.4rem + 6.5vw, 5.5rem); letter-spacing: -0.03em; line-height: 1.02; overflow-wrap: break-word; }
.typed-1 { font-family: var(--mono); font-size: clamp(1.35rem, 1rem + 1.6vw, 1.875rem); margin-top: 24px; min-height: 1.5em; }
.typed-2 { font-family: var(--mono); color: var(--accent); margin-top: 8px; min-height: 1.5em; }
.headline { margin-top: 32px; font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem); color: var(--fg); max-width: 40rem; line-height: 1.5; }
.bio { color: var(--dim); max-width: 36rem; margin-top: 12px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 40px; }
.status-line { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); padding: 4px 12px; margin-bottom: 24px; }
.status-line::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: var(--glow-sm); }

/* ---------------------------------------------------------------- sections */
.section { padding: 96px 0; }
/* translucent so the 3D particle field (fx.js) shows through; cards and windows stay opaque */
.section.alt { background: color-mix(in srgb, var(--muted) 72%, transparent); }
.sec-title { font-size: 24px; font-weight: 400; margin-bottom: 40px; }
.sec-title .slashes { color: var(--primary); }
.sub-title { font-family: var(--mono); font-size: 14px; color: var(--dim); margin-bottom: 10px; font-weight: 400; }

/* Reveal (fade-up with stagger) — content stays visible without JS */
.js .rv { opacity: 0; transform: translateY(24px); transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  transition-delay: calc(var(--i, 0) * 100ms); }
.js .rv.in { opacity: 1; transform: none; }

/* 3D tilt + glare (js/public/tilt.js). Declared after .rv so the reveal's staggered delay doesn't lag the tilt. */
.js .tilt { transition: transform 500ms var(--ease), border-color 200ms, box-shadow 200ms, opacity 600ms var(--ease);
  transition-delay: 0s; will-change: transform; }
.js .tilt.tilting { transition-duration: 120ms, 200ms, 200ms, 600ms; }
.tilt::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 300ms;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), color-mix(in srgb, var(--primary) 11%, transparent), transparent 60%); }
.tilt.tilting::before { opacity: 1; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.about-text { color: var(--dim); line-height: 1.75; }
.about-text > * + * { margin-top: 1em; }
.about-text strong { color: var(--fg); font-weight: 500; }
.about-text ul { padding-left: 1.2em; }
.about-text li + li { margin-top: 6px; }
.about-text li::marker { color: var(--primary); }
.facts { display: grid; gap: 24px; align-content: start; }
.fact-val { font-family: var(--mono); font-size: 14px; color: var(--fg); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* Projects */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; font-family: var(--mono); font-size: 13px; }
.filters .cmd { margin: 0 4px 0 0; align-self: center; }
.fbtn { background: none; border: 1px solid var(--line); color: var(--dim); font-family: var(--mono); font-size: 12px; padding: 6px 12px;
  cursor: pointer; transition: all 200ms; min-height: 32px; }
.fbtn:hover { color: var(--primary); border-color: var(--primary); }
.fbtn[aria-pressed="true"] { color: var(--bg); background: var(--primary); border-color: var(--primary); }
.p-metrics { display: flex; flex-wrap: wrap; gap: 6px 24px; font-family: var(--mono); font-size: 13px; margin-bottom: 16px; }
.p-metrics b { color: var(--primary); font-weight: 700; }
.p-metrics span { color: var(--dim); }

/* Skills / stack window */
.stack-tools { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; padding-bottom: 20px; margin-bottom: 20px;
  border-bottom: 1px dashed var(--line); }
.grep { display: flex; align-items: center; gap: 10px; flex: 1 1 260px; }
.grep .cmd { margin: 0; white-space: nowrap; }
.grep .inp { padding: 8px 10px; font-size: 14px; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; }
.stack-rows { display: grid; gap: 16px; }
.stack-rows[hidden] { display: none; }
/* 3D map view (js/public/skills3d.js) */
.skills-mode { margin-left: auto; }
.skills-map { border: 1px solid var(--line); background: radial-gradient(70% 70% at 50% 50%, color-mix(in srgb, var(--primary) 5%, var(--bg)), var(--bg) 75%); }
.skills-map[hidden] { display: none; }
.skills-map-canvas { display: block; width: 100%; height: 440px; cursor: grab; touch-action: pan-y; font-family: var(--mono); }
.skills-map-canvas.pointing { cursor: pointer; }
.skills-map-canvas.dragging { cursor: grabbing; }
.skills-map-hint { order: 2; margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--dim); font-family: var(--mono); font-size: 11px; }
.skills-map { display: flex; flex-direction: column; }
@media (max-width: 640px) { .skills-map-canvas { height: 360px; } .skills-mode { margin-left: 0; } }
.stack-row { display: grid; grid-template-columns: 11rem 1fr; gap: 16px; align-items: start; }
.stack-row > span { color: var(--primary); padding-top: 4px; }
@media (max-width: 640px) { .stack-row { grid-template-columns: 1fr; gap: 8px; } }
.lv-experienced::before, .lv-familiar::before, .lv-exploring::before { font-size: 10px; }
.lv-experienced::before { content: "●"; color: var(--primary); }
.lv-familiar::before { content: "○"; color: var(--primary); }
.lv-exploring { border-style: dashed; color: var(--dim); }
.lv-exploring::before { content: "◌"; color: var(--dim); }
.legend { margin-top: 24px; padding-top: 16px; border-top: 1px dashed var(--line); color: var(--dim); font-size: 12px;
  display: flex; flex-wrap: wrap; gap: 8px 24px; }
.legend .lv-experienced::before, .legend .lv-familiar::before, .legend .lv-exploring::before { margin-right: 6px; }
/* Skills backed by published projects (click → which projects) */
.tag-btn { cursor: pointer; background: none; font: inherit; font-family: var(--mono); font-size: 12px; }
.tag-btn[aria-pressed="true"] { border-color: var(--primary); color: var(--bg); background: var(--primary); box-shadow: var(--glow-sm); }
.tag-btn[aria-pressed="true"]::before { color: var(--bg); }
.tag-count { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 2px; border-radius: 999px;
  font-size: 10px; line-height: 1; color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent); }
.tag-btn[aria-pressed="true"] .tag-count { color: var(--bg); border-color: color-mix(in srgb, var(--bg) 45%, transparent); }
.skill-usage { margin-top: 20px; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--line));
  background: color-mix(in srgb, var(--primary) 4%, var(--bg)); display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  animation: usage-in 220ms var(--ease); }
.skill-usage[hidden] { display: none; }
@keyframes usage-in { from { opacity: 0; transform: translateY(-6px); } }
.skill-usage > .cmd { flex-basis: 100%; margin: 0; }
.usage-list { flex-basis: 100%; list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.usage-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 10px 12px; border: 1px solid var(--line); background: var(--card);
  color: var(--fg); transition: border-color 150ms, transform 150ms var(--ease); }
.usage-item:hover { border-color: var(--primary); transform: translateX(3px); }
.usage-title { font-family: var(--mono); font-weight: 700; font-size: 14px; }
.usage-meta { grid-column: 1; font-size: 12px; color: var(--dim); }
.usage-go { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--primary); }
.skill-chip[hidden] { display: none; }
.skill-chip { border-color: var(--accent) !important; color: var(--accent) !important; background: none !important; }
.empty-line { color: var(--dim); }

/* Experience */
.xp-list { display: grid; gap: 16px; list-style: none; margin: 0; padding: 0; }
.xp { display: grid; grid-template-columns: 11rem 1fr; gap: 24px; }
.xp-when { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.xp-when small { display: block; color: var(--dim); margin-top: 4px; font-size: 12px; }
.xp h3 { font-size: 17px; }
.xp-org { font-family: var(--mono); font-size: 14px; color: var(--primary); margin-top: 4px; }
.xp-org a { color: inherit; }
.xp-loc { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-top: 2px; }
.xp-summary { color: var(--dim); margin-top: 12px; font-size: 15px; }
.arrow-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.arrow-list li { position: relative; padding-left: 22px; color: var(--dim); font-size: 15px; line-height: 1.6; }
.arrow-list li::before { content: ">"; position: absolute; left: 0; font-family: var(--mono); color: var(--primary); }
.xp-logo { width: 40px; height: 40px; object-fit: contain; background: #fff; border: 1px solid var(--line); float: right; margin-left: 12px; }
@media (max-width: 700px) { .xp { grid-template-columns: 1fr; gap: 8px; } }

/* Education & certifications */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .edu-grid { grid-template-columns: 1fr; } }
.stack-list { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.mini h3 { font-size: 15px; }
.mini .meta { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-top: 6px; }
.mini .sub { color: var(--fg); font-size: 14px; margin-top: 4px; }
.mini .acts { display: flex; gap: 16px; margin-top: 12px; font-family: var(--mono); font-size: 12px; position: relative; z-index: 1; }
.mini .acts a { color: var(--dim); }
.mini .acts a:hover { color: var(--primary); }
.cert { display: grid; grid-template-columns: 48px 1fr; gap: 16px; }
.cert-thumb { width: 48px; height: 48px; object-fit: cover; border: 1px solid var(--line); background: var(--bg);
  display: grid; place-items: center; color: var(--primary); font-family: var(--mono); font-size: 12px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-title { font-size: clamp(2rem, 1.5rem + 2vw, 2.25rem); }
.contact-title .p-c { color: var(--primary); }
.contact-lede { color: var(--dim); margin: 16px 0 32px; max-width: 26rem; }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.contact-form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-family: var(--mono); font-size: 13px; }
.form-status.ok { color: var(--primary); }
.form-status.bad { color: var(--danger); }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-foot small { color: var(--dim); font-family: var(--mono); font-size: 11px; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  display: inline-block; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  font-family: var(--mono); font-size: 12px; color: var(--dim); }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--dim); text-transform: capitalize; transition: color 200ms; }
.footer-links a:hover { color: var(--primary); }
.footer-note { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 16px; }
@media (max-width: 760px) { .footer-inner { flex-direction: column; text-align: center; } }

/* ---------------------------------------------------------------- states */
.state { border: 1px dashed var(--line); padding: 48px 24px; text-align: center; font-family: var(--mono); display: grid; gap: 12px;
  justify-items: center; color: var(--dim); }
.state h3 { color: var(--fg); font-size: 16px; }
.state .code { color: var(--accent); }
.page-state { padding: 140px 0 96px; }
.skeleton { background: linear-gradient(90deg, #121212 0%, #1b1b1b 50%, #121212 100%); background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-hero { padding: 140px 0 80px; }
.sk-meta { width: 160px; height: 16px; margin-bottom: 24px; }
.sk-h1 { width: min(520px, 90%); height: 80px; margin-bottom: 24px; }
.sk-p { width: min(360px, 70%); height: 28px; margin-bottom: 12px; }
.sk-p2 { width: min(480px, 85%); height: 18px; }
.sk-title { width: min(600px, 80%); height: 48px; margin-bottom: 18px; }
.sk-cover { width: 100%; height: 320px; }
.noscript-box { padding: 120px 0 48px; }

/* ---------------------------------------------------------------- project page */
.crumbs { padding-top: 104px; font-family: var(--mono); font-size: 13px; }
.crumbs a { color: var(--dim); }
.crumbs a:hover { color: var(--primary); }
.case-head { padding: 24px 0 40px; display: grid; gap: 16px; max-width: 52rem; }
.case-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-family: var(--mono); font-size: 13px; }
.case-head h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); letter-spacing: -0.02em; }
.case-head h1 .p-c { color: var(--primary); }
.case-head .lede { color: var(--dim); font-size: 18px; line-height: 1.6; }
/* Case-study hero: the same art as the project's card (they morph into each other on navigation) */
.case-visual { position: relative; margin-top: 20px; aspect-ratio: 16 / 6; overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(120% 140% at 80% 0%, color-mix(in srgb, var(--primary) 9%, var(--bg)), var(--bg) 62%); }
.case-visual > img, .case-visual > .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.case-visual::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, color-mix(in srgb, var(--bg) 70%, transparent)); }
@media (max-width: 640px) { .case-visual { aspect-ratio: 16 / 8; } }
.case-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
/* 3D data-flow diagram (js/public/arch3d.js) */
.arch3d { margin: 20px 0 0; border: 1px solid var(--line);
  background: radial-gradient(90% 100% at 50% 40%, color-mix(in srgb, var(--primary) 6%, var(--bg)), var(--bg) 70%); }
.arch3d-canvas { display: block; width: 100%; height: 340px; cursor: grab; touch-action: pan-y; font-family: var(--mono); }
.arch3d-canvas.dragging { cursor: grabbing; }
.arch3d figcaption { padding: 8px 14px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; }
/* Results: big numbers that count up when scrolled into view */
.case-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; margin-bottom: 56px; }
.metric { position: relative; display: grid; gap: 6px; align-content: start; padding: 22px 22px 20px; background: var(--card);
  border: 1px solid var(--line); overflow: hidden; }
.metric::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: linear-gradient(var(--primary), var(--accent)); }
.metric-value { font-family: var(--mono); font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.2rem); line-height: 1; color: var(--primary);
  text-shadow: 0 0 22px color-mix(in srgb, var(--primary) 45%, transparent); font-variant-numeric: tabular-nums; }
.metric-label { font-family: var(--mono); font-size: 14px; color: var(--fg); }
.metric-desc { font-size: 13px; color: var(--dim); line-height: 1.5; }
/* Sticky contents with the current section highlighted */
.case-toc { font-family: var(--mono); font-size: 13px; padding: 16px 18px; border: 1px solid var(--line); background: var(--card); }
.case-toc ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.case-toc li { counter-increment: toc; }
.case-toc a { display: block; padding: 4px 0 4px 12px; border-left: 2px solid var(--line); color: var(--dim); transition: color 150ms, border-color 150ms; }
.case-toc a::before { content: counter(toc, decimal-leading-zero) "  "; color: color-mix(in srgb, var(--dim) 60%, transparent); }
.case-toc a:hover { color: var(--fg); }
.case-toc a[aria-current="true"] { color: var(--primary); border-left-color: var(--primary); }
.case-aside > * { min-width: 0; }   /* the mobile contents strip scrolls instead of widening the page */
.case-aside .tags a.tag { color: var(--fg); }
.case-aside .tags a.tag:hover { color: var(--primary); }
.case-main > section { scroll-margin-top: 90px; }
@media (max-width: 960px) {
  .case-toc ol { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .case-toc a { white-space: nowrap; border: 1px solid var(--line); padding: 4px 10px; }
  .case-toc a::before { content: none; }
  .case-toc a[aria-current="true"] { border-color: var(--primary); }
}
.case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; padding-bottom: 80px; }
.case-main > section + section { margin-top: 56px; }
.case-main h2 { font-size: 20px; font-weight: 400; margin-bottom: 16px; }
.case-main h2 .slashes { color: var(--primary); }
.case-aside { position: sticky; top: 88px; align-self: start; display: grid; gap: 24px; }
.case-aside .win-body { display: grid; gap: 10px; }
.case-aside .btn { justify-content: flex-start; width: 100%; }
@media (max-width: 960px) { .case-layout { grid-template-columns: 1fr; } .case-aside { position: static; order: -1; } }
.prose { color: var(--dim); line-height: 1.8; font-size: 16px; }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { color: var(--fg); font-size: 17px; margin-top: 1.6em; }
.prose strong { color: var(--fg); font-weight: 500; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; margin-bottom: 0; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--primary); }
.prose code { font-family: var(--mono); font-size: 0.88em; background: var(--card); border: 1px solid var(--line); padding: 0.1em 0.4em; color: var(--fg); }
.prose pre { background: var(--card); border: 1px solid var(--line); padding: 16px; overflow-x: auto; font-size: 14px; }
.prose pre code { border: 0; padding: 0; background: none; }
.prose blockquote { margin: 0; padding-left: 16px; border-left: 2px solid var(--primary); }
.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose img { border: 1px solid var(--line); }
.prose hr { border: 0; border-top: 1px dashed var(--line); }
.diagram { border: 1px solid var(--line); background: #fff; padding: 16px; margin: 20px 0 0; }
.diagram img { margin-inline: auto; }
.diagram figcaption { color: #333; font-family: var(--mono); font-size: 12px; text-align: center; margin-top: 8px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.gallery figure { margin: 0; }
.gallery button { padding: 0; border: 1px solid var(--line); background: var(--card); cursor: zoom-in; width: 100%; display: block;
  transition: border-color 200ms, box-shadow 200ms; }
.gallery button:hover { border-color: var(--primary); box-shadow: var(--glow); }
.gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.gallery figcaption { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-top: 6px; }
.case-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--line); padding: 32px 0 96px; }
.case-nav a { display: grid; gap: 4px; color: var(--fg); }
.case-nav a:hover { color: var(--primary); }
.case-nav .dir { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.case-nav .next { grid-column: 2; text-align: right; }
.case-nav .title { font-family: var(--mono); font-weight: 700; }
.lightbox { border: 1px solid var(--line); padding: 0; background: var(--bg); max-width: min(1200px, 96vw); max-height: 92vh; }
.lightbox::backdrop { background: rgb(0 0 0 / 0.85); }
.lightbox img { max-height: 82vh; width: auto; margin-inline: auto; }
.lightbox p { color: var(--dim); text-align: center; font-family: var(--mono); font-size: 12px; padding: 8px; }
.lightbox .close { position: fixed; top: 16px; right: 16px; background: var(--bg); }

.page-404 { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cur { animation: none; }
  .js .rv { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
.page-404 .win { position: relative; width: min(560px, 100%); }
.page-404 h1 { font-size: 18px; margin: 4px 0 0; }
.page-404 .btn { margin-top: 8px; }

/* ---------------------------------------------------------------- projects (bento cards) */
.pc-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.pc-lede { font-family: var(--mono); font-size: 14px; color: var(--fg); }
.pc-toolbar .filters { margin: 0; }
.fcount { margin-left: 8px; padding: 0 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 10px; color: var(--dim); }
.fbtn[aria-pressed="true"] .fcount { color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
.pc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 860px) { .pc-grid { grid-template-columns: 1fr; } }
.pc { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); overflow: hidden;
  transition: border-color 200ms, box-shadow 200ms, transform 250ms var(--ease); }
.pc:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); box-shadow: var(--glow); }
/* gradient hairline that lights up on hover */
.pc::after, .post-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: 0; transition: opacity 300ms;
  border: 1px solid transparent; background: linear-gradient(125deg, var(--primary), transparent 35%, transparent 65%, var(--accent)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.pc:hover::after, .post-card:hover::after { opacity: 1; }
.pc-visual, .post-visual, .post-cover { position: relative; aspect-ratio: 16 / 7; overflow: hidden; border-bottom: 1px solid var(--line);
  background: radial-gradient(120% 140% at 80% 0%, color-mix(in srgb, var(--primary) 9%, var(--bg)), var(--bg) 62%); }
.pc-visual > img, .pc-visual > .art, .post-visual > img, .post-visual > .art, .post-cover > img, .post-cover > .art {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease); }
.pc:hover .pc-visual > img, .pc:hover .pc-visual > .art, .post-card:hover .post-visual > img, .post-card:hover .post-visual > .art { transform: scale(1.045); }
.pc-visual::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 35%, color-mix(in srgb, var(--card) 88%, transparent)); }
.pc-bar { position: absolute; inset: 0 0 auto 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: linear-gradient(180deg, rgb(0 0 0 / 0.6), transparent); font-family: var(--mono); font-size: 11px; color: var(--dim); }
.pc-bar .dots { gap: 6px; }
.pc-bar .dots i { width: 9px; height: 9px; }
.pc-path { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-index { position: absolute; right: 14px; top: 30px; z-index: 1; font-family: var(--mono); font-weight: 700; font-size: 46px; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--primary) 45%, transparent); }
.pc-metric { position: absolute; left: 18px; bottom: 12px; z-index: 2; display: grid; gap: 2px; }
@media (max-width: 560px) { .pc-index { top: 38px; font-size: 32px; } .pc-metric b { font-size: 28px; } }
.pc-metric b { font-family: var(--mono); font-size: 34px; line-height: 1; color: var(--primary);
  text-shadow: 0 0 18px color-mix(in srgb, var(--primary) 55%, transparent); }
.pc-metric span { font-family: var(--mono); font-size: 11px; color: var(--fg); text-transform: lowercase; }
.pc-body { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 20px 22px 22px; }
.pc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-family: var(--mono); font-size: 12px; }
.pc-cat { color: var(--dim); }
.pc-meta .draft { color: var(--accent); }
.pc h3 { font-size: 19px; line-height: 1.3; }
.pc h3 a, .post-card h3 a { color: var(--fg); transition: color 200ms; }
.pc h3 a::after, .post-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pc:hover h3 a, .post-card:hover h3 a { color: var(--primary); }
.pc-desc { color: var(--dim); font-size: 14.5px; line-height: 1.65; }
.pc .p-metrics { margin: 0; }
.pc .tags .tag { font-size: 11px; padding: 3px 9px; }
.pc-links { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 16px; font-family: var(--mono); font-size: 13px; position: relative; z-index: 2; }
.pc-links a { color: var(--dim); transition: color 200ms; }
.pc-links a:hover { color: var(--primary); }
.pc-links .pc-primary { color: var(--primary); }
.pc-primary .arrow, .post-read { display: inline-block; transition: transform 200ms var(--ease); }
.pc:hover .pc-primary .arrow, .post-card:hover .post-read { transform: translateX(4px); }
.pc-wide { grid-column: 1 / -1; }
@media (min-width: 861px) {
  .pc-wide { flex-direction: row; }
  .pc-wide .pc-visual { flex: 0 0 52%; aspect-ratio: auto; min-height: 300px; border-bottom: 0; border-right: 1px solid var(--line); }
  .pc-wide .pc-visual::after { background: linear-gradient(90deg, transparent 55%, color-mix(in srgb, var(--card) 80%, transparent)); }
  .pc-wide .pc-body { padding: 28px 30px; justify-content: center; }
  .pc-wide h3 { font-size: 24px; }
  .pc-wide .pc-metric b { font-size: 46px; }
}

/* GitHub numbers (js/public/github-ui.js) */
.pc-gh { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-top: -4px; }
.pc-gh:empty { display: none; }
.gh-slot:empty { display: none; }
.gh-slot .win-body { display: grid; gap: 8px; font-size: 13px; }
.gh-row { display: flex; justify-content: space-between; gap: 12px; }
.gh-row .cmd { margin: 0; }
.gh-spark { width: 100%; height: 32px; margin: 4px 0; }
.gh-spark rect { fill: color-mix(in srgb, var(--primary) 70%, transparent); }
.gh-asof { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.gh-profile .fact-val a { color: var(--primary); }
/* GitHub-style contribution chart (About section) */
.gh-activity { margin-top: 48px; }
.gh-activity:empty { display: none; }
.gh-act-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 12px; }
.gh-act-head .sub-title { margin: 0; }
.gh-act-total { font-family: var(--mono); font-size: 14px; color: var(--fg); }
.gh-act-total b { color: var(--primary); font-weight: 700; }
.gh-act-link { margin-left: auto; font-family: var(--mono); font-size: 13px; }
.gh-act-card { border: 1px solid var(--line); background: var(--card); padding: 18px 18px 14px; }
.gh-scroll { position: relative; overflow-x: auto; padding-top: 4px; scrollbar-width: thin; }
.gh-cal { --cell: 11px; --gap: 3px; display: grid; width: max-content; margin-inline: auto;
  grid-template-columns: 28px repeat(var(--weeks), var(--cell)); grid-template-rows: 15px repeat(7, var(--cell)); gap: var(--gap); }
@media (min-width: 1000px) { .gh-cal { --cell: 13px; } }
.gh-dow, .gh-month { font-family: var(--mono); font-size: 10px; line-height: 1; color: var(--dim); white-space: nowrap; }
.gh-dow { grid-column: 1; align-self: center; }
.gh-month { grid-row: 1; align-self: end; }
.gh-cell { width: var(--cell, 11px); height: var(--cell, 11px); border-radius: 2px; background: color-mix(in srgb, var(--fg) 7%, transparent);
  outline: 1px solid color-mix(in srgb, var(--fg) 4%, transparent); outline-offset: -1px; }
.gh-cell.l1 { background: color-mix(in srgb, var(--primary) 28%, var(--card)); }
.gh-cell.l2 { background: color-mix(in srgb, var(--primary) 50%, var(--card)); }
.gh-cell.l3 { background: color-mix(in srgb, var(--primary) 75%, var(--card)); }
.gh-cell.l4 { background: var(--primary); box-shadow: 0 0 6px color-mix(in srgb, var(--primary) 55%, transparent); }
.gh-cal .gh-cell:hover { outline: 1px solid var(--fg); }
.gh-activity.in .gh-cal .gh-cell { animation: gh-cell-in 420ms var(--ease) both; animation-delay: calc(var(--w) * 10ms); }
@keyframes gh-cell-in { from { opacity: 0; transform: scale(0.4); } }
.gh-tip { position: absolute; z-index: 2; transform: translate(-50%, calc(-100% - 8px)); padding: 4px 8px; white-space: nowrap; pointer-events: none;
  background: var(--fg); color: var(--bg); font-family: var(--mono); font-size: 11px; border-radius: 3px; }
.gh-tip[hidden] { display: none; }
.gh-act-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-top: 12px; }
.gh-legend { display: flex; align-items: center; gap: 3px; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.gh-legend .gh-cell { --cell: 11px; }
.gh-legend > :first-child { margin-left: 4px; }

/* ---------------------------------------------------------------- neural playground (js/public/nn-playground.js) */
.nn-lede { color: var(--dim); max-width: 44rem; margin: -20px 0 24px; }
.nn-skeleton { min-height: 360px; display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--mono); color: var(--dim); }
.nn-wrap { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .nn-wrap { grid-template-columns: 1fr; } .nn-left { max-width: 320px; } }
.nn-left { display: grid; gap: 12px; }
.nn-left .cmd { margin: 4px 0 0; }
.nn-pad-wrap { position: relative; }
.nn-pad { display: block; width: 100%; aspect-ratio: 1; touch-action: none; cursor: crosshair; background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--primary) 40%, var(--line)); box-shadow: inset 0 0 40px color-mix(in srgb, var(--primary) 6%, transparent);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 10% 10%; }
.nn-hint { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-family: var(--mono); font-size: 13px;
  color: var(--dim); transition: opacity 200ms; }
.has-input .nn-hint { opacity: 0; }
.nn-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nn-sees-wrap { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.nn-sees { width: 42px; height: 42px; image-rendering: pixelated; border: 1px solid var(--line); background: #000; }
.nn-samples { display: flex; flex-wrap: wrap; gap: 6px; }
.nn-samples .fbtn { min-width: 32px; }
.nn-right { display: grid; gap: 18px; min-width: 0; }
.nn-viz-wrap { position: relative; border: 1px solid var(--line);
  background: radial-gradient(80% 90% at 60% 40%, color-mix(in srgb, var(--primary) 7%, var(--bg)), var(--bg) 70%); }
.nn-viz { display: block; width: 100%; height: 340px; cursor: grab; touch-action: pan-y; font-family: var(--mono); }
.nn-viz.dragging { cursor: grabbing; }
@media (max-width: 560px) { .nn-viz { height: 260px; } }
.nn-legend { position: absolute; inset: auto 12px 8px 12px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none;
  font-family: var(--mono); font-size: 10px; color: var(--dim); }
.nn-out { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 12px 24px; align-items: start; }
@media (max-width: 560px) { .nn-out { grid-template-columns: 1fr; } }
.nn-readout { font-family: var(--mono); font-size: 18px; line-height: 1.4; color: var(--fg); }
.nn-readout b { color: var(--primary); font-size: 30px; display: block; text-shadow: 0 0 18px color-mix(in srgb, var(--primary) 45%, transparent); }
.nn-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.nn-bar { display: grid; grid-template-columns: 14px 1fr 46px; gap: 10px; align-items: center; font-family: var(--mono); font-size: 12px; color: var(--dim); }
.nn-track { height: 8px; background: color-mix(in srgb, var(--fg) 6%, transparent); overflow: hidden; }
.nn-fill { display: block; height: 100%; width: 0; background: color-mix(in srgb, var(--primary) 55%, transparent); transition: width 180ms var(--ease); }
.nn-pct { text-align: right; }
.nn-bar.win { color: var(--fg); }
.nn-bar.win .nn-digit { color: var(--accent); font-weight: 700; }
.nn-bar.win .nn-fill { background: var(--primary); box-shadow: 0 0 8px color-mix(in srgb, var(--primary) 60%, transparent); }
.nn-caption { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--dim); line-height: 1.6; }

/* ---------------------------------------------------------------- generated cover art (js/public/art.js) */
.art .a-grid line { stroke: color-mix(in srgb, var(--primary) 7%, transparent); stroke-width: 1; }
.art .a-line, .art .a-line line { stroke: color-mix(in srgb, var(--primary) 30%, transparent); stroke-width: 1; fill: none; }
.art .a-flow, .art .a-flow > * { stroke: color-mix(in srgb, var(--accent) 70%, transparent); stroke-width: 1.3; stroke-dasharray: 4 6; fill: none;
  animation: art-flow 1.6s linear infinite paused; }
.pc:hover .art .a-flow, .pc:hover .art .a-flow > *, .post-card:hover .art .a-flow, .post-card:hover .art .a-flow > * { animation-play-state: running; }
@keyframes art-flow { to { stroke-dashoffset: -20; } }
.art .a-node circle, .art circle.a-node { fill: color-mix(in srgb, var(--primary) 70%, transparent); }
.art .a-hot circle, .art circle.a-hot { fill: var(--accent); }
.art circle.a-pulse { fill: none; stroke: var(--accent); stroke-opacity: 0.7; transform-box: fill-box; transform-origin: center;
  animation: art-pulse 2.6s var(--ease) infinite; }
@keyframes art-pulse { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
.art .a-pulse-dot { animation: blink 1.4s steps(1) infinite; }
.art .a-plane { fill: color-mix(in srgb, var(--primary) 6%, transparent); stroke: color-mix(in srgb, var(--primary) 45%, transparent); stroke-width: 1; }
.art .a-hot-fill { fill: color-mix(in srgb, var(--accent) 20%, transparent); stroke: var(--accent); stroke-width: 1; }
.art .a-grid-in { fill: none; stroke: color-mix(in srgb, var(--primary) 22%, transparent); stroke-width: 1; }
.art .a-box path, .art .a-hot-box path { fill: none; stroke: var(--primary); stroke-width: 2; }
.art .a-box-fill { fill: color-mix(in srgb, var(--primary) 5%, transparent); stroke: color-mix(in srgb, var(--primary) 22%, transparent); stroke-width: 1; }
.art .a-tab { fill: color-mix(in srgb, var(--primary) 55%, transparent); }
.art .a-hot-box path { stroke: var(--accent); }
.art .a-hot-box .a-box-fill { fill: color-mix(in srgb, var(--accent) 7%, transparent); stroke: color-mix(in srgb, var(--accent) 30%, transparent); }
.art .a-hot-box .a-tab { fill: var(--accent); }
.art .a-scan { fill: color-mix(in srgb, var(--primary) 55%, transparent); animation: art-scan 3.4s linear infinite; }
@keyframes art-scan { from { transform: translateY(0); } to { transform: translateY(175px); } }
.art .a-gutter { fill: color-mix(in srgb, var(--fg) 12%, transparent); }
.art .a-tok { fill: color-mix(in srgb, var(--primary) 50%, transparent); }
.art .a-tok-dim { fill: color-mix(in srgb, var(--fg) 16%, transparent); }
.art .a-cursor { fill: var(--primary); animation: blink 1s steps(1) infinite; }

/* ---------------------------------------------------------------- clubs & volunteering */
.club-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 760px) { .club-grid { grid-template-columns: 1fr; } }
.club { display: grid; gap: 14px; align-content: start; overflow: hidden; }
.club::after { content: ""; position: absolute; right: -50px; top: -50px; width: 160px; height: 160px; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); }
.club-head { display: flex; align-items: center; gap: 14px; }
.club-mark { flex: none; width: 44px; height: 44px; display: grid; place-items: center; object-fit: contain;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--bg));
  color: var(--accent); font-family: var(--mono); font-weight: 700; font-size: 15px; }
.club h3 { font-size: 17px; }
.club .xp-org { margin-top: 2px; }
.club-when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-family: var(--mono); font-size: 12px; color: var(--fg); }
.club-when .draft { color: var(--accent); }
.club .xp-summary, .club .arrow-list { margin-top: 0; }

/* ---------------------------------------------------------------- blog: cards */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.post-grid.n1 { grid-template-columns: minmax(0, 30rem); }
.post-grid.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .post-grid, .post-grid.n1, .post-grid.n2 { grid-template-columns: 1fr; } }
.more-link { margin-top: 32px; }
.post-card { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); overflow: hidden;
  transition: border-color 200ms, box-shadow 200ms, transform 250ms var(--ease); }
.post-card:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); box-shadow: var(--glow); }
.post-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; }
.post-meta { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.post-meta .draft { color: var(--accent); }
.post-card h3 { font-size: 17px; line-height: 1.35; }
.post-excerpt { color: var(--dim); font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .tags .tag { font-size: 11px; padding: 2px 8px; }
.post-read { margin-top: auto; font-family: var(--mono); font-size: 13px; color: var(--primary); }
.post-card.featured { grid-column: 1 / -1; }
@media (min-width: 861px) {
  .post-card.featured { flex-direction: row; }
  .post-card.featured .post-visual { flex: 0 0 55%; aspect-ratio: auto; min-height: 280px; border-bottom: 0; border-right: 1px solid var(--line); }
  .post-card.featured .post-body { padding: 28px 30px; justify-content: center; }
  .post-card.featured h3 { font-size: 24px; }
  .post-card.featured .post-excerpt { -webkit-line-clamp: 5; }
}

/* ---------------------------------------------------------------- blog: index page */
.blog-page { padding: 112px 0 96px; }
.blog-head { display: grid; gap: 12px; max-width: 46rem; margin-bottom: 32px; }
.blog-head .prompt { margin-bottom: 0; }
.blog-head h1 { font-size: clamp(2.5rem, 1.6rem + 4vw, 4rem); letter-spacing: -0.03em; }
.blog-head .lede { color: var(--dim); font-size: 17px; line-height: 1.6; }
.blog-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding: 16px 0; margin-bottom: 14px;
  border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.blog-tools .grep { flex: 1 1 240px; max-width: 360px; }
.blog-tools .filters { margin: 0; }
.blog-count { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-bottom: 18px; }
.blog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 760px) { .blog-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- blog: post page */
.post-page { max-width: 46rem; padding-bottom: 32px; }
.post-page .crumbs { padding-top: 104px; }
.post-head { display: grid; gap: 14px; padding: 24px 0 28px; }
.post-head .post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.post-head .post-meta .pill { margin-left: 8px; }
.post-head h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); letter-spacing: -0.02em; line-height: 1.12; }
.post-head .lede { color: var(--dim); font-size: 18px; line-height: 1.6; }
.post-head .tags a.tag { color: var(--fg); }
.post-cover { margin: 0 0 32px; border: 1px solid var(--line); }
.post-toc { margin-bottom: 32px; padding: 16px 20px; background: var(--card); border: 1px solid var(--line); font-family: var(--mono); font-size: 13px; }
.post-toc ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.post-toc li.l3 { padding-left: 18px; }
.post-toc a { color: var(--dim); }
.post-toc a:hover { color: var(--primary); }
.post-body-md { font-size: 17px; line-height: 1.85; }
.post-body-md h2 { font-size: 22px; margin-top: 2em; }
.post-body-md h3 { font-size: 18px; margin-top: 1.6em; }
.post-body-md h2, .post-body-md h3 { scroll-margin-top: 90px; }
.post-body-md img { max-width: 100%; }
.h-anchor { margin-left: 8px; color: var(--primary); font-weight: 400; opacity: 0; transition: opacity 150ms; text-decoration: none !important; }
.post-body-md h2:hover .h-anchor, .post-body-md h3:hover .h-anchor, .h-anchor:focus-visible { opacity: 1; }
.post-body-md pre { position: relative; }
.copy-code { position: absolute; top: 8px; right: 8px; padding: 3px 8px; background: var(--bg); border: 1px solid var(--line); color: var(--dim);
  font-family: var(--mono); font-size: 11px; cursor: pointer; opacity: 0; transition: opacity 150ms, color 150ms; }
.post-body-md pre:hover .copy-code, .copy-code:focus-visible { opacity: 1; }
.copy-code:hover { color: var(--primary); border-color: var(--primary); }
@media (hover: none) { .copy-code { opacity: 1; } }
.post-foot { margin-top: 48px; padding-top: 24px; border-top: 1px dashed var(--line); display: grid; gap: 8px; }
.post-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.post-share .cmd { margin: 0 6px 0 0; }
.post-foot .case-nav { padding-bottom: 32px; }
/* While a page's content loads, keep the footer below the fold so it doesn't jump down when content arrives (CLS) */
#main[aria-busy="true"] { min-height: 100vh; }
/* Related posts (core/related.js) */
.post-related { margin-top: 16px; padding-top: 32px; border-top: 1px dashed var(--line); }
.post-related h2 { font-family: var(--mono); font-size: 18px; font-weight: 500; margin: 0 0 20px; }
.post-related .post-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.post-related .post-card .post-excerpt, .post-related .post-card .tags { display: none; }
/* Reading rail: contents + progress, beside the post on wide screens (the inline contents list covers narrow ones) */
.post-rail { display: none; }
@media (min-width: 1240px) {
  .post-rail { display: grid; gap: 10px; position: fixed; top: 120px; left: calc(50% + 23rem + 40px); width: min(220px, calc(50vw - 23rem - 56px));
    max-height: calc(100vh - 160px); overflow-y: auto; font-family: var(--mono); font-size: 12px; opacity: 0; visibility: hidden;
    transition: opacity 250ms var(--ease), visibility 250ms; }
  .post-rail.on { opacity: 1; visibility: visible; }
  .post-rail .cmd { margin: 0; }
  .post-rail ol { list-style: none; margin: 0; padding: 0 0 0 10px; display: grid; gap: 7px; border-left: 1px solid var(--line); }
  .post-rail li.l3 { padding-left: 12px; }
  .post-rail a { color: var(--dim); display: block; line-height: 1.4; }
  .post-rail a:hover { color: var(--fg); }
  .post-rail a[aria-current="true"] { color: var(--primary); }
  .post-page .post-toc { display: none; }
}
.rail-progress { display: grid; gap: 6px; margin-top: 8px; color: var(--dim); }
.rail-bar { display: block; height: 2px; background: var(--line); overflow: hidden; }
.rail-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); transform-origin: left; transform: scaleX(0); }
/* Code blocks: language label + syntax colours (core/highlight.js) */
.post-body-md pre[data-lang]::before { content: attr(data-lang); position: absolute; top: 8px; right: 70px; font-family: var(--mono);
  font-size: 11px; color: var(--dim); opacity: 0.8; }
@media (hover: none) { .post-body-md pre[data-lang]::before { right: 76px; } }
.post-body-md pre[data-lang] { padding-top: 34px; }
.tk-com { color: #7a8a80; font-style: italic; }
.tk-str { color: #e6c07b; }
.tk-kw { color: var(--primary); }
.tk-num, .tk-lit { color: #f4a261; }
.tk-fn { color: #7cc7ff; }
.tk-type { color: #c9a6ff; }
.tk-prop, .tk-attr { color: #8fd3e8; }
.tk-var, .tk-dec { color: #ff9e7a; }
.tk-tag { color: var(--primary); }
.tk-ent { color: #f4a261; }

/* ---------------------------------------------------------------- resume: PDF preview (js/public/resume.js) */
.pdf-viewer { max-width: 52rem; padding-bottom: 64px; }
.pdf-pages { padding: 24px; min-height: 360px;
  background: radial-gradient(100% 60% at 50% 0%, color-mix(in srgb, var(--primary) 6%, var(--muted)), var(--muted) 70%); }
.pdf-stack { display: grid; gap: 24px; }
.pdf-sheet { position: relative; justify-self: center; background: #fff;
  box-shadow: 0 18px 50px rgb(0 0 0 / 0.55), 0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent); }
.pdf-canvas { display: block; }
.pdf-link { position: absolute; display: block; border-radius: 2px; }
.pdf-link:hover, .pdf-link:focus-visible { background: color-mix(in srgb, var(--primary) 18%, transparent); outline: 1px solid var(--primary); }
.pdf-loading { min-height: 320px; display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--mono); color: var(--dim); }
.pdf-fallback { min-height: 320px; display: grid; place-content: center; gap: 10px; text-align: center; font-family: var(--mono); }
.pdf-fallback .acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
@media (max-width: 560px) { .pdf-pages { padding: 10px; } .pdf-stack { gap: 12px; } }
@media print {
  body.resume-pdf .pdf-pages { padding: 0; background: none; }
  body.resume-pdf .win-bar { display: none; }
  body.resume-pdf .pdf-sheet { box-shadow: none; }
}

/* ---------------------------------------------------------------- page transitions (cross-document View Transitions)
   Chrome/Edge 126+ and Safari 18.2+ animate between pages; other browsers navigate normally.
   The clicked card's cover and title are named in JS (layout.js → morphLinks) and morph into the page's hero. */
/* The opt-in itself, @view-transition { navigation: auto }, is an inline <style> in each page's <head> (allowed by a
   CSP hash): Chrome can decide before an external stylesheet is processed, so here it would be dropped at random. */
.case-visual { view-transition-name: project-hero; }
.case-head h1 { view-transition-name: project-title; }
.post-cover { view-transition-name: post-hero; }
.post-head h1 { view-transition-name: post-title; }
::view-transition-old(root) { animation: 180ms ease both vt-out; }
::view-transition-new(root) { animation: 300ms var(--ease) both vt-in; }
::view-transition-group(project-hero), ::view-transition-group(post-hero),
::view-transition-group(project-title), ::view-transition-group(post-title) { animation-duration: 460ms; animation-timing-function: var(--ease); }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------------------------------------------------------------- site-wide effects (js/public/fx.js) */
/* "Training run" HUD (js/public/training-hud.js): bottom-left, desktop only, decorative */
.train-hud { position: fixed; left: 14px; bottom: 18px; z-index: 40; width: 180px; display: grid; gap: 6px; padding: 10px 12px;
  font-family: var(--mono); font-size: 11px; color: var(--dim); pointer-events: none;
  background: color-mix(in srgb, var(--bg) 78%, transparent); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(8px); transition: opacity 300ms var(--ease), transform 300ms var(--ease); }
.train-hud.on { opacity: 1; transform: none; }
@media (max-width: 1439px) { .train-hud { display: none; } }   /* needs the free side margin: never over text */
.th-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; }
.th-split { justify-content: space-between; }
.th-led { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: blink 1.2s steps(1) infinite; }
.train-hud.done .th-led { background: var(--primary); box-shadow: 0 0 8px var(--primary); animation: none; }
.th-status { color: var(--fg); }
.train-hud.done .th-status { color: var(--primary); }
.th-file { margin-left: auto; }
.th-epoch { color: var(--fg); overflow: hidden; text-overflow: ellipsis; }
.th-bar { display: block; height: 3px; background: var(--line); overflow: hidden; }
.th-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--primary)); transform-origin: 0 50%; transform: scaleX(0); }
.th-loss { color: var(--primary); font-weight: 700; }
.th-spark { width: 76px; height: 22px; overflow: visible; }
.th-curve { stroke: var(--primary); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.th-dot { fill: var(--accent); }
.fx-backdrop { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: 0; }
.fx-field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; animation: fx-fade 900ms var(--ease); }
@keyframes fx-fade { from { opacity: 0; } }
.fx-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 90; pointer-events: none;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 50%, var(--accent)), var(--accent));
  box-shadow: 0 0 10px color-mix(in srgb, var(--primary) 60%, transparent); }
.fx-cursor { position: fixed; left: 0; top: 0; width: 30px; height: 30px; z-index: 300; pointer-events: none; border-radius: 50%;
  translate: -50% -50%; opacity: 0; border: 1px solid color-mix(in srgb, var(--primary) 70%, transparent);
  transition: width 200ms var(--ease), height 200ms var(--ease), opacity 200ms, background-color 200ms, border-color 200ms; }
.fx-cursor.on { opacity: 1; }
.fx-cursor.hot { width: 54px; height: 54px; border-color: var(--accent); background: color-mix(in srgb, var(--primary) 7%, transparent); }
.fx-cursor.down { width: 22px; height: 22px; }
.fx-cursor.hot.down { width: 42px; height: 42px; }
.fx-cursor.text { opacity: 0; }

/* ---------------------------------------------------------------- portfolio terminal (js/public/terminal.js) */
.term-btn { display: inline-flex; align-items: center; justify-content: center; height: 34px; min-width: 40px; padding: 0 10px;
  background: none; border: 1px solid var(--line); color: var(--primary); font-family: var(--mono); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: border-color 200ms, box-shadow 200ms; }
.term-btn:hover { border-color: var(--primary); box-shadow: var(--glow-sm); }
@media (max-width: 760px) { .term-btn { height: 40px; } }
html.term-open { overflow: hidden; }
.term-backdrop { position: fixed; inset: 0; z-index: 120; display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh var(--gutter) 24px;
  background: rgb(0 0 0 / 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.term { width: min(680px, 100%); min-width: 0; max-height: min(560px, 76vh); display: flex; flex-direction: column;
  box-shadow: var(--glow), 0 24px 60px rgb(0 0 0 / 0.6); border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
  animation: term-in 180ms var(--ease); }
@keyframes term-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
.term h2.win-title { font-size: 12px; font-weight: 400; flex: 1; }
.term-body { flex: 1; min-height: 200px; overflow-y: auto; padding: 16px 20px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; }
.term-line { overflow-wrap: anywhere; }
.term-answer { white-space: pre-wrap; }
.term-err { color: var(--danger); }
.term-line + .term-line { margin-top: 4px; }
.term-grid { display: grid; grid-template-columns: max-content 1fr; gap: 2px 20px; }
.term-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.term-row .tag { font-size: 11px; padding: 2px 8px; }
.term-link { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-align: left;
  overflow-wrap: anywhere;
  text-decoration: underline dotted color-mix(in srgb, var(--primary) 50%, transparent); text-underline-offset: 3px; }
.term-link:hover { color: var(--accent); }
.term-form { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); font-family: var(--mono); }
.term-prompt { color: var(--primary); font-size: 14px; white-space: nowrap; }
.term-input { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 4px 0; font-family: var(--mono); font-size: 16px;
  color: var(--fg); caret-color: var(--primary); }
.term-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 14px; }
@media (max-width: 480px) { .term-backdrop { padding-top: 72px; } .term-prompt { font-size: 12px; } .term-body { padding: 12px 14px; } }

/* ---------------------------------------------------------------- "ask my portfolio" assistant */
.ask-launcher { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 70; display: inline-flex;
  align-items: center; gap: 6px; min-height: 44px; padding: 10px 16px; background: var(--bg); color: var(--fg); cursor: pointer;
  border: 1px solid var(--primary); font-family: var(--mono); font-size: 14px; box-shadow: var(--glow);
  transition: background-color 200ms, color 200ms; }
.ask-launcher:hover { background: var(--primary); color: var(--bg); }
.ask-launcher:hover .p-c { color: var(--bg); }
.ask-launcher .cur { height: 0.9em; }
.ask-panel { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 80;
  width: min(440px, calc(100vw - 40px)); height: min(600px, calc(100dvh - 120px)); display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.6), var(--glow); }
.ask-panel .win-bar { flex: none; }
.ask-panel h2.win-title { font-size: 12px; font-weight: 400; flex: 1; }
.ask-close { background: none; border: 0; color: var(--dim); cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; }
.ask-close:hover { color: var(--primary); }
.ask-close svg { width: 16px; height: 16px; }
.ask-body { flex: 1; overflow-y: auto; padding: 16px; display: grid; align-content: start; gap: 14px; font-size: 14px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ask-intro { font-family: var(--mono); font-size: 12px; color: var(--dim); line-height: 1.6; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-chips .fbtn { text-align: left; white-space: normal; line-height: 1.4; }
.ask-proj { display: grid; gap: 12px; font-size: 13px; }
.ask-proj > p { margin: 0; line-height: 1.5; }
.ask-proj-qs { display: grid; gap: 6px; }
.ask-proj-qs .fbtn { text-align: left; white-space: normal; line-height: 1.4; }
.ask-proj > .btn { justify-self: start; }
.ask-line[aria-busy="true"] > p { display: inline; }
.ask-log { display: grid; gap: 14px; }
.ask-line { line-height: 1.65; }
.ask-q { font-family: var(--mono); font-size: 13px; color: var(--fg); word-break: break-word; }
.ask-a { color: var(--fg); display: grid; gap: 8px; padding-left: 14px; border-left: 1px solid var(--line); }
.ask-a .arrow-list { margin: 0; }
.ask-a .arrow-list li { color: var(--fg); font-size: 14px; }
.ask-err { font-family: var(--mono); font-size: 12px; color: var(--danger); }
.ask-sources { font-family: var(--mono); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.ask-sources a:hover { text-decoration: underline; }
.ask-form { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.ask-form .cmd { margin: 0; font-family: var(--mono); color: var(--primary); }
.ask-form .inp { padding: 8px 10px; font-size: 16px; }
.ask-note { flex: none; font-family: var(--mono); font-size: 10.5px; color: var(--dim); padding: 0 16px 10px; }
@media (max-width: 560px) {
  .ask-panel { right: 0; bottom: 0; width: 100vw; height: min(85dvh, 640px); border-left: 0; border-right: 0; }
  .ask-launcher { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
}
/* Long slugs/titles must wrap instead of widening grid columns on phones */
.pc-grid > *, .post-grid > *, .blog-grid > *, .club-grid > *, .edu-grid > *, .about-grid > *, .contact-grid > *, .case-layout > * { min-width: 0; }
.pc h3, .post-card h3, .case-head h1, .post-head h1, .stack-row .tag { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- recruiter-first hero additions */
.hero-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.hero-top:empty { display: none; }
.hero-top .status-line { margin-bottom: 0; }
.avatar { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--primary); box-shadow: var(--glow-sm); }

/* ------------------------------------------------------------ printable resume (resume.html) */
.resume-page { background: var(--bg); }
.resume-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 52rem; padding-block: 24px 16px; }
.resume-bar .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.paper { --ink: #18181b; --ink-dim: #52525b; --rule: #e4e4e7; --link: #047857;
  max-width: 52rem; margin: 0 auto 48px; background: #fff; color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.5;
  padding: 48px 56px; border-radius: 6px; box-shadow: 0 10px 40px rgb(0 0 0 / 0.5); overflow-wrap: break-word; }
.paper a { color: var(--link); text-decoration: none; }
.paper a:hover { text-decoration: underline; }
.rs-top h1 { font-family: var(--mono); font-size: 30px; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); }
.rs-top .role { font-size: 16px; color: var(--ink-dim); margin-top: 4px; }
.rs-contact { margin-top: 8px; font-size: 13px; color: var(--ink-dim); }
.rs-contact .sep { color: #a1a1aa; }
.rs { margin-top: 22px; }
.rs h2 { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--link);
  border-bottom: 1px solid var(--rule); padding-bottom: 4px; margin-bottom: 10px; }
.rs-item + .rs-item { margin-top: 12px; }
.rs-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; }
.rs-head h3 { font-size: 15px; font-weight: 600; color: var(--ink); }
.rs-head .org { font-weight: 400; color: var(--ink-dim); }
.rs-head .when { font-size: 12.5px; color: var(--ink-dim); white-space: nowrap; }
.paper p { margin-top: 3px; }
.paper ul { margin: 4px 0 0 18px; padding: 0; list-style: disc; }
.paper li { margin-top: 2px; }
.paper .tech { font-size: 12.5px; color: var(--ink-dim); }
.rs-skills { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.rs-skills dt { font-weight: 600; }
.rs-skills dd { margin: 0; color: var(--ink-dim); }
@media (max-width: 640px) {
  .paper { padding: 28px 20px; border-radius: 0; }
  .rs-skills { grid-template-columns: 1fr; }
  .rs-skills dd { margin-bottom: 6px; }
}
@media print {
  .fx-field, .fx-backdrop, .fx-progress, .fx-cursor, .term-backdrop, .train-hud { display: none !important; }
  @page { size: A4; margin: 10mm 12mm; }
  :root:has(body.resume-page) { color-scheme: light; background: #fff; }
  body.resume-page { background: #fff !important; }
  .resume-page .resume-bar, .resume-page .skip-link { display: none !important; }
  .paper { box-shadow: none; padding: 0; margin: 0; max-width: none; font-size: 9pt; line-height: 1.3; border-radius: 0; }
  .rs { margin-top: 8px; }
  .rs h2 { margin-bottom: 5px; font-size: 8.5pt; }
  .rs-item + .rs-item { margin-top: 6px; }
  .rs-top h1 { font-size: 20pt; }
  .rs-top .role { font-size: 11pt; }
  .rs-head h3 { font-size: 10pt; }
  .rs-head .when, .paper .tech, .rs-contact { font-size: 8.5pt; }
  .rs-skills { grid-template-columns: max-content 1fr max-content 1fr; gap: 1px 10px; }
  .rs-skills dt { font-size: 8.5pt; }
  .rs-skills dd { font-size: 8.5pt; }
  .rs > ul { font-size: 8.5pt; }
  .paper ul li { break-inside: avoid; }
  .paper a { color: inherit; }
  .rs-item, .rs-skills dt, .rs-skills dd { break-inside: avoid; }
  .rs h2 { break-after: avoid; }
}
