/* ============================================================ tokens */
:root {
  --bg: #f3efe6;
  --surface: #fbf9f3;
  --ink: #17150f;
  --ink-2: #3a372f;
  --muted: #6e695d;
  --line: #d9d2c2;
  --line-soft: #e7e1d3;
  --accent: #d9481f;
  --accent-soft: rgba(217, 72, 31, 0.11);
  --mark: rgba(217, 72, 31, 0.16);
  --code-bg: #ece6d8;
  --net-node: 23, 21, 15;
  --net-pulse: 217, 72, 31;

  --hl-blue: #2459b8; --hl-purple: #7a3fb8; --hl-red: #c2331f; --hl-orange: #c05a12; --hl-yellow: #9a7400;
  --hl-green: #2f7d4a; --hl-teal: #11756f; --hl-pink: #b3336f; --hl-brown: #87572f; --hl-gray: #6e695d;
  --hlb-blue: #dde8fb; --hlb-purple: #ebdff8; --hlb-red: #fadcd6; --hlb-yellow: #f8ecc4; --hlb-green: #dcefe2;
  --hlb-pink: #f8dcea; --hlb-gray: #e7e3d9; --hlb-brown: #efe0d0;

  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e0c; --surface: #171613; --ink: #eeeae1; --ink-2: #c9c4b8; --muted: #958f81;
    --line: #2d2b26; --line-soft: #22211d; --accent: #ff6b3d; --accent-soft: rgba(255, 107, 61, 0.14);
    --mark: rgba(255, 107, 61, 0.22); --code-bg: #1c1b17; --net-node: 238, 234, 225; --net-pulse: 255, 107, 61;
    --hl-blue: #7fa8f5; --hl-purple: #c09af0; --hl-red: #f38a74; --hl-orange: #f5a162; --hl-yellow: #e8c75a;
    --hl-green: #7cc795; --hl-teal: #5cc6bd; --hl-pink: #f08bbd; --hl-brown: #d0a17a; --hl-gray: #a39d8f;
    --hlb-blue: #1d2a44; --hlb-purple: #2d2340; --hlb-red: #3d1f1a; --hlb-yellow: #3a3116; --hlb-green: #1b3224;
    --hlb-pink: #3b1f2e; --hlb-gray: #26251f; --hlb-brown: #33271c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0e0c; --surface: #171613; --ink: #eeeae1; --ink-2: #c9c4b8; --muted: #958f81;
  --line: #2d2b26; --line-soft: #22211d; --accent: #ff6b3d; --accent-soft: rgba(255, 107, 61, 0.14);
  --mark: rgba(255, 107, 61, 0.22); --code-bg: #1c1b17; --net-node: 238, 234, 225; --net-pulse: 255, 107, 61;
  --hl-blue: #7fa8f5; --hl-purple: #c09af0; --hl-red: #f38a74; --hl-orange: #f5a162; --hl-yellow: #e8c75a;
  --hl-green: #7cc795; --hl-teal: #5cc6bd; --hl-pink: #f08bbd; --hl-brown: #d0a17a; --hl-gray: #a39d8f;
  --hlb-blue: #1d2a44; --hlb-purple: #2d2340; --hlb-red: #3d1f1a; --hlb-yellow: #3a3116; --hlb-green: #1b3224;
  --hlb-pink: #3b1f2e; --hlb-gray: #26251f; --hlb-brown: #33271c;
  color-scheme: dark;
}

/* ============================================================ base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; }
img, svg, canvas { display: block; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
code { font: 400 .88em var(--mono); background: var(--code-bg); padding: 1px 6px; border-radius: 5px; }
mark { background: linear-gradient(transparent 58%, var(--mark) 58%); color: var(--ink); padding: 0 1px; }
.count { font: 500 11px var(--mono); background: var(--line-soft); color: var(--muted); padding: 2px 7px; border-radius: 6px; vertical-align: middle; letter-spacing: 0; }

/* ============================================================ nav */
.nav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.nav-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font: 500 15px var(--mono); text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.nav-links { display: flex; gap: 2px; margin-left: auto; }
.nav-links a { font: 400 13.5px var(--mono); text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 8px; transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--ink); background: var(--line-soft); }
.nav-links a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); }
.nav-actions { display: flex; gap: 8px; }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--ink); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; font: 500 15px var(--mono); transition: border-color .2s, background .2s; }
.icon-btn:hover:not(:disabled) { border-color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.menu-btn { display: none; }
.i-moon { display: none !important; }
:root[data-theme="dark"] .i-sun { display: none !important; }
:root[data-theme="dark"] .i-moon { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none !important; }
  :root:not([data-theme="light"]) .i-moon { display: block !important; }
}

