@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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 Mono";
  src: url("fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  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;
}

:root {
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 3.5rem;

  /* dark (primary) */
  --bg: #0a100c;
  --surface: #101812;
  --surface-2: #142019;
  --border: #1f2e24;
  --border-strong: #2e4435;
  --text: #e7ede8;
  --muted: #92a69a;
  --accent: #4ade80;
  --accent-text: #4ade80;
  --on-accent: #05200f;
  --danger: #f4968c;
}

/* light: warm off-white, restrained green */
:root[data-theme="light"] {
  --bg: #f8f6f0;
  --surface: #f1eee5;
  --surface-2: #e9e5d9;
  --border: #ddd8ca;
  --border-strong: #c3bdab;
  --text: #18201b;
  --muted: #566259;
  --accent: #166534;
  --accent-text: #166534;
  --on-accent: #f8f6f0;
  --danger: #b3372c;
}
/* no-JS visitors still get their system preference */
@media (prefers-color-scheme: light) {
  :root:not(.js) {
    --bg: #f8f6f0; --surface: #f1eee5; --surface-2: #e9e5d9;
    --border: #ddd8ca; --border-strong: #c3bdab;
    --text: #18201b; --muted: #566259;
    --accent: #166534; --accent-text: #166534; --on-accent: #f8f6f0; --danger: #b3372c;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* gentle theme change, enabled only after first paint */
html.theme-ready body,
html.theme-ready .site-header,
html.theme-ready .term,
html.theme-ready .project,
html.theme-ready .viz,
html.theme-ready input,
html.theme-ready textarea {
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}

.wrap { width: 100%; max-width: 64rem; margin: 0 auto; padding: 0 1.25rem; }

a { color: inherit; text-decoration-color: var(--accent-text); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
a:hover { color: var(--accent-text); }

:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 20; padding: .55rem .9rem; background: var(--accent); color: var(--on-accent); font-weight: 600; border-radius: 3px; }
.skip:focus { top: .75rem; }

/* header */
.site-header { position: sticky; top: 0; z-index: 10; height: var(--header-h); background: var(--bg); border-bottom: 1px solid var(--border); }
.bar { height: 100%; display: flex; align-items: center; gap: 1.5rem; }
.brand { font: 500 .95rem var(--mono); text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.brand span { color: var(--accent-text); }
.brand:hover { color: var(--text); }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.site-nav a { display: block; padding: .4rem .7rem; font-size: .93rem; color: var(--muted); text-decoration: none; border-radius: 3px; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

.tools { display: flex; align-items: center; gap: .5rem; }
.icon-btn { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0; background: transparent; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 4px; cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--muted); }
.icon-btn svg { grid-area: 1 / 1; }
:root[data-theme="dark"] .i-moon, :root[data-theme="light"] .i-sun { display: none; }

.menu-btn { display: none; height: 2.25rem; padding: 0 .8rem; font: 500 .85rem var(--mono); color: var(--text); background: transparent; border: 1px solid var(--border-strong); border-radius: 4px; cursor: pointer; }
.menu-btn:hover { border-color: var(--muted); }

@media (max-width: 47.99rem) {
  .bar { flex-wrap: wrap; row-gap: 0; }
  .tools { margin-left: auto; }
  .js .menu-btn { display: inline-block; }
  .site-header { height: auto; min-height: var(--header-h); position: sticky; }
  .bar { min-height: var(--header-h); }
  .site-nav { order: 3; width: 100%; margin: 0; }
  .site-nav ul { flex-direction: column; padding: .25rem 0 .75rem; }
  .site-nav a { padding: .65rem .25rem; font-size: 1rem; }
  .site-nav a[aria-current="true"] { box-shadow: none; color: var(--accent-text); }
  .js .site-nav { display: none; }
  .js .site-nav.open { display: block; }
}

/* hero */
.hero { display: grid; gap: 2.5rem; padding-top: clamp(2.5rem, 7vh, 4.5rem); padding-bottom: clamp(3rem, 8vh, 5rem); align-items: center; }
@media (min-width: 56rem) { .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 4rem; } }

h1 { margin: 0; font: 600 clamp(2.1rem, 5vw, 3.25rem)/1.08 var(--sans); letter-spacing: -.025em; overflow-wrap: anywhere; }
.role { margin: .9rem 0 0; font-size: 1.15rem; font-weight: 500; color: var(--accent-text); }
.tagline { margin: 1.1rem 0 0; max-width: 34ch; color: var(--muted); font-size: 1.1rem; line-height: 1.55; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.6rem; margin-top: 2rem; }
.btn { display: inline-block; padding: .72rem 1.25rem; font: 600 .98rem var(--sans); color: var(--on-accent); background: var(--accent); border: 0; border-radius: 4px; text-decoration: none; cursor: pointer; transition: filter .15s ease, transform .15s ease; }
.btn:hover { color: var(--on-accent); filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.link { font-weight: 500; }

/* terminal panel */
.term { margin: 0; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; font: 400 .9rem/1.65 var(--mono); }
.term-head { padding: .6rem 1rem; color: var(--muted); font-size: .8rem; border-bottom: 1px solid var(--border); }
.term-body { padding: 1.1rem 1.15rem 1.2rem; }
.term p { margin: 0; max-width: none; }
.cmd + .cmd, .cmd + .end { margin-top: 1rem; }
.in { color: var(--muted); }
.ps { color: var(--accent-text); margin-right: .6ch; }
.out { color: var(--text); overflow-wrap: anywhere; }
.cursor { display: inline-block; width: .62ch; height: 1.1em; vertical-align: text-bottom; background: var(--accent); }

/* sections */
.section { border-top: 1px solid var(--border); padding: 3.25rem 0; }
.sec { display: grid; gap: 1.5rem 3rem; }
@media (min-width: 56rem) {
  .sec { grid-template-columns: 11rem minmax(0, 1fr); }
  .label { position: sticky; top: calc(var(--header-h) + 1.5rem); align-self: start; }
}
.label { margin: 0; font: 500 .78rem/1.2 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--accent-text); }
.label .num { color: var(--muted); margin-right: .5ch; }

.content p { margin: 0 0 1.1rem; max-width: 62ch; }
.content > p:last-child { margin-bottom: 0; }
.lead { font-size: 1.3rem; line-height: 1.55; letter-spacing: -.005em; }
.intro { color: var(--muted); }

/* expertise */
.groups { display: grid; gap: 0 2.5rem; align-content: start; }
@media (min-width: 40rem) { .groups { grid-template-columns: 1fr 1fr; } .group.wide { grid-column: 1 / -1; } }
.group { padding: 1rem 0 1.25rem; border-top: 1px solid var(--border); }
.group:first-child, .group:nth-child(2) { border-top: 0; padding-top: 0; }
@media (max-width: 39.99rem) { .group:nth-child(2) { border-top: 1px solid var(--border); padding-top: 1rem; } }
.group h3 { margin: 0 0 .5rem; font: 600 1rem/1.3 var(--sans); }
.items { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; color: var(--muted); font-size: .98rem; line-height: 1.6; }
.items li { white-space: nowrap; }

/* projects */
.project { display: grid; margin-top: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; transition: border-color .2s ease; }
.project:hover, .project:focus-within { border-color: var(--accent-text); }
@media (min-width: 40rem) { .project { grid-template-columns: 15rem minmax(0, 1fr); } }
.pbody { padding: 1.25rem 1.4rem 1.4rem; display: flex; flex-direction: column; gap: .5rem; }
.pbody h3 { margin: 0; font: 600 1.2rem/1.3 var(--sans); letter-spacing: -.01em; }
.pbody p { margin: 0; max-width: none; color: var(--muted); font-size: 1rem; }
.pbody .pmeta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; color: var(--muted); font: 400 .78rem/1.4 var(--mono); }
.status { color: var(--accent-text); }
.status::before { content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .6ch; border: 1.5px solid var(--accent-text); border-radius: 1px; }

.viz { position: relative; display: grid; place-items: center; min-height: 11rem; padding: 1.5rem 1.25rem 2.25rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
@media (min-width: 40rem) { .viz { border-bottom: 0; border-right: 1px solid var(--border); } }
.viz-cap { position: absolute; left: .9rem; bottom: .6rem; font: 400 .68rem var(--mono); color: var(--muted); }
.sketch { width: 100%; max-width: 12.5rem; }
.line { display: block; height: 6px; background: var(--border-strong); border-radius: 3px; }
.w-35 { width: 35%; } .w-45 { width: 45%; } .w-60 { width: 60%; } .w-70 { width: 70%; } .w-80 { width: 80%; } .w-90 { width: 90%; }

/* sketch 1: prioritized task list */
.v-tasks .row { display: flex; align-items: center; gap: .65rem; padding: .5rem 0; }
.v-tasks .box { flex: none; width: .85rem; height: .85rem; border: 1.5px solid var(--muted); border-radius: 2px; }
.v-tasks .hot .box { background: var(--accent); border-color: var(--accent); }
.v-tasks .hot .line { background: var(--accent-text); opacity: .85; }
.v-tasks .dim { opacity: .5; }

/* sketch 2: semantic search */
.v-search .field { display: flex; align-items: center; gap: .3rem; padding: .5rem .65rem; font: 400 .72rem var(--mono); color: var(--muted); border: 1px solid var(--border-strong); border-radius: 4px; }
.v-search .caret { width: 1px; height: .95em; background: var(--accent-text); }
.v-search .chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .7rem 0 .9rem; }
.v-search .chips span { padding: .05rem .45rem; font: 400 .66rem var(--mono); color: var(--muted); border: 1px solid var(--border-strong); border-radius: 2px; }
.v-search .chips span:first-child { color: var(--accent-text); border-color: var(--accent-text); }
.v-search .res { display: grid; gap: .6rem; }

/* sketch 3: budget tracks */
.v-budget .track { height: 6px; margin: .85rem 0; background: var(--border-strong); border-radius: 3px; }
.v-budget .fill { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.v-budget .goal { height: 1.1rem; width: 72%; margin-top: 1.3rem; border: 1px dashed var(--muted); border-radius: 3px; }

/* experience */
.exp-title { margin: 0 0 .6rem; font: 600 1.3rem/1.3 var(--sans); letter-spacing: -.01em; }
.focus { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0 2rem; max-width: 40rem; }
@media (min-width: 40rem) { .focus { grid-template-columns: 1fr 1fr; } }
.focus li { padding: .65rem 0; border-top: 1px solid var(--border); color: var(--muted); }

/* contact form */
form { display: grid; gap: 1.25rem; max-width: 34rem; margin-top: 1.75rem; }
.field { display: grid; gap: .4rem; }
label { font-weight: 500; font-size: .97rem; }
.hint { display: block; color: var(--muted); font-weight: 400; font-size: .87rem; }
input, textarea { width: 100%; padding: .7rem .8rem; font: 400 1rem var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px; }
textarea { min-height: 9rem; resize: vertical; }
input:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; border-color: var(--accent-text); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
#form-status { margin: 0; min-height: 1.7em; font-size: .95rem; }
#form-status.ok { color: var(--accent-text); }
#form-status.err { color: var(--danger); }
.fine { margin: 0; color: var(--muted); font-size: .88rem; max-width: none; }

/* footer */
.site-footer { border-top: 1px solid var(--border); padding: 1.75rem 0 2.5rem; color: var(--muted); font-size: .9rem; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; }
.foot p { margin: 0; }
.foot-links { display: flex; gap: 1.4rem; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; text-decoration-color: var(--accent-text); }

/* motion: one staged reveal in the terminal, a blinking cursor, nothing else */
@media (prefers-reduced-motion: no-preference) {
  /* content is visible by default; the animation only fades it in (backwards fill) */
  .term .cmd, .term .end { animation: show .25s ease-out backwards; }
  .term .cmd:nth-child(1) { animation-delay: .25s; }
  .term .cmd:nth-child(2) { animation-delay: .75s; }
  .term .cmd:nth-child(3) { animation-delay: 1.25s; }
  .term .end { animation-delay: 1.8s; }
  .cursor { animation: blink 1.1s steps(1) infinite 1.8s; }
}
@keyframes show { from { opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }

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