:root {
  --void: #060b1e;
  --void-deep: #02050f;
  --frost: #edf7f5;
  --ice: #a9bfca;
  --iron: #526a7a;
  --copper: #c65b48;
  --copper-hot: #f08a67;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--void-deep); }
body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  color: var(--frost);
  background:
    linear-gradient(rgba(6, 11, 30, .08), rgba(2, 5, 15, .54)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(169, 191, 202, .018) 3px 4px),
    var(--void);
  font-family: "Arial Narrow", "Roboto Condensed", "Segoe UI", sans-serif;
  -webkit-font-smoothing: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 8px;
  border: 1px solid rgba(169, 191, 202, .2);
  pointer-events: none;
}

::selection { color: var(--void); background: var(--copper-hot); }

.arrival {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  align-items: center;
  width: 100%;
  min-height: 100svh;
  padding: max(22px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
}

.title-lockup { z-index: 2; text-align: center; }
.title-lockup h1 {
  margin: 0;
  color: var(--frost);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(3.25rem, 17vw, 7.5rem);
  font-weight: 900;
  line-height: .78;
  letter-spacing: .07em;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 #263a4c, -1px -1px 0 #fff;
}
.title-lockup p {
  margin: 12px 0 0;
  color: var(--ice);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .28em;
  text-transform: uppercase;
}

.planet-stage {
  position: relative;
  place-self: center;
  width: min(92vw, 64svh, 710px);
  aspect-ratio: 1008 / 1048;
  margin: -4px 0 -10px;
}
.planet {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .44));
  animation: planet-arrive 1200ms var(--ease-out) both;
}
.orbit {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: 114%;
  aspect-ratio: 1;
  border: 1px solid rgba(169, 191, 202, .22);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-14deg) scaleY(.32);
}
.orbit-two { width: 129%; opacity: .45; transform: translate(-50%, -50%) rotate(18deg) scaleY(.24); }
.signal {
  position: absolute;
  z-index: 2;
  right: 5%;
  bottom: 13%;
  padding: 5px 8px;
  border: 1px solid rgba(240, 138, 103, .68);
  color: var(--copper-hot);
  background: rgba(6, 11, 30, .88);
  font: 800 .56rem/1 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.entry { z-index: 2; width: min(100%, 760px); place-self: center; text-align: center; }
.entry-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.enter {
  display: grid;
  min-height: 66px;
  place-content: center;
  border: 2px solid var(--copper-hot);
  color: var(--frost);
  background: #8d392f;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .36), inset 0 0 0 2px rgba(6, 11, 30, .42);
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 140ms var(--ease-out), background-color 140ms ease, box-shadow 140ms ease;
}
.enter-pad {
  border-color: rgba(169, 191, 202, .72);
  color: var(--frost);
  background: rgba(20, 32, 54, .94);
}
.enter-pad small { color: var(--ice); }
.enter span { font-size: 1.08rem; font-weight: 900; letter-spacing: .13em; }
.enter small { margin-top: 4px; color: #ffd5c5; font-size: .58rem; font-weight: 800; letter-spacing: .16em; }
.enter:active { transform: translateY(2px) scale(.99); box-shadow: 0 3px 9px rgba(0, 0, 0, .4), inset 0 0 0 2px rgba(6, 11, 30, .5); }
.enter:focus-visible, .shortcuts a:focus-visible, .shortcuts button:focus-visible, .sound:focus-visible {
  outline: 2px solid var(--frost);
  outline-offset: 4px;
}
.safety { margin: 8px 0 0; color: var(--ice); font-size: .58rem; letter-spacing: .08em; text-transform: uppercase; }

.shortcuts {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 46px;
  margin-top: 4px;
  color: var(--iron);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.shortcuts a, .shortcuts button {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  color: var(--ice);
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-decoration: none;
  text-transform: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.shortcuts [aria-disabled="true"] { opacity: .48; cursor: not-allowed; }

.sound {
  position: fixed;
  z-index: 4;
  top: max(18px, env(safe-area-inset-top));
  right: 18px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(169, 191, 202, .35);
  color: var(--ice);
  background: rgba(6, 11, 30, .8);
  cursor: pointer;
}
.sound svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; stroke-linejoin: miter; }
.sound-off, .sound[aria-pressed="true"] .sound-on { display: none; }
.sound[aria-pressed="true"] .sound-off { display: block; }
.no-script { position: fixed; z-index: 5; inset: auto 16px 16px; margin: 0; padding: 12px; color: var(--frost); background: var(--void-deep); font-size: .8rem; }
.no-script a { color: var(--copper-hot); }

body.is-entering .planet { animation: none; transform: scale(1.08); opacity: 0; transition: transform 700ms var(--ease-out), opacity 700ms var(--ease-out); }
body.is-entering .title-lockup, body.is-entering .entry, body.is-entering .shortcuts { opacity: 0; transition: opacity 260ms ease; }

@keyframes planet-arrive {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}

@media (hover: hover) and (pointer: fine) {
  .enter:hover { background: #a94737; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .42), inset 0 0 0 2px rgba(6, 11, 30, .35); }
  .enter-pad:hover { background: #263a4c; }
  .shortcuts a:hover, .shortcuts button:hover, .sound:hover { color: var(--frost); }
}

@media (min-width: 760px) {
  .arrival { padding-top: 34px; }
  .title-lockup p { font-size: .76rem; }
  .planet-stage { margin-top: -18px; margin-bottom: -22px; }
  .signal { font-size: .62rem; }
}

@media (max-width: 600px) {
  .entry-actions { grid-template-columns: 1fr; gap: 9px; }
  .sound {
    top: max(112px, calc(env(safe-area-inset-top) + 88px));
    right: auto;
    left: 18px;
    width: 40px;
    height: 40px;
  }
}

@media (max-height: 700px) {
  .arrival { padding-top: 18px; padding-bottom: 8px; }
  .title-lockup h1 { font-size: clamp(2.7rem, 13vw, 5rem); }
  .title-lockup p { margin-top: 8px; }
  .planet-stage { width: min(76vw, 50svh, 500px); }
  .enter { min-height: 58px; }
  .shortcuts { min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .planet { animation: fade-in 180ms ease both; }
  body.is-entering .planet { transform: none; transition: opacity 180ms ease; }
  body.is-entering .title-lockup, body.is-entering .entry, body.is-entering .shortcuts { transition-duration: 120ms; }
  .enter { transition: background-color 140ms ease, box-shadow 140ms ease; }
  .enter:active { transform: none; }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
}
