/* qsimeon.github.io — site styles. Tokens live in tokens.css (loaded first).
   Order: reset → base → layout → components → home → pages → prose → syntax → motion → print. */

/* ───────────────────────────── reset ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1.5rem); }
body { min-height: 100dvh; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
p, h1, h2, h3, h4 { overflow-wrap: break-word; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

/* ───────────────────────────── base ───────────────────────────── */
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

h1, h2, h3, h4 { font-weight: 600; line-height: var(--leading-snug); letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
strong { font-weight: 600; }
em { font-style: italic; }
small { font-size: var(--text-sm); }
code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.9em; }
hr { border: 0; border-top: 1px solid var(--line); }

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

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  padding: 0.5rem 0.9rem; border-radius: var(--radius-sm);
  background: var(--fg); color: var(--bg); font-size: var(--text-sm);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: 0.75rem; }

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

/* ───────────────────────────── layout ───────────────────────────── */
.container { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.container--prose { max-width: calc(var(--prose) + 2 * var(--gutter)); }
.section { padding-block: var(--section) 0; }
.section:last-child { padding-bottom: var(--section); }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .container { height: 100%; display: flex; align-items: center; gap: 1.5rem; }

.brand { display: inline-flex; align-items: center; gap: 0.65rem; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9px;
  background: var(--fg); color: var(--bg);
  font-family: var(--font-serif); font-style: italic; font-size: 1.15rem; line-height: 1;
  transition: transform var(--dur) var(--ease-out);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.05); }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 0.25rem; list-style: none; padding: 0; }
.site-nav a {
  display: block; padding: 0.4rem 0.8rem; border-radius: var(--radius-pill);
  font-size: var(--text-sm); color: var(--fg-2);
  transition: color var(--dur-fast), background-color var(--dur-fast);
}
.site-nav a:hover { color: var(--fg); background: var(--bg-hover); }
.site-nav a[aria-current="page"] { color: var(--fg); background: var(--bg-hover); }

.header-actions { display: flex; align-items: center; gap: 0.25rem; }
.icon-btn {
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: var(--radius-pill);
  color: var(--fg-2); transition: color var(--dur-fast), background-color var(--dur-fast);
}
.icon-btn:hover { color: var(--fg); background: var(--bg-hover); }
.icon-btn svg { width: 1.1rem; height: 1.1rem; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
.menu-btn { display: none; }

@media (max-width: 46rem) {
  .menu-btn { display: grid; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 0.75rem var(--gutter) 1.25rem;
    opacity: 0; visibility: hidden; transform: translateY(-0.5rem);
    transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), visibility 0s linear var(--dur);
  }
  .site-nav.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { font-size: var(--text-lg); padding: 0.7rem 0.25rem; border-radius: 0; border-bottom: 1px solid var(--line); background: none !important; }
  .header-actions { margin-left: auto; }
}

/* footer */
.site-footer { margin-top: var(--section); border-top: 1px solid var(--line); padding-block: 3.5rem 2.5rem; color: var(--fg-2); font-size: var(--text-sm); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2rem; }
.footer-grid h2 { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 0.9rem; }
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: 0.45rem; }
.footer-grid a:hover { color: var(--fg); }
.footer-blurb { max-width: 26ch; margin-top: 0.75rem; }
.footer-base { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--fg-3); font-size: var(--text-xs); font-family: var(--font-mono); }
.footer-base a:hover { color: var(--fg); }
@media (max-width: 46rem) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ───────────────────────────── components ───────────────────────────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.eyebrow--plain::before { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 2.75rem; padding-inline: 1.15rem; border-radius: var(--radius-pill);
  font-size: var(--text-sm); font-weight: 500; letter-spacing: -0.005em; white-space: nowrap;
  border: 1px solid var(--line-strong); color: var(--fg); background: var(--bg-raised);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); border-color: var(--fg-3); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn svg { width: 1rem; height: 1rem; transition: transform var(--dur) var(--ease-out); }
