:root {
  color-scheme: dark;
  --bg0: #05070a;
  --bg1: #070b10;
  --ink: rgba(233, 245, 255, 0.92);
  --muted: rgba(233, 245, 255, 0.72);
  --accent: #00ffd1;
  --accent2: #00a3ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 600px at 50% 25%, rgba(0, 255, 209, 0.12) 0%, rgba(0, 0, 0, 0) 55%),
    radial-gradient(900px 600px at 35% 60%, rgba(0, 163, 255, 0.10) 0%, rgba(0, 0, 0, 0) 58%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", "Apple Color Emoji", "Segoe UI Emoji";
  overflow: hidden;
}

.wrap {
  text-align: center;
  padding: 32px 20px;
  position: relative;
  isolation: isolate;
}

.title {
  margin: 0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: clamp(28px, 6vw, 56px);
  line-height: 1.1;
  filter: drop-shadow(0 0 12px rgba(0, 255, 209, 0.12));
}

.subtitle {
  margin: 14px 0 0;
  font-size: clamp(16px, 2.6vw, 20px);
  color: var(--muted);
  letter-spacing: 0.08em;
}

.js-only {
  display: none;
}

.no-js {
  display: block;
}

body.js .js-only {
  display: block;
}

body.js .no-js {
  display: none;
}

/* Watch Dogs-ish HUD lines */
.wrap::before {
  content: "";
  position: absolute;
  inset: -40px -40px;
  background:
    linear-gradient(to right, rgba(0, 255, 209, 0.08), rgba(0, 0, 0, 0) 18%, rgba(0, 0, 0, 0) 82%, rgba(0, 163, 255, 0.07)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.045) 0px,
      rgba(255, 255, 255, 0.045) 1px,
      rgba(0, 0, 0, 0) 1px,
      rgba(0, 0, 0, 0) 84px
    );
  opacity: 0.25;
  pointer-events: none;
  z-index: -2;
}

/* Scanlines + noise overlay */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

body::before {
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.00) 0px,
    rgba(255, 255, 255, 0.00) 2px,
    rgba(0, 0, 0, 0.22) 3px
  );
  mix-blend-mode: overlay;
  opacity: 0.35;
  animation: scan 8s linear infinite;
}

body::after {
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 55%),
    radial-gradient(circle at 80% 70%, rgba(0, 255, 209, 0.03), rgba(0, 255, 209, 0) 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.018) 0px, rgba(255,255,255,0.018) 1px, rgba(0,0,0,0) 1px, rgba(0,0,0,0) 3px);
  opacity: 0.22;
  filter: contrast(120%);
}

@keyframes scan {
  0% { transform: translateY(-6%); }
  100% { transform: translateY(6%); }
}

/* Typed caret */
.typed {
  position: relative;
}

.caret {
  display: inline-block;
  width: 10px;
  height: 1.05em;
  margin-left: 10px;
  translate: 0 0.16em;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  opacity: 0;
}

.caret.is-active {
  opacity: 0.9;
  animation: blink 1s steps(1, end) infinite;
  filter: drop-shadow(0 0 10px rgba(0, 255, 209, 0.35));
}

@keyframes blink {
  0%, 49% { opacity: 0.95; }
  50%, 100% { opacity: 0.10; }
}

/* Glitch text effect (subtle, occasional) */
.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-glitch);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  white-space: pre;
}

.glitch::before {
  color: var(--accent);
  text-shadow: -2px 0 rgba(0, 255, 209, 0.55);
}

.glitch::after {
  color: var(--accent2);
  text-shadow: 2px 0 rgba(0, 163, 255, 0.55);
}

body.glitch-burst .glitch::before {
  opacity: 0.65;
  transform: translate(-1px, 0);
  animation: glitch1 220ms steps(2, end) 1;
}

body.glitch-burst .glitch::after {
  opacity: 0.55;
  transform: translate(1px, 0);
  animation: glitch2 220ms steps(2, end) 1;
}

@keyframes glitch1 {
  0% { clip-path: inset(12% 0 70% 0); }
  25% { clip-path: inset(55% 0 18% 0); }
  50% { clip-path: inset(22% 0 55% 0); }
  75% { clip-path: inset(70% 0 12% 0); }
  100% { clip-path: inset(0 0 0 0); }
}

@keyframes glitch2 {
  0% { clip-path: inset(60% 0 20% 0); }
  25% { clip-path: inset(10% 0 72% 0); }
  50% { clip-path: inset(38% 0 38% 0); }
  75% { clip-path: inset(72% 0 10% 0); }
  100% { clip-path: inset(0 0 0 0); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .caret.is-active { animation: none; opacity: 0.8; }
  body.glitch-burst .glitch::before,
  body.glitch-burst .glitch::after { animation: none; }
}
