@font-face { font-family: 'VT323'; src: url('/fonts/vt323.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/instrument-sans.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('/fonts/plex-mono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('/fonts/plex-mono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --deep: #01060b;
  --mid: #062236;
  --ink: #dcf2f5;
  --ink-2: #9dbcc4;
  --ink-3: #64848d;
  --line-2: rgba(159, 243, 255, .28);
  --cyan: #9ff3ff;
  --amber: #ffc163;
  --red: #ff8a7a;
  --pixel: 'VT323', ui-monospace, monospace;
  --mono: 'Plex Mono', ui-monospace, Consolas, monospace;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  display: flex; flex-direction: column;
  background: radial-gradient(120% 80% at 50% 0%, #0a3247 0%, var(--mid) 35%, var(--deep) 80%) var(--deep);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--amber); color: #1a0e00; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.gate {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 16px; text-align: center;
}
.sonar { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.sonar span {
  position: absolute; left: -45vmin; top: -45vmin; width: 90vmin; height: 90vmin;
  border: 1px solid rgba(159, 243, 255, .16); border-radius: 50%;
  opacity: 0; transform: scale(.15);
  animation: ping 6s cubic-bezier(.16, 1, .3, 1) infinite;
}
.sonar span:nth-child(2) { animation-delay: 2s; }
.sonar span:nth-child(3) { animation-delay: 4s; }
@keyframes ping { 0% { opacity: .9; transform: scale(.15); } 100% { opacity: 0; transform: scale(1); } }

.emblem { position: relative; width: 96px; height: 96px; image-rendering: pixelated; filter: drop-shadow(0 0 24px rgba(80, 220, 255, .35)); }
.eyebrow {
  position: relative; margin: 26px 0 6px;
  font: 500 12px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--amber);
  display: inline-flex; align-items: center; gap: 10px;
}
.dot { width: 7px; height: 7px; background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
h1 {
  position: relative; margin: 0;
  font: clamp(48px, 9vw, 84px)/1 var(--pixel); letter-spacing: .12em; text-transform: uppercase; color: var(--cyan);
  text-shadow: 3px 3px 0 #04151d, 0 0 28px rgba(80, 220, 255, .35);
}
.lede { position: relative; max-width: 34ch; margin: 14px 0 30px; color: var(--ink-2); }

.code { position: relative; display: flex; width: min(420px, 100%); border: 1px solid var(--line-2); background: rgba(4, 22, 33, .78); border-radius: 6px; overflow: hidden; transition: border-color .3s, box-shadow .3s; }
.code:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(159, 243, 255, .08), 0 0 30px rgba(80, 220, 255, .12); }
.code.is-err { border-color: var(--red); animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.code input {
  flex: 1; min-width: 0; padding: 14px 16px; border: 0; background: transparent; color: var(--ink);
  font: 28px/1 var(--pixel); letter-spacing: .14em; text-transform: uppercase;
}
.code input::placeholder { color: var(--ink-3); opacity: .6; }
.code input:focus { outline: none; }
.code button {
  padding: 0 22px; border: 0; cursor: pointer;
  background: var(--amber); color: #1b1100;
  font: 500 13px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  transition: background-color .2s;
}
.code button:hover { background: #ffd28a; }
.code button:disabled { cursor: wait; opacity: .7; }
.msg { position: relative; min-height: 1.6em; margin: 14px 0 0; font: 13px/1.6 var(--mono); color: var(--ink-3); }
.msg.is-err { color: var(--red); }

.foot { padding: 18px 16px 24px; text-align: center; font: 12px/1 var(--mono); letter-spacing: .12em; color: var(--ink-3); }

@media (max-width: 420px) {
  .code input { padding: 14px 12px; font-size: 23px; letter-spacing: .06em; }
  .code button { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .sonar, .dot { animation: none; }
  .sonar span { display: none; }
  .code.is-err { animation: none; }
}
