/* ============================================================
   Aman Sharma, portfolio
   Type: Cabinet Grotesk (display), Satoshi (text), JetBrains Mono (data).
   Shape rule: interactive controls are full pills, surfaces are 14px,
   small tiles are 10px. One accent: forest green.
   ============================================================ */

@font-face { font-family: "Cabinet Grotesk"; src: url("assets/fonts/cabinet-grotesk-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cabinet Grotesk"; src: url("assets/fonts/cabinet-grotesk-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Cabinet Grotesk"; src: url("assets/fonts/cabinet-grotesk-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("assets/fonts/satoshi-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("assets/fonts/satoshi-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("assets/fonts/satoshi-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("assets/fonts/satoshi-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("assets/fonts/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("assets/fonts/jetbrains-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light;
  --page: #f4f6f3;
  --panel: #e9ede7;
  --card: #fbfcfa;
  --ink: #0e1712;
  --ink-2: #0e1712bf;
  --ink-3: #0e17128f;
  --ink-4: #0e171261;
  --line: #d6ddd4;
  --line-soft: #e2e7e0;
  --accent: #1f5c3d;
  --accent-ink: #f4f6f3;
  --accent-soft: #1f5c3d12;
  --accent-line: #1f5c3d59;
  --pop: #7a5fe6;
  --pop-soft: #7a5fe614;
  --pop-line: #7a5fe666;
  --pop-hl: #d9d0fd;
  --shadow: 0 1px 0 #0e171208, 0 12px 30px -22px #0e171240;
  --logo-filter: grayscale(1) contrast(1.05);
  --logo-blend: multiply;

  --display: "Cabinet Grotesk", ui-sans-serif, system-ui, sans-serif;
  --text: "Satoshi", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --spring: linear(0, .0791, .2369, .4041, .5522, .6723, .7649, .8339, .884, .9198, .945, .9625, .9746, .9829, .9885, .9923, .9949, .9966, .9977, .9985, .999, 1, 1);

  --rail-w: 200px;
  --gap: 96px;
  --col-w: 720px;
  --space: 112px;

  --z-rail: 10;
  --z-skip: 20;
  --z-grain: 60;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d120f;
    --panel: #111814;
    --card: #141c17;
    --ink: #e7ece6;
    --ink-2: #e7ece6c2;
    --ink-3: #e7ece68c;
    --ink-4: #e7ece65c;
    --line: #253029;
    --line-soft: #1c251f;
    --accent: #7fc59c;
    --accent-ink: #0d120f;
    --accent-soft: #7fc59c14;
    --accent-line: #7fc59c55;
    --pop: #b9a8ff;
    --pop-soft: #b9a8ff17;
    --pop-line: #b9a8ff66;
    --pop-hl: #4b3d99;
    --shadow: 0 1px 0 #00000040, 0 14px 34px -24px #000000a0;
    --logo-filter: grayscale(1) invert(1) contrast(.9);
    --logo-blend: screen;
  }
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 32px; scrollbar-gutter: stable; }
body {
  background: var(--page); color: var(--ink);
  font-family: var(--text); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
ul, ol { list-style: none; }
::selection { background: var(--pop); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* fine grain on a fixed layer, never on scrolling content */
body::after {
  content: ""; position: fixed; inset: 0; z-index: var(--z-grain); pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: fixed; top: 12px; left: 12px; z-index: var(--z-skip); padding: 10px 16px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 500; font-size: 14px;
  translate: 0 -200%; transition: translate .2s var(--ease-out);
}
.skip:focus { translate: 0; }

/* Phosphor arrow glyphs as masks */
.ext, .arr {
  display: inline-block; flex: 0 0 auto; width: .8em; height: .8em; background: currentColor; vertical-align: -.05em;
  -webkit-mask: url("assets/icons/arrow-up-right.svg") center / contain no-repeat; mask: url("assets/icons/arrow-up-right.svg") center / contain no-repeat;
  transition: translate .25s var(--ease-out), opacity .25s var(--ease-out);
}
.ext { opacity: .5; }
.arr { -webkit-mask-image: url("assets/icons/arrow-right.svg"); mask-image: url("assets/icons/arrow-right.svg"); }
.arr.up { -webkit-mask-image: url("assets/icons/arrow-up-right.svg"); mask-image: url("assets/icons/arrow-up-right.svg"); }
a:focus-visible .ext { translate: 2px -2px; opacity: 1; }

/* ============ SHELL ============ */
.shell {
  display: grid; grid-template-columns: var(--rail-w) var(--col-w); column-gap: var(--gap);
  width: max-content; max-width: 100%; margin-inline: auto; position: relative; isolation: isolate;
}
.shell::before {
  content: ""; position: fixed; top: 0; bottom: 0; left: 0; z-index: -1; pointer-events: none;
  width: calc(50% - (var(--rail-w) + var(--gap) + var(--col-w)) / 2 + var(--rail-w) + var(--gap) / 2);
  background: var(--panel);
}

/* ============ RAIL ============ */
.rail {
  position: sticky; top: 0; align-self: start; height: 100dvh; overflow-y: auto; scrollbar-width: none;
  padding: 56px 0 40px 20px; margin-left: -20px; z-index: var(--z-rail);
  display: flex; flex-direction: column;
}
.rail::-webkit-scrollbar { display: none; }
.logo { display: inline-flex; color: var(--ink); width: fit-content; }
.logo-word { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -.035em; line-height: 1; white-space: nowrap; }
.menu { display: none; }

.nav { display: flex; flex-direction: column; position: relative; }
.nav-doors { margin-top: 44px; gap: 9px; font-size: 15px; line-height: 21px; }
.nav-doors a { color: var(--ink-3); font-weight: 500; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 6px; width: fit-content; transition: color .2s var(--ease-out); }

.nav-doors a[aria-current] { color: var(--ink); }
.nav-gap { height: 10px; }
.nav-mark {
  position: absolute; top: 0; left: -16px; width: 6px; height: 6px; border-radius: 50%; background: var(--pop);
  transform: translateY(var(--y, 7.5px)); transition: transform .6s var(--spring);
}

.nav-here { --y: -99; margin-top: auto; padding-top: 32px; }
.nav-here::before {
  content: "In this section"; display: block; margin-bottom: 10px;
  font: 500 11px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-4);
}
.toc-title { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -.01em; line-height: 1.2; margin-bottom: 10px; }
.toc-list { position: relative; display: flex; flex-direction: column; }
.toc-list a { display: flex; align-items: flex-start; gap: 10px; padding: 4px 0; font-size: 14px; color: var(--ink-3); transition: color .2s var(--ease-out); }
.toc-list a::before, .nav-ruler i {
  --l: max(0, calc(1 - abs(var(--t, 0) - var(--y)) / 4));
  content: ""; display: block; width: 22px; height: 2px; border-radius: 2px; transform-origin: 0 50%;
  transition: scale .3s var(--ease-out), background-color .2s var(--ease-out);
}
.toc-list a::before { flex: 0 0 auto; margin-top: 10px; background: var(--ink-4); scale: calc(.5 + .5 * var(--l)) 1; }

.toc-list a[aria-current] { color: var(--ink); font-weight: 500; }
.toc-list a[aria-current]::before, .toc-list a:has(~ a[aria-current])::before { background: var(--accent); }
.nav-ruler { position: absolute; inset: 0; pointer-events: none; }
.nav-ruler i { position: absolute; left: 0; height: 1px; background: var(--ink-4); scale: calc(.25 + .5 * var(--l)) 1; opacity: .7; }
.toc-title, .toc-list { transition: opacity .17s var(--ease-in-out), translate .17s var(--ease-in-out); }
.nav-here.is-out .toc-title, .nav-here.is-out .toc-list { opacity: 0; translate: 0 -5px; }

/* ============ MAIN ============ */
main { padding: 56px 0 48px; min-width: 0; outline: none; }

/* hero */
.note {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 3px 3px 3px 16px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2);
}
.note-short { display: none; }
.note-cta { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-weight: 500; }


.statement {
  margin-top: 28px; max-width: 15em;
  font-family: var(--display); font-weight: 700; font-size: clamp(38px, 4.4vw, 56px); line-height: 1.04; letter-spacing: -.03em;
  text-wrap: balance;
}
.dek { margin-top: 20px; max-width: 34em; font-size: 19px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }

.ways { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 46px; border-radius: 999px;
  font-size: 15px; font-weight: 500; white-space: nowrap; transition: transform .12s var(--ease-out), background-color .2s, border-color .2s, color .2s;
}
.btn:active { transform: scale(.98); }
.btn-primary { min-width: 196px; padding: 3px 18px 3px 3px; gap: 14px; background: var(--accent); color: var(--accent-ink); }
.btn-primary::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--card);
  clip-path: inset(3px calc(100% - 43px) 3px 3px round 999px); transition: clip-path .4s var(--ease-out);
}
.btn-rail { position: absolute; top: 3px; left: 3px; width: calc(100% - 46px); height: 40px; pointer-events: none; transition: translate .4s var(--ease-out); }
.btn-tile { position: relative; z-index: 1; width: 40px; height: 40px; display: grid; place-items: center; color: var(--accent); transition: rotate .4s var(--ease-out); }
.btn-tile svg { width: 20px; height: 20px; fill: currentColor; }
.btn-slot { width: 40px; height: 40px; flex: 0 0 auto; }
.btn-label { position: relative; z-index: 1; flex: 1; text-align: center; transition: color .25s, translate .4s var(--ease-out); }
.btn-primary:focus-visible::before { clip-path: inset(3px round 999px); }
.btn-primary:focus-visible .btn-rail { translate: 100%; }
.btn-primary:focus-visible .btn-tile { rotate: 360deg; }
.btn-primary:focus-visible .btn-label { color: var(--accent); translate: -43px; }
.btn-ghost { padding: 0 20px; border: 1px solid var(--line); color: var(--ink); background: transparent; }




.figure { margin-top: 56px; }
.field { position: relative; aspect-ratio: 2.2 / 1; overflow: hidden; border-radius: 14px; background: #1f5c3d; box-shadow: var(--shadow); cursor: crosshair; }
.field canvas, .cta-art { position: absolute; inset: 0; width: 100%; height: 100%; }

/* memo */
.memo { display: flex; flex-direction: column; gap: 22px; margin-top: 72px; }
.memo p, .body { max-width: 62ch; font-size: 17px; line-height: 1.7; text-wrap: pretty; }
.memo strong, .body strong { font-weight: 700; }
.memo .pull { font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1.2; letter-spacing: -.02em; max-width: 22em; }
.pull + p { margin-top: -6px; }
.hl {
  background: linear-gradient(transparent 50%, var(--pop-hl) 50%, var(--pop-hl) 94%, transparent 94%) no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.key {
  display: inline; text-align: left; font-weight: 500; color: var(--accent);
  text-decoration: underline; text-decoration-color: var(--accent-line); text-decoration-thickness: 1px; text-underline-offset: 4px;
  transition: text-decoration-color .2s;
}
.key[aria-expanded="true"] { text-decoration-color: var(--accent); }
.key .fn {
  position: relative; display: inline-block; width: 13px; height: 13px; margin-left: 4px; translate: 0 1px; border-radius: 50%;
  border: 1px solid var(--accent-line); transition: background-color .2s, border-color .2s;
}
.key .fn::before, .key .fn::after { content: ""; position: absolute; top: 5px; left: 3px; width: 5px; height: 1px; background: var(--accent); transition: rotate .2s, background-color .2s; }
.key .fn::after { rotate: 90deg; }
.key[aria-expanded="true"] .fn { background: var(--accent); border-color: var(--accent); }
.key[aria-expanded="true"] .fn::before, .key[aria-expanded="true"] .fn::after { background: var(--accent-ink); }
.key[aria-expanded="true"] .fn::after { rotate: 0deg; }
.footnote {
  max-width: 62ch; margin-top: -8px; padding: 14px 16px; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: 15px; line-height: 1.55; color: var(--ink-2);
}
.fn-label { display: block; margin-bottom: 4px; font-weight: 700; color: var(--ink); }
.fn-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-weight: 500; color: var(--accent); }


/* ============ SECTIONS ============ */
.section { margin-top: var(--space); padding-top: 40px; border-top: 1px solid var(--line); }
.section-head { font-family: var(--display); font-weight: 700; font-size: 38px; line-height: 1.08; letter-spacing: -.025em; text-wrap: balance; max-width: 18em; }
.section-head + .body { margin-top: 18px; }
.body + .body { margin-top: 14px; }
.sub-head { margin-top: 64px; font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -.02em; }
.u-link { color: var(--accent); font-weight: 500; text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 4px; }

.u-link .ext { opacity: .7; }

/* deal diagram */
.loop { margin-top: 40px; }
.loop-stage { position: relative; aspect-ratio: 640 / 300; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.loop-svg { width: 100%; height: 100%; overflow: visible; }
.loop-svg text { font-family: var(--mono); font-weight: 500; letter-spacing: .02em; }
.t-label { font-size: 8.5px; fill: var(--ink-3); }
.t-node { font-size: 8px; fill: var(--ink-2); }
.t-accent { font-size: 8.5px; fill: var(--accent); }
.frame { fill: none; stroke: var(--line); }
.frame.inner { stroke: var(--accent-line); fill: var(--accent-soft); }
.wire { fill: none; stroke: var(--line); stroke-width: 1.2; }
.wire.ret { stroke-dasharray: 3 4; stroke: var(--accent-line); }
.comet { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.comet.is-faint { stroke: var(--accent-line); }
.node rect { fill: var(--card); stroke: var(--line); transition: fill .3s, stroke .3s; }
.node .ico { fill: var(--ink-2); transition: fill .3s; }
.node text { transition: fill .3s; }
.node.is-hot rect { fill: var(--accent-soft); stroke: var(--accent); }
.node.is-hot .ico, .node.is-hot text { fill: var(--accent); }
.node.is-warm rect { stroke: var(--accent-line); }
.reg-box { fill: var(--accent); }
.reg-ico { fill: var(--accent-ink); }
.verb { fill: var(--accent); transition: opacity .2s; }
.loop figcaption { margin-top: 14px; max-width: 62ch; font-size: 14px; line-height: 1.6; color: var(--ink-3); }

.entries { margin-top: 56px; display: flex; flex-direction: column; gap: 32px; }
.entry { display: grid; grid-template-columns: 76px 1fr; gap: 24px; align-items: start; transition: opacity .5s var(--ease-out); }
.entry-art { width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--accent); }
.entry-art canvas { width: 100%; height: 100%; }
.entry h3 { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.015em; line-height: 1.25; }
.entry p { margin-top: 6px; font-size: 16px; line-height: 1.65; color: var(--ink-2); max-width: 58ch; }

.facts { margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 40px; }
.facts dt { font-size: 13px; color: var(--ink-3); }
.facts dd { margin-top: 2px; font-size: 16px; font-weight: 500; }
.lanes { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.lanes li { padding: 7px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 500; }

.oss {
  margin-top: 40px; display: grid; grid-template-columns: 44px 1fr auto; gap: 18px; align-items: start; padding: 20px;
  border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transition: border-color .25s;
}

.oss-ico { width: 44px; height: 44px; border-radius: 10px; background: var(--ink); -webkit-mask: var(--i) center / 28px no-repeat; mask: var(--i) center / 28px no-repeat; }
.oss-body { display: flex; flex-direction: column; gap: 4px; }
.oss-title { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.015em; }
.oss-text { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.more { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px 28px; font-weight: 500; }
.more a { display: inline-flex; align-items: center; gap: 6px; }


/* record */
.lit { font-family: var(--display); font-weight: 700; font-size: 40px; line-height: 1.1; letter-spacing: -.025em; max-width: 17em; text-wrap: balance; }

.stats { margin-top: 48px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.stat { padding: 20px 20px 0 0; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat-n { font-family: var(--display); font-weight: 800; font-size: 48px; line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stat h3 { margin-top: 12px; font-size: 15px; font-weight: 700; }
.stat-m { margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--ink-3); }

.xp { margin-top: 56px; padding: 20px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.xp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.xp-head h3 { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.015em; }
.xp-tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 999px; background: var(--panel); }
.xp-tabs button { padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--ink-3); transition: color .2s, background-color .2s; }

.xp-tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px #0e17121f; }
.xp-panel { margin-top: 22px; min-height: 140px; display: grid; grid-template-columns: 52px 1fr; column-gap: 18px; }
.xp-panel > :not(.xp-mark) { grid-column: 2; }
.xp-mark { grid-row: 1 / span 6; position: relative; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--page); }
.xp-mark img { width: 36px; height: 36px; object-fit: contain; filter: var(--logo-filter); mix-blend-mode: var(--logo-blend); }
.xp-mark.is-pair img { position: absolute; width: 26px; height: 26px; }
.xp-mark.is-pair img:first-child { top: 5px; left: 5px; }
.xp-mark.is-pair img:last-child { bottom: 5px; right: 5px; }
.xp-when { font: 500 13px/1 var(--mono); color: var(--accent); }
.xp-title { margin-top: 8px; font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.2; letter-spacing: -.02em; }
.xp-org { margin-top: 2px; font-size: 14px; color: var(--ink-3); }
.xp-text { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--ink-2); max-width: 58ch; }
.xp-text + .xp-text { margin-top: 4px; }
.xp-chart { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.xp-chart svg { width: 100%; height: auto; overflow: visible; }
.xp-chart text { font: 500 9px var(--mono); fill: var(--ink-4); }
.xp-chart .grid { stroke: var(--line-soft); }
.xp-chart .seg { fill: var(--line); transition: fill .3s; cursor: pointer; }
.xp-chart .seg.is-on { fill: var(--accent); }
.xp-chart .seg-l { fill: var(--ink-3); pointer-events: none; transition: fill .3s; }
.xp-chart .seg-l.is-on { fill: var(--accent); }
.xp-chart .now { stroke: var(--accent); stroke-dasharray: 2 2; }

/* path */
.orgs { margin-top: 48px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px 28px; align-items: center; }
.org { display: flex; align-items: center; justify-content: center; gap: 8px; height: 56px; }
.org img { max-width: 100%; max-height: 38px; object-fit: contain; filter: var(--logo-filter); mix-blend-mode: var(--logo-blend); opacity: .75; transition: opacity .3s, filter .3s; }
.org.is-crest img { max-height: 56px; }
.org.is-tall img { max-height: 52px; }
.org.is-raster img { max-height: 34px; }
.org.is-girard img { max-height: 30px; }
.org-name { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--ink-2); }

@media (hover: hover) and (prefers-color-scheme: dark) { .org:hover img { filter: var(--logo-filter); } }

.orgs-note { margin-top: 28px; max-width: 62ch; font-size: 13px; line-height: 1.55; color: var(--ink-3); }
.orgs-note a, .foot-legal a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }

.timeline { margin-top: 56px; position: relative; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 116px; width: 1px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 76px 46px 1fr; gap: 18px; padding: 14px 0; position: relative; }
.t-year { font: 500 13px/1 var(--mono); color: var(--ink-3); padding-top: 17px; }
.t-marks { position: relative; z-index: 1; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.t-marks img { width: 32px; height: 32px; object-fit: contain; filter: var(--logo-filter); mix-blend-mode: var(--logo-blend); }
.t-marks.is-pair img { position: absolute; width: 24px; height: 24px; }
.t-marks.is-pair img:first-child { top: 4px; left: 4px; }
.t-marks.is-pair img:last-child { bottom: 4px; right: 4px; }
.timeline h3 { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -.015em; line-height: 1.3; padding-top: 6px; }
.t-role { margin-top: 2px; font-size: 14px; color: var(--ink-3); }
.timeline p:not(.t-role) { margin-top: 6px; font-size: 15px; line-height: 1.6; color: var(--ink-2); max-width: 56ch; }
.timeline .is-now .t-year { color: var(--accent); }
.timeline .is-now .t-marks { border-color: var(--accent); }

/* stack */
.stack { margin-top: 40px; display: grid; gap: 36px; }
.stack-group h3 { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.015em; }
.chips { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px 7px 8px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: 15px; font-weight: 500;
  transition: border-color .25s var(--ease-out), opacity .6s var(--ease-out), translate .6s var(--ease-out);
  transition-delay: 0s, calc(var(--n) * 40ms), calc(var(--n) * 40ms);
}
.chip-ico { width: 22px; height: 22px; border-radius: 50%; background: var(--panel); position: relative; flex: 0 0 auto; }
.chip-ico::after { content: ""; position: absolute; inset: 4px; background: var(--ink-2); -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; transition: background-color .25s; }


@media (hover: hover) and (prefers-color-scheme: dark) { .chip:hover .chip-ico::after { background: var(--accent); } }

/* work */
.projects { margin-top: 36px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.projects a { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); }
.p-t { font-weight: 500; font-size: 16px; line-height: 1.35; }
.p-m { grid-column: 1; margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.projects .ext { grid-column: 2; grid-row: 1; margin-top: 4px; }

.papers { margin-top: 20px; display: grid; gap: 4px; }
.papers a { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: baseline; padding: 12px 0; }
.pp-j { font: 500 13px/1 var(--mono); color: var(--accent); }
.pp-t { font-size: 16px; line-height: 1.45; }


/* blog */
.soon { margin-top: 28px; padding: 28px; border-radius: 14px; border: 1px dashed var(--pop-line); background: var(--pop-soft); }
.soon-t { font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: -.02em; color: var(--pop); }
.soon-d { margin-top: 6px; font-size: 16px; color: var(--ink-2); max-width: 52ch; }

/* contact card (sky shader) */
#contact { border-top: 0; padding-top: 0; }
.cta {
  position: relative; isolation: isolate; overflow: hidden; padding: 40px; border-radius: 14px;
  background: #1a2620; color: #f4f6f3; box-shadow: var(--shadow);
}
.cta-art { z-index: -2; }
.cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #0b110dcc 0%, #0b110d8a 55%, #0b110d10 100%); }
.cta-title { font-family: var(--display); font-weight: 700; font-size: 38px; line-height: 1.08; letter-spacing: -.025em; max-width: 14em; }
.cta-text { margin-top: 10px; max-width: 34em; font-size: 16px; line-height: 1.6; color: #f4f6f3d9; }
.cta .ways { margin-top: 28px; }
.btn-primary.is-light { background: #f4f6f3; color: #1f5c3d; }
.btn-primary.is-light::before { background: #1f5c3d; }
.btn-primary.is-light .btn-tile { color: #f4f6f3; }
.btn-primary.is-light:focus-visible .btn-label { color: #f4f6f3; }
.btn-ghost.is-light { color: #f4f6f3; border-color: #f4f6f359; }


/* footer */
.foot { margin-top: var(--space); }
.foot-sign { transition: color .5s var(--ease-out); font-family: var(--display); font-weight: 800; font-size: clamp(56px, 7.4vw, 108px); line-height: .85; letter-spacing: -.045em; white-space: nowrap; }

.foot-grid { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--ink); display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.foot-note { font-size: 15px; color: var(--ink-2); max-width: 20em; }
.foot nav { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.foot-h { font-weight: 700; margin-bottom: 4px; }
.foot nav a { display: inline-flex; align-items: center; gap: 6px; width: fit-content; color: var(--ink-2); }

.foot-legal { margin-top: 36px; max-width: 70ch; font-size: 12.5px; line-height: 1.55; color: var(--ink-3); }
.foot-legal + .foot-base { margin-top: 14px; }
.foot-base { margin-top: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-3); }


/* ============ HOVER (pointer devices only, so taps never leave sticky hover states) ============ */
@media (hover: hover) {
  a:hover .ext { translate: 2px -2px; opacity: 1; }
  .nav-doors a:hover { color: var(--ink); }
  .toc-list a:hover { color: var(--ink); }
  .note:hover .ext { translate: 2px -2px; opacity: 1; }
  .btn-primary:hover::before { clip-path: inset(3px round 999px); }
  .btn-primary:hover .btn-rail { translate: 100%; }
  .btn-primary:hover .btn-tile { rotate: 360deg; }
  .btn-primary:hover .btn-label { color: var(--accent); translate: -43px; }
  .btn-ghost:hover { border-color: var(--accent-line); background: var(--accent-soft); }
  .btn-ghost:hover .arr { translate: 2px 0; }
  .btn-ghost:hover .arr.up { translate: 2px -2px; }
  .key:hover { text-decoration-color: var(--accent); }
  .fn-link:hover { text-decoration: underline; text-underline-offset: 3px; }
  .u-link:hover { text-decoration-color: var(--accent); }
  .oss:hover { border-color: var(--accent-line); }
  .more a:hover { color: var(--accent); }
  .xp-tabs button:hover { color: var(--ink); }
  .org:hover img { opacity: 1; filter: none; }
  .orgs-note a:hover, .foot-legal a:hover { color: var(--accent); text-decoration-color: var(--accent); }
  .chip:hover { border-color: var(--pop-line); background: var(--pop-soft); }
  .chip:hover .chip-ico::after { background: var(--b, var(--accent)); }
  .projects a:hover .p-t { color: var(--accent); }
  .papers a:hover .pp-t { color: var(--accent); }
  .btn-primary.is-light:hover .btn-label { color: #f4f6f3; }
  .btn-ghost.is-light:hover { background: #f4f6f314; border-color: #f4f6f3; }
  .foot-sign:hover { color: var(--pop); }
  .foot nav a:hover { color: var(--accent); }
  .foot-base a:hover { color: var(--ink); }
  .doc-back:hover { color: var(--accent); }
}


/* ============ DOCUMENT PAGES ============ */
.doc { max-width: 720px; margin: 0 auto; padding: 48px 24px 40px; }
.doc-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 48px; }
.doc-back { font-size: 14px; font-weight: 500; color: var(--ink-3); }

.doc main { padding: 0; }
.doc .updated { font-size: 14px; color: var(--ink-3); }
.doc .statement { margin-top: 12px; }
.doc-sec { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.doc-sec h2 { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.015em; }
.doc-sec p { margin-top: 12px; font-size: 16px; line-height: 1.7; color: var(--ink-2); max-width: 62ch; }
.doc .foot-base { margin-top: 56px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1140px) {
  :root { --gap: 56px; --rail-w: 180px; --col-w: 640px; }
}

@media (max-width: 940px) {
  :root { --space: 88px; }
  .shell { display: block; width: auto; padding-inline: 24px; }
  .shell::before { display: none; }
  .rail {
    position: sticky; top: 0; height: auto; overflow: visible; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between;
    margin-inline: -24px; padding: 14px 24px; background: color-mix(in srgb, var(--panel) 92%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .logo-word { font-size: 21px; }
  .menu { display: grid; gap: 5px; place-content: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); }
  .menu span:not(.sr) { width: 14px; height: 1.5px; background: var(--ink); transition: translate .3s var(--ease-out), rotate .3s var(--ease-out); }
  .rail.is-open .menu span:nth-child(1) { translate: 0 3.25px; rotate: 45deg; }
  .rail.is-open .menu span:nth-child(2) { translate: 0 -3.25px; rotate: -45deg; }
  .nav-mark, .nav-here, .nav-gap { display: none; }
  .nav-doors {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0; gap: 0; padding: 4px 24px 12px;
    background: var(--panel); border-bottom: 1px solid var(--line);
    opacity: 0; visibility: hidden; translate: 0 -8px;
    transition: opacity .2s var(--ease-out), translate .3s var(--ease-out), visibility 0s linear .3s;
  }
  .rail.is-open .nav-doors { opacity: 1; visibility: visible; translate: 0; transition: opacity .2s var(--ease-out), translate .42s var(--spring), visibility 0s; }
  .nav-doors a { padding: 12px 0; font-size: 17px; width: 100%; opacity: 1; translate: 0; border-bottom: 1px solid var(--line-soft); }
  main { padding-top: 40px; max-width: 720px; margin-inline: auto; }
}

@media (max-width: 767px) {
  body { font-size: 16px; }
  .memo p, .body { font-size: 16px; }
  .statement { font-size: 36px; }
  .dek { font-size: 17px; }
  .ways .btn { flex: 1 1 100%; }
  .btn-primary { min-width: 0; }
  .field { aspect-ratio: 16 / 11; }
  .memo .pull { font-size: 23px; }
  .section-head { font-size: 30px; }
  .lit { font-size: 28px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 18px 0; }
  .stat + .stat { padding-left: 0; border-left: 0; }
  .stat:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--line); }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stat-n { font-size: 38px; }
  .facts { grid-template-columns: 1fr; gap: 16px; }
  .orgs { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .timeline::before { left: 22px; }
  .timeline li { grid-template-columns: 46px 1fr; column-gap: 14px; row-gap: 4px; }
  .t-year { grid-column: 2; grid-row: 1; padding-top: 0; }
  .t-marks { grid-row: 1 / span 2; }
  .timeline li > div { grid-column: 2; }
  .projects { grid-template-columns: 1fr; }
  .papers a { grid-template-columns: 1fr auto; }
  .pp-j { grid-column: 1 / -1; }
  .entry { grid-template-columns: 58px 1fr; gap: 16px; }
  .entry-art { width: 58px; height: 58px; }
  .xp { padding: 16px; }
  .xp-tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .xp-tabs::-webkit-scrollbar { display: none; }
  .xp-tabs button { flex: 0 0 auto; }
  .xp-panel { grid-template-columns: 42px 1fr; column-gap: 12px; }
  .xp-mark { width: 42px; height: 42px; }
  .xp-mark img { width: 28px; height: 28px; }
  .loop { margin-inline: -24px; }
  .loop-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
  .loop-stage { width: 620px; margin-inline: 24px; }
  .loop figcaption { padding-inline: 24px; }
  .cta { padding: 28px 22px; margin-inline: -8px; }
  .cta::before { background: linear-gradient(180deg, #0b110dcc 0%, #0b110d8f 70%, #0b110d50 100%); }
  .cta-title { font-size: 30px; }
  .foot-sign { font-size: calc((100vw - 56px) / 5.95); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-note { grid-column: 1 / -1; }
  .oss { grid-template-columns: 36px 1fr auto; gap: 14px; padding: 16px; }
  .oss-ico { width: 36px; height: 36px; -webkit-mask-size: 24px; mask-size: 24px; }
}


/* ============ PHONES AND TABLETS ============ */
@media (max-width: 940px) {
  html { scroll-padding-top: 84px; }
  .shell { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .rail { padding-top: max(14px, env(safe-area-inset-top)); padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .menu { width: 44px; height: 44px; }
  .note { min-height: 44px; flex-wrap: nowrap; gap: 10px; padding: 4px 4px 4px 16px; border-radius: 999px; max-width: 100%; }
  .note-long { display: none; }
  .note-short { display: inline; }
  .note-t { white-space: nowrap; }
  .note-cta { height: 34px; flex: 0 0 auto; }
  .rail .logo { min-height: 44px; align-items: center; }
  .facts .u-link { display: inline-flex; align-items: center; min-height: 40px; }
  .nav-doors a { min-height: 48px; display: flex; align-items: center; }
  .rail.is-open .nav-doors { max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain; }
  .xp-tabs button { padding: 10px 14px; }
  .more a, .fn-link { padding: 8px 0; }
  .foot nav { gap: 0; }
  .foot nav a, .foot-base a { padding: 10px 0; }
  .foot-base { align-items: center; }
  .orgs-note a, .foot-legal a { display: inline-block; padding: 6px 0; }
  main { padding-bottom: max(48px, env(safe-area-inset-bottom)); }
}
@media (max-width: 767px) {
  .loop-scroll {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 40px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 40px), transparent 100%);
    scroll-snap-type: x proximity;
  }
  .loop figcaption::before { content: "Swipe to see the full diagram. "; font-weight: 500; color: var(--ink-2); }
  .stats .stat-m { font-size: 13px; }
  .foot-base { flex-direction: column; align-items: flex-start; gap: 0; }
}
@media (max-width: 360px) {
  .statement { font-size: 32px; }
  .section-head { font-size: 27px; }
  .lit { font-size: 25px; }
  .memo .pull { font-size: 21px; }
  .stat-n { font-size: 32px; }
  .stat:nth-child(even) { padding-left: 12px; }
  .cta-title { font-size: 26px; }
  .orgs { gap: 22px 14px; }
  .btn-primary { padding-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
}

/* ============ 404 ============ */
.nf { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 48px 24px; max-width: 720px; margin: 0 auto; }
.nf-code { font-family: var(--display); font-weight: 800; font-size: clamp(120px, 26vw, 240px); line-height: .85; letter-spacing: -.06em; color: var(--pop); }
.nf-title { margin-top: 20px; font-family: var(--display); font-weight: 700; font-size: 32px; letter-spacing: -.02em; }
.nf .btn { margin-top: 28px; align-self: flex-start; }
