/* ===========================
   ZETA - Design System
   =========================== */
:root {
  --bg: #0a0711;
  --bg-deep: #06040b;
  --bg-surface: #120d1f;
  --bg-surface-2: #18122a;
  --line: rgba(168, 130, 255, 0.16);
  --line-strong: rgba(168, 130, 255, 0.38);
  --text: #f5f1ff;
  --text-muted: #b8b0cc;
  --text-dim: #7e7694;
  --purple: #8b5cf6;
  --purple-bright: #a78bfa;
  --purple-glow: #7c3aed;
  --magenta: #c084fc;
  --cyan: #67e8f9;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-display: 'Oxanium', system-ui, -apple-system, sans-serif;
  --font-body: 'Space Grotesk', system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

p, h1, h2, h3, h4 {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

code, pre {
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
}

/* Background canvas */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* Ambient glows */
.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}
.ambient-a {
  width: 520px;
  height: 520px;
  top: -100px;
  left: -80px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.55) 0%, transparent 70%);
}
.ambient-b {
  width: 620px;
  height: 620px;
  bottom: 10%;
  right: -120px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.35) 0%, rgba(56, 30, 114, 0.2) 40%, transparent 70%);
}

/* ===========================
   NAV
   =========================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: rgba(10, 7, 17, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(168, 130, 255, 0.06);
  transition: background var(--transition), padding var(--transition);
}
.nav.scrolled {
  background: rgba(10, 7, 17, 0.82);
  padding: 14px 40px;
  border-bottom-color: rgba(168, 130, 255, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  position: relative;
  z-index: 5;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.28), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: var(--purple-bright);
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.25);
}
.brand-mark.small {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: color var(--transition);
  letter-spacing: 0.01em;
}
.nav-links a:hover {
  color: var(--text);
}
.nav-cta {
  padding: 10px 20px !important;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.14) !important;
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: var(--purple-bright) !important;
  font-weight: 500;
  transition: all var(--transition) !important;
}
.nav-cta:hover {
  background: rgba(139, 92, 246, 0.26) !important;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.25);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid rgba(167, 139, 250, 0.25);
  background: rgba(139, 92, 246, 0.08);
  position: relative;
  z-index: 5;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--purple-bright);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ===========================
   HERO
   =========================== */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 32px;
  padding: 140px 40px 72px;
  max-width: 1320px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  color: var(--purple-bright);
  margin-bottom: 24px;
  text-transform: uppercase;
}
.eyebrow-line {
  display: inline-block;
  width: 32px;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), transparent);
  border-radius: 2px;
  flex-shrink: 0;
}
.eyebrow-center .eyebrow-line:last-child {
  background: linear-gradient(90deg, transparent, var(--purple));
}

