
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/geist-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/geist-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/geist-mono-latin.woff2') format('woff2'); }

@view-transition { navigation: auto; }

:root {
    --sans: 'Geist', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --ease: cubic-bezier(0.23, 1, 0.32, 1);
    --spring-flip: cubic-bezier(0.34, 1.32, 0.5, 1);
    --col: 620px;
    --wide: 760px;
    --bg:       light-dark(oklch(0.984 0.0015 265), oklch(0.166 0.004 265));
    --raised:   light-dark(oklch(1 0 0),            oklch(0.2 0.0045 265));
    --sel:      light-dark(oklch(0.956 0.003 265),  oklch(0.245 0.0055 265));
    --line:     light-dark(oklch(0.3 0.012 265 / 0.1), oklch(0.95 0.01 265 / 0.075));
    --line-2:   light-dark(oklch(0.3 0.012 265 / 0.17), oklch(0.95 0.01 265 / 0.13));
    --text:     light-dark(oklch(0.205 0.006 265),  oklch(0.955 0.002 265));
    --text-2:   light-dark(oklch(0.425 0.009 265),  oklch(0.77 0.006 265));
    --text-3:   light-dark(oklch(0.50 0.009 265),   oklch(0.645 0.007 265));
    --accent:   light-dark(#1f3dff, #8c9bff);
    --on-accent: light-dark(oklch(0.99 0 0), oklch(0.166 0.004 265));
    --track:    light-dark(oklch(0.925 0.004 265), oklch(0.14 0.004 265));
    --cap:      light-dark(oklch(1 0 0), oklch(0.27 0.006 265));
    --cap-2:    light-dark(oklch(0.965 0.003 265), oklch(0.235 0.006 265));
    --cap-edge: light-dark(oklch(0.3 0.012 265 / 0.16), oklch(0 0 0 / 0.6));
    --cap-hi:   light-dark(oklch(1 0 0), oklch(1 0 0 / 0.07));
    --shadow:   0 1px 2px oklch(0.2 0.02 265 / 0.12), 0 12px 28px -12px oklch(0.2 0.02 265 / 0.35);
    color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-reduced-motion: no-preference) { :root { scroll-behavior: smooth; } }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; overflow-x: clip; }
body {
    font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "ss01", "cv11";
}
a { color: inherit; }
img { max-width: 100%; }
::selection { background: color-mix(in oklch, var(--accent) 30%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.nw { white-space: nowrap; }
.ic { width: 14px; height: 14px; flex: none; fill: currentColor; }

.page {
    --side: max(20px, env(safe-area-inset-left), env(safe-area-inset-right));
    width: 100%; max-width: calc(var(--col) + 2 * var(--side)); padding-inline: var(--side); margin-inline: auto;
}
.bar { display: flex; align-items: center; gap: 10px; padding-top: 28px; font-size: 0.875rem; color: var(--text-3); }
.bar a { text-decoration: none; }
.home { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 560; }
.home:hover .name, .crumb a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-2); }
.crumb a { color: var(--text-3); }
.sep { color: var(--line-2); }
.th-mark { width: 18px; height: 18px; flex: none; }
.th-mark .th-bg { fill: var(--accent); }
.th-mark .th-fg { fill: var(--bg); }

.sc {
    --n: 2; --i: 0; position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: 28px; padding: 2px; border-radius: 9px;
    background: var(--track); box-shadow: inset 0 0 0 0.5px var(--line-2), inset 0 1px 2px oklch(0.2 0.02 265 / 0.06);
}
.sc input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.sc label { position: relative; z-index: 1; display: grid; place-items: center; padding: 0 10px; border-radius: 7px; font-size: 0.75rem; font-weight: 520; line-height: 1; color: var(--text-3); white-space: nowrap; cursor: pointer; transition: color 160ms var(--ease); }
.sc input:checked + label { color: var(--text); }
.sc input:focus-visible + label { outline: 2px solid var(--accent); }
.sc-thumb {
    position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--n)); border-radius: 7px; pointer-events: none;
    background: linear-gradient(var(--cap), var(--cap-2));
    box-shadow: 0 0 0 0.5px var(--cap-edge), 0 1px 2px oklch(0.2 0.02 265 / 0.12), inset 0 1px 0 var(--cap-hi);
    translate: calc(var(--i) * 100%) 0; transition: translate 460ms var(--spring-flip);
}
.sc:has(> input:nth-of-type(2):checked) { --i: 1; }

.switches { margin-left: auto; display: flex; gap: 8px; }
@media (max-width: 560px) {
    .bar { flex-wrap: wrap; row-gap: 16px; }
    .switches { order: -1; width: 100%; justify-content: flex-end; }
}

