:root {
  /* Palette inspired by your neon collage pieces */
  --void: #060712;
  --hull: #0c1024;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-2: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.72);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.72);

  --accent: #45d6ff; /* cyan */
  --accent2: #ff4fb8; /* magenta */
  --accent3: #b7ff00; /* neon lime */
  --warm: #ff6a00; /* orange */

  --radius: 18px;
  --stroke: 2px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);

  --max: 1100px;
  --pad: clamp(16px, 3vw, 34px);
  --hudH: 88px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(
      1200px 700px at 70% 10%,
      rgba(69, 214, 255, 0.18),
      transparent 60%
    ),
    radial-gradient(
      900px 700px at 20% 40%,
      rgba(255, 79, 184, 0.12),
      transparent 60%
    ),
    linear-gradient(180deg, var(--void), #070a18 55%, var(--void));
  font:
    16px/1.45 ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Inter,
    Arial,
    sans-serif;
  overflow-x: hidden;
}

/* Mode shifts by section (JS flips body[data-active]) */
body[data-active="mission"] {
  --accent: #45d6ff;
}
body[data-active="crew"] {
  --accent: #ff6a00;
}
body[data-active="logbook"] {
  --accent: #b7ff00;
}
body[data-active="archive"] {
  --accent: #ff4fb8;
}

/* Overlays */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.05) 0px,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 2px,
    transparent 6px
  );
  mix-blend-mode: soft-light;
}

/* HUD */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--hudH);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 var(--pad);
  z-index: 50;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.25));
  border-bottom: var(--stroke) solid rgba(255, 255, 255, 0.12);
}
.hud__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 340px;
}
.mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: var(--stroke) solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.04);
  object-fit: contain;
  background: rgba(0, 0, 0, 0.18);
  padding: 6px;
}
.brand__title {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 14px;
}
.brand__subtitle {
  font-size: 12px;
  color: var(--muted);
}

.hud__nav {
  display: flex;
  gap: 10px;
}

.iconlink {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: var(--stroke) solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-decoration: none;
}
.iconlink svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.iconlink:hover {
  border-color: rgba(255, 255, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(69, 214, 255, 0.1);
}
.navlink {
  text-decoration: none;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 999px;
  border: var(--stroke) solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
}
.navlink:hover {
  border-color: rgba(255, 255, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(69, 214, 255, 0.1);
}

.hud__telemetry {
  margin-left: auto;
  display: flex;
  gap: 10px;
}
.chip {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 12px;
  border-radius: 999px;
  border: var(--stroke) solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.22);
}
.chip .k {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.chip .v {
  font-weight: 800;
  color: color-mix(in oklab, var(--accent) 65%, white);
}

/* Bays / sections */
main {
  padding-top: calc(var(--hudH) + 16px);
}
.bay {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(34px, 5vw, 72px) var(--pad);
}
.bay__content {
  width: min(var(--max), 100%);
  position: relative;
  z-index: 2;
}

.panel {
  border-radius: var(--radius);
  border: var(--stroke) solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, var(--panel), rgba(0, 0, 0, 0.18));
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 32px);
}
.panel__title {
  margin: 0 0 10px;
  font-size: clamp(26px, 3.2vw, 42px);
  letter-spacing: 0.02em;
}
.panel__lead {
  margin: 0 0 14px;
  font-size: clamp(16px, 1.6vw, 19px);
  color: rgba(255, 255, 255, 0.86);
}
.panel p {
  color: rgba(255, 255, 255, 0.82);
}

.grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 860px) {
  .grid--2 {
    grid-template-columns: 1fr;
  }
}

.subpanel {
  border-radius: calc(var(--radius) - 6px);
  border: var(--stroke) solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  padding: 14px 16px;
}
.subpanel h3 {
  margin: 0 0 6px;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Stage layers (your PNG “props”) */
.bay__stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}
.layer {
  position: absolute;
  max-width: none;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
  transform: translate3d(0, 0, 0);
  opacity: 0.95;
}
.layer--back {
  width: min(900px, 78vw);
  left: -6vw;
  top: 14vh;
  opacity: 0.55;
}
.layer--mid {
  width: min(860px, 76vw);
  right: -8vw;
  top: 18vh;
  opacity: 0.7;
}
.layer--front {
  width: min(760px, 70vw);
  left: 6vw;
  bottom: -10vh;
  opacity: 0.92;
}

