:root {
  --bg: #0a0e12;
  --fg: #e6f7ff;
  --fg-dim: #8aa9b8;
  --accent: #22d3ee;
  --accent-warm: #f43f5e;
  --accent-cool: #38bdf8;
  --mono: 'IBM Plex Mono', ui-monospace, "SF Mono", "JetBrains Mono",
    "Fira Code", Menlo, Consolas, monospace;
  --sans: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  min-height: 100dvh;
  overflow: hidden;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#tron-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  filter: blur(1px);
  mask-image: radial-gradient(
    ellipse 80% 70% at 50% 55%,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.85) 35%,
    rgba(0, 0, 0, 0.4) 65%,
    rgba(0, 0, 0, 0) 100%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 80% 70% at 50% 55%,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.85) 35%,
    rgba(0, 0, 0, 0.4) 65%,
    rgba(0, 0, 0, 0) 100%
  );
}

#tron-grid canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  text-align: center;
  gap: 1.25rem;
}

.wordmark {
  position: relative;
  width: clamp(220px, 38vw, 380px);
  height: auto;
  margin-bottom: 1.5rem;
  isolation: isolate;
}

.wordmark-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
}

.wordmark-base {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.25));
  animation: wordmark-flicker 2.6s steps(1, end) infinite;
}

@keyframes wordmark-flicker {
  0%,
  84%,
  100% {
    filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.25));
    opacity: 1;
  }
  86% {
    filter: drop-shadow(0 0 18px rgba(244, 63, 94, 0.65))
      drop-shadow(2px 0 0 rgba(244, 63, 94, 0.9))
      drop-shadow(-2px 0 0 rgba(56, 189, 248, 0.8));
    opacity: 0.85;
  }
  88% {
    opacity: 0.2;
  }
  90% {
    filter: drop-shadow(0 0 22px rgba(244, 63, 94, 0.85))
      drop-shadow(4px 0 0 rgba(244, 63, 94, 1))
      drop-shadow(-4px 0 0 rgba(56, 189, 248, 0.9));
    opacity: 0.95;
  }
  93% {
    opacity: 0.4;
  }
  96% {
    filter: drop-shadow(0 0 14px rgba(244, 63, 94, 0.6));
    opacity: 0.9;
  }
}

.wordmark-glitch {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  -webkit-mask-image: url('/assets/eigenoid-wordmark-dark.svg');
  mask-image: url('/assets/eigenoid-wordmark-dark.svg');
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0;
}

.wordmark-glitch-1 {
  z-index: 1;
  background-color: var(--accent-warm);
  animation: glitch-shift-a 2.6s steps(1, end) infinite;
}

.wordmark-glitch-2 {
  z-index: 1;
  background-color: var(--accent-cool);
  animation: glitch-shift-b 2.6s steps(1, end) infinite;
}

@keyframes glitch-shift-a {
  0%,
  84%,
  100% {
    transform: translate(0, 0);
    opacity: 0;
  }
  85% {
    transform: translate(-7px, 2px);
    opacity: 1;
  }
  88% {
    transform: translate(5px, -2px);
    opacity: 0.95;
  }
  91% {
    transform: translate(-9px, 1px);
    opacity: 1;
  }
  94% {
    transform: translate(4px, -3px);
    opacity: 0.85;
  }
  97% {
    transform: translate(-2px, 0);
    opacity: 0.7;
  }
}

@keyframes glitch-shift-b {
  0%,
  84%,
  100% {
    transform: translate(0, 0);
    opacity: 0;
  }
  85% {
    transform: translate(7px, -2px);
    opacity: 1;
  }
  88% {
    transform: translate(-5px, 2px);
    opacity: 0.95;
  }
  91% {
    transform: translate(9px, -1px);
    opacity: 1;
  }
  94% {
    transform: translate(-4px, 3px);
    opacity: 0.85;
  }
  97% {
    transform: translate(2px, 0);
    opacity: 0.7;
  }
}

.title {
  position: relative;
  margin: 0;
  font-family: 'Share Tech Mono', var(--mono);
  font-weight: 400;
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  letter-spacing: 0.04em;
  color: var(--fg);
  text-transform: lowercase;
}

.title::before,
.title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.7;
}

.title::before {
  color: var(--accent-warm);
  animation: title-jitter-a 5s steps(2, end) infinite;
}

.title::after {
  color: var(--accent-cool);
  animation: title-jitter-b 5s steps(2, end) infinite;
}

@keyframes title-jitter-a {
  0%,
  90%,
  100% {
    transform: translate(0, 0);
    opacity: 0;
  }
  91% {
    transform: translate(-1.5px, 0);
    opacity: 0.8;
  }
  93% {
    transform: translate(1px, -1px);
    opacity: 0.6;
  }
  95% {
    transform: translate(0, 1px);
    opacity: 0.4;
  }
}

@keyframes title-jitter-b {
  0%,
  90%,
  100% {
    transform: translate(0, 0);
    opacity: 0;
  }
  91% {
    transform: translate(1.5px, 0);
    opacity: 0.8;
  }
  93% {
    transform: translate(-1px, 1px);
    opacity: 0.6;
  }
  95% {
    transform: translate(0, -1px);
    opacity: 0.4;
  }
}

.lede {
  margin: 0;
  max-width: 38rem;
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  line-height: 1.55;
  color: var(--fg);
  text-wrap: balance;
}

.mono {
  font-family: var(--mono);
  color: var(--accent);
}

.hint {
  margin: 0;
  max-width: 36rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--fg-dim);
  text-wrap: balance;
}

.footer {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--fg-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.footer-sep {
  opacity: 0.4;
}

.footer-copy {
  opacity: 0.7;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wordmark-glitch,
  .title::before,
  .title::after,
  .dot {
    animation: none;
  }
  .wordmark-glitch {
    opacity: 0;
  }
  .title::before,
  .title::after {
    opacity: 0;
  }
}
