/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --ink: #1b2140;        /* deep indigo — hero, atlas band, contact */
  --ink-raised: #252c55; /* raised surface on dark */
  --ink-text: #303755;   /* body ink on light ground */
  --ink-soft: #565d7c;   /* muted indigo — secondary text */
  --paper: #f6f1e7;      /* warm cream ground */
  --card: #fffcf4;       /* light card surface */
  --sand: #eadfcc;       /* wash, map land on light */
  --clay: #c26a5a;       /* dusty clay — chapter countries, echoes the photos */
  --gold: #d2973f;       /* savanna gold — Zambia, accents on dark */
  --line: rgba(27, 33, 64, 0.14);
  --line-dark: rgba(246, 241, 231, 0.18);
  --cream-70: rgba(246, 241, 231, 0.72);

  --serif: "Fraunces", Georgia, serif;
  --sans: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;

  --radius: 18px;
  --measure: 62ch;
  --pad: clamp(1.25rem, 4vw, 3rem);
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
  margin: 0 0 0.6em;
  color: var(--ink);
}

h2 {
  font-size: clamp(1.9rem, 3.8vw, 2.75rem);
  letter-spacing: -0.01em;
  max-width: 24ch;
}
h2 em { font-style: italic; font-weight: 500; }

h3 { font-size: 1.2rem; font-weight: 600; }

p { margin: 0 0 1em; max-width: var(--measure); }

a { color: var(--ink); text-decoration-color: var(--clay); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--clay); }

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

main > section {
  padding: clamp(3rem, 7vw, 5.5rem) var(--pad);
  max-width: 76rem;
  margin: 0 auto;
}

/* Small-caps section kickers */
.kicker {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 1rem;
}
.kicker::after {
  content: "";
  display: block;
  width: 2.25rem;
  height: 3px;
  background: var(--gold);
  margin-top: 0.6rem;
  border-radius: 2px;
}
.kicker-gold { color: var(--gold); }

/* Pill buttons */
.pill {
  display: inline-block;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  border: 2px solid transparent;
}
.pill-solid { background: var(--ink); color: var(--paper); }
.pill-solid:hover { background: var(--clay); color: var(--paper); }
.pill-light { background: var(--paper); color: var(--ink); }
.pill-light:hover { background: var(--gold); color: var(--ink); }
.pill-ghost { border-color: var(--cream-70); color: var(--paper); }
.pill-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* Scroll reveal — pure CSS scroll-driven animation. Browsers without
   animation-timeline support (and reduced-motion users) see static content. */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@supports (animation-timeline: view()) {
  @media not (prefers-reduced-motion: reduce) {
    .reveal {
      animation: rise-in both ease;
      animation-timeline: view();
      animation-range: entry 5% entry 40%;
    }
  }
}

/* ============================================================
   Header / footer
   ============================================================ */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem var(--pad);
  max-width: 76rem;
  margin: 0 auto;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
  border-bottom: 3px solid var(--clay);
  padding-bottom: 2px;
}

.header-cta { padding: 0.55rem 1.3rem; font-size: 0.95rem; }

.site-nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  margin-right: 1.5rem;
}
.site-nav a {
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft);
}
.site-nav a:hover { color: var(--clay); }
@media (max-width: 700px) {
  .site-nav { display: none; }
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem var(--pad) 2.5rem;
  max-width: 76rem;
  margin: 0 auto;
}
.site-footer p { color: var(--ink-soft); font-size: 0.9rem; margin: 0; }

/* ============================================================
   Hero — dark immersive card
   ============================================================ */
.hero-wrap { padding-top: 0.75rem; }

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  background: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 560px;
}

.hero-text {
  padding: clamp(2rem, 5vw, 4rem);
  align-self: center;
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
}

.hero-card h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--paper);
  margin-bottom: 0.5em;
}

.thesis {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.45;
  color: var(--paper);
  max-width: 40ch;
  margin-bottom: 0.9em;
}
.thesis em { color: var(--gold); font-style: italic; }

.hero-support {
  color: var(--cream-70);
  max-width: 52ch;
  margin-bottom: 2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.hero-photo {
  margin: 0;
  position: relative;
  min-height: 320px;
}
.hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
/* Blend the portrait into the dark card */
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--ink) 0%, rgba(27, 33, 64, 0.2) 22%, rgba(27, 33, 64, 0) 45%);
  pointer-events: none;
}