.float {
  animation: float 8s ease-in-out infinite;
}
.float-slow {
  animation: float 12s ease-in-out infinite;
}
.float-fast {
  animation: float 6.5s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(-0.2deg);
  }
  50% {
    transform: translateY(-16px) rotate(0.2deg);
  }
}

/* Cards */
.crew,
.archive {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 860px) {
  .crew,
  .archive {
    grid-template-columns: 1fr;
  }
}
.card {
  border-radius: calc(var(--radius) - 6px);
  border: var(--stroke) solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  padding: 14px 16px;
  position: relative;
}

/* Crew expandable bios */
.card--bio {
  padding: 0;
  overflow: hidden;
}
.card__summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  outline: none;
  user-select: none;
}
.card__summary::-webkit-details-marker {
  display: none;
}
.card--bio:not([open]) .card__summary {
  aspect-ratio: 1 / 1;
  display: grid;
  align-content: start;
}
.card--bio[open] {
  grid-column: 1 / -1;
}
.card__expand {
  padding: 0 16px 16px;
  border-top: var(--stroke) solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.14);
}
.bio {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
}
@media (max-width: 860px) {
  .bio {
    grid-template-columns: 1fr;
  }
}
.bio__photo {
  position: relative;
  border-radius: calc(var(--radius) - 10px);
  border: var(--stroke) dashed rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.03);
  min-height: 180px;
  overflow: hidden;
}
.bio__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bio__hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  background: radial-gradient(
    600px 260px at 30% 20%,
    rgba(69, 214, 255, 0.08),
    transparent 70%
  );
  pointer-events: none;
}
/* Hide the hint automatically once you set an image src */
.bio__photo img[src]:not([src=""]) + .bio__hint {
  display: none;
}
.card__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.72);
}
.callsign {
  color: color-mix(in oklab, var(--accent) 70%, white);
  font-weight: 800;
}
.card__title {
  margin: 10px 0 2px;
  font-size: 18px;
}
.card__meta {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.7);
}
.card__link {
  display: inline-block;
  margin-top: 10px;
  color: var(--text);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
  border: var(--stroke) solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.22);
}
.card__link:hover {
  border-color: rgba(255, 255, 255, 0.48);
}

/* Logbook */
.log {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}
.log__entry {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 14px;
  align-items: center;
  border-radius: calc(var(--radius) - 6px);
  border: var(--stroke) solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  padding: 14px 16px;
}
@media (max-width: 860px) {
  .log__entry {
    grid-template-columns: 1fr;
  }
}
.log__date {
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.78);
}
.log__action {
  text-decoration: none;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 999px;
  border: var(--stroke) solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.22);
}

/* CTA */
.cta {
  display: inline-block;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 999px;
  border: var(--stroke) solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(0, 0, 0, 0.18)
  );
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.04);
}
.cta--secondary {
  margin-top: 0;
}

/* Gauge */
.gauge {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  align-items: center;
}
.gauge__ring {
  width: 140px;
  aspect-ratio: 1/1;
  border-radius: 50%;
  border: var(--stroke) solid rgba(255, 255, 255, 0.22);
  background: conic-gradient(
    from 220deg,
    rgba(255, 255, 255, 0.1),
    color-mix(in oklab, var(--accent) 70%, white),
    rgba(255, 255, 255, 0.1)
  );
  box-shadow: inset 0 0 0 10px rgba(0, 0, 0, 0.35);
}
.gauge__note {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.filter {
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 999px;
  border: var(--stroke) solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}
.filter.is-active {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 6px rgba(69, 214, 255, 0.1);
}

/* Glitch (subtle; use on hover/focus if you prefer) */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
}
.glitch::before {
  color: var(--accent);
  transform: translateX(1px);
}
.glitch::after {
  color: var(--accent2);
  transform: translateX(-1px);
}

.navlink:hover .glitch::before,
.navlink:hover .glitch::after,
.glitch:hover::before,
.glitch:hover::after {
  opacity: 0.35;
  animation: glitch 180ms steps(2, end) 1;
}
@keyframes glitch {
  0% {
    clip-path: inset(0 0 80% 0);
  }
  50% {
    clip-path: inset(30% 0 30% 0);
  }
  100% {
    clip-path: inset(80% 0 0 0);
  }
}

/* Motion safety */
@media (prefers-reduced-motion: reduce) {
  .float,
  .float-slow,
  .float-fast {
    animation: none;
  }
}
