:root {
  --bg: #06070d;
  --bg-alt: #0a1022;
  --text: #f5f8ff;
  --muted: #b4bfd8;
  --primary: #7e7bff;
  --secondary: #40e2ff;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.14);
  --shadow: 0 20px 80px rgba(3, 7, 20, 0.55);
  --gradient: linear-gradient(130deg, #7e7bff, #40e2ff 60%, #79f0c6);
  --fx-blur: 16px;
  --fx-shadow: 0 20px 80px rgba(3, 7, 20, 0.55);
  --fx-particle-opacity: 0.75;
}

:root[data-theme='midnight-neon'] {
  --bg: #05070f;
  --bg-alt: #130a2b;
  --text: #f9f7ff;
  --muted: #c6bce8;
  --primary: #a55aff;
  --secondary: #00e3ff;
  --glass: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --gradient: linear-gradient(130deg, #a55aff, #00e3ff 55%, #ffa9f9);
}

:root[data-theme='frost-glass'] {
  --bg: #09111e;
  --bg-alt: #152337;
  --text: #edf5ff;
  --muted: #bed0e4;
  --primary: #63a8ff;
  --secondary: #8df4d8;
  --glass: rgba(220, 242, 255, 0.12);
  --glass-border: rgba(220, 242, 255, 0.25);
  --gradient: linear-gradient(130deg, #63a8ff, #8df4d8 58%, #d5f4ff);
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px circle at 8% 8%, color-mix(in srgb, var(--secondary) 20%, transparent), transparent 52%),
    radial-gradient(900px circle at 90% 10%, color-mix(in srgb, var(--primary) 28%, transparent), transparent 48%),
    linear-gradient(180deg, var(--bg), var(--bg-alt));
  transition: background 0.6s ease, color 0.45s ease;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

#particleCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: var(--fx-particle-opacity);
}

.loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, #1e2247, #06070d 70%);
  display: grid;
  place-items: center;
  gap: 1rem;
  z-index: 999;
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-core {
  width: 90px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gradient);
  filter: blur(0.3px) saturate(1.2);
  animation: pulseCore 1.8s ease-in-out infinite;
  box-shadow: 0 0 60px color-mix(in srgb, var(--primary) 50%, transparent);
}

@keyframes pulseCore {
  0%,
  100% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.1);
  }
}

.page-transition {
  position: fixed;
  inset: 0;
  background: linear-gradient(120deg, color-mix(in srgb, var(--primary) 65%, transparent), color-mix(in srgb, var(--secondary) 65%, transparent));
  opacity: 0;
  pointer-events: none;
  transform-origin: left;
  transform: perspective(1400px) rotateY(85deg) scaleX(0.1);
  z-index: 50;
}

.page-transition.active {
  animation: pageTurn 1.1s ease;
}

@keyframes pageTurn {
  0% {
    opacity: 0;
    transform: perspective(1400px) rotateY(85deg) scaleX(0.1);
  }
  35% {
    opacity: 0.58;
  }
  100% {
    opacity: 0;
    transform: perspective(1400px) rotateY(-88deg) scaleX(0.1);
  }
}

.site-header {
  position: sticky;
  top: 1rem;
  margin: 1rem auto 0;
  width: min(1160px, calc(100vw - 1rem));
  padding: 0.8rem 1rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  z-index: 30;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--fx-blur));
  -webkit-backdrop-filter: blur(var(--fx-blur));
  box-shadow: var(--fx-shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 12px;
  background: var(--gradient);
  font-size: 1rem;
}

.nav-links {
  display: inline-flex;
  gap: 0.4rem;
}

.nav-links a,
.footer a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.nav-links a:hover,
.footer a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease, background 0.22s ease;
}

.btn:hover {
  transform: translateY(-2px) scale(1.01);
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: var(--gradient);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--primary) 30%, transparent);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--glass-border);
}

main {
  width: min(1160px, calc(100vw - 1rem));
  margin: 0 auto;
  overflow-x: clip;
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 1.6rem;
  padding: 3.8rem 0 2rem;
  overflow: hidden;
}

