@font-face {
  font-family: "Dela Gothic One";
  src: url("../fonts/dela-gothic-one-title.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  background: #070d19;
  color: #fff;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  cursor: url("../images/retro-cursor.svg") 2 2, auto;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

body { margin: 0; }

.observatory {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  padding: 2rem 1rem;
}

.observatory__scene {
  position: absolute;
  z-index: -2;
  top: 50%;
  left: 50%;
  width: max(100%, calc(100vh * 1672 / 941));
  width: max(100%, calc(100svh * 1672 / 941));
  aspect-ratio: 1672 / 941;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.observatory__background,
.observatory__effects {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.film-grain {
  position: absolute;
  z-index: 1;
  inset: -40px;
  pointer-events: none;
  background: url("../images/film-grain.svg") repeat;
  opacity: 0.075;
  animation: film-grain 800ms steps(1) infinite;
}

@keyframes film-grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-17px, 13px); }
  40% { transform: translate(11px, -19px); }
  60% { transform: translate(-23px, -7px); }
  80% { transform: translate(19px, 23px); }
}

.meteor {
  opacity: 0;
  animation: shooting-star 60s linear infinite;
}

.meteor--one { animation-delay: 5s; }
.meteor--two { animation-delay: 35s; }

@keyframes shooting-star {
  0% { opacity: 0; transform: translate(0, 0); }
  0.5% { opacity: 0.8; }
  2.8%, 100% { opacity: 0; transform: translate(220px, 82px); }
}

.console-light {
  opacity: 0.04;
  animation: console-pulse 3.6s ease-in-out infinite;
}

.console-light--amber,
.console-light--secondary {
  fill: #ffe3a6;
  filter: blur(1.5px) drop-shadow(0 0 5px #fff0c6) drop-shadow(0 0 14px #ffb347);
}

.console-light--cyan {
  fill: #b4f5ff;
  filter: blur(1.5px) drop-shadow(0 0 5px #dcfbff) drop-shadow(0 0 14px #49d5ff);
  animation-duration: 4.7s;
  animation-delay: -1.5s;
}

.console-light--secondary {
  animation-duration: 6.1s;
  animation-delay: -3s;
}

@keyframes console-pulse {
  0%, 10%, 44%, 100% { opacity: 0.04; }
  16%, 36% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .meteor { animation: none; }
  .console-light { animation: none; opacity: 0.2; }
  .film-grain { animation: none; }
}

.observatory::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgb(3 7 18 / 8%), rgb(3 7 18 / 4%) 55%, rgb(3 7 18 / 25%));
}

.observatory__identity {
  width: 100%;
  text-align: center;
  padding-bottom: 8vh;
}

h1 {
  margin: 0;
  color: #f3353e;
  font-family: "Dela Gothic One", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-size: clamp(2.5rem, 10.7vw, 10rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.045em;
  white-space: nowrap;
  text-shadow: 0 3px 0 #8d1826, 0 6px 24px rgb(0 0 0 / 20%);
}



::selection { background: #f3353e; color: #fff; }

.app-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.85rem; margin-top: 1.8rem; }
.app-link {
  display: flex;
  align-items: center;
  width: 272px;
  gap: 0.8rem;
  padding: 0.65rem 0.9rem 0.65rem 0.65rem;
  border: 1px solid rgb(218 178 115 / 38%);
  background: rgb(8 17 28 / 88%);
  color: #efe2c9;
  text-decoration: none;
  text-align: left;
  font-family: "Courier New", monospace;
  cursor: inherit;
  box-shadow: inset 0 0 0 3px rgb(218 178 115 / 4%), 0 4px 16px rgb(0 0 0 / 20%);
  transition: border-color 160ms, background-color 160ms;
}
.app-link__icon { display: grid; place-items: center; width: 56px; height: 56px; flex: 0 0 56px; }
.app-link__icon img { display: block; }
.app-link__copy { display: grid; gap: 0.25rem; }
.app-link__copy strong { font-size: 0.9rem; letter-spacing: 0.035em; }
.app-link__copy > span { color: #b4aa96; font-size: 0.65rem; }
.app-link__arrow { color: #e0ad69; font-size: 1.15rem; margin-left: auto; }
.app-link:hover { border-color: #e0ad69; background: #17212c; }
.app-link:focus-visible { outline: 2px solid #f2ce94; outline-offset: 4px; }

.hyperspace { display: none; }

.destination-view { opacity: 0; transition: opacity 1.2s ease-in-out; }
.destination-view.is-current { opacity: 1; }

.is-warping .hyperspace {
  display: block;
  animation: jump-envelope 4.8s ease-in-out both;
}

.hyperspace line {
  stroke: #c3edff;
  stroke-width: 1.5;
  stroke-linecap: round;
  transform-origin: 836px 400px;
  animation: star-jump var(--ray-duration) linear var(--ray-delay) infinite;
}

@keyframes star-jump {
  0% { opacity: 0; transform: scale(0.15); }
  20% { opacity: 0.7; }
  85% { opacity: 0.7; }
  100% { opacity: 0; transform: scale(2.5); }
}

@keyframes jump-envelope {
  0%, 100% { opacity: 0; }
  18%, 75% { opacity: 1; }
}

.secret-console {
  position: absolute;
  z-index: 2;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(27rem, calc(100% - 2rem));
  padding: 1rem;
  border: 1px solid #8da17d;
  background: #101a15;
  color: #c2dba8;
  box-shadow: inset 0 0 0 3px #1f3025, inset 0 0 0 4px #475b41, 0 8px 35px rgb(0 0 0 / 50%);
  text-align: left;
  font-family: "Courier New", monospace;
}

.secret-console[hidden] { display: none; }
.secret-console::after { content: ""; position: absolute; inset: 4px; pointer-events: none; background: repeating-linear-gradient(transparent 0 2px, rgb(0 0 0 / 14%) 2px 3px); }
.secret-console__header { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0.5rem; color: #101a15; background: #aabd8e; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.09em; }
.secret-console__readout { display: grid; grid-template-columns: 88px 1fr; gap: 1rem; padding: 1rem 0.25rem; }
.nav-scope { width: 88px; height: 100%; color: #a4c891; align-self: center; }
.secret-console__label { margin: 0 0 0.35rem; color: #91a783; font-size: 0.55rem; letter-spacing: 0.07em; }
.secret-console h2 { margin: 0; color: #d6edb8; font-size: clamp(1rem, 4vw, 1.4rem); letter-spacing: 0.06em; text-shadow: 0 0 8px rgb(161 211 116 / 20%); }
.secret-console__mode { margin: 0.35rem 0 0.8rem; color: #ddbc77; font-size: 0.6rem; letter-spacing: 0.06em; }
.secret-console__mode::before { content: "■"; margin-right: 0.45rem; font-size: 0.55rem; }
.secret-console__destination-label { display: flex; justify-content: space-between; margin: 0 0 0.2rem; color: #91a783; font-size: 0.55rem; }
.secret-console__destination { margin: 0; font-size: 0.85rem; color: #d6edb8; text-transform: uppercase; }
.flight-route { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 1rem; margin: 0 0 0.85rem; padding: 0.65rem 0.25rem; border-block: 1px solid #43523b; list-style: none; font-size: 0.6rem; color: #899a7d; }
.flight-route li { padding: 0.2rem 0.25rem; }
.flight-route li > span { margin-right: 0.45rem; }
.flight-route [aria-current="true"] { background: #aabd8e; color: #101a15; font-weight: bold; }
.secret-console__controls { display: grid; grid-template-columns: 1.25fr 1fr; gap: 0.6rem; }
.secret-console button {
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  border: 1px solid #89976d;
  background: #263629;
  color: #d6edb8;
  font: inherit;
  font-size: 0.7rem;
  font-weight: bold;
  cursor: inherit;
}
.secret-console #jump-again { background: #aabd8e; color: #101a15; }
.secret-console button:hover:not(:disabled) { border-color: #d6edb8; filter: brightness(1.2); }
.secret-console button:focus-visible { outline: 2px solid #ddbc77; outline-offset: 3px; }
.secret-console button:disabled { opacity: 0.55; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .is-warping .hyperspace { display: none; }
  .hyperspace line { animation: none; }
  .destination-view { transition: none; }
}

@media (max-height: 760px) {
  .secret-console { position: relative; left: auto; bottom: auto; transform: none; margin: 1.5rem auto 0; }
  .observatory:has(.secret-console:not([hidden])) { align-content: center; }
  .observatory:has(.secret-console:not([hidden])) .observatory__identity { padding-bottom: 0; }
}

@media (max-width: 600px) {
  h1 { font-size: clamp(2.5rem, 16vw, 6rem); }
  .observatory__scene { left: 58%; transform: translate(-58%, -50%); }
  .observatory__identity { padding-bottom: 12vh; }
  .app-links { gap: 0.6rem; margin-top: 1.4rem; }
  .app-link { max-width: 100%; }
  .secret-console { position: relative; left: auto; bottom: auto; transform: none; margin: 1.5rem auto 0; }
  .observatory:has(.secret-console:not([hidden])) { align-content: center; }
  .observatory:has(.secret-console:not([hidden])) .observatory__identity { padding-bottom: 0; }
}
