:root {
  --bg: #f6f4ef;
  --bg-2: #efece5;
  --ink: #161513;
  --ink-2: #3a3833;
  --muted: #74706a;
  --line: #e1ddd3;
  --line-2: #d2cdc1;
  --accent: #e2482c;
  --accent-ink: #ffffff;
  --card: #fbfaf7;
  --shadow: 0 1px 0 rgba(0,0,0,.03), 0 18px 50px -24px rgba(40,30,20,.28);
  --contour: rgba(30, 28, 24, .10);
  --contour-hi: rgba(226, 72, 44, .34);
  --radius: 18px;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0e; --bg-2: #161614; --ink: #f1efea; --ink-2: #cfccc5; --muted: #8f8b84;
    --line: #262522; --line-2: #34322e; --accent: #f05a3c; --card: #151513;
    --shadow: 0 1px 0 rgba(255,255,255,.03), 0 24px 60px -28px rgba(0,0,0,.8);
    --contour: rgba(240, 236, 228, .085); --contour-hi: rgba(240, 90, 60, .42);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f0e; --bg-2: #161614; --ink: #f1efea; --ink-2: #cfccc5; --muted: #8f8b84;
  --line: #262522; --line-2: #34322e; --accent: #f05a3c; --card: #151513;
  --shadow: 0 1px 0 rgba(255,255,255,.03), 0 24px 60px -28px rgba(0,0,0,.8);
  --contour: rgba(240, 236, 228, .085); --contour-hi: rgba(240, 90, 60, .42);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.55; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.025em; line-height: 1.08; margin: 0; font-style: normal; }