.hero-liquid {
  position: absolute;
  inset: 3% 10% 22% 10%;
  z-index: -1;
  will-change: transform;
}

.orb {
  position: absolute;
  border-radius: 44% 56% 62% 38% / 42% 33% 67% 58%;
  background: var(--gradient);
  opacity: 0.25;
  animation: morph 16s ease-in-out infinite;
  will-change: transform, border-radius;
}

.orb-a {
  width: min(500px, 58vw);
  aspect-ratio: 1;
  left: -7%;
  top: 4%;
}

.orb-b {
  width: min(340px, 40vw);
  aspect-ratio: 1;
  right: 10%;
  top: 10%;
  animation-delay: -4s;
}

.orb-c {
  width: min(260px, 32vw);
  aspect-ratio: 1;
  left: 38%;
  bottom: 0;
  animation-delay: -9s;
}

.shine {
  position: absolute;
  width: 35%;
  height: 10%;
  right: 8%;
  top: 16%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  filter: blur(6px);
  animation: sweep 8s linear infinite;
}

@keyframes morph {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    border-radius: 44% 56% 62% 38% / 42% 33% 67% 58%;
  }
  50% {
    transform: translate3d(0, -16px, 0) rotate(15deg);
    border-radius: 64% 36% 45% 55% / 56% 55% 45% 44%;
  }
}

@keyframes sweep {
  0% {
    transform: translateX(-180px) rotate(-15deg);
  }
  100% {
    transform: translateX(380px) rotate(-15deg);
  }
}

.hero-content h1 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.6rem, 10vw, 5.2rem);
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: color-mix(in srgb, var(--secondary) 76%, white);
  font-weight: 700;
  letter-spacing: 0.11em;
  font-size: 0.75rem;
}

.tagline {
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.hero-cta {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.3rem;
}

.hero-visual {
  padding: 1.1rem;
  border-radius: 24px;
  max-width: 100%;
}

.visual-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

.track-card {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.24);
}

.track-card h3 {
  margin: 0;
}

.track-card p {
  margin: 0.45rem 0 0.8rem;
  color: var(--muted);
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.progress span {
  display: block;
  width: 44%;
  height: 100%;
  background: var(--gradient);
  animation: progressPulse 3.8s ease-in-out infinite;
}

@keyframes progressPulse {
  0%,
  100% {
    width: 38%;
  }
  50% {
    width: 62%;
  }
}

.wave-bars {
  margin-top: 1rem;
  display: flex;
  gap: 0.4rem;
  align-items: flex-end;
  min-height: 46px;
}

.wave-bars span {
  width: 8px;
  border-radius: 999px;
  background: var(--gradient);
  animation: bars 1.4s ease-in-out infinite;
}

.wave-bars span:nth-child(2) {
  animation-delay: 0.1s;
}

.wave-bars span:nth-child(3) {
  animation-delay: 0.3s;
}

.wave-bars span:nth-child(4) {
  animation-delay: 0.15s;
}

.wave-bars span:nth-child(5) {
  animation-delay: 0.22s;
}

@keyframes bars {
  0%,
  100% {
    height: 16px;
  }
  50% {
    height: 46px;
  }
}

.section {
  padding: 4.8rem 0;
  max-width: 100%;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
}

.visual-grid,
.feature-grid,
.why-grid,
.support-grid {
  display: grid;
  gap: 1rem;
  max-width: 100%;
}

.visual-grid {
  margin-top: 1.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.visual-card,
.feature,
.why-card,
.support-card,
.command-book,
.invite-card {
  border-radius: 20px;
  padding: 1.1rem;
  overflow: hidden;
}

.visual-card h3 {
  margin-top: 0;
}

.liquid-orb {
  width: 120px;
  aspect-ratio: 1;
  margin: 1.2rem auto;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.1) 22%, transparent 30%),
    var(--gradient);
  animation: orbFloat 4.8s ease-in-out infinite;
  box-shadow: 0 0 35px color-mix(in srgb, var(--secondary) 35%, transparent);
}

@keyframes orbFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-12px) scale(1.04);
  }
}

