/* ============================================================
   Arkraj Biswas — Editorial Research Studio · v3
   Static, no build step.
   Tokens → base → utilities → header/drawer → hero/motif
   → sections → research index → modal → about → contact
   → footer → motion → responsive
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  --paper: #faf8f2;          /* warm mineral white */
  --stone: #f1ede1;           /* soft stone band */
  --card: #fffdf8;
  --sage-wash: #e9efe2;       /* very pale sage */
  --ink: #1f2521;             /* deep charcoal */
  --ink-soft: #49534c;
  --muted: #83877f;
  --line: #e0d9c6;
  --line-soft: rgba(31, 37, 33, 0.1);
  --accent: #33573f;          /* muted forest — primary */
  --earth: #a97a3e;           /* muted ochre — secondary, sparse */
  --shadow: 0 30px 70px -40px rgba(31, 37, 33, 0.3);
  --radius: 14px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --measure: 66ch;
  --gutter: clamp(20px, 4.5vw, 72px);
  --container: 1380px;
  --space: clamp(64px, 8vw, 128px);
}

[data-theme="dark"] {
  --paper: #0e1310;           /* near-black green */
  --stone: #141b15;
  --card: #17201a;
  --sage-wash: #1a2b1f;
  --ink: #edebe1;             /* soft ivory */
  --ink-soft: #b7bdb0;
  --muted: #878d81;
  --line: #263027;
  --line-soft: rgba(237, 235, 225, 0.1);
  --accent: #9dbea3;          /* desaturated sage */
  --earth: #c99b5f;           /* muted earth */
  --shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.7);
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s ease, color 0.5s ease;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 2px solid var(--earth); outline-offset: 3px; border-radius: 3px; }
.container { width: min(94vw, 1500px); margin: 0 auto; }
.container-narrow { width: min(94vw, 860px); margin: 0 auto; }
img, svg { max-width: 100%; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; line-height: 1.06; text-wrap: balance; }
p { margin: 0 0 1em; max-width: var(--measure); }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.meta { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* Sparse micro-label — used rarely, never as decoration */
.kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.kicker::after { content: ""; height: 1px; width: 56px; background: var(--line); }

/* ---------- 3. Progress + grain ---------- */
.progress-bar { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); z-index: 120; }
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 4. Header + drawer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 70;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav { display: flex; align-items: center; gap: 16px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--paper); display: grid; place-items: center; flex: none; transition: transform 0.4s ease; }
.brand:hover .brand-mark { transform: rotate(-14deg); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-mark { width: 36px; height: 36px; }
.lotus-bloom { transform-box: fill-box; transform-origin: 50% 100%; animation: lotusbloom 0.9s ease-out 0.25s 1 both; }
@keyframes lotusbloom {
  from { transform: scale(0.88); opacity: 0.35; }
  to { transform: scale(1); opacity: 1; }
}
.brand-text { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 0.01em; }
.brand-text em { font-style: italic; color: var(--accent); }
.nav-inline { display: flex; gap: 4px; margin-left: auto; }
.nav-inline a { text-decoration: none; color: var(--ink-soft); font-size: 0.9rem; font-weight: 500; padding: 8px 13px; border-radius: 999px; transition: background 0.25s, color 0.25s; }
.nav-inline a:hover { background: var(--stone); color: var(--ink); }
.nav-inline a.active { color: var(--ink); background: var(--stone); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.menu-btn {
  display: none; align-items: center; gap: 9px;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); padding: 9px 15px; min-height: 44px; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em;
}
.menu-btn .bars { display: inline-flex; flex-direction: column; gap: 4px; }
.menu-btn .bars span { display: block; width: 15px; height: 1.6px; background: currentColor; transition: transform 0.3s, opacity 0.3s; }
body.menu-open .menu-btn .bars span:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
body.menu-open .menu-btn .bars span:nth-child(2) { opacity: 0; }
body.menu-open .menu-btn .bars span:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }

.scrim { position: fixed; inset: 0; z-index: 75; background: rgba(14, 19, 16, 0.4); opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
body.menu-open .scrim { opacity: 1; pointer-events: auto; }
.nav-links {
  position: fixed; top: 0; left: 0; z-index: 80;
  height: 100dvh; width: min(340px, 86vw);
  background: var(--card); border-right: 1px solid var(--line);
  transform: translateX(-103%);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; flex-direction: column; padding: 30px 32px;
}
.nav-links.open { transform: none; }
.drawer-links { display: flex; flex-direction: column; margin-top: 12px; }
.drawer-links a.drawer-link {
  font-family: var(--font-display); font-size: 2rem; text-decoration: none;
  color: var(--ink-soft); padding: 14px 0; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: baseline; gap: 14px;
  transition: color 0.25s, padding-left 0.3s ease;
}
.drawer-links a.drawer-link .n { font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted); }
.drawer-links a.drawer-link:hover { color: var(--ink); padding-left: 10px; }
.drawer-links a.drawer-link.active { color: var(--ink); }
.drawer-foot { margin-top: auto; }

/* Theme toggle */
.theme-toggle { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px; min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; transition: border-color 0.25s; }
.theme-toggle:hover { border-color: var(--accent); }
.toggle-track { display: block; width: 58px; height: 30px; border-radius: 999px; background: var(--stone); position: relative; }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--earth); display: grid; place-items: center; color: #fff; transition: transform 0.45s cubic-bezier(0.34, 1.3, 0.64, 1), background 0.45s; }
.toggle-thumb svg { width: 14px; height: 14px; position: absolute; transition: opacity 0.3s; }
.icon-moon { opacity: 0; } .icon-sun { opacity: 1; }
[data-theme="dark"] .toggle-thumb { transform: translateX(28px); background: #2b3c4e; }
[data-theme="dark"] .icon-moon { opacity: 1; } [data-theme="dark"] .icon-sun { opacity: 0; }
.hamburger { display: none; }

/* ---------- 5. Buttons / links ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 0.93rem; padding: 13px 24px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: transform 0.22s ease, background 0.25s, border-color 0.25s, box-shadow 0.25s; background: none; color: inherit; font-family: inherit; }
.btn:hover { transform: translateY(-2px); }
.btn .arr { transition: transform 0.25s ease; }
.btn:hover .arr { transform: translateX(5px); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { box-shadow: var(--shadow); }
.btn-line { border-color: var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--accent); }
.btn-light { background: #f6f1e4; color: #20261f; }
.text-link { color: var(--accent); font-weight: 600; text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 100% 1px; background-repeat: no-repeat; background-position: 0 100%; padding-bottom: 2px; transition: background-size 0.3s ease; }
.text-link:hover { background-size: 0% 1px; }

/* ---------- 6. Hero (full-viewport editorial composition) ---------- */
.hero { padding: clamp(48px, 7vh, 96px) 0 clamp(48px, 6vw, 88px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(36px, 4.5vw, 88px); align-items: center; }
.hero-role { font-size: clamp(0.95rem, 1.2vw, 1.05rem); color: var(--ink-soft); max-width: 28rem; margin: 0 0 26px; }
.hero-name { font-size: clamp(3.6rem, 8.6vw, 7.5rem); line-height: 0.93; margin: 0 0 28px; letter-spacing: -0.035em; }
.hero-name span { display: block; }
.hero-name .surname { font-style: italic; font-weight: 400; color: var(--accent); }
.hero-statement { font-family: var(--font-display); font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.4; color: var(--ink); max-width: 30rem; margin: 0 0 14px; }
.hero-sub { color: var(--ink-soft); max-width: 32rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.hero-domains { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.hero-domains span { font-size: 0.85rem; color: var(--muted); }

/* Motif visual — pixel grid dissolving into contours */
.visual-frame { position: relative; }
.visual-frame figure { margin: 0; }
.motif {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 4.4;
  border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(180deg, var(--sage-wash), var(--paper) 70%);
  color: var(--accent);
}
[data-theme="dark"] .motif { background: linear-gradient(180deg, #18261d, var(--paper) 75%); }
.visual-caption { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; }
.north { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- 6a. Fieldwork slideshow (real photographs) ---------- */
.slideshow { width: clamp(300px, 34vw, 500px); justify-self: end; }
.slideshow figure { margin: 0; }
.slides-frame {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  border: 1px solid var(--line); border-radius: 4px; background: var(--stone);
  box-shadow: var(--shadow);
}
.slides-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; opacity: 0;
  transition: opacity 0.9s ease;
}
.slides-frame img.current { opacity: 1; }
.slides-ui { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 12px; }
.slides-bar { height: 2px; background: var(--line-soft); margin-top: 10px; overflow: hidden; border-radius: 2px; }
.slides-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.slides-bar.go i { animation: slideprog 5s linear forwards; }
@keyframes slideprog { from { width: 0; } to { width: 100%; } }
.slides-ctrl { display: flex; gap: 8px; margin-top: 12px; }
.slide-btn {
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft);
  border-radius: 999px; padding: 7px 14px; min-height: 44px; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em;
  transition: border-color 0.25s, color 0.25s;
}
.slide-btn:hover { border-color: var(--accent); color: var(--ink); }

/* Download buttons (Climate Lens + Earth / Now exports) */
.dl-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.dl-btn {
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft);
  border-radius: 999px; padding: 8px 16px; min-height: 44px; cursor: pointer;
  font-family: inherit; font-size: 0.84rem; font-weight: 600;
  transition: border-color 0.25s, color 0.25s, opacity 0.25s;
}
.dl-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--ink); }
.dl-btn:disabled { opacity: 0.45; cursor: default; }

/* Static editorial photograph frame (profile, bio) */
.photo-frame {
  aspect-ratio: 4 / 5; overflow: hidden;
  border: 1px solid var(--line); border-radius: 4px; background: var(--stone);
  box-shadow: var(--shadow);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }

/* Wide editorial photograph frame (project features) */
.photo-wide {
  aspect-ratio: 16 / 10; overflow: hidden;
  border: 1px solid var(--line); border-radius: 4px; background: var(--stone);
  box-shadow: var(--shadow);
}
.photo-wide img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.photo-wide.contain img { object-fit: contain; background: var(--stone); }
/* Hero figure: contained scientific maps, capped height, legend-safe */
.photo-hero {
  overflow: hidden;
  border: 1px solid var(--line); border-radius: 4px; background: var(--stone);
  box-shadow: var(--shadow);
  max-height: clamp(350px, 44vw, 430px);
}
.photo-hero img { width: 100%; height: 100%; max-height: inherit; object-fit: contain; object-position: center; display: block; }
@media (max-width: 900px) { .photo-hero { max-height: 300px; } }
@media (max-width: 560px) { .photo-hero { max-height: 250px; } }
.visual-caption a { color: inherit; }

/* Fieldwork grid (research page documentation strip) */
.field-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); }
.field-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .field-grid.cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .field-grid.cols-3 { grid-template-columns: 1fr; }
  .field-grid.cols-3 .frame { aspect-ratio: 4 / 3; }
}
.field-grid figure { margin: 0; }
.field-grid .frame {
  aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--line);
  border-radius: 4px; background: var(--stone);
}
.field-grid img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; transition: transform 0.6s ease; }
.field-grid figure:hover img { transform: scale(1.025); }