.hero-title {
  font-family: var(--font-display);
  line-height: 0.92;
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}
.title-top {
  display: block;
  font-size: clamp(1.1rem, 2.2vw, 1.7rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.title-main {
  display: block;
  font-size: clamp(4.2rem, 9.5vw, 8.4rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #faf7ff;
  text-shadow:
    0 0 40px rgba(139, 92, 246, 0.35),
    0 0 120px rgba(124, 58, 237, 0.18);
}
.title-accent {
  color: var(--purple-bright);
}
.title-sub {
  display: block;
  font-size: clamp(1.4rem, 3.2vw, 2.8rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #d8d0ea;
  margin-top: 14px;
}

.hero-lead {
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 580px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 12px;
  font-size: 0.96rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(180deg, #9a6cf8 0%, #7c3aed 100%);
  color: #fff;
  box-shadow:
    0 4px 24px rgba(124, 58, 237, 0.4),
    0 0 0 1px rgba(196, 167, 255, 0.28) inset;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 36px rgba(124, 58, 237, 0.55),
    0 0 0 1px rgba(216, 196, 255, 0.4) inset;
  filter: brightness(1.06);
}
.btn-ghost {
  background: rgba(139, 92, 246, 0.06);
  color: #e6deff;
  border-color: rgba(167, 139, 250, 0.28);
}
.btn-ghost:hover {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(167, 139, 250, 0.5);
  transform: translateY(-2px);
}
.btn-lg {
  padding: 17px 36px;
  font-size: 1.02rem;
}

/* Hero stats */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 28px;
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #f2ecff;
  letter-spacing: 0.02em;
}
.stat-label {
  font-size: 0.88rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.stat-divider {
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, transparent, rgba(167, 139, 250, 0.4), transparent);
}

/* ===========================
   MARQUEE
   =========================== */
.marquee {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(167, 139, 250, 0.14);
  border-bottom: 1px solid rgba(167, 139, 250, 0.14);
  background: rgba(20, 14, 35, 0.6);
  padding: 18px 0;
  overflow: hidden;
  backdrop-filter: blur(6px);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 28px;
  width: max-content;
  animation: marquee 28s linear infinite;
  padding: 0 20px;
}
.marquee-track span {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #cfc3eb;
  white-space: nowrap;
}
.marquee-track .star {
  color: var(--purple-bright);
  font-size: 0.7rem;
  letter-spacing: 0;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===========================
   SECTIONS
   =========================== */
.section {
  position: relative;
  z-index: 2;
  max-width: 1320px;
  margin: 0 auto;
  padding: 96px 40px;
}

.section-head {
  margin-bottom: 48px;
  max-width: 720px;
}
.section-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  max-width: none;
}
.section-head-row .section-lead {
  max-width: 420px;
  margin-bottom: 6px;
  text-align: right;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.8vw, 3.6rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
  color: #f6f2ff;
}
.text-gradient {
  background: linear-gradient(135deg, #c4a5ff 0%, #8b5cf6 50%, #d19fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-lead {
  color: var(--text-muted);
  font-size: 1.04rem;
  line-height: 1.8;
  max-width: 620px;
}

/* ===========================
   FEATURES
   =========================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.feature-card {
  background: linear-gradient(180deg, rgba(30, 22, 52, 0.72) 0%, rgba(18, 13, 32, 0.78) 100%);
  border: 1px solid rgba(167, 139, 250, 0.14);
  border-radius: 20px;
  padding: 30px 26px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple-bright), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.feature-card:hover {
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 16px 40px rgba(0,0,0,0.25), 0 0 60px rgba(124, 58, 237, 0.08);
}
.feature-card:hover::before {
  opacity: 1;
}
.feature-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.22);
  color: var(--purple-bright);
  margin-bottom: 22px;
}
.feature-card h3 {
  font-size: 1.16rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #f3eeff;
  letter-spacing: 0.01em;
}
.feature-card p {
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.75;
  margin-bottom: 18px;
}
.feature-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #cdb8ff;
  padding: 6px 10px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.16);
  border-radius: 6px;
  font-family: ui-monospace, Consolas, monospace;
}

/* ===========================
   ABOUT
   =========================== */
.about {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 56px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 72px;
}
.about-image-frame {
  position: relative;
  border-radius: 24px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(36, 26, 62, 0.7), rgba(16, 11, 28, 0.8));
  border: 1px solid rgba(167, 139, 250, 0.22);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}
.about-image-glow {
  position: absolute;
  inset: 15%;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.35), transparent 70%);
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
}
.about-image {
  position: relative;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(167, 139, 250, 0.15);
  display: block;
  z-index: 1;
}
.about-image-caption {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 4px 4px;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #bda8e8;
}
.caption-dot {
  width: 7px;
  height: 7px;
  background: var(--purple-bright);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--purple-bright);
}

.about-copy .section-title {
  margin-bottom: 20px;
}
.about-text {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.9;
  margin-bottom: 26px;
  max-width: 600px;
}

/* code card */
.code-card {
  background: #100c1b;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 26px;
  max-width: 560px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.code-card-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: rgba(139, 92, 246, 0.06);
  border-bottom: 1px solid rgba(167, 139, 250, 0.12);
}
.code-card-file {
  margin-left: 10px;
  font-size: 0.74rem;
  color: #8a7fa6;
  font-family: ui-monospace, Consolas, monospace;
}
.code-card-body {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  font-size: 0.92rem;
  line-height: 1.7;
  color: #e7defc;
}
.c-fn { color: #c4b5fd; }
.c-method { color: #93c5fd; }
.c-str { color: #a7f3d0; }

.about-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pill {
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.2);
  color: #ddd2f7;
  font-size: 0.82rem;
  font-weight: 500;
}

/* ===========================
   COMMANDS
   =========================== */
.commands-wrap {
  background: linear-gradient(180deg, rgba(26, 19, 45, 0.7), rgba(14, 10, 24, 0.8));
  border: 1px solid rgba(167, 139, 250, 0.16);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.command-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 160px;
  gap: 20px;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid rgba(167, 139, 250, 0.1);
  transition: background var(--transition);
}
.command-row:last-child {
  border-bottom: none;
}
.command-row:hover {
  background: rgba(139, 92, 246, 0.06);
}
.command-name {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.96rem;
  font-weight: 600;
  color: #efe9ff;
}
.prompt {
  color: var(--purple-bright);
}
.command-desc {
  color: var(--text-muted);
  font-size: 0.94rem;
}
.command-alias {
  text-align: right;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8rem;
  color: #8f84a8;
}
.inline-code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9em;
  padding: 2px 7px;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 6px;
  color: #dbcfff;
}

/* ===========================
   CTA
   =========================== */
.cta-section {
  position: relative;
  z-index: 2;
  padding: 56px 40px 100px;
}
.cta-inner {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 72px 40px;
  text-align: center;
  background: linear-gradient(180deg, rgba(36, 24, 66, 0.75) 0%, rgba(18, 12, 32, 0.85) 100%);
  border: 1px solid rgba(167, 139, 250, 0.24);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
}
.cta-glow {
  position: absolute;
  width: 520px;
  height: 320px;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.45) 0%, transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}
.cta-title {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: 16px;
  color: #f8f5ff;
}
.cta-text {
  position: relative;
  color: var(--text-muted);
  font-size: 1.06rem;
  margin-bottom: 32px;
}
.cta-inner .btn {
  position: relative;
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 40px 44px;
  max-width: 1320px;
  margin: 0 auto;
  border-top: 1px solid rgba(167, 139, 250, 0.12);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-brand .brand-name {
  font-size: 1.05rem;
}
.footer-copy {
  color: #8a829f;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
}
.footer-links a {
  color: #bfb5d6;
  transition: color var(--transition);
}
.footer-links a:hover {
  color: #efe8ff;
}

/* ===========================
   REVEAL ANIMATIONS (3D)
   Hidden only when JS runs (html.js), so the page is never blank.
   =========================== */
.js .reveal {
  opacity: 0;
  transform: perspective(1000px) translate3d(0, 46px, -60px) rotateX(16deg);
  transition: opacity 0.9s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.js .reveal.visible {
  opacity: 1;
  transform: perspective(1000px) translate3d(0, 0, 0) rotateX(0);
}
/* stagger for grids */
.feature-card.reveal:nth-child(2) { transition-delay: 0.08s; }
.feature-card.reveal:nth-child(3) { transition-delay: 0.16s; }
.feature-card.reveal:nth-child(4) { transition-delay: 0.24s; }
.hero-copy .reveal:nth-child(1) { transition-delay: 0.05s; }
.hero-copy .reveal:nth-child(2) { transition-delay: 0.12s; }
.hero-copy .reveal:nth-child(3) { transition-delay: 0.2s; }
.hero-copy .reveal:nth-child(4) { transition-delay: 0.28s; }
.hero-copy .reveal:nth-child(5) { transition-delay: 0.36s; }
.hero-visual.reveal { transition-delay: 0.2s; }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1120px) {
  .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero {
    grid-template-columns: 1fr;
    padding-top: 130px;
    gap: 20px;
    min-height: auto;
  }
  .hero-copy {
    max-width: 760px;
  }
  .hero-visual {
    justify-content: flex-start;
    padding: 20px 0 0;
  }
  .stage { width: min(520px, 100%); }
  .chip-a { left: 0; }
  .chip-b { right: 0; }
  .about {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .about-media {
    max-width: 640px;
  }
}

@media (max-width: 800px) {
  .nav {
    padding: 16px 22px;
  }
  .nav.scrolled {
    padding: 12px 22px;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 16px;
    background: rgba(16, 11, 28, 0.96);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
    display: none;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 12px 10px;
  }
  .nav-cta {
    text-align: center;
    margin-top: 6px;
  }

  .hero {
    padding: 120px 22px 56px;
  }
  .section {
    padding: 72px 22px;
  }
  .section-head-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .section-head-row .section-lead {
    text-align: left;
    max-width: none;
  }
  .command-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 18px 20px;
  }
  .command-alias {
    text-align: left;
  }
  .cta-section {
    padding: 40px 22px 72px;
  }
  .cta-inner {
    padding: 52px 24px;
  }
  .footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 22px 40px;
  }
  .hero-stats {
    gap: 20px;
  }
}

@media (max-width: 560px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
  .title-top {
    letter-spacing: 0.2em;
  }
  .title-sub {
    letter-spacing: 0.12em;
  }
  .hero-lead {
    font-size: 1rem;
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .float-chip {
    display: none;
  }
  .now-playing { left: 4%; right: 4%; }
  .hero-stats {
    flex-wrap: wrap;
    gap: 16px 24px;
  }
  .stat-divider { display: none; }
  .marquee-track span {
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .marquee-track,
  .np-eq i,
  .np-bar-fill,
  .hud-corner,
  .live-dot,
  .float-chip {
    animation: none;
  }
  .btn, .feature-card, .nav-links a {
    transition: none;
  }
}

/* ===========================
   3D LAYER — stage, now playing, tilt, HUD
   =========================== */
/* Without WebGL the canvas falls back to 2D particles; .webgl just raises its opacity a touch */
#bg-canvas { opacity: 0; transition: opacity 1.2s ease; }
#bg-canvas.ready { opacity: 1; }

.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--purple), var(--magenta), var(--cyan));
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.8);
  z-index: 200;
  pointer-events: none;
}

