/* ==========================================================================
   VISIONS — The VISTA Star Formation Atlas, visions.univie.ac.at
   Plain hand-editable CSS. No build step. Tokens first, then components.
   Based on the univie-style system built for stefan.meingast (2026-07-05);
   accent swapped from teal to coral for the infrared imagery (2026-08-26).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts (self-hosted, SIL OFL). woff2 only.
   -------------------------------------------------------------------------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-v18-latin-regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/inter-v18-latin-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-v18-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 600; font-display: swap; src: url("../fonts/inter-v18-latin-600italic.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/source-serif-4-v8-latin-regular.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/source-serif-4-v8-latin-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/source-serif-4-latin-600.woff2") format("woff2"); }

/* --------------------------------------------------------------------------
   Tokens (univie system; coral is the one VISIONS accent)
   -------------------------------------------------------------------------- */
:root {
  --blue:         #005c99;   /* univie blue: links, primary buttons          */
  --blue-dark:    #034672;   /* hover                                        */
  --navy:         #032138;   /* text, footer, dark bands                     */
  --ink-strong:   #1c374c;   /* lead paragraphs                              */
  --ink-muted:    #354d60;   /* secondary text                               */
  --gray-mid:     #64747f;   /* smallest AA-safe muted on white              */
  --gray-base:    #9aa6af;   /* muted on dark bg only (fails AA on white)    */
  --gray-border:  #cdd3d7;
  --hairline:     #e6e9eb;
  --surface-alt:  #f2f4f5;
  --accent:       #e65640;   /* univie coral; decorative only, never text on
                                white (contrast). Text accent on dark bands
                                uses --accent-soft. */
  --accent-soft:  #ff9d8a;
  --link-on-navy: #7fc4e8;

  /* --- Semantic theme tokens --------------------------------------------
     Light values below; dark mode redefines ONLY these. ------------------ */
  --bg:            #ffffff;
  --surface:       #ffffff;
  --surface-2:     var(--surface-alt);
  --text:          var(--navy);
  --text-strong:   var(--ink-strong);
  --text-muted:    var(--ink-muted);
  --text-faint:    var(--gray-mid);
  --border:        var(--hairline);
  --border-strong: var(--gray-border);
  --link:          var(--blue);
  --link-hover:    var(--blue-dark);
  --link-tint:     rgba(0, 92, 153, 0.07);
  --focus:         var(--blue);
  color-scheme: light;

  --sans:  "Inter", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;

  --container: 1200px;
  --pad-x: 60px;
  --pad-y: 96px;

  --radius-btn: 8px;
  --radius-card: 4px;
  --transition: 0.15s ease;

  --shadow-card:      0 18px 34px -18px rgba(3, 33, 56, 0.35);
  --shadow-card-sm:   0 16px 30px -18px rgba(3, 33, 56, 0.3);
  --shadow-hero-box:  0 22px 50px -22px rgba(3, 20, 40, 0.7);

  /* Dark sky fallback (used when a band has no photo) */
  --sky-band: radial-gradient(60% 80% at 80% 18%, rgba(230, 86, 64, 0.10), transparent 70%),
              radial-gradient(70% 90% at 12% 98%, rgba(70, 92, 150, 0.24), transparent 70%),
              linear-gradient(155deg, #06213a 0%, #05192e 45%, #081428 100%);
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--text);
  margin: 0 0 0.5em;
}
h1, h2 { text-wrap: balance; }
h1 { font-size: clamp(1.9375rem, 2.5vw + 1.4rem, 3.4375rem); line-height: 1.1; }
h2 { font-size: clamp(1.5625rem, 1.8vw + 1.1rem, 2.4375rem); line-height: 1.25; }
h3 { font-size: clamp(1.375rem, 0.4vw + 1.25rem, 1.5625rem); line-height: 1.22; }

p { margin: 0 0 1.25em; }
p:last-child { margin-bottom: 0; }

a { color: var(--link); }
main :where(a:not([class])) { text-decoration: underline; text-underline-offset: 2px; }
main :where(a:not([class])):hover { color: var(--link-hover); }

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