/* Thumbnail research row (home features) */
.index-row .row-thumb { width: 96px; height: 120px; object-fit: cover; object-position: center; border-radius: 6px; border: 1px solid var(--line); flex: none; }
.index-row.thumb-row { grid-template-columns: 110px 1fr auto; align-items: center; }
@media (max-width: 900px) {
  .index-row .row-thumb { width: 100%; height: 180px; }
  .index-row.thumb-row { grid-template-columns: 1fr; }
}

/* Research figures (white-background charts stay legible in both themes) */
.fig-block { margin: 34px 0 0; max-width: 920px; }
.fig-block:first-of-type { margin-top: 26px; }
.fig-frame { border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 10px; }
.fig-frame img { width: 100%; height: auto; display: block; }

/* Lightbox (project figure enlargement) */
.lightbox { position: fixed; inset: 0; z-index: 110; background: rgba(14, 19, 16, 0.88); display: grid; place-items: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1100px, 94vw); text-align: center; }
.lightbox img { max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: 4px; background: #fff; }
.lightbox figcaption { color: #edebe1; margin: 12px 0; }
.lightbox .btn { margin-top: 4px; }

/* Atlas (research page visual index) */
.atlas-index { display: flex; gap: 8px 26px; flex-wrap: wrap; margin: 22px 0 8px; }
.atlas-index a { color: var(--ink-soft); text-decoration: none; font-size: 0.92rem; font-weight: 600; border-bottom: 1px solid var(--line); padding-bottom: 3px; transition: color 0.25s, border-color 0.25s; }
.atlas-index a:hover { color: var(--accent); border-color: var(--accent); }
.atlas-feature { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(24px, 4vw, 52px); align-items: center; margin-top: 30px; padding-top: 30px; border-top: 1px solid var(--line-soft); }
.atlas-feature h3 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); margin: 10px 0 10px; }
.atlas-entry { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 52px); margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line-soft); }
.atlas-entry h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); margin: 10px 0 8px; }
@media (max-width: 900px) { .atlas-feature, .atlas-entry { grid-template-columns: 1fr; } }