.cursor-glow {
  position: fixed;
  left: 0; top: 0;
  width: 520px; height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.13), transparent 60%);
  pointer-events: none;
  z-index: 1;
  transform: translate3d(var(--cx, -999px), var(--cy, -999px), 0);
  opacity: 0;
  transition: opacity 0.6s ease;
}
.cursor-glow.on { opacity: 1; }
@media (pointer: coarse) { .cursor-glow { display: none; } }

/* Hero stage: empty square the WebGL core is drawn behind */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.stage {
  position: relative;
  width: min(500px, 100%);
  aspect-ratio: 1 / 1;
  perspective: 1200px;
  transform-style: preserve-3d;
}
.stage-hud { position: absolute; inset: 0; pointer-events: none; }
.hud-corner {
  position: absolute;
  width: 26px; height: 26px;
  border: 0 solid rgba(167, 139, 250, 0.45);
  animation: hudPulse 3.2s ease-in-out infinite;
}
.hud-corner.tl { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 8px; }
.hud-corner.tr { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 8px; }
.hud-corner.bl { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 8px; }
.hud-corner.br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 8px; }
@keyframes hudPulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }

/* Live badge (used in now playing) */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px #4ade80;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

/* Floating chips (3D depth) */
.float-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(22, 16, 38, 0.72);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  font-size: 0.84rem;
  font-weight: 500;
  color: #efeaff;
  white-space: nowrap;
  z-index: 5;
}
.chip-icon {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.2);
  color: var(--purple-bright);
  font-size: 0.9rem;
}
.chip-a { top: 9%; left: -30px; animation: floatY 5s ease-in-out infinite; }
.chip-b { top: 46%; right: -34px; animation: floatY 5.5s ease-in-out infinite 0.8s; }
@keyframes floatY {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}

