/* ============ TOKENS ============ */
:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #17181b;
  --muted: #5d6068;
  --line: #e4e4de;
  --accent: #2f5bea;
  --accent-soft: #e6ecfd;
  --accent-text: #ffffff;
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 8px 24px rgba(20, 20, 30, .06);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 14px;
  --max: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111214;
    --surface: #18191c;
    --text: #ececec;
    --muted: #9a9ca3;
    --line: #2a2c31;
    --accent: #7c9bff;
    --accent-soft: #1d2540;
    --accent-text: #0d1020;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111214;
  --surface: #18191c;
  --text: #ececec;
  --muted: #9a9ca3;
  --line: #2a2c31;
  --accent: #7c9bff;
  --accent-soft: #1d2540;
  --accent-text: #0d1020;
  --shadow: none;
  color-scheme: dark;
}

/* ============ BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 8px; }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon--fill { fill: currentColor; stroke: none; }

/* ============ HEADER ============ */
.header {
  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 transparent;
  transition: border-color .2s;
}
.header.is-scrolled { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.nav__logo { font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; }
.nav__logo span { color: var(--accent); }
.nav__list { display: flex; gap: 24px; }
.nav__link { font-size: .92rem; color: var(--muted); transition: color .15s; }
.nav__link:hover, .nav__link.is-active { color: var(--text); }
.nav__actions { display: flex; gap: 4px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--accent-soft); }
.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; }
}
.nav__toggle { display: none; }

@media (max-width: 760px) {
  .nav__toggle { display: grid; }
  .nav__list {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px;
    display: none;
  }
  .nav__list.is-open { display: flex; }
  .nav__link { display: block; padding: 12px 0; font-size: 1rem; }
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px;
  font-weight: 500; font-size: .95rem;
  border: 1px solid transparent;
  transition: transform .15s, background-color .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--accent-text); }
.btn--ghost { border-color: var(--line); background: var(--surface); }
.btn--ghost:hover { border-color: var(--accent); }

/* ============ HERO ============ */
.hero {
  display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; gap: 48px;
  padding-top: 72px; padding-bottom: 56px;
}
.eyebrow {
  font-family: var(--mono); font-size: .8rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px;
}
.hero__title { font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 700; letter-spacing: -.035em; margin-bottom: 20px; }
.hero__lead { color: var(--muted); font-size: 1.08rem; max-width: 56ch; margin-bottom: 28px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 28px; color: var(--muted); font-size: .9rem; }
.hero__meta li, .hero__meta a { display: inline-flex; align-items: center; gap: 6px; }
.hero__meta a:hover { color: var(--accent); }
.hero__photo {
  justify-self: center; width: min(100%, 340px); aspect-ratio: 1;
  border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, var(--accent-soft), color-mix(in srgb, var(--accent) 35%, var(--accent-soft)));
  box-shadow: var(--shadow);
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transform: translateX(6%); }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; }
  .hero__photo { order: -1; width: 128px; justify-self: start; }
}

/* ============ STATS ============ */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.stats li { padding: 22px; border-left: 1px solid var(--line); }
.stats li:first-child { border-left: 0; }
.stats strong { display: block; font-size: 1.6rem; letter-spacing: -.02em; }
.stats span { color: var(--muted); font-size: .85rem; line-height: 1.45; display: block; margin-top: 4px; }
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats li:nth-child(3) { border-left: 0; }
  .stats li:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ============ SECTIONS ============ */
.section { padding-top: 88px; }
.section__title {
  display: flex; align-items: baseline; gap: 14px;
  font-size: 1.75rem; letter-spacing: -.02em; margin-bottom: 32px;
}
.section__num { font-family: var(--mono); font-size: .85rem; color: var(--accent); font-weight: 500; }
.section__intro { color: var(--muted); margin: -16px 0 28px; }
.subhead { font-size: 1rem; margin: 40px 0 14px; }

/* ============ EXPERIENCE ============ */
.role {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.role__head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.role__title { font-size: 1.15rem; }
.role__org { color: var(--muted); font-size: .95rem; }
.role__date, .card__date, .edu__date { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.role__list, .card__list { display: grid; gap: 10px; }
.role__list li, .card__list li { position: relative; padding-left: 18px; color: var(--muted); }
.role__list li::before, .card__list li::before {
  content: ""; position: absolute; left: 0; top: .7em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.role .tags { margin-top: 20px; }

/* ============ TAGS ============ */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: .82rem; padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--text);
}

/* ============ TEACHING CARDS ============ */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; transition: border-color .15s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.card__title { font-size: 1.05rem; margin-top: 6px; }
.card__role { color: var(--accent); font-size: .88rem; margin: 2px 0 14px; }
.card__list { font-size: .93rem; gap: 8px; }
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }

/* ============ EDUCATION ============ */
.edu { display: grid; gap: 0; border-left: 2px solid var(--line); margin-left: 6px; }
.edu__item { position: relative; padding: 0 0 32px 28px; }
.edu__item:last-child { padding-bottom: 0; }
.edu__item::before {
  content: ""; position: absolute; left: -8px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.edu__title { font-size: 1.08rem; margin: 4px 0 2px; }
.edu__org { color: var(--text); font-size: .95rem; }
.edu__note { color: var(--muted); font-size: .9rem; }

/* ============ SKILLS ============ */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 40px; }
.skills__group h3 { font-size: .85rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
@media (max-width: 760px) { .skills { grid-template-columns: 1fr; } }

.certs { border-top: 1px solid var(--line); }
.certs li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .95rem;
}
.certs__year { font-family: var(--mono); font-size: .8rem; color: var(--muted); flex-shrink: 0; }

/* ============ BEYOND WORK ============ */
.life { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.life__item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.life__icon {
  width: 36px; height: 36px; padding: 8px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  margin-bottom: 14px;
}
.life__item h3 { font-size: 1rem; margin-bottom: 6px; }
.life__item p { color: var(--muted); font-size: .92rem; }
@media (max-width: 900px) { .life { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .life { grid-template-columns: 1fr; } }

/* ============ CONTACT ============ */
.contact__lead { color: var(--muted); max-width: 52ch; margin-bottom: 16px; }
.contact__email {
  display: inline-block; font-size: clamp(1.4rem, 4.5vw, 2.4rem); font-weight: 600;
  letter-spacing: -.02em; margin-bottom: 28px; word-break: break-all;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
  transition: background-size .25s;
}
.contact__email:hover { background-size: 100% 2px; }

/* ============ FOOTER ============ */
.footer {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 96px; padding-top: 24px; padding-bottom: 32px;
  color: var(--muted); font-size: .88rem; position: relative;
}
.footer::before { content: ""; position: absolute; top: 0; left: 20px; right: 20px; border-top: 1px solid var(--line); }
.footer__top:hover { color: var(--accent); }

/* ============ MOTION ============ */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .btn:hover { transform: none; }
}

@media (max-width: 480px) {
  .role, .card { padding: 20px; }
}
