/* ============================================
   AN HOUR OF QUANTUM — $1M Cinematic Design
   v5: Diamond → Zoom → Title. Nothing else.
   ============================================ */

:root {
  --quantum-cyan: #00FFFF;
  --interference-violet: #7B61FF;
  --void-black: #050510;
  --photon-white: #E0E0FF;
  --collapse-pink: #FF00FF;
}

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--void-black);
  color: var(--photon-white);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---- Canvas ---- */
#quantum-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ---- Hand Overlay — premium quality ---- */
.hand-overlay {
  display: none; /* hidden for now */
  position: fixed;
  bottom: 2%;
  left: 50%;
  transform: translateX(-50%);
  height: clamp(360px, 58vh, 660px);
  width: auto;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  /* Multi-layer glow: upward cyan (diamond light), ambient violet */
  filter: drop-shadow(0 -8px 20px rgba(0, 255, 255, 0.06))
          drop-shadow(0 0 30px rgba(0, 255, 255, 0.04))
          drop-shadow(0 0 60px rgba(123, 97, 255, 0.04));
  transition: none;
}

.hand-overlay svg {
  height: 100%;
  width: auto;
  display: block;
}

.hand-overlay.visible {
  opacity: 1;
}

.hand-overlay.fading {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- "Your Potential" — directly on the diamond ---- */
.potential-text {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(1.4rem, 3.4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #ffffff;
  /* no background panel — readability comes from a strong dark halo only */
  text-shadow:
    0 0 3px rgba(2, 4, 16, 0.98),
    0 0 6px rgba(2, 4, 16, 0.95),
    0 2px 14px rgba(2, 4, 16, 0.95),
    0 0 30px rgba(2, 4, 16, 0.85),
    0 0 52px rgba(0, 255, 255, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: none;
}

.potential-text.visible {
  opacity: 1;
}

.potential-text.fading {
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Screen Wash (whiteout) ---- */
.screen-wash {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  /* near-solid white that FULLY covers the screen (edges stay white, with only
     a faint cyan tint in the center) so the whiteout never reveals the scene */
  background:
    radial-gradient(circle at 50% 45%,
      rgba(224, 255, 255, 0.6) 0%,
      rgba(255, 255, 255, 0) 55%),
    #ffffff;
  opacity: 0;
  transition: none;
}

/* ---- Content Overlay ---- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.title-group {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title-accent {
  position: absolute;
  width: clamp(350px, 75vw, 900px);
  height: clamp(140px, 22vw, 280px);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(0, 255, 255, 0.12) 0%,
    rgba(123, 97, 255, 0.06) 40%,
    transparent 70%
  );
  filter: blur(50px);
  opacity: 0;
  pointer-events: none;
}

.title-accent.pulse {
  animation: accent-pulse 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes accent-pulse {
  0% { opacity: 0; }
  40% { opacity: 0.8; }
  100% { opacity: 0.5; }
}

/* ---- Title ---- */
.title-final {
  display: flex;
  align-items: baseline;
  gap: clamp(0.5rem, 1.5vw, 1.1rem);
  line-height: 1;
  white-space: nowrap;
}

.word {
  display: inline-block;
  opacity: 0;
  filter: blur(12px);
  transform: translateY(10px);
  pointer-events: none;
}

.word.materialize {
  animation: word-materialize 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  /* promote to its own layer ONLY during the blur-in (the one spot where the
     animated filter:blur is costly). Not on the base .word — that would hold
     GPU layers indefinitely and hurt on Windows. */
  will-change: filter, transform, opacity;
}

@keyframes word-materialize {
  0%   { opacity: 0; filter: blur(12px); transform: translateY(10px); }
  55%  { opacity: 0.8; filter: blur(2px); transform: translateY(2px); }
  100% { opacity: 1; filter: blur(0); transform: translateY(0); }
}

/* Thick title — Anton (Impact-style), gradient fill.
   One shared gradient across every word so the whole title reads as a single,
   uniform sweep of light (white -> cyan -> violet), matching the diamond. */
.word--an,
.word--hour,
.word--of,
.word--quantum {
  font-family: 'Anton', Impact, sans-serif;
  font-size: clamp(2.8rem, 8vw, 6.5rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  background-image: linear-gradient(180deg, #ffffff 0%, #7fdcff 52%, #b79bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* "of" is a tiny lowercase word in Anton whose o/f sit far apart — pull them
   together so it never reads as "o f". */
.word--of { letter-spacing: -0.02em; }

/* Glow lives on the line so it works with gradient (clipped) text */
.title-final {
  filter:
    drop-shadow(0 0 28px rgba(0, 255, 255, 0.28))
    drop-shadow(0 0 70px rgba(123, 97, 255, 0.18))
    drop-shadow(0 0 140px rgba(0, 255, 255, 0.08));
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  .hand-overlay, .potential-text, .screen-wash { display: none !important; }
  .word { opacity: 1 !important; filter: none !important; transform: none !important; animation: none !important; }
  .title-accent { opacity: 0.4 !important; }
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .potential-text { font-size: 1rem; letter-spacing: 0.08em; }
  .title-final { gap: 0.35rem; }
}

@media (max-width: 360px) {
  .word--an, .word--hour, .word--quantum { font-size: 2.2rem; }
}

/* ============================================
   SITE — top nav + content (revealed after intro)
   ============================================ */

/* Scrolling is locked during the intro, unlocked once the site is live */
html { scroll-behavior: smooth; }
body.site-live { overflow-y: auto; }

/* ---- Top navigation ---- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(0.9rem, 2vw, 1.4rem) clamp(1.25rem, 4vw, 3rem);
  font-family: 'DM Sans', sans-serif;
  /* Solid-ish gradient instead of backdrop-filter: live blur over the WebGL
     canvas is a real per-frame compositing cost on Windows. */
  background: linear-gradient(to bottom, rgba(5, 5, 16, 0.96), rgba(5, 5, 16, 0));
  opacity: 0;
  transform: translateY(-14px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.site-live .site-nav {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.nav-brand {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 3vw, 2.5rem);
  margin: 0;
  padding: 0;
}

.nav-item { position: relative; }

.nav-link {
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 400;
  color: rgba(224, 224, 255, 0.82);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.02em;
  padding: 0.35rem 0;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible { color: #fff; outline: none; }

/* ============================================
   PAGES — full-screen views opened from the nav
   ============================================ */
.view {
  position: fixed;
  inset: 0;
  z-index: 30;                 /* above the page, below the fixed nav (50) */
  overflow-y: auto;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(0, 255, 255, 0.06), transparent 60%),
    radial-gradient(900px 520px at 82% 118%, rgba(123, 97, 255, 0.06), transparent 60%),
    var(--void-black);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  font-family: 'DM Sans', sans-serif;
}
.view.active { opacity: 1; visibility: visible; pointer-events: auto; }

.view-inner {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(6rem, 13vh, 9rem) clamp(1.5rem, 5vw, 4rem) 5rem;
}
.view-center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.back-btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(224, 224, 255, 0.65);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0;
  margin-bottom: 1.6rem;
  transition: color 0.2s ease;
}
.back-btn:hover { color: #fff; }
.view-center .back-btn {
  position: absolute;
  top: clamp(5rem, 12vh, 7rem);  /* clear the fixed nav */
  left: 0;
  margin: 0;
}

.view-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0, 255, 255, 0.7);
  margin-bottom: 0.6rem;
}
.view-title {
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
}
.view-lead {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  color: rgba(224, 224, 255, 0.62);
  line-height: 1.6;
  max-width: 34rem;
  margin: 0 auto 0.4rem;
}

/* ---- Level cards (each with an empty media slot for a picture later) ---- */
.level-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
}
.level-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(120, 200, 255, 0.12);
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease,
              box-shadow 0.3s ease, background 0.2s ease;
}
.level-card:hover {
  transform: translateY(-4px);
  background: rgba(120, 200, 255, 0.05);
  border-color: rgba(120, 200, 255, 0.32);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(120, 200, 255, 0.08);
}
.level-card:active { transform: translateY(-1px); }

.card-media {
  display: block;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(120% 120% at 28% 18%, rgba(0, 255, 255, 0.10), transparent 55%),
    radial-gradient(120% 120% at 82% 92%, rgba(123, 97, 255, 0.13), transparent 55%),
    rgba(8, 10, 24, 0.9);
  border-bottom: 1px solid rgba(120, 200, 255, 0.1);
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.4rem 1.5rem 1.7rem;
}
.card-title { font-size: clamp(1.2rem, 2.2vw, 1.6rem); font-weight: 600; color: #fff; }
.card-text { font-size: 0.95rem; color: rgba(224, 224, 255, 0.55); line-height: 1.55; }

/* ---- "To come" card (e.g. Year Round) — corner tag, gently muted ---- */
.card-media { position: relative; }
.level-card.is-soon .card-body { opacity: 0.78; }
.card-soon-tag {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  font-family: 'Geist Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(0, 255, 255, 0.85);
  background: rgba(0, 255, 255, 0.07);
  border: 1px solid rgba(0, 255, 255, 0.28);
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
}

/* ---- Coming soon page ---- */
.soon-title {
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 1.2rem;
  background: linear-gradient(150deg, #ffffff 0%, #7fd8ff 55%, #b79bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.soon-pill {
  margin-top: 1.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0, 255, 255, 0.8);
  border: 1px solid rgba(0, 255, 255, 0.3);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
}

/* ---- Page content ---- */
.page {
  position: relative;
  z-index: 10;
  font-family: 'DM Sans', sans-serif;
}

/* transparent first screen so the intro animation shows through */
.hero { height: 100vh; }

/* lock background scroll while a full-screen page is open */
body.view-open { overflow: hidden; }

@media (max-width: 720px) {
  .level-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .nav-brand { font-size: 0.9rem; }
  .nav-links { gap: 1.1rem; }
  .nav-link { font-size: 0.92rem; }
}

/* ---- Graceful fallback: 3D couldn't boot (no WebGL / CDN blocked) ---- */
html.intro-failed #quantum-canvas { background: var(--void-black); }
html.intro-failed .word {
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
  animation: none !important;
}
html.intro-failed .potential-text,
html.intro-failed .hand-overlay,
html.intro-failed .screen-wash { display: none !important; }

/* ---- Pre-rendered intro video (fallback only) ---- */
/* Sits above the canvas (1) and intro overlays (wash = 8), below the nav (50).
   Hidden until the fallback player adds .playing; .ending fades it out to
   reveal the identical static title/site underneath. */
.intro-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--void-black);
  z-index: 60;                 /* above the nav (50) so the video fully owns the
                                  screen until it fades out at the end */
  opacity: 0;
  display: none;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.intro-video.playing { display: block; opacity: 1; }
.intro-video.ending { opacity: 0; }

/* ============================================
   SITE FLOURISHES — cursor glow, typewriter, ambient lines
   ============================================ */

/* ---- Trailing cursor glow ---- */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 460px;
  height: 460px;
  margin: -230px 0 0 -230px;     /* centre the glow on its transform origin */
  border-radius: 50%;
  pointer-events: none;
  z-index: 45;                   /* over content + views, under the nav (50) */
  opacity: 0;
  background: radial-gradient(
    circle,
    rgba(0, 255, 255, 0.10) 0%,
    rgba(123, 97, 255, 0.07) 34%,
    transparent 68%
  );
  transition: opacity 0.6s ease;
  will-change: transform;
}
/* only on the live site, and only once the pointer has actually moved */
body.site-live .cursor-glow.on { opacity: 1; }

/* ---- Typewriter caret (hero) ---- */
.hero-tagline {
  position: absolute;
  top: 100%;                     /* sits just below the title, no layout shift */
  left: 50%;
  transform: translate(-50%, 10px);
  margin-top: clamp(0.9rem, 2.6vh, 1.5rem);
  font-family: 'Geist Mono', monospace;
  font-size: clamp(0.82rem, 1.5vw, 1.05rem);
  letter-spacing: 0.01em;
  color: rgba(224, 234, 255, 0.78);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease, transform 0.9s ease;
}
body.site-live .hero-tagline { opacity: 1; transform: translate(-50%, 0); transition-delay: 0.25s; }

.tw-caret {
  display: inline-block;
  width: 0.09em;
  height: 1.05em;
  margin-left: 0.14em;
  vertical-align: -0.16em;
  background: #7fdcff;
  box-shadow: 0 0 8px rgba(127, 220, 255, 0.7);
  animation: tw-blink 1s steps(1) infinite;
}
@keyframes tw-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* ---- Ambient typed lines (faint, behind the site) ---- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 1;                    /* just above the canvas paint, behind the title */
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1.4s ease;
  font-family: 'Geist Mono', monospace;
}
body.site-live .ambient { opacity: 1; }
.ambient-line {
  position: absolute;
  font-size: clamp(0.7rem, 1.05vw, 0.92rem);
  letter-spacing: 0.06em;
  color: rgba(120, 200, 255, 0.11);
  white-space: nowrap;
}
.al-1 { top: 21%; left: 7%; }
.al-2 { top: 58%; right: 9%; }
.al-3 { bottom: 15%; left: 13%; }
.at-caret {
  display: inline-block;
  width: 0.45ch;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: rgba(120, 200, 255, 0.2);
  animation: tw-blink 1.1s steps(1) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .cursor-glow { display: none; }
  .ambient { display: none; }
  .tw-caret { animation: none; }
}

@media (max-width: 600px) {
  .ambient { display: none; }     /* keep small screens clean */
  .hero-tagline { font-size: 0.8rem; white-space: normal; max-width: 80vw; text-align: center; }
}
