:root {
  --ink: #191512;
  --muted: #60564d;
  --paper: #ece6de;
  --panel: #f5efe7;
  --ivory: #ece5da;
  --accent: #b97b4b;
  --accent-cool: #6b787d;
  --accent-soft: #efe0cf;
  --line: #d5cabf;
  --shadow: 0 18px 40px rgba(32, 22, 14, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
}

code {
  padding: 0.08rem 0.36rem;
  border-radius: 0.35rem;
  background: rgba(92, 74, 58, 0.08);
  color: #4e4034;
  font-family: "Space Grotesk", "SFMono-Regular", monospace;
  font-size: 0.92em;
}

.topbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 28px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  color: var(--ivory);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar .brand {
  font-family: "Cormorant Garamond", serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  justify-self: start;
}

.topbar .topbar-nav-desktop {
  display: flex;
  gap: 28px;
  justify-self: center;
}

.topbar .topbar-nav-desktop a {
  font-size: 1.05rem;
  text-decoration: none;
  opacity: 0.93;
}

.topbar .topbar-nav-desktop a:hover {
  opacity: 1;
}

.topbar .cta {
  justify-self: end;
  text-decoration: none;
  color: #131313;
  background: #efede8;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 500;
  font-size: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.topbar .cta:hover {
  background: #ffffff;
}

/* Mobile nav overlay — lives OUTSIDE topbar to avoid fixed-positioning issues on iOS */
.mobile-nav-overlay {
  display: none; /* hidden on desktop */
}

@media (max-width: 860px) {
  .mobile-nav-overlay {
    display: flex; /* enable on mobile */
    position: fixed;
    inset: 0;
    z-index: 19;
    background: rgba(12, 10, 8, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .mobile-nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mobile-nav-links a {
  font-size: 1.6rem;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  color: var(--ivory);
  text-decoration: none;
  padding: 14px 24px;
  opacity: 0.9;
  letter-spacing: 0.04em;
  transition: opacity 0.2s, color 0.2s;
}

.mobile-nav-links a:hover,
.mobile-nav-links a:active {
  opacity: 1;
  color: var(--accent);
}

.mobile-nav-cta {
  margin-top: 18px;
  color: #131313 !important;
  background: #efede8;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  padding: 14px 32px !important;
  font-weight: 600 !important;
  font-size: 1.15rem !important;
  font-family: "Space Grotesk", sans-serif !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 30;
  flex-direction: column;
  gap: 5px;
  justify-self: end;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ivory);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hero {
  position: relative;
  min-height: 104vh;
  padding-top: 86px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, #26211a 0%, #080808 45%, #000000 100%),
    #000;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.24)),
    radial-gradient(circle at 50% 84%, rgba(245, 244, 239, 0.04), rgba(0, 0, 0, 0) 46%);
}

.hero-copy {
  position: relative;
  z-index: 3;
  width: min(1400px, 92vw);
  margin: 14vh auto 0;
  color: #ecf4fa;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  color: #cfb7a1;
  margin-bottom: 0.8rem;
}

h1,
h2,
h3 {
  line-height: 1.1;
  margin: 0 0 0.7rem;
}

h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.8rem, 9vw, 10rem);
  letter-spacing: 0.01em;
  line-height: 0.9;
  color: var(--ivory);
}

h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.5rem, 3vw, 2.6rem);
}

h3 {
  font-size: 1.2rem;
  font-family: "Cormorant Garamond", serif;
}

.hero-copy p {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(0.95rem, 1.2vw, 1.16rem);
  color: rgba(232, 228, 220, 0.84);
}

.hero-title em {
  font-style: italic;
  font-weight: 500;
  color: #e6d0bf;
}

.hero-wordmark {
  display: inline-block;
  font-family: "Bodoni Moda", "Cormorant Garamond", serif;
  font-weight: 700;
  letter-spacing: 0.035em;
  color: #f3ece2;
  text-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
}

.hero-sub {
  margin-top: 18px;
  max-width: 560px !important;
  font-size: clamp(0.9rem, 1.1vw, 1.05rem) !important;
  color: rgba(232, 228, 220, 0.72) !important;
}

.hero-stats {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
}

.hero-stat {
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 0;
  min-width: 0;
  text-align: left;
}

.hero-stat .k {
  font-size: 0.66rem;
  color: rgba(232, 228, 220, 0.64);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.hero-stat .v {
  font-size: 0.92rem;
  font-weight: 500;
  color: #f0ece4;
}

.hero-globe-wrap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -34vh;
  width: 132vw;
  height: 132vw;
  min-width: 980px;
  min-height: 980px;
  max-width: 1850px;
  max-height: 1850px;
  pointer-events: none;
  z-index: 2;
}

#hero-globe {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  mix-blend-mode: normal;
}