.btn:hover svg.icon-arrow { transform: translateX(3px); }
.btn-primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-primary:hover { background: var(--fg); border-color: var(--fg); box-shadow: 0 10px 30px -10px var(--glow), var(--shadow); }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--fg-2); }
.btn-ghost:hover { color: var(--fg); background: var(--bg-hover); border-color: transparent; box-shadow: none; }
.btn-sm { height: 2.25rem; padding-inline: 0.9rem; font-size: var(--text-xs); }

.link-arrow { display: inline-flex; align-items: center; gap: 0.35rem; font-size: var(--text-sm); color: var(--fg-2); transition: color var(--dur-fast); }
.link-arrow svg { width: 0.95rem; height: 0.95rem; transition: transform var(--dur) var(--ease-out); }
.link-arrow:hover { color: var(--fg); }
.link-arrow:hover svg { transform: translateX(3px); }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; }
.chip {
  display: inline-flex; align-items: center; height: 1.6rem; padding-inline: 0.6rem; border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: var(--tracking-mono); color: var(--fg-2);
  border: 1px solid var(--line); background: var(--bg-raised);
}
a.chip:hover { color: var(--fg); border-color: var(--line-strong); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.25rem); }
.section-title { font-size: var(--text-3xl); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); margin-top: 0.85rem; max-width: 18ch; }
.section-title em, .page-title em, .hero-title em { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; color: var(--accent); }
.section-lede { margin-top: 1rem; color: var(--fg-2); font-size: var(--text-lg); max-width: 52ch; }
@media (max-width: 46rem) { .section-head { flex-direction: column; align-items: flex-start; } }

.avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-strong); }

/* cards: spotlight follows the pointer via --mx/--my set in site.js */
.card {
  position: relative; isolation: isolate; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-raised);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur);
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0;
  background: radial-gradient(28rem circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 45%);
  transition: opacity var(--dur) var(--ease-out);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card:hover::before { opacity: 1; }
.card-link { position: absolute; inset: 0; z-index: 3; border-radius: inherit; }
.card-visual { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-sunken); border-bottom: 1px solid var(--line); }
.card-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
.card:hover .card-visual img { transform: scale(1.04); }
.card-body { display: flex; flex-direction: column; gap: 0.55rem; padding: 1.25rem 1.35rem 1.4rem; flex: 1; }
.card-kind { display: flex; justify-content: space-between; gap: 1rem; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--fg-3); letter-spacing: var(--tracking-mono); }
.card-title { font-size: var(--text-xl); letter-spacing: -0.025em; line-height: 1.2; }
.card-blurb { color: var(--fg-2); font-size: var(--text-sm); line-height: 1.6; }
.card-links { position: relative; z-index: 4; display: flex; gap: 0.4rem; margin-top: auto; padding-top: 0.6rem; }

/* built-in card drawings (_includes/visual.html) */
.visual-draw { display: grid; place-items: center; width: 100%; height: 100%; color: var(--fg-3);
  background:
    radial-gradient(circle at 20% 15%, var(--accent-soft), transparent 55%),
    radial-gradient(circle at 85% 90%, var(--signal-soft), transparent 50%),
    var(--bg-sunken); }
