/* ============================================================
   ELLIOTT TEELING — Geography & Remote Sensing Portfolio
   Restyle: editorial / atlas · cartographic palette · motion layer
   Palette: refined Forest & Sage · first-class dark mode
   Headings: Fraunces (serif) · Body: Inter · Labels: DM Mono
   ============================================================ */

/* ── Design Tokens — LIGHT ──────────────────────────────── */
:root {
  /* Core palette — refined Forest & Sage */
  --forest:       #2C4A3C;
  --forest-deep:  #1E3329;
  --forest-darker:#16271F;
  --sage:         #7C9885;
  --sage-light:   #A8BCAE;
  --sand:         #E8E2D5;
  --sand-deep:    #DBD2BF;
  --bone:         #F5F2EB;
  --charcoal:     #18201C;
  --terracotta:   #C56A38;
  --terracotta-d: #A8552A;
  --terracotta-l: #DA8255;

  /* Semantic — light */
  --bg:            var(--bone);
  --bg-alt:        #FCFAF5;
  --bg-subtle:     #EBE5D9;
  --surface:       #FFFFFF;
  --surface-2:     #FBF9F3;
  --accent:        var(--forest);
  --accent-mid:    var(--sage);
  --accent-2:      var(--terracotta);
  --accent-subtle: #E5EBE4;
  --accent-border: #C9D6CA;

  --text:          var(--charcoal);
  --text-muted:    #586056;
  --text-faint:    #868D80;
  --border:        #DBD4C5;
  --border-strong: #C2BAA7;

  /* contour/graticule stroke colour for ambient SVG */
  --line-ink:      #2C4A3C;
  --line-soft:     rgba(44,74,60,.10);
  --line-soft-2:   rgba(44,74,60,.06);
  --spotlight:     rgba(44,74,60,.07);

  /* Type */
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:  "DM Mono", "SF Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;

  /* Geometry — 8px scale, soft */
  --radius:    8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 16px;

  --maxw: 1180px;

  --shadow-sm: 0 1px 2px rgba(24,32,28,.05);
  --shadow:    0 4px 18px -6px rgba(24,32,28,.12);
  --shadow-lg: 0 18px 48px -16px rgba(24,32,28,.22);

  --ease:      cubic-bezier(.22,.61,.36,1);
  --ease-out:  cubic-bezier(.16,1,.3,1);

  color-scheme: light;
}

/* ── Design Tokens — DARK ───────────────────────────────── */
[data-theme="dark"] {
  --bg:            #0F1714;
  --bg-alt:        #121B17;
  --bg-subtle:     #18241E;
  --surface:       #15201B;
  --surface-2:     #18241E;
  --accent:        #6FA585;
  --accent-mid:    #7C9885;
  --accent-2:      #DC7E4A;
  --accent-subtle: #1B2A22;
  --accent-border: #2A3D32;

  --forest:        #6FA585;   /* lighter so it reads on dark */
  --forest-deep:   #0C1410;
  --forest-darker: #0A100D;
  --sage:          #8FAE98;
  --sage-light:    #B6CABC;
  --terracotta:    #DC7E4A;
  --terracotta-d:  #C5683A;
  --terracotta-l:  #E8966A;
  --bone:          #ECEFE9;
  --charcoal:      #E7ECE6;   /* inline HTML stats use var(--charcoal) — keep legible on dark */

  --text:          #E7ECE6;
  --text-muted:    #A4AFA4;
  --text-faint:    #79857A;
  --border:        #283A30;
  --border-strong: #34493B;

  --line-ink:      #6FA585;
  --line-soft:     rgba(143,174,152,.12);
  --line-soft-2:   rgba(143,174,152,.07);
  --spotlight:     rgba(143,174,152,.10);

  color-scheme: dark;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
::selection { background: var(--forest); color: var(--bone); }

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

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 540;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--text);
  font-optical-sizing: auto;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.3rem); font-weight: 560; letter-spacing: -.02em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.25rem; font-weight: 560; }
h4 { font-size: 1.02rem; font-weight: 560; }
p  { color: var(--text-muted); }
strong { color: var(--text); font-weight: 600; }
em { font-style: italic; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--accent-2);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent-2); display: inline-block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 2rem; position: relative; }

.section    { padding: 6rem 0; }
.section-sm { padding: 4rem 0; }