#hero-globe canvas {
  outline: none;
  filter: none;
}

.globe-site-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(227, 223, 216, 0.76);
  box-shadow:
    0 0 0 1px rgba(10, 11, 14, 0.36),
    0 0 16px rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.globe-site-dot.focus {
  width: 10px;
  height: 10px;
  background: #f5efe5;
  box-shadow:
    0 0 0 1px rgba(10, 11, 14, 0.42),
    0 0 18px rgba(245, 239, 229, 0.48);
}

.globe-site-dot:hover {
  transform: translate(-50%, -50%) scale(1.15);
}

#globe-hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 20vh;
  color: rgba(229, 222, 212, 0.88);
  background: rgba(9, 9, 9, 0.26);
  border: 1px solid rgba(232, 228, 220, 0.16);
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 0.78rem;
  max-width: 420px;
  text-align: center;
  letter-spacing: 0.04em;
  pointer-events: none;
  user-select: none;
}

main {
  width: min(1220px, 92vw);
  margin: -3.8rem auto 0;
  position: relative;
  z-index: 3;
}

.panel {
  margin: 22px 0;
  padding: 26px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f7f1e9, #eee5db);
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(33, 22, 15, 0.07);
}

.panel.alt {
  background: linear-gradient(180deg, #f2ebe1, #e9e0d5);
}

.panel-head {
  margin-bottom: 16px;
}

.grid {
  display: grid;
  gap: 14px;
  margin-bottom: 12px;
}

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

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
}

.card p,
.card li {
  color: var(--muted);
  line-height: 1.55;
}

.narrative .qa-note {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border-radius: 8px;
  padding: 9px 10px;
  margin: 10px 0 12px;
  color: #6d472e;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.controls label,
.explorer-controls label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
  color: #5e544b;
  min-width: 220px;
}

.explorer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

select {
  border: 1px solid #cdbfb2;
  border-radius: 8px;
  background: #fffdfa;
  color: #302721;
  padding: 7px 9px;
  font-family: inherit;
}

.mini-metrics {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 8px;
}

.metric-pill {
  border: 1px solid #dbd0c4;
  border-radius: 10px;
  padding: 8px;
  background: #fbf7f2;
}

.metric-pill .k {
  font-size: 0.7rem;
  color: #7b6e61;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-pill .v {
  font-weight: 700;
  color: #2f261f;
}

.chart-card {
  overflow: hidden;
}

.chart {
  width: 100%;
  height: 380px;
}

.chart.tall {
  height: 500px;
}

.simple-list {
  margin: 8px 0 0 1.1rem;
  padding: 0;
}

.simple-list li {
  margin-bottom: 6px;
}

#outlier-table {
  margin-top: 12px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid #ded2c6;
  border-radius: 10px;
}

#outlier-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

#outlier-table th,
#outlier-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid #edf3f8;
}

#outlier-table th {
  position: sticky;
  top: 0;
  background: #f7f1ea;
}

