:root {
  --bg-black: #000000;
  --logo-blue: #00a8ff;
  --logo-blue-soft: #7ad4ff;
  --logo-orange: #ff7816;
  --logo-orange-soft: #ffa85c;
  --logo-purple: #9e1ef0;
  --logo-purple-soft: #c97bff;
  --logo-gold: #fac62d;
  --logo-gold-soft: #ffe27a;
  --text-light: #f9fbff;
}

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

html,
body {
  width: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--bg-black);
  color: var(--text-light);
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Main single-screen stage */
.viewport-stage {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-black);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 48px);
  isolation: isolate;
}

/* Pure radial gradients — zero blur filter overhead */
.cosmos-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg-black);
}

.aura {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.aura-pink {
  width: 72vw;
  height: 72vw;
  top: -18%;
  left: -14%;
  background: radial-gradient(
    circle,
    rgba(0, 168, 255, 0.16) 0%,
    rgba(0, 168, 255, 0.05) 40%,
    transparent 70%
  );
}

.aura-lavender {
  width: 70vw;
  height: 70vw;
  bottom: -22%;
  right: -14%;
  background: radial-gradient(
    circle,
    rgba(158, 30, 240, 0.16) 0%,
    rgba(158, 30, 240, 0.05) 42%,
    transparent 70%
  );
}

.aura-gold {
  width: 56vw;
  height: 56vw;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(250, 198, 45, 0.1) 0%,
    rgba(255, 120, 22, 0.05) 40%,
    transparent 70%
  );
}

/* Outer Galaxy Dust — scales proportionally with viewport */
.cosmos-dust {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: visible;
  pointer-events: none;
  z-index: -2;
}

/* Emblem Frame — scales proportionally with screen size, bold & slightly offset past edges */
.hero-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112vw;
  height: 102dvh;
}

.emblem-decor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

.twinkle-a {
  animation: twinkleOpacity 3.2s ease-in-out infinite;
}

.twinkle-b {
  animation: twinkleOpacity 3.9s ease-in-out -1.4s infinite;
}

.twinkle-c {
  animation: twinkleOpacity 4.6s ease-in-out -2.7s infinite;
}

/* Centered Handle, Name, Crown & Catch Phrase (scales cleanly with viewport) */
.center-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(12px, 2.4vh, 48px);
  max-width: min(90vw, 64vw);
  width: 100%;
  padding: clamp(16px, 3vw, 64px);
  z-index: 2;
}

.persona-handle {
  margin: 0 0 clamp(4px, 0.6vh, 14px);
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(1.15rem, 1.9vw, 4rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--logo-blue-soft);
}

.persona-name {
  position: relative;
  display: inline-block;
  margin: 0;
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(3.4rem, 8.2vw, 17rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.015em;
}

.name-main {
  background: linear-gradient(115deg, var(--logo-blue-soft) 0%, var(--logo-blue) 48%, var(--logo-purple-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.name-crown {
  position: absolute;
  top: -0.34em;
  left: -0.18em;
  width: 0.56em;
  height: 0.42em;
  transform: rotate(-16deg);
  pointer-events: none;
  animation: crownFloat 4.8s ease-in-out infinite;
}

.name-accent {
  background: linear-gradient(110deg, var(--logo-gold-soft) 0%, var(--logo-gold) 22%, var(--logo-orange) 68%, #ff5a00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.catch-phrase {
  margin: 0;
  max-width: min(92vw, 72vw);
  font-size: clamp(1.15rem, 1.95vw, 4.2rem);
  font-weight: 700;
  line-height: 1.48;
  color: var(--text-light);
  text-wrap: balance;
}

/* Mobile Portrait Adaptation: Spread clusters vertically toward top/bottom & enlarge text */
@media (max-width: 640px) {
  .viewport-stage {
    padding: 12px;
  }

  .hero-frame {
    width: 100%;
    height: 92dvh;
  }

  .emblem-decor {
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) scale(1.42);
  }

  .cluster-tl {
    transform: translate(32px, -420px);
  }

  .cluster-tr {
    transform: translate(-42px, -385px);
  }

  .cluster-bl {
    transform: translate(38px, 360px);
  }

  .cluster-br {
    transform: translate(-84px, 330px);
  }

  .center-hero {
    max-width: 94%;
    gap: 14px;
    padding: 12px 6px;
  }

  .persona-handle {
    font-size: clamp(1.2rem, 4.8vw, 1.55rem);
    margin-bottom: 2px;
  }

  .persona-name {
    font-size: clamp(3.3rem, 15.5vw, 4.8rem);
  }

  .catch-phrase {
    max-width: 100%;
    font-size: clamp(1.15rem, 4.8vw, 1.45rem);
    line-height: 1.45;
  }
}

/* Lightweight GPU Keyframes */
@keyframes crownFloat {
  0%,
  100% {
    transform: rotate(-16deg) translateY(0px);
  }
  50% {
    transform: rotate(-13deg) translateY(-4px);
  }
}

@keyframes twinkleOpacity {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  .twinkle-a,
  .twinkle-b,
  .twinkle-c,
  .name-crown {
    animation: none !important;
  }
}