.section-header { max-width: 640px; margin-bottom: 3rem; }
.section-header .eyebrow { margin-bottom: 1rem; }
.section-header h2 { margin-bottom: .85rem; }
.section-header p  { font-size: 1.05rem; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .04em;
  padding: .8rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease), background-color .25s, border-color .25s, box-shadow .25s, color .25s;
  text-transform: uppercase;
  white-space: nowrap;
  will-change: transform;
}
.btn-lg { padding: .95rem 1.85rem; font-size: .82rem; }
.btn-primary { background: var(--forest); color: var(--bone); border-color: var(--forest); }
.btn-primary:hover { background: var(--forest-deep); transform: translateY(-2px); box-shadow: var(--shadow); }
[data-theme="dark"] .btn-primary { color: var(--forest-darker); }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--accent); background: var(--accent-subtle); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text-muted); padding-left: .4rem; padding-right: .4rem; }
.btn-ghost:hover { color: var(--accent); }
.btn-white { background: var(--bone); color: var(--forest-deep); border-color: var(--bone); }
.btn-white:hover { background: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-accent { background: var(--terracotta); color: #fff; border-color: var(--terracotta); }
.btn-accent:hover { background: var(--terracotta-d); transform: translateY(-2px); }

/* ── Navigation ─────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  transition: background-color .4s var(--ease), border-color .4s;
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 2rem;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: .04em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.nav-logo .logo-mark { width: 26px; height: 26px; flex: none; }
.nav-logo .logo-mark [stroke="#2D4A3E"] { stroke: var(--accent); }
.nav-logo .logo-mark [fill="#2D4A3E"]   { fill: var(--accent); }
.nav-logo .name { letter-spacing: -.01em; }

.nav-links { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .02em;
  color: var(--text-muted);
  padding: .5rem .8rem;
  border-radius: var(--radius);
  transition: color .2s, background .2s;
  position: relative;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: .8rem; right: .8rem; bottom: .15rem;
  height: 1.5px;
  background: var(--accent-2);
  transform-origin: left;
  animation: underdraw .4s var(--ease-out) both;
}
@keyframes underdraw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.nav-links a.btn-nav { background: var(--forest); color: var(--bone); margin-left: .5rem; padding: .55rem 1.1rem; }
[data-theme="dark"] .nav-links a.btn-nav { color: var(--forest-darker); }
.nav-links a.btn-nav:hover { background: var(--forest-deep); color: var(--bone); }
[data-theme="dark"] .nav-links a.btn-nav:hover { color: var(--forest-darker); }
.nav-links a.btn-nav.active::after { display: none; }

/* theme toggle (injected button) — height matches the Contact button so the
   two boxed nav items line up edge-to-edge */
.theme-toggle {
  width: 39px; height: 39px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  margin-left: .6rem;
  transition: color .2s, border-color .2s, background .2s, transform .3s var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--accent); transition: .3s var(--ease); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Ambient cartographic layer (injected) ──────────────── */
.ambient-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient-graticule {
  position: absolute;
  inset: -10% -10% -10% -10%;
  width: 120%; height: 120%;
  background-image:
    linear-gradient(var(--line-soft-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft-2) 1px, transparent 1px);
  background-size: 64px 64px;
  animation: graticule-pan 90s linear infinite;
  will-change: transform;
}
@keyframes graticule-pan {
  from { transform: translate3d(0,0,0); }
  to   { transform: translate3d(-64px,-64px,0); }
}
.ambient-contours {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: .9;
}
.ambient-contours svg { width: 100%; height: 100%; }
.ambient-contours .contour-group { animation: contour-drift 40s ease-in-out infinite alternate; will-change: transform; }
.ambient-contours .contour-group.g2 { animation-duration: 56s; animation-direction: alternate-reverse; }
@keyframes contour-drift {
  from { transform: translate3d(0,0,0); }
  to   { transform: translate3d(2.5%, -1.8%, 0); }
}
/* each ambient contour path strokes itself in on load.
   The start dashoffset (±length) is set inline per-line in JS; the keyframe
   draws it to 0. forwards fill keeps the line fully visible afterward. */
.ambient-contours path { will-change: stroke-dashoffset; }
@keyframes contour-draw {
  to { stroke-dashoffset: 0; opacity: 1; }
}

/* keep page content above ambient layer */
body > nav, body > main, body > footer, body > .marquee-ticker { position: relative; z-index: 1; }

/* cursor spotlight on cards */
.spotlight {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s var(--ease);
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--spotlight), transparent 60%);
  z-index: 0;
}
.has-spotlight { position: relative; }
.has-spotlight:hover .spotlight { opacity: 1; }
.has-spotlight > *:not(.spotlight) { position: relative; z-index: 1; }

/* ── Coordinates ticker / marquee (injected) ────────────── */
.marquee-ticker {
  background: var(--forest-deep);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  padding: .55rem 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  animation: marquee 48s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }
.marquee-item {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .06em;
  color: var(--sage-light);
  padding: 0 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
}
.marquee-item::after { content: "◆"; color: var(--terracotta); font-size: .5rem; }
@keyframes marquee {
  from { transform: translate3d(0,0,0); }
  to   { transform: translate3d(-50%,0,0); }
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 7rem 0 6rem;
  overflow: hidden;
  background: var(--forest);
  color: var(--bone);
}
[data-theme="dark"] .hero { background: linear-gradient(165deg, #16271F, #0F1714); }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='800' viewBox='0 0 1200 800'%3E%3Cg fill='none' stroke='%237C9885' stroke-width='1' opacity='0.5'%3E%3Cpath d='M-50 400 C 200 300, 400 500, 650 380 S 1100 250, 1300 360'/%3E%3Cpath d='M-50 440 C 200 350, 420 540, 660 420 S 1100 300, 1300 400'/%3E%3Cpath d='M-50 480 C 220 400, 440 580, 680 470 S 1120 360, 1300 450'/%3E%3Cpath d='M-50 520 C 240 450, 460 610, 700 520 S 1130 420, 1300 500'/%3E%3Cpath d='M-50 560 C 260 500, 480 650, 720 570 S 1140 470, 1300 550'/%3E%3Cpath d='M-50 600 C 280 550, 500 690, 740 620 S 1150 520, 1300 600'/%3E%3Cpath d='M-50 200 C 200 120, 400 260, 650 160 S 1100 80, 1300 170'/%3E%3Cpath d='M-50 250 C 200 180, 420 310, 660 210 S 1100 140, 1300 230'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  opacity: .55;
  animation: hero-contour 30s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes hero-contour {
  from { transform: scale(1) translateX(0); }
  to   { transform: scale(1.06) translateX(-1.5%); }
}
.hero .container { position: relative; z-index: 1; }
.hero-content { max-width: 820px; }
.hero .eyebrow { color: var(--sage-light); margin-bottom: 1.5rem; }
.hero .eyebrow::before { background: var(--sage-light); }
.hero h1 { color: var(--bone); margin-bottom: 1.5rem; }
.hero h1 .accent { color: var(--sage-light); font-style: italic; }
.hero-subtitle { font-size: 1.18rem; color: rgba(245,242,235,.84); max-width: 620px; margin-bottom: 2.25rem; line-height: 1.6; }
.hero-subtitle strong { color: var(--bone); }
.hero-ctas { display: flex; gap: .85rem; flex-wrap: wrap; margin-bottom: 2.75rem; }
.hero-ctas .btn-outline { color: var(--bone); border-color: rgba(245,242,235,.4); }
.hero-ctas .btn-outline:hover { border-color: var(--bone); background: rgba(245,242,235,.08); }
.hero-ctas .btn-ghost { color: rgba(245,242,235,.78); }
.hero-ctas .btn-ghost:hover { color: var(--bone); }
.hero-chips { display: flex; flex-wrap: wrap; gap: .55rem; }
.hero-chip {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .03em;
  color: var(--sage-light);
  border: 1px solid rgba(124,152,133,.45);
  padding: .35rem .7rem;
  border-radius: 999px;
  transition: background .25s, transform .25s;
}
.hero-chip:hover { background: rgba(124,152,133,.16); transform: translateY(-1px); }

/* ── Grids ──────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.6rem; }

/* ── Tags ───────────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.tag {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .02em;
  color: var(--text-muted);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  padding: .25rem .65rem;
  border-radius: 999px;
  transition: background .2s, color .2s, border-color .2s;
}
.card:hover .tag { border-color: var(--border-strong); }

/* ── Cards (projects) ───────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
  position: relative;
  will-change: transform;
}
.card .spotlight { border-radius: var(--radius-lg); }
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.card-thumb {
  width: 100%;
  height: 210px;
  object-fit: cover;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  filter: saturate(.95);
  transition: transform .6s var(--ease), filter .35s;
  z-index: 1;
}
.card:hover .card-thumb { transform: scale(1.04); filter: saturate(1.05); }
.card-thumb-placeholder { width: 100%; height: 210px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border); }
.card-body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; position: relative; z-index: 1; }
.card-eyebrow { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); margin-bottom: .6rem; }
.card-title { font-size: 1.22rem; margin-bottom: .65rem; line-height: 1.2; }
.card-desc { font-size: .9rem; color: var(--text-muted); margin-bottom: 1rem; flex: 1; }
.card-link {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .02em;
  color: var(--accent);
  font-weight: 500;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: gap .25s, color .25s;
}
.card-link:hover { gap: .7rem; color: var(--terracotta); }

/* Geometric placeholders */
.thumb-dem      { background: linear-gradient(135deg, var(--forest-deep), var(--forest), var(--sage)); }
.thumb-coastal  { background: linear-gradient(135deg, #1E3D4C, #4E7E8E, var(--sage-light)); }
.thumb-urban    { background: linear-gradient(135deg, #5C4E40, var(--terracotta), #D9A05B); }
.thumb-landcover{ background: linear-gradient(135deg, var(--forest-deep), var(--sage), #C7D4B8); }
.thumb-rs       { background: linear-gradient(135deg, #54463A, var(--terracotta-d), #D9A05B); }
.thumb-topo     { background: linear-gradient(135deg, var(--forest), var(--sage), var(--sand)); }

/* ── Info cards / panels ────────────────────────────────── */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  margin-bottom: 1.25rem;
  transition: border-color .3s, box-shadow .3s, transform .3s var(--ease);
  position: relative;
}
.info-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.info-card-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent-2);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .55rem;
}
.info-card-label::before { content: ""; width: 16px; height: 1px; background: var(--accent-2); }

/* ── Stat tiles ─────────────────────────────────────────── */
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
  position: relative;
}
.stat-tile:hover { transform: translateY(-4px); border-color: var(--sage); box-shadow: var(--shadow); }
.stat-tile .icon-geo { margin: 0 auto .75rem; }
.stat-tile-title { font-weight: 600; font-size: .9rem; color: var(--text); }
.stat-tile-sub   { font-size: .78rem; color: var(--text-muted); margin-top: .15rem; }

.icon-geo { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.icon-geo svg { width: 100%; height: 100%; }
.icon-geo [stroke="#2D4A3E"], .icon-geo [stroke="#2C4A3C"] { stroke: var(--accent); }
.icon-geo [stroke="#7C9885"] { stroke: var(--accent-mid); }
.icon-geo [stroke="#C4703A"], .icon-geo [stroke="#C56A38"] { stroke: var(--accent-2); }
.icon-geo [fill="#2D4A3E"], .icon-geo [fill="#2C4A3C"] { fill: var(--accent); }

/* ── Page header ────────────────────────────────────────── */
.page-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 260px; height: 260px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cg fill='none' stroke='%237C9885' stroke-width='1' opacity='0.35'%3E%3Ccircle cx='130' cy='130' r='40'/%3E%3Ccircle cx='130' cy='130' r='70'/%3E%3Ccircle cx='130' cy='130' r='100'/%3E%3Ccircle cx='130' cy='130' r='128'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  animation: slow-spin 120s linear infinite;
  transform-origin: 130px 130px;
}
@keyframes slow-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.page-header .container { position: relative; z-index: 1; }
.page-header h1 { margin-bottom: .6rem; }
.page-header p  { font-size: 1.08rem; max-width: 620px; }

/* ── About layout ───────────────────────────────────────── */
.about-layout { display: grid; grid-template-columns: 1.55fr 1fr; gap: 3.5rem; align-items: start; }
.about-photo-wrap {
  aspect-ratio: 4/5;
  border-radius: var(--radius-lg);
  background: var(--forest);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='500'%3E%3Cg fill='none' stroke='%237C9885' stroke-width='1.2' opacity='0.45'%3E%3Cpath d='M-20 120 C 120 80, 200 180, 420 110'/%3E%3Cpath d='M-20 170 C 120 130, 200 230, 420 160'/%3E%3Cpath d='M-20 220 C 120 180, 200 280, 420 210'/%3E%3Cpath d='M-20 280 C 120 240, 200 340, 420 270'/%3E%3Cpath d='M-20 340 C 120 300, 200 400, 420 330'/%3E%3Cpath d='M-20 400 C 120 360, 200 460, 420 390'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--forest-deep);
  overflow: hidden;
}
.about-photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.about-photo-wrap .icon-geo { width: 64px; height: 64px; color: var(--sage-light); }
.about-photo-wrap .icon-geo [stroke] { stroke: var(--sage-light); }

.fieldwork-item { display: flex; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--border); }
.fieldwork-item:first-of-type { border-top: none; padding-top: 0; }
.fw-icon {
  flex: none;
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  transition: transform .3s var(--ease);
}
.fieldwork-item:hover .fw-icon { transform: scale(1.08) rotate(-3deg); }
.fw-icon svg { width: 20px; height: 20px; }
.fw-title { font-weight: 600; font-size: .92rem; margin-bottom: .2rem; color: var(--text); font-family: var(--font-sans); }
.fw-desc  { font-size: .82rem; color: var(--text-muted); }

.module-grid { display: flex; flex-wrap: wrap; gap: .4rem; }
.module-tag { font-size: .76rem; background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text-muted); padding: .3rem .65rem; border-radius: 999px; transition: border-color .2s, transform .2s; }
.module-tag:hover { border-color: var(--sage); transform: translateY(-1px); }

/* ── Skills ─────────────────────────────────────────────── */
.skill-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color .3s, box-shadow .3s, transform .3s var(--ease);
  position: relative;
}
.skill-category:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-3px); }
.skill-category-header { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.25rem; }
.skill-cat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex: none;
  transition: transform .35s var(--ease);
}
.skill-category:hover .skill-cat-icon { transform: rotate(-6deg) scale(1.06); }
.skill-cat-icon svg { width: 20px; height: 20px; }
.skill-cat-icon [stroke] { stroke: var(--accent); }
.skill-category-header h3 { font-size: 1.05rem; }
.skill-tags-grid { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ── CV ─────────────────────────────────────────────────── */
.cv-download-banner {
  background: var(--forest);
  color: var(--bone);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .cv-download-banner { background: linear-gradient(150deg, #1E3329, #0F1714); border: 1px solid var(--border); }
.cv-download-banner::after {
  content: "";
  position: absolute;
  right: -30px; bottom: -60px;
  width: 220px; height: 220px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cg fill='none' stroke='%237C9885' stroke-width='1' opacity='0.4'%3E%3Ccircle cx='110' cy='110' r='35'/%3E%3Ccircle cx='110' cy='110' r='60'/%3E%3Ccircle cx='110' cy='110' r='85'/%3E%3Ccircle cx='110' cy='110' r='108'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  animation: slow-spin 100s linear infinite;
  transform-origin: 110px 110px;
}
.cv-download-banner > * { position: relative; z-index: 1; }
.cv-download-banner h2 { color: var(--bone); margin-bottom: .6rem; }
.cv-download-banner p  { color: rgba(245,242,235,.8); margin-bottom: 1.5rem; max-width: 500px; }
.cv-download-banner .btn-row { display: flex; gap: .85rem; flex-wrap: wrap; }
/* outline button sits on the dark forest banner — use light text/border */
.cv-download-banner .btn-outline { color: var(--bone); border-color: rgba(245,242,235,.4); }
.cv-download-banner .btn-outline:hover { color: var(--bone); border-color: var(--bone); background: rgba(245,242,235,.08); }

.cv-section { margin-bottom: 3rem; }
.cv-section-title {
  font-family: var(--font-mono);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--accent-2);
  padding-bottom: .75rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .6rem;
}
.cv-section-title::before { content: ""; width: 8px; height: 8px; background: var(--terracotta); transform: rotate(45deg); }
.cv-entry { display: flex; justify-content: space-between; gap: 2rem; padding: 1.25rem 0; border-bottom: 1px solid var(--border); transition: padding-left .3s var(--ease); }
.cv-entry:last-child { border-bottom: none; }
.cv-entry:hover { padding-left: .5rem; }
.cv-entry-role { font-weight: 600; font-size: 1.02rem; color: var(--text); margin-bottom: .15rem; }
.cv-entry-org  { color: var(--accent); font-size: .88rem; font-weight: 500; margin-bottom: .5rem; }
.cv-entry-desc { font-size: .88rem; color: var(--text-muted); }
.cv-entry-desc ul { list-style: none; }
.cv-entry-desc li { padding-left: 1.1rem; position: relative; margin-bottom: .35rem; }
.cv-entry-desc li::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; background: var(--sage); transform: rotate(45deg); }
.cv-entry-date { flex: none; font-family: var(--font-mono); font-size: .78rem; color: var(--text-faint); white-space: nowrap; }

/* ── Contact ────────────────────────────────────────────── */
.contact-layout { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3.5rem; align-items: start; }
.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: .85rem;
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.contact-card:hover { border-color: var(--sage); transform: translateX(5px); box-shadow: var(--shadow); }
.contact-card-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex: none;
  transition: transform .3s var(--ease);
}
.contact-card:hover .contact-card-icon { transform: scale(1.08); }
.contact-card-icon svg { width: 20px; height: 20px; }
.contact-card-icon [stroke] { stroke: var(--accent); }
.contact-card-label { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-faint); }
.contact-card-value { font-weight: 500; font-size: .92rem; color: var(--text); }

