@font-face {
  font-family: 'Orbitron';
  src: url('fonts/Orbitron-900.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: 'VT323';
  src: url('fonts/VT323-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --void: #04060d;
  --grid: rgba(255, 42, 109, 0.045);
  --grid-strong: rgba(0, 240, 230, 0.07);
  --cyan: #00f0ff;
  --magenta: #ff2a6d;
  --acid: #d4ff3a;
  --bone: #d6e2ff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--void); }

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(255, 42, 109, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 10%, rgba(0, 240, 255, 0.10) 0%, transparent 50%),
    var(--void);
  color: var(--bone);
  font-family: 'VT323', ui-monospace, Menlo, monospace;
  overflow-x: hidden;
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
}

/* horizon grid floor — perspective stripes */
body::before {
  content: '';
  position: fixed;
  inset: 50% 0 0 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(transparent 0%, transparent 60%, var(--grid-strong) 60%, var(--grid-strong) 100%),
    linear-gradient(90deg,
      transparent calc(50% - 0.5px),
      var(--grid) calc(50% - 0.5px),
      var(--grid) calc(50% + 0.5px),
      transparent calc(50% + 0.5px)),
    repeating-linear-gradient(0deg, transparent 0, transparent 14px, var(--grid) 14px, var(--grid) 15px),
    repeating-linear-gradient(90deg, transparent 0, transparent 28px, var(--grid) 28px, var(--grid) 29px);
  transform: perspective(500px) rotateX(60deg);
  transform-origin: 50% 0;
  mask-image: linear-gradient(transparent 0%, #000 30%, #000 100%);
  -webkit-mask-image: linear-gradient(transparent 0%, #000 30%, #000 100%);
  opacity: 0.85;
}

/* CRT scan lines + flicker */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background:
    repeating-linear-gradient(180deg,
      transparent 0,
      transparent 2px,
      rgba(0, 0, 0, 0.18) 2px,
      rgba(0, 0, 0, 0.18) 3px);
  mix-blend-mode: multiply;
  animation: flicker 4s steps(2, end) infinite;
}
@keyframes flicker {
  0%, 96% { opacity: 0.65; }
  97%     { opacity: 0.4; }
  98%     { opacity: 0.75; }
  99%     { opacity: 0.55; }
}

main {
  display: grid;
  place-items: center;
  padding: clamp(2rem, 6vw, 6rem) clamp(1rem, 4vw, 4rem);
  position: relative;
  z-index: 3;
}

.mark {
  font-family: 'Orbitron', 'Eurostile', 'Helvetica Neue', sans-serif;
  font-weight: 900;
  font-size: clamp(1.6rem, 9.2vw, 16rem);
  line-height: 0.92;
  letter-spacing: 0;
  text-align: center;
  color: var(--cyan);
  position: relative;
  word-break: break-word;
  user-select: none;
  text-shadow:
    0 0 4px rgba(0, 240, 255, 0.9),
    0 0 16px rgba(0, 240, 255, 0.55),
    0 0 38px rgba(0, 240, 255, 0.35),
    0 0 78px rgba(0, 240, 255, 0.18);
}

.mark .stop {
  color: var(--magenta);
  display: inline-block;
  text-shadow:
    0 0 4px rgba(255, 42, 109, 0.95),
    0 0 18px rgba(255, 42, 109, 0.6),
    0 0 36px rgba(255, 42, 109, 0.35);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50%      { opacity: 0.6; transform: translateY(-2px); }
}

/* RGB-split glitch layers — magenta and acid */
.mark::before, .mark::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  font-family: inherit;
  pointer-events: none;
  letter-spacing: inherit;
}
.mark::before {
  color: var(--magenta);
  mix-blend-mode: screen;
  animation: shift-a 3.6s ease-in-out infinite;
  text-shadow: 0 0 12px rgba(255, 42, 109, 0.5);
}
.mark::after {
  color: var(--acid);
  mix-blend-mode: screen;
  animation: shift-b 4.8s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(212, 255, 58, 0.35);
}
@keyframes shift-a {
  0%, 100% { transform: translate(0, 0); clip-path: inset(0 0 0 0); }
  10% { transform: translate(-2px, 1px); clip-path: inset(8% 0 70% 0); }
  20% { transform: translate(3px, -1px); clip-path: inset(40% 0 30% 0); }
  30% { transform: translate(-1px, 2px); clip-path: inset(60% 0 10% 0); }
  40% { transform: translate(2px, 0); clip-path: inset(0 0 80% 0); }
  50% { transform: translate(0, 0); clip-path: inset(0 0 0 0); }
}
@keyframes shift-b {
  0%, 100% { transform: translate(0, 0); clip-path: inset(0 0 0 0); }
  15% { transform: translate(2px, -1px); clip-path: inset(20% 0 55% 0); }
  35% { transform: translate(-3px, 1px); clip-path: inset(55% 0 20% 0); }
  55% { transform: translate(1px, 2px); clip-path: inset(0 0 90% 0); }
  75% { transform: translate(-1px, -2px); clip-path: inset(75% 0 0 0); }
}

/* Subline under the mark */
.subline {
  font-family: 'VT323', monospace;
  font-size: clamp(0.8rem, 1.6vw, 1.05rem);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--bone);
  margin-top: clamp(1.5rem, 3vw, 2.8rem);
  opacity: 0.8;
  text-align: center;
}
.subline .caret {
  color: var(--cyan);
  animation: caret 1s steps(2, end) infinite;
  display: inline-block;
  margin-left: 0.4em;
}
@keyframes caret { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* Corner HUD chrome */
.hud {
  position: fixed;
  font-family: 'VT323', monospace;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  z-index: 30;
  line-height: 1.4;
}
.hud.tl { top: clamp(1.2rem, 3vw, 2rem); left: clamp(1.2rem, 3vw, 2rem); }
.hud.tr { top: clamp(1.2rem, 3vw, 2rem); right: clamp(1.2rem, 3vw, 2rem); text-align: right; }
.hud .row { display: flex; gap: 0.6em; align-items: baseline; }
.hud .row::before { content: '▌'; color: var(--magenta); }
.hud.tr .row { justify-content: flex-end; }
.hud.tr .row::before { display: none; }
.hud.tr .row::after { content: '▌'; color: var(--magenta); margin-left: 0.6em; }

.hud .dim { color: var(--bone); opacity: 0.55; }

/* Bracket frame around the mark */
.bracket {
  position: relative;
  padding: clamp(1.2rem, 3vw, 2.5rem) clamp(1rem, 2.5vw, 2rem);
}
.bracket::before, .bracket::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--cyan);
  filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.6));
}
.bracket::before {
  top: 0; left: 0;
  border-right: 0;
  border-bottom: 0;
}
.bracket::after {
  bottom: 0; right: 0;
  border-left: 0;
  border-top: 0;
}

