/* ============================================================
   Balaji Senapati — personal academic website
   ============================================================ */

:root {
  --ink: #0f1d2e;
  --ink-soft: #3d4b5c;
  --muted: #6b7887;
  --line: #e3e7ec;
  --paper: #ffffff;
  --tint: #f5f7f9;
  --navy: #0b2540;
  --navy-deep: #06182b;
  --ocean: #1f6f8b;
  --ocean-soft: #e6f1f5;
  --gold: #e8c47a;
  --amber: #b7791f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 29, 46, .04), 0 8px 24px rgba(15, 29, 46, .06);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --maxw: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--ocean); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.8rem, 3.2vw, 2.5rem); letter-spacing: -.01em; margin-bottom: 1.5rem; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 .9rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 104px 0; }
.section--tint { background: var(--tint); }
.section--dark { background: var(--navy); color: #dbe4ee; }
.section__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 1.5rem; }
.section__head h2 { margin-bottom: 0; }

.kicker {
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ocean); margin-bottom: .6rem;
}
.kicker--light { color: var(--gold); }

.grid-2 { display: grid; grid-template-columns: 1fr 1.5fr; gap: 64px; }
.grid-2--even { grid-template-columns: 1fr 1fr; }

/* ---------------- NAV ---------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.nav.is-scrolled { background: rgba(255, 255, 255, .9); backdrop-filter: saturate(160%) blur(12px); box-shadow: 0 1px 0 var(--line); }
.nav__inner { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; height: 68px; display: flex; align-items: center; justify-content: space-between; }
.nav__brand { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; color: #fff; }
.nav.is-scrolled .nav__brand { color: var(--ink); }
.nav__brand:hover { text-decoration: none; }
.nav__links { display: flex; gap: 4px; align-items: center; }
.nav__links a { color: rgba(255, 255, 255, .8); font-size: .9rem; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.nav__links a:hover { color: #fff; text-decoration: none; background: rgba(255, 255, 255, .08); }
.nav.is-scrolled .nav__links a { color: var(--ink-soft); }
.nav.is-scrolled .nav__links a:hover, .nav.is-scrolled .nav__links a.is-active { color: var(--ink); background: var(--tint); }
.nav__links a.nav__cta { border: 1px solid rgba(255, 255, 255, .35); margin-left: 8px; color: #fff; }
.nav.is-scrolled .nav__links a.nav__cta { border-color: var(--ink); color: var(--ink); }
.nav__toggle { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; position: relative; }
.nav__toggle span { position: absolute; left: 10px; right: 10px; height: 2px; background: #fff; transition: transform .25s, top .25s; }
.nav__toggle span:first-child { top: 15px; }
.nav__toggle span:last-child { top: 23px; }
.nav.is-scrolled .nav__toggle span, .nav.is-open .nav__toggle span { background: var(--ink); }
.nav.is-open .nav__toggle span:first-child { top: 19px; transform: rotate(45deg); }
.nav.is-open .nav__toggle span:last-child { top: 19px; transform: rotate(-45deg); }

/* ---------------- HERO ---------------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  background: radial-gradient(1200px 700px at 78% 40%, #123a5e 0%, var(--navy) 45%, var(--navy-deep) 100%);
  color: #fff; overflow: hidden;
}
#wave { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__inner {
  position: relative; z-index: 1; max-width: var(--maxw); width: 100%; margin: 0 auto;
  padding: 120px 24px 96px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center;
}
.eyebrow { font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 1.25rem; }
.hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.8rem, 6.4vw, 5rem); letter-spacing: -.02em; line-height: 1.02; }
.hero__role { font-family: var(--serif); font-size: clamp(1.15rem, 2vw, 1.45rem); font-weight: 400; color: #c9d7e6; margin: 1rem 0 1.5rem; font-style: italic; }
.hero__lede { font-size: 1.08rem; color: #aebfd1; max-width: 560px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 2rem 0 2.25rem; }
.btn { display: inline-flex; align-items: center; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem; transition: transform .15s, background .2s, border-color .2s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--gold); color: var(--navy-deep); }
.btn--primary:hover { background: #f0d392; }
.btn--ghost { border: 1px solid rgba(255, 255, 255, .35); color: #fff; }
.btn--ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .06); }

.profiles { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.profiles a { display: inline-flex; align-items: center; gap: 8px; color: #b8c7d8; font-size: .88rem; font-weight: 500; }
.profiles a:hover { color: #fff; text-decoration: none; }
.profiles svg { width: 18px; height: 18px; fill: currentColor; }

.hero__portrait {
  position: relative; margin: 0; justify-self: end; width: min(320px, 100%); aspect-ratio: 1 / 1;
  border-radius: 24px; overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
}
.hero__portrait img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.hero__monogram {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-size: 6rem; color: rgba(232, 196, 122, .85); letter-spacing: .04em;
}
.hero__scroll { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 1; width: 26px; height: 42px; border: 1.5px solid rgba(255, 255, 255, .4); border-radius: 14px; }
.hero__scroll span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: #fff; animation: scroll 1.8s infinite; }
@keyframes scroll { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------------- ABOUT ---------------- */
.prose p { font-size: 1.08rem; color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 2.25rem 0 0; }
.stats div { border-top: 2px solid var(--ink); padding-top: 14px; }
.stats dt { font-family: var(--serif); font-size: 2.2rem; font-weight: 500; line-height: 1; }
.stats dd { margin: 8px 0 0; font-size: .85rem; color: var(--muted); line-height: 1.4; }