.contact-form-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; }
.contact-form-title { font-size: 1.3rem; margin-bottom: 1.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: .45rem; }
.form-input, .form-textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: .92rem;
  padding: .7rem .85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px var(--accent-subtle); }
.form-textarea { min-height: 130px; resize: vertical; }
.form-note { font-size: .78rem; color: var(--text-faint); margin-top: 1rem; }
.form-note a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ── Maps gallery ───────────────────────────────────────── */
.maps-section-header { margin-bottom: 1.75rem; }
.maps-section-header h2 { margin-bottom: .4rem; }
.maps-section-header p  { font-size: .95rem; }
.map-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.5rem; }
.map-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s, border-color .35s;
  position: relative;
}
.map-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.map-item-img { width: 100%; height: 200px; object-fit: cover; border-bottom: 1px solid var(--border); filter: saturate(.95); transition: transform .6s var(--ease); }
.map-item:hover .map-item-img { transform: scale(1.05); }
.map-item-placeholder { width: 100%; height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; color: rgba(255,255,255,.92); font-family: var(--font-mono); font-size: .8rem; text-align: center; padding: 1rem; }
.map-item-placeholder .icon { font-size: 1.6rem; }
.map-item-info { padding: 1.1rem 1.25rem; }
.map-item-title { font-weight: 600; font-size: .95rem; color: var(--text); margin-bottom: .25rem; font-family: var(--font-sans); }
.map-item-meta  { font-family: var(--font-mono); font-size: .72rem; color: var(--text-muted); letter-spacing: .01em; }

