:root {
  color-scheme: dark;
  --bg: #03050a;
  --panel: rgba(7, 12, 20, 0.72);
  --panel-strong: rgba(9, 17, 30, 0.9);
  --line: rgba(191, 218, 255, 0.18);
  --text: #eef5ff;
  --muted: #9baec7;
  --accent: #7bdff2;
  --accent-2: #f6bd60;
  --hot: #ff6b8a;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: #03050a;
  overflow-x: hidden;
}

body.subpage {
  background:
    linear-gradient(180deg, rgba(3, 5, 10, 0.12), rgba(3, 5, 10, 0.94) 62%),
    radial-gradient(circle at 72% 18%, rgba(255, 107, 138, 0.14), transparent 34rem),
    radial-gradient(circle at 18% 74%, rgba(123, 223, 242, 0.12), transparent 30rem),
    #03050a;
}

button,
input {
  font: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #d7fbff;
}

#volume-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #03050a;
  cursor: grab;
  touch-action: none;
  z-index: 0;
}

#volume-canvas:active {
  cursor: grabbing;
}

.sun-marker {
  position: fixed;
  z-index: 3;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 5.5rem;
  height: 5.5rem;
  transform: translate(-50%, -50%);
  color: #fff8d8;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  pointer-events: none;
  text-shadow: 0 0.45rem 1rem rgba(0, 0, 0, 0.95);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.sun-marker span {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: #fff3a4;
  box-shadow:
    0 0 0 0.34rem rgba(246, 189, 96, 0.16),
    0 0 1.2rem rgba(255, 234, 142, 0.94),
    0 0 4.6rem rgba(246, 189, 96, 0.5);
}

.sun-marker strong {
  margin-top: 0.42rem;
}

.outside-map-story .sun-marker {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.94);
}

.sun-marker.is-hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.88);
}

.site-header {
  position: fixed;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: linear-gradient(180deg, rgba(3, 5, 10, 0.92), rgba(3, 5, 10, 0));
  pointer-events: none;
}

.brand,
.top-nav,
.map-console {
  pointer-events: auto;
  user-select: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.25rem;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  width: 0.9rem;
  height: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow:
    0 0 0 0.34rem rgba(123, 223, 242, 0.1),
    0 0 2rem rgba(123, 223, 242, 0.65);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 4, 8, 0.48);
  backdrop-filter: blur(18px);
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.8rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.top-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

main {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.story-card,
.map-console,
.standalone-section {
  pointer-events: auto;
}

.hero-copy {
  pointer-events: auto;
}

.chapter {
  min-height: 100vh;
}

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 100vh;
  padding: 14vh clamp(1rem, 5vw, 4rem) 22vh;
}

.hero-copy {
  width: min(30rem, 31vw);
  margin-left: auto;
  text-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.72);
  transform: translateY(-8vh);
}

.eyebrow,
.kicker {
  margin: 0 0 0.85rem;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 0.98;
}

h1 {
  max-width: 11ch;
  font-size: clamp(3.35rem, 6.3vw, 5.45rem);
}

h2 {
  font-size: clamp(2.25rem, 5vw, 4.8rem);
}

.hero p:not(.eyebrow),
.story-card p:not(.kicker) {
  color: #d6e2f3;
  font-size: clamp(0.96rem, 1.18vw, 1.12rem);
  line-height: 1.6;
}

.hero p:not(.eyebrow) {
  width: min(29rem, 100%);
  margin: 1.35rem 0 0;
}

.hero-citations {
  margin-top: 1rem;
}

.hero-citations a {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.2rem 0.85rem;
  border: 1px solid rgba(123, 223, 242, 0.35);
  border-radius: 999px;
  background: rgba(4, 8, 15, 0.6);
  color: #c9f8ff;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  backdrop-filter: blur(18px);
}

.hero-citations a:hover {
  border-color: rgba(123, 223, 242, 0.7);
  background: rgba(123, 223, 242, 0.12);
}