.visual-draw svg { width: 88%; height: 80%; overflow: visible; }
.visual-draw .stroke-accent { stroke: var(--accent); }
.visual-draw .stroke-signal { stroke: var(--signal); }
.visual-draw .fill-accent { fill: var(--accent); }
.visual-draw .axis { stroke: var(--line-strong); }
.visual-draw .grid { stroke: var(--line); }
.visual-draw text { fill: var(--fg-3); font-family: var(--font-mono); font-size: 9px; }
.visual-draw .quote-mark { fill: var(--accent); font-family: var(--font-serif); font-size: 140px; }
.draw-path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.is-visible .draw-path { animation: draw 1.6s var(--ease-out) 0.2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.terminal { width: 86%; border-radius: 10px; background: var(--bg-raised); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-family: var(--font-mono); font-size: 0.72rem; line-height: 1.7; color: var(--fg-2); overflow: hidden; }
.terminal-bar { display: flex; gap: 5px; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); }
.terminal-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.terminal pre { margin: 0; padding: 0.7rem 0.9rem 0.9rem; font-size: inherit; white-space: pre; }
.terminal .t-prompt { color: var(--accent); }
.terminal .t-ok { color: var(--signal); }
.terminal .t-caret { display: inline-block; width: 0.5em; height: 1em; vertical-align: -0.15em; background: var(--accent); animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ───────────────────────────── home ───────────────────────────── */
.hero { position: relative; isolation: isolate; overflow: hidden; padding-block: clamp(4.5rem, 3rem + 7vw, 9.5rem) clamp(3.5rem, 2rem + 5vw, 7rem); border-bottom: 1px solid var(--line); }
.hero-canvas {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 70% 45%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 85% at 70% 45%, #000 30%, transparent 78%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 20%, transparent 75%);
  opacity: 0.55;
}
.hero::after {
  content: ""; position: absolute; z-index: -2; width: 60rem; height: 40rem; right: -18rem; top: -16rem;
  background: radial-gradient(closest-side, var(--glow), transparent);
  filter: blur(10px);
}
.hero-inner { position: relative; max-width: 54rem; }
.now-pill {
  display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0.85rem 0.3rem 0.35rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: color-mix(in srgb, var(--bg-raised) 80%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: var(--text-sm); color: var(--fg-2); box-shadow: var(--shadow-sm);
}
.now-pill .avatar { width: 1.75rem; height: 1.75rem; }
.now-pill strong { color: var(--fg); font-weight: 500; }
.pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--signal); animation: pulse 2.2s var(--ease-out) infinite; }
@keyframes pulse { from { transform: scale(1); opacity: 0.7; } to { transform: scale(3.2); opacity: 0; } }
.hero-title { margin-top: 1.75rem; font-size: var(--text-hero); line-height: 0.98; letter-spacing: -0.045em; font-weight: 600; max-width: 14ch; }
.hero-title em { padding-right: 0.06em; }
.hero-lede { margin-top: 1.75rem; max-width: 46ch; font-size: var(--text-lg); line-height: 1.6; color: var(--fg-2); }
.hero-lede strong { color: var(--fg); font-weight: 500; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2.25rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 1.5rem; margin-top: 3rem; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--fg-3); letter-spacing: var(--tracking-mono); list-style: none; padding: 0; }
.hero-meta li { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero-meta svg { width: 0.85rem; height: 0.85rem; }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; list-style: none; padding: 0; }
.bento > li { grid-column: span 2; display: flex; }
.bento > li > .card { flex: 1; }
.bento > .span-wide { grid-column: span 4; }
.bento > .span-half { grid-column: span 3; }
.bento > .span-wide .card-visual { aspect-ratio: auto; flex: 1; min-height: 15rem; }
.bento > .span-wide .card { flex-direction: row; }
.bento > .span-wide .card-visual { width: 55%; border-bottom: 0; border-right: 1px solid var(--line); }
.bento > .span-wide .card-body { width: 45%; justify-content: center; padding: 1.75rem; }
.bento > .span-wide .card-title { font-size: var(--text-2xl); }
.bento > .span-wide .card-links { margin-top: 0.75rem; }
@media (max-width: 64rem) { .bento > li, .bento > .span-half { grid-column: span 3; } .bento > .span-wide { grid-column: span 6; } }
@media (max-width: 40rem) {
  .bento > li, .bento > .span-half, .bento > .span-wide { grid-column: span 6; }
  .bento > .span-wide .card { flex-direction: column; }
  .bento > .span-wide .card-visual { width: 100%; aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--line); }
  .bento > .span-wide .card-body { width: 100%; padding: 1.25rem 1.35rem 1.4rem; }
}

/* timeline */
.timeline { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 7rem 1fr 1.2fr; gap: 1.5rem; align-items: baseline; padding-block: 1.35rem; border-bottom: 1px solid var(--line); transition: background-color var(--dur-fast); }
.timeline li:hover { background: linear-gradient(90deg, transparent, var(--accent-soft) 50%, transparent); }
.tl-year { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--fg-3); }
.tl-role { font-weight: 600; letter-spacing: -0.01em; }
.tl-org { display: block; color: var(--fg-2); font-weight: 400; font-size: var(--text-sm); margin-top: 0.15rem; }
.tl-short { color: var(--fg-2); font-size: var(--text-sm); }
@media (max-width: 46rem) { .timeline li { grid-template-columns: 4.5rem 1fr; gap: 0.25rem 1rem; } .tl-short { grid-column: 2; } }

/* writing rows */
.post-list { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.post-row { display: grid; grid-template-columns: 7rem 1fr auto; gap: 1.5rem; align-items: baseline; padding-block: 1.4rem; border-bottom: 1px solid var(--line); position: relative; }
.post-row::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); background: var(--bg-hover); opacity: 0; transform: scale(0.98); transition: opacity var(--dur-fast), transform var(--dur) var(--ease-out); z-index: -1; margin-inline: -1rem; }
.post-row:hover::after { opacity: 1; transform: none; }
.post-list li { isolation: isolate; }
.post-date { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--fg-3); white-space: nowrap; }
.post-title { font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.02em; line-height: 1.35; }
.post-excerpt { margin-top: 0.35rem; color: var(--fg-2); font-size: var(--text-sm); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 72ch; }
.post-row .chips { margin-top: 0.7rem; }
.post-arrow { color: var(--fg-3); transition: transform var(--dur) var(--ease-out), color var(--dur-fast); }
.post-arrow svg { width: 1.1rem; height: 1.1rem; }
.post-row:hover .post-arrow { color: var(--accent); transform: translate(3px, -3px); }
.post-row:hover .post-title { color: var(--fg); }
@media (max-width: 46rem) { .post-row { grid-template-columns: 1fr auto; gap: 0.35rem 1rem; } .post-date { grid-column: 1 / -1; } }
.year-label { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--fg-3); margin: 3rem 0 0.75rem; }
.year-label:first-child { margin-top: 0; }

/* recognition marquee */
.marquee { position: relative; overflow: hidden; padding-block: 1.6rem; border-block: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; gap: 3rem; animation: marquee 48s linear infinite; list-style: none; padding: 0; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track li { display: inline-flex; align-items: center; gap: 0.75rem; white-space: nowrap; color: var(--fg-2); font-size: var(--text-sm); }
.marquee-track li::before { content: "✦"; color: var(--accent); font-size: 0.7rem; }
.marquee-track strong { color: var(--fg); font-weight: 500; }
@keyframes marquee { to { transform: translateX(calc(-50% - 1.5rem)); } }

/* contact */
.contact { position: relative; isolation: isolate; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(2.25rem, 1.5rem + 4vw, 4.5rem); background: var(--bg-raised); }
.contact::before { content: ""; position: absolute; z-index: -1; inset: auto -10% -60% 30%; height: 120%; background: radial-gradient(closest-side, var(--glow), transparent); }
.contact-title { font-size: var(--text-3xl); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); max-width: 16ch; }
.contact-title em { font-family: var(--font-serif); font-weight: 400; color: var(--accent); }
.contact p { margin-top: 1rem; max-width: 50ch; color: var(--fg-2); font-size: var(--text-lg); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2rem; }

/* ───────────────────────────── pages ───────────────────────────── */
.page-head { padding-block: clamp(3.5rem, 2.5rem + 5vw, 7rem) clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.page-title { margin-top: 1rem; font-size: var(--text-3xl); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); max-width: 20ch; }
.page-lede { margin-top: 1.25rem; max-width: 56ch; color: var(--fg-2); font-size: var(--text-lg); }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2rem; }
.page-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: -1rem 0 3rem; }

.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 1rem; list-style: none; padding: 0; }
.work-grid > li { display: flex; }
.work-grid > li > .card { flex: 1; }
.press-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); gap: 1rem; list-style: none; padding: 0; }
.press-grid .card-visual { aspect-ratio: 4 / 3; }
.press-grid .card-title { font-size: var(--text-base); }

/* entry lists: publications, talks, teaching */
.entry-list { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.entry-list > li { display: grid; grid-template-columns: 7rem 1fr; gap: 1.5rem; padding-block: 1.5rem; border-bottom: 1px solid var(--line); }
.entry-year { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--fg-3); }
.entry-title { font-weight: 600; font-size: var(--text-lg); letter-spacing: -0.015em; line-height: 1.4; }
.entry-title a:hover { color: var(--accent); }
.entry-meta { margin-top: 0.3rem; color: var(--fg-2); font-size: var(--text-sm); }
.entry-meta .me { color: var(--fg); font-weight: 600; }
.entry-links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
@media (max-width: 46rem) { .entry-list > li { grid-template-columns: 1fr; gap: 0.3rem; } }

