:root {
  color-scheme: dark;
  --bg: #060711;
  --ink: #f9fbff;
  --muted: #9ea7b8;
  --cyan: #4ce8df;
  --gold: #ffd166;
  --rose: #ff5a8a;
  --green: #7ef29d;
  --shadow: rgba(0, 0, 0, 0.46);
  --mouse-x: 50%;
  --mouse-y: 45%;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, "PingFang TC",
    "Microsoft JhengHei", sans-serif;
  background:
    radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(76, 232, 223, 0.24), transparent 23rem),
    radial-gradient(circle at 18% 78%, rgba(255, 209, 102, 0.2), transparent 19rem),
    radial-gradient(circle at 86% 16%, rgba(255, 90, 138, 0.22), transparent 20rem),
    linear-gradient(135deg, #050611 0%, #121322 54%, #090a12 100%);
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
}

body::before {
  opacity: 0.26;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 72%);
}

body::after {
  mix-blend-mode: screen;
  opacity: 0.5;
  background:
    conic-gradient(from 210deg at 50% 50%, transparent 0deg, rgba(126, 242, 157, 0.2) 56deg, transparent 96deg, rgba(255, 209, 102, 0.18) 180deg, transparent 260deg, rgba(76, 232, 223, 0.16) 320deg, transparent 360deg);
  filter: blur(80px);
  transform: scale(1.12);
  animation: color-drift 12s ease-in-out infinite alternate;
}

.spark-field {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stage {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: clamp(24px, 7vw, 88px);
  perspective: 1200px;
}

.aura {
  position: absolute;
  z-index: 0;
  width: min(74vw, 760px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 20%),
    conic-gradient(from 0deg, rgba(76, 232, 223, 0.45), rgba(255, 209, 102, 0.28), rgba(255, 90, 138, 0.38), rgba(126, 242, 157, 0.3), rgba(76, 232, 223, 0.45));
  box-shadow:
    0 0 96px rgba(76, 232, 223, 0.18),
    inset 0 0 56px rgba(255, 255, 255, 0.08);
  filter: blur(0.2px) saturate(1.18);
  opacity: 0.6;
  transform: rotateX(66deg) rotateZ(0deg);
  animation: orbit 18s linear infinite;
}

.aura::before,
.aura::after {
  position: absolute;
  inset: 11%;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: inherit;
  content: "";
}

.aura::after {
  inset: 25%;
  border-style: solid;
  border-color: rgba(255, 209, 102, 0.26);
}

.headline {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.03em;
  max-width: min(1120px, 96vw);
  margin: 0;
  text-align: center;
  font-size: clamp(3.1rem, 12vw, 10.8rem);
  font-weight: 950;
  line-height: 0.92;
  letter-spacing: 0;
  text-wrap: balance;
  transform:
    rotateX(var(--tilt-x))
    rotateY(var(--tilt-y))
    translateZ(0);
  transform-style: preserve-3d;
  animation: headline-enter 1100ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.headline::before,
.headline::after {
  position: absolute;
  inset: -0.12em -0.06em;
  z-index: -1;
  color: transparent;
  content: attr(data-line-one) "\A" attr(data-line-two);
  white-space: pre;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.22);
  text-shadow: 0 22px 52px var(--shadow);
  transform: translate3d(0.035em, 0.04em, -28px);
}

.headline::after {
  opacity: 0.55;
  -webkit-text-stroke-color: rgba(76, 232, 223, 0.26);
  filter: blur(18px);
  transform: translate3d(-0.025em, -0.025em, -54px);
}

.headline-line {
  display: block;
  white-space: nowrap;
}

.glyph {
  position: relative;
  display: inline-block;
  color: var(--ink);
  white-space: pre;
  filter:
    drop-shadow(0 0 0.07em rgba(255, 255, 255, 0.36))
    drop-shadow(0 0 0.16em rgba(76, 232, 223, 0.28));
  transform:
    translate3d(0, 0, calc(var(--z) * 1px))
    rotateZ(calc(var(--r) * 1deg));
  animation:
    glyph-rise 900ms cubic-bezier(0.16, 1, 0.3, 1) both,
    glyph-float 4.8s ease-in-out infinite;
  animation-delay:
    calc(var(--i) * 42ms),
    calc(var(--i) * -180ms);
}

.glyph::before,
.glyph::after {
  position: absolute;
  inset: 0;
  content: attr(data-char);
  pointer-events: none;
}

.glyph::before {
  color: transparent;
  background:
    linear-gradient(115deg, #ffffff 0%, #ffffff 22%, var(--cyan) 34%, var(--gold) 52%, var(--rose) 68%, var(--green) 84%, #ffffff 100%);
  background-size: 260% 100%;
  background-position: calc(var(--i) * -16%) 50%;
  background-clip: text;
  -webkit-background-clip: text;
  animation: text-shine 4.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * -95ms);
}

.glyph::after {
  color: transparent;
  -webkit-text-stroke: 0.018em rgba(255, 255, 255, 0.28);
  transform: translate3d(0.025em, 0.025em, -14px);
}

.space {
  width: 0.28em;
}

@keyframes headline-enter {
  from {
    transform: translateY(34px) scale(0.96) rotateX(12deg);
  }
}

@keyframes glyph-rise {
  from {
    filter: blur(14px);
    transform: translate3d(0, 0.7em, -90px) rotateZ(8deg);
  }
}

@keyframes glyph-float {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -0.08em;
  }
}

@keyframes text-shine {
  0%,
  100% {
    background-position-y: 50%;
  }

  50% {
    background-position-x: calc(100% - (var(--i) * 12%));
  }
}

@keyframes orbit {
  to {
    transform: rotateX(66deg) rotateZ(360deg);
  }
}

@keyframes color-drift {
  from {
    rotate: -8deg;
    scale: 1;
  }

  to {
    rotate: 10deg;
    scale: 1.08;
  }
}

@media (max-width: 680px) {
  body {
    overflow: hidden;
  }

  .stage {
    padding-inline: 18px;
  }

  .headline {
    max-width: 100%;
    font-size: clamp(3.2rem, 17vw, 6.4rem);
  }

  .aura {
    width: 108vw;
  }
}

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

  .headline {
    transform: none;
  }
}