html.vt-theme::view-transition-old(root) { animation: none; }
html.vt-theme::view-transition-new(root) { animation: vt-in 0.8s cubic-bezier(0.4, 0, 0.2, 1) both; }
@keyframes vt-in { from { opacity: 0; } }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: start; padding-top: 64px; }
.hero.solo { grid-template-columns: minmax(0, 1fr); }
.meta { font-size: 0.875rem; color: var(--text-3); }
h1 { margin-top: 10px; font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.25rem); line-height: 1.12; font-weight: 640; letter-spacing: -0.024em; text-wrap: balance; }
h1.long { font-size: clamp(1.625rem, 1.25rem + 1.2vw, 1.875rem); }
.sub { margin-top: 12px; font-size: 1.0625rem; line-height: 1.5; color: var(--text-2); text-wrap: pretty; max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 24px; }
.btn {
    display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 9px; font: inherit; font-size: 0.875rem; font-weight: 560;
    text-decoration: none; color: var(--on-accent); background: var(--accent); border: 0; cursor: pointer; transition: filter 0.15s ease, scale 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { scale: 0.98; }
.out { display: inline-flex; align-items: center; gap: 5px; font-size: 0.875rem; font-weight: 520; color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: text-decoration-color 150ms var(--ease); }
.out:hover { text-decoration-color: currentColor; }
.out .ic { width: 12px; height: 12px; color: var(--text-3); }
.thumb { display: block; width: 116px; height: auto; border-radius: 4px; box-shadow: var(--shadow); transition: translate 0.25s var(--ease); }
a:hover > .thumb { translate: 0 -2px; }
:root:not([data-theme="light"]) .thumb.paper-page { filter: brightness(0.86); }
.tile { width: 128px; height: 128px; border-radius: 12px; box-shadow: var(--shadow); }
@media (max-width: 560px) {
    .hero { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 44px; }
    .hero > :last-child:not(:first-child) { order: -1; margin-bottom: 20px; }
    .thumb { width: 84px; height: auto; }
    .tile { width: 88px; height: 88px; border-radius: 10px; }
}
.sec { margin-top: 56px; scroll-margin-top: 24px; }
.sec-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 0.84375rem; font-weight: 500; line-height: 1.4; color: var(--text-3); }
.sec-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.prose p + p { margin-top: 14px; }
.prose p { text-wrap: pretty; }
.small { margin-top: 12px; font-size: 0.875rem; color: var(--text-3); text-wrap: pretty; }
.small a { color: var(--text-2); }
.findings { display: grid; gap: 18px; }
.findings p { text-wrap: pretty; }
.findings b { font-weight: 600; }
details.more { margin-top: 16px; }
details.more summary, details.toc summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; font-weight: 520; color: var(--text-2); }
details.more summary::-webkit-details-marker, details.toc summary::-webkit-details-marker { display: none; }
details.more summary .ic, details.toc summary .ic { width: 12px; height: 12px; color: var(--text-3); transition: rotate 0.25s var(--ease); }
details[open] > summary .ic { rotate: 180deg; }
details.more[open] > .prose { margin-top: 14px; }
figure { margin-top: 28px; }
figure img { display: block; width: 100%; height: auto; }
:root[data-theme="light"] .fig-dark, :root:not([data-theme="light"]) .fig-light { display: none; }
figcaption { margin-top: 12px; font-size: 0.8125rem; line-height: 1.5; color: var(--text-3); text-wrap: pretty; }
figcaption b { font-weight: 600; color: var(--text-2); }
.works { margin-top: 40px; display: grid; gap: 4px; margin-inline: -12px; }
.work { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 18px; align-items: start; padding: 14px 12px; border-radius: 12px; text-decoration: none; transition: background-color 0.18s var(--ease); }
.work:hover { background: var(--sel); }
.work .vis { width: 56px; display: grid; place-items: center; }
.work .vis img { width: 48px; height: auto; border-radius: 3px; box-shadow: var(--shadow); }
.work .vis img.tile-s { width: 48px; height: 48px; border-radius: 8px; }
.work .vis .px { width: 40px; height: 40px; color: var(--accent); fill: currentColor; }
.work .t { display: block; font-weight: 600; letter-spacing: -0.008em; text-wrap: pretty; }
.work .m { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--text-3); }
.work .d { display: block; margin-top: 6px; font-size: 0.9375rem; color: var(--text-2); text-wrap: pretty; }
.toc ol { list-style: none; display: grid; gap: 1px; }
.toc ol ol { display: none; }
.toc a { display: flex; gap: 10px; padding: 3px 0; font-size: 0.875rem; line-height: 1.4; color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--text); }
.toc .n { min-width: 22px; color: var(--text-3); font-variant-numeric: tabular-nums; }
details.toc[open] > ol { margin-top: 12px; }
.rail { display: none; }
@media (min-width: 1280px) {
    details.toc { display: none; }
    .rail {
        display: block; position: fixed; top: 96px; width: 200px; left: calc(50% - var(--wide) / 2 - 232px); max-height: calc(100dvh - 140px); overflow-y: auto;
        opacity: 0; translate: -6px 0; pointer-events: none; transition: opacity 0.3s var(--ease), translate 0.3s var(--ease);
    }
    .rail.on { opacity: 1; translate: 0 0; pointer-events: auto; }
    .rail a { font-size: 0.8125rem; color: var(--text-3); }
    .rail a[aria-current="true"] { color: var(--text); }
    .rail a[aria-current="true"] .n { color: var(--accent); }
}