::selection { background: rgba(0, 92, 153, 0.15); }

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  font: 600 14px/1 var(--sans);
  text-decoration: none;
}
.skip-link:focus { left: 12px; top: 12px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
}

.section {
  padding: var(--pad-y) var(--pad-x);
}
.section-alt { background: var(--surface-2); }

.lead {
  font-size: 20px;
  line-height: 1.55;
  color: var(--text-strong);
  max-width: 66ch;
}
.body-muted {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 66ch;
}
.section-intro {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 62ch;
  margin-bottom: 44px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
}
.on-dark .eyebrow { color: var(--accent-soft); }

[id] { scroll-margin-top: 90px; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--pad-x);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
}
.wordmark-logo { width: 40px; height: 40px; flex-shrink: 0; }
.logo-on-dark { display: none; }
.wordmark-text { display: flex; flex-direction: column; gap: 3px; }
.wordmark-name {
  font: 600 23px/1 var(--serif);
  color: var(--text);   /* tracking 0 per CD manual p.16-17 (family lock) */
}
.wordmark-affil {
  font: 600 11px/1 var(--sans);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}
.site-nav a {
  position: relative;
  font: 600 15px/1 var(--sans);
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 0;
  transition: color var(--transition);
}
.site-nav a:hover { color: var(--link); }
.site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* Mobile menu: <details> so it works without JavaScript */
.menu-toggle { display: none; position: relative; }
.menu-toggle > summary {
  list-style: none;
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  cursor: pointer;
}
.menu-toggle > summary::-webkit-details-marker { display: none; }
.menu-toggle > summary .bar {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.menu-toggle[open] > summary .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[open] > summary .bar:nth-child(2) { opacity: 0; }
.menu-toggle[open] > summary .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.menu-panel {
  position: absolute;
  top: calc(100% + 15px);
  right: -20px;
  width: calc(100vw);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 24px 40px -24px rgba(3, 33, 56, 0.3);
}
.menu-panel a:not(.btn) {
  font: 600 17px/1 var(--sans);
  color: var(--text);
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.menu-panel a[aria-current="page"] { color: var(--link); }
.menu-panel .btn { margin-top: 14px; justify-content: center; }

@media (max-width: 767px) {
  .site-nav { display: none; }
  .menu-toggle { display: block; }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  font: 600 15px/1 var(--sans);
  border-radius: var(--radius-btn);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn svg { flex-shrink: 0; }

.btn-primary {
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
  padding: 15px 24px;
}
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

.btn-secondary {
  color: var(--link);
  background: transparent;
  border: 1px solid var(--link);
  padding: 14px 22px;
}
.btn-secondary:hover { background: var(--link-tint); }

.btn-inverted {
  color: var(--blue);
  background: #fff;
  border: 1px solid #fff;
  padding: 15px 24px;
}
.btn-inverted:hover { background: var(--hairline); border-color: var(--hairline); }

/* --------------------------------------------------------------------------
   Dark sky bands — subtle repeating star layer
   -------------------------------------------------------------------------- */
.sky {
  position: relative;
  overflow: hidden;
}
.sky::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.9;
  background-image:
    radial-gradient(1.5px 1.5px at 40px 60px, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 130px 30px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 90px 170px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 210px 120px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 175px 205px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 30px 200px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 225px 45px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(2px 2px at 70px 110px, rgba(255, 200, 175, 0.85), transparent),
    radial-gradient(1px 1px at 250px 180px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 150px 95px, rgba(255, 255, 255, 0.45), transparent);
  background-size: 270px 270px;
  background-repeat: repeat;
}
.sky > * { position: relative; }

/* --------------------------------------------------------------------------
   Hero (home)
   -------------------------------------------------------------------------- */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  min-height: 520px;
  padding: 48px var(--pad-x);
  background: var(--sky-band);
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(3, 20, 40, 0.5), rgba(3, 20, 40, 0.12));
}
.hero-box {
  max-width: 680px;
  background: rgba(255, 255, 255, 0.95);
  border-top: 4px solid var(--accent);
  padding: 34px 40px 38px;
  box-shadow: var(--shadow-hero-box);
}
/* The white hero box keeps dark-on-light text in every theme, so its colors
   reference fixed hue tokens, never --text. */
.hero-box h1 { margin-bottom: 14px; color: var(--navy); }
.hero-box .hero-sub {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 56ch;
  margin: 0 0 26px;
}
.hero-box > :last-child { margin-bottom: 0; }
/* Buttons inside the white box use fixed hues so dark mode cannot wash
   them out on the invariant white background. */
.hero-box .btn-secondary { color: var(--blue); border-color: var(--blue); }
.hero-box .btn-secondary:hover { background: rgba(0, 92, 153, 0.07); }
.hero-lockup { margin: 6px 0 26px; }
.hero-lockup img { width: min(520px, 100%); height: auto; }
.hero-kicker {
  display: inline-block;
  margin-bottom: 12px;
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
}

.hero-credit {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
}

/* --------------------------------------------------------------------------
   Page hero (subpages): light intro strip
   -------------------------------------------------------------------------- */
.page-hero {
  padding: 72px var(--pad-x) 0;
}
.page-hero .lead { margin-top: 6px; }

/* --------------------------------------------------------------------------
   Stats band
   -------------------------------------------------------------------------- */
.stats {
  background: var(--sky-band);
  padding: 72px var(--pad-x);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}
.stat-num {
  font: 600 clamp(2rem, 2vw + 1.4rem, 3rem)/1.1 var(--serif);
  color: #fff;
}
.stat-num sup { font-size: 0.55em; }
.stat-label {
  margin-top: 10px;
  font: 600 12px/1.5 var(--sans);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gray-base);
}
@media (max-width: 899px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}