.bracket .b2, .bracket .b3 {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--magenta);
  filter: drop-shadow(0 0 5px rgba(255, 42, 109, 0.55));
}
.bracket .b2 { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.bracket .b3 { bottom: 0; left: 0; border-right: 0; border-top: 0; }

footer {
  padding: clamp(1.2rem, 2.8vw, 2.4rem) clamp(2rem, 4vw, 3.5rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-family: 'VT323', monospace;
  font-size: 15px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone);
  position: relative;
  z-index: 4;
  border-top: 1px solid rgba(0, 240, 255, 0.2);
  background: linear-gradient(180deg, transparent 0%, rgba(0, 240, 255, 0.04) 100%);
}
footer a {
  color: var(--bone);
  text-decoration: none;
  position: relative;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: color 160ms, border-color 160ms, text-shadow 160ms;
}
footer a::before {
  content: '>';
  color: var(--cyan);
  margin-right: 0.4em;
  opacity: 0.5;
}
footer a:hover, footer a:focus-visible {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
  outline: none;
}
footer a:hover::before { opacity: 1; }

footer .legal { display: flex; gap: 1.6rem; flex-wrap: wrap; }
footer .copy { opacity: 0.55; }

@media (max-width: 600px) {
  .hud { font-size: 11px; }
  footer { font-size: 13px; gap: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .mark::before, .mark::after { animation: none; }
  .mark .stop { animation: none; }
  body::after { animation: none; }
  .subline .caret { animation: none; opacity: 1; }
}

/* ---------------- legal pages ---------------- */
.doc {
  background: transparent;
  color: var(--bone);
  font-family: 'VT323', monospace;
  max-width: 64ch;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 7rem) clamp(1.5rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem);
  line-height: 1.6;
  font-size: 18px;
  position: relative;
  z-index: 3;
}
.doc h1 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  color: var(--cyan);
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: 0.02em;
  margin-bottom: 2rem;
  text-shadow:
    0 0 5px rgba(0, 240, 255, 0.7),
    0 0 18px rgba(0, 240, 255, 0.4);
}
.doc h1 .dot { color: var(--magenta); text-shadow: 0 0 5px var(--magenta), 0 0 18px rgba(255, 42, 109, 0.5); }
.doc h2 {
  color: var(--magenta);
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 2.5rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 42, 109, 0.35);
  padding-bottom: 0.4rem;
}
.doc p { margin-bottom: 1rem; opacity: 0.9; }
.doc a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.doc a:hover { text-shadow: 0 0 8px rgba(0, 240, 255, 0.6); }
.doc .back {
  display: inline-block;
  margin-top: 3rem;
  font-size: 16px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone);
  text-decoration: none;
  opacity: 0.75;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.doc .back::before { content: '< '; color: var(--cyan); margin-right: 0.2em; }
.doc .back:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  opacity: 1;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}