/* Stats strip overlapping the hero card */
.stats-strip {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  margin: -2.5rem auto 0;
  padding: 0;
  position: relative;
  z-index: 2;
  width: min(100%, 58rem);
  box-shadow: 0 18px 40px -24px rgba(27, 33, 64, 0.45);
}
.stats-strip li {
  background: var(--card);
  padding: 1.4rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.stat-num {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}
.stat-label { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.35; }

/* ============================================================
   The Intersection
   ============================================================ */
.intersection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.75rem);
  margin-top: 2rem;
}

.intersection-grid article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 6px);
  padding: 1.5rem 1.5rem 0.75rem;
}
.intersection-grid h3 {
  border-top: 3px solid var(--clay);
  padding-top: 0.9rem;
}
.intersection-grid article:first-child h3 { border-top-color: var(--gold); }
.intersection-grid article:last-child h3 { border-top-color: var(--ink); }
.intersection-grid p { font-size: 1rem; }

/* ============================================================
   On the ground — photo grid
   ============================================================ */
.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
  margin-top: 2rem;
}

.field-photo { margin: 0; }
.field-photo img,
.field-photo .photo-placeholder {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: calc(var(--radius) - 6px);
}
.field-photo figcaption {
  font-size: 0.92rem;
  color: var(--ink-soft);
  padding: 0.7rem 0.25rem 0;
}

/* Portrait sources in landscape cells: keep faces in frame */
.field-photo img.crop-high { object-position: 50% 22%; }

/* ============================================================
   Photo placeholders (shown until real files are dropped in)
   ============================================================ */
.photo-placeholder {
  border-radius: calc(var(--radius) - 6px);
  border: 2px dashed var(--clay);
  background: var(--sand);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.photo-placeholder code { font-size: 0.85rem; color: var(--ink); }
.hero-photo .photo-placeholder {
  position: absolute;
  inset: 0;
  border-radius: 0;
  border: none;
  background: var(--ink-raised);
  color: var(--cream-70);
}
.hero-photo .photo-placeholder code { color: var(--gold); }

/* ============================================================
   Career Atlas — dark band
   ============================================================ */
.atlas-band {
  max-width: none !important;
  background: var(--ink);
  padding-inline: 0 !important;
}
.atlas {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 var(--pad);
}
.atlas h2 { color: var(--paper); }
.atlas h2 em { color: var(--gold); }

.atlas-lede {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--cream-70);
  margin-bottom: 2rem;
}

.atlas-layout {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}

#atlas-map svg { display: block; width: 100%; height: auto; }

/* Map fills — tuned for the dark band */
.land {
  fill: #2a3157;
  stroke: var(--ink);
  stroke-width: 0.5;
}

.country {
  cursor: pointer;
  stroke: var(--ink);
  stroke-width: 0.7;
  transition: fill 0.25s ease;
}
.country.tier-1 { fill: var(--clay); }
.country.tier-2 { fill: #8b7663; }
.country.is-zambia { fill: var(--gold); }
.country:hover { fill: var(--paper); }
.country.is-selected { fill: var(--paper); stroke: var(--gold); stroke-width: 1.2; }
.country.is-zambia:hover,
.country.is-zambia.is-selected { fill: var(--gold); stroke: var(--paper); }

.hit-target { fill: transparent; cursor: pointer; }

/* Countries fade in as the map scrolls into view — same CSS-only mechanism */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@supports (animation-timeline: view()) {
  @media not (prefers-reduced-motion: reduce) {
    .country {
      animation: fade-in both ease;
      animation-timeline: view();
      animation-range: entry 10% entry 70%;
    }
  }
}

/* Chips — accessible controls that mirror the map */
.atlas-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.chip {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--paper);
  background: transparent;
  border: 1.5px solid var(--line-dark);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  min-height: 44px;
}
.chip:hover { border-color: var(--clay); color: var(--gold); }
.chip[aria-pressed="true"] { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.chip.chip-zambia { border-color: var(--gold); }
.chip.chip-zambia[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }

.atlas-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--cream-70);
}
.key::before {
  content: "";
  display: inline-block;
  width: 0.75em; height: 0.75em;
  border-radius: 2px;
  margin-right: 0.45em;
}
.key-gold::before { background: var(--gold); }
.key-clay::before { background: var(--clay); }
.key-tier2::before { background: #8b7663; }

/* Story card on dark */
.story-card {
  background: var(--ink-raised);
  border: 1px solid var(--line-dark);
  border-radius: calc(var(--radius) - 6px);
  padding: 1.5rem 1.5rem 1.25rem;
  position: sticky;
  top: 1.5rem;
}

.story-card.slide-in { animation: card-in 0.35s ease; }
@keyframes card-in {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .story-card.slide-in { animation: none; }
}

.story-country {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--paper);
  margin: 0 0 0.25rem;
}