/* --------------------------------------------------------------------------
   Science questions
   -------------------------------------------------------------------------- */
.questions {
  list-style: none;
  margin: 0;
  padding: 0;
}
.questions li {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 28px;
  align-items: baseline;
  padding: 34px 0;
  border-top: 1px solid var(--border-strong);
}
.questions li:last-child { border-bottom: 1px solid var(--border-strong); }
.q-num {
  font: 600 30px/1 var(--serif);
  color: var(--accent);
}
.q-text {
  font: 400 clamp(1.25rem, 1vw + 1rem, 1.6875rem)/1.4 var(--serif);
  color: var(--text);
  max-width: 34em;
}
@media (max-width: 639px) {
  .questions li { grid-template-columns: 48px 1fr; gap: 16px; padding: 24px 0; }
  .q-num { font-size: 22px; }
}

/* --------------------------------------------------------------------------
   Cards (teasers, news, releases, team leads)
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.teaser-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  padding: 26px 24px 20px;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition);
}
a.teaser-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.teaser-card h3 { margin-bottom: 12px; }
.teaser-card p { font-size: 16px; line-height: 1.5; color: var(--text-muted); margin: 0; }
.teaser-card .card-arrow {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  justify-content: flex-end;
  color: var(--link);
}

/* News teaser: image on top, date above the title */
.card-media {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  margin: -27px -25px 20px;  /* bleed over the card padding + border */
  border-bottom: 1px solid var(--border);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-date {
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}

@media (max-width: 1023px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 639px) {
  .card-grid { grid-template-columns: 1fr; gap: 14px; }
  .teaser-card { padding: 20px 20px 16px; }
  .card-media { margin: -21px -21px 16px; }
  .teaser-card .card-arrow { padding-top: 14px; }
}

/* --------------------------------------------------------------------------
   Chips (survey regions)
   -------------------------------------------------------------------------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 13px/1 var(--sans);
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 9px 15px;
}
.chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* --------------------------------------------------------------------------
   Goals list (survey page)
   -------------------------------------------------------------------------- */
.goals {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 48px;
}
.goals li {
  position: relative;
  padding-left: 26px;
  font-size: 16.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.goals li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.48em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}
@media (max-width: 767px) {
  .goals { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Figures. Scientific plots keep a white plate in both themes.
   -------------------------------------------------------------------------- */
.figure { margin: 0; }
.figure img {
  width: 100%;
  border-radius: var(--radius-card);
}
.figure-plot img {
  background: #fff;
  border: 1px solid var(--border-strong);
  padding: 12px;
}
.figure figcaption {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-faint);
  max-width: 80ch;
}
.figure + .figure { margin-top: 56px; }

/* --------------------------------------------------------------------------
   Split (media + text)
   -------------------------------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 56px;
  align-items: center;
}
.split + .split { margin-top: 88px; }
.split-flip .split-figure { order: 2; }

.split-figure { margin: 0; }
.split-figure img {
  width: 100%;
  border-radius: var(--radius-card);
}
.split-figure figcaption { margin-top: 10px; font-size: 12.5px; color: var(--text-faint); }

.split-content h2, .split-content h3 { margin-bottom: 16px; }
.split-content p { font-size: 17px; line-height: 1.65; color: var(--text-muted); margin-bottom: 26px; }
.split-content p:last-child { margin-bottom: 0; }

@media (max-width: 1023px) {
  .split { grid-template-columns: 1fr; gap: 28px; }
  .split-flip .split-figure { order: 0; }
  .split + .split { margin-top: 64px; }
}

/* --------------------------------------------------------------------------
   Data releases
   -------------------------------------------------------------------------- */
.release {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  overflow: hidden;
}
.release + .release { margin-top: 32px; }
.release-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.release-body { padding: 30px 34px 28px; }
.release-body h3 { margin-bottom: 6px; }
.release-meta {
  font: 600 12px/1.5 var(--sans);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.release-body p { font-size: 16px; line-height: 1.6; color: var(--text-muted); margin-bottom: 20px; }
@media (max-width: 899px) {
  .release { grid-template-columns: 1fr; }
  .release-media { aspect-ratio: 5 / 2; }
  .release-body { padding: 24px 22px 22px; }
}

/* --------------------------------------------------------------------------
   Publications list
   -------------------------------------------------------------------------- */
.pub-list {
  list-style: none;
  margin: 40px 0 48px;
  padding: 0;
  border-top: 1px solid var(--border);
}
.pub-list li {
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}
.pub-tag {
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 10px;
}
.pub-title {
  font: 400 21px/1.35 var(--serif);
  margin: 0 0 8px;
}
.pub-authors {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 6px;
}
.pub-authors strong { font-weight: 600; color: var(--text); }
.pub-meta {
  font-size: 14px;
  color: var(--text-faint);
  margin: 0 0 12px;
}
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font: 600 14px/1 var(--sans);
}
.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}
.pub-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   Team
   -------------------------------------------------------------------------- */
.lead-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 64px;
}
.lead-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  padding: 26px 24px 24px;
}
.lead-card h3 { margin-bottom: 4px; }
.lead-role {
  font: 600 12px/1.5 var(--sans);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 12px;
}
.lead-card p { font-size: 15.5px; color: var(--text-muted); margin: 0; }
@media (max-width: 899px) {
  .lead-cards { grid-template-columns: 1fr; gap: 14px; margin-bottom: 44px; }
}

