:root {
  color-scheme: dark;
  --bg: #070806;
  --panel: rgba(18, 20, 16, 0.82);
  --panel-strong: rgba(29, 31, 24, 0.94);
  --line: rgba(239, 191, 106, 0.32);
  --text: #f1dfbd;
  --muted: #a99b7f;
  --green: #b8d5e8;
  --amber: #efbf6a;
  --blue: #8dc8f4;
  --red: #f47f63;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 70% 20%, rgba(83, 117, 110, 0.17), transparent 36rem),
    radial-gradient(circle at 18% 65%, rgba(239, 191, 106, 0.1), transparent 32rem),
    linear-gradient(180deg, #050606 0%, #0c0d09 48%, #050604 100%);
  overflow-x: hidden;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

.shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.brand {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  background: rgba(184, 213, 232, 0.07);
  text-decoration: none;
  color: var(--green);
  letter-spacing: 0;
  font-weight: 800;
}

.nav-links,
.site-footer {
  font-size: 12px;
  letter-spacing: 0.08em;
}

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

.nav-links a,
.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.nav-links a:hover,
.site-footer a:hover {
  color: var(--green);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
  gap: 24px;
  align-items: end;
  padding: 52px 0 26px;
}

.kicker,
.label {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 12px;
  letter-spacing: 0.12em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  max-width: 760px;
  font-size: clamp(42px, 8vw, 96px);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  color: var(--amber);
  font-size: 22px;
  letter-spacing: 0;
}

.lead {
  display: grid;
  gap: 8px;
  max-width: 720px;
  color: #d9c8a6;
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.75;
}

.status-rack,
.panel,
.notes article {
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(184, 213, 232, 0.035), transparent 42%),
    var(--panel);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.28);
}

.status-rack {
  padding: 18px;
}

.status-rack p {
  margin: 0;
  color: var(--green);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.8;
}

.observatory {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: stretch;
}

.viewport-wrap {
  position: relative;
  min-height: 680px;
  border: 1px solid rgba(239, 191, 106, 0.22);
  background: #020302;
  overflow: hidden;
}

#galaxyCanvas {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 680px;
  touch-action: none;
}

.nebula-overlay {
  position: absolute;
  inset: -16%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse at 18% 72%, rgba(234, 178, 78, 0.42) 0%, rgba(206, 146, 54, 0.22) 17%, rgba(95, 54, 22, 0.04) 35%, transparent 56%),
    radial-gradient(ellipse at 82% 32%, rgba(84, 184, 188, 0.34) 0%, rgba(64, 129, 151, 0.2) 19%, rgba(28, 59, 72, 0.04) 42%, transparent 64%),
    radial-gradient(ellipse at 48% 54%, rgba(232, 216, 150, 0.28) 0%, rgba(140, 160, 122, 0.15) 24%, transparent 58%),
    radial-gradient(ellipse at 70% 78%, rgba(161, 78, 38, 0.24) 0%, rgba(82, 39, 25, 0.12) 26%, transparent 58%);
  background-size: 120% 120%, 116% 118%, 132% 120%, 124% 130%;
  filter: blur(18px) saturate(1.18);
  transform: translate3d(0, 0, 0) scale(1.05);
  transition: opacity 900ms ease;
  mix-blend-mode: screen;
}

.viewport-wrap.is-nebula-cruise .nebula-overlay {
  opacity: 0.78;
  animation: nebulaDrift 18s linear infinite;
}

.viewport-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 44%, rgba(0, 0, 0, 0.18) 100%),
    linear-gradient(180deg, transparent 0%, rgba(239, 191, 106, 0.025) 50%, transparent 100%);
}

.viewport-hud {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 10px;
  width: min(220px, calc(100% - 28px));
}

@keyframes nebulaDrift {
  0% {
    background-position: 0% 45%, 70% 20%, 30% 60%, 90% 80%;
    transform: translate3d(-1.5%, 1.5%, 0) scale(1.08);
  }
  50% {
    background-position: 55% 28%, 28% 62%, 65% 42%, 45% 22%;
    transform: translate3d(2%, -1%, 0) scale(1.15);
  }
  100% {
    background-position: 110% 10%, -10% 92%, 100% 24%, 0% -18%;
    transform: translate3d(-1.5%, 1.5%, 0) scale(1.08);
  }
}

#galaxyMap {
  width: 100%;
  height: auto;
  border: 1px solid rgba(239, 191, 106, 0.45);
  background: rgba(1, 3, 4, 0.78);
  cursor: crosshair;
}

.warp-hud {
  padding: 9px 10px;
  border: 1px solid rgba(239, 191, 106, 0.24);
  background: rgba(7, 8, 8, 0.76);
  color: var(--green);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px;
}

.panel-section {
  display: grid;
  gap: 10px;
}

.button-grid,
.planet-grid,
.button-row {
  display: grid;
  gap: 8px;
}

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

.planet-grid {
  grid-template-columns: repeat(4, 1fr);
}

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

button {
  min-height: 54px;
  border: 1px solid rgba(239, 191, 106, 0.38);
  background: rgba(239, 191, 106, 0.08);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  padding: 10px 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.planet-grid button {
  min-height: 48px;
  padding: 8px 9px;
  font-size: 12px;
}

button span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

button:hover,
button:focus-visible {
  border-color: rgba(239, 191, 106, 0.72);
  background: rgba(239, 191, 106, 0.12);
  outline: none;
}

.readout {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(239, 191, 106, 0.2);
  background: rgba(5, 5, 4, 0.54);
}

.readout p {
  display: grid;
  gap: 4px;
  margin: 0;
}

.readout b {
  color: var(--green);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.readout span {
  color: #e6d6b7;
  font-size: 14px;
  line-height: 1.45;
}

.notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 18px 0 30px;
}

.notes article {
  padding: 20px;
}

.notes p:last-child {
  display: grid;
  gap: 7px;
  margin-bottom: 0;
  color: #d8c8a8;
  line-height: 1.75;
}

.site-footer {
  border-top: 1px solid rgba(239, 191, 106, 0.22);
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero,
  .observatory,
  .notes {
    grid-template-columns: 1fr;
  }

  .viewport-wrap,
  #galaxyCanvas {
    min-height: 560px;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1220px);
  }

  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    padding-top: 32px;
  }

  h1 {
    font-size: clamp(38px, 13vw, 64px);
  }

  .viewport-wrap,
  #galaxyCanvas {
    min-height: 520px;
  }

  .viewport-hud {
    position: static;
    width: 100%;
    padding: 10px;
    background: rgba(1, 3, 4, 0.9);
  }

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

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