/* ============================================================ buttons */
.btn { font: 500 14px var(--mono); text-decoration: none; padding: 13px 20px; border-radius: 12px; transition: transform .2s, background .2s, border-color .2s, color .2s; display: inline-flex; gap: 8px; align-items: center; border: 1px solid transparent; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: #fff; }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink); }

/* ============================================================ home hero */
.hero { padding: clamp(48px, 8vw, 96px) 0 0; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.kicker { display: inline-flex; align-items: center; gap: 10px; font: 400 13px var(--mono); color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 6px 12px 6px 10px; border-radius: 999px; margin: 0 0 28px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
.hero-title { font: 400 clamp(42px, 5.4vw, 78px)/1 var(--serif); letter-spacing: -0.025em; margin: 0 0 28px; }
.hero-title em { font-style: italic; color: var(--accent); }
.hero-sub { font-size: clamp(16px, 1.5vw, 18.5px); color: var(--ink-2); max-width: 50ch; margin: 0 0 36px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-viz { position: relative; aspect-ratio: 1 / 1.05; border: 1px solid var(--line); border-radius: 20px; background:
  radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 22px 22px, var(--surface); overflow: hidden; cursor: crosshair; }
.hero-viz canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.viz-caption { position: absolute; left: 16px; bottom: 12px; font: 400 11.5px var(--mono); color: var(--muted); pointer-events: none; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: clamp(48px, 7vw, 80px) 0 0; border-top: 1px solid var(--line); }
.stats > div { padding: 24px 0 28px; }
.stats > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.stats dt { font: 400 11.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.stats dd { margin: 0; font: 400 44px/1 var(--serif); }
.stats dd.small { font: 500 12.5px/1.6 var(--mono); color: var(--ink-2); }

/* ============================================================ page heads & sections */
.page-head { padding: clamp(56px, 9vw, 112px) 0 clamp(40px, 6vw, 64px); border-bottom: 1px solid var(--line); }
.eyebrow { font: 400 13px var(--mono); color: var(--muted); margin: 0 0 18px; display: flex; gap: 12px; align-items: center; }
.eyebrow-num { color: var(--accent); font-weight: 500; }
.eyebrow-num::after { content: ''; display: inline-block; width: 28px; height: 1px; background: var(--line); vertical-align: middle; margin-left: 12px; }
.page-title { font: 400 clamp(48px, 8vw, 104px)/0.98 var(--serif); letter-spacing: -0.03em; margin: 0; }
.page-title em { font-style: italic; color: var(--accent); }
.page-intro { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); max-width: 56ch; margin: 24px 0 0; }

.section { padding: clamp(56px, 8vw, 96px) 0; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 28px; }
.sec-head h2 { font: 400 clamp(32px, 4vw, 44px)/1.05 var(--serif); letter-spacing: -0.015em; margin: 0; }
.sec-sub { color: var(--muted); margin: -16px 0 24px; }
.more { font: 500 13px var(--mono); text-decoration: none; color: var(--ink-2); }
.more:hover { color: var(--accent); }

/* split rows: label column + content, used on /about */
.split { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px 48px; }
.split-label { font: 500 12.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); padding-top: 8px; }
.prose-lite p { margin: 0 0 18px; font-size: 17.5px; max-width: 64ch; color: var(--ink-2); }
.prose-lite .lead { font: 400 clamp(26px, 3vw, 36px)/1.2 var(--serif); color: var(--ink); }
.prose-lite .muted { font-size: 15.5px; color: var(--muted); }
.prose-lite a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.tags { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font: 400 12.5px var(--mono); border: 1px solid var(--line); background: var(--surface); padding: 5px 11px; border-radius: 999px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px 32px; padding: 22px 0; border-top: 1px solid var(--line-soft); }
.tl-item:first-child { border-top: 0; padding-top: 0; }
.tl-date { font: 400 12.5px var(--mono); color: var(--muted); padding-top: 10px; }
.tl-org { font: 400 32px/1.1 var(--serif); letter-spacing: -0.01em; }
.tl-item.upcoming .tl-org { color: var(--accent); }
.tl-role { color: var(--ink-2); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pill { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; background: var(--line-soft); color: var(--muted); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.tl-bar { margin-top: 12px; height: 4px; background: var(--line-soft); border-radius: 4px; overflow: hidden; max-width: 420px; }
.tl-bar span { display: block; height: 100%; width: var(--w); background: var(--ink); border-radius: 4px; }

/* papers */
.papers { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.paper { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 12px 48px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.paper-meta { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.venue { font: 500 13px var(--mono); color: var(--accent); }
.status { font: 400 12px/1.5 var(--mono); color: var(--muted); }
.paper h3 { font: 400 clamp(23px, 2.4vw, 30px)/1.18 var(--serif); letter-spacing: -0.01em; margin: 0 0 8px; }
.paper h3 a { text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1.5px no-repeat; transition: background-size .35s; }
.paper h3 a:hover { background-size: 100% 1.5px; }
.paper p { margin: 0 0 14px; color: var(--muted); }
.paper-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.topic, .post-tag { font: 400 11.5px var(--mono); border: 1px solid var(--line); padding: 2px 9px; border-radius: 999px; color: var(--ink-2); }
.cites { font: 400 12.5px var(--mono); color: var(--ink-2); }
.cites b { font-weight: 500; color: var(--ink); }
.soon { font: 400 12.5px var(--mono); color: var(--muted); }
.arrow-link { font: 500 12.5px var(--mono); text-decoration: none; }
.arrow-link:hover { color: var(--accent); }

/* post lists */
.posts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.post a { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 4px 24px; align-items: start; padding: 20px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; transition: background .2s; }
.post a:hover { background: linear-gradient(90deg, var(--surface), transparent); }
.post-n { font: 400 12.5px var(--mono); color: var(--muted); padding-top: 3px; }
.post-main { display: flex; flex-direction: column; gap: 2px; }
.post-t { font: 500 17px var(--sans); transition: color .2s; }
.post-d { color: var(--muted); font-size: 14.5px; }
.post-meta { display: flex; gap: 12px; align-items: center; font: 400 12px var(--mono); color: var(--muted); white-space: nowrap; padding-top: 3px; }
.post a:hover .post-t { color: var(--accent); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 26px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-decoration: none; transition: transform .25s, border-color .25s, box-shadow .25s; }
.card:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: 0 18px 40px -24px rgba(0,0,0,.35); }
.lang { font: 400 11.5px var(--mono); color: var(--muted); }
.lang::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; }
.card h3 { font: 400 30px/1.05 var(--serif); margin: 4px 0 0; letter-spacing: -0.01em; }
.card p { margin: 0 0 8px; color: var(--muted); font-size: 14.5px; }
.card-cta { margin-top: auto; font: 500 12.5px var(--mono); color: var(--ink-2); }
.card:hover .card-cta { color: var(--accent); }

.channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.channel { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 24px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); text-decoration: none; transition: transform .25s, border-color .25s; }
.channel:hover { transform: translateY(-3px); border-color: var(--ink); }
.ch-label { font: 400 11.5px var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.ch-title { font: 400 26px/1.15 var(--serif); }
.ch-desc { color: var(--muted); font-size: 14.5px; }
.ch-arrow { position: absolute; top: 20px; right: 22px; color: var(--muted); transition: transform .25s, color .25s; }
.channel:hover .ch-arrow { transform: translate(3px, -3px); color: var(--accent); }

/* fun projects */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { font: 400 12.5px var(--mono); background: transparent; border: 1px solid var(--line); color: var(--ink-2); padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: all .2s; }
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fun { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fun-item { background: var(--bg); padding: 20px 22px; text-decoration: none; display: flex; flex-direction: column; gap: 6px; transition: background .2s; min-height: 124px; }
.fun-item:hover { background: var(--surface); }
.fun-item[hidden] { display: none; }
.fun-t { font: 500 15.5px var(--sans); display: flex; justify-content: space-between; gap: 8px; }
.go { color: var(--muted); transition: transform .2s, color .2s; }
.fun-item:hover .go { transform: translate(2px, -2px); color: var(--accent); }
.fun-d { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.fun-c { font: 400 11px var(--mono); color: var(--muted); margin-top: auto; text-transform: uppercase; letter-spacing: .06em; }
.award { font: 500 10.5px var(--mono); color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 5px; align-self: flex-start; text-transform: uppercase; letter-spacing: .04em; }
.portfolios { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.portfolios summary { list-style: none; cursor: pointer; padding: 18px 22px; display: flex; gap: 10px; align-items: center; font: 500 14px var(--mono); }
.portfolios summary::-webkit-details-marker { display: none; }
.portfolios summary::after { content: '+'; margin-left: auto; font-size: 20px; color: var(--muted); transition: transform .25s; }
.portfolios[open] summary::after { transform: rotate(45deg); }
.pf-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 22px 22px; }
.pf-grid a { font: 400 13px var(--mono); text-decoration: none; border: 1px solid var(--line); padding: 7px 12px; border-radius: 8px; background: var(--bg); transition: border-color .2s, color .2s; }
.pf-grid a:hover { border-color: var(--accent); color: var(--accent); }

/* contact */
.big-mail { display: inline-block; font: 400 clamp(32px, 7vw, 96px)/1.05 var(--serif); letter-spacing: -0.03em; text-decoration: none; margin-bottom: 56px; overflow-wrap: anywhere; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 3px no-repeat; transition: background-size .5s, color .3s; padding-bottom: 6px; }
.big-mail:hover { background-size: 100% 3px; color: var(--accent); }
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin-bottom: 48px; }
.contact-grid h3 { font: 500 12.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0 0 10px; }
.contact-grid p { margin: 0; color: var(--ink-2); font-size: 15px; }
.contact-grid a { text-decoration-color: var(--accent); text-underline-offset: 3px; }
.socials { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.socials a { font: 500 13.5px var(--mono); text-decoration: none; border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; display: block; transition: background .2s, color .2s, border-color .2s; }
.socials a:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.cta-band { background: var(--surface); }
.cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta-text { font: 400 clamp(28px, 3.6vw, 44px)/1.1 var(--serif); margin: 0; letter-spacing: -0.015em; }

.footer { border-top: 1px solid var(--line); padding: 28px 0 36px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; font: 400 12.5px var(--mono); color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--accent); }

/* ============================================================ article */
.read-progress { position: fixed; top: var(--nav-h); left: 0; right: 0; height: 2px; z-index: 49; }
.read-progress span { display: block; height: 100%; width: 0; background: var(--accent); }
.article { padding-top: clamp(40px, 6vw, 72px); padding-bottom: 64px; }
.article-head { max-width: 860px; margin-bottom: 48px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.back { font: 500 13px var(--mono); text-decoration: none; color: var(--muted); }
.back:hover { color: var(--accent); }
.article-meta { display: flex; gap: 14px; align-items: center; margin: 28px 0 16px; font: 400 12.5px var(--mono); color: var(--muted); }
.article-title { font: 400 clamp(40px, 6vw, 76px)/1.02 var(--serif); letter-spacing: -0.025em; margin: 0 0 16px; }
.article-desc { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); margin: 0; max-width: 60ch; }
.article-desc a { text-decoration-color: var(--accent); text-underline-offset: 3px; }
.article-grid { display: grid; grid-template-columns: 220px minmax(0, 740px); gap: 64px; }
.toc { position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; max-height: calc(100vh - var(--nav-h) - 64px); overflow: auto; }
.toc-h { font: 500 11.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 1px solid transparent; font-size: 13.5px; line-height: 1.4; color: var(--muted); text-decoration: none; transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); border-left-color: var(--accent); }

.prose { font-size: 17.5px; line-height: 1.75; color: var(--ink-2); min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1em; }
.prose h2, .prose h3 { font: 400 clamp(28px, 3vw, 36px)/1.15 var(--serif); color: var(--ink); letter-spacing: -0.01em; margin: 2.2em 0 .6em; }
.prose h4 { font: 600 18px/1.35 var(--sans); color: var(--ink); margin: 1.8em 0 .5em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.prose a:hover { color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--muted); }
.prose figure { margin: 1.8em 0; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: #fff; margin: 0 auto; }
.prose p > img { margin: 1.4em auto; }
.prose pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; overflow-x: auto; margin: 1.5em 0; font-size: 14px; line-height: 1.6; }
.prose pre code { background: none; padding: 0; font-size: inherit; border-radius: 0; }
.prose .equation { overflow-x: auto; overflow-y: hidden; margin: 1.2em 0; padding: 4px 0; color: var(--ink); }
.prose mjx-container { color: var(--ink); }
.prose .table-wrap { overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--line); border-radius: 10px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.prose td, .prose th { padding: 9px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.prose tr:first-child td { font: 500 12.5px var(--mono); color: var(--ink); background: var(--surface); }
.prose tr:last-child td { border-bottom: 0; }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--ink-2); font-style: italic; }
.prose .blog-spacer { height: 1em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose .callout { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin: 1.5em 0; font-size: 15.5px; }
.prose .callout-body > :last-child { margin-bottom: 0; }
.prose details.toggle { margin: 1em 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; background: var(--surface); }
.prose details.toggle summary { cursor: pointer; font-weight: 500; }
.notion-highlight-blue { color: var(--hl-blue); } .notion-highlight-purple { color: var(--hl-purple); }
.notion-highlight-red { color: var(--hl-red); } .notion-highlight-orange { color: var(--hl-orange); }
.notion-highlight-yellow { color: var(--hl-yellow); } .notion-highlight-green { color: var(--hl-green); }
.notion-highlight-teal { color: var(--hl-teal); } .notion-highlight-pink { color: var(--hl-pink); }
.notion-highlight-brown { color: var(--hl-brown); } .notion-highlight-gray { color: var(--hl-gray); }
[class*="_background"] { padding: 1px 4px; border-radius: 4px; color: var(--ink); }
.notion-highlight-blue_background { background: var(--hlb-blue); } .notion-highlight-purple_background { background: var(--hlb-purple); }
.notion-highlight-red_background { background: var(--hlb-red); } .notion-highlight-yellow_background { background: var(--hlb-yellow); }
.notion-highlight-green_background { background: var(--hlb-green); } .notion-highlight-pink_background { background: var(--hlb-pink); }
.notion-highlight-gray_background { background: var(--hlb-gray); } .notion-highlight-brown_background { background: var(--hlb-brown); }

/* highlight.js tokens */
.hljs-keyword, .hljs-built_in, .hljs-type { color: var(--hl-purple); }
.hljs-string, .hljs-attr { color: var(--hl-green); }
.hljs-number, .hljs-literal { color: var(--hl-orange); }
.hljs-comment { color: var(--muted); font-style: italic; }
.hljs-title, .hljs-function .hljs-title { color: var(--hl-blue); }
.hljs-meta, .hljs-params { color: var(--ink-2); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--line); }
.pn { display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; background: var(--surface); transition: border-color .2s; }
.pn:hover { border-color: var(--ink); }
.pn.next { text-align: right; }
.pn-l { font: 500 12px var(--mono); color: var(--accent); }
.pn-t { font: 400 22px/1.2 var(--serif); }

/* slideshow */
.deck { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); padding: clamp(16px, 3vw, 28px); }
.deck-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.deck-group { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0 0 6px; }
.deck-title { font: 400 clamp(26px, 3.4vw, 40px)/1.1 var(--serif); margin: 0; }
.deck-count { font: 500 13px var(--mono); color: var(--muted); white-space: nowrap; }
.deck-stage { border-radius: 12px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); aspect-ratio: 16 / 9; display: grid; place-items: center; }
.deck-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.deck-controls { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.deck-progress { flex: 1; height: 4px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.deck-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.deck-hint { font: 400 12.5px var(--mono); color: var(--muted); margin: 14px 0 0; }
.sl-index { columns: 3 260px; column-gap: 40px; margin-top: 56px; }
.sl-group { break-inside: avoid; margin-bottom: 28px; }
.sl-group-h { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0 0 8px; }
.sl-group ol { list-style: none; margin: 0; padding: 0; }
.sl-group button { display: flex; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 6px 0; color: var(--ink-2); font: 400 14.5px var(--sans); cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.sl-group button span { font: 400 12px var(--mono); color: var(--muted); padding-top: 2px; }
.sl-group button:hover, .sl-group button[aria-current="true"] { color: var(--accent); }

/* ============================================================ responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-viz { aspect-ratio: 16 / 10; max-height: 360px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .split { grid-template-columns: 1fr; gap: 20px; }
  .paper { grid-template-columns: 1fr; gap: 8px; }
  .paper-meta { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; padding: 0; }
  .article-grid { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .menu-btn { display: grid; }
  .nav-links { position: fixed; top: var(--nav-h); left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px; background: var(--bg); border-bottom: 1px solid var(--line); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all .2s; }
  .nav-links.open { transform: none; opacity: 1; visibility: visible; }
  .nav-links a { padding: 12px 8px; font-size: 15px; }
  .nav-actions { margin-left: auto; }
}
@media (max-width: 620px) {
  .cards { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 1fr; gap: 2px; }
  .tl-date { padding-top: 0; }
  .post a { grid-template-columns: 32px minmax(0, 1fr); }
  .post-meta { grid-column: 2; }
  .post-nav { grid-template-columns: 1fr; }
  .stats dd { font-size: 36px; }
  .stats > div + div { padding-left: 16px; }
  .stats > div:nth-child(3) { padding-left: 0; }
  .prose { font-size: 16.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
