:root {
  color-scheme: dark;
  --ink: #030408;
  --cyan: #41e6ff;
  --blue: #5f7cff;
  --violet: #b369ff;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.scene {
  position: relative;
  isolation: isolate;
  width: 100vw;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(48, 87, 150, .13), transparent 30%),
    radial-gradient(circle at 16% 20%, rgba(65, 230, 255, .065), transparent 22%),
    radial-gradient(circle at 82% 78%, rgba(179, 105, 255, .07), transparent 24%),
    #030408;
}

.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .16;
  background-image:
    linear-gradient(rgba(112, 197, 255, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 197, 255, .1) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(circle at center, black, transparent 68%);
  mask-image: radial-gradient(circle at center, black, transparent 68%);
  transform: perspective(500px) rotateX(64deg) scale(1.8) translateY(12%);
  animation: grid-drift 18s linear infinite;
}

.scene::after {
  content: "";
  position: absolute;
  inset: -50%;
  z-index: 8;
  pointer-events: none;
  opacity: .12;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.11) 4px);
  animation: scan 10s linear infinite;
}

h1 {
  position: relative;
  z-index: 5;
  margin: 0;
  padding: .12em .2em;
  color: #eefaff;
  font-size: clamp(3.8rem, 13vw, 11rem);
  font-weight: 820;
  line-height: .82;
  letter-spacing: -.075em;
  text-shadow:
    0 0 12px rgba(103, 225, 255, .5),
    0 0 42px rgba(76, 136, 255, .28),
    0 0 90px rgba(179, 105, 255, .2);
  animation: word-breathe 6s ease-in-out infinite;
}

h1::before,
h1::after {
  content: attr(data-text);
  position: absolute;
  inset: .12em .2em;
  z-index: -1;
  pointer-events: none;
}

h1::before {
  color: var(--cyan);
  opacity: .55;
  transform: translate(-3px, 1px);
  clip-path: polygon(0 12%, 100% 7%, 100% 39%, 0 43%);
  animation: glitch-a 7s steps(1) infinite;
}

h1::after {
  color: var(--violet);
  opacity: .48;
  transform: translate(3px, -1px);
  clip-path: polygon(0 63%, 100% 58%, 100% 91%, 0 96%);
  animation: glitch-b 7s steps(1) infinite;
}

.halo {
  position: absolute;
  z-index: 1;
  width: min(72vw, 880px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(102, 220, 255, .16);
  box-shadow:
    inset 0 0 90px rgba(55, 124, 255, .08),
    0 0 130px rgba(88, 70, 255, .11);
  animation: halo-pulse 7s ease-in-out infinite;
}

.halo::before,
.halo::after {
  content: "";
  position: absolute;
  inset: 13%;
  border: 1px solid rgba(179, 105, 255, .2);
  transform: rotate(45deg);
  animation: inverse-spin 24s linear infinite;
}

.halo::after {
  inset: 27%;
  border-color: rgba(65, 230, 255, .24);
  border-radius: 32%;
  animation-duration: 17s;
  animation-direction: reverse;
}

.mesh {
  position: absolute;
  z-index: 0;
  width: min(58vw, 680px);
  aspect-ratio: 1;
  border: 1px solid rgba(90, 187, 255, .12);
  transform: rotate(45deg);
  animation: mesh-turn 42s linear infinite;
}

.mesh::before,
.mesh::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: inherit;
  transform: rotate(22.5deg);
}

.mesh::after { inset: 27%; transform: rotate(45deg); }

.fractal {
  position: absolute;
  z-index: 2;
  width: clamp(240px, 34vw, 520px);
  aspect-ratio: 1;
  animation: fractal-orbit 31s linear infinite;
}

.fractal i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42%;
  aspect-ratio: 1;
  border: 1px solid rgba(72, 225, 255, .35);
  border-radius: 13% 41% 16% 38%;
  transform-origin: 0 0;
  box-shadow: inset 0 0 22px rgba(55, 176, 255, .045);
}

.fractal i:nth-child(1) { transform: rotate(0deg) translate(18%, 8%) scale(1); }
.fractal i:nth-child(2) { transform: rotate(45deg) translate(18%, 8%) scale(.86); }
.fractal i:nth-child(3) { transform: rotate(90deg) translate(18%, 8%) scale(.74); }
.fractal i:nth-child(4) { transform: rotate(135deg) translate(18%, 8%) scale(.64); }
.fractal i:nth-child(5) { transform: rotate(180deg) translate(18%, 8%) scale(.55); }
.fractal i:nth-child(6) { transform: rotate(225deg) translate(18%, 8%) scale(.47); }
.fractal i:nth-child(7) { transform: rotate(270deg) translate(18%, 8%) scale(.4); }
.fractal i:nth-child(8) { transform: rotate(315deg) translate(18%, 8%) scale(.34); }

.fractal-a { left: -10vw; top: -10vw; opacity: .68; }
.fractal-b { right: -11vw; bottom: -12vw; opacity: .58; animation-direction: reverse; animation-duration: 37s; }
.fractal-b i { border-color: rgba(179, 105, 255, .34); }
.fractal-c { left: 50%; top: 50%; opacity: .28; transform: translate(-50%, -50%) scale(1.6); animation-duration: 48s; }
.fractal-c i { border-radius: 50%; border-color: rgba(99, 132, 255, .3); }

@keyframes grid-drift {
  to { background-position: 54px 54px; }
}

@keyframes scan {
  from { transform: translateY(-10%); }
  to { transform: translateY(10%); }
}

@keyframes fractal-orbit {
  to { rotate: 1turn; }
}

@keyframes mesh-turn {
  to { transform: rotate(405deg); }
}

@keyframes inverse-spin {
  to { transform: rotate(-315deg); }
}

@keyframes halo-pulse {
  0%, 100% { opacity: .58; transform: scale(.96); }
  50% { opacity: 1; transform: scale(1.04); }
}

@keyframes word-breathe {
  0%, 100% { filter: brightness(.92); transform: scale(.985); }
  50% { filter: brightness(1.16); transform: scale(1); }
}

@keyframes glitch-a {
  0%, 89%, 93%, 100% { transform: translate(-3px, 1px); }
  90% { transform: translate(8px, -2px); }
  91% { transform: translate(-7px, 2px); }
  92% { transform: translate(2px, 0); }
}

@keyframes glitch-b {
  0%, 84%, 88%, 100% { transform: translate(3px, -1px); }
  85% { transform: translate(-8px, 2px); }
  86% { transform: translate(6px, -2px); }
  87% { transform: translate(-1px, 0); }
}

@media (max-width: 600px) {
  h1 { font-size: clamp(3.25rem, 20vw, 5.2rem); }
  .halo { width: 118vw; }
  .mesh { width: 92vw; }
  .fractal { width: 78vw; }
  .fractal-a { left: -34vw; top: -18vw; }
  .fractal-b { right: -36vw; bottom: -20vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