.divider { border: none; border-top: 1px solid var(--border); }

.leaflet-container-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; position: relative; z-index: 1; }
#interactive-map { height: 460px; width: 100%; background: var(--bg-subtle); position: relative; z-index: 1; }
/* keep Leaflet panes/controls above the fixed ambient cartographic layer */
#interactive-map .leaflet-pane,
#interactive-map .leaflet-top,
#interactive-map .leaflet-bottom { z-index: 2; }
/* themed popup so it reads in dark mode */
[data-theme="dark"] .leaflet-popup-content-wrapper,
[data-theme="dark"] .leaflet-popup-tip { background: var(--surface); color: var(--text); }
[data-theme="dark"] .leaflet-popup-content-wrapper a { color: var(--accent); }
[data-theme="dark"] .leaflet-bar a { background: var(--surface); color: var(--text); border-color: var(--border); }

.storymap-embed { position: relative; padding-bottom: 62%; height: 0; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.storymap-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.storymap-placeholder {
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--forest-deep), var(--forest), var(--sage));
  color: var(--bone);
  padding: 2.5rem 2rem;
  min-height: 280px;
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center;
  gap: .6rem;
  transition: transform .35s var(--ease), box-shadow .35s;
}
.storymap-placeholder:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.storymap-placeholder .icon { font-size: 1.8rem; }
.storymap-placeholder h3 { color: var(--bone); }
.storymap-placeholder p { color: rgba(245,242,235,.82); font-size: .9rem; }
.storymap-placeholder code { background: rgba(0,0,0,.2); padding: 1px 5px; border-radius: 4px; font-size: .8em; }

