/* The landing page at "/". Error pages from the Worker (worker/errors.ts) share its look. */

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-italic-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-300-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #07080c;
  --fg: #efe9dd;
  --muted: rgba(239, 233, 221, 0.42);
  --faint: rgba(239, 233, 221, 0.25);
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
}

canvas#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.vignette {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, transparent 0%, rgba(7, 8, 12, 0.55) 70%, rgba(7, 8, 12, 0.95) 100%);
}

.grain {
  position: fixed; inset: -50%; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -2%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

main {
  position: fixed; inset: 0; display: grid; place-items: center; text-align: center;
  padding: 16px; pointer-events: none;
}

h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400; font-style: italic;
  font-size: clamp(64px, 15vw, 220px);
  letter-spacing: -0.03em; line-height: 0.9;
  text-shadow: 0 0 60px rgba(7, 8, 12, 0.9), 0 0 120px rgba(7, 8, 12, 0.8);
  opacity: 0; transform: translateY(-18px); filter: blur(10px);
  animation: arrive 2.4s cubic-bezier(.2, .7, .1, 1) 0.4s forwards;
}

.whisper {
  margin-top: 52px; font-size: 12px; font-weight: 300; letter-spacing: 0.32em;
  color: var(--muted);
  opacity: 0; animation: fade 2s ease 2.2s forwards;
}

footer {
  position: fixed; left: 0; right: 0; bottom: 24px; text-align: center;
  font-size: 11px; letter-spacing: 0.2em; color: var(--faint);
  opacity: 0; animation: fade 2s ease 3s forwards;
}

@keyframes arrive { to { opacity: 1; transform: none; filter: none; } }
@keyframes fade { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  h1, .whisper, footer { animation: none; opacity: 1; transform: none; filter: none; }
  .grain { animation: none; }
}
