
@font-face {
  font-family: "Archivo"; 
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: block;
  src: url("/static/fonts/archivo.woff2") format("woff2");
}

:root {
  --sky-top: #070f1d;
  --sky-low: #14263d;
  --sea: #050b16;
  --light: #fff3cf;
  --ink: #b9c6d6;
  --ink-soft: #6f8096;
  --pad: clamp(14px, 2.6vw, 32px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  overflow: hidden;
  background: var(--sea);
  color: var(--ink);
  font: 500 15px/1.45 "Archivo", system-ui, sans-serif;
  font-stretch: 90%;
  -webkit-font-smoothing: antialiased;
}
h1, p, ol { margin: 0; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--light); outline-offset: 3px; }

.lamp { position: relative; min-height: 100svh; }
.top {
  position: absolute;
  z-index: 3;
  left: var(--pad);
  right: var(--pad);
  top: var(--pad);
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.back { color: inherit; text-decoration: none; }
.back:hover { color: var(--ink); }



.scene { position: absolute; inset: 0; overflow: hidden; }
.stars { position: absolute; inset: 0 0 44% 0; background: linear-gradient(var(--sky-top), var(--sky-low)); }
.stars i { position: absolute; width: 1.5px; height: 1.5px; border-radius: 50%; background: #dbe6ff; }

.horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: 56%;
  height: 0;
}
.ship {
  position: absolute;
  left: 58%;
  bottom: -2px;
  width: clamp(140px, 18vw, 240px);
  fill: #02060d;
}

.their-lamp {
  position: absolute;
  left: calc(58% + clamp(140px, 18vw, 240px) * 0.48);
  bottom: calc(clamp(140px, 18vw, 240px) * 0.155);
  width: 7px;
  height: 7px;
  translate: -50% 50%;
  border-radius: 50%;
  background: #3a3426;
  transition: background 30ms, box-shadow 30ms;
}
.their-lamp.on {
  background: var(--light);
  box-shadow: 0 0 6px 2px var(--light), 0 0 26px 10px rgb(255 238 190 / 0.55), 0 0 90px 30px rgb(255 228 160 / 0.18);
}

.glint {
  position: absolute;
  left: calc(58% + clamp(140px, 18vw, 240px) * 0.48);
  top: 6px;
  width: 26px;
  height: 34vh;
  translate: -50% 0;
  background: repeating-linear-gradient(transparent 0 7px, rgb(255 238 190 / 0.55) 7px 9px);
  -webkit-mask-image: linear-gradient(#000, transparent);
  mask-image: linear-gradient(#000, transparent);
  opacity: 0;
  transition: opacity 30ms;
}
.glint.on { opacity: 0.75; }

.sea {
  position: absolute;
  inset: 56% 0 0 0;
  background:
    repeating-linear-gradient(rgb(120 150 190 / 0.05) 0 1px, transparent 1px 9px),
    linear-gradient(#0c1a2c, var(--sea) 60%);
  background-size: 100% 9px, 100% 100%;
  animation: swell 9s linear infinite;
}
@keyframes swell { to { background-position: 0 9px, 0 0; } }


.beam {
  position: absolute;
  left: 50%;
  bottom: 9rem;
  width: 62vw;
  height: 54vh;
  translate: -18% 0;
  background: linear-gradient(to top, rgb(255 243 207 / 0.35), rgb(255 243 207 / 0));
  clip-path: polygon(30% 100%, 36% 100%, 52% 0, 47% 0);
  opacity: 0;
  transition: opacity 40ms;
}
.keying .beam { opacity: 1; }



.console {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: calc(var(--pad) * 0.8);
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  padding: 0 var(--pad);
}
.keyed {
  min-height: 2.2rem;
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--light);
  text-shadow: 0 0 14px rgb(255 238 190 / 0.35);
}
.keyed .pending { color: var(--ink-soft); letter-spacing: 0.12em; margin-left: 0.4em; }


.aldis {
  position: relative;
  width: 6.2rem;
  aspect-ratio: 1;
  padding: 0;
  border: 3px solid #4a5566;
  border-radius: 50%;
  background: #121a26;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 0 0 6px #0b111b, 0 10px 30px -10px #000;
}
.louvres {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: repeating-linear-gradient(#2a3546 0 7px, #0e141e 7px 10px);
  transition: background 40ms;
}
.keying .louvres {
  background: repeating-linear-gradient(var(--light) 0 9px, #b9a77a 9px 10px);
  box-shadow: 0 0 40px 10px rgb(255 243 207 / 0.6);
}
.keying .aldis { border-color: var(--light); }

.controls { display: flex; gap: 1.6rem; }
.text-btn {
  padding: 0.35rem 0.2rem;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.text-btn:hover { color: var(--ink); border-bottom-color: currentColor; }
.text-btn.send { color: var(--light); }
.is-solved .controls, .is-solved .aldis { opacity: 0.35; pointer-events: none; }

.status { min-height: 1.45em; color: var(--ink); letter-spacing: 0.04em; }
.verdict { list-style: none; padding: 0; text-align: center; letter-spacing: 0.06em; }
.verdict li { opacity: 0; animation: line-in 0.8s ease forwards; animation-delay: calc(var(--i) * 0.9s + 0.2s); }
.verdict li:first-child { color: var(--light); font-weight: 700; }
@keyframes line-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .sea { animation: none; }
  .verdict li { animation-duration: 0.01s; }
}