.table-wrap { overflow-x: auto; }
.team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
}
.team-table th {
  text-align: left;
  font: 600 12px/1.5 var(--sans);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 18px 12px 0;
  border-bottom: 2px solid var(--border-strong);
}
.team-table td {
  padding: 11px 18px 11px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}
.team-table td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }

/* --------------------------------------------------------------------------
   News timeline
   -------------------------------------------------------------------------- */
.timeline {
  position: relative;
  margin-top: 8px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-strong);
}
.post {
  position: relative;
  padding: 0 0 72px 44px;
}
.post:last-child { padding-bottom: 8px; }
.post::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  outline: 3px solid var(--bg);
}
.post-date {
  font: 600 13px/1 var(--sans);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 10px;
}
.post h2 { font-size: clamp(1.4rem, 1vw + 1.1rem, 1.75rem); margin-bottom: 14px; }
.post-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}
.post-body > div p { font-size: 16.5px; line-height: 1.65; color: var(--text-muted); }
.post-figure { margin: 0; }
.post-figure img {
  width: 100%;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
}
.post-figure figcaption { margin-top: 8px; font-size: 12.5px; color: var(--text-faint); }
.post-noimg .post-body { grid-template-columns: 1fr; }
@media (max-width: 767px) {
  .post { padding-left: 32px; }
  .post-body { grid-template-columns: 1fr; gap: 20px; }
  .post-figure { max-width: 380px; }
}

