:root {
  --bg: #f8fafc; --surface: #ffffff; --text: #0f172a; --muted: #475569;
  --border: #e2e8f0; --accent: #0369a1; --accent-strong: #075985; --accent-soft: #e0f2fe;
  --radius: 14px; --maxw: 960px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --surface: #111a2e; --text: #e2e8f0; --muted: #94a3b8;
    --border: #1e293b; --accent: #38bdf8; --accent-strong: #7dd3fc; --accent-soft: #0c2a43;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1120; --surface: #111a2e; --text: #e2e8f0; --muted: #94a3b8;
  --border: #1e293b; --accent: #38bdf8; --accent-strong: #7dd3fc; --accent-soft: #0c2a43;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.65; color: var(--text); background: var(--bg); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); font-weight: 400; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(150%) blur(10px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.nav-links { display: flex; gap: 22px; list-style: none; margin: 0 0 0 auto; padding: 0; font-size: 15px; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--text); }
.theme-toggle { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; } :root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .icon-sun { display: none; } :root:not([data-theme="light"]) .icon-moon { display: block; } }

/* Hero */
.hero { padding-top: 96px; padding-bottom: 72px; }
.eyebrow { font-family: var(--mono); color: var(--accent); margin: 0 0 8px; font-size: 15px; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.2rem); letter-spacing: -0.03em; }
.role { font-size: clamp(1.15rem, 2.6vw, 1.45rem); margin: 12px 0 0; color: var(--muted); }
.role strong { color: var(--text); }
.lede { font-size: 1.15rem; max-width: 40ch; margin: 18px 0 0; }
.meta { color: var(--muted); margin: 12px 0 0; font-size: 15px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; transition: transform .15s, border-color .15s; }
.btn:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.primary:hover { background: var(--accent-strong); color: var(--bg); }

/* Sections */
.section { padding-top: 56px; padding-bottom: 24px; scroll-margin-top: 64px; }
.section h2 { font-size: 1.6rem; margin-bottom: 24px; display: flex; align-items: center; gap: 14px; }
.section h2::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.prose p { margin: 0 0 14px; max-width: 68ch; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 2px solid var(--border); }
.tl-item { position: relative; padding: 0 0 32px 10px; }
.tl-item::before { content: ""; position: absolute; left: -31px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; }
.tl-item h3 { font-size: 1.1rem; }
.org { color: var(--accent); }
.dates { margin: 0; font-family: var(--mono); font-size: 14px; color: var(--muted); white-space: nowrap; }
.tl-item ul { margin: 10px 0 0; padding-left: 20px; }
.tl-item li { margin-bottom: 6px; }
.tl-item li::marker { color: var(--muted); }

/* Skills */
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.skill-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.skill-group h3 { font-size: 0.95rem; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chips li { background: var(--accent-soft); color: var(--text); padding: 4px 12px; border-radius: 999px; font-size: 14px; }

/* Projects */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.card h3 a { text-decoration: none; }
.card p { margin: 0 0 10px; font-size: 15.5px; }
.tags { font-family: var(--mono); font-size: 13px !important; color: var(--muted); margin: 0 !important; }
.more { margin-top: 18px; }

/* Education */
.edu { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.edu h3 { font-size: 1.1rem; }
.edu p { margin: 6px 0 0; }

/* Contact */
.contact { padding-bottom: 64px; }
.links { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 18px 0 0; }

.site-footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: 14px; }
.site-footer p { margin: 0; }
.notfound { padding: 120px 24px; text-align: center; }
.notfound h1 { font-size: 4rem; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .theme-toggle { margin-left: auto; }
  .hero { padding-top: 56px; padding-bottom: 40px; }
  .section { padding-top: 40px; }
  body { font-size: 16px; }
  .dates { white-space: normal; }
}
