:root {
  --bg: #fafaf9;
  --surface: #f3f3f1;
  --text: #18181b;
  --muted: #5b5b64;
  --border: #e4e4e0;
  --accent: #2a55c4;
  --accent-ink: #ffffff;
  --font: Inter, Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0c0c0e;
  --surface: #151518;
  --text: #ececef;
  --muted: #a1a1aa;
  --border: #26262b;
  --accent: #8fabff;
  --accent-ink: #0c0c0e;
  color-scheme: dark;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-color: var(--border); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; gap: 16px; height: 56px; max-width: 920px; }
.wordmark { font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.wordmark:hover { color: var(--text); }
#site-nav { margin-left: auto; }
#site-nav ul { display: flex; gap: 22px; }
#site-nav a { font-size: 14px; color: var(--muted); text-decoration: none; }
#site-nav a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; transition: background .15s; }
.icon-btn:hover { background: var(--surface); }
.icon-btn.menu-btn { display: none; }
.sun { display: none; }
:root[data-theme="dark"] .sun { display: block; }
:root[data-theme="dark"] .moon { display: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; font-weight: 500; text-decoration: none; color: var(--text); background: transparent; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface); border-color: var(--muted); color: var(--text); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.08); border-color: var(--accent); }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; }

/* Hero */
.hero { padding-top: 72px; padding-bottom: 24px; }
.eyebrow { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
h1 { font-size: clamp(30px, 5.2vw, 44px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 650; max-width: 18em; }
.lead { margin-top: 20px; font-size: 18px; color: var(--muted); max-width: 36em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.social { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 24px; font-size: 15px; }
.social a { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; }
.ic-fill { fill: currentColor; stroke: none; }
.social a { text-decoration: none; }
.social a span, .social a { line-height: 1.2; }
.stack-line { margin-top: 20px; font-size: 13px; color: var(--muted); font-family: var(--mono); line-height: 1.8; }

.highlights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 48px 0 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.highlights > div { padding: 18px 16px 18px 0; }
.highlights > div + div { padding-left: 16px; border-left: 1px solid var(--border); }
.highlights dt { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.highlights dd { font-size: 13px; line-height: 1.45; color: var(--muted); margin-top: 6px; }
.highlights dd span { display: block; margin-top: 6px; font-size: 12px; color: var(--accent); font-weight: 500; }

/* Sections */
.section { padding-top: 72px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; color: var(--muted); margin-bottom: 24px; }
.section-sub { margin: -12px 0 28px; color: var(--muted); font-size: 15px; }
h3 { font-size: 19px; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; }
.meta { font-size: 14px; color: var(--muted); }

/* Projects */
.project { padding: 28px 0; border-top: 1px solid var(--border); }
.project:last-child { border-bottom: 1px solid var(--border); }
.project header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; margin-bottom: 10px; }
.project > p { color: var(--muted); max-width: 38em; }
.outcomes { margin-top: 18px; display: grid; gap: 6px; font-size: 15px; }
.outcomes li { padding-left: 16px; position: relative; }
.outcomes li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 6px; height: 1px; background: var(--accent); }
.outcomes strong { font-weight: 650; }
details { margin-top: 18px; }
summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--accent); list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; font-family: var(--mono); width: 12px; }
details[open] summary::before { content: "−"; }
.details { margin-top: 10px; padding-left: 18px; border-left: 1px solid var(--border); font-size: 15px; }
.details dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.details li { margin-bottom: 8px; color: var(--muted); }
.details li strong { color: var(--text); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.tags li { font-size: 12.5px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); }

/* Timeline */
.timeline > li { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 24px 0; border-top: 1px solid var(--border); }
.timeline > li:last-child { border-bottom: 1px solid var(--border); }
.when { font-size: 14px; color: var(--muted); padding-top: 3px; }
.timeline ul { margin-top: 12px; display: grid; gap: 8px; font-size: 15px; color: var(--muted); }
.timeline ul li { padding-left: 16px; position: relative; }
.timeline ul li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 6px; height: 1px; background: var(--muted); }

/* Skills */
.skills > div { display: grid; grid-template-columns: 220px 1fr; gap: 20px; padding: 14px 0; border-top: 1px solid var(--border); }
.skills > div:last-child { border-bottom: 1px solid var(--border); }
.skills dt { font-weight: 600; font-size: 15px; }
.skills dd { color: var(--muted); font-size: 15px; }

/* About / contact */
.prose { display: grid; gap: 14px; max-width: 38em; }
.contact .lead { margin-top: 0; font-size: 17px; }

.footer { display: flex; justify-content: space-between; margin-top: 96px; padding-top: 20px; padding-bottom: 40px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* Contact form */
.form { display: grid; gap: 16px; max-width: 560px; margin-top: 24px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.form input[type="text"], .form input[type="email"], .form textarea { font: inherit; font-weight: 400; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; min-height: 44px; width: 100%; transition: border-color .15s; }
.form textarea { resize: vertical; min-height: 120px; }
.form input:hover, .form textarea:hover { border-color: var(--muted); }
.form input:focus-visible, .form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.form-foot button { cursor: pointer; font-family: inherit; }
.form-foot button[disabled] { opacity: .6; cursor: default; }
#form-status { font-size: 14px; color: var(--muted); }
#form-status.err { color: #c0392b; }
:root[data-theme="dark"] #form-status.err { color: #ff8a80; }
.hp { position: absolute; left: -9999px; }
.contact .cta { margin-top: 32px; }

/* Responsive */
@media (max-width: 720px) {
  .icon-btn.menu-btn { display: inline-flex; }
  #site-nav { display: none; position: absolute; top: 56px; left: 0; right: 0; margin: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 20px 16px; }
  #site-nav.open { display: block; }
  #site-nav ul { flex-direction: column; gap: 0; }
  #site-nav a { display: block; padding: 12px 0; font-size: 16px; }
  .nav-actions { margin-left: auto; }
  .hero { padding-top: 48px; }
  .lead { font-size: 17px; }
  .btn { flex: 1 1 auto; justify-content: center; }
  .btn-sm { flex: none; }
  .highlights { grid-template-columns: 1fr 1fr; }
  .highlights > div { padding: 16px 12px 16px 0; }
  .highlights > div + div { padding-left: 0; border-left: 0; }
  .highlights > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--border); }
  .highlights > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .form .row { grid-template-columns: 1fr; }
  .timeline > li, .skills > div { grid-template-columns: 1fr; gap: 4px; }
  .section { padding-top: 56px; }
}

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