/* ---------- tokens ---------- */
:root {
  --nav-h: 64px;

  --ink: #1F2326;
  --paper: #fbfaf7;
  --paper-2: #efede7;
  --muted: #5c5a55;
  --rule: #cfcbc2;
  --accent: #8B2E2E;          /* used sparingly: links, active state, numbers */
  --on-dark: #f4f2ee;
  --on-dark-muted: #b9b5ad;
  --rule-dark: #3a3936;

  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: var(--font-body);
  --font-brand: var(--font-body);   /* previously "Source Serif 4" */
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding-top: var(--nav-h);
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }

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

.skip {
  position: fixed;
  top: -100px; left: 16px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--on-dark);
}
.skip:focus { top: 12px; color: var(--on-dark); }

/* ---------- top bar ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  padding: 0 clamp(16px, 3vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgb(251 250 247 / 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  z-index: 10;
}
.nav .brand {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.nav nav { display: flex; gap: clamp(16px, 2.2vw, 32px); }
.nav nav a {
  position: relative;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s;
}
.nav nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav nav a:hover,
.nav nav a.active { color: var(--ink); }
.nav nav a:hover::after,
.nav nav a.active::after { transform: scaleX(1); }

/* ---------- panels ---------- */
.panel {
  min-height: calc(100vh - var(--nav-h));
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* text columns scale with the viewport (and its height, so short windows don't overflow) */
.split .text {
  font-size: clamp(13px, min(0.9vw + 4px, 1.9vh), 21px);
  padding: 4em 2em;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.split .text > * {
  width: 100%;
  max-width: 27em;
  margin-left: auto;
  margin-right: auto;
}

/* images fill their column; <img> keeps them accessible and lets us pick the focal point */
.split .image {
  position: relative;
  overflow: hidden;
  min-height: 24em;
}
.split .image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.panel-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

/* ---------- panel 1: intro ---------- */
.intro .text { background: var(--ink); color: var(--on-dark); }
.intro h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 4.2em;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-top: 0;
  margin-bottom: 0.7em;
}
.intro .block { padding: 1.1em 0 1.3em; border-top: 1px solid var(--rule-dark); }
.intro .block:last-child { border-bottom: 1px solid var(--rule-dark); }
.eyebrow {
  margin: 0 0 0.7em;
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6d8556;                 /* accent, lightened for contrast on black */
}
.intro .block p {
  margin: 0;
  font-size: 1em;
  line-height: 1.65;
  color: var(--on-dark-muted);
}
.intro .image img { object-position: center top; }

/* ---------- panel 2: projects ---------- */
.projects .image::after {            /* paper wash so the title stays legible over the busy map */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgb(251 250 247 / 0.9), rgb(251 250 247 / 0) 38%);
  pointer-events: none;
}
.projects .panel-title {
  position: absolute;
  z-index: 1;
  top: 0.7em; left: 0.8em;
  margin: 0;
  font-size: clamp(28px, 3vw, 54px);
}
.projects .text { background: var(--paper); }

/* ---------- shared item styling ---------- */
.item {
  padding-top: 1em;
  margin-bottom: 1.6em;
  border-top: 2px solid var(--ink);
}
.item h3 {
  margin: 0 0 0.6em;
  font-size: 1.2em;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 0.7em;
}
.item .num {
  font-size: 0.65em;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.item p {
  margin: 0 0 0.8em;
  font-size: 0.95em;
  line-height: 1.6;
  color: var(--muted);
}
.item p a { color: var(--ink); text-decoration-color: var(--accent); }
.item p a:hover { color: var(--accent); }

/* ---------- panel 3: experience ---------- */
.experience .text { background: var(--paper-2); }
.experience .panel-title { font-size: 2.6em; margin-top: 0; margin-bottom: 0.2em; }
.experience .resume {
  max-width: none;                /* span the full column so it sits flush with the title */
  margin-top: 0;
  margin-bottom: 1.8em;
  font-size: 0.95em;
  color: var(--muted);
}
.resume span { margin: 0 0.6em; }
.resume a { color: var(--ink); text-decoration-color: var(--accent); }
.resume a:hover { color: var(--accent); }
.experience .org {
  display: flex;
  justify-content: space-between;
  gap: 1em;
  margin: 0 0 0.7em;
  padding-bottom: 0.6em;
  border-bottom: 1px solid var(--rule);
  font-size: 0.85em;
  color: var(--ink);
}
.experience .org time { color: var(--muted); white-space: nowrap; }
/* keep the speaker (about 30% across the photo) in frame at any aspect ratio */
.experience .image img { object-position: 30% center; }

.anchor { height: 0; }

/* ---------- footer ---------- */
footer {
  --glyph: var(--paper);          /* icon glyph knocks out of the filled circle */
  padding: 3.5rem 1rem 2.5rem;
  text-align: center;
  background: var(--paper);
  border-top: 1px solid var(--rule);
}
.footer-label {
  margin: 0 0 1.2rem;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.social { display: flex; justify-content: center; gap: 20px; }
.social a { display: block; border-radius: 50%; transition: transform 0.2s, opacity 0.2s; }
.social a:hover { transform: translateY(-3px); }
.social svg { width: 48px; height: 48px; display: block; fill: var(--ink); transition: fill 0.2s; }
.social a:hover svg { fill: var(--accent); }
.copyright { margin: 2rem 0 0; font-size: 12px; color: var(--muted); }
/* ---------- motion ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.in { opacity: 1; transform: none; }
.reveal:nth-child(3) { transition-delay: 0.08s; }
.reveal:nth-child(4) { transition-delay: 0.16s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ---------- mobile: stack the halves ---------- */
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  .split .image { order: -1; min-height: 60vh; }
  .projects .image { min-height: 40vh; }
  .split .text { padding: 2.5em 1.5em; }
  .intro h1 { font-size: 3.2em; }
  .nav nav { gap: 14px; }
  .brand { font-size: 17px; }
}