.ba-slider { position: relative; width: 100%; aspect-ratio: 16/10; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); cursor: ew-resize; user-select: none; }
.ba-img { position: absolute; inset: 0; }
.ba-img img { width: 100%; height: 100%; object-fit: cover; }
.ba-after { clip-path: polygon(50% 0%, 100% 0%, 100% 100%, 50% 100%); }
.ba-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--bone); font-weight: 600; background: linear-gradient(135deg, var(--forest), var(--sage)); }
.ba-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--bone); transform: translateX(-50%); z-index: 3; }
.ba-knob { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: var(--bone); color: var(--forest); display: flex; align-items: center; justify-content: center; font-size: .65rem; box-shadow: var(--shadow); }
.ba-label { position: absolute; top: .6rem; font-family: var(--font-mono); font-size: .68rem; background: rgba(20,26,22,.6); color: var(--bone); padding: .2rem .5rem; border-radius: 999px; z-index: 2; }
.ba-label-before { left: .6rem; }
.ba-label-after  { right: .6rem; }

/* ── Filter bar ─────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.5rem; }
.filter-btn {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .02em;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: .5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.filter-btn:hover { border-color: var(--sage); color: var(--accent); transform: translateY(-1px); }
.filter-btn.active { background: var(--forest); color: var(--bone); border-color: var(--forest); }
[data-theme="dark"] .filter-btn.active { color: var(--forest-darker); }

/* ── Project detail ─────────────────────────────────────── */
.project-detail-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0 2.5rem;
  position: relative;
  overflow: hidden;
}
.project-detail-header::after {
  content: "";
  position: absolute;
  top: -50px; right: -50px;
  width: 280px; height: 280px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cg fill='none' stroke='%237C9885' stroke-width='1' opacity='0.3'%3E%3Cpath d='M0 140 C 60 100, 120 180, 280 120'/%3E%3Cpath d='M0 170 C 60 130, 120 210, 280 150'/%3E%3Cpath d='M0 200 C 60 160, 120 240, 280 180'/%3E%3Cpath d='M0 230 C 60 190, 120 270, 280 210'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  animation: contour-drift 24s ease-in-out infinite alternate;
}
.project-detail-header .container { position: relative; z-index: 1; }
.back-link { font-family: var(--font-mono); font-size: .78rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 1.5rem; transition: gap .2s, color .2s; }
.back-link::before { content: "←"; }
.back-link:hover { color: var(--accent); gap: .6rem; }

.project-meta-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.5rem; margin-top: 1.75rem; padding-top: 1.75rem; border-top: 1px solid var(--border); }
.project-meta-item { display: flex; flex-direction: column; gap: .25rem; }
.project-meta-label { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-2); }
.project-meta-value { font-size: .9rem; color: var(--text); font-weight: 500; }