/* ---------------- RESEARCH ---------------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 1px 2px rgba(15, 29, 46, .05), 0 18px 40px rgba(15, 29, 46, .1); }
.card__icon { width: 52px; height: 52px; border-radius: 12px; background: var(--ocean-soft); display: grid; place-items: center; margin-bottom: 20px; }
.card__icon svg { width: 30px; height: 30px; fill: none; stroke: var(--ocean); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; margin-bottom: .75rem; }
.card p { color: var(--ink-soft); font-size: .98rem; }
.card__meta { font-size: .82rem !important; color: var(--muted) !important; margin: 1.1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }

.explore-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.explore-link { display: flex; flex-direction: column; gap: 6px; padding: 24px 28px; border-radius: var(--radius); background: var(--navy); color: #dbe4ee; transition: background .2s; }
.explore-link:hover { text-decoration: none; background: #0f3050; }
.explore-link__label { font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.explore-link__title { font-family: var(--serif); font-size: 1.35rem; color: #fff; }
.explore-link__title::after { content: " →"; }
.explore-link__text { font-size: .95rem; color: #aebfd1; }

/* ---------------- PUBLICATIONS ---------------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; background: var(--tint); border-radius: 999px; }
.filter { font: inherit; font-size: .86rem; font-weight: 500; border: 0; background: none; color: var(--ink-soft); padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.filter:hover { color: var(--ink); }
.filter.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 29, 46, .12); }

.pubs { border-top: 1px solid var(--line); }
.pub { display: grid; grid-template-columns: 80px 1fr; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.pub[hidden] { display: none; }
.pub__year { font-family: var(--serif); font-size: 1.1rem; color: var(--muted); padding-top: 2px; }
.pub__title { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; margin-bottom: .4rem; }
.pub__authors { color: var(--ink-soft); font-size: .95rem; margin-bottom: .25rem; }
.pub__authors b { color: var(--ink); font-weight: 600; }
.pub__venue { font-size: .92rem; color: var(--muted); margin: 0; }
.pub__venue em { color: var(--ink-soft); }
.pub--featured { position: relative; }
.pub--featured::before { content: ""; position: absolute; left: -24px; top: 24px; bottom: 24px; width: 3px; border-radius: 2px; background: var(--gold); }
.tag { display: inline-block; margin-left: 6px; font-size: .74rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--ocean-soft); color: var(--ocean); vertical-align: 1px; }
.tag--amber { background: #fbf1dc; color: var(--amber); }
.note { margin-top: 1.5rem; color: var(--muted); font-size: .92rem; }

/* ---------------- TIMELINE ---------------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: #cfd6de; }
.timeline li { position: relative; padding-bottom: 32px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -28px; top: 7px; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ocean); }
.timeline li:first-child::before { background: var(--ocean); }
.timeline__date { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ocean); }
.timeline h3 { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; margin: .25rem 0 .15rem; }
.timeline__org { color: var(--ink); font-weight: 500; font-size: .95rem; margin-bottom: .4rem; }
.timeline p:not(.timeline__org) { color: var(--ink-soft); font-size: .95rem; margin-bottom: 0; }

.subblock { margin-top: 56px; }
.subhead { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; margin-bottom: 1rem; }

/* ---------------- TALKS ---------------- */
.events li { display: grid; grid-template-columns: 86px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.events time { font-size: .82rem; font-weight: 600; color: var(--ocean); padding-top: 2px; white-space: nowrap; }
.events strong { display: block; font-weight: 500; line-height: 1.45; }
.events span { display: block; font-size: .88rem; color: var(--muted); margin-top: 2px; }
.events--small strong { font-size: .95rem; }
.more { margin-top: 20px; }
.more summary { cursor: pointer; font-weight: 600; color: var(--ocean); font-size: .92rem; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: " +"; }
.more[open] summary::after { content: " −"; }

/* ---------------- TEACHING / MENTORING ---------------- */
.items li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.items li:first-child { padding-top: 0; }
.items h3 { font-weight: 600; margin-bottom: .2rem; }
.items p { margin: 0; font-size: .93rem; color: var(--ink-soft); }
.items p:nth-of-type(1) { color: var(--ocean); font-size: .85rem; font-weight: 500; margin-bottom: .25rem; }

.people li { display: flex; gap: 16px; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--gold); font-family: var(--serif); font-size: .95rem; }
.people h3 { margin-bottom: 2px; }
.people p { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.people__role { color: var(--muted) !important; font-size: .84rem !important; margin-bottom: 4px !important; }

.list-bullets li { position: relative; padding: 8px 0 8px 20px; font-size: .94rem; color: var(--ink-soft); }
.list-bullets li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.list-bullets strong { color: var(--ink); font-weight: 600; }

/* ---------------- AWARDS & MEDIA ---------------- */
.awards li { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.awards li:first-child { padding-top: 0; }
.awards__year { font-family: var(--serif); font-size: 1.15rem; color: var(--amber); }
.awards h3 { margin-bottom: .2rem; }
.awards p { margin: 0; font-size: .93rem; color: var(--ink-soft); }

.media { display: grid; gap: 16px; align-content: start; }
.media__card { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; background: linear-gradient(180deg, var(--paper), var(--tint)); }
.media__card--blog { background: var(--ocean-soft); border-color: transparent; }
.media__badge { display: inline-block; font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); margin-bottom: .5rem; }
.media__card h3 { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; margin-bottom: .5rem; }
.media__card p { font-size: .94rem; color: var(--ink-soft); }
.link-arrow { font-weight: 600; font-size: .9rem; }
.link-arrow::after { content: " →"; transition: margin .2s; }
.link-arrow:hover { text-decoration: none; }
.link-arrow:hover::after { margin-left: 4px; }

/* ---------------- CONTACT ---------------- */
.contact { display: grid; grid-template-columns: 1fr 1.3fr; gap: 64px; align-items: start; }
.contact h2 { color: #fff; }
.contact__lede { color: #aebfd1; font-size: 1.05rem; }
.contact__grid { display: grid; gap: 12px; }
.contact__item { display: block; padding: 20px 24px; border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius); transition: background .2s, border-color .2s; }
.contact__item:hover { text-decoration: none; background: rgba(255, 255, 255, .05); border-color: rgba(232, 196, 122, .5); }
.contact__label { display: block; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 4px; }
.contact__value { color: #fff; font-size: 1.05rem; }

.footer { background: var(--navy-deep); color: #7f93a8; font-size: .88rem; }
.footer__inner { display: flex; justify-content: space-between; padding-top: 24px; padding-bottom: 24px; }
.footer p { margin: 0; }
.footer a { color: #b8c7d8; }

/* ---------------- SUBPAGES ---------------- */
.nav.nav--solid { background: #fff; backdrop-filter: none; }
.page-head { padding: 140px 0 0; }
.page-head h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.2rem, 4.5vw, 3.2rem); letter-spacing: -.02em; margin-bottom: 1.25rem; }
.page-head .prose { max-width: 760px; }
.back-link { display: inline-block; font-weight: 600; font-size: .9rem; margin-bottom: 2rem; }
.runs { grid-template-columns: repeat(3, 1fr); }
.run__id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem !important; color: var(--ocean) !important; margin-bottom: .5rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 1rem 0 1.25rem; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--ink); }
.table-wrap { overflow-x: auto; }
.exp-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.exp-table th { text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 16px 12px 0; border-bottom: 2px solid var(--ink); }
.exp-table td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); vertical-align: top; }
.exp-table td:first-child { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; color: var(--ocean); white-space: nowrap; }
.exp-table td:last-child { white-space: nowrap; }
.callout { background: var(--ocean-soft); border-radius: var(--radius); padding: 40px; }
.callout h2 { margin-bottom: .75rem; }
.callout p { color: var(--ink-soft); max-width: 640px; margin-bottom: 1.5rem; }

/* ---------------- CLIMATE INDEX EXPLORER ---------------- */
.viz {
  --viz-pos: #e34948; --viz-neg: #2a78d6;      /* diverging pair: above / below zero */
  --viz-s1: #2a78d6; --viz-s2: #eb6834;        /* categorical slots 1-2 */
  --viz-grid: #ecebe6; --viz-axis: #c3c2b7;
}
.explorer { padding-top: 40px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.controls { display: flex; flex-wrap: wrap; gap: 20px 36px; align-items: flex-start; padding: 20px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.control { display: flex; flex-direction: column; gap: 8px; }
.control__label { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: .86rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); cursor: pointer; }
.chip:hover { border-color: var(--muted); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.years { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); }
.field { font: inherit; font-size: .9rem; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.year-input { width: 84px; font-variant-numeric: tabular-nums; }
.viz-key, .legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .85rem; color: var(--ink-soft); margin: 0 0 12px; }
.viz-key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i { display: inline-block; width: 16px; height: 2px; border-radius: 1px; margin-right: 6px; vertical-align: middle; }
.viz-key__pos { background: var(--viz-pos); opacity: .55; }
.viz-key__neg { background: var(--viz-neg); opacity: .55; }
.viz-key__s1 { background: var(--viz-s1); }
.viz-key__s2 { background: var(--viz-s2); }
.panels { position: relative; }
.panel { margin-bottom: 22px; }
.panel__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; margin-bottom: 4px; }
.panel__name { font-weight: 600; }
.panel__long { color: var(--muted); font-size: .86rem; }
.panel__latest { color: var(--ink-soft); font-size: .84rem; }
.panel__empty { color: var(--muted); font-size: .9rem; padding: 20px 0; border-bottom: 1px solid var(--line); }
.panel svg, #cmpChart svg { display: block; width: 100%; height: auto; overflow: visible; }
.panel svg:focus-visible { outline: 2px solid var(--ocean); outline-offset: 4px; border-radius: 4px; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-zero { stroke: var(--viz-axis); stroke-width: 1; }
.viz-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-pos { fill: var(--viz-pos); opacity: .45; }
.viz-neg { fill: var(--viz-neg); opacity: .45; }
.viz-line { fill: none; stroke: var(--ink-soft); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.viz-s1, .viz-s2 { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-s1 { stroke: var(--viz-s1); }
.viz-s2 { stroke: var(--viz-s2); }
.viz-line--thin { stroke-width: 1; }
.viz-cross { stroke: var(--ink); stroke-width: 1; opacity: .5; pointer-events: none; }
.viz-dot { fill: var(--ink); stroke: #fff; stroke-width: 2; pointer-events: none; }
.viz-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; padding: 10px 12px; background: #fff; border: 1px solid rgba(15, 29, 46, .1); border-radius: 10px; box-shadow: var(--shadow); font-size: .84rem; }
.viz-tip__date { color: var(--muted); font-size: .76rem; margin-bottom: 4px; }
.viz-tip__row { display: flex; justify-content: space-between; gap: 16px; }
.viz-tip__row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-tip__row span { color: var(--ink-soft); }
.table-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 8px; }
.table-view { flex: 1 1 420px; }
.table-view summary { cursor: pointer; font-weight: 600; color: var(--ocean); font-size: .92rem; }
.table-view .table-wrap { max-height: 420px; overflow: auto; margin-top: 12px; }
.data-table td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table td:first-child { color: var(--ink); font-family: var(--sans); font-size: .95rem; }
.btn--ghost-dark { border: 1px solid var(--ink); color: var(--ink); background: none; font: inherit; font-weight: 600; font-size: .9rem; padding: 8px 18px; cursor: pointer; }
.compare { display: grid; grid-template-columns: 320px 1fr; gap: 40px; align-items: start; }
.compare__side { display: flex; flex-direction: column; gap: 8px; }
.compare__side .control__label { margin-top: 8px; }
.compare__lag { font-size: .88rem; color: var(--ink-soft); margin: 0; }
.compare__chart { margin: 0; min-width: 0; }
.subhead--small { font-size: 1.05rem; margin: 24px 0 6px; }
.compare__best { font-size: .88rem; color: var(--ink-soft); margin: 6px 0 0; }
.viz-lagline { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
#cmpLag { width: 100%; accent-color: var(--navy); }
.stat { display: flex; flex-direction: column; gap: 6px; margin-top: 20px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.stat__label { font-size: .85rem; color: var(--ink-soft); }
.stat__value { font-family: var(--sans); font-size: 3rem; font-weight: 600; line-height: 1; color: var(--ink); }
.stat__meta { font-size: .8rem; color: var(--muted); }
.sources li { padding: 10px 0 10px 20px; }

/* Monsoon page: drought/flood/normal bars, ENSO/IOD/North Atlantic symbols, compact tiles */
.viz { --viz-wet: #2a78d6; --viz-dry: #e34948; --viz-normal: #9e9d97; --viz-enso: #eb6834; --viz-iod: #4a3aa7; --viz-na: #199e70; }
.monsoon-top { display: grid; grid-template-columns: 1fr minmax(320px, 400px); gap: 20px 40px; align-items: start; margin-bottom: 24px; }
.monsoon-top .controls { flex-direction: column; flex-wrap: nowrap; gap: 16px; padding: 0; margin: 0; border-bottom: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat--small { margin-top: 0; padding: 12px 14px; gap: 2px; }
.stat--small .stat__label { font-size: .78rem; }
.stat--small .stat__value { font-size: 1.5rem; }
.stat--small .stat__meta { font-size: .72rem; }
.viz-figure { margin: 0; }
.viz-figure__title { font-weight: 600; margin-bottom: 8px; }
.bars { position: relative; }
.bars svg { display: block; width: 100%; height: auto; overflow: visible; }
.bars svg:focus-visible { outline: 2px solid var(--ocean); outline-offset: 4px; border-radius: 4px; }
.bar--flood { fill: var(--viz-wet); }
.bar--drought { fill: var(--viz-dry); }
.bar--normal { fill: var(--viz-normal); }
.bar--faded { opacity: .28; }
.bar--hover { stroke: var(--ink); stroke-width: 1.5; }
.viz-key__bar--flood { background: var(--viz-wet); }
.viz-key__bar--drought { background: var(--viz-dry); }
.viz-key__bar--normal { background: var(--viz-normal); }
.viz-key__bar--faded { background: var(--viz-normal); opacity: .28; }
.viz-key svg { width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; overflow: visible; }
.sym-enso { fill: var(--viz-enso); }
.sym-iod { fill: var(--viz-iod); }
.sym-na { fill: var(--viz-na); }
.sym--open { fill: #fff; stroke-width: 1.3; }
.sym-enso.sym--open { stroke: var(--viz-enso); }
.sym-iod.sym--open { stroke: var(--viz-iod); }
.sym-na.sym--open { stroke: var(--viz-na); }
.viz-enso-line, .viz-iod-line, .viz-na-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-enso-line { stroke: var(--viz-enso); }
.viz-iod-line { stroke: var(--viz-iod); }
.viz-na-line { stroke: var(--viz-na); }
.viz-enso-line-dot, .viz-key__enso, .viz-enso-line-key { fill: var(--viz-enso); background: var(--viz-enso); }
.viz-iod-line-dot, .viz-key__iod, .viz-iod-line-key { fill: var(--viz-iod); background: var(--viz-iod); }
.viz-na-line-dot, .viz-key__na, .viz-na-line-key { fill: var(--viz-na); background: var(--viz-na); }
.viz-track-label { fill: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .06em; }
.viz-ref { stroke: var(--viz-axis); stroke-width: 1; }
.viz-band { fill: #e9e8e3; opacity: .7; }
.viz-tick--label { fill: var(--ink-soft); font-size: 12px; }
.viz-s1-dot { fill: var(--viz-s1); }
.viz-s2-dot { fill: var(--viz-s2); }
.viz-tip__key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; margin-right: 6px; vertical-align: middle; }
.viz-s1-key { background: var(--viz-s1); }
.viz-s2-key { background: var(--viz-s2); }
.prose--narrow { max-width: 760px; }
.controls--inline { border-bottom: 0; padding: 4px 0 12px; margin-bottom: 0; }

/* ---------------- WAVENUMBER-4 STORY ---------------- */
.page-head--compact { padding-top: 104px; }
.page-head--compact .back-link { margin-bottom: 1rem; }
.page-head--compact h1 { font-size: clamp(2rem, 3.4vw, 2.5rem); margin-bottom: .5rem; }
.page-head--compact .prose p { font-size: 1rem; margin-bottom: 0; }
.story-section { padding-top: 24px; }
.story { display: grid; gap: 20px; }
.story__stage { align-self: start; border-radius: 22px; overflow: hidden; background: linear-gradient(180deg, #eef6fc 0%, #f8fbfe 55%, #eaf3f9 100%); border: 1px solid var(--line); touch-action: pan-y; }
.story__stage svg { display: block; width: 100%; height: auto; user-select: none; }
.story__panel { display: flex; flex-direction: column; gap: 20px; padding: 0 4px; }
/* Wide screens: caption and controls beside the animation, so both fit on one screen */
@media (min-width: 981px) {
  .story { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 36px; align-items: stretch; }
  .story__panel { padding: 6px 0; }
  .story__controls { margin-top: auto; }
}
.story__chapter { font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ocean); margin-bottom: .4rem; }
.story__title { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; margin-bottom: .6rem; }
.story__title.reveal { opacity: 1; transform: none; }
.story__text { color: var(--ink-soft); font-size: 1rem; max-width: 680px; margin: 0; }
.story__controls { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.story__buttons { display: flex; align-items: center; gap: 14px; }
.story__buttons .btn { font: inherit; font-weight: 600; font-size: .92rem; padding: 10px 20px; border: 0; cursor: pointer; }
.story__buttons .btn--ghost-dark { border: 1px solid var(--ink); }
.story__buttons .btn:disabled { opacity: .35; cursor: default; transform: none; }
.story__count { font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.5em; text-align: center; }
.story__dots { display: flex; flex-wrap: wrap; gap: 6px; max-width: 320px; }
.story__hint { font-size: .8rem; color: var(--muted); margin: 0; }
.story__dot { width: 12px; height: 12px; border-radius: 50%; border: 0; padding: 0; background: #d3dae2; cursor: pointer; }
.story__dot[aria-current="step"] { background: var(--navy); transform: scale(1.25); }
.story__play { font: inherit; font-size: .84rem; background: none; border: 0; color: var(--ocean); font-weight: 600; cursor: pointer; padding: 0; }

.w4-layer, .w4-day { opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.w4-layer.is-on, .w4-day.is-on { opacity: 1; }
.w4-plane { stroke-width: 1.5; }
.w4-plane--air { fill: rgba(237, 231, 252, .7); stroke: #b8a6e6; }
.w4-plane--ocean { fill: #cfe7f6; stroke: #8fbfdd; }
.w4-plane-title { font: 600 18px var(--sans); fill: var(--ink-soft); }
.w4-plane-note { font: 500 14px var(--sans); fill: var(--muted); }
.w4-land { fill: #ecdcb8; stroke: #c4a971; stroke-width: 1.2; stroke-linejoin: round; }
.w4-land-ghost { fill: rgba(196, 169, 113, .14); stroke: rgba(150, 125, 160, .45); stroke-width: 1; }
.w4-ice { fill: #fbfdff; stroke: #c9dceb; stroke-width: 1.5; }
.w4-polar-rim { fill: none; stroke: #b7d7ec; stroke-width: 10; }
.w4-polar-spin { transform-origin: 500px 300px; animation: w4-spin 90s linear infinite; }
.w4-ring { fill: none; stroke: #7b3fb5; stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; animation: w4-flow 1.4s linear infinite; }
.w4-label { font: 600 17px var(--sans); fill: var(--ink); }
.w4-label-bg { fill: #fff; stroke: rgba(15, 29, 46, .12); }
.w4-label--small { font-size: 15px; }
.w4-label--tiny { font-size: 13px; }
.w4-label--warm { fill: #c2410c; }
.w4-label--cool { fill: #1864ab; }
.w4-label--jet { fill: #6a2fa8; }
.w4-small { font: 500 15px var(--sans); fill: var(--ink-soft); }
.w4-col-title { font: 600 20px var(--sans); fill: var(--ink); }
.w4-day { font: 600 19px var(--sans); fill: #6a2fa8; }

.w4-jet { fill: none; stroke: #7b3fb5; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 14 6; animation: w4-flow 1s linear infinite; }
.w4-hl circle { stroke: #fff; stroke-width: 2; }
.w4-hl-h { fill: #fff1e6; stroke: #e8590c !important; }
.w4-hl-l { fill: #e7f1ff; stroke: #1c7ed6 !important; }
.w4-hl-text { font: 700 15px var(--sans); fill: var(--ink); }
.w4-hl-text--small { font-size: 11px; }
.w4-connector { stroke: #9aa7b6; stroke-width: 1.5; stroke-dasharray: 3 5; }

.w4-cloud { fill: #fff; stroke: #9fb3c8; stroke-width: 2; }
.w4-rain { stroke: #4dabf7; stroke-width: 2.5; stroke-linecap: round; animation: w4-fall 1s linear infinite; transform-box: fill-box; }
.w4-sun { fill: #ffd43b; stroke: #f59f00; stroke-width: 2; }
.w4-ray { stroke: #f59f00; stroke-width: 2.5; stroke-linecap: round; }
.w4-sunrays { animation: w4-spin 12s linear infinite; transform-box: fill-box; transform-origin: center; }
.w4-dry { fill: #e8590c; opacity: .85; }
.w4-crack { fill: none; stroke: #7a2e05; stroke-width: 1.5; }
.w4-heat { fill: none; stroke: #ff8a6b; stroke-width: 2.5; stroke-linecap: round; animation: w4-rise 1.8s ease-in infinite; transform-box: fill-box; }
.w4-updraft { fill: none; stroke: #2f9e44; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 10 8; animation: w4-flow-up .9s linear infinite; }
.w4-diverge { fill: none; stroke: #0b2540; stroke-width: 2.5; stroke-linecap: round; }
.w4-wind { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 10 7; animation: w4-flow .9s linear infinite; }
.w4-wind--warm { stroke: #e8590c; }
.w4-wind--cool { stroke: #1c7ed6; }
.w4-vapour { fill: none; stroke: #74c0fc; stroke-width: 2.2; stroke-linecap: round; animation: w4-rise 2s ease-in infinite; transform-box: fill-box; }
.w4-vapour--weak { opacity: .45; }
.w4-panel { fill: rgba(255, 255, 255, .92); stroke: var(--line); }
.w4-ml { fill: #96cdf0; transition: fill .3s; }
.w4-ml-base { stroke: #fff; stroke-width: 2; stroke-dasharray: 6 5; }
.w4-sunbeam { stroke: #fcc419; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 8 10; animation: w4-flow 1s linear infinite; opacity: .8; }
.w4-mix { fill: none; stroke: #0b2540; stroke-width: 2.5; stroke-linecap: round; opacity: .7; }
.w4-thermo { fill: #fff; stroke: #8a99aa; stroke-width: 1.5; }
.w4-thermo-bulb { fill: #4dabf7; }
.w4-thermo-bulb--warm, .w4-thermo-fill--warm { fill: #f03e3e; }
.w4-thermo-fill { fill: #4dabf7; }
.w4-thermo-fill.w4-thermo-fill--warm { fill: #f03e3e; }
.w4-tl { stroke: #b9c4cf; stroke-width: 3; stroke-linecap: round; }
.w4-tl-dot { fill: #0b2540; stroke: #fff; stroke-width: 2; }
.w4-vert { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 10 7; animation: w4-flow .9s linear infinite; }
.w4-vert--up { stroke: #2f9e44; }
.w4-vert--down { stroke: #8d6e4f; }
.w4-moist { fill: none; stroke: #0c8599; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 10 7; animation: w4-flow .9s linear infinite; }
.w4-loop { fill: none; stroke: #e8590c; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 10 7; animation: w4-flow 1.2s linear infinite; }
.w4-pulse { animation: w4-pulse 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.w4-pulse-slow { animation: w4-pulse 3.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

@keyframes w4-spin { to { transform: rotate(360deg); } }
@keyframes w4-flow { to { stroke-dashoffset: -34; } }
@keyframes w4-flow-up { to { stroke-dashoffset: -36; } }
@keyframes w4-fall { from { transform: translateY(-4px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(12px); opacity: 0; } }
@keyframes w4-rise { from { transform: translateY(6px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(-14px); opacity: 0; } }
@keyframes w4-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* ---------------- REVEAL ---------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 980px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: fixed; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; padding: 8px 16px 20px; box-shadow: 0 12px 24px rgba(15, 29, 46, .12);
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  }
  .nav.is-open { background: #fff; }
  .nav.is-open .nav__brand { color: var(--ink); }
  .nav.is-open .nav__links { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a, .nav.is-scrolled .nav__links a { color: var(--ink); padding: 12px 8px; }
  .nav__links a.nav__cta { margin: 8px 0 0; border-color: var(--ink); color: var(--ink); text-align: center; }

  .hero__inner { grid-template-columns: 1fr; }
  .hero__portrait { justify-self: start; width: 180px; order: -1; }
  .hero__monogram { font-size: 3.5rem; }
  .grid-2, .grid-2--even, .contact { grid-template-columns: 1fr; gap: 48px; }
  .cards { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; gap: 24px; }
  .explore-links { grid-template-columns: 1fr; }
  .monsoon-top { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .section { padding: 72px 0; }
  .container, .nav__inner, .hero__inner { padding-left: 18px; padding-right: 18px; }
  .card { padding: 24px; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; width: 100%; border-radius: 16px; }
  .filter { border-radius: 12px; }
  .pub { grid-template-columns: 1fr; gap: 4px; }
  .pub--featured::before { left: -12px; }
  .events li { grid-template-columns: 1fr; gap: 2px; }
  .callout { padding: 28px 22px; }
  .explore-link { padding: 22px; }
  .footer__inner { flex-direction: column; gap: 6px; }
}
/* Story labels: larger on phones, minor ones hidden (the caption explains them) */
@media (max-width: 600px) {
  .story__stage .w4-label { font-size: 23px; }
  .story__stage .w4-tag--minor, .story__stage .w4-plane-note, .story__stage .w4-col-note { display: none; }
  .story__stage .w4-plane-title { font-size: 26px; }
  .story__stage .w4-day { font-size: 28px; }
  .story__stage .w4-small { font-size: 22px; }
  .story__stage .w4-col-title { font-size: 28px; }
  .story__stage .w4-hl circle { r: 19px; }
  .story__stage .w4-hl-text { font-size: 22px; }
  .story__stage .w4-hl-text--small { font-size: 18px; }
  .story__title { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .story__stage * { animation: none !important; }
  .hero__scroll span { animation: none; }
}
@media print {
  .nav, .hero__scroll, #wave, .filters, .hero__actions { display: none !important; }
  .hero { min-height: auto; background: none; color: var(--ink); }
  .hero__lede, .hero__role { color: var(--ink-soft); }
  .section { padding: 32px 0; }
  .reveal { opacity: 1; transform: none; }
  details > * { display: block; }
}