.paper { margin-top: 8px; font-size: 1.0625rem; line-height: 1.7; }
.paper section { scroll-margin-top: 24px; }
.paper h2 { margin-top: 64px; font-size: 1.375rem; line-height: 1.25; font-weight: 640; letter-spacing: -0.016em; text-wrap: balance; }
.paper h3 { margin-top: 40px; font-size: 1.0625rem; line-height: 1.35; font-weight: 620; letter-spacing: -0.008em; text-wrap: balance; }
.paper h4, .paper h5, .paper h6 { margin-top: 26px; font-size: 1rem; font-weight: 600; }
.paper .header-section-number { margin-right: 12px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.paper p, .paper ul, .paper ol, .paper pre, .paper blockquote { margin-top: 16px; }
.paper p { text-wrap: pretty; }
.paper ul, .paper ol { padding-left: 22px; }
.paper li + li { margin-top: 6px; }
.paper li::marker { color: var(--text-3); }
.paper a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in oklch, var(--accent) 35%, transparent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.paper a:hover { text-decoration-color: currentColor; }
.paper strong { font-weight: 620; }
.paper code { font-family: var(--mono); font-size: 0.82em; background: var(--sel); padding: 1px 5px; border-radius: 4px; }
.paper pre { font-family: var(--mono); font-size: 0.8125rem; line-height: 1.6; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; }
.paper pre code { background: none; padding: 0; font-size: inherit; }
.paper blockquote { border-left: 2px solid var(--line-2); padding-left: 16px; color: var(--text-2); }
.paper .citation a { color: var(--text-3); }
.paper .citation a:hover { color: var(--accent); }
.paper .ed { display: block; margin-top: 10px; font-size: 0.875rem; color: var(--text-3); }
.table-wrap { margin-top: 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); }
.paper table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; line-height: 1.5; }
.paper caption { caption-side: top; text-align: left; padding: 12px 14px; font-size: 0.8125rem; color: var(--text-3); border-bottom: 1px solid var(--line); text-wrap: pretty; }
.paper caption b { font-weight: 600; color: var(--text-2); }
.paper th, .paper td { text-align: left; vertical-align: top; padding: 9px 14px; }
.paper th { font-weight: 600; color: var(--text); border-bottom: 1px solid var(--line-2); }
.paper tbody tr + tr td { border-top: 1px solid var(--line); }
@media (min-width: 900px) {
    .paper .table-wrap, .paper figure, figure.wide { margin-inline: calc((var(--col) - var(--wide)) / 2); }
}
.paper #refs, .paper .references { font-size: 0.9375rem; line-height: 1.6; color: var(--text-2); }
.paper .csl-entry { margin-top: 10px; padding-left: 22px; text-indent: -22px; text-wrap: pretty; }
.paper .footnotes { margin-top: 48px; font-size: 0.875rem; color: var(--text-2); }
.paper .footnotes hr { border: 0; border-top: 1px solid var(--line); margin-bottom: 12px; }
.cite-text { font-size: 0.9375rem; color: var(--text-2); text-wrap: pretty; }
.bib { position: relative; margin-top: 14px; }
.bib pre { font-family: var(--mono); font-size: 0.75rem; line-height: 1.6; color: var(--text-2); background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow-x: auto; white-space: pre; }
.copy { position: absolute; top: 8px; right: 8px; height: 26px; padding: 0 10px; border-radius: 7px; border: 0; font: inherit; font-size: 0.75rem; font-weight: 520; color: var(--text-2); background: var(--sel); cursor: pointer; transition: color 0.15s ease; }
.copy:hover { color: var(--text); }

footer { margin-top: 88px; padding: 20px 0 40px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 14px; font-size: 0.8125rem; color: var(--text-3); }
footer a { color: var(--text-2); text-decoration: none; }
footer a:hover { color: var(--text); }
footer .th-mark { width: 22px; height: 22px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0s !important; }
    @view-transition { navigation: none; }
}
.note-body > section:first-child > h2:first-child { margin-top: 0; }
