:root {
  --bg: #f7f6fb;
  --surface: #ffffff;
  --surface-2: #f0edf7;
  --text: #1c1a24;
  --muted: #5d5970;
  --line: #e2deec;
  --accent: #4b2a82;
  --accent-soft: #ece6f7;
  --accent-text: #ffffff;
  --now: #1f7a4d;
  --now-soft: #e3f4ea;
  --shadow: 0 1px 2px rgb(28 26 36 / .06), 0 8px 24px rgb(28 26 36 / .06);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121118;
    --surface: #1b1a23;
    --surface-2: #22202c;
    --text: #ecebf2;
    --muted: #a6a2b8;
    --line: #2f2c3b;
    --accent: #b9a1f0;
    --accent-soft: #2c2440;
    --accent-text: #170f29;
    --now: #6fd3a0;
    --now-soft: #173327;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121118;
  --surface: #1b1a23;
  --surface-2: #22202c;
  --text: #ecebf2;
  --muted: #a6a2b8;
  --line: #2f2c3b;
  --accent: #b9a1f0;
  --accent-soft: #2c2440;
  --accent-text: #170f29;
  --now: #6fd3a0;
  --now-soft: #173327;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

.ms {
  font-family: "Material Symbols Rounded";
  font-weight: normal; font-style: normal;
  font-size: 1.25em; line-height: 1;
  display: inline-block; vertical-align: -0.22em;
  white-space: nowrap; letter-spacing: normal; text-transform: none;
  -webkit-font-feature-settings: "liga"; font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  user-select: none;
}

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

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand img { border-radius: 50%; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }

/* Hero */
.hero { padding: 72px 0 56px; }
.eyebrow { color: var(--muted); font-size: 14px; font-weight: 500; margin: 0 0 12px; }
.hero h1 { font-size: clamp(40px, 7vw, 64px); font-weight: 800; letter-spacing: -0.02em; }
.hero__role { font-size: clamp(18px, 2.6vw, 22px); font-weight: 600; color: var(--accent); margin: 10px 0 20px; }
.hero__lead { max-width: 68ch; color: var(--muted); font-size: 17px; margin: 0 0 28px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 15px; text-decoration: none;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); background: var(--surface-2); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn--primary:hover { background: var(--accent); filter: brightness(1.08); }

.stats { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 480px; }
.stats li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stats strong { display: block; font-size: 28px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.stats span { color: var(--muted); font-size: 14px; }

/* Sections */
.section { padding: 64px 0; }
.section--alt { background: var(--surface-2); }
.section__title { display: flex; align-items: center; gap: 10px; font-size: 28px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 28px; }
.section__title .ms { color: var(--accent); font-size: 30px; }
.section__intro { color: var(--muted); font-style: italic; margin: -12px 0 28px; }
.sub { font-size: 18px; font-weight: 700; margin: 36px 0 16px; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 24px; border-left: 2px solid var(--line); display: grid; gap: 20px; }
.job { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.job::before { content: ""; position: absolute; left: -32px; top: 28px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.job__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.job h3 { font-size: 20px; font-weight: 700; }
.job__role { display: inline; font-weight: 500; color: var(--muted); font-size: 16px; margin-left: 6px; }
.job__role::before { content: "— "; }
.job__meta { margin: 0; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.job__ctx { margin: 6px 0 0; color: var(--muted); font-style: italic; font-size: 15px; }
.job > ul:not(.tags) { margin: 12px 0 0; padding-left: 20px; }
.job > ul:not(.tags) li + li { margin-top: 6px; }
.badge { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.badge--now { background: var(--now-soft); color: var(--now); }
.tags { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.project { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.project p { margin: 0; color: var(--muted); }
.project .tags { margin-top: 0; }
.project--featured { grid-column: 1 / -1; border-color: var(--accent); background: linear-gradient(135deg, var(--accent-soft), var(--surface) 60%); }
.project__head { display: flex; align-items: center; gap: 14px; }
.project__head > div { flex: 1; min-width: 0; }
.project__head h3 { font-size: 20px; font-weight: 800; }
.project__tag { font-size: 14px; font-weight: 500; }
.project__icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: var(--accent-text); }
.project__icon .ms { font-size: 26px; vertical-align: 0; }
.project__points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.project__points li { display: flex; gap: 10px; align-items: flex-start; }
.project__points .ms { color: var(--accent); flex: none; vertical-align: 0; margin-top: 2px; }
.project__link { align-self: flex-start; margin-top: auto; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.skill { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.skill__icon { font-size: 28px; color: var(--accent); background: var(--accent-soft); border-radius: 12px; padding: 8px; margin-bottom: 12px; }
.skill h3 { font-size: 16px; margin-bottom: 6px; }
.skill p { margin: 0; color: var(--muted); font-size: 15px; }

/* Education */
.edu { list-style: none; margin: 0; padding: 0; }
.edu li { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.edu .ms { font-size: 28px; color: var(--accent); }
.edu div { display: grid; }
.edu span:not(.ms) { color: var(--muted); font-size: 14px; }

/* Paths + courses */
.paths { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.courses { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.card {
  width: 100%; height: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px 14px 16px; display: flex; align-items: center; gap: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.card__icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.card__icon .ms { font-size: 24px; vertical-align: 0; }
.card__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.card__title { font-weight: 600; font-size: 15px; line-height: 1.35; }
.card__meta { color: var(--muted); font-size: 13px; }
.card__open { flex: none; color: var(--muted); }
.card:hover .card__open { color: var(--accent); }
.card--path { padding: 18px 18px 18px 20px; }
.card--path .card__icon { width: 52px; height: 52px; background: var(--accent); color: var(--accent-text); }
.card--path .card__title { font-size: 16px; }
.card__kicker { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); }

.skill { position: relative; }
.skill--main { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.skill__badge { position: absolute; top: 22px; right: 22px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-text); }

.courses__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 36px 0 16px; }
.courses__head .sub { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

/* Viewer */
.viewer { border: 0; padding: 16px; border-radius: var(--radius); background: var(--surface); color: var(--text); width: min(960px, 100% - 32px); max-height: calc(100% - 32px); }
.viewer::backdrop { background: rgb(10 8 16 / .7); }
.viewer img { width: 100%; height: auto; border-radius: 8px; background: #fff; }
.viewer p { margin: 12px 4px 0; font-weight: 600; }
.viewer__close { position: absolute; top: 24px; right: 24px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 14px; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer p { margin: 0; }
.footer__links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .nav { display: none; }
  .topbar__inner .icon-btn { margin-left: auto; }
  .hero { padding: 48px 0 40px; }
  .stats { grid-template-columns: 1fr; }
  .projects, .project__points { grid-template-columns: 1fr; }
  .project { padding: 20px; }
  .timeline { padding-left: 16px; }
  .job { padding: 18px; }
  .job::before { left: -24px; }
  .job__role { display: block; margin: 4px 0 0; }
  .job__role::before { content: ""; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card { transition: none; }
}