.hero-figure { background: var(--bg); padding: 2.5rem 0; }
.hero-figure img { width: 100%; max-width: 900px; margin: 0 auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.figure-caption-c { font-size: .76rem; color: var(--text-faint); font-style: italic; text-align: center; margin-top: .75rem; }

.project-body { max-width: 820px; margin-left: auto; margin-right: auto; }
.project-section { margin-bottom: 2.75rem; }
.project-section-label { font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent-2); margin-bottom: 1rem; display: flex; align-items: center; gap: .6rem; }
.project-section-label::before { content: ""; width: 8px; height: 8px; background: var(--terracotta); transform: rotate(45deg); flex: none; }
.project-section p { margin-bottom: .5rem; color: var(--text); }
.project-section p:last-child { margin-bottom: 0; }

.research-q {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.45;
  font-style: italic;
  color: var(--text);
  padding: 1.5rem 1.75rem;
  background: var(--accent-subtle);
  border-left: 3px solid var(--forest);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.project-list { margin: 0; }
.project-list li { padding-left: 1.4rem; position: relative; margin-bottom: .6rem; color: var(--text); font-size: .94rem; }
.data-list li::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; background: var(--sage); transform: rotate(45deg); }
.limitations-list li::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; border: 1.5px solid var(--terracotta); transform: rotate(45deg); }

.methods-list { counter-reset: m; margin: 0; }
.methods-list li { counter-increment: m; padding-left: 2.4rem; position: relative; margin-bottom: .85rem; color: var(--text); font-size: .94rem; }
.methods-list li::before {
  content: counter(m);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px;
  background: var(--forest);
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: .75rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
}
[data-theme="dark"] .methods-list li::before { color: var(--forest-darker); }

.learned-box { background: var(--accent-subtle); border: 1px solid var(--accent-border); border-radius: var(--radius-lg); padding: 1.75rem; }
.learned-box h4 { margin-bottom: 1rem; color: var(--accent); }
.learned-box p { font-size: .94rem; color: var(--text); }