.emblem-wrap {
  position: relative;
  margin: 1rem auto;
  width: 150px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  animation: rotateEmblem 12s linear infinite;
}

.emblem {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--primary) 20%, transparent);
}

.layer-1 {
  transform: rotate(22deg) translateZ(20px);
}

.layer-2 {
  transform: rotate(-26deg) translateZ(10px);
  background: color-mix(in srgb, var(--secondary) 20%, transparent);
}

.emblem.core {
  display: grid;
  place-items: center;
  inset: 28%;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient);
  color: white;
}

@keyframes rotateEmblem {
  from {
    transform: rotateY(0deg) rotateX(9deg);
  }
  to {
    transform: rotateY(360deg) rotateX(9deg);
  }
}

.neon-wave {
  margin-top: 1.2rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.36rem;
  min-height: 90px;
}

.neon-wave span {
  width: 8px;
  border-radius: 999px;
  background: var(--gradient);
  box-shadow: 0 0 20px color-mix(in srgb, var(--secondary) 40%, transparent);
  animation: bars 1.2s ease-in-out infinite;
}

.neon-wave span:nth-child(odd) {
  animation-delay: 0.14s;
}

.neon-wave span:nth-child(3n) {
  animation-delay: 0.28s;
}

.feature-grid,
.why-grid,
.support-grid {
  margin-top: 1.4rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature p,
.why-card p,
.support-card p,
.invite-card p {
  color: var(--muted);
}

.command-book {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  max-width: 100%;
}

.book-nav {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 14px;
  width: 42px;
  height: 42px;
  cursor: pointer;
}

.book-stage {
  position: relative;
  min-height: 240px;
  perspective: 1400px;
}

.book-panel {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  transform-origin: left;
  opacity: 0;
  transform: rotateY(-90deg);
  pointer-events: none;
  overflow-wrap: anywhere;
}

.book-panel.is-active {
  opacity: 1;
  transform: rotateY(0deg);
  pointer-events: auto;
  transition: transform 0.55s ease, opacity 0.35s ease;
}

.book-panel.is-leaving {
  animation: leavePage 0.5s ease forwards;
}

@keyframes leavePage {
  to {
    transform: rotateY(80deg);
    opacity: 0;
  }
}

.book-panel ul {
  margin: 0.7rem 0 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.65rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: color-mix(in srgb, var(--secondary) 90%, white);
}

.invite-section {
  padding-top: 1rem;
}

.invite-card {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.support-card {
  text-decoration: none;
  color: var(--text);
}

.footer {
  width: min(1160px, calc(100vw - 1rem));
  margin: 2rem auto;
  padding: 1.2rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
}

.footer div {
  display: inline-flex;
  gap: 0.4rem;
}

.reveal {
  opacity: 0;
  transform: translateY(26px) scale(0.98);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 767px) {
  :root {
    --fx-blur: 8px;
    --fx-shadow: 0 10px 28px rgba(3, 7, 20, 0.35);
    --fx-particle-opacity: 0.35;
  }

  .nav-links {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 2.7rem;
  }

  .visual-grid,
  .feature-grid,
  .why-grid,
  .support-grid {
    grid-template-columns: 1fr;
  }

  .page-transition {
    display: none;
  }

  .orb,
  .shine,
  .loader-core {
    animation-duration: 22s;
  }

  .wave-bars span,
  .neon-wave span,
  .progress span {
    animation-duration: 2.4s;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --fx-blur: 12px;
    --fx-shadow: 0 14px 38px rgba(3, 7, 20, 0.4);
    --fx-particle-opacity: 0.5;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .visual-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  :root {
    --fx-blur: 16px;
    --fx-shadow: 0 20px 80px rgba(3, 7, 20, 0.55);
    --fx-particle-opacity: 0.75;
  }
}

@media (max-width: 767px) {
  .site-header {
    top: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.7rem;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .command-book {
    grid-template-columns: 1fr;
  }

  .book-nav {
    width: 100%;
  }

  .hero-content h1 {
    font-size: clamp(2.2rem, 12vw, 3rem);
  }

  .tagline {
    font-size: 0.98rem;
  }
}

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