/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* Dark-blue palette — lighter than pure navy, blue-tinted surfaces. */
  --bg: #1d2f5e;
  --bg-elev: #243670;
  --bg-card: #2c3f7e;
  --bg-card-hover: #344891;
  --border: #324b86;
  --border-strong: #4862ab;
  --border-bright: #5e7ac7;
  --fg: #f5f8ff;
  --fg-2: #e3e8f5;
  --fg-dim: #b8c1de;
  --fg-faint: #8694b8;
  --fg-mute: #5e6da0;
  --accent: #fff;
  --purple: #60a5fa;
  --purple-bright: #93c5fd;
  --shadow-sm: 0 1px 2px rgba(2, 8, 24, 0.5);
  --shadow-md: 0 8px 24px -8px rgba(2, 8, 24, 0.7);
  --shadow-lg: 0 24px 60px -16px rgba(2, 8, 24, 0.8);
  --radius: 10px;
  --radius-lg: 16px;
  --max: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mono: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  font-feature-settings: "ss01", "cv01", "cv11";
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(96, 165, 250, 0.08), transparent 60%),
    radial-gradient(1000px 500px at -10% 30%, rgba(96, 165, 250, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0;
  color: var(--fg);
}

p { margin: 0; color: var(--fg-dim); }

::selection { background: var(--purple); color: #000; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  background: rgba(0, 0, 0, 0.72);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.04em;
  color: var(--fg);
}

.logo-mark {
  width: 26px;
  height: 26px;
  display: block;
}

.logo-parl { color: var(--fg); }

.logo-text-suffix {
  display: inline-block;
  margin-left: 1px;
  color: var(--fg-faint);
  font-weight: 500;
}

.nav-links { display: flex; gap: 2px; flex-wrap: wrap; }

.nav-links a {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg-dim);
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--fg);
  background: var(--bg-card);
}

/* ---------- Layout ---------- */
main { position: relative; z-index: 1; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 28px; }

section { padding: 96px 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: all 0.15s var(--ease);
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: var(--fg);
  color: #000;
  border-color: var(--fg);
}

.btn-primary:hover {
  background: #e6e6e6;
  border-color: #e6e6e6;
}

.btn-ghost {
  color: var(--fg);
  border-color: var(--border-strong);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--border-bright);
  background: var(--bg-card);
}

.btn-ghost-on-photo {
  color: var(--fg);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
}

.btn-ghost-on-photo:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.10);
}

/* ---------- Home: hero ---------- */
.home-hero {
  position: relative;
  padding: 100px 28px 80px;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

/* Two-column variant: text left, photo right. Sized to fit the
   viewport (minus the sticky nav) so the next section stays below the
   fold on first paint. */
.home-hero.hero-with-image {
  min-height: calc(100vh - 56px);
  min-height: calc(100dvh - 56px);
  display: flex;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 40px;
}
.home-hero.hero-with-image .home-hero-inner {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  text-align: left;
}
.home-hero.hero-with-image .home-title {
  font-size: clamp(40px, 5.5vw, 76px);
  letter-spacing: -0.045em;
}
.home-hero.hero-with-image .home-sub {
  margin: 0 0 32px 0;
  max-width: none;
  text-align: left;
}
.home-hero.hero-with-image .home-cta {
  justify-content: flex-start;
}
.hero-image-wrap img {
  width: 100%;
  border-radius: 14px;
  display: block;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
}

/* Carousel: stack the parliament photos on top of one another and cross-
   fade between them. JS toggles the `.is-active` class on a 3 s timer.
   `aspect-ratio` reserves the box height (children are absolute, so they
   don't contribute intrinsic size); `min-height` is a fallback for the
   rare browser that ignores `aspect-ratio`. Under prefers-reduced-motion
   JS adds `.is-instant` to the wrap, which kills the 900 ms cross-fade
   while keeping the rotation visible. */
.hero-image-wrap.hero-carousel {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 240px;
  overflow: hidden;
  border-radius: 14px;
}
.hero-image-wrap.hero-carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 900ms ease-in-out;
  pointer-events: none;
}
.hero-image-wrap.hero-carousel img.is-active {
  opacity: 1;
  pointer-events: auto;
}
.hero-image-wrap.hero-carousel.is-instant img {
  transition: none;
}
@media (max-width: 880px) {
  .home-hero.hero-with-image .home-hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  .home-hero.hero-with-image .home-sub { text-align: center; }
  .home-hero.hero-with-image .home-cta { justify-content: center; }
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(800px 400px at 50% 10%, rgba(96, 165, 250, 0.10), transparent 60%),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 75%);
  opacity: 0.6;
}

