:root {
  --bg-0: #04060c;
  --bg-1: #0b1220;
  --ink: #e8eefc;
  --muted: #8b96b3;
  --faint: #5a6480;
  --accent: #6ea8ff;
  --cyan: #45e0ff;
  --fault: #ff4d5e;
  --amber: #ffb454;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  background: radial-gradient(120% 90% at 50% 0%, var(--bg-1), var(--bg-0) 72%);
  color: var(--ink);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-font-smoothing: antialiased;
}

/* faint scanlines for texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.022) 0px,
    rgba(255, 255, 255, 0.022) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 3;
}

/* vignette */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(90% 80% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.5));
  z-index: 2;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

main {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px clamp(64px, 15vh, 160px);
  text-align: center;
  pointer-events: none;
}

main > * {
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

main > .tagline { animation-delay: 0.15s; }

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

/* ---------- title ---------- */

h1 {
  position: relative;
  font-size: 3.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 20%, #a8c4ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 42px rgba(110, 168, 255, 0.28);
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

/* one-shot glitch burst, fired by lightning strikes */
h1.glitching {
  animation: glitch-base 0.38s steps(1);
}

h1.glitching::before {
  animation: glitch-a 0.38s steps(1);
}

h1.glitching::after {
  animation: glitch-b 0.44s steps(1) 0.03s;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  text-shadow: none;
  opacity: 0;
  pointer-events: none;
}

.glitch::before {
  color: var(--cyan);
}

.glitch::after {
  color: var(--fault);
}

@keyframes glitch-base {
  0%  { transform: translateX(2px) skewX(2deg); }
  25% { transform: translateX(-2px); }
  55% { transform: translateX(1px) skewX(-1deg); }
  80%, 100% { transform: none; }
}

@keyframes glitch-a {
  0%   { opacity: 0.85; clip-path: inset(8% 0 64% 0);  transform: translate(-4px, -2px); }
  25%  { opacity: 0.85; clip-path: inset(50% 0 26% 0); transform: translate(3px, 1px); }
  50%  { opacity: 0.85; clip-path: inset(72% 0 6% 0);  transform: translate(-3px, 0); }
  75%  { opacity: 0.85; clip-path: inset(22% 0 55% 0); transform: translate(2px, 2px); }
  100% { opacity: 0; clip-path: inset(100% 0 0 0); }
}

@keyframes glitch-b {
  0%   { opacity: 0.85; clip-path: inset(62% 0 12% 0); transform: translate(4px, 2px); }
  30%  { opacity: 0.85; clip-path: inset(20% 0 58% 0); transform: translate(-3px, -1px); }
  65%  { opacity: 0.85; clip-path: inset(44% 0 40% 0); transform: translate(2px, 1px); }
  100% { opacity: 0; clip-path: inset(100% 0 0 0); }
}

/* ---------- tagline / status ---------- */

.tagline {
  margin-top: 20px;
  font-size: clamp(0.95rem, 2.4vw, 1.25rem);
  letter-spacing: 0.06em;
  color: var(--muted);
}

.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.35em;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

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

/* ---------- footer ---------- */

footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  padding: 18px 22px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--faint);
  pointer-events: none;
}

@media (max-width: 560px) {
  .footer-right {
    display: none;
  }
}

::selection {
  background: rgba(110, 168, 255, 0.35);
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  main > *,
  h1,
  .glitch::before,
  .glitch::after,
  .caret {
    animation: none !important;
  }
  .glitch::before,
  .glitch::after {
    opacity: 0;
  }
}