.story-panel {
  position: relative;
  width: min(31rem, 34vw);
  margin-left: auto;
  padding: 0 clamp(1.5rem, 3vw, 3rem) 35vh clamp(1.25rem, 2.4vw, 2.3rem);
  background: linear-gradient(90deg, rgba(3, 5, 10, 0.08), rgba(3, 5, 10, 0.86) 16%, rgba(3, 5, 10, 0.96));
}

.story-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 12vh 0;
}

.story-card h2 {
  font-size: clamp(1.8rem, 3.3vw, 3.15rem);
}

.story-card h2,
.story-card p,
.story-card a {
  text-shadow: 0 0.5rem 1.6rem rgba(0, 0, 0, 0.8);
}

.story-card a {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 2.6rem;
  margin-top: 0.6rem;
  padding: 0 1rem;
  border: 1px solid rgba(123, 223, 242, 0.35);
  border-radius: 999px;
  background: rgba(4, 8, 15, 0.56);
  color: #c9f8ff;
  font-size: 0.86rem;
  font-weight: 800;
  backdrop-filter: blur(18px);
}

.map-console {
  position: fixed;
  z-index: 4;
  left: clamp(0.75rem, 2vw, 1.5rem);
  bottom: clamp(0.75rem, 2vw, 1.25rem);
  width: min(14.75rem, calc(100vw - 1.5rem));
  padding: 0.62rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    width 180ms ease;
}

.map-console.is-collapsed {
  width: min(12.5rem, calc(100vw - 1.5rem));
}

.map-console.is-collapsed > :not(.console-row) {
  display: none;
}

.outside-map-story .map-console {
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem);
}

.console-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 1.45rem;
}

.console-label {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#active-map-name {
  flex: 1;
  overflow: hidden;
  color: var(--text);
  font-size: 0.78rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-toggle {
  display: grid;
  flex: 0 0 1.45rem;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #d9e6f7;
  cursor: pointer;
  font: 800 0.9rem/1 sans-serif;
}

.console-toggle:hover {
  border-color: rgba(123, 223, 242, 0.72);
  background: rgba(123, 223, 242, 0.16);
}

.progress-shell {
  height: 0.2rem;
  margin: 0.5rem 0 0.58rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--hot));
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
}

.layer-button,
.control-button {
  display: inline-grid;
  place-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #c7d6ea;
  cursor: pointer;
  font-weight: 900;
}

.layer-button {
  min-height: 1.8rem;
  padding: 0 0.22rem;
  font-size: 0.65rem;
}

.control-button {
  min-height: 1.78rem;
  padding: 0 0.22rem;
  font-size: 0.62rem;
}

.layer-button:hover,
.control-button:hover,
.layer-button.is-active,
.control-button.is-active {
  border-color: rgba(123, 223, 242, 0.72);
  background: rgba(123, 223, 242, 0.16);
  color: #ecfdff;
}

.control-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.48rem;
}

.detail-button {
  grid-column: 1 / -1;
}

