@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;700&family=Sora:wght@200;300;400;600&display=swap');

:root {
  --accent: #7dd8ff;
  --accent-2: #b98bff;
  --accent-3: #ff9ecf;
  --bg: #05060c;
  --text: #eef2fb;
  --text-dim: #93a0c2;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

#bg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

/* ---------- Loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s ease, visibility 1s ease;
}
#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-inner { text-align: center; }
.loader-ring {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  border-radius: 50%;
  border: 2px solid rgba(125, 216, 255, 0.15);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: spin 1.1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.35em;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ---------- Progress bar ---------- */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.06);
  z-index: 50;
}
#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  box-shadow: 0 0 12px rgba(125, 216, 255, 0.7);
  transition: width 0.05s linear;
}

/* ---------- Sound toggle ---------- */
#sound-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(10, 12, 24, 0.55);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
#sound-toggle:hover {
  transform: scale(1.08);
  border-color: var(--accent);
}

/* ---------- Content ---------- */
#scroll-content {
  position: relative;
  z-index: 10;
  pointer-events: none;
}

.panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 8vw;
  text-align: center;
  pointer-events: none; /* let clicks pass through to the 3D canvas below */
}
.panel.align-left { justify-content: flex-start; text-align: left; }
.panel.align-right { justify-content: flex-end; text-align: right; }

.panel-inner {
  max-width: 560px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s ease;
  pointer-events: none;
}
.panel-inner a,
.panel-inner button {
  pointer-events: auto; /* re-enable for actual interactive elements like the CTA link */
}
.panel-inner.visible {
  opacity: 1;
  transform: translateY(0);
}

.tag {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 14px;
  opacity: 0.85;
}

h1, h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  margin: 0 0 18px;
  line-height: 1.1;
}

.glow-title {
  font-size: clamp(3.5rem, 12vw, 8rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(120deg, #ffffff, var(--accent) 45%, var(--accent-2) 75%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(125, 216, 255, 0.35);
}
.glow-title.small { font-size: clamp(2rem, 6vw, 3.5rem); }

h2 { font-size: clamp(1.6rem, 4vw, 2.6rem); color: #fff; }

.subtitle {
  font-size: 1.05rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-bottom: 60px;
}

p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-dim);
  font-weight: 300;
}

.cta {
  display: inline-block;
  margin-top: 28px;
  padding: 14px 30px;
  border: 1px solid rgba(125, 216, 255, 0.4);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  transition: all 0.3s ease;
  background: rgba(125, 216, 255, 0.06);
}
.cta:hover {
  background: rgba(125, 216, 255, 0.18);
  box-shadow: 0 0 30px rgba(125, 216, 255, 0.4);
  transform: translateY(-2px);
}

/* ---------- Scroll hint ---------- */
.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  animation: fadeInOut 2.4s ease-in-out infinite;
}
.mouse {
  width: 22px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 12px;
  position: relative;
}
.wheel {
  width: 3px;
  height: 6px;
  background: var(--accent);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollWheel 1.6s ease-in-out infinite;
}
@keyframes scrollWheel {
  0% { top: 6px; opacity: 1; }
  70% { top: 18px; opacity: 0; }
  100% { top: 6px; opacity: 0; }
}
@keyframes fadeInOut {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.hint-text {
  margin-top: 10px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0.75;
}

/* ---------- Warp hold-to-charge button (Jam3 FWA100-inspired) ---------- */
#warp-hold-btn {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 30px auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(125, 216, 255, 0.05);
  border: 1px solid rgba(125, 216, 255, 0.25);
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
#warp-hold-btn:hover {
  background: rgba(125, 216, 255, 0.1);
  box-shadow: 0 0 40px rgba(125, 216, 255, 0.25);
}
#warp-hold-btn.charging {
  transform: scale(1.05);
}
#warp-hold-btn.launched {
  opacity: 0;
  transform: scale(1.6);
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.8s ease;
}
.warp-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.warp-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3;
}
.warp-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  filter: drop-shadow(0 0 6px rgba(125, 216, 255, 0.8));
  transition: stroke-dashoffset 0.05s linear;
}
.warp-btn-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--text);
  opacity: 0.85;
}
#warp-hold-btn.charging .warp-btn-label { opacity: 1; }

/* ---------- Finale overlay (revealed after warp completes) ---------- */
#finale-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(15, 22, 42, 0.75), rgba(2, 3, 8, 0.96));
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s ease, visibility 1.2s ease;
}
#finale-overlay.show {
  opacity: 1;
  visibility: visible;
}
#finale-overlay-inner {
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease 0.4s, transform 1s ease 0.4s;
}
#finale-overlay.show #finale-overlay-inner {
  opacity: 1;
  transform: translateY(0);
}
#finale-overlay p {
  margin-bottom: 30px;
}
#replay-btn {
  padding: 14px 30px;
  border: 1px solid rgba(125, 216, 255, 0.4);
  border-radius: 999px;
  background: rgba(125, 216, 255, 0.08);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.3s ease;
}
#replay-btn:hover {
  background: rgba(125, 216, 255, 0.2);
  box-shadow: 0 0 30px rgba(125, 216, 255, 0.4);
}

/* ---------- Custom glowing cursor ---------- */
body.warping #progress-bar,
body.warping #sound-toggle,
body.warping #custom-cursor {
  opacity: 0;
  transition: opacity 0.4s ease;
}

#custom-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125,216,255,0.9) 0%, rgba(125,216,255,0.25) 55%, transparent 75%);
  pointer-events: none;
  z-index: 80;
  transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease, background 0.25s ease;
  mix-blend-mode: screen;
}
#custom-cursor.hover {
  width: 46px;
  height: 46px;
  margin-left: -23px;
  margin-top: -23px;
  background: radial-gradient(circle, rgba(255,158,207,0.95) 0%, rgba(185,139,255,0.35) 55%, transparent 75%);
}
@media (hover: none) {
  #custom-cursor { display: none; }
}

/* ---------- Click-to-explore info panel ---------- */
#info-panel {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 3, 8, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#info-panel.open {
  opacity: 1;
  visibility: visible;
}
#info-panel-inner {
  position: relative;
  max-width: 460px;
  margin: 24px;
  padding: 40px 36px;
  background: linear-gradient(160deg, rgba(20, 24, 42, 0.9), rgba(10, 12, 22, 0.9));
  border: 1px solid rgba(125, 216, 255, 0.25);
  border-radius: 20px;
  box-shadow: 0 0 60px rgba(125, 216, 255, 0.15);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.4s ease;
}
#info-panel.open #info-panel-inner {
  transform: translateY(0) scale(1);
}
#info-panel-close {
  position: absolute;
  top: 16px; right: 20px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 1rem;
  transition: color 0.2s ease;
}
#info-panel-close:hover { color: var(--text); }
#info-panel-title {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  background: linear-gradient(120deg, #fff, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 14px;
}
#info-panel p {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.7;
  margin: 0;
}

@media (max-width: 720px) {
  .panel.align-left, .panel.align-right { justify-content: center; text-align: center; }
  .panel-inner { max-width: 90%; }
}
