/* ---- Theme tokens ---- */
:root {
  --bg: #f7f9f8;
  --bg-elev: #ffffff;
  --text: #16211e;
  --text-muted: #55635f;
  --text-faint: #859390;
  --border: #e0e7e4;
  --accent: #0f6b60;
  --accent-soft: #dcefeb;
  --ring: rgba(15, 107, 96, 0.35);
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.05);
  --max: 800px;
}

:root[data-theme="dark"] {
  --bg: #0d1412;
  --bg-elev: #151d1b;
  --text: #eef3f1;
  --text-muted: #a6b2ae;
  --text-faint: #6e7b77;
  --border: #263230;
  --accent: #4ec9b8;
  --accent-soft: #16302b;
  --ring: rgba(78, 201, 184, 0.35);
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1412;
    --bg-elev: #151d1b;
    --text: #eef3f1;
    --text-muted: #a6b2ae;
    --text-faint: #6e7b77;
    --border: #263230;
    --accent: #4ec9b8;
    --accent-soft: #16302b;
    --ring: rgba(78, 201, 184, 0.35);
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav__brand {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.15rem;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.nav__links {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  margin-left: auto;
  font-size: 0.92rem;
}
.nav__links a {
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.nav__links a:hover { color: var(--accent); }
.nav__links a[aria-current="page"] { color: var(--accent); }

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: border-color 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle__icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset -4px -4px 0 0 var(--bg-elev);
  transition: all 0.3s ease;
}
:root[data-theme="dark"] .theme-toggle__icon,
:root:not([data-theme="light"]) .theme-toggle__icon {
  box-shadow: none;
  transform: scale(0.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__icon { box-shadow: none; transform: scale(0.6); }
}
:root[data-theme="light"] .theme-toggle__icon {
  box-shadow: inset -4px -4px 0 0 var(--bg-elev);
  transform: none;
}

@media (max-width: 620px) {
  .nav__links { display: none; }
}

/* ---- Layout ---- */
main { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}
.section__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 28px;
}
.section__num {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.section__title {
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: 1.7rem;
  margin: 0;
  letter-spacing: -0.01em;
}
.section__lede {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0 0 28px;
}

/* ---- Hero ---- */
.hero {
  padding: 96px 0 72px;
  border: none;
}
.hero__inner { animation: rise 0.7s ease both; }
.hero__avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-elev);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  display: block;
}
.hero__eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}
.hero__name {
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: clamp(2.4rem, 7vw, 3.9rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.hero__degree { color: var(--text-faint); font-weight: 400; }
.hero__role {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0 0 26px;
}
.hero__lede {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 58ch;
  margin: 0 0 34px;
}
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__loc {
  margin: 26px 0 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--text-faint);
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn--ghost { border: 1px solid var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Prose ---- */
.prose p { margin: 0 0 16px; color: var(--text-muted); max-width: 64ch; }
.prose p:last-child { margin-bottom: 0; }

/* ---- Service cards ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card__title {
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: 1.14rem;
  margin: 0 0 8px;
}
.card__desc { color: var(--text-muted); font-size: 0.92rem; margin: 0; }

/* ---- Projects ---- */
.projects { list-style: none; margin: 0; padding: 0; }
.project {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.project:hover { transform: translateY(-2px); border-color: var(--accent); }
.project__head { margin-bottom: 10px; }
.project__title {
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: 1.28rem;
  line-height: 1.25;
  margin: 0 0 6px;
}
.project__client {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--accent);
}
.project__role {
  font-size: 0.86rem;
  color: var(--text-faint);
  margin: 0 0 12px;
}
.project__desc { color: var(--text-muted); margin: 0 0 16px; font-size: 0.98rem; }

/* ---- Tags ---- */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; }
.tags li {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.tags--wide li { font-size: 0.8rem; padding: 6px 13px; }

/* ---- Timeline ---- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}
.timeline__item:first-child { border-top: none; padding-top: 0; }
.timeline__date {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--text-faint);
}
.timeline__role {
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: 1.2rem;
  margin: 0 0 4px;
}
.timeline__org { color: var(--accent); font-size: 0.92rem; margin: 0 0 8px; }
.timeline__desc { color: var(--text-muted); margin: 0; font-size: 0.98rem; }

@media (max-width: 560px) {
  .timeline__item { grid-template-columns: 1fr; gap: 6px; }
}

/* ---- Expertise ---- */
.expertise {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px 40px;
}
.skills__label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin: 0 0 14px;
}
.skills-list { list-style: none; margin: 0; padding: 0; }
.skills-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}
.skills-list li:first-child { border-top: none; }
.skills-list__level { color: var(--text-faint); font-size: 0.88rem; }

.edu { list-style: none; margin: 0; padding: 0; }
.edu li { padding: 10px 0; border-top: 1px solid var(--border); }
.edu li:first-child { border-top: none; padding-top: 0; }
.edu__degree { display: block; font-weight: 500; font-size: 0.98rem; }
.edu__school {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- Publications ---- */
.pubs { list-style: none; margin: 0 0 20px; padding: 0; }
.pub { padding: 16px 0; border-top: 1px solid var(--border); }
.pub:first-child { border-top: none; padding-top: 0; }
.pub__title { margin: 0 0 4px; font-weight: 500; }
.pub__note { color: var(--text-faint); font-weight: 400; font-size: 0.85rem; }
.pub__meta { margin: 0; font-size: 0.88rem; color: var(--text-muted); }
.pubs__note { font-size: 0.92rem; color: var(--text-faint); margin: 0; }

/* ---- Contact ---- */
.section--contact { padding-bottom: 40px; }
.contact__lede { font-size: 1.15rem; color: var(--text-muted); margin: 0 0 28px; max-width: 62ch; }
.contact__links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.contact__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  background: var(--bg-elev);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.contact__link:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact__label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.contact__value { font-weight: 500; }

/* ---- Footer ---- */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 24px 48px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.85rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
