:root {
  --pink: #ff2bd6;
  --cyan: #19f0ff;
  --violet: #7b2bff;
  --sun: #ffb347;
  --ink: #0b0221;
  --depth: 14;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--ink);
  color: #fff;
  overflow: hidden;
  font-family: "Share Tech Mono", ui-monospace, monospace;
}

/* ---------- Background layers ---------- */
.bg {
  position: fixed; inset: -4%;
  background:
    linear-gradient(180deg, rgba(11,2,33,.35) 0%, rgba(11,2,33,.05) 40%, rgba(11,2,33,.55) 100%),
    url("samples/neon-horizon.jpg") center / cover no-repeat;
  background:
    linear-gradient(180deg, rgba(11,2,33,.35) 0%, rgba(11,2,33,.05) 40%, rgba(11,2,33,.55) 100%),
    image-set(url("samples/neon-horizon.webp") type("image/webp"), url("samples/neon-horizon.jpg") type("image/jpeg")) center / cover no-repeat;
  animation: bgdrift 30s ease-in-out infinite alternate;
  transform: translate3d(var(--px, 0), var(--py, 0), 0) scale(1.04);
  transition: transform .4s ease-out;
  z-index: 0;
}
@keyframes bgdrift {
  from { filter: saturate(1.1) hue-rotate(0deg); }
  to   { filter: saturate(1.35) hue-rotate(-12deg); }
}

.grid {
  position: fixed; left: 0; right: 0; bottom: 0; height: 42vh;
  perspective: 320px;
  overflow: hidden;
  z-index: 1;
  -webkit-mask-image: linear-gradient(to top, #000 30%, transparent);
          mask-image: linear-gradient(to top, #000 30%, transparent);
  opacity: .55;
  mix-blend-mode: screen;
}
.grid-plane {
  position: absolute; left: -50%; width: 200%; height: 200%; top: 0;
  background-image:
    linear-gradient(var(--pink) 2px, transparent 2px),
    linear-gradient(90deg, var(--pink) 2px, transparent 2px);
  background-size: 60px 60px;
  transform-origin: top center;
  transform: rotateX(72deg);
  animation: gridmove 1.2s linear infinite;
  filter: drop-shadow(0 0 6px var(--pink));
}
@keyframes gridmove {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 60px, 0 0; }
}

#stars { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

.scanlines {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
  animation: flicker 6s infinite steps(1);
}
@keyframes flicker {
  0%, 100% { opacity: .55; }
  47% { opacity: .7; }
  48% { opacity: .35; }
  49% { opacity: .6; }
}
.vignette {
  position: fixed; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(5,0,20,.85) 100%);
}

/* ---------- Stage ---------- */
.stage {
  position: relative; z-index: 3;
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(1rem, 3vh, 2rem);
  padding: 2rem 1rem 6rem;
  text-align: center;
  perspective: 1100px;
}

.kicker {
  font-size: clamp(.7rem, 1.4vw, .9rem);
  letter-spacing: .35em;
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan);
  display: inline-flex; align-items: center; gap: .6em;
  padding: .5em 1.1em;
  border: 1px solid rgba(25,240,255,.45);
  background: rgba(11,2,33,.45);
  backdrop-filter: blur(6px);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  opacity: 0; animation: fadeup .8s .2s forwards;
}
.dot {
  width: .55em; height: .55em; border-radius: 50%;
  background: var(--pink); box-shadow: 0 0 10px var(--pink);
  animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: .15; } }