/* Now playing glass card */
.now-playing {
  position: absolute;
  left: 8%; right: 8%;
  bottom: -4%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(40, 28, 72, 0.72), rgba(16, 11, 30, 0.78));
  border: 1px solid rgba(167, 139, 250, 0.34);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 60px rgba(124, 58, 237, 0.25);
  overflow: hidden;
  z-index: 6;
}
.np-art {
  width: 78px; height: 78px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(167, 139, 250, 0.35);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.45);
  transform: translateZ(30px);
}
.np-body { flex: 1; min-width: 0; transform: translateZ(20px); }
.np-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.np-label { font-size: 0.62rem; letter-spacing: 0.2em; font-weight: 700; color: var(--purple-bright); }
.np-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: #f3eeff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 10px;
}
.np-bar { height: 4px; border-radius: 4px; background: rgba(167, 139, 250, 0.16); overflow: hidden; margin-bottom: 8px; }
.np-bar-fill {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--purple), var(--magenta), var(--cyan));
  animation: progress 24s linear infinite;
}
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.np-meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.74rem; color: var(--text-dim); font-family: ui-monospace, Consolas, monospace; }
.np-eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 14px; }
.np-eq i {
  width: 3px; height: 100%;
  border-radius: 2px;
  background: var(--purple-bright);
  transform-origin: 50% 100%;
  animation: eq 0.9s ease-in-out infinite alternate;
}
.np-eq i:nth-child(2) { animation-delay: -0.3s; animation-duration: 0.7s; }
.np-eq i:nth-child(3) { animation-delay: -0.6s; animation-duration: 1.1s; }
.np-eq i:nth-child(4) { animation-delay: -0.15s; animation-duration: 0.8s; }
.np-eq i:nth-child(5) { animation-delay: -0.45s; animation-duration: 0.95s; }
@keyframes eq { from { transform: scaleY(0.2); } to { transform: scaleY(1); } }