/* about */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(2rem, 1rem + 5vw, 6rem); align-items: start; }
.about-portrait { position: sticky; top: calc(var(--header-h) + 2rem); }
.about-portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.facts { list-style: none; padding: 0; margin-top: 1.5rem; display: grid; gap: 0; border-top: 1px solid var(--line); font-size: var(--text-sm); }
.facts li { display: flex; justify-content: space-between; gap: 1rem; padding-block: 0.7rem; border-bottom: 1px solid var(--line); }
.facts span:first-child { color: var(--fg-3); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: var(--tracking-mono); text-transform: uppercase; padding-top: 0.15rem; }
.facts span:last-child { text-align: right; }
@media (max-width: 52rem) { .about-grid { grid-template-columns: 1fr; } .about-portrait { position: static; max-width: 24rem; } }

/* cv */
.cv-section { display: grid; grid-template-columns: 12rem 1fr; gap: 2rem; padding-block: 2.5rem; border-top: 1px solid var(--line); }
.cv-section > h2 { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); padding-top: 0.3rem; }
.cv-items { display: grid; gap: 1.75rem; list-style: none; padding: 0; }
.cv-item-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.cv-item-head > :first-child { flex: 1 1 18rem; min-width: 0; }
.cv-item-head .cv-item-date { flex: none; }
.nowrap { white-space: nowrap; }
.cv-item-title { font-weight: 600; letter-spacing: -0.01em; }
.cv-item-org { color: var(--fg-2); }
.cv-item-date { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--fg-3); white-space: nowrap; }
.cv-item ul { margin-top: 0.5rem; padding-left: 1.1rem; color: var(--fg-2); font-size: var(--text-sm); display: grid; gap: 0.3rem; }
.cv-item ul li::marker { color: var(--fg-3); }
.cv-simple { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.cv-simple li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.cv-simple a:hover { color: var(--accent); }
.skills-table { display: grid; grid-template-columns: 9rem 1fr; gap: 0.6rem 1.5rem; font-size: var(--text-sm); }
.skills-table dt { font-weight: 600; }
.skills-table dd { color: var(--fg-2); margin: 0; }
@media (max-width: 46rem) { .cv-section { grid-template-columns: 1fr; gap: 1rem; } .skills-table { grid-template-columns: 1fr; gap: 0.1rem; } .skills-table dd { margin-bottom: 0.6rem; } }

.notfound { min-height: 60vh; display: grid; align-content: center; }
.notfound-code { font-family: var(--font-serif); font-style: italic; font-size: clamp(6rem, 3rem + 14vw, 14rem); line-height: 0.9; color: var(--accent); }

/* ───────────────────────────── post ───────────────────────────── */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
@supports (animation-timeline: scroll()) {
  .progress { animation: progress linear both; animation-timeline: scroll(root); }
  @keyframes progress { to { transform: scaleX(1); } }
}
@supports not (animation-timeline: scroll()) { .progress { display: none; } }

.post-head { padding-block: clamp(3rem, 2rem + 4vw, 6rem) 2.5rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); transition: color var(--dur-fast); }
.back-link svg { width: 0.9rem; height: 0.9rem; transform: rotate(180deg); transition: transform var(--dur) var(--ease-out); }
.back-link:hover { color: var(--fg); }
.back-link:hover svg { transform: rotate(180deg) translateX(3px); }
.post-title-lg { margin-top: 1.5rem; font-size: clamp(2rem, 1.45rem + 2.1vw, 3.1rem); line-height: 1.08; letter-spacing: var(--tracking-tight); }
.post-lede { margin-top: 1.25rem; font-size: var(--text-lg); color: var(--fg-2); line-height: 1.55; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--fg-3); letter-spacing: var(--tracking-mono); }
.post-meta .avatar { width: 1.6rem; height: 1.6rem; }
.post-meta .author { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--fg-2); font-family: var(--font-sans); font-size: var(--text-sm); letter-spacing: 0; }
.post-meta .chips { flex-basis: 100%; }
.post-foot { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.post-nav a { display: block; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); transition: border-color var(--dur-fast), transform var(--dur) var(--ease-out); }
.post-nav a:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.post-nav small { display: block; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--fg-3); margin-bottom: 0.3rem; }
.post-nav .next { text-align: right; grid-column: 2; }
.post-nav span { font-weight: 600; letter-spacing: -0.01em; }
@media (max-width: 40rem) { .post-nav { grid-template-columns: 1fr; } .post-nav .next { grid-column: 1; } }

