@font-face {
  font-family: "Greeble";
  src: url("/fonts/GreebleCypher.ttf") format("truetype");
  font-display: block;
}

@font-face {
  font-family: "Raskahu";
  src: url("/fonts/RaskahuFormal-Regular.ttf") format("truetype");
  font-display: block;
}

:root {
  --bg: #060708;
  --fg: #eceff3;
  --muted: #8b929c;
  --accent: #ff6b1a;
  --glitch: #00e5ff;
  --line: rgba(236, 239, 243, 0.1);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mx: 0;
  --my: 0;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--fg); }

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

/* ---------- Background ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 115%, rgba(255, 107, 26, 0.18), transparent 60%),
    var(--bg);
}

.bg > * { position: absolute; }

.bg-grid {
  inset: -64px;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.4;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 15%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 15%, transparent 80%);
  animation: grid-pan 24s linear infinite;
}

@keyframes grid-pan { to { transform: translate3d(0, 64px, 0); } }

.bg-mark {
  inset: 0;
  transform: translate3d(calc(var(--mx) * -30px), calc(var(--my) * -30px), 0);
}

.bg-mark img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(120vmax, 2000px);
  height: auto;
  translate: -50% -50%;
  opacity: 0.03;
  animation: breathe 14s ease-in-out infinite;
}

@keyframes breathe { 50% { opacity: 0.055; scale: 1.03; } }

.bands {
  inset: 0;
  transform: translate3d(calc(var(--mx) * 18px), calc(var(--my) * 12px), 0);
}

.band {
  position: absolute;
  left: 0;
  top: var(--y);
  font-family: "Greeble";
  font-size: var(--s);
  line-height: 1;
  white-space: nowrap;
  color: var(--fg);
  opacity: var(--o);
}

.band.hot { color: var(--accent); }

.band-track {
  display: flex;
  width: max-content;
  animation: drift var(--d) linear infinite;
}

.band.rev .band-track { animation-direction: reverse; }

.band-track span { padding-right: 0.6em; }

@keyframes drift { to { transform: translate3d(-50%, 0, 0); } }

.bg-scan {
  left: 0;
  right: 0;
  top: -40vh;
  height: 40vh;
  background: linear-gradient(transparent, rgba(236, 239, 243, 0.04), transparent);
  animation: scan 9s linear infinite;
}

@keyframes scan { to { transform: translate3d(0, 140vh, 0); } }

.bg-lines {
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px);
}

.bg-noise {
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.07;
  animation: noise 0.8s steps(4) infinite;
}

@keyframes noise {
  25% { transform: translate3d(-3%, 2%, 0); }
  50% { transform: translate3d(2%, -3%, 0); }
  75% { transform: translate3d(-1%, -2%, 0); }
}

.bg-vignette {
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.8) 100%);
}

/* ---------- HUD frame ---------- */

.frame {
  position: fixed;
  inset: 16px;
  pointer-events: none;
  z-index: 1;
}

.frame i {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(236, 239, 243, 0.35);
}

.frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 30px 40px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.hud a { color: var(--muted); text-decoration: none; }
.hud a:hover { color: var(--fg); }

.hud-code {
  font-family: "Greeble";
  font-size: 14px;
  letter-spacing: 0;
  color: rgba(236, 239, 243, 0.35);
}

.status { display: inline-flex; align-items: center; gap: 8px; }

.status i {
  width: 6px;
  height: 6px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: blink 2.4s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0.25; } }

.hatnote {
  margin: 18px 0 0;
  padding: 0 28px;
  font-family: var(--mono);
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--muted);
  animation: rise 0.9s ease-out 2s both;
}

.hatnote a {
  color: var(--fg);
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.hatnote a:hover { color: var(--accent); }

/* ---------- Hero ---------- */

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 16px;
}

.brand {
  display: flex;
  align-items: flex-start;
  margin: 0;
  padding-left: clamp(10px, 1.4vw, 18px);
}

.logo {
  width: clamp(250px, 44vw, 560px);
  height: auto;
  animation:
    flicker-in 1.4s steps(1, end) both,
    glitch 9s steps(1, end) 2.5s infinite;
}

@keyframes flicker-in {
  0% { opacity: 0; }
  10% { opacity: 0.6; }
  14% { opacity: 0; }
  22% { opacity: 1; }
  26% { opacity: 0.2; }
  34%, 100% { opacity: 1; }
}

@keyframes glitch {
  0%, 93%, 100% { transform: none; filter: none; clip-path: none; }
  94% {
    transform: translate(-5px, 0);
    filter: drop-shadow(4px 0 var(--glitch)) drop-shadow(-4px 0 var(--accent));
    clip-path: inset(8% 0 58% 0);
  }
  95% { transform: translate(6px, 1px); clip-path: inset(62% 0 6% 0); }
  96% { transform: translate(-2px, 0); clip-path: inset(30% 0 34% 0); }
  97% {
    transform: none;
    filter: drop-shadow(-2px 0 var(--glitch)) drop-shadow(2px 0 var(--accent));
    clip-path: none;
  }
}

.tm {
  margin: 0.2em 0 0 0.35em;
  font-size: clamp(10px, 1.3vw, 16px);
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
}

.code {
  margin-top: 26px;
  font-family: "Greeble";
  font-size: clamp(14px, 1.6vw, 20px);
  line-height: 1;
  color: var(--accent);
  animation: wipe 1.1s cubic-bezier(0.6, 0, 0.2, 1) 0.9s both;
}

@keyframes wipe {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

.tagline {
  margin: 32px 0 40px;
  font-family: var(--mono);
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.tagline.split { letter-spacing: 0; }

.ch {
  display: inline-block;
  width: 0.9em;
  text-align: center;
}

.ch.rk {
  font-family: "Raskahu";
  text-transform: none;
  color: var(--accent);
}

.ch.gone { width: 0; }

.signup {
  width: min(440px, 100%);
  animation: rise 0.9s ease-out 1.6s both;
}

.signup-k {
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.signup-row {
  display: flex;
  background: rgba(6, 7, 8, 0.6);
  border: 1px solid rgba(236, 239, 243, 0.25);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: border-color 0.2s;
}

.signup-row:focus-within { border-color: var(--accent); }

.signup input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  font: 0.9rem var(--mono);
  color: var(--fg);
  background: transparent;
  border: 0;
  outline: none;
}

.signup input[type="email"]::placeholder { color: rgba(139, 146, 156, 0.7); }

.signup button {
  padding: 0 20px;
  font: 600 0.75rem var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  border: 0;
  cursor: pointer;
  transition: filter 0.2s;
}

.signup button:hover,
.signup button:focus-visible { filter: brightness(1.15); }

.signup button:disabled { cursor: progress; filter: saturate(0.4); }

.signup .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}

.signup-status {
  min-height: 1.4em;
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.signup.done .signup-status { color: var(--fg); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Footer ---------- */

footer {
  padding: 0 40px 36px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.7;
  text-align: center;
  color: var(--muted);
}

footer p { margin: 2px 0; }
footer a { color: var(--muted); }
footer a:hover { color: var(--fg); }

/* ---------- Policy page ---------- */

.policy {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 40px auto;
  padding: 40px;
  background: rgba(6, 7, 8, 0.72);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.policy h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.policy .meta {
  margin: 0 0 28px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.policy h2 {
  margin: 32px 0 6px;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.policy p { margin: 0 0 12px; color: #cfd3d9; }

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  .hud { padding: 28px 28px 0; }
  .hud-code { display: none; }
  footer { padding: 0 28px 32px; }
  .policy { margin: 24px 16px; padding: 28px 22px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
