:root {
  --bg: #121511;
  --panel: #171b15;
  --line: #2c3228;
  --text: #e6e8dc;
  --muted: #a6b09b;
  --dim: #788270;
  --lime: #d9f775;
  --ink: #1c2214;
  --sans: 'Geologica', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --gutter: clamp(20px, 5vw, 64px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
::selection { background: var(--lime); color: var(--ink); }

.container { max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter); }
.skip {
  position: fixed; top: 12px; left: 12px; z-index: 10;
  padding: 12px 16px; background: var(--lime); color: var(--ink);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* Header */
.header { display: flex; align-items: center; gap: 40px; height: 88px; }
.wordmark { font-size: 26px; font-weight: 600; letter-spacing: -0.04em; margin-right: auto; }
.wordmark span { color: var(--lime); }
.nav { display: flex; gap: 32px; font-size: 14px; color: var(--muted); }
.nav a:hover { color: var(--text); }
.languages { display: flex; gap: 2px; font: 12px var(--mono); }
.languages button { min-height: 40px; padding: 0 8px; border: 0; background: none; color: var(--dim); }
.languages button:hover { color: var(--text); }
.languages button[aria-pressed=true] { color: var(--text); text-decoration: underline; text-underline-offset: 6px; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 64px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 96px;
}
.hero h1 {
  font-size: clamp(40px, 7.4vw, 94px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}
.hero h1 span { color: var(--lime); }
.bio { display: flex; gap: 20px; align-items: flex-start; margin-top: 44px; }
.bio img { width: 60px; aspect-ratio: 1; object-fit: cover; filter: grayscale(0.6); flex-shrink: 0; }
.bio p { max-width: 440px; font-size: 18px; line-height: 1.55; color: var(--muted); }
.button {
  display: inline-block;
  margin-top: 36px;
  padding: 14px 24px;
  background: var(--lime);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}
.button:hover { background: #ecffa8; }
.stack {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font: 12px/1.8 var(--mono);
  color: var(--dim);
}

/* Career circuit */
.track { border: 1px solid var(--line); background: var(--panel); min-width: 0; }
.circuit { display: block; width: 100%; height: auto; }
.circuit path { fill: none; stroke-linejoin: round; }
.circuit-road { stroke: #22281f; stroke-width: 22; }
.circuit-line { stroke: #3a4234; stroke-width: 1.5; }
.circuit-progress { stroke: var(--lime); stroke-width: 3; stroke-linecap: round; }
.circuit-start { stroke: #e8ecd9; stroke-width: 6; stroke-dasharray: 3 3; }
.checkpoint { cursor: pointer; }
.checkpoint circle { fill: #4a5242; stroke: var(--panel); stroke-width: 2; transition: fill 0.2s; }
.checkpoint text { font: 11px var(--mono); fill: var(--dim); letter-spacing: 0.06em; transition: fill 0.2s; }
.checkpoint.is-passed circle { fill: var(--lime); }
.checkpoint.is-current text, .checkpoint:hover text { fill: var(--lime); }
.racer { fill: #f2ffcc; filter: drop-shadow(0 0 6px var(--lime)); pointer-events: none; }

.chapters { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); }
.chapters button {
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--muted);
  font: 12px var(--mono);
}
.chapters button + button { border-left: 1px solid var(--line); }
.chapters button:hover { color: var(--text); }
.chapters button[aria-selected=true] { background: var(--lime); color: var(--ink); }
.chapters button:focus-visible { outline-offset: -4px; }

/* Panels share one cell so switching chapters never changes the height. */
.chapter-panels { display: grid; }
.chapter { grid-area: 1 / 1; padding: 22px 24px 26px; }
.chapter[hidden] { display: block; visibility: hidden; }
.chapter h2 { font-size: 17px; font-weight: 500; }
.chapter p { margin-top: 8px; font-size: 14px; line-height: 1.65; color: var(--muted); }

/* Work */
.work { padding-top: 40px; padding-bottom: 112px; }
.work > h2 { font-size: 40px; font-weight: 500; letter-spacing: -0.035em; line-height: 1.1; margin-bottom: 40px; }
.projects li {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  grid-template-rows: auto 1fr;
  column-gap: 64px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.projects li:last-child { border-bottom: 1px solid var(--line); }
.projects h3 { font-size: 24px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.25; }
.tag { margin-top: 10px; font: 12px var(--mono); color: var(--dim); }
.projects p { grid-column: 2; grid-row: 1 / span 2; max-width: 560px; color: var(--muted); }

/* Contact */
.contact { background: var(--lime); color: var(--ink); padding: 80px 0 32px; }
.contact :focus-visible { outline-color: var(--ink); }
.contact h2 { font-size: 18px; font-weight: 500; }
.contact-email {
  display: inline-block;
  margin: 16px 0 88px;
  font-size: clamp(26px, 7.2vw, 96px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  overflow-wrap: anywhere;
}
.contact-email:hover { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.12em; }
.contact-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid rgb(28 34 20 / 0.25);
}
.contact-links { display: flex; gap: 32px; font-weight: 500; }
.contact-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.copyright { font: 12px var(--mono); color: #4d5a35; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 56px; padding-top: 32px; padding-bottom: 72px; }
  .hero h1 { font-size: min(13vw, 96px); }
  .track { max-width: 600px; }
}

@media (max-width: 720px) {
  .header { height: 72px; gap: 24px; }
  .projects li { grid-template-columns: 1fr; padding: 28px 0; }
  .projects p { grid-column: 1; grid-row: auto; margin-top: 14px; }
  .work { padding-top: 24px; padding-bottom: 80px; }
  .work > h2 { font-size: 32px; margin-bottom: 28px; }
  .contact { padding-top: 56px; }
  .contact-email { margin-bottom: 56px; }
}

@media (max-width: 480px) {
  .nav { display: none; }
  .bio { gap: 16px; margin-top: 32px; }
  .bio img { width: 52px; }
  .bio p { font-size: 16px; }
  .stack { margin-top: 40px; }
  .chapter { padding: 20px; }
  .projects h3 { font-size: 21px; }
  .contact-links { gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