.home-hero-inner {
  max-width: 920px;
  margin: 0 auto;
  position: relative;
}

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-dim);
  letter-spacing: -0.005em;
  margin-bottom: 32px;
  transition: border-color 0.15s var(--ease);
}

.home-eyebrow:hover { border-color: var(--border-bright); color: var(--fg); }

.home-eyebrow .pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--purple);
  color: #1a0033;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-eyebrow .arrow { color: var(--fg-faint); }

.home-title {
  font-size: clamp(52px, 7.2vw, 104px);
  font-weight: 600;
  letter-spacing: -0.05em;
  margin-bottom: 24px;
  line-height: 0.97;
  color: var(--fg);
}

.home-title .gradient-text {
  background: linear-gradient(180deg, #fff 0%, #888 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.home-sub {
  font-size: clamp(19px, 1.5vw, 22.5px);
  color: var(--fg-dim);
  max-width: 680px;
  margin: 0 auto 40px;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

.home-cta {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Stats strip ---------- */
.stats-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0;
  background: var(--bg-elev);
}

.stats-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat-cell {
  padding: 32px 28px;
  border-right: 1px solid var(--border);
  position: relative;
}

.stat-cell:last-child { border-right: none; }

.stat-num {
  font-size: clamp(33px, 3vw, 42.5px);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Country grid (home) ---------- */
.countries-section { padding: 96px 28px; }

.countries-inner { max-width: var(--max); margin: 0 auto; }

.section-head {
  text-align: left;
  max-width: 720px;
  margin: 0 0 56px;
}

.section-head.center { text-align: center; margin: 0 auto 56px; }

.section-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: clamp(35.5px, 4vw, 56.5px);
  font-weight: 600;
  letter-spacing: -0.045em;
  margin-bottom: 14px;
  color: var(--fg);
}

.section-head p {
  font-size: 19px;
  line-height: 1.55;
  color: var(--fg-dim);
  letter-spacing: -0.01em;
}

.country-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.country-tile {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), background 0.18s var(--ease);
  text-decoration: none;
  color: inherit;
}

.country-tile:hover {
  border-color: var(--border-bright);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.country-tile-photo {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-elev);
}

.country-tile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.88) brightness(0.9);
  transition: transform 0.5s var(--ease), filter 0.3s var(--ease);
}

.country-tile:hover .country-tile-photo img {
  transform: scale(1.04);
  filter: saturate(1) brightness(1);
}

.country-tile-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}

.country-tile-flag {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.country-tile-body { padding: 18px 18px 20px; }

.country-tile-name {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 3px;
}

.country-tile-leg {
  font-size: 15px;
  color: var(--fg-faint);
  font-style: italic;
  margin-bottom: 14px;
  line-height: 1.4;
}

.country-tile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.country-tile-stat .n {
  font-family: var(--mono);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.country-tile-stat .lbl {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.country-tile-years {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
  margin-top: 10px;
}

/* ---------- Feature strip (home) ---------- */
.feature-strip {
  padding: 96px 28px;
  border-top: 1px solid var(--border);
}

.feature-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.feature-card {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.feature-card:hover { border-color: var(--border-strong); background: var(--bg-card-hover); }

.feature-card .label {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 14px;
}

.feature-card h3 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  color: var(--fg);
}

.feature-card p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-dim);
  margin-bottom: 12px;
}

/* :not(.btn) so the inline-link styling here doesn't clobber the
   button colour — without this, .feature-card a (specificity 0,2,0)
   beats .btn-primary's color:#000 (0,1,0), making white-on-white. */
.feature-card a:not(.btn) {
  color: var(--fg);
  border-bottom: 1px solid var(--border-bright);
  font-weight: 500;
  transition: border-color 0.15s var(--ease);
}

.feature-card a:not(.btn):hover { border-bottom-color: var(--fg); }

.feature-card code,
.feature-card .mono {
  font-family: var(--mono);
  font-size: 15px;
  background: var(--bg-elev);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  color: var(--fg);
}

/* ---------- Subpage hero (smaller, with grid bg) ---------- */
.page-hero {
  position: relative;
  padding: 80px 28px 56px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  isolation: isolate;
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 100% at 50% 0%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 100% at 50% 0%, black 30%, transparent 75%);
  opacity: 0.5;
}

