/* ---------- Theme tokens ---------- */
:root {
  --bg: #fcfcfb;
  --surface: #ffffff;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --faint: #e8e8e6;
  --accent: #2b59c3;          /* accent: muted blue */
  --accent-soft: rgba(43, 89, 195, 0.08);
  --btn-bg: #2b59c3;
  --placeholder: #b45309;
  --placeholder-bg: rgba(245, 158, 11, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113;
    --surface: #18181b;
    --text: #ececee;
    --muted: #9a9aa2;
    --faint: #2a2a2f;
    --accent: #9bb3e6;
    --accent-soft: rgba(155, 179, 230, 0.10);
    --btn-bg: #3a5bb0;
    --placeholder: #fbbf24;
    --placeholder-bg: rgba(251, 191, 36, 0.12);
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #111113;
  --surface: #18181b;
  --text: #ececee;
  --muted: #9a9aa2;
  --faint: #2a2a2f;
  --accent: #9bb3e6;
  --accent-soft: rgba(155, 179, 230, 0.10);
  --btn-bg: #3a5bb0;
  --placeholder: #fbbf24;
  --placeholder-bg: rgba(251, 191, 36, 0.12);
  --shadow: none;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

strong { font-weight: 600; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--faint);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); text-decoration: none; }

.theme-toggle {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--faint); border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--muted); }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: 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; }
}

/* ---------- Intro ---------- */
.intro { padding: 64px 0 24px; }
.intro-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.intro-head .tagline { margin-bottom: 0; }
.headshot {
  flex: none; width: 128px; height: 128px; border-radius: 50%;
  object-fit: cover; border: 1px solid var(--faint);
}
h1 { font-size: 2.25rem; line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 6px; font-weight: 600; }
.tagline { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; color: var(--muted); margin: 0 0 24px; }
.intro p { margin: 0 0 14px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--faint); background: var(--surface);
  color: var(--text); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--btn-bg); border-color: var(--btn-bg); color: #fff; }
.btn-primary:hover { border-color: var(--btn-bg); filter: brightness(1.1); }

/* ---------- Sections ---------- */
section { padding: 32px 0; border-top: 1px solid var(--faint); }
.intro { border-top: none; }
h2 {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); margin: 0 0 20px;
}
h3 { font-size: 1rem; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.role { font-weight: 400; color: var(--muted); }
.date { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* Items (experience / research / education) */
.item { margin-bottom: 24px; }
.item:last-child { margin-bottom: 0; }
.item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.item-sub { color: var(--muted); font-size: 14px; margin: 2px 0 8px; }
.item-desc { margin: 0; font-size: 15px; }
.item ul, .plain { margin: 0; padding-left: 18px; }
.item li, .plain li { margin: 3px 0; font-size: 15px; }
.item li::marker, .plain li::marker { color: var(--muted); }

/* Workshop paper (inside a research item) */
.paper {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--faint); border-radius: 10px; background: var(--surface);
}
.paper p { margin: 0; }
.pub-title { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.pub-venue {
  align-self: start; justify-self: start;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11.5px; font-weight: 500;
  color: var(--accent); background: var(--accent-soft);
  padding: 3px 8px; border-radius: 6px; white-space: nowrap;
}
.pub-authors, .pub-meta { margin: 0; font-size: 14px; color: var(--muted); }
.pub-authors strong { color: var(--text); }
.pub-meta { font-style: italic; }
.pub-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11.5px;
  padding: 2px 8px; border: 1px solid var(--faint); border-radius: 6px; color: var(--muted);
}
a.tag:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.tag-muted { background: var(--faint); border-color: transparent; }

/* Placeholders: delete the class (or the element) once filled in */
/* Placeholders render like real content; search "placeholder" in index.html to find what to fill in.
   To highlight them again in amber, change the rule below to:
   .placeholder { color: var(--placeholder); background: var(--placeholder-bg); border-radius: 4px; padding: 0 4px; } */
.placeholder { color: inherit; }

/* Footer */
.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding-top: 24px; padding-bottom: 48px; border-top: 1px solid var(--faint);
  font-size: 13px; color: var(--muted);
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .nav a { display: none; }
  .intro { padding-top: 40px; }
  h1 { font-size: 1.85rem; }
  .intro-head { flex-direction: column-reverse; align-items: flex-start; gap: 20px; }
  .headshot { width: 96px; height: 96px; }
    .item-head { flex-direction: column; gap: 0; }
  .paper { flex-direction: column; gap: 8px; }
}

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

#teaching .item-head { margin-bottom: 4px; }
#teaching .item-desc { color: var(--muted); }

.coursework { margin-top: 20px; color: var(--muted); }
.coursework .label { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.tagline span { white-space: nowrap; }