/* --------------------------------------------------------------------------
   Dark coda band (data CTA) with photo background
   -------------------------------------------------------------------------- */
.coda {
  position: relative;
  overflow: hidden;
  padding: 100px var(--pad-x);
  background: var(--sky-band);
}
.coda-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.coda-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(3, 20, 40, 0.82) 25%, rgba(3, 20, 40, 0.45));
}
.coda .container { position: relative; }
.coda h2 { color: #fff; margin-bottom: 20px; }
.coda-body {
  font-size: 17px;
  line-height: 1.65;
  color: #c3ccd2;
  max-width: 60ch;
  margin-bottom: 30px;
}
.coda-credit {
  position: absolute;
  right: 16px;
  bottom: 14px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}

/* --------------------------------------------------------------------------
   Partner band. Logos live on white in both themes (brand invariant).
   -------------------------------------------------------------------------- */
.partners {
  background: #fff;
  border-top: 1px solid var(--hairline);
  padding: 44px var(--pad-x);
}
.partners-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.partners-note {
  font-size: 15px;
  color: var(--ink-muted);
  max-width: 44ch;
  margin: 0;
}
.partners-logos {
  display: flex;
  align-items: center;
  gap: 48px;
}
.partners-logos a { display: block; }
.partners-logos img { display: block; }
.logo-univie { height: 52px; width: auto; }
.logo-eso { height: 74px; width: auto; }
@media (max-width: 767px) {
  .partners-inner { justify-content: center; text-align: center; }
  .partners-logos { gap: 32px; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--navy);
  color: var(--gray-base);
}
.footer-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 64px var(--pad-x) 44px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px;
}
.footer-wordmark { margin-bottom: 18px; }
.footer-wordmark img { width: 220px; height: auto; }
.footer-wordmark .wordmark-name { color: #fff; font-size: 22px; }
.footer-wordmark .wordmark-affil { color: var(--gray-base); }
.footer-address {
  font-size: 15px;
  line-height: 1.7;
  font-style: normal;
  color: var(--gray-base);
  margin: 0 0 16px;
}
.footer-email {
  font-size: 15px;
  color: var(--link-on-navy);
  text-decoration: none;
  border-bottom: 1px solid rgba(127, 196, 232, 0.4);
  padding-bottom: 1px;
  transition: color var(--transition);
}
.footer-email:hover { color: #fff; }

.footer-heading {
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gray-border);
  margin: 0 0 16px;
}
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  color: var(--gray-base);
  text-decoration: none;
  padding: 6px 0;
  transition: color var(--transition);
}
.footer-links a:hover { color: #fff; }
.footer-links svg { opacity: 0.65; }

.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.footer-bottom-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-copy { font-size: 13px; color: var(--gray-base); }
.footer-copy a { color: var(--gray-border); }

@media (max-width: 899px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
  .footer-main > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 479px) {
  .footer-main { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Responsive: global paddings & hero
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  :root { --pad-x: 20px; --pad-y: 48px; }
  .hero { min-height: 420px; padding: 20px 20px 44px; }
  .hero-box { padding: 22px 22px 24px; }
  .hero-box .hero-sub { font-size: 15px; margin-bottom: 20px; }
  .lead { font-size: 18px; }
  .body-muted { font-size: 16px; }
  .section-intro { font-size: 16px; margin-bottom: 26px; }
  .stats { padding: 44px var(--pad-x); }
  .coda { padding: 56px var(--pad-x); }
  .page-hero { padding-top: 44px; }
  .wordmark-name { font-size: 18px; }
  .wordmark-logo { width: 34px; height: 34px; }
  .wordmark-affil { font-size: 9.5px; }
  .footer-main { padding: 44px var(--pad-x) 32px; }
  .footer-bottom-inner { padding: 18px var(--pad-x); }
}

/* ==========================================================================
   univie at night — dark mode. Default follows prefers-color-scheme; an
   explicit user choice (data-theme on <html>) always wins. Dark redefines
   ONLY the semantic tokens, plus the component overrides below.
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #08192b;
    --surface:       #102a40;
    --surface-2:     #0e2338;
    --text:          #eaf1f6;
    --text-strong:   #f5f9fc;
    --text-muted:    #a8b8c4;
    --text-faint:    #8494a1;
    --border:        #24384c;
    --border-strong: #38506a;
    --link:          #7fc4e8;
    --link-hover:    #a9d8f0;
    --link-tint:     rgba(127, 196, 232, 0.10);
    --focus:         #5db4e6;
    --shadow-card:     0 16px 30px -16px rgba(0, 0, 0, 0.6);
    --shadow-card-sm:  0 14px 26px -16px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:            #08192b;
  --surface:       #102a40;
  --surface-2:     #0e2338;
  --text:          #eaf1f6;
  --text-strong:   #f5f9fc;
  --text-muted:    #a8b8c4;
  --text-faint:    #8494a1;
  --border:        #24384c;
  --border-strong: #38506a;
  --link:          #7fc4e8;
  --link-hover:    #a9d8f0;
  --link-tint:     rgba(127, 196, 232, 0.10);
  --focus:         #5db4e6;
  --shadow-card:     0 16px 30px -16px rgba(0, 0, 0, 0.6);
  --shadow-card-sm:  0 14px 26px -16px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* Dark-only component overrides, duplicated for both dark triggers. */
:root[data-theme="dark"] .teaser-card,
:root[data-theme="dark"] .lead-card,
:root[data-theme="dark"] .release { border-color: var(--border-strong); }
:root[data-theme="dark"] a.teaser-card:hover {
  background: #17324c;
  border-color: #4a6076;
  box-shadow: var(--shadow-card);
}
:root[data-theme="dark"] .eyebrow { color: var(--link); }
:root[data-theme="dark"] .q-num { color: var(--accent-soft); }
:root[data-theme="dark"] .goals li::before,
:root[data-theme="dark"] .chip::before,
:root[data-theme="dark"] .post::before { background: var(--accent-soft); }
:root[data-theme="dark"] .site-footer { border-top: 1px solid var(--border); }
:root[data-theme="dark"] .partners { border-color: transparent; }
:root[data-theme="dark"] .menu-panel { box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.7); }
:root[data-theme="dark"] ::selection { background: rgba(127, 196, 232, 0.22); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .teaser-card,
  :root:not([data-theme="light"]) .lead-card,
  :root:not([data-theme="light"]) .release { border-color: var(--border-strong); }
  :root:not([data-theme="light"]) a.teaser-card:hover {
    background: #17324c;
    border-color: #4a6076;
    box-shadow: var(--shadow-card);
  }
  :root:not([data-theme="light"]) .eyebrow { color: var(--link); }
  :root:not([data-theme="light"]) .q-num { color: var(--accent-soft); }
  :root:not([data-theme="light"]) .goals li::before,
  :root:not([data-theme="light"]) .chip::before,
  :root:not([data-theme="light"]) .post::before { background: var(--accent-soft); }
  :root:not([data-theme="light"]) .site-footer { border-top: 1px solid var(--border); }
  :root:not([data-theme="light"]) .partners { border-color: transparent; }
  :root:not([data-theme="light"]) .menu-panel { box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.7); }
  :root:not([data-theme="light"]) ::selection { background: rgba(127, 196, 232, 0.22); }
}

/* Theme toggle (both themes via tokens) */
.header-right { display: flex; align-items: center; gap: 20px; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }

:root[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .logo-on-light { display: none; }
:root[data-theme="dark"] .logo-on-dark  { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="light"]) .logo-on-light { display: none; }
  :root:not([data-theme="light"]) .logo-on-dark  { display: block; }
}

/* Progressive enhancement: no JS → no toggle (site follows the OS theme). */
.no-js .theme-toggle { display: none; }

@media (max-width: 767px) {
  .theme-toggle { width: 44px; height: 44px; }
}