/* ───────────────────────────── prose ───────────────────────────── */
.prose { font-size: var(--text-prose); line-height: 1.75; color: var(--fg); }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { margin-top: 2.6em; font-size: var(--text-xl); letter-spacing: -0.025em; line-height: 1.25; }
.prose h3 { margin-top: 2.1em; font-size: var(--text-lg); letter-spacing: -0.015em; }
.prose h4 { margin-top: 1.8em; font-size: var(--text-base); }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.75em; }
.prose a { color: var(--fg); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; transition: text-decoration-color var(--dur-fast), color var(--dur-fast); }
.prose a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.prose strong { color: var(--fg); }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--fg-3); }
.prose blockquote { padding: 0.25em 0 0.25em 1.25em; border-left: 2px solid var(--accent); color: var(--fg-2); font-style: normal; }
.prose blockquote > * + * { margin-top: 0.75em; }
.prose img { border-radius: var(--radius); border: 1px solid var(--line); margin-inline: auto; }
.prose figure { margin-block: 2em; }
.prose figcaption, .prose img + em { display: block; margin-top: 0.75em; text-align: center; font-size: var(--text-sm); color: var(--fg-3); }
.prose hr { margin-block: 3em; }
.prose :not(pre) > code { padding: 0.15em 0.4em; border-radius: 6px; background: var(--bg-sunken); border: 1px solid var(--line); font-size: 0.85em; color: var(--fg); overflow-wrap: anywhere; }
.prose pre { overflow-x: auto; padding: 1.1rem 1.25rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-sunken); font-size: 0.82rem; line-height: 1.65; }
.prose pre code { font-size: inherit; }
.prose div.highlighter-rouge, .prose figure.highlight { margin-block: 1.5em; }
.prose table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: var(--text-sm); line-height: 1.5; }
.prose th, .prose td { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-weight: 600; border-bottom-color: var(--line-strong); white-space: nowrap; }
.prose tbody tr:hover { background: var(--bg-hover); }
.prose svg { max-width: 100%; height: auto; margin-inline: auto; }
.prose mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; padding-block: 0.25em; }
.prose .footnotes { margin-top: 4em; padding-top: 1.5em; border-top: 1px solid var(--line); font-size: var(--text-sm); color: var(--fg-2); }
.prose sup a { text-decoration: none; color: var(--accent); }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); }

/* ───────────────────────────── syntax (rouge) ───────────────────────────── */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp { color: var(--fg-3); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kc, .highlight .kt, .highlight .ow { color: light-dark(#8f3fb0, #d2a8ff); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr { color: light-dark(#1f7a3a, #9ae6a8); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .il { color: light-dark(#b25000, #ffb86b); }
.highlight .nf, .highlight .fm, .highlight .nc, .highlight .nn { color: light-dark(#0b5cad, #8fc7ff); }
.highlight .nb, .highlight .bp, .highlight .nt { color: var(--accent); }
.highlight .na, .highlight .nv, .highlight .vi { color: light-dark(#a3420f, #ffa98a); }
.highlight .o, .highlight .p { color: var(--fg-2); }
.highlight .gd { color: light-dark(#b42318, #ff8c84); }
.highlight .gi { color: light-dark(#1f7a3a, #9ae6a8); }
.highlight .err { color: inherit; background: none; }

/* ───────────────────────────── motion ───────────────────────────── */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 260ms; animation-timing-function: var(--ease-out); }

.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
  .draw-path { stroke-dashoffset: 0; }
}

/* ───────────────────────────── print ───────────────────────────── */
@media print {
  .site-header, .site-footer, .hero-canvas, .progress, .post-nav, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .prose a { text-decoration: underline; }
}