/* ---------- Pointer tilt (driven by script.js via --rx/--ry/--gx/--gy) ---------- */
.tilt {
  transform-style: preserve-3d;
  will-change: transform;
}
.now-playing.tilt,
.about-image-frame.tilt,
.js .reveal.visible.tilt {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(var(--lift, 0px));
}
.tilt.tilt-ready { transition: transform 0.18s ease-out, border-color var(--transition), box-shadow var(--transition); }
.card-glare,
.np-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.14), rgba(196, 167, 255, 0.05) 30%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}
.tilt:hover .card-glare,
.tilt:hover .np-glare { opacity: 1; }
.feature-card { transform-style: preserve-3d; }
.feature-card > *:not(.card-glare) { position: relative; z-index: 1; }
.feature-card .feature-icon { transform: translateZ(40px); }
.feature-card h3 { transform: translateZ(26px); }
.feature-card .feature-tag { transform: translateZ(18px); }
.feature-card:hover .feature-icon {
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.45);
  border-color: rgba(196, 167, 255, 0.5);
}
.about-image-frame .about-image { transform: translateZ(24px); }
.about-image-frame .about-image-caption { transform: translateZ(36px); }
.cta-inner > * { transform: translateZ(30px); }

/* Marquee tilted into 3D space */
.marquee {
  transform: perspective(900px) rotateX(10deg) rotateZ(-1.5deg) scale(1.04);
  box-shadow: 0 20px 60px rgba(124, 58, 237, 0.15);
}

/* Command rows lift toward the viewer */
.commands-wrap { perspective: 1000px; }
.command-row { transition: background var(--transition), transform var(--transition); }
.command-row:hover { transform: translateZ(14px) translateX(6px); }

@media (max-width: 1120px) {
  .hero-visual { justify-content: center; padding-top: 10px; padding-bottom: 40px; }
}
@media (max-width: 560px) {
  .marquee { transform: none; }
  .np-art { width: 60px; height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .float-chip, .hud-corner, .live-dot { animation: none; }
  .tilt { transform: none !important; }
}
@media (max-width: 560px) {
  .float-chip { display: none; }
  .now-playing { bottom: -14%; }
  .hero-visual { padding-bottom: 70px; }
}
