@charset "UTF-8";
/* =====================================================================
   Karthik Ramaswamy, Ph.D. - site stylesheet
   Single consolidated stylesheet. Sections:
     1. Tokens & base
     2. Layout helpers
     3. Header & navigation
     4. Buttons, links, tags
     5. Hero (home) & page hero (inner pages)
     6. Content sections & cards
     7. Page-specific: research, projects, tools, publications, cv,
        contact, about
     8. Call-to-action & footer
     9. Responsive
    10. Accessibility, motion, print
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Tokens & base
   --------------------------------------------------------------------- */

:root {
  --navy: #12355B;
  --navy-dark: #0B2239;
  --navy-soft: #1E4A7A;
  --teal: #0F766E;
  --teal-dark: #0B5F59;
  --teal-light: #EAF5F4;
  --teal-ring: rgba(15, 118, 110, 0.18);

  --text: #374151;
  --text-strong: #1F2937;
  --muted: #6B7280;
  --border: #E5E7EB;
  --border-soft: #EEF1F5;
  --bg: #F8FAFC;
  --white: #FFFFFF;

  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-head: 'Merriweather', Georgia, 'Times New Roman', serif;

  --max-w: 2200px;
  --gutter: clamp(20px, 5vw, 120px);
  --pad-x: max(var(--gutter), calc((100% - var(--max-w)) / 2));

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 28px rgba(18, 53, 91, 0.07);
  --shadow-hover: 0 18px 45px rgba(18, 53, 91, 0.12);
  --header-h: 76px;

  /* Decorative contour-line pattern (aquifer / topography motif), tiled */
  --contour-teal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='480'%3E%3Cg fill='none' stroke='%230F766E' stroke-opacity='.16' stroke-width='1.3'%3E%3Cpath d='M0 80C80 40 160 120 240 80S400 40 480 80'/%3E%3Cpath d='M0 200C90 160 150 250 240 200S390 160 480 200'/%3E%3Cpath d='M0 320C70 280 170 370 240 320S410 280 480 320'/%3E%3Cpath d='M0 440C100 400 140 480 240 440S380 400 480 440'/%3E%3Cpath d='M0 140C60 120 180 160 240 140S420 120 480 140' stroke-opacity='.08'/%3E%3Cpath d='M0 260C60 240 180 280 240 260S420 240 480 260' stroke-opacity='.08'/%3E%3Cpath d='M0 380C60 360 180 400 240 380S420 360 480 380' stroke-opacity='.08'/%3E%3C/g%3E%3C/svg%3E");
  --contour-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='480'%3E%3Cg fill='none' stroke='%23FFFFFF' stroke-opacity='.13' stroke-width='1.3'%3E%3Cpath d='M0 80C80 40 160 120 240 80S400 40 480 80'/%3E%3Cpath d='M0 200C90 160 150 250 240 200S390 160 480 200'/%3E%3Cpath d='M0 320C70 280 170 370 240 320S410 280 480 320'/%3E%3Cpath d='M0 440C100 400 140 480 240 440S380 400 480 440'/%3E%3Cpath d='M0 140C60 120 180 160 240 140S420 120 480 140' stroke-opacity='.07'/%3E%3Cpath d='M0 260C60 240 180 280 240 260S420 240 480 260' stroke-opacity='.07'/%3E%3Cpath d='M0 380C60 360 180 400 240 380S420 360 480 380' stroke-opacity='.07'/%3E%3C/g%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

p:last-child,
ul:last-child {
  margin-bottom: 0;
}

li {
  color: var(--text);
}

a {
  color: var(--teal);
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

a:hover {
  color: var(--teal-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

em {
  font-style: italic;
}

/* ---------------------------------------------------------------------
   2. Layout helpers
   --------------------------------------------------------------------- */

main {
  display: block;
}

.eyebrow {
  display: block;
  margin: 0 0 14px;
  color: var(--teal);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-intro {
  max-width: 960px;
  margin-bottom: 40px;
}

.section-intro h2 {
  font-size: clamp(28px, 3vw, 38px);
  margin-bottom: 12px;
}

.section-intro p {
  font-size: 18px;
  line-height: 1.7;
}

/* ---------------------------------------------------------------------
   3. Header & navigation
   --------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 2000;
  padding: 10px 16px;
  background: var(--navy);
  color: var(--white);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
  color: var(--white);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: var(--header-h);
  padding: 0 var(--pad-x);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}

.logo:hover {
  color: var(--teal);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  position: relative;
  padding: 8px 11px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--navy);
  background: var(--bg);
}

.site-nav a.active {
  color: var(--teal);
}

.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--teal);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  border-radius: 2px;
  background: var(--navy);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------------------------------------------------------------------
   4. Buttons, links, tags
   --------------------------------------------------------------------- */

.buttons,
.page-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 9px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  line-height: 1.2;
  border: 1px solid transparent;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.22);
}

.btn.primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: var(--white);
}

.btn.secondary {
  background: transparent;
  border-color: var(--teal);
  color: var(--teal);
}

.btn.secondary:hover {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  color: var(--teal-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Pills / tags */
.methods-grid,
.project-tags,
.cv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.methods-grid {
  gap: 12px;
}

.methods-grid span,
.project-tags span,
.cv-tags span {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--teal-light);
  border: 1px solid var(--teal-ring);
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.project-tags {
  margin-top: 22px;
}

.project-tags span {
  font-size: 13px;
  padding: 7px 12px;
}

/* ---------------------------------------------------------------------
   5. Hero (home) & page hero (inner pages)
   --------------------------------------------------------------------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
  padding: clamp(56px, 7vw, 96px) var(--pad-x) clamp(64px, 7vw, 104px);
  background: linear-gradient(135deg, #FFFFFF 0%, #F5F9F9 50%, #E9F3F2 100%);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 85% 20%, rgba(15, 118, 110, 0.10), transparent 42%),
    radial-gradient(circle at 10% 90%, rgba(18, 53, 91, 0.06), transparent 38%);
  pointer-events: none;
}

/* County-level US irrigation map, washed out, behind the portrait */
.hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  right: calc(var(--pad-x) - 60px);
  width: clamp(560px, 64vw, 1500px);
  aspect-ratio: 1729 / 1094;
  transform: translateY(-50%);
  background: url("../images/figures/hero-irrigation-map.png") center / contain no-repeat;
  opacity: 0.7;
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.75) 24%, #000 48%),
    linear-gradient(180deg, transparent 0%, #000 12%, #000 86%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.75) 24%, #000 48%),
    linear-gradient(180deg, transparent 0%, #000 12%, #000 86%, transparent 100%);
  mask-composite: intersect;
  pointer-events: none;
}

/* Animated irrigation map (canvas) that replaces the static image once it is ready */
.hero > .hero-map {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: calc(var(--pad-x) - 60px);
  width: clamp(560px, 64vw, 1500px);
  aspect-ratio: 1729 / 1094;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 1s ease;
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.75) 24%, #000 48%),
    linear-gradient(180deg, transparent 0%, #000 12%, #000 86%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.75) 24%, #000 48%),
    linear-gradient(180deg, transparent 0%, #000 12%, #000 86%, transparent 100%);
  mask-composite: intersect;
  pointer-events: none;
}

.hero > .hero-map canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hero.hero-map-on > .hero-map {
  opacity: 0.7;
}

.hero.hero-map-on::after {
  opacity: 0;
  transition: opacity 1s ease;
}

.hero > .hero-map-year {
  position: absolute;
  z-index: 1;
  right: var(--pad-x);
  bottom: 18px;
  width: 380px;
  padding: 10px 14px 11px;
  border: 1px solid rgba(18, 53, 91, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text);
  opacity: 0;
  transition: opacity 1s ease;
}

.hero > .hero-map-year .hml-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.hero > .hero-map-year b {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.hero > .hero-map-year .hml-head span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
}

.hero > .hero-map-year .hml-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 5px;
}

.hero > .hero-map-year .hml-title {
  flex: 0 0 100%;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero > .hero-map-year .hml-bar {
  display: inline-flex;
  flex: 1 1 auto;
  height: 10px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.hero > .hero-map-year .hml-bar i {
  flex: 1 1 0;
}

.hero > .hero-map-year .hml-lab {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.hero > .hero-map-year .hml-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.hero > .hero-map-year .hml-cat i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.hero.hero-map-on > .hero-map-year {
  opacity: 1;
}

.hero > .hero-map-year .hml-link {
  margin-left: auto;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
}

.hero > .hero-map-year .hml-link:hover,
.hero > .hero-map-year .hml-link:focus-visible {
  text-decoration: underline;
}

/* The same link lives in the legend card once the animated map runs; this copy is for phones */
.hero.hero-map-on .hero-explore-meta {
  display: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-text {
  max-width: 800px;
}

.hero h1 {
  font-size: clamp(36px, 4.4vw, 58px);
  line-height: 1.08;
  margin: 0 0 22px;
}

.hero-text p {
  max-width: 680px;
  font-size: 18px;
  line-height: 1.75;
}

.hero-image {
  display: flex;
  justify-content: flex-end;
}

.hero-image img {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 28px 60px rgba(18, 53, 91, 0.18);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}

.hero-meta strong {
  color: var(--text-strong);
  font-weight: 600;
}

.affiliation-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 20px var(--pad-x);
  background: var(--navy);
}

.affiliation-strip span {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Inner page hero */
.page-hero {
  position: relative;
  padding: clamp(56px, 6vw, 86px) var(--pad-x);
  background: linear-gradient(100deg, #FFFFFF 0%, #FFFFFF 45%, #EEF5F4 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.page-hero > * {
  position: relative;
  z-index: 1;
}

.page-hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  left: 40%;
  background: var(--contour-teal);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
  pointer-events: none;
}

.page-hero::before {
  position: relative;
  z-index: 1;
  content: "";
  display: block;
  width: 64px;
  height: 5px;
  margin-bottom: 24px;
  border-radius: 999px;
  background: var(--teal);
}

/* Research hero: 3D aquifer surface (WebGL) with a static image fallback */
.page-hero.hero-3d {
  background: linear-gradient(100deg, #FFFFFF 0%, #FFFFFF 38%, #EEF5F4 100%);
}

.page-hero.hero-3d::after {
  left: 42%;
  background: var(--hero-fallback, url("../images/figures/hpa-surface-fallback.png")) right center / contain no-repeat;
  opacity: 0.95;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 32%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 32%);
  transition: opacity 0.6s ease;
}

.page-hero.hero-3d.hero-3d-on::after {
  opacity: 0;
}

.page-hero .hero3d {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  right: 0;
  width: 58%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 30%);
}

.page-hero .hero3d canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.page-hero.hero-3d .hero-note {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--muted);
}

/* Year readout for the animated drawdown hero (Projects) */
.page-hero.hero-3d .hero-year {
  position: absolute;
  right: var(--pad-x);
  bottom: 26px;
  z-index: 1;
  margin: 0;
  max-width: 300px;
  text-align: right;
  pointer-events: none;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
}

.page-hero.hero-3d .hero-year strong {
  display: block;
  font-family: var(--font-head);
  font-size: 30px;
  line-height: 1.1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.page-hero.hero-3d .hero-year:empty {
  display: none;
}

/* Legend card and projected place labels for the WebGL heroes (created by the hero scripts) */
.page-hero.hero-3d .hero-legend {
  position: absolute;
  right: var(--pad-x);
  bottom: 22px;
  z-index: 1;
  width: 280px;
  max-width: calc(100% - 2 * var(--pad-x));
  padding: 12px 14px 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(18, 53, 91, 0.08);
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text);
  pointer-events: none;
}

.page-hero.hero-3d .hero-legend h4 {
  margin: 0 0 6px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text-strong);
}

.page-hero.hero-3d .hero-legend .ramp {
  height: 10px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.page-hero.hero-3d .hero-legend .ticks {
  display: flex;
  justify-content: space-between;
  margin: 3px 0 6px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.page-hero.hero-3d .hero-legend .key {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text);
}

.page-hero.hero-3d .hero-legend .key i {
  flex: 0 0 auto;
  width: 14px;
  height: 10px;
  border-radius: 2px;
}

.page-hero.hero-3d .hero-legend .key i.line {
  height: 2px;
  border-radius: 1px;
}

.page-hero.hero-3d .hero-legend .note {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

.page-hero.hero-3d .hero-legend .hero-year {
  position: static;
  max-width: none;
  text-align: left;
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

.page-hero.hero-3d .hero-legend .hero-year strong {
  font-size: 26px;
}

.page-hero.hero-3d .hero-legend .progress {
  height: 4px;
  margin: 6px 0 4px;
  border-radius: 2px;
  background: var(--border-soft);
  overflow: hidden;
}

.page-hero.hero-3d .hero-legend .progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--teal);
}

.page-hero.hero-3d .hero-label {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3F4B5C;
  pointer-events: none;
  paint-order: stroke;
  text-shadow: 0 0 3px #FFFFFF, 0 0 6px #FFFFFF, 0 0 10px rgba(255, 255, 255, 0.9);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.page-hero.hero-3d .hero-label.on {
  opacity: 0.9;
}

/* Play/pause control for rotating heroes, placed in the legend card's top-right corner */
.page-hero.hero-3d .hero-legend.has-play h4 {
  padding-right: 34px;
}

.page-hero.hero-3d .hero-play {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  pointer-events: auto;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.page-hero.hero-3d .hero-play:hover {
  background: var(--teal-light);
  border-color: var(--teal);
  color: var(--teal-dark);
}

.page-hero.hero-3d .hero-play:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.page-hero.hero-3d .hero-play svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

@media (max-width: 1100px) {
  .page-hero.hero-3d .hero-legend {
    width: 240px;
    font-size: 12px;
  }
}

@media (min-width: 1100px) {
  .page-hero.hero-3d h1,
  .page-hero.hero-3d p {
    max-width: min(880px, 50%);
  }
}

@media (max-width: 760px) {
  .page-hero.hero-3d::after {
    left: 30%;
    opacity: 0.32;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 60%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 60%);
  }
}

/* Tools page hero: featured web tool with a framed screenshot */
.page-hero.tool-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.page-hero.tool-hero::before {
  display: none;
}

/* Faint images of the Excel/VBA model's input and results sheets behind the hero */
.page-hero.tool-hero::after {
  left: 0;
  background:
    url("../images/figures/excel-inputs.jpg") left -60px top -20px / 620px auto no-repeat,
    url("../images/figures/excel-results.jpg") right -120px top 36px / 1100px auto no-repeat;
  opacity: 0.13;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
}

.tool-hero-text::before {
  content: "";
  display: block;
  width: 64px;
  height: 5px;
  margin-bottom: 24px;
  border-radius: 999px;
  background: var(--teal);
}

.page-hero.tool-hero h1 {
  font-size: clamp(30px, 3.6vw, 46px);
}

.page-hero.tool-hero .tool-hero-text > p {
  max-width: 720px;
  font-size: 17.5px;
}

.tool-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0 0;
  max-width: 760px;
}

.tool-hero-stats div {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.tool-hero-stats dt {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}

.tool-hero-stats dd {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
}

.page-hero.tool-hero .hero-note {
  margin-top: 16px;
  max-width: 720px;
  font-size: 13.5px;
  color: var(--muted);
}

.tool-hero-media {
  position: relative;
  z-index: 1;
  min-width: 0;
}

/* Returns chart card (tools hero) */
.returns-card {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  padding: 18px 20px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(18, 53, 91, 0.16);
}

.rc-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px 12px;
  margin-bottom: 6px;
}

.rc-head > div:first-child {
  flex: 1 1 260px;
}

.rc-head strong {
  display: block;
  font-family: var(--font-head);
  font-size: 17px;
  color: var(--navy);
  line-height: 1.3;
}

.rc-head span {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}

.rc-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.rc-controls output {
  min-width: 56px;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.rc-btn {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--white);
  color: var(--text-strong);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.rc-btn:hover {
  background: var(--teal-light);
  border-color: var(--teal);
}

.rc-tabs {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.rc-tab {
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.rc-tab[aria-selected="true"] {
  background: var(--navy);
  color: var(--white);
}

.rc-readout {
  display: block;
  margin: 2px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.rc-stage {
  overflow: hidden;
}

.rc-views {
  display: flex;
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.rc-view {
  flex: 0 0 100%;
  min-width: 0;
}

.rc-chart {
  position: relative;
}

.rc-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.rc-grid line {
  stroke: var(--border-soft);
}

.rc-zero {
  stroke: #9AA7B8;
  stroke-width: 1;
}

.rc-axis text {
  font-family: var(--font-body);
  font-size: 11px;
  fill: var(--muted);
}

.rc-axis line {
  stroke: var(--border);
}

.rc-axis-title {
  font-size: 11.5px;
  font-weight: 600;
  fill: var(--text-strong);
}

.rc-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.rc-mark line {
  stroke-width: 1;
  stroke-dasharray: 2 2;
}

.rc-mark-text {
  font-size: 11px;
  font-weight: 600;
  fill: var(--text-strong);
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
}

.rc-end {
  font-size: 11.5px;
  font-weight: 700;
}

.rc-cross {
  stroke: var(--navy);
  stroke-width: 1;
}

.rc-tip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  min-width: 190px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(18, 53, 91, 0.12);
  font-size: 12.5px;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.rc-tip.on {
  opacity: 1;
}

.rc-tip-year {
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.rc-tip-row {
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.5;
}

.rc-tip-row i {
  width: 12px;
  height: 3px;
  border-radius: 2px;
}

.rc-tip-row span {
  flex: 1 1 auto;
  color: var(--text);
}

.rc-tip-row b {
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
}

.rc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: var(--text);
}

.rc-legend i {
  display: inline-block;
  width: 14px;
  height: 3px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 2px;
}

.rc-table {
  margin-top: 10px;
  overflow-x: auto;
}

.rc-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.rc-table caption {
  text-align: left;
  padding: 0 0 6px;
  color: var(--muted);
}

.rc-table th,
.rc-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
}

.rc-table th.num,
.rc-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.returns-card figcaption {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.device {
  display: block;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: 0 30px 70px rgba(18, 53, 91, 0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.device:hover {
  transform: translateY(-4px);
  box-shadow: 0 38px 80px rgba(18, 53, 91, 0.26);
}

.device-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: var(--navy);
}

.device-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

.device-bar em {
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.device img {
  width: 100%;
  height: auto;
  display: block;
}

/* About hero: journey globe (Canvas 2D) with a static image fallback */
.page-hero.hero-globe {
  background: linear-gradient(100deg, #FFFFFF 0%, #FFFFFF 40%, #EEF5F4 100%);
}

.page-hero.hero-globe::after {
  left: 46%;
  background: url("../images/figures/journey-globe-fallback.png") center / contain no-repeat;
  opacity: 0.95;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 26%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 26%);
  transition: opacity 0.6s ease;
}

.page-hero.hero-globe.hero-globe-on::after {
  opacity: 0;
}

.page-hero .globe-wrap {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  right: 0;
  width: 52%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 22%);
}

.page-hero .globe-wrap canvas {
  display: block;
  cursor: grab;
  touch-action: none;
}

.page-hero.hero-globe .hero-note {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--muted);
}

@media (min-width: 1100px) {
  .page-hero.hero-globe h1,
  .page-hero.hero-globe p {
    max-width: min(820px, 48%);
  }
}

@media (min-width: 761px) and (max-width: 1099px) {
  .page-hero.hero-globe {
    min-height: 540px;
  }

  .page-hero.hero-globe h1,
  .page-hero.hero-globe p {
    max-width: 58%;
  }

  .page-hero .globe-wrap {
    width: 46%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 34%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 34%);
  }
}

@media (max-width: 760px) {
  .page-hero.hero-globe::after {
    left: 35%;
    opacity: 0.35;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
  }
}

/* CV hero: animated career timeline (SVG built by js/cv-timeline.js) */
.page-hero.hero-timeline {
  background: linear-gradient(100deg, #FFFFFF 0%, #FFFFFF 40%, #EEF5F4 100%);
}

.page-hero .timeline-wrap {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: calc(var(--pad-x) - 10px);
  width: min(56%, 820px);
  transform: translateY(-50%);
}

.timeline-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--font-body);
}

.timeline-svg .tl-axis {
  stroke: #9AA7B8;
  stroke-width: 1.2;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

.timeline-svg .tl-tick {
  stroke: #9AA7B8;
  stroke-width: 1;
}

.timeline-svg .tl-year {
  font-size: 12px;
  font-weight: 600;
  fill: var(--muted);
}

.timeline-svg .tl-bar {
  fill: var(--teal);
  opacity: 0.85;
  transform: scaleX(0);
}

.timeline-svg .tl-pos.nonacademic .tl-bar {
  fill: #DCEFED;
  stroke: var(--teal);
  stroke-width: 1.5;
  opacity: 1;
}

.timeline-svg .tl-pos.current .tl-bar {
  fill: var(--navy);
  opacity: 1;
}

.timeline-svg .tl-title {
  font-size: 13.5px;
  font-weight: 700;
  fill: var(--navy);
}

.timeline-svg .tl-org,
.timeline-svg .tl-place {
  font-size: 11.5px;
  fill: var(--muted);
}

.timeline-svg .tl-pos text,
.timeline-svg .tl-deg,
.timeline-svg .tl-now,
.timeline-svg .tl-nowlabel {
  opacity: 0;
}

.timeline-svg .tl-stem {
  stroke: var(--teal);
  stroke-width: 1.2;
}

.timeline-svg .tl-leader {
  stroke: var(--navy);
  stroke-width: 1;
  opacity: 0.6;
}

.timeline-svg .tl-dot {
  fill: var(--white);
  stroke: var(--teal);
  stroke-width: 2.5;
}

.timeline-svg .tl-degree {
  font-size: 12.5px;
  font-weight: 700;
  fill: var(--teal);
}

.timeline-svg .tl-now {
  stroke: var(--navy);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.timeline-svg .tl-nowlabel {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  fill: var(--navy);
}

.hero-timeline-on .timeline-svg .tl-axis {
  transition: stroke-dashoffset 1.4s ease-out;
  stroke-dashoffset: 0;
}

.hero-timeline-on .timeline-svg .tl-bar {
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0.5s);
  transform: scaleX(1);
}

.hero-timeline-on .timeline-svg .tl-pos text {
  transition: opacity 0.6s ease calc(var(--d, 0.5s) + 0.45s);
  opacity: 1;
}

.hero-timeline-on .timeline-svg .tl-deg {
  transition: opacity 0.6s ease var(--d, 1.6s);
  opacity: 1;
}

.hero-timeline-on .timeline-svg .tl-now,
.hero-timeline-on .timeline-svg .tl-nowlabel {
  transition: opacity 0.6s ease 2.6s;
  opacity: 1;
}

@media (min-width: 1100px) {
  .page-hero.hero-timeline h1,
  .page-hero.hero-timeline p {
    max-width: min(820px, 42%);
  }
}

@media (max-width: 1100px) {
  .page-hero .timeline-wrap {
    position: static;
    width: 100%;
    max-width: 820px;
    margin-top: 28px;
    transform: none;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* Contact hero: North America map with a pulsing Madison marker and the local time */
.page-hero.hero-contact {
  background: linear-gradient(100deg, #FFFFFF 0%, #FFFFFF 40%, #EEF5F4 100%);
}

.page-hero.hero-contact.hero-contact-on::after {
  opacity: 0;
}

.page-hero .contact-map {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  right: 0;
  width: 54%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 24%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 24%);
  pointer-events: none;
}

.contact-map-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.contact-map-svg .cm-graticule {
  fill: none;
  stroke: rgba(15, 118, 110, 0.14);
  stroke-width: 0.6;
}

.contact-map-svg .cm-land {
  fill: #DCEBE8;
  stroke: #FFFFFF;
  stroke-width: 0.8;
}

.contact-map-svg .cm-nation {
  fill: #CFE5E1;
  stroke: #7B8798;
  stroke-width: 0.9;
}

.contact-map-svg .cm-states {
  fill: none;
  stroke: #FFFFFF;
  stroke-width: 0.9;
}

.contact-map-svg .cm-dot {
  fill: var(--teal);
  stroke: #FFFFFF;
  stroke-width: 2.5;
}

.contact-map-svg .cm-pulse {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2;
  opacity: 0;
  animation: cm-pulse 2.8s ease-out infinite;
}

.contact-map-svg .cm-pulse.delay {
  animation-delay: 1.4s;
}

@keyframes cm-pulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(5); opacity: 0; }
}

.contact-map-svg .cm-label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  fill: var(--navy);
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 4px;
}

.contact-time {
  position: absolute;
  right: var(--pad-x);
  bottom: 28px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--muted);
}

.contact-time strong {
  display: block;
  font-family: var(--font-head);
  font-size: 18px;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.contact-time[data-part="night"] strong {
  color: var(--navy-dark);
}

@media (min-width: 1100px) {
  .page-hero.hero-contact h1,
  .page-hero.hero-contact p {
    max-width: min(820px, 46%);
  }
}

@media (max-width: 760px) {
  .page-hero .contact-map {
    display: none;
  }
}

.page-hero h1 {
  max-width: 960px;
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.1;
  margin: 0 0 20px;
}

.page-hero p {
  max-width: 880px;
  font-size: 19px;
  line-height: 1.7;
}

.page-hero .page-buttons {
  margin-top: 28px;
}

.page-hero .page-buttons + p {
  margin-top: 16px;
  font-size: 15px;
  color: var(--muted);
}

/* ---------------------------------------------------------------------
   6. Content sections & cards
   --------------------------------------------------------------------- */

.content-section {
  padding: clamp(52px, 6vw, 84px) var(--pad-x);
  background: var(--white);
}

.alt-section {
  background: var(--bg);
}

.home-intro-section {
  border-top: 1px solid var(--border);
}

.content-section + .content-section:not(.alt-section) {
  border-top: 1px solid var(--border-soft);
}

/* Keep running text to a readable measure on wide screens while the frame stays fluid */
.content-section p,
.content-section li {
  max-width: 78ch;
}

/* Slightly larger type on very wide displays so the page does not feel sparse */
@media (min-width: 1900px) {
  body {
    font-size: 18px;
  }

  .section-intro p,
  .page-hero p {
    font-size: 19.5px;
  }
}

/* Shared card surface */
.theme-card,
.project-card,
.tool-card,
.publication-item,
.contact-card,
.workflow-step,
.timeline-item,
.research-item,
.cv-sidebar,
.contact-sidebar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.project-card,
.tool-card,
.theme-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-card:hover,
.tool-card:hover,
.theme-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(15, 118, 110, 0.35);
}

/* Theme grid (research themes) */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.theme-card {
  padding: 28px 26px;
}

.theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--teal-light);
  border: 1px solid var(--teal-ring);
  color: var(--teal);
}

.theme-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.theme-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.theme-card p {
  font-size: 15.5px;
  line-height: 1.7;
}

/* Labels used above card titles */
.project-label,
.tool-label,
.publication-year,
.cv-date,
.timeline-date,
.workflow-number {
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------
   7. Page-specific
   --------------------------------------------------------------------- */

/* Research page ------------------------------------------------------ */
.research-list {
  display: grid;
  gap: 24px;
}

.research-item {
  padding: 28px 32px;
  border-left: 5px solid var(--teal);
}

.research-item h3 {
  font-size: 23px;
  margin-bottom: 10px;
}

.research-item p {
  font-size: 16.5px;
  line-height: 1.7;
}

/* Projects page ------------------------------------------------------ */
.project-grid,
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.project-card,
.tool-card {
  display: flex;
  flex-direction: column;
  padding: 32px;
}

.project-label,
.tool-label {
  margin-bottom: 14px;
}

/* Image header on project cards */
.project-media {
  position: relative;
  /* An explicit width, so the height cap can't shrink the art narrower than its card */
  width: calc(100% + 64px);
  margin: -32px -32px 24px;
  aspect-ratio: 16 / 9;
  max-height: 340px;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--border);
  background:
    var(--contour-white),
    radial-gradient(circle at 85% 15%, rgba(15, 118, 110, 0.55), transparent 50%),
    var(--navy);
}

.project-media canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Figure gallery (research results) */
.figure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.figure-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.figure-card {
  margin: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.figure-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(15, 118, 110, 0.35);
}

.figure-card a {
  display: block;
  background: var(--white);
}

.figure-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  padding: 14px 14px 6px;
}

.figure-card figcaption {
  padding: 14px 20px 20px;
  border-top: 1px solid var(--border-soft);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

.figure-card figcaption strong {
  display: block;
  font-family: var(--font-head);
  font-size: 17px;
  line-height: 1.3;
  color: var(--navy);
  margin-bottom: 6px;
}

/* Full-width lead figure (national map) */
.figure-card.figure-wide {
  margin-bottom: 24px;
}

.figure-card.figure-wide img {
  aspect-ratio: auto;
  padding: 10px 10px 4px;
}

.figure-card.figure-wide figcaption {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 6px 32px;
  align-items: start;
  padding: 18px 24px 22px;
}

.figure-card.figure-wide figcaption strong {
  font-size: 20px;
  margin-bottom: 0;
}

/* Embedded interactive explorer (home page) */
.figure-card.figure-embed:hover {
  transform: none;
}

.figure-card figcaption a {
  display: inline;
}

.figure-embed .embed-frame {
  height: clamp(640px, 78vh, 880px);
  background: var(--white);
}

.figure-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.figure-credit {
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
}

.figure-credit a {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
}

.figure-credit a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-card h3,
.tool-card h3 {
  font-size: 24px;
  line-height: 1.25;
  margin-bottom: 14px;
}

.project-card > p,
.tool-card > p {
  font-size: 16.5px;
  line-height: 1.7;
}

.project-card .text-link {
  margin-top: auto;
  padding-top: 18px;
}

.project-details,
.tool-details {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.project-details h4,
.tool-details h4 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.project-details p {
  font-size: 15.5px;
  line-height: 1.7;
}

.tool-details ul {
  padding-left: 20px;
  margin: 0;
}

.tool-details li {
  font-size: 15.5px;
  line-height: 1.65;
  margin-bottom: 5px;
}

.featured-tool {
  border-top: 5px solid var(--teal);
}

/* Workflow steps (tools page) */
.workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.workflow-step {
  padding: 28px 26px;
}

.workflow-number {
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(15, 118, 110, 0.35);
  margin-bottom: 14px;
}

.workflow-step h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.workflow-step p {
  font-size: 15.5px;
  line-height: 1.7;
}

/* Publications page -------------------------------------------------- */
.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -8px 0 0;
  padding: 0;
  list-style: none;
}

.section-nav a {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.section-nav a:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-light);
}

.publication-list {
  display: grid;
  gap: 22px;
}

.publication-item {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 24px;
  padding: 28px 30px;
}

.publication-year {
  padding-top: 6px;
}

.publication-content h3 {
  font-size: 21px;
  line-height: 1.35;
  margin-bottom: 10px;
}

.publication-authors {
  font-size: 15.5px;
  line-height: 1.6;
  margin-bottom: 4px;
}

.publication-journal {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 12px;
}

.publication-summary {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.publication-links a,
.publication-links span {
  display: inline-block;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.3;
}

.publication-links a {
  background: var(--teal-light);
  border: 1px solid var(--teal-ring);
  color: var(--teal-dark);
}

.publication-links a:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}

.publication-links .is-pending {
  background: var(--bg);
  border: 1px dashed var(--border);
  color: var(--muted);
  font-weight: 600;
}

/* Compact list variant for reports, conference papers, talks, posters */
.list-heading {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 36px 0 14px;
}

.list-heading:first-of-type {
  margin-top: 0;
}

.publication-list.compact {
  gap: 12px;
}

.publication-list.compact .publication-item {
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 22px;
  box-shadow: none;
}

.publication-list.compact .publication-year {
  padding-top: 3px;
}

.publication-list.compact .publication-content h3 {
  font-family: var(--font-body);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  margin-bottom: 5px;
}

.publication-list.compact .publication-authors,
.publication-list.compact .publication-journal {
  font-size: 14.5px;
  line-height: 1.55;
}

.publication-list.compact .publication-journal {
  margin-bottom: 10px;
}

.publication-list.compact .publication-journal:last-child {
  margin-bottom: 0;
}

/* CV summary stats */
.cv-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.cv-stat {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 1px solid var(--border);
}

.cv-stat strong {
  display: block;
  font-family: var(--font-head);
  font-size: 24px;
  line-height: 1.1;
  color: var(--navy);
}

.cv-stat span {
  font-size: 13px;
  color: var(--muted);
}

.cv-entry .cv-org {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 6px;
}

.cv-entry ul {
  padding-left: 18px;
  margin: 8px 0 0;
}

.cv-entry li {
  font-size: 15.5px;
  line-height: 1.6;
  margin-bottom: 4px;
}

/* CV page ------------------------------------------------------------ */
.cv-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.cv-sidebar,
.contact-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: 30px;
  background: var(--bg);
}

.cv-sidebar h2 {
  font-size: 24px;
  line-height: 1.25;
  margin-bottom: 14px;
}

.cv-sidebar p {
  font-size: 15.5px;
  line-height: 1.7;
}

.cv-contact-box {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.cv-contact-box h3 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.cv-contact-box a {
  display: block;
  padding: 7px 0;
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--border-soft);
}

.cv-contact-box a:last-child {
  border-bottom: none;
}

.cv-contact-box a:hover {
  color: var(--teal-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cv-main {
  display: grid;
  gap: 40px;
}

.cv-section {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.cv-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cv-section h2 {
  font-size: 27px;
  margin-bottom: 22px;
}

.cv-entry {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 22px;
}

.cv-entry:last-child {
  margin-bottom: 0;
}

.cv-date {
  padding-top: 4px;
}

.cv-entry h3 {
  font-size: 19px;
  margin-bottom: 6px;
}

.cv-entry p,
.cv-section > p {
  font-size: 16.5px;
  line-height: 1.7;
}

/* Contact page ------------------------------------------------------- */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 56px;
  align-items: start;
}

.contact-main h2,
.contact-sidebar h2 {
  font-size: 28px;
  margin-bottom: 18px;
}

.contact-main > p {
  max-width: 760px;
  font-size: 17.5px;
  line-height: 1.7;
  margin-bottom: 28px;
}

.contact-card {
  padding: 22px 26px;
  margin-bottom: 18px;
  border-left: 5px solid var(--teal);
}

.contact-card h3 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.contact-card p {
  font-size: 17px;
  line-height: 1.7;
}

.contact-card a {
  font-weight: 700;
  text-decoration: none;
}

.contact-card a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-links {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}

.contact-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}

.contact-links a::after {
  content: "\2197";
  color: var(--muted);
  font-size: 14px;
}

.contact-links a:hover {
  border-color: var(--teal);
  background: var(--teal-light);
  color: var(--teal-dark);
}

.contact-links a:hover::after {
  color: var(--teal-dark);
}

.contact-note {
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.contact-note h3 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.contact-note p {
  font-size: 15.5px;
  line-height: 1.7;
}

/* About page --------------------------------------------------------- */
.about-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.about-image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(18, 53, 91, 0.16);
}

.about-text h2 {
  font-size: 32px;
  margin-bottom: 20px;
}

.about-text p {
  font-size: 17.5px;
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-timeline {
  display: grid;
  gap: 22px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 24px;
  padding: 26px 30px;
  border-left: 5px solid var(--teal);
}

.timeline-date {
  padding-top: 4px;
}

.timeline-content h3 {
  font-size: 21px;
  margin-bottom: 8px;
}

.timeline-content p {
  font-size: 16.5px;
  line-height: 1.7;
}

/* ---------------------------------------------------------------------
   8. Call-to-action & footer
   --------------------------------------------------------------------- */

.home-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  padding: clamp(52px, 6vw, 76px) var(--pad-x);
  background:
    var(--contour-white),
    radial-gradient(circle at 90% 10%, rgba(15, 118, 110, 0.40), transparent 45%),
    var(--navy);
  color: var(--white);
}

.home-cta h2 {
  color: var(--white);
  font-size: clamp(26px, 2.8vw, 34px);
  line-height: 1.25;
  margin-bottom: 12px;
}

.home-cta p {
  max-width: 720px;
  color: #D7DEE8;
  font-size: 17.5px;
  line-height: 1.7;
}

.home-cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
}

.home-cta .btn.primary {
  background: var(--white);
  border-color: var(--white);
  color: var(--navy);
  box-shadow: none;
}

.home-cta .btn.primary:hover {
  background: var(--teal-light);
  border-color: var(--teal-light);
  color: var(--navy);
}

.home-cta .btn.secondary {
  border-color: rgba(255, 255, 255, 0.7);
  color: var(--white);
}

.home-cta .btn.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--white);
  color: var(--white);
}

.site-footer {
  padding: 56px var(--pad-x) 28px;
  background: var(--navy-dark);
  color: #C7D0DC;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand .logo {
  color: var(--white);
  font-size: 20px;
}

.footer-brand .logo:hover {
  color: var(--teal-light);
}

.footer-brand p {
  max-width: 420px;
  margin-top: 14px;
  color: #A9B5C6;
  font-size: 15px;
  line-height: 1.7;
}

.footer-brand a:not(.logo) {
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
}

.footer-brand a:not(.logo):hover {
  color: var(--teal-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer h3 {
  font-family: var(--font-body);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  color: inherit;
  margin-bottom: 8px;
}

.site-footer li a {
  color: #C7D0DC;
  font-size: 15px;
  text-decoration: none;
}

.site-footer li a:hover {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 22px;
  font-size: 13.5px;
  color: #8E9CB0;
}

.footer-bottom p {
  margin: 0;
  color: inherit;
}

/* ---------------------------------------------------------------------
   9. Responsive
   --------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .theme-grid,
  .workflow,
  .figure-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .page-hero.tool-hero {
    grid-template-columns: 1fr;
  }

  .page-hero.tool-hero::after {
    background-size: 520px auto, 900px auto;
    opacity: 0.1;
  }

  .tool-hero-media {
    max-width: 720px;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--pad-x) 16px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 40px rgba(18, 53, 91, 0.12);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 13px 4px;
    border-radius: 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 16px;
  }

  .site-nav a:hover {
    background: transparent;
  }

  .site-nav a:last-child {
    border-bottom: none;
  }

  .site-nav a.active::after {
    display: none;
  }

  .site-nav a.active {
    font-weight: 700;
  }

  .menu-toggle {
    display: block;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-text {
    order: 1;
    max-width: 100%;
  }

  .hero-image {
    order: 2;
    justify-content: flex-start;
  }

  .hero-image img {
    max-width: 300px;
  }

  .hero::after {
    top: auto;
    bottom: -30px;
    right: -120px;
    width: 640px;
    transform: none;
    opacity: 0.4;
  }

  .hero > .hero-map,
  .hero > .hero-map-year {
    display: none;
  }

  .hero.hero-map-on::after {
    opacity: 0.4;
  }

  .cv-layout,
  .contact-layout,
  .about-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .cv-sidebar,
  .contact-sidebar {
    position: static;
  }

  .about-image img {
    max-width: 340px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 850px) {
  .project-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .project-card,
  .tool-card {
    padding: 26px;
  }

  .project-media {
    width: calc(100% + 52px);
    margin: -26px -26px 20px;
  }

  .figure-grid {
    grid-template-columns: 1fr 1fr;
  }

  .figure-card.figure-wide figcaption {
    grid-template-columns: 1fr;
  }

  .project-card h3,
  .tool-card h3 {
    font-size: 22px;
  }

  .home-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 650px) {
  .tool-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .device-bar em {
    display: none;
  }

  .returns-card {
    padding: 16px 14px 14px;
  }

  .rc-head {
    flex-direction: column;
  }

  .rc-head > div:first-child {
    flex: 0 0 auto;
  }

  .rc-controls {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .rc-chart {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .rc-chart svg {
    min-width: 520px;
  }

  :root {
    --header-h: 64px;
  }

  body {
    font-size: 16px;
  }

  .logo {
    font-size: 17px;
  }

  .theme-grid,
  .workflow,
  .figure-grid,
  .figure-grid.four {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero-text p {
    font-size: 16.5px;
  }

  .hero-image img {
    max-width: 240px;
  }

  .buttons,
  .page-buttons,
  .home-cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .affiliation-strip {
    justify-content: flex-start;
    gap: 8px;
  }

  .affiliation-strip span {
    font-size: 12.5px;
    padding: 7px 11px;
  }

  .page-hero h1 {
    font-size: 30px;
  }

  .page-hero p {
    font-size: 16.5px;
  }

  .section-intro h2 {
    font-size: 26px;
  }

  .section-intro p {
    font-size: 16.5px;
  }

  .theme-card,
  .workflow-step,
  .contact-card,
  .research-item {
    padding: 22px;
  }

  .publication-item,
  .publication-list.compact .publication-item,
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 22px;
  }

  .publication-list.compact .publication-item {
    padding: 16px 18px;
    gap: 6px;
  }

  .cv-stats {
    grid-template-columns: 1fr 1fr;
  }

  .publication-year,
  .timeline-date {
    padding-top: 0;
  }

  .publication-content h3 {
    font-size: 19px;
  }

  .cv-entry {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .cv-section h2 {
    font-size: 24px;
  }

  .cv-sidebar,
  .contact-sidebar {
    padding: 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
  }
}

/* ---------------------------------------------------------------------
   10. Accessibility, motion, print
   --------------------------------------------------------------------- */

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

.btn:focus-visible {
  outline-offset: 2px;
}

/* Reduced motion: only smooth scrolling and card hover lifts are switched off.
   Hero animations and transitions stay on by the site owner's choice (2026-10-30). */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .project-card:hover,
  .tool-card:hover,
  .theme-card:hover,
  .figure-card:hover {
    transform: none;
  }
}

@media print {
  .site-header,
  .menu-toggle,
  .home-cta,
  .site-footer,
  .skip-link,
  .page-buttons,
  .buttons {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .content-section,
  .page-hero {
    padding: 24px 0;
  }

  .cv-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cv-sidebar,
  .cv-section,
  .publication-item {
    box-shadow: none;
    border-color: #ccc;
  }

  a {
    color: #000;
    text-decoration: none;
  }
}