.page-hero-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.page-hero h1 {
  font-size: clamp(42.5px, 5vw, 71px);
  font-weight: 600;
  letter-spacing: -0.045em;
  margin-bottom: 18px;
  color: var(--fg);
  max-width: 880px;
}

.page-hero h1 .gradient-text {
  background: linear-gradient(180deg, #fff 0%, #888 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-hero .lead {
  font-size: 20px;
  color: var(--fg-dim);
  line-height: 1.55;
  max-width: 720px;
  letter-spacing: -0.01em;
}

.page-hero .hero-actions {
  margin-top: 28px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Body sections ---------- */
.body-section { padding: 80px 28px; }

.body-inner { max-width: var(--max); margin: 0 auto; }

/* ---------- Prose ---------- */
.prose {
  max-width: 720px;
  margin: 0 auto;
}

.prose > * + * { margin-top: 18px; }

.prose h2 {
  font-size: clamp(26px, 2.6vw, 33px);
  margin-top: 48px;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
  color: var(--fg);
}

.prose h3 {
  font-size: 21px;
  margin-top: 28px;
  margin-bottom: 4px;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.prose p {
  font-size: 18.5px;
  color: var(--fg-dim);
  line-height: 1.7;
}

.prose strong { color: var(--fg); font-weight: 600; }

.prose a:not(.btn) {
  color: var(--fg);
  border-bottom: 1px solid var(--border-bright);
  font-weight: 500;
  transition: border-color 0.15s var(--ease);
}

.prose a:not(.btn):hover { border-bottom-color: var(--fg); }

.prose code,
.prose .mono {
  font-family: var(--mono);
  font-size: 15px;
  background: var(--bg-card);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  color: var(--fg);
}

.prose ul,
.prose ol {
  padding-left: 22px;
  color: var(--fg-dim);
  font-size: 18.5px;
  line-height: 1.7;
}

.prose ul li::marker { color: var(--fg-mute); }

/* ---------- Country cards (data page, full grid) ---------- */
.country-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
}

.country-card {
  position: relative;
  padding: 26px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.country-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.country-card .flag {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--purple);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.country-card h3 {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
  color: var(--fg);
}

.country-card .legislature {
  font-size: 15px;
  color: var(--fg-faint);
  margin-bottom: 18px;
  font-style: italic;
}

.country-card dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px 16px;
  font-size: 16px;
  margin: 0;
}

.country-card dt { color: var(--fg-faint); }

.country-card dd {
  margin: 0;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  text-align: right;
  letter-spacing: -0.01em;
}

/* ---------- Team ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
}

.team-card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 22px;
  align-items: start;
}

.team-card:hover { border-color: var(--border-strong); background: var(--bg-card-hover); }

.team-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
}

.team-card .role {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--purple);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.team-card h3 {
  font-size: 22.5px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  color: var(--fg);
}

.team-card .affiliation { font-size: 15.5px; color: var(--fg-dim); margin-bottom: 12px; line-height: 1.55; }
.team-card .affiliation a {
  color: var(--fg);
  border-bottom: 1px solid var(--border-bright);
  font-weight: 500;
  transition: border-color 0.15s var(--ease);
}
.team-card .affiliation a:hover { border-bottom-color: var(--fg); }

/* Inline links inside the page-hero / home-hero lead copy (e.g. the
   poltextLAB link in the team intro). The base `a` rule strips
   text-decoration, so without this rule these links render as plain
   text indistinguishable from the surrounding paragraph. */
.page-hero .lead a,
.home-sub a {
  color: var(--fg);
  border-bottom: 1px solid var(--border-bright);
  font-weight: 500;
  transition: border-color 0.15s var(--ease);
}
.page-hero .lead a:hover,
.home-sub a:hover { border-bottom-color: var(--fg); }

.team-card .bio { font-size: 15.5px; color: var(--fg-dim); line-height: 1.6; margin-bottom: 12px; }

.team-card .interests {
  font-size: 13px;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.team-card .contact {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg);
  border-bottom: 1px solid var(--border-bright);
}

.team-card .contact:hover { border-bottom-color: var(--fg); }

/* ---------- News ---------- */
.news-list {
  max-width: 760px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.news-item {
  display: block;
  padding: 28px 8px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s var(--ease);
}

.news-item:hover { background: var(--bg-card); }

.news-date {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--purple);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.news-item h3 { font-size: 23.5px; font-weight: 600; letter-spacing: -0.025em; margin-bottom: 8px; color: var(--fg); }

.news-item p { font-size: 17px; color: var(--fg-dim); line-height: 1.6; }

/* ---------- Research citations ---------- */
.cite-list {
  max-width: 820px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: cite;
}

.cite-list li {
  position: relative;
  padding: 22px 24px 22px 60px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  font-size: 17px;
  color: var(--fg-dim);
  line-height: 1.6;
}

.cite-list li::before {
  content: counter(cite, decimal-leading-zero);
  counter-increment: cite;
  position: absolute;
  left: 22px;
  top: 22px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--purple);
  letter-spacing: 0.05em;
}

.cite-list li a { color: var(--fg); border-bottom: 1px solid var(--border-bright); font-weight: 500; }

.cite-list li a:hover { border-bottom-color: var(--fg); }

/* ---------- Capabilities (about) ---------- */
.capabilities {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 40px;
}

.capability {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 20px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.capability-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--purple);
  padding-top: 3px;
  min-width: 24px;
  letter-spacing: 0.05em;
}

.capability-title {
  font-weight: 600;
  font-size: 17.5px;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  color: var(--fg);
}

.capability-text { font-size: 16px; color: var(--fg-dim); line-height: 1.6; }

/* ---------- Contact card ---------- */
.contact-card {
  position: relative;
  padding: 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  text-align: center;
  overflow: hidden;
  max-width: 720px;
  margin: 0 auto;
}

.contact-card .section-label { margin-bottom: 18px; }

.contact-card h2 { font-size: clamp(33px, 4vw, 47px); font-weight: 600; letter-spacing: -0.04em; margin-bottom: 14px; color: var(--fg); }

.contact-card > p { font-size: 19px; color: var(--fg-dim); margin-bottom: 28px; }

.contact-cta {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.02em;
  padding: 12px 22px;
}

/* ---------- Illustrations table ---------- */
.illustrations-grid {
  max-width: 880px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.illustration-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 16px;
}

.illustration-row .country {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--purple);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.illustration-row .credit { color: var(--fg-dim); line-height: 1.55; }

.illustration-row .credit a {
  color: var(--fg);
  border-bottom: 1px solid var(--border-bright);
}

.illustration-row .credit a:hover { border-bottom-color: var(--fg); }

.illustration-row .credit strong { color: var(--fg); font-weight: 600; }

.illustration-row .license {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--purple);
  letter-spacing: 0.05em;
  font-weight: 500;
  white-space: nowrap;
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px 28px;
  background: var(--bg);
  margin-top: 0;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.04em;
  color: var(--fg);
}

