:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #526077;
  --line: #e3e8ef;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0fe;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --bg-alt: #0f172a;
    --surface: #111a2e;
    --text: #e6ebf3;
    --muted: #9aa8bd;
    --line: #1f2b42;
    --accent: #60a5fa;
    --accent-ink: #0b1120;
    --accent-soft: #15233d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 800; font-size: 20px; color: var(--text); letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }
.nav nav { display: flex; gap: 22px; align-items: center; }
.nav nav a { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav nav a:hover { color: var(--text); text-decoration: none; }
.nav nav a.nav-cta { color: var(--accent); }

/* Hero */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 14px; font-weight: 500; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px color-mix(in srgb, #22c55e 20%, transparent); }
.hero h1 { font-size: clamp(40px, 6vw, 64px); font-weight: 800; letter-spacing: -.03em; }
.role { margin: 8px 0 0; font-size: clamp(17px, 2.2vw, 21px); font-weight: 600; color: var(--accent); }
.lede { margin: 18px 0 0; max-width: 58ch; font-size: 18px; color: var(--muted); }

.portrait {
  width: 220px; height: 220px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  border: 4px solid var(--surface); box-shadow: var(--shadow), 0 0 0 1px var(--line);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cta-row.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 20px; border-radius: 10px;
  font-weight: 600; font-size: 15px; transition: transform .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); background: var(--surface); }

.stats {
  list-style: none; margin: 56px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.stats li { padding: 22px 20px; border-left: 1px solid var(--line); }
.stats li:first-child { border-left: 0; }
.stats strong { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.stats span { font-size: 14px; color: var(--muted); }

/* Sections */
.section { padding: 80px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 28px; }
.two-col { display: grid; grid-template-columns: 200px 1fr; gap: 32px; }
.two-col .section-title { margin-bottom: 0; padding-top: 4px; }
.prose p { margin: 0 0 16px; font-size: 17px; max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 26px 32px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.timeline li:first-child::before { background: var(--accent); }
.t-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.t-head h3 { font-size: 17px; }
.t-date { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-org { margin: 2px 0 0; color: var(--muted); font-size: 15px; }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.project { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; }
.p-org { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.project h3 { font-size: 19px; margin-bottom: 12px; }
.project ul { margin: 0 0 16px; padding-left: 18px; color: var(--muted); font-size: 15px; }
.project li { margin-bottom: 6px; }
.tags { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.footnote { margin: 20px 0 0; color: var(--muted); font-size: 14px; }

.edu-title { font-size: 18px; }

/* Contact */
.contact { text-align: center; }
.contact-inner { max-width: 640px; }
.contact h2 { font-size: clamp(30px, 4.5vw, 42px); font-weight: 800; letter-spacing: -.02em; }
.contact p { color: var(--muted); font-size: 17px; margin: 14px 0 0; }

.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 14px; text-align: center; }

/* Responsive */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .projects { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats li:nth-child(3) { border-left: 0; }
  .stats li:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 40px 0 24px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .portrait { order: -1; width: 128px; height: 128px; }
  .lede { font-size: 17px; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .two-col .section-title { margin-bottom: 24px; }
  .section { padding: 56px 0; }
  .cards { grid-template-columns: 1fr; }
  .nav nav { gap: 14px; }
  .nav nav a:not(.nav-cta) { display: none; }
  .stats strong { font-size: 24px; }
}
