/* === Design tokens =========================================== */
:root {
  --bg: #dde6f1;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --hairline: #c7d3e3;
  --accent: #1d4ed8;
  --accent-ink: #ffffff;

  --maxw: 760px;
  --pad-x: clamp(20px, 5vw, 32px);
  --pad-section: clamp(56px, 9vw, 96px);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
}

/* === Reset =================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }

/* === Typography ============================================== */
h1, h2, h3 { letter-spacing: -0.01em; margin: 0; line-height: 1.2; }
h1 { font-size: clamp(40px, 6vw, 56px); font-weight: 700; }
h2 { font-size: clamp(24px, 3.4vw, 30px); font-weight: 600; margin-bottom: 24px; }
h3 { font-size: 18px; font-weight: 600; }

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

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.muted { color: var(--muted); }

/* === Layout primitives ======================================= */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}
section { padding-top: var(--pad-section); padding-bottom: var(--pad-section); }
section + section { border-top: 1px solid var(--hairline); }

/* === Buttons ================================================= */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  border: 1px solid transparent;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #1e40af; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--hairline); }
.btn-secondary:hover { border-color: #cbd5e1; }

/* === Focus =================================================== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* === Utility ================================================= */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* === Motion preferences ====================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === Site header / nav ======================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
  max-width: 960px; /* slightly wider than content so CTA breathes */
}
.brand {
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }

.nav-menu {
  display: flex;
  gap: 22px;
  margin-left: auto;
}
.nav-menu a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.nav-menu a:hover { color: var(--text); text-decoration: none; }
.nav-menu a[aria-current="true"] { color: var(--text); }

.nav-cta { font-size: 14px; padding: 8px 14px; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 8px 10px;
  align-items: center;
  gap: 4px;
}
.nav-toggle-bar {
  width: 18px; height: 2px; background: var(--text); display: block;
}
.nav-toggle-bar + .nav-toggle-bar { margin-top: 4px; }

/* Mobile */
@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; flex-direction: column; }
  .nav-menu {
    position: absolute;
    top: 60px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--hairline);
    padding: 8px 0;
    display: none;
  }
  .nav-menu[data-open] { display: flex; }
  .nav-menu a { display: block; padding: 12px var(--pad-x); }
  .nav-cta { order: 3; }
}

/* === Hero ==================================================== */
.hero { padding-top: calc(var(--pad-section) + 16px); padding-bottom: var(--pad-section); }
.hero .eyebrow { margin-bottom: 14px; }
.hero h1 { margin-bottom: 14px; }
.hero-sub {
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--text);
  max-width: 620px;
  margin: 0 0 10px;
}
.hero-meta { color: var(--muted); font-size: 15px; margin: 0 0 28px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0 0 32px;
}
.chips li {
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 10px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }

/* Hero has no top divider (it follows the sticky header) */
.hero + section { border-top: 1px solid var(--hairline); }
.hero { border-top: 0; }

/* === About / stats =========================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 32px 0 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}
.stats > div { display: flex; flex-direction: column; gap: 2px; }
.stats dt { font-size: 28px; font-weight: 700; color: var(--text); }
.stats dd { margin: 0; color: var(--muted); font-size: 14px; }

@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* === Highlights cards ======================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 20px;
}
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card-wide { grid-column: 1 / -1; }

@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr; }
}

/* === Experience ============================================== */
.role { padding: 24px 0; border-bottom: 1px solid var(--hairline); }
.role:first-of-type { padding-top: 0; }
.role header { margin-bottom: 14px; }
.role h3 { margin-bottom: 4px; }
.role-meta { margin: 0; color: var(--muted); font-size: 14px; }
.role-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
  margin: 14px 0 8px;
}
.role-list { padding-left: 20px; list-style: disc; color: var(--text); }
.role-list li { margin-bottom: 6px; font-size: 16px; }
.role-list li::marker { color: var(--muted); }

.earlier-heading {
  margin-top: 32px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 600;
}
.earlier-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}
.earlier-list li { color: var(--text); font-size: 15px; }
.earlier-list strong { font-weight: 600; }

/* === Skills ================================================== */
.skills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 32px;
}
.skill-group p { margin: 0; }
.skill-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px !important;
}

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

/* === Education =============================================== */
.plain-list li { margin-bottom: 12px; font-size: 15px; }

/* === Footer ================================================== */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 32px 0;
  color: var(--muted);
  font-size: 14px;
}
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* === Reveal-on-scroll ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms ease, transform 240ms ease;
}
.reveal.is-revealed {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* === Skip link =============================================== */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--text);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transform: translateY(-150%);
  transition: transform 120ms ease;
  z-index: 100;
}
.skip-link:focus { transform: translateY(0); text-decoration: none; }