.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }

.footer-links a {
  font-size: 15px;
  color: var(--fg-faint);
  transition: color 0.15s var(--ease);
  letter-spacing: -0.01em;
}

.footer-links a:hover { color: var(--fg); }

.footer-copy { font-size: 14px; color: var(--fg-faint); font-family: var(--mono); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .country-tiles { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-cell:nth-child(2) { border-right: none; }
  .stat-cell:nth-child(1), .stat-cell:nth-child(2) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 720px) {
  section { padding: 56px 0; }

  .nav { padding: 12px 18px; gap: 8px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 6px 9px; font-size: 14px; }

  .home-hero { padding: 60px 20px 50px; }
  .countries-section { padding: 64px 20px; }
  .feature-strip { padding: 64px 20px; }

  .country-tiles { grid-template-columns: 1fr; }
  .country-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .capabilities { grid-template-columns: 1fr; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-cell { padding: 22px 20px; }

  .team-card { grid-template-columns: 70px 1fr; padding: 22px; gap: 16px; }
  .team-photo { width: 70px; height: 70px; }

  .contact-card { padding: 36px 22px; }

  .illustration-row { grid-template-columns: 1fr; gap: 6px; padding: 14px 16px; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }

  .page-hero { padding: 56px 20px 40px; }
  .body-section { padding: 56px 20px; }
}

/* ---------- Tutorial body ---------- */
.tutorial-body {
  max-width: 880px;
  margin: 0 auto;
}
.tutorial-body .tut-h2 {
  font-size: 33px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--fg);
  margin: 64px 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.tutorial-body .tut-h2:first-child { margin-top: 0; }
.tutorial-body .tut-h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 36px 0 12px;
}
.tutorial-body p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--fg-2);
  margin: 0 0 16px;
}
.tutorial-body p code,
.tutorial-body li code {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--fg);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 1px 7px;
}
.tutorial-body pre.tut-code,
.tutorial-body pre.tut-output {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 18px 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--fg);
}
.tutorial-body pre.tut-output {
  border-style: dashed;
  color: var(--fg-dim);
  background: rgba(0, 0, 0, 0.18);
}
.tutorial-body pre code { background: transparent; border: 0; padding: 0; font-size: inherit; color: inherit; }
.tutorial-body figure.tut-figure {
  margin: 24px 0;
  padding: 0;
}
.tutorial-body figure.tut-figure img {
  width: 100%;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  border: 1px solid var(--border);
}
.tutorial-body a {
  color: var(--purple-bright);
  border-bottom: 1px solid var(--border-strong);
  transition: border-color 0.15s var(--ease);
}
.tutorial-body a:hover { border-bottom-color: var(--purple-bright); }
.tutorial-body em { color: var(--fg); font-style: italic; }
.tutorial-body strong { color: var(--fg); }