/* Global stripes */
.stripe-wrap { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; margin-top: 6px; border-radius: 6px; overflow: hidden; }
.stripe-wrap span { display: block; height: clamp(64px, 9vw, 110px); min-width: 2px; }
.stripe-legend { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.stripe-bar { display: inline-block; width: 140px; height: 10px; border-radius: 5px; background: linear-gradient(90deg, rgb(47,109,179), rgb(239,233,220) 50%, rgb(194,94,58)); border: 1px solid var(--line-soft); }

/* Breadcrumb (project pages) */
.breadcrumb { padding: 26px 0 0; font-size: 0.88rem; color: var(--muted); }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- 7. Section rhythm ---------- */
.section { padding: clamp(64px, 8vw, 120px) 0; }
.section-tight { padding: clamp(48px, 6vw, 84px) 0; }
.band { background: var(--stone); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: end; margin-bottom: clamp(32px, 4vw, 56px); }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); margin: 0; }
.section-head p { margin: 0; color: var(--ink-soft); justify-self: end; max-width: 26rem; }

/* Taxonomy (What I investigate) */
.taxonomy { border-top: 1px solid var(--ink); }
.tax-row {
  display: grid; grid-template-columns: 72px 1fr 40px; gap: 20px; align-items: baseline;
  padding: 24px 4px; border-bottom: 1px solid var(--line-soft);
  text-decoration: none; color: inherit;
  transition: padding-left 0.3s ease, background 0.3s ease;
}
.tax-row:hover { padding-left: 16px; background: color-mix(in srgb, var(--sage-wash) 55%, transparent); }
.tax-row .t-num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.tax-row h3 { margin: 0 0 6px; font-size: clamp(1.4rem, 2.8vw, 2rem); }
.tax-row .t-desc { margin: 0; font-size: 0.93rem; color: var(--muted); max-width: 44rem; }
.tax-row .t-arrow { font-size: 1.2rem; color: var(--accent); transition: transform 0.3s ease; justify-self: end; }
.tax-row:hover .t-arrow { transform: translateX(6px); }