/* ---------- 3D title ---------- */
.title3d {
  position: relative; z-index: 1;
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  font-size: clamp(3.2rem, 15vw, 12rem);
  line-height: 1;
  letter-spacing: .04em;
  transform-style: preserve-3d;
  animation: titlein 1.6s cubic-bezier(.2,.9,.2,1) both;
}
@keyframes titlein {
  from { opacity: 0; transform: translateZ(-900px) rotateX(70deg); filter: blur(12px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.layers {
  position: relative; display: inline-block;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 12deg)) rotateY(var(--ry, -18deg));
  transition: transform .15s ease-out;
}
.layers .layer {
  position: absolute; left: 0; top: 0;
  white-space: nowrap;
  pointer-events: none;
  color: hsl(calc(310 - var(--i) * 4), 100%, calc(58% - var(--i) * 1.4%));
  transform: translateZ(calc(var(--i) * -0.008em));
}
.layers .layer.back {
  text-shadow: 0 0 40px rgba(255,43,214,.9), 0 0 90px rgba(123,43,255,.8);
}
.layers .front {
  position: relative; display: inline-block; white-space: nowrap;
  background: linear-gradient(180deg,
    #fff 0%, #e6f7ff 22%, #19f0ff 45%, #2a1052 50%, #ff2bd6 56%, #ffb347 85%, #fff4c2 100%);
  background-size: 100% 200%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,.55);
  filter: drop-shadow(0 0 6px rgba(25,240,255,.6));
  animation: chrome 5s ease-in-out infinite alternate;
}
@keyframes chrome {
  from { background-position: 0 0; }
  to   { background-position: 0 100%; }
}
.layers .front::after {
  /* light sweep */
  content: attr(data-text);
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.95) 50%, transparent 60%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  -webkit-text-stroke: 0;
  animation: sweep 4s ease-in-out infinite;
}
@keyframes sweep {
  0%, 30% { background-position: 150% 0; }
  70%, 100% { background-position: -100% 0; }
}

.title3d.glitch .front { animation: chrome 5s ease-in-out infinite alternate, glitch .35s steps(2) 1; }
@keyframes glitch {
  0%   { transform: translate(0); clip-path: inset(0 0 0 0); }
  20%  { transform: translate(-6px, 2px); clip-path: inset(10% 0 60% 0); }
  40%  { transform: translate(6px, -2px); clip-path: inset(50% 0 20% 0); }
  60%  { transform: translate(-3px, 0); clip-path: inset(30% 0 40% 0); }
  80%  { transform: translate(3px, 1px); clip-path: inset(70% 0 5% 0); }
  100% { transform: translate(0); clip-path: inset(0 0 0 0); }
}

/* ---------- Subtitle ---------- */
.subtitle {
  position: relative; z-index: 2;
  font-family: "Orbitron", sans-serif;
  font-weight: 500;
  font-size: clamp(1rem, 3.4vw, 2.2rem);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 6px var(--pink), 0 0 18px var(--pink), 0 0 40px var(--violet);
  min-height: 1.4em;
}
.caret { color: var(--cyan); text-shadow: 0 0 10px var(--cyan); animation: blink .8s infinite steps(1); }

/* ---------- Boot bar ---------- */
.boot {
  width: min(520px, 86vw);
  opacity: 0; animation: fadeup .8s 1.4s forwards;
}
.boot-bar {
  height: 10px;
  border: 1px solid rgba(25,240,255,.6);
  background: rgba(11,2,33,.6);
  box-shadow: 0 0 12px rgba(25,240,255,.35), inset 0 0 8px rgba(25,240,255,.2);
  overflow: hidden;
}
.boot-fill {
  height: 100%; width: 0%;
  background: repeating-linear-gradient(90deg, var(--cyan) 0 10px, var(--pink) 10px 12px);
  box-shadow: 0 0 14px var(--cyan);
  transition: width .5s ease;
}
.boot-meta {
  display: flex; justify-content: space-between;
  margin-top: .55rem;
  font-size: .78rem; letter-spacing: .2em;
  color: rgba(230,247,255,.85);
  text-shadow: 0 0 6px rgba(25,240,255,.6);
}

.foot {
  position: fixed; bottom: 1.2rem; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: center; gap: .8rem;
  font-size: .72rem; letter-spacing: .3em;
  color: rgba(255,255,255,.6);
}
.foot .sep { color: var(--pink); }

@keyframes fadeup {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
  .grid { height: 34vh; }
  .foot { flex-direction: column; align-items: center; gap: .2rem; }
  .foot .sep { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