.control-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.vector-legend {
  display: none;
  grid-template-columns: auto minmax(4rem, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.48rem;
  color: #c7d6ea;
  font-size: 0.58rem;
  font-weight: 800;
}

.vector-legend.is-visible {
  display: grid;
}

.vector-legend i {
  display: block;
  height: 0.42rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f6fff, #1f222b 48%, #ff4038);
  box-shadow: 0 0 1.2rem rgba(123, 223, 242, 0.26);
}

.vector-legend.is-bfield i {
  background: linear-gradient(90deg, #ff47b7, #f3f6ff 48%, #63ff9e);
  box-shadow: 0 0 1.2rem rgba(99, 255, 158, 0.22);
}

.citation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.citation-list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.3rem;
  margin-top: 0;
  padding: 0.1rem 0.8rem;
  border: 1px solid rgba(123, 223, 242, 0.35);
  border-radius: 999px;
  background: rgba(4, 8, 15, 0.56);
  color: #c9f8ff;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
}

.citation-list-wide {
  max-width: 52rem;
}

.data-card {
  min-height: 86vh;
}

.science-video {
  display: block;
  width: min(100%, 52rem);
  aspect-ratio: 16 / 9;
  margin: 1.3rem 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 1.4rem 3rem rgba(0, 0, 0, 0.32);
  object-fit: contain;
}

.standalone-section {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 16vh clamp(1rem, 6vw, 5rem);
  background:
    linear-gradient(180deg, rgba(3, 5, 10, 0.58), rgba(3, 5, 10, 0.98) 18%),
    #03050a;
}

.standalone-copy {
  width: min(64rem, 100%);
  margin: 0 auto;
}

.standalone-copy h2 {
  max-width: 12ch;
}

.standalone-copy p:not(.kicker) {
  width: min(42rem, 100%);
  color: #d6e2f3;
  font-size: clamp(1rem, 1.6vw, 1.24rem);
  line-height: 1.6;
}

.standalone-copy a {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  margin-top: 0.6rem;
  padding: 0 1rem;
  border: 1px solid rgba(123, 223, 242, 0.35);
  border-radius: 999px;
  background: rgba(4, 8, 15, 0.56);
  color: #c9f8ff;
  font-size: 0.86rem;
  font-weight: 800;
}

.cv-section {
  min-height: 62vh;
}

.subpage-main {
  z-index: 1;
  pointer-events: auto;
}

.subpage-hero {
  display: grid;
  grid-template-columns: minmax(18rem, 0.78fr) minmax(22rem, 1.22fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  min-height: 100vh;
  padding: 14vh clamp(1rem, 5vw, 4.5rem) 8vh;
}

.subpage-copy {
  width: min(42rem, 100%);
}

.subpage-copy h1 {
  max-width: 11ch;
  font-size: clamp(3rem, 6vw, 5.9rem);
}

.subpage-copy h2 {
  max-width: 12ch;
  font-size: clamp(2.3rem, 5vw, 4.7rem);
}

.subpage-copy p:not(.kicker) {
  color: #d6e2f3;
  font-size: clamp(1rem, 1.55vw, 1.24rem);
  line-height: 1.6;
}

.simulation-feature {
  margin: 0;
}

.simulation-inline {
  width: min(100%, 52rem);
  margin-top: 1.3rem;
}

.simulation-feature img {
  display: block;
  width: 100%;
  max-height: 76vh;
  border: 1px solid rgba(191, 218, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.42);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.42);
  object-fit: contain;
}

.subpage-section {
  padding: 10vh clamp(1rem, 5vw, 4.5rem) 16vh;
}

@media (max-width: 780px) {
  .site-header {
    align-items: flex-start;
    padding-top: 0.75rem;
  }

  .top-nav {
    display: none;
  }

  .hero {
    align-items: center;
    padding: 15vh 1rem 38vh;
  }

  h1 {
    font-size: clamp(3.5rem, 18vw, 5.8rem);
  }

  .hero-copy {
    display: block;
    width: min(29rem, 92vw);
    margin-left: 0;
    transform: none;
  }

  .hero-copy .eyebrow {
    margin-bottom: 0.85rem;
  }

  .story-panel {
    width: min(100%, 31rem);
    margin: 0;
    padding: 0 1rem 34vh;
    background: linear-gradient(90deg, rgba(3, 5, 10, 0.88), rgba(3, 5, 10, 0.56));
  }

  .story-card {
    min-height: 106vh;
    padding: 14vh 0 28vh;
  }

  .map-console {
    left: 0.65rem;
    right: auto;
    bottom: 0.65rem;
    width: min(14.25rem, calc(100vw - 1.3rem));
    padding: 0.58rem;
  }

  .subpage-hero {
    grid-template-columns: 1fr;
    padding: 14vh 1rem 8vh;
  }

  .subpage-section {
    padding: 8vh 1rem 14vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