/* Feature (Selected research lead) */
.feature { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(28px, 4vw, 56px); align-items: center; margin-bottom: 8px; }
.feature-visual .motif { aspect-ratio: 16 / 10.5; }
.feature h3 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); margin: 14px 0 12px; }
.feature h3 a { color: inherit; text-decoration: none; }
.feature h3 a:hover { color: var(--accent); }
.feature p { color: var(--ink-soft); }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 18px 0 22px; }
.meta-row div { display: flex; flex-direction: column; gap: 1px; }
.meta-row dt { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.meta-row dd { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }

/* Index rows (research ledger — home + archive) */
.index-list { border-top: 1px solid var(--ink); }
.index-row {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 22px; align-items: baseline;
  padding: 22px 4px; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; transition: padding-left 0.3s ease, background 0.3s ease;
}
.index-row:hover { padding-left: 16px; background: color-mix(in srgb, var(--sage-wash) 50%, transparent); }
.index-row .i-year { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); }
.index-row h3, .index-row h4 { margin: 0 0 4px; font-size: clamp(1.2rem, 2.2vw, 1.6rem); line-height: 1.25; }
.index-row .i-sub { color: var(--ink-soft); font-size: 0.93rem; margin: 0; max-width: 46rem; }
.index-row .i-side { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.index-row .i-method { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.index-row .i-open { color: var(--accent); font-weight: 600; font-size: 0.88rem; }
.index-row .i-open .arr { display: inline-block; transition: transform 0.25s ease; }
.index-row:hover .i-open .arr { transform: translateX(5px); }
.tag { display: inline-block; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); }
.tag-climate { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }
.tag-environment { background: var(--sage-wash); border-color: transparent; color: var(--accent); }
.tag-agriculture { border-color: color-mix(in srgb, var(--earth) 55%, transparent); color: var(--earth); }
.tag-justice { background: var(--sage-wash); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }

/* Methods band — typography only */
.methods-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; border-top: 1px solid var(--line); padding-top: 32px; }
.methods-grid h3 { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.methods-grid ul { list-style: none; margin: 0; padding: 0; }
.methods-grid li { font-family: var(--font-display); font-size: 1.35rem; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.methods-grid li:last-child { border-bottom: none; }

/* Bio split */
.bio-grid { display: grid; grid-template-columns: 1fr 0.85fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.bio-grid h2 { font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 20px; }
.portrait-frame .motif { aspect-ratio: 4 / 5; }

/* Notes list */
.notes-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--ink); }
.note-cell { padding: 26px 26px 22px 0; border-bottom: 1px solid var(--line-soft); }
.note-cell + .note-cell { padding-left: 26px; border-left: 1px solid var(--line-soft); }
.note-cell h3 { font-size: 1.25rem; margin: 10px 0 8px; line-height: 1.3; }
.note-cell p { font-size: 0.9rem; color: var(--ink-soft); }

/* Contact close */
.contact-close { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 32px; align-items: end; }
.contact-close h2 { font-size: clamp(2.6rem, 6vw, 4.6rem); margin: 0; }
.contact-close h2 em { font-style: italic; color: var(--accent); }

/* CTA card (kept minimal, used sparingly) */
.cta-band { border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(30px, 4vw, 48px); display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; flex-wrap: wrap; background: var(--card); }
.cta-band h2 { margin: 0 0 8px; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.cta-band p { margin: 0; color: var(--ink-soft); }

/* ---------- 8. Research archive ---------- */
.page-hero { padding: clamp(56px, 7vw, 96px) 0 8px; }
.page-hero h1 { font-size: clamp(2.8rem, 6.4vw, 5rem); margin: 0 0 18px; }
.page-hero h1 em { font-style: italic; color: var(--accent); }
.page-hero .lede { font-size: 1.08rem; color: var(--ink-soft); max-width: 40rem; }
.archive-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 34px 0 6px; border-top: 1px solid var(--line-soft); padding-top: 20px; }
.research-controls { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; margin: 18px 0 8px; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn { border: none; border-bottom: 1px solid transparent; background: none; color: var(--muted); padding: 8px 12px; min-height: 44px; cursor: pointer; font-size: 0.88rem; font-weight: 600; font-family: inherit; transition: color 0.25s, border-color 0.25s; }
.filter-btn:hover { color: var(--ink); }
.filter-btn.active { color: var(--ink); border-color: var(--accent); }
.search-box { display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); padding: 7px 2px; min-width: min(300px, 100%); transition: border-color 0.25s; }
.search-box:focus-within { border-color: var(--accent); }
.search-box svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.search-box input { border: none; background: none; outline: none; color: var(--ink); font-size: 0.92rem; width: 100%; font-family: inherit; }
.empty-state { padding: 56px 0; text-align: left; }
.archive-feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: center; padding: clamp(28px, 4vw, 48px) 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line-soft); margin: 26px 0 6px; }
.archive-feature h2 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); margin: 12px 0; }

