/* Fancy 404. Change the colors here (light, then dark). */
:root {
  --bg: #eef0fb;
  --bg-2: #f9f3ff;
  --text: #1d1b38;
  --muted: #5b5878;
  --card: #ffffff;
  --line: #d9dbf0;
  --accent: #5a43e0;
  --accent-text: #ffffff;
  --moon: #ffe9a8;
  --moon-glow: rgb(255 214 102 / 0.35);
  --crater: #f5d27a;
  --face: #4a3a1a;
  --blush: #ffab8a;
  --star: #b9b5e6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e22;
    --bg-2: #1a1233;
    --text: #f1efff;
    --muted: #aeaacd;
    --card: #1c1a36;
    --line: #2f2c52;
    --accent: #a594ff;
    --accent-text: #120f2a;
    --moon-glow: rgb(255 214 102 / 0.18);
    --star: #ffffff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
  font: 17px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(2px 2px at 10% 20%, var(--star) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 25% 75%, var(--star) 50%, transparent 51%),
    radial-gradient(2px 2px at 40% 12%, var(--star) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 62% 85%, var(--star) 50%, transparent 51%),
    radial-gradient(2px 2px at 78% 28%, var(--star) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90% 65%, var(--star) 50%, transparent 51%),
    radial-gradient(2px 2px at 52% 45%, var(--star) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 90%, var(--star) 50%, transparent 51%);
  opacity: 0.7;
  animation: twinkle 4s ease-in-out infinite alternate;
}

.wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(640px, 100% - 32px);
  margin: 0 auto;
  padding: 48px 0 24px;
  text-align: center;
}

.code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 2vw, 16px);
  margin: 0 0 12px;
  font-size: clamp(6rem, 24vw, 11rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}
.moon { width: 0.95em; height: 0.95em; overflow: visible; animation: bob 5s ease-in-out infinite; }
.moon-glow { fill: var(--moon-glow); }
.moon-face { fill: var(--moon); }
.crater { fill: var(--crater); }
.eye, .mouth { stroke: var(--face); }
.blush { fill: var(--blush); opacity: 0.6; }
.zzz text { fill: var(--muted); font: 700 22px ui-sans-serif, system-ui, sans-serif; animation: zzz 3s ease-in-out infinite; }
.zzz text:nth-child(2) { font-size: 16px; animation-delay: 0.8s; }
.orbit { transform-origin: 100px 100px; animation: orbit 9s linear infinite; }
.satellite { fill: var(--accent); }

h2 { margin: 0 0 10px; font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -0.02em; }
.lead { margin: 0 0 28px; color: var(--muted); }

.search {
  position: relative;
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 460px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 10px 30px rgb(40 30 120 / 0.08);
}
.search svg { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.search input {
  flex: 1; min-width: 0; height: 46px;
  padding: 0 12px 0 40px;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
}
.search input::placeholder { color: var(--muted); }
.search input:focus-visible { outline-offset: 0; }
.search button {
  height: 46px; padding: 0 20px;
  border: 0; border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit; font-weight: 700;
  cursor: pointer;
}
.note { min-height: 1.6em; margin: 10px 0 18px; color: var(--muted); font-size: 0.95rem; }

.home { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font-weight: 700; text-decoration: none; }
.home:hover { background: var(--card); }
.home svg { width: 20px; height: 20px; }

.foot { padding: 24px 16px 32px; text-align: center; color: var(--muted); font-size: 0.85rem; }

@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes zzz { 0%, 100% { opacity: 0; transform: translateY(6px); } 50% { opacity: 1; transform: translateY(-4px); } }
@keyframes twinkle { to { opacity: 0.35; } }

@media (prefers-reduced-motion: reduce) {
  .moon, .orbit, .zzz text, .stars { animation: none; }
}