/* ---------- Team-card per-person link row ---------- */
.team-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 14px;
  font-size: 13.5px;
}
.team-links a {
  color: var(--purple-bright);
  border-bottom: 1px solid var(--border-strong);
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
  padding-bottom: 1px;
}
.team-links a:hover {
  border-bottom-color: var(--purple-bright);
  color: var(--fg);
}

/* ---------- Data page: column dictionary + files table ---------- */
.data-h3 {
  font-size: 19px;
  font-weight: 600;
  color: var(--fg);
  margin: 32px 0 12px;
  letter-spacing: -0.02em;
}
.data-h3 code {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--fg);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 2px 8px;
  margin-right: 4px;
}
.data-cols {
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: minmax(180px, max-content) 1fr;
  gap: 6px 24px;
  align-items: baseline;
  font-size: 15px;
}
.data-cols dt {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 8px;
  justify-self: start;
  white-space: nowrap;
}
.data-cols dt code { font: inherit; color: inherit; background: transparent; border: 0; padding: 0; }
.data-cols dd {
  color: var(--fg-2);
  margin: 0;
  line-height: 1.55;
}
.data-files-wrap {
  overflow-x: auto;
  margin: 16px 0 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.data-files {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--fg-2);
}
.data-files th {
  text-align: left;
  font-weight: 600;
  color: var(--fg);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.data-files td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}
.data-files tr:last-child td { border-bottom: 0; }
.data-files .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-files code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  background: transparent;
  border: 0;
  padding: 0;
}
@media (max-width: 720px) {
  .data-cols { grid-template-columns: 1fr; gap: 2px 0; }
  .data-cols dd { margin-bottom: 12px; padding-left: 4px; }
}