/* ---------- 9. Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(14, 19, 16, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 100; display: grid; place-items: end center; transition: opacity 0.3s ease; }
.modal-backdrop[hidden] { display: none; }
.modal { background: var(--paper); color: var(--ink); border-top: 1px solid var(--line); max-width: 720px; width: 100%; max-height: 88dvh; overflow-y: auto; padding: clamp(30px, 5vw, 56px); position: relative; animation: sheetUp 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes sheetUp { from { transform: translateY(36px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 760px) {
  .modal-backdrop { place-items: center; padding: 32px; }
  .modal { border: 1px solid var(--line); animation: modalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
  @keyframes modalIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
}
.modal-close { position: sticky; top: 0; float: right; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 8px 15px; cursor: pointer; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; margin-left: 14px; transition: border-color 0.25s; }
.modal-close:hover { border-color: var(--accent); }
.modal h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 14px 0 10px; padding-right: 32px; }
.modal-rule { border: none; border-top: 1px solid var(--line-soft); margin: 24px 0; }
.modal-body p { color: var(--ink-soft); }
.modal-body h4 { font-family: var(--font-display); font-size: 1.15rem; margin: 1.6em 0 0.4em; }
.modal-foot { margin-top: 28px; border-top: 1px solid var(--line-soft); padding-top: 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- 10. About ---------- */
.about-open { padding: clamp(56px, 7vw, 96px) 0 clamp(32px, 4vw, 56px); }
.about-open h1 { font-size: clamp(2.8rem, 6.4vw, 5rem); margin: 0 0 20px; }
.about-open h1 em { font-style: italic; color: var(--accent); }
.about-cols { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(32px, 5vw, 72px); padding: 40px 0; border-top: 1px solid var(--line-soft); }
.about-cols h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 14px; }
.interest-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; margin-top: 8px; }
.interest-groups span { font-family: var(--font-display); font-size: 1.2rem; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.interest-block { padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.interest-block:first-child { padding-top: 0; }
.interest-block:last-child { border-bottom: none; }
.interest-block h3 { margin: 0 0 4px; font-size: 1.25rem; }
.interest-block p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.contact-interests { list-style: none; margin: 10px 0 0; padding: 0; }
.contact-interests li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.95rem; }
.contact-interests li::before { content: "→  "; color: var(--accent); }
.contact-interests li:last-child { border-bottom: none; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.timeline li:last-child { border-bottom: none; }
.timeline .t-when { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); padding-top: 4px; }
.timeline strong { font-family: var(--font-display); font-weight: 500; font-size: 1.08rem; display: block; }
.timeline p { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.93rem; }

/* ---------- 11. Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); padding: 24px 0 clamp(64px, 8vw, 110px); align-items: start; }
.contact-form { display: flex; flex-direction: column; gap: 18px; border-top: 1px solid var(--ink); padding-top: 26px; }
.contact-form label { display: flex; flex-direction: column; gap: 7px; font-size: 0.86rem; font-weight: 600; }
.contact-form input, .contact-form select, .contact-form textarea { font-family: inherit; font-size: 0.95rem; padding: 12px 2px; border: none; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); outline: none; border-radius: 0; transition: border-color 0.25s; width: 100%; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { border-color: var(--accent); }
.form-success { color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.detail-list { border-top: 1px solid var(--ink); }
.detail-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.94rem; }
.detail-row a { color: var(--accent); font-weight: 600; text-decoration: none; }
.placeholder-box { font-family: var(--font-mono); font-size: 0.82rem; background: var(--stone); border: 1px dashed var(--earth); border-radius: 8px; padding: 12px 14px; margin: 14px 0; word-break: break-all; }
.status-flag { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.status-flag.live { border-color: var(--accent); color: var(--accent); }
.status-flag.soon { border-style: dashed; }

/* ---------- 12a. Research groups / trajectory / Earth-Now ---------- */
.group-head { display: flex; align-items: baseline; gap: 16px; margin: clamp(30px, 4vw, 48px) 0 4px; }
.group-head:first-child { margin-top: 8px; }
.group-head h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); margin: 0; }
.group-head .meta { margin-left: auto; }
.ongoing-flag { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper); background: var(--accent); border-radius: 999px; padding: 5px 12px; }