.figure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.figure-item img { width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--border); transition: transform .4s var(--ease); }
.figure-item:hover img { transform: scale(1.015); }
.figure-placeholder { width: 100%; height: 240px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.figure-caption { font-size: .78rem; color: var(--text-faint); font-style: italic; margin-top: .6rem; }

.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.data-table thead tr { background: var(--forest); color: var(--bone); }
[data-theme="dark"] .data-table thead tr { color: var(--bone); }
.data-table th { padding: .65rem 1rem; text-align: left; font-weight: 600; }
.data-table td { padding: .55rem 1rem; }
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background .2s; }
.data-table tbody tr:nth-child(even) { background: var(--bg-subtle); }
.data-table tbody tr:hover { background: var(--accent-subtle); }
.data-table tbody tr:last-child { border-bottom: none; }
.num-neg { color: var(--terracotta-d); font-weight: 600; }
.num-pos { color: #3B82C4; }
[data-theme="dark"] .num-pos { color: #6BA8DC; }

.project-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.75rem; border-top: 1px solid var(--border); }
.project-nav a { font-family: var(--font-mono); font-size: .8rem; color: var(--accent); font-weight: 500; transition: color .2s; }
.project-nav a:hover { color: var(--terracotta); }

/* ── CTA strip ──────────────────────────────────────────── */
.cta-strip { background: var(--forest); color: var(--bone); position: relative; overflow: hidden; }
[data-theme="dark"] .cta-strip { background: linear-gradient(165deg, #1E3329, #0F1714); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cta-strip::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='400'%3E%3Cg fill='none' stroke='%237C9885' stroke-width='1' opacity='0.4'%3E%3Cpath d='M-50 200 C 200 140, 400 260, 650 180 S 1100 100, 1300 200'/%3E%3Cpath d='M-50 240 C 220 180, 420 300, 660 220 S 1110 140, 1300 240'/%3E%3Cpath d='M-50 280 C 240 220, 440 340, 680 260 S 1120 180, 1300 280'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover; opacity: .55;
  animation: hero-contour 26s ease-in-out infinite alternate;
}
.cta-strip .container { position: relative; z-index: 1; text-align: center; }
/* outline buttons sit on the dark forest strip — use light text/border so they stay legible */
.cta-strip .btn-outline { color: var(--bone); border-color: rgba(245,242,235,.4); }
.cta-strip .btn-outline:hover { color: var(--bone); border-color: var(--bone); background: rgba(245,242,235,.08); }
.cta-strip h2 { color: var(--bone); margin-bottom: .85rem; }
.cta-strip p { color: rgba(245,242,235,.82); margin: 0 auto 2rem; max-width: 480px; }
.cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Footer ─────────────────────────────────────────────── */
.footer { background: var(--forest-darker); color: rgba(245,242,235,.72); padding: 3rem 0 2rem; position: relative; overflow: hidden; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 2rem; position: relative; z-index: 1; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; padding-bottom: 2rem; border-bottom: 1px solid rgba(124,152,133,.25); }
.footer-logo { font-family: var(--font-mono); font-weight: 500; color: var(--bone); font-size: 1rem; display: inline-flex; align-items: center; gap: .55rem; margin-bottom: .5rem; }
.footer-logo .logo-mark { width: 24px; height: 24px; }
.footer-tagline { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .04em; color: var(--sage-light); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-nav a { font-family: var(--font-mono); font-size: .8rem; color: rgba(245,242,235,.72); transition: color .2s; }
.footer-nav a:hover { color: var(--bone); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding-top: 1.5rem; font-family: var(--font-mono); font-size: .74rem; color: rgba(245,242,235,.5); }

/* ── Scroll reveal ──────────────────────────────────────── */
.fade-up { opacity: 0; transform: translateY(26px); transition: opacity .55s var(--ease-out), transform .55s var(--ease-out); will-change: transform, opacity; }
.fade-up.visible { opacity: 1; transform: none; }
/* stagger children within a grid when revealed together */
.reveal-stagger > * { transition-delay: var(--stagger, 0ms); }

/* counter pop */
.counted { display: inline-block; }

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .fade-up { opacity: 1; transform: none; }
  .ambient-graticule, .ambient-contours .contour-group,
  .hero::before, .cta-strip::before, .page-header::after, .cv-download-banner::after,
  .marquee-track { animation: none !important; }
  .ambient-contours path { stroke-dashoffset: 0 !important; }
  /* mobile nav: skip the cascade/clip reveal, just show/hide */
  .nav-links { clip-path: none !important; transform: none !important; }
  .nav-links li { opacity: 1 !important; transform: none !important; transition-delay: 0s !important; }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 940px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .about-layout { grid-template-columns: 1fr; gap: 2rem; }
  .about-photo-wrap { max-width: 320px; aspect-ratio: 4/4; }
  .contact-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  /* ── Mobile nav panel: unrolls from the top like a pulled-down map ── */
  .nav-links {
    position: fixed;
    top: 70px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: .85rem 1.1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    transform-origin: top center;
    /* closed state: rolled up + lifted, and clipped away */
    transform: translateY(-14px) scaleY(.96);
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    pointer-events: none;
    transition:
      transform .42s var(--ease-out),
      opacity .3s ease,
      clip-path .46s var(--ease-out);
  }
  .nav-links.open {
    transform: translateY(0) scaleY(1);
    opacity: 1;
    clip-path: inset(0 0 0 0);
    pointer-events: auto;
  }
  .nav-links li { display: block; }
  /* roomier, clearly separated rows */
  .nav-links a {
    display: block;
    padding: .95rem .75rem;
    font-size: 1rem;
    border-radius: var(--radius);
    border-bottom: 1px solid var(--border);
  }
  .nav-links li:last-of-type a { border-bottom: none; }
  .nav-links a:hover { background: var(--accent-subtle); }
  .nav-links a.active::after { display: none; }
  .nav-links a.btn-nav { margin-left: 0; margin-top: .6rem; text-align: center; padding: .85rem 1.1rem; border-bottom: none; }

  /* each row cascades in after the panel opens (staggered fade + slide-down) */
  .nav-links li {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
  }
  .nav-links.open li {
    opacity: 1;
    transform: translateY(0);
  }
  .nav-links.open li:nth-child(1) { transition-delay: .10s; }
  .nav-links.open li:nth-child(2) { transition-delay: .16s; }
  .nav-links.open li:nth-child(3) { transition-delay: .22s; }
  .nav-links.open li:nth-child(4) { transition-delay: .28s; }
  .nav-links.open li:nth-child(5) { transition-delay: .34s; }
  .nav-links.open li:nth-child(6) { transition-delay: .40s; }
  .nav-links.open li:nth-child(7) { transition-delay: .46s; }
  .nav-links.open li:nth-child(8) { transition-delay: .52s; }
  /* On mobile the toggle still lives in the bar, before the hamburger.
     The toggle is last in the DOM, so use flex order to place it ahead of
     the hamburger and push the pair to the right edge. */
  .theme-toggle { order: 2; margin: 0 .5rem 0 auto; }
  .nav-toggle   { order: 3; }
  .section { padding: 4rem 0; }
  .container { padding: 0 1.25rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding: 4.5rem 0 4rem; }
  .cv-entry { flex-direction: column; gap: .4rem; }
  .cv-download-banner { padding: 1.75rem; }
  .footer-top { flex-direction: column; }
  .about-layout, .contact-layout { gap: 2rem; }
}