h2 { font-size: clamp(30px, 4.2vw, 46px); }
h3 { font-size: 21px; letter-spacing: -0.015em; }
p { margin: 0; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.small { font-size: 15px; color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* nav */
.nav {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 22px; padding: 7px 7px 7px 18px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
  width: max-content; max-width: calc(100% - 24px);
}
.nav-name { font-weight: 600; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.nav nav { display: flex; gap: 18px; }
.nav nav a { text-decoration: none; color: var(--muted); font-size: 15px; transition: color .2s; }
.nav nav a:hover, .nav nav a.on { color: var(--ink); }
.nav-resume {
  text-decoration: none; font-size: 14px; font-weight: 500; background: var(--ink); color: var(--bg);
  padding: 7px 14px; border-radius: 999px; white-space: nowrap;
}
@media (max-width: 720px) {
  .nav nav { display: none; }
  .nav { gap: 14px; }
}

/* hero */
.hero { position: relative; min-height: min(100svh, 920px); display: flex; align-items: center; padding: 120px 0 72px; overflow: hidden; }
.contours { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(54px, 9vw, 112px); letter-spacing: -0.045em; line-height: .95; font-weight: 600; }
.lede { font-size: clamp(19px, 2.1vw, 23px); line-height: 1.45; color: var(--ink-2); margin-top: 26px; max-width: 34em; }
.creds { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.creds li { font-size: 14px; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px; background: color-mix(in srgb, var(--bg) 70%, transparent); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: inherit; font-size: 16px; font-weight: 500;
  padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); cursor: pointer;
  transition: transform .2s ease, border-color .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.04); }
.muted-in { font-size: 13px; opacity: .78; font-weight: 400; }
.btn-quiet { margin-top: 18px; }

.portrait { margin: 0; justify-self: end; width: 100%; max-width: 440px; perspective: 900px; position: relative; }
.portrait-card {
  border-radius: 28px; overflow: hidden; box-shadow: var(--shadow), 0 40px 80px -40px rgba(226,72,44,.35);
  transform: rotate(2.2deg); transition: transform .5s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; cursor: pointer;
  aspect-ratio: 1 / 1; background: var(--bg-2);
}
.portrait-card img { width: 100%; height: 100%; object-fit: cover; }
.portrait-note { position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%); font-size: 14px; color: var(--muted); white-space: nowrap; min-height: 1em; }
.portrait-card.spin { animation: spin 1s cubic-bezier(.3,.7,.2,1); }
@keyframes spin { from { transform: rotateY(0) rotate(2deg); } to { transform: rotateY(360deg) rotate(2deg); } }

@media (max-width: 860px) {
  .hero { padding-top: 96px; min-height: 0; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .portrait { justify-self: start; max-width: 300px; order: -1; }
  .portrait-note { left: 0; transform: none; }
}

/* sections */
.section { padding: 76px 24px; }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: 40px; }
.section-head p { color: var(--ink-2); max-width: 36em; }
@media (max-width: 860px) { .section-head { grid-template-columns: 1fr; gap: 16px; } .section { padding: 64px 16px; } .wrap { padding-left: 16px; padding-right: 16px; } }

/* wins */
.wins { list-style: none; margin: 36px 0 0; padding: 0; border-top: 1px solid var(--line); }
.wins li { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: baseline; padding: 22px 0; border-bottom: 1px solid var(--line); }
.win-num { font-size: clamp(34px, 4.6vw, 52px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.win-text { font-size: 19px; color: var(--ink-2); max-width: 40em; }
.wins li:hover .win-num { color: var(--accent); }
.win-num { transition: color .25s; }
@media (max-width: 640px) { .wins li { grid-template-columns: 1fr; gap: 6px; } .win-text { font-size: 17px; } }

/* projects */
.flagships { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); margin-bottom: 36px; }
.flag { display: grid; grid-template-columns: 220px 1fr auto; gap: 28px; align-items: center; padding: 26px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.flag-name { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.flag-line { color: var(--ink-2); font-size: 18px; }
.flag-url { font-family: var(--mono); font-size: 13px; color: var(--muted); transition: color .2s; }
.flag:hover .flag-url, .flag:hover .flag-name { color: var(--accent); }
@media (max-width: 760px) { .flag { grid-template-columns: 1fr; gap: 4px; } }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filters button {
  font: inherit; font-size: 14px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; color: var(--ink-2); cursor: pointer; transition: all .2s;
}
.filters button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.projects { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 48px; }
.projects li { break-inside: avoid; border-bottom: 1px solid var(--line); }
.projects a, .projects .p-row { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; text-decoration: none; }
.p-name { font-weight: 500; white-space: nowrap; }
.p-line { color: var(--muted); font-size: 15px; text-align: right; }
.projects a:hover .p-name { color: var(--accent); }
.projects li.hide { display: none; }
.projects li.enter { animation: fadeUp .5s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { @keyframes fadeUp { from { opacity: 0; } to { opacity: 1; } } }
@media (max-width: 760px) { .projects { columns: 1; } .p-line { text-align: left; } .projects a, .projects .p-row { flex-direction: column; gap: 2px; } }

/* diagram */
.diagram { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram .edge { fill: none; stroke: var(--line-2); stroke-width: 1.2; }
.diagram .edge.future { stroke-dasharray: 4 5; }
.diagram .pkt { fill: var(--accent); }
.diagram .node rect { fill: var(--bg); stroke: var(--line-2); stroke-width: 1.2; transition: stroke .2s, fill .2s; }
.diagram .node.future rect { stroke-dasharray: 5 5; }
.diagram .node.games rect { fill: transparent; }
.diagram .node .n-title { font: 600 15px var(--sans); fill: var(--ink); letter-spacing: -0.01em; }
.diagram .node .n-sub { font: 400 12.5px var(--mono); fill: var(--muted); }
.diagram .node { cursor: default; }
.diagram .node.on rect { stroke: var(--accent); }
.diagram .node.lead rect { stroke: var(--ink); stroke-width: 1.6; }
.diagram .zone { font: 500 12px var(--mono); fill: var(--muted); letter-spacing: .02em; }
.diagram .zone-box { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.diagram-tip { position: absolute; max-width: 280px; background: var(--ink); color: var(--bg); font-size: 14px; line-height: 1.4; padding: 10px 12px; border-radius: 10px; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 3; }
.diagram-tip.show { opacity: 1; }
.diagram-note { font-size: 14px; color: var(--muted); margin-top: 12px; }

.lab-split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; margin-top: 72px; }
.lab-split h3 { margin-bottom: 10px; }
@media (max-width: 860px) { .lab-split { grid-template-columns: 1fr; gap: 48px; margin-top: 56px; } }
.tokens { list-style: none; padding: 0; margin: 22px 0 0; }
.tokens li { display: grid; grid-template-columns: 22px 170px 1fr 64px; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.t-rank { font-family: var(--mono); color: var(--muted); font-size: 14px; }
.t-name { font-weight: 500; display: flex; flex-direction: column; line-height: 1.25; }
.t-name small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.t-bar { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.t-bar i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 99px; transition: width 1.6s cubic-bezier(.2,.8,.2,1); }
.tokens li:first-child .t-bar i { background: var(--accent); }
.t-bar i.dashed { background: repeating-linear-gradient(90deg, var(--ink-2) 0 6px, transparent 6px 10px); }
.tokens.go .t-bar i { width: var(--w); }
.t-val { font-family: var(--mono); font-size: 14px; text-align: right; }
@media (max-width: 520px) { .tokens li { grid-template-columns: 18px 1fr 54px; } .t-bar { grid-column: 2 / 4; grid-row: 2; } }

.swaps { list-style: none; padding: 0; margin: 22px 0 0; }
.swaps li { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.swaps s { color: var(--muted); text-decoration-thickness: 1px; }
@media (max-width: 520px) { .swaps li { grid-template-columns: 1fr; gap: 2px; } }

.github { display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: center; margin-top: 80px; }
.github-text p { color: var(--ink-2); margin: 12px 0 14px; }
.github-shot { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0d1117; box-shadow: var(--shadow); transform: rotate(-1deg); transition: transform .4s; }
.github-shot:hover { transform: rotate(0); }
.link { color: var(--ink); text-decoration-color: var(--line-2); text-underline-offset: 4px; font-weight: 500; }
.link:hover { text-decoration-color: var(--accent); }
@media (max-width: 860px) { .github { grid-template-columns: 1fr; gap: 28px; margin-top: 56px; } }

/* games */
.games { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.games li { flex: 1 1 240px; display: flex; flex-direction: column; gap: 4px; padding: 26px 24px 26px 0; }
.games li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.g-rank { font-size: clamp(40px, 5vw, 60px); font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.g-name { color: var(--muted); }
@media (max-width: 760px) { .games li + li { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); } }
.highway { margin-top: 28px; position: relative; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); overflow: hidden; }
.highway canvas { display: block; width: 100%; height: 220px; touch-action: manipulation; cursor: pointer; }
.highway-hint { position: absolute; right: 14px; top: 12px; font-size: 13px; color: var(--muted); font-family: var(--mono); }

/* balto */
.balto { position: relative; background: var(--ink); color: var(--bg); margin: 40px 0 0; overflow: hidden; }
.balto .paws { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.balto .paws path, .balto .paws ellipse { fill: color-mix(in srgb, var(--bg) 9%, transparent); }
.balto-inner { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.balto-text p { color: color-mix(in srgb, var(--bg) 80%, transparent); margin-top: 16px; max-width: 32em; }
.balto-text h2 { font-size: clamp(44px, 6vw, 76px); letter-spacing: -0.045em; }
.balto .small { color: color-mix(in srgb, var(--bg) 58%, transparent); }
.balto-channels { display: flex; flex-direction: column; border-top: 1px solid color-mix(in srgb, var(--bg) 16%, transparent); }
.channel { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 20px 0; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--bg) 16%, transparent); }
.ch-name { color: color-mix(in srgb, var(--bg) 62%, transparent); }
.ch-val { font-size: clamp(20px, 2.4vw, 28px); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; transition: color .2s; text-align: right; }
.channel:hover .ch-val { color: var(--accent); }
.channel.pending { pointer-events: none; }
.channel.pending .ch-val { color: color-mix(in srgb, var(--bg) 40%, transparent); font-weight: 500; font-size: 18px; }
@media (max-width: 860px) { .balto-inner { grid-template-columns: 1fr; gap: 36px; } .channel { flex-direction: column; gap: 2px; } .ch-val { text-align: left; } }

/* links */
.links { list-style: none; padding: 0; margin: 32px 0 0; border-top: 1px solid var(--line); columns: 2; column-gap: 48px; }
.links li { break-inside: avoid; border-bottom: 1px solid var(--line); }
.links a { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; text-decoration: none; font-size: 19px; font-weight: 500; }
.l-url { font-family: var(--mono); font-size: 13.5px; color: var(--muted); font-weight: 400; align-self: center; transition: color .2s; }
.links a:hover .l-url { color: var(--accent); }
@media (max-width: 760px) { .links { columns: 1; } .links a { flex-direction: column; gap: 2px; } .l-url { align-self: flex-start; } }

.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 40px; padding-bottom: 48px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.eggs span { color: var(--ink); font-variant-numeric: tabular-nums; }

/* toast + snow */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 80; opacity: 0;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 15px;
  transition: opacity .3s, transform .3s; pointer-events: none; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; display: none; }
.dog-run { position: fixed; bottom: 18px; left: 0; z-index: 75; pointer-events: none; font-size: 0; }

/* reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { transform: none; transition: opacity .9s ease; } }

/* balto chat */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sms-note { margin-top: 14px; }
.balto-chat { margin-top: 18px; }
.balto-input { display: flex; gap: 8px; background: color-mix(in srgb, var(--bg) 8%, transparent); border: 1px solid color-mix(in srgb, var(--bg) 20%, transparent); border-radius: 999px; padding: 6px 6px 6px 18px; transition: border-color .2s; }
.balto-input:focus-within { border-color: var(--accent); }
.balto-input input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--bg); font: inherit; font-size: 16px; }
.balto-input input::placeholder { color: color-mix(in srgb, var(--bg) 45%, transparent); }
.balto-input button { font: inherit; font-size: 15px; font-weight: 500; border: 0; border-radius: 999px; padding: 9px 16px; background: var(--accent); color: #fff; cursor: pointer; }
.balto-input button:disabled { opacity: .5; cursor: default; }
.balto-log { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.balto-log .msg { margin: 0; padding: 9px 14px; border-radius: 16px; max-width: 88%; font-size: 15.5px; line-height: 1.45; white-space: pre-wrap; animation: fadeUp .35s both; }
.balto-log .msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.balto-log .msg.balto { align-self: flex-start; background: color-mix(in srgb, var(--bg) 12%, transparent); color: var(--bg); border-bottom-left-radius: 5px; }

/* lab list on phones */
.pack { list-style: none; margin: 0; padding: 18px 18px 18px 40px; position: relative; }
.pack::before { content: ""; position: absolute; left: 22px; top: 34px; height: var(--trunk, 0px); width: 1px; background: var(--line-2); }
.pack::after { content: ""; position: absolute; left: 19.5px; top: 34px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: trunk 6s linear infinite; }
@keyframes trunk { from { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } to { transform: translateY(calc(var(--trunk, 900px))); opacity: 0; } }
.pack li { position: relative; padding: 12px 0 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.pack li:last-child { border-bottom: 0; }
.pack li::before { content: ""; position: absolute; left: -22px; top: 21px; width: 12px; height: 1px; background: var(--line-2); }
.pack b { font-weight: 600; }
.pack .n-sub { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.pack .n-tip { font-size: 15px; color: var(--ink-2); margin-top: 4px; }
.pack li.lead b::after { content: "lead dog"; margin-left: 8px; font: 500 11px var(--mono); color: var(--accent); }
.pack li.future { opacity: .75; }
.pack li.games::before { background: transparent; }

.sms-note a { color: inherit; text-underline-offset: 3px; }