.trajectory { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); }
.trajectory li { padding: 18px 18px 6px 0; border-bottom: 1px solid var(--line-soft); }
.trajectory li + li { padding-left: 18px; border-left: 1px solid var(--line-soft); }
.trajectory strong { display: block; font-family: var(--font-display); font-weight: 500; font-size: 1.02rem; line-height: 1.35; }
.trajectory span { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* Earth / Now — scientist's data panel, not a weather app */
.earth-band { background: var(--stone); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.earth-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.earth-place { font-family: var(--font-display); font-size: clamp(1.6rem, 2.8vw, 2.3rem); margin: 6px 0 0; }
.earth-temp { font-family: var(--font-display); font-size: clamp(4.5rem, 9vw, 7.5rem); line-height: 1; letter-spacing: -0.04em; margin: 8px 0 0; }
.earth-temp small { font-size: 0.32em; font-style: italic; color: var(--accent); letter-spacing: 0; }
.earth-cond { color: var(--ink-soft); margin: 6px 0 0; }
.earth-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); margin-top: 22px; }
.earth-meta div { padding: 14px 14px 12px 0; border-bottom: 1px solid var(--line-soft); }
.earth-meta div:nth-child(3n+2), .earth-meta div:nth-child(3n) { padding-left: 14px; border-left: 1px solid var(--line-soft); }
.earth-meta dt { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.earth-meta dd { margin: 2px 0 0; font-size: 1.02rem; }
.earth-meta dd small { display: block; font-size: 0.78rem; color: var(--muted); }
.earth-search { display: flex; gap: 10px; margin-top: 22px; max-width: 26rem; position: relative; flex-wrap: wrap; }
.earth-search input { flex: 1 1 200px; font-family: inherit; font-size: 0.95rem; padding: 12px 2px; border: none; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); outline: none; border-radius: 0; }
.earth-search input:focus { border-color: var(--accent); }
.place-results { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line-soft); }
.place-results li button { width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--line-soft); padding: 11px 2px; cursor: pointer; color: var(--ink); font-family: inherit; font-size: 0.92rem; transition: padding-left 0.25s ease; }
.place-results li button:hover { padding-left: 8px; color: var(--accent); }
.place-results li button small { color: var(--muted); }
.earth-status { margin-top: 18px; max-width: 30rem; }
.forecast-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); margin-top: 30px; }
.forecast-day { padding: 14px 10px 4px 0; }
.forecast-day + .forecast-day { padding-left: 12px; border-left: 1px solid var(--line-soft); }
.forecast-day .dow { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.forecast-day .tmax { font-family: var(--font-display); font-size: 1.35rem; }
.forecast-day .tmin { color: var(--muted); font-size: 0.88rem; }
.forecast-day .pp { font-size: 0.76rem; color: var(--muted); }
.earth-attrib { margin-top: 26px; }

/* ---------- 12b. Climate Lens + Biodiversity Pulse ---------- */
.lens-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.lens-controls { display: flex; flex-direction: column; gap: 16px; }
.lens-search { display: flex; gap: 10px; max-width: 26rem; }
.lens-search input { flex: 1 1 180px; font-family: inherit; font-size: 0.95rem; padding: 12px 2px; border: none; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); outline: none; border-radius: 0; }
.lens-search input:focus { border-color: var(--accent); }
.var-row { display: flex; gap: 8px; flex-wrap: wrap; }
.var-btn { border: 1px solid var(--line); background: transparent; color: var(--ink-soft); border-radius: 999px; padding: 8px 16px; cursor: pointer; font-family: inherit; font-size: 0.85rem; font-weight: 600; transition: background 0.25s, color 0.25s, border-color 0.25s; }
.var-btn:hover { border-color: var(--accent); color: var(--ink); }
.var-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.lens-chart { border-top: 1px solid var(--ink); padding-top: 18px; }
.lens-chart svg { display: block; width: 100%; height: auto; }
.lens-skeleton { border: 1px dashed var(--line); border-radius: 8px; padding: 44px 20px; text-align: center; color: var(--muted); font-size: 0.9rem; }
.lens-skeleton span { display: inline-block; animation: lenspulse 1.6s ease-in-out infinite; }
@keyframes lenspulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.lens-canvas-wrap { position: relative; height: 340px; }
.lens-data { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.lens-data summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; padding: 4px 0; min-height: 44px; display: flex; align-items: center; }
.lens-table-scroll { overflow-x: auto; }
.lens-data table { border-collapse: collapse; width: 100%; font-size: 0.85rem; margin: 8px 0 4px; }
.lens-data th, .lens-data td { border-bottom: 1px solid var(--line-soft); padding: 7px 10px 7px 0; text-align: left; white-space: nowrap; }
.lens-data th[scope="col"] { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 900px) { .lens-canvas-wrap { height: 300px; } }
@media (max-width: 560px) { .lens-canvas-wrap { height: 260px; } }
@media (prefers-reduced-motion: reduce) { .lens-skeleton span { animation: none; } }
.pulse-strip { margin-top: 30px; border-top: 1px solid var(--line-soft); padding-top: 18px; }
.pulse-strip[hidden] { display: none; }

/* ---------- 12. Footer ---------- */
.site-footer { border-top: 1px solid var(--line-soft); padding: 44px 0 32px; }
.footer-grid { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; align-items: flex-start; }
.footer-name { font-family: var(--font-display); font-size: 1.5rem; margin: 0; }
.footer-name em { font-style: italic; color: var(--accent); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-soft); text-decoration: none; font-size: 0.88rem; transition: color 0.25s; }
.footer-links a:hover { color: var(--ink); }
.footer-links a[aria-disabled="true"] { color: var(--muted); cursor: default; }
.footer-base { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line-soft); }

/* ---------- 13a. Dark theme — late-evening studio tuning ---------- */
[data-theme="dark"] {
  --line: #2c382d;
  --line-soft: rgba(237, 235, 225, 0.08);
  --shadow: 0 30px 70px -44px rgba(0, 0, 0, 0.75);
}
[data-theme="dark"] .site-header { background: color-mix(in srgb, var(--paper) 90%, transparent); }
[data-theme="dark"] .nav-links { background: #131a14; }
[data-theme="dark"] .slides-frame,
[data-theme="dark"] .field-grid .frame { border-color: #33402f; box-shadow: 0 30px 70px -44px rgba(0, 0, 0, 0.8); }
[data-theme="dark"] .slides-frame img,
[data-theme="dark"] .field-grid img { filter: brightness(0.94) saturate(0.96); }
[data-theme="dark"] .btn-solid { background: var(--ink); }
[data-theme="dark"] .filter-btn.active { border-color: var(--accent); }
[data-theme="dark"] .index-row:hover,
[data-theme="dark"] .tax-row:hover { background: rgba(157, 190, 163, 0.07); }
[data-theme="dark"] .modal { background: #121814; }
[data-theme="dark"] .earth-band { background: #121915; }
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea { color-scheme: dark; }
[data-theme="dark"] .drawer-links a.drawer-link:hover { background: rgba(157, 190, 163, 0.06); border-radius: 8px; }
[data-theme="dark"] .slide-btn:hover { border-color: var(--accent); color: var(--ink); background: rgba(157, 190, 163, 0.06); }
[data-theme="dark"] .place-results li button:hover { color: var(--accent); }
[data-theme="dark"] .modal-close { background: #1a231c; }
[data-theme="dark"] .cta-band { background: #141b15; }
[data-theme="dark"] .kicker { color: var(--accent); }

/* ---------- 13. Reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- 14. Responsive ---------- */
@media (min-width: 901px) {
  /* Lift the About portrait toward the heading on desktop only */
  .about-open .portrait-frame { transform: translateY(-clamp(20px, 3vw, 40px)); }
}
@media (max-width: 1020px) {
  .nav-inline { display: none; }
  .menu-btn { display: inline-flex; }
  .trajectory { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trajectory li:nth-child(3) { padding-left: 0; border-left: none; }
}
@media (max-width: 900px) {
  .hero-grid, .feature, .archive-feature, .earth-grid, .lens-grid, .bio-grid, .contact-close, .contact-grid, .about-cols { grid-template-columns: 1fr; }
  .slideshow { width: 100%; max-width: 380px; justify-self: start; }
  .slides-frame { max-height: 58vh; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .section-head { grid-template-columns: 1fr; }
  .section-head p { justify-self: start; }
  .tax-row { grid-template-columns: 44px 1fr 28px; gap: 14px; }
  .index-row { grid-template-columns: 1fr; gap: 8px; }
  .index-row .i-side { text-align: left; align-items: flex-start; flex-direction: row; gap: 12px; flex-wrap: wrap; }
  .methods-grid { grid-template-columns: 1fr; gap: 24px; }
  .notes-list { grid-template-columns: 1fr; }
  .note-cell + .note-cell { padding-left: 0; border-left: none; }
  .note-cell { padding-right: 0; }
  .about-cols { gap: 8px; }
  .earth-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .earth-meta div:nth-child(3n+2), .earth-meta div:nth-child(3n) { padding-left: 0; border-left: none; }
  .earth-meta div:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line-soft); }
  .forecast-strip { grid-template-columns: repeat(7, minmax(92px, 1fr)); overflow-x: auto; }
}
@media (max-width: 560px) {
  .trajectory { grid-template-columns: 1fr; }
  .trajectory li + li { padding-left: 0; border-left: none; }
  .group-head { flex-wrap: wrap; gap: 8px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .frame { aspect-ratio: 4 / 3; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .modal { animation: none; }
  .nav-links { transition: none; }
  .slides-frame img { transition: none; }
  .slides-bar.go i { animation: none; }
  .lotus-bloom { animation: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