.subtle {
  margin-top: -2px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.pipeline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pipe-step {
  border: 1px solid #d2c6ba;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  background: #fbf6f0;
  transition: all 0.25s ease;
}

.pipe-step.active {
  border-color: var(--accent-cool);
  background: #ece7e0;
  color: #3d433f;
  transform: translateY(-2px);
}

.pipeline-text {
  min-height: 86px;
  font-size: 0.92rem;
  color: #554c44;
  background: #faf4ed;
  border: 1px solid #ddd0c3;
  border-radius: 10px;
  padding: 10px 12px;
}

.map-card .map {
  position: relative;
  height: 360px;
  border-radius: 12px;
  border: 1px solid #cfc2b5;
  overflow: hidden;
  background: linear-gradient(145deg, #15202a, #32424d);
}

.map .js-plotly-plot,
.map .plot-container,
.map .svg-container {
  width: 100% !important;
  height: 100% !important;
}

.map-tooltip {
  margin-top: 8px;
  min-height: 64px;
  border: 1px dashed #cdbfb1;
  border-radius: 10px;
  background: #f9f3eb;
  padding: 9px 10px;
  color: #51463f;
  font-size: 0.88rem;
}

.story-grid,
.instrument-grid {
  align-items: stretch;
}

.story-lead {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 78% 18%, rgba(191, 125, 72, 0.15), rgba(191, 125, 72, 0) 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.16));
}

.story-lead p em,
.story-lead li em,
.mission-callout em,
.micro-card .micro-v em,
.term-note li em,
.usecase-card p em,
.network-story p em,
.bridge-connector p em,
.bridge-overlay p em {
  font-style: italic;
  color: #6b4d37;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  color: #917760;
  margin-bottom: 0.9rem;
}

.editorial-callout {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(136, 113, 90, 0.22);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.5rem, 2.2vw, 2.3rem);
  line-height: 1.05;
  color: #6c4d34;
}

.mission-callout,
.term-note {
  margin-top: 1rem;
  padding: 1rem 1.05rem;
  border-radius: 14px;
  border: 1px solid rgba(131, 111, 91, 0.18);
  background: rgba(255, 253, 249, 0.78);
}

.mission-callout {
  color: #4c4036;
  line-height: 1.55;
}

.term-note h4 {
  margin: 0 0 0.65rem;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
  color: #3b3028;
}

.term-note .simple-list {
  margin-top: 0;
}

.overview-map-block {
  margin-top: auto;
  padding-top: 1.2rem;
}

.overview-map-head {
  margin-bottom: 0.8rem;
}

.overview-map-head h3 {
  margin-bottom: 0.25rem;
}

.overview-map-head p {
  margin: 0;
  color: #6a5d52;
  font-size: 0.9rem;
}

.story-network-map {
  height: 290px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(131, 111, 91, 0.18);
  background: linear-gradient(180deg, #dbe1e4, #d3dadd);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.story-network-map .js-plotly-plot,
.story-network-map .plot-container,
.story-network-map .svg-container {
  width: 100% !important;
  height: 100% !important;
}

.story-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 0.85rem;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #55493f;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.network-story {
  display: flex;
  flex-direction: column;
}

.pgn-scene-container {
  margin-top: auto;
  padding-top: 1.2rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(131, 111, 91, 0.18);
  background: #ede8e0;
}

.pgn-city-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 2.2;
  overflow: hidden;
  cursor: pointer;
  background: #d9d4cb;
}

.pgn-city-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 2px;
  padding: 2px;
}

.pgn-block {
  position: relative;
  border-radius: 3px;
  transition: background 0.6s ease;
}

.pgn-sat-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}

.pgn-single-color {
  width: 100%;
  height: 100%;
}

.pgn-ground-pin {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.4s ease;
  pointer-events: none;
  opacity: 0;
}

.pgn-pin-ring {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid #3a6b5e;
  background: rgba(58, 107, 94, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 6px rgba(58, 107, 94, 0.08), 0 2px 12px rgba(0, 0, 0, 0.15);
  animation: pgnPingRing 2.5s ease-in-out infinite;
}

.pgn-pin-dot {
  width: 12px;
  height: 12px;
  background: #3a6b5e;
  border-radius: 50%;
}

@keyframes pgnPingRing {
  0%,
  100% {
    box-shadow: 0 0 0 6px rgba(58, 107, 94, 0.08), 0 2px 12px rgba(0, 0, 0, 0.15);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(58, 107, 94, 0.04), 0 2px 12px rgba(0, 0, 0, 0.15);
  }
}

.pgn-slider-area {
  padding: 1.25rem 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.pgn-slider-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 420px;
}

.pgn-slider-label {
  font-family: "Space Grotesk", "Avenir Next", sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.3s ease;
}

.pgn-slider-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pgn-sat-label {
  color: #b85c38;
}

.pgn-sat-label .dot {
  background: #b85c38;
}

.pgn-ground-label {
  color: #3a6b5e;
}

.pgn-ground-label .dot {
  background: #3a6b5e;
}

.pgn-slider-label.dimmed {
  opacity: 0.35;
}

#pgnViewSlider {
  width: 100%;
  max-width: 420px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, #b85c38 0%, #d6d0c6 50%, #3a6b5e 100%);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

#pgnViewSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: #fff;
  border: 2px solid #2c2a26;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

#pgnViewSlider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: #fff;
  border: 2px solid #2c2a26;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.pgn-drag-hint {
  margin-top: -0.2rem;
  font-size: 0.78rem;
  color: #7a756b;
  font-style: italic;
}

