/* =========================================================
   PRELOADER
   ========================================================= */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #070709;
  display: grid;
  place-items: center;
  padding: 24px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  transition:
    clip-path 0.9s cubic-bezier(0.77, 0, 0.175, 1),
    opacity 0.55s ease 0.35s,
    visibility 0.55s ease 0.35s;
}

.preloader.is-done {
  clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-frame {
  position: relative;
  width: min(440px, 86vw);
  padding: 40px 28px;
  border: 1px solid rgba(244, 241, 234, 0.10);
  background: rgba(14, 14, 18, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.preloader-logo {
  width: 210px;
  height: auto;
  opacity: 0.92;
}

.preloader-bar {
  width: 100%;
  height: 2px;
  background: rgba(244, 241, 234, 0.10);
  overflow: hidden;
}

.preloader-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--ink));
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.preloader-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-muted);
}

/* =========================================================
   FILM GRAIN OVERLAY
   ========================================================= */
.film-grain {
  position: fixed;
  inset: -40%;
  width: 180%;
  height: 180%;
  z-index: 80;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 8s steps(6) infinite;
}

@keyframes grainShift {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-2%, 1.5%); }
  40% { transform: translate(1.5%, -2%); }
  60% { transform: translate(-1.5%, -1%); }
  80% { transform: translate(2%, 1%); }
}

/* =========================================================
   CUSTOM PRECISION CURSOR
   ========================================================= */
.cursor-dot,
.cursor-ring,
.cursor-label {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 150;
  opacity: 0;
  transition: opacity 0.25s ease;
}

body.has-custom-cursor .cursor-dot,
body.has-custom-cursor .cursor-ring,
body.has-custom-cursor .cursor-label {
  opacity: 1;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  margin-left: -3px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--gold);
}

.cursor-ring {
  width: 34px;
  height: 34px;
  margin-left: -17px;
  margin-top: -17px;
  border-radius: 50%;
  border: 1px solid rgba(244, 241, 234, 0.42);
  transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease, border-color 0.25s ease, background-color 0.25s ease, opacity 0.25s ease;
}

.cursor-ring.is-hover {
  width: 56px;
  height: 56px;
  margin-left: -28px;
  margin-top: -28px;
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}

.cursor-label {
  margin-left: 24px;
  margin-top: -10px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--gold);
  color: #09090B;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  opacity: 0 !important;
  transform: scale(0.9);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cursor-label.is-visible {
  opacity: 1 !important;
  transform: scale(1);
}

@media (hover: none), (pointer: coarse) {
  .cursor-dot,
  .cursor-ring,
  .cursor-label {
    display: none !important;
  }
}

/* =========================================================
   LOGO CALLIGRAPHIC WIPE & GOLD SHEEN
   ========================================================= */
.hero-logo-crisp.is-revealed {
  opacity: 1;
  animation: inkReveal 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-logo-sheen.is-sweeping {
  animation: goldSweep 1.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes inkReveal {
  0% {
    opacity: 0.2;
    clip-path: polygon(0 100%, 0 100%, 0 0, 0 0);
  }
  100% {
    opacity: 1;
    clip-path: polygon(0 100%, 115% 100%, 100% 0, 0 0);
  }
}

@keyframes goldSweep {
  0% {
    opacity: 0;
    clip-path: polygon(-25% 0%, -5% 0%, -20% 100%, -40% 100%);
  }
  20% {
    opacity: 0.95;
  }
  80% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    clip-path: polygon(110% 0%, 135% 0%, 120% 100%, 95% 100%);
  }
}

/* =========================================================
   MARQUEE, EQUALIZER, SCROLL CUE & HALO ANIMATIONS
   ========================================================= */
.marquee-track {
  animation: marqueeScroll 28s linear infinite;
}

.marquee-ribbon:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.bgm-toggle.is-playing .eq-bar:nth-child(1) { animation: eqBar 0.7s ease-in-out infinite alternate; }
.bgm-toggle.is-playing .eq-bar:nth-child(2) { animation: eqBar 0.55s ease-in-out 0.15s infinite alternate; }
.bgm-toggle.is-playing .eq-bar:nth-child(3) { animation: eqBar 0.85s ease-in-out 0.3s infinite alternate; }
.bgm-toggle.is-playing .eq-bar:nth-child(4) { animation: eqBar 0.65s ease-in-out 0.1s infinite alternate; }

@keyframes eqBar {
  0% { height: 3px; }
  100% { height: 12px; }
}

.scroll-cue-line {
  animation: scrollLine 2.1s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes scrollLine {
  0% { transform: translateY(-100%); }
  60% { transform: translateY(200%); }
  100% { transform: translateY(200%); }
}

.altar-halo {
  animation: haloBreath 4.6s ease-in-out infinite;
}

@keyframes haloBreath {
  0%, 100% { transform: scale(0.95); opacity: 0.75; }
  50% { transform: scale(1.08); opacity: 1; }
}

.btn-tribute-count.is-pop {
  animation: countPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes countPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* =========================================================
   MASK REVEAL HELPERS (Visible by default; GSAP animates)
   ========================================================= */
.reveal-clip {
  overflow: hidden;
}

.reveal-line {
  display: block;
  opacity: 1;
  transform: none;
  will-change: transform, opacity;
}

/* =========================================================
   REDUCED MOTION SUPPORT
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .film-grain,
  .marquee-track,
  .scroll-cue-line,
  .altar-halo,
  .bgm-toggle.is-playing .eq-bar {
    animation: none !important;
  }

  .hero-logo-crisp {
    opacity: 1 !important;
    clip-path: none !important;
  }

  .hero-logo-sheen {
    display: none !important;
  }
}