.story-flag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.story-chapter + .story-chapter {
  border-top: 1px solid var(--line-dark);
  margin-top: 1.1rem;
  padding-top: 1.1rem;
}

.story-role { font-weight: 600; color: var(--paper); margin: 0 0 0.1rem; }
.story-years { color: var(--gold); font-size: 0.9rem; margin: 0 0 0.5rem; }
.story-text { font-size: 0.98rem; color: var(--cream-70); margin: 0; }

/* ============================================================
   What I take on
   ============================================================ */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
  margin-top: 2rem;
}
.work-grid article {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--sand);
  border-radius: calc(var(--radius) - 8px);
  padding: 1.5rem 1.6rem 0.75rem;
}
.work-grid article:hover { border-left-color: var(--clay); }
.work-grid p { font-size: 1rem; }

/* ============================================================
   Experience
   ============================================================ */
.career-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.career-list li {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
}
.career-list li:last-child { border-bottom: 1px solid var(--line); }

.career-when {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--clay);
  font-size: 0.98rem;
  padding-top: 0.15rem;
}

.career-what h3 { margin-bottom: 0.3rem; font-size: 1.1rem; }
.career-what p { margin: 0; font-size: 0.98rem; color: var(--ink-soft); }

.credentials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.75rem);
  margin-top: 3rem;
}
.credentials ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
}
.credentials li { padding: 0.3rem 0; }

/* ============================================================
   Beyond the resume
   ============================================================ */
.beyond {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.beyond-photos {
  display: grid;
  gap: 1.25rem;
  width: min(100%, 24rem);
  justify-self: end;
}
.beyond-photos figure { margin: 0; }
.beyond-photos img,
.beyond-photos .photo-placeholder {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: calc(var(--radius) - 6px);
}
.beyond-photos figcaption {
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding: 0.55rem 0.25rem 0;
}

/* ============================================================
   Contact — dark card
   ============================================================ */
.contact-wrap { padding-bottom: clamp(3rem, 7vw, 5rem); }
.contact-card {
  background: var(--ink);
  border-radius: var(--radius);
  padding: clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
}
.contact-card .kicker { margin-inline: auto; }
.contact-card .kicker::after { margin-inline: auto; }
.contact-card h2 { color: var(--paper); margin-inline: auto; }
.contact-card h2 em { color: var(--gold); }
.contact-card p { color: var(--cream-70); margin-inline: auto; }
.contact-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.75rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 880px) {
  .hero-card { grid-template-columns: 1fr; }
  /* Photo above text on mobile so her face leads; square slot shows the
     tight studio crop without zooming */
  .hero-photo { order: -1; min-height: 0; aspect-ratio: 4 / 5; }
  .hero-photo::after {
    background: linear-gradient(180deg, rgba(27, 33, 64, 0) 78%, var(--ink) 100%);
  }
  .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 1.5rem; }
  .atlas-layout { grid-template-columns: 1fr; }
  .story-card { position: static; }
  .intersection-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-grid { grid-template-columns: 1fr; }
  .beyond { grid-template-columns: 1fr; }
  .beyond-photos { justify-self: start; grid-template-columns: 1fr 1fr; align-items: start; }
}

@media (max-width: 560px) {
  .career-list li { grid-template-columns: 1fr; gap: 0.2rem; }
  .credentials { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .beyond-photos { grid-template-columns: 1fr; }
}