.pgn-caption-area {
  text-align: center;
  padding: 0 1.5rem 1.5rem;
}

.pgn-caption {
  min-height: 3.3rem;
  max-width: 560px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.65;
  color: #2c2a26;
}

.pgn-caption strong {
  font-weight: 600;
}

.pgn-caption .highlight-sat {
  color: #b85c38;
  font-weight: 600;
}

.pgn-caption .highlight-gnd {
  color: #3a6b5e;
  font-weight: 600;
}

.stack-grid {
  display: grid;
  gap: 12px;
}

.stack-grid.compact {
  gap: 10px;
}

.micro-card {
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid rgba(131, 111, 91, 0.18);
  background: rgba(255, 253, 249, 0.76);
}

.micro-card .micro-k {
  margin-bottom: 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #887563;
}

.micro-card .micro-v {
  color: #352b24;
  line-height: 1.45;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.timeline-item {
  min-height: 220px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(126, 103, 82, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.92), rgba(241, 233, 222, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.timeline-item .year {
  display: block;
  margin-bottom: 8px;
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  color: #765034;
}

.timeline-item h3,
.usecase-card h3,
.ops-card h3 {
  margin-bottom: 0.45rem;
}

.source-note {
  margin-top: 10px;
  font-size: 0.76rem;
  color: #7d6f63;
}

.dark-card {
  color: #f2ebde;
  background:
    radial-gradient(circle at 50% 25%, rgba(205, 145, 94, 0.12), rgba(205, 145, 94, 0) 32%),
    linear-gradient(180deg, #171311, #0b0908);
  border-color: rgba(237, 223, 205, 0.12);
}

.dark-card p,
.dark-card li,
.dark-card h3 {
  color: inherit;
}

.instrument-stage {
  margin-top: 8px;
}

.media-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(249, 242, 234, 0.92));
}

.instrument-media {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.media-shot {
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(132, 112, 92, 0.18);
  background: #efe8de;
}

.inline-video-shell {
  position: relative;
  cursor: pointer;
  background: #0f0d0c;
}

.media-shot img,
.media-shot video {
  display: block;
  width: 100%;
  height: 420px;
  object-fit: cover;
  background: #0f0d0c;
}

.inline-video-shell video {
  cursor: pointer;
}

.inline-video-trigger {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(245, 239, 229, 0.42);
  border-radius: 999px;
  padding: 12px 18px;
  background: rgba(15, 12, 10, 0.58);
  color: #f1ebe2;
  font: inherit;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.32);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.inline-video-trigger:hover {
  background: rgba(15, 12, 10, 0.74);
  transform: translate(-50%, -50%) scale(1.02);
}

.inline-video-shell.is-playing .inline-video-trigger {
  opacity: 0;
  pointer-events: none;
}

.play-icon {
  width: 0;
  height: 0;
  border-left: 12px solid #f1ebe2;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.media-shot figcaption {
  padding: 10px 12px 12px;
  font-size: 0.82rem;
  color: #5f564d;
}

.ops-callout {
  margin-top: 14px;
  border-radius: 12px;
  border: 1px solid rgba(134, 111, 89, 0.18);
  background: rgba(255, 251, 246, 0.82);
  padding: 12px 13px;
  color: #55493f;
  line-height: 1.5;
}

.ops-card,
.usecase-card {
  padding: 14px;
}

.workflow {
  display: grid;
  gap: 12px;
}

.workflow-step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(128, 108, 88, 0.18);
  background: rgba(255, 252, 247, 0.88);
}

.workflow-step .step-no {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Bodoni Moda", "Cormorant Garamond", serif;
  font-size: 1.2rem;
  color: #fff7ec;
  background: linear-gradient(135deg, #b68557, #7f5b3d);
  box-shadow: 0 10px 24px rgba(127, 91, 61, 0.22);
}

.workflow-step .step-no span {
  display: inline-block;
  line-height: 1;
  transform: translateY(-0.03em);
}

.workflow-step h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: #2f261f;
}

.workflow-step p {
  margin: 0;
  color: #5a5148;
}

.resource-strip {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.resource-card-link,
.source-card a {
  text-decoration: none;
}

.resource-card-link {
  display: block;
}

.resource-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(117, 98, 80, 0.18);
  background: rgba(255, 252, 247, 0.86);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.resource-card-link:hover .resource-card {
  transform: translateY(-2px);
  border-color: rgba(117, 98, 80, 0.32);
  box-shadow: 0 14px 28px rgba(33, 22, 15, 0.08);
}

.resource-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", "Avenir Next", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff8ef;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.resource-logo.pgn {
  background: linear-gradient(135deg, #6d4d34, #9a6f49);
}

.resource-logo.tree {
  background: linear-gradient(135deg, #56705c, #7b977d);
}

.resource-logo.checker {
  background: linear-gradient(135deg, #596a74, #7f97a3);
}

.resource-logo.manual {
  background: linear-gradient(135deg, #8a6e54, #b99772);
}

.resource-logo.nasa {
  background: linear-gradient(135deg, #3b5377, #6081b2);
}

.resource-copy h4 {
  margin: 0 0 0.35rem;
  font-size: 1.04rem;
  color: #2f261f;
}

.resource-copy p {
  margin: 0 0 0.45rem;
  color: #5a5148;
  line-height: 1.5;
}

.resource-data {
  color: #64574b;
  line-height: 1.5;
  font-size: 0.9rem;
}

.resource-data strong {
  color: #3e332b;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.source-card {
  padding: 15px;
  border-radius: 14px;
  border: 1px solid rgba(123, 102, 81, 0.18);
  background: rgba(255, 252, 247, 0.84);
}

.source-card .label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #8a7764;
}

.source-card h3 {
  font-size: 1.1rem;
}

.source-card p {
  margin-bottom: 0.8rem;
}

.source-card a {
  color: #6d4d34;
  font-weight: 600;
}

.footer {
  width: min(1220px, 92vw);
  margin: 28px auto 40px;
  padding: 26px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(191, 125, 72, 0.12), rgba(191, 125, 72, 0) 34%),
    linear-gradient(180deg, #f5eee5, #ece3d8);
  border: 1px solid rgba(132, 112, 92, 0.18);
  color: #564a41;
  font-size: 0.9rem;
  box-shadow: 0 20px 44px rgba(33, 22, 15, 0.11);
}

.footer a {
  color: inherit;
}

.footer-brand {
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(132, 112, 92, 0.16);
}

.footer-brand-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.uni-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.84);
  border: 1px solid rgba(132, 112, 92, 0.14);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

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

.kyushu-logo {
  background:
    radial-gradient(circle at 50% 0%, rgba(170, 102, 72, 0.18), rgba(170, 102, 72, 0) 38%),
    linear-gradient(180deg, #4b3a39, #2f2322);
  border-color: rgba(85, 58, 56, 0.28);
}

.kyushu-logo img {
  width: min(320px, 100%);
}

.pknu-logo {
  background: linear-gradient(180deg, #f8f4ef, #f0e9df);
}

.pknu-logo img {
  width: min(300px, 100%);
}

.brand-cross {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  color: rgba(92, 74, 58, 0.7);
  line-height: 1;
}

.footer-credit {
  margin-top: 16px;
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.6;
  color: #5b4d43;
}

.footer-credit strong {
  color: #2f261f;
}

.footer-legal {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.footer-legal p {
  margin: 0;
  color: #64584f;
  line-height: 1.6;
}

.footer-legal em {
  font-style: italic;
  color: #7b5a43;
}

.footer-legal a {
  color: #6d4d34;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.footer-legal a:hover {
  color: #4c3322;
}

/* ===== TABLET (≤1050px) ===== */
@media (max-width: 1050px) {
  .hero-globe-wrap {
    width: 170vw;
    height: 170vw;
    bottom: -70vw;
    min-width: 720px;
    min-height: 720px;
  }

  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .timeline,
  .source-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mini-metrics {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .chart {
    height: 330px;
  }

  .pgn-city-canvas {
    aspect-ratio: 1.7;
  }

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

  .brand-cross {
    justify-self: center;
  }
}

/* ===== MOBILE NAV BREAKPOINT (≤860px) ===== */
@media (max-width: 860px) {
  .topbar {
    grid-template-columns: auto 1fr;
    padding: 10px 16px;
  }

  .topbar-nav-desktop {
    display: none !important;
  }

  .cta-desktop {
    display: none !important;
  }

  .nav-toggle {
    display: flex;
    justify-self: end;
  }
}

/* ===== MOBILE (≤760px) ===== */
@media (max-width: 760px) {
  main {
    width: 96vw;
    margin-top: -2.2rem;
  }

  .panel {
    padding: 14px;
    border-radius: 14px;
    margin: 14px 0;
  }

  /* Transparent topbar on mobile so globe shows through to the top edge */
  .topbar {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
  }

  /* Restore dark bar once scrolled past the hero */
  .topbar.scrolled {
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: 56px;
    background:
      radial-gradient(circle at 50% 30%, #1e1a14 0%, #0a0808 50%, #000000 100%),
      #000;
  }

  .hero-copy {
    margin-top: 3vh;
    width: 92vw;
  }

  h1 {
    font-size: clamp(2.2rem, 11vw, 4rem);
  }

  .hero-sub {
    font-size: 0.84rem !important;
    max-width: 88vw !important;
    padding: 0 4px;
  }

  .hero-stats {
    gap: 10px 16px;
  }

  .hero-stat .k {
    font-size: 0.58rem;
  }

  .hero-stat .v {
    font-size: 0.82rem;
  }

  /* Globe centered in hero, sized to fill regardless of screen aspect ratio */
  .hero-globe-wrap {
    position: absolute;
    top: 50%;
    bottom: auto;
    left: 50%;
    transform: translate(-50%, -50%);
    width: max(180vw, 130vh);
    height: max(180vw, 130vh);
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    z-index: 1;
  }

  /* Gentle overlay for text readability */
  .hero-overlay {
    background:
      linear-gradient(180deg,
        rgba(0, 0, 0, 0.35) 0%,
        rgba(0, 0, 0, 0.1) 30%,
        rgba(0, 0, 0, 0.0) 55%
      );
    z-index: 2;
  }

  /* Hide globe hint on mobile — clutters the top */
  #globe-hint {
    display: none;
  }

  .panel-head h2 {
    font-size: clamp(1.25rem, 5vw, 1.6rem);
  }

  .eyebrow {
    font-size: 0.65rem;
  }

  .card {
    padding: 12px;
    border-radius: 12px;
  }

  .card p, .card li {
    font-size: 0.9rem;
  }

  .controls label,
  .explorer-controls label {
    min-width: 100%;
  }

  select {
    font-size: 0.95rem;
    padding: 10px 12px;
    -webkit-appearance: none;
    min-height: 44px;
  }

  .chart {
    height: 280px;
  }

  .chart.tall {
    height: 340px;
  }

  .map-card .map {
    height: 280px;
  }

  .timeline {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .timeline-item {
    min-height: auto;
    padding: 14px;
  }

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

  .instrument-media {
    grid-template-columns: 1fr;
  }

  .media-shot img,
  .media-shot video {
    height: 260px;
  }

  .workflow-step {
    grid-template-columns: 42px 1fr;
    gap: 10px;
    padding: 10px;
  }

  .workflow-step .step-no {
    width: 42px;
    height: 42px;
    font-size: 1rem;
  }

  .mini-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .metric-pill {
    padding: 8px 6px;
  }

  .metric-pill .k {
    font-size: 0.62rem;
  }

  .metric-pill .v {
    font-size: 0.88rem;
  }

  .pipeline {
    gap: 6px;
  }

  .pipe-step {
    font-size: 0.72rem;
    padding: 6px 8px;
  }

  .editorial-callout {
    font-size: clamp(1.2rem, 4.5vw, 1.6rem);
  }

  .pgn-city-canvas {
    aspect-ratio: 1.3;
  }

  .pgn-slider-area {
    padding: 1rem 1rem 0.8rem;
  }

  .pgn-caption-area {
    padding: 0 1rem 1rem;
  }

  .pgn-caption {
    font-size: 0.88rem;
    min-height: 2.6rem;
  }

  .story-network-map {
    height: 220px;
    border-radius: 14px;
  }

  .resource-card {
    grid-template-columns: 48px 1fr;
    gap: 10px;
    padding: 12px;
  }

  .resource-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 0.72rem;
  }

  .resource-copy h4 {
    font-size: 0.92rem;
  }

  .resource-copy p,
  .resource-data {
    font-size: 0.82rem;
  }

  #outlier-table {
    max-height: 180px;
    -webkit-overflow-scrolling: touch;
  }

  #outlier-table table {
    font-size: 0.75rem;
  }

  #outlier-table th,
  #outlier-table td {
    padding: 5px 6px;
  }

  .footer {
    width: 96vw;
    padding: 18px 14px;
    border-radius: 14px;
    margin: 20px auto 28px;
  }

  .footer-brand-row {
    gap: 14px;
  }

  .uni-logo {
    min-height: 80px;
    padding: 14px;
  }

  .kyushu-logo img {
    width: min(240px, 100%);
  }

  .pknu-logo img {
    width: min(220px, 100%);
  }

  .footer-credit {
    font-size: 0.85rem;
  }

  .footer-legal {
    font-size: 0.82rem;
  }

  .footer-legal p {
    font-size: 0.82rem;
  }

  .explorer-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .explorer-controls label {
    min-width: 0;
    width: 100%;
  }

  .source-card {
    padding: 12px;
  }

  .source-card h3 {
    font-size: 0.95rem;
  }

  .ops-callout {
    font-size: 0.88rem;
    padding: 10px;
  }

  .micro-card {
    padding: 10px;
  }

  .micro-card .micro-v {
    font-size: 0.88rem;
  }

  .mission-callout,
  .term-note {
    padding: 0.8rem;
  }

  .term-note h4 {
    font-size: 1rem;
  }

  .simple-list li {
    font-size: 0.88rem;
  }
}

/* ===== SMALL MOBILE (≤420px) ===== */
@media (max-width: 420px) {
  h1 {
    font-size: clamp(1.8rem, 12vw, 3rem);
  }

  .hero-copy {
    margin-top: 3vh;
  }

  .hero-sub {
    font-size: 0.82rem !important;
  }

  .hero-stats {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .hero-stat {
    text-align: center;
  }

  .hero-globe-wrap {
    width: max(200vw, 140vh);
    height: max(200vw, 140vh);
  }

  .panel {
    padding: 10px;
    margin: 10px 0;
  }

  .card {
    padding: 10px;
  }

  .chart {
    height: 240px;
  }

  .chart.tall {
    height: 300px;
  }

  .mini-metrics {
    grid-template-columns: 1fr;
  }

  .pgn-city-canvas {
    aspect-ratio: 1.1;
  }

  .media-shot img,
  .media-shot video {
    height: 200px;
  }

  .workflow-step {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .workflow-step .step-no {
    justify-self: center;
  }
}

/* ===== TOUCH & INTERACTION IMPROVEMENTS ===== */
@media (pointer: coarse) {
  .globe-site-dot {
    width: 12px;
    height: 12px;
    min-width: 12px;
    min-height: 12px;
  }

  .globe-site-dot.focus {
    width: 14px;
    height: 14px;
  }

  select {
    min-height: 44px;
  }

  .pipe-step {
    min-height: 36px;
    padding: 8px 12px;
  }

  .mobile-nav-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  #pgnViewSlider::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }

  #pgnViewSlider::-moz-range-thumb {
    width: 28px;
    height: 28px;
  }
}

/* Plotly modebar: hide on mobile to save space */
@media (max-width: 760px) {
  .modebar-container {
    display: none !important;
  }
}
