@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }

:root {
  --paper: #EEF1F4;
  --paper-2: #E1E7ED;
  --white: #FBFCFD;
  --line: #CBD3DC;
  --ink: #0C1A28;
  --ink-2: #34475A;
  --ink-3: #55657A;
  --bid: #0E9F86;
  --bid-ink: #0A6F5E;
  --ask: #E8503A;
  --cobalt: #2347F5;
  --cobalt-ink: #1B38C4;
  --display: "Geist", "Helvetica Neue", Arial, sans-serif;
  --text: "Newsreader", Georgia, "Times New Roman", serif;
  --pad: clamp(20px, 5vw, 56px);
  --max: 1120px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  interpolate-size: allow-keywords;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: #2347F533; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--display); margin: 0; font-weight: 650; letter-spacing: -0.02em; line-height: 1.05; }
p { margin: 0; }
a { color: var(--cobalt-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }
em { font-style: italic; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .82em; background: var(--paper-2); padding: .12em .4em; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(238, 241, 244, .84);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
}
.nav-in { max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad); height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 17px/1 var(--display); letter-spacing: -0.01em; }
.mark svg { width: 28px; height: 28px; }
.nav-links { display: flex; gap: clamp(14px, 3vw, 28px); align-items: center; }
.nav-links a { font: 500 15px/1 var(--display); color: var(--ink-2); text-decoration: none; padding: 8px 0; }
.nav-links a:hover { color: var(--ink); }
.nav-links .nav-cta { color: var(--white); background: var(--ink); padding: 10px 14px; border-radius: 8px; transition: background .2s; }
.nav-links .nav-cta:hover { color: var(--white); background: var(--cobalt); }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--cobalt); transform-origin: left; transform: scaleX(var(--p, 0)); }
.nav::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); z-index: -1; }
@media (max-width: 560px) { .nav-links .hide-sm { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; min-height: calc(100svh - 60px); display: flex; flex-direction: column; }
.hero-top { width: 100%; max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto; padding: clamp(36px, 8vh, 96px) var(--pad) 0; display: flex; flex-wrap: wrap; gap: 28px 40px; justify-content: space-between; align-items: flex-start; }
.hero-copy { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 26px; }
.name { font-size: clamp(46px, 9.4vw, 128px); font-weight: 600; letter-spacing: -0.045em; line-height: .95; }
.name .ln { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.name .ln > span { display: block; transform: translateY(105%); animation: rise 1s var(--ease) forwards; animation-delay: calc(.08s + var(--i) * .13s); }
@keyframes rise { to { transform: none; } }
.lede { font-size: clamp(20px, 2.3vw, 26px); line-height: 1.45; color: var(--ink-2); max-width: 30em; opacity: 0; animation: fade .9s var(--ease) .55s forwards; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; opacity: 0; animation: fade .9s var(--ease) .7s forwards; }
.portrait { flex: 0 0 auto; width: clamp(96px, 12vw, 148px); aspect-ratio: 1; object-fit: cover; border-radius: 22px; box-shadow: 0 0 0 6px var(--paper), 0 0 0 7px var(--line); opacity: 0; animation: fade 1s var(--ease) .4s forwards; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) { .portrait { order: -1; } }

.market { position: relative; flex: 1 0 clamp(220px, 36vh, 380px); margin-top: clamp(24px, 5vh, 56px); touch-action: pan-y; }
.market canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.readout { width: 100%; max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto; padding: 14px var(--pad) 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; font: 400 14px/1.45 var(--display); color: var(--ink-3); border-top: 1px solid var(--line); }
.readout .vals { display: flex; gap: 18px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.readout .b { color: var(--bid-ink); }
.readout .a { color: #B83A27; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 20px; border-radius: 10px; font: 600 15px/1 var(--display); text-decoration: none; background: var(--cobalt); color: var(--white); border: 1px solid var(--cobalt); transition: background .2s, color .2s, border-color .2s; }
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }
.btn.alt { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.alt:hover { background: var(--ink); color: var(--white); }

/* ---------- sections ---------- */
.section { padding: clamp(80px, 12vw, 150px) var(--pad) 0; }
.split { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 20px 64px; }
.split > h2 { font-size: clamp(30px, 3.4vw, 40px); position: sticky; top: 92px; align-self: start; }
.stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.prose { max-width: 34em; color: var(--ink-2); }
@media (max-width: 820px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > h2 { position: static; }
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { font: 500 14px/1 var(--display); padding: 9px 13px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.chips.quiet li { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- project ledger ---------- */
.ledger { border-top: 2px solid var(--ink); }
.proj { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 14px 48px; padding: 34px 0; border-bottom: 1px solid var(--line); }
.proj::before { content: ""; position: absolute; inset: 0 -18px; background: var(--white); border-radius: 12px; z-index: -1; transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.proj:hover::before, .proj:focus-within::before { transform: scaleX(1); }
.proj h3 { font-size: clamp(26px, 2.8vw, 34px); }
.proj .meta { margin-top: 10px; font: 400 15px/1.4 var(--display); color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.proj .body { display: flex; flex-direction: column; gap: 16px; }
.proj .body p { font-size: 17px; color: var(--ink-2); max-width: 36em; }
.links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.links a { font: 600 15px/1.6 var(--display); text-decoration: none; color: var(--cobalt-ink); }
.links a:hover { text-decoration: underline; }
.badge { display: inline-flex; align-items: center; gap: 6px; font: 600 13px/1 var(--display); padding: 6px 10px; border-radius: 6px; background: var(--cobalt); color: var(--white); }
.badge svg { width: 13px; height: 13px; }
@media (max-width: 820px) { .proj { grid-template-columns: minmax(0, 1fr); padding: 28px 0; } }

details.more { border-bottom: 1px solid var(--line); }
details.more summary { list-style: none; cursor: pointer; padding: 24px 0; display: flex; justify-content: space-between; align-items: center; font: 600 18px/1 var(--display); color: var(--ink-2); }
details.more summary::-webkit-details-marker { display: none; }
details.more summary:hover { color: var(--ink); }
.plus { position: relative; width: 16px; height: 16px; transition: transform .35s var(--ease); }
.plus::before, .plus::after { content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 2px; background: currentColor; }
.plus::after { transform: rotate(90deg); }
details[open] .plus { transform: rotate(45deg); }
details.more::details-content { block-size: 0; overflow: hidden; transition: block-size .45s var(--ease), content-visibility .45s allow-discrete; }
details.more[open]::details-content { block-size: auto; }
details.more .proj { border-bottom: 0; padding-top: 4px; }
details.more .proj h3 { font-size: 24px; }

/* ---------- interests ---------- */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; border-top: 2px solid var(--ink); padding-top: 28px; }
.duo h3 { font-size: 26px; margin-bottom: 10px; }
.duo p { color: var(--ink-2); font-size: 17px; }
@media (max-width: 640px) { .duo { grid-template-columns: minmax(0, 1fr); gap: 28px; } }

ul.list { margin: 0; padding-left: 1.1em; color: var(--ink-2); max-width: 36em; }
ul.list li { margin: .45em 0; padding-left: .25em; }
ul.list li::marker { color: var(--ink-3); }

/* ---------- footer ---------- */
.foot { padding: clamp(90px, 12vw, 150px) var(--pad) 40px; }
.foot .wrap { border-top: 1px solid var(--line); padding-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font: 400 14px/1.4 var(--display); color: var(--ink-3); }
.foot a { color: var(--ink-2); }

/* ---------- README pages ---------- */
.doc-head { padding: clamp(48px, 9vw, 110px) var(--pad) clamp(36px, 6vw, 64px); }
.doc-head .wrap { display: flex; flex-direction: column; gap: 22px; }
.crumb { font: 500 15px/1 var(--display); color: var(--ink-3); text-decoration: none; }
.crumb:hover { color: var(--ink); }
.doc-title { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.doc-title h1 { font-size: clamp(44px, 7.5vw, 96px); font-weight: 600; letter-spacing: -0.04em; line-height: .95; }
.status { display: inline-flex; font: 600 13px/1 var(--display); padding: 6px 10px; border-radius: 6px; background: var(--paper-2); color: var(--ink-2); }
.status.ok { background: #CDEFE6; color: #0A5C4D; }
.status.win { background: var(--cobalt); color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.doc-body { padding: 0 var(--pad); }
.doc-sec { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 14px 64px; padding: 34px 0; border-top: 1px solid var(--line); }
.doc-sec:first-child { border-top: 2px solid var(--ink); }
.doc-sec h2 { font-size: 21px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.doc-sec .stack { gap: 16px; }
.doc-sec .stack > p { color: var(--ink-2); max-width: 36em; }
.doc-sec .stack > p.note { font-size: 15px; color: var(--ink-3); }
@media (max-width: 820px) { .doc-sec { grid-template-columns: minmax(0, 1fr); } }

/* ---------- contact ---------- */
.contacts { border-top: 2px solid var(--ink); }
.crow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 26px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.crow .k { display: flex; align-items: center; gap: 10px; font: 500 15px/1 var(--display); color: var(--ink-3); margin-bottom: 10px; }
.crow .v { font: 600 clamp(19px, 3vw, 28px)/1.15 var(--display); letter-spacing: -0.015em; overflow-wrap: anywhere; }
.crow .arr { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); transition: background .25s, color .25s, transform .35s var(--ease); }
.crow .arr svg { width: 18px; height: 18px; }
.crow:hover .arr { background: var(--cobalt); color: var(--white); box-shadow: none; transform: rotate(-8deg); }
.crow:hover .v { color: var(--cobalt-ink); }

/* ---------- page transitions & reduced motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out .18s ease-in both; }
  ::view-transition-new(root) { animation: vt-in .4s var(--ease) both; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .name .ln > span, .lede, .hero-cta, .portrait { animation: none; opacity: 1; transform: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* touch + press states */
.btn:active, .nav-cta:active { transform: scale(.97); }
.btn, .nav-cta { transition: background .2s, color .2s, border-color .2s, transform .12s; }
.nav-links a { padding: 12px 0; }
@media (pointer: coarse) { .links a { padding: 10px 0; } }
.portrait { height: auto; }
.mark span, .nav-links a { white-space: nowrap; }
@media (max-width: 440px) { .mark span { display: none; } .portrait { width: 88px; } }
