/* ═══════════════════════════════════════════════════
   GoNukkad Growth Control Room — custom styles & motion
   ═══════════════════════════════════════════════════ */

:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-fluid: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: smooth; }
body { font-feature-settings: "ss01", "cv01"; }

/* Material symbols default */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

[data-page-id].hidden,
.step-row.hidden,
.dash-view.hidden,
.dash-tab.hidden {
  display: none !important;
}

::selection { background: #f27476; color: #fff; }

/* custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #FBF8F5; }
::-webkit-scrollbar-thumb { background: #ddc0bf; border-radius: 8px; border: 2px solid #FBF8F5; }
::-webkit-scrollbar-thumb:hover { background: #c9a3a2; }

/* ═══════ REVEAL SYSTEM ═══════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out-expo), transform 0.9s var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.001s !important; }
}

/* ═══════ GLASS CARD ═══════ */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

/* ═══════ LEAK CARDS ═══════ */
.leak-card { animation: none; }
.leak-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(242,116,118,0.08), transparent 45%);
  opacity: 0;
  transition: opacity 0.5s var(--ease-fluid);
  pointer-events: none;
}
.leak-card:hover::after { opacity: 1; }

/* ═══════ STEPPER ═══════ */
.step-row:hover { background: var(--surface-container, #fee9e8); }
.step-row[data-active="true"] {
  background: #fff;
  box-shadow: 0 12px 32px -14px rgba(164, 57, 62, 0.25);
  border: 1px solid rgba(242, 116, 118, 0.45);
}

/* ═══════ SPARK LINE (hero mini chart) ═══════ */
.spark-line, .gline-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.spark-line.is-drawn, .gline-line.is-drawn {
  animation: drawLine 1.8s var(--ease-fluid) forwards;
}
.spark-fill, .gline-fill {
  transition: opacity 1.2s ease 0.6s;
}
@keyframes drawLine { to { stroke-dashoffset: 0; } }

/* ═══════ HEATMAP MARKERS ═══════ */
.heat-marker {
  position: absolute;
  z-index: 2;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
  transition: opacity 0.6s var(--ease-spring), transform 0.6s var(--ease-spring);
}
.heat-marker.is-in {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.heat-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 9999px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.heat-pin {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.95), 0 2px 6px rgba(0, 0, 0, 0.25);
}
.heat-name {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  color: #574241;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 9999px;
  padding: 2px 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.heat-name.up { bottom: calc(100% + var(--pill-gap, 13px)); }
.heat-name.down { top: calc(100% + var(--pill-gap, 13px)); }

/* ═══════ BAR FILLS / DONUT ═══════ */
.bar-fill {
  width: 0 !important;
  transition: width 1.4s var(--ease-out-expo);
}
.bar-fill.is-drawn { width: var(--w) !important; }
.donut { transition: stroke-dashoffset 1.6s var(--ease-out-expo); }

/* ═══════ DASHBOARD VIEWS ═══════ */
.dash-view { transition: opacity 0.4s ease; }
.dash-view.swapping { opacity: 0; }
.dash-enter { animation: dashEnter 0.55s var(--ease-out-expo); }
@keyframes dashEnter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════ HERO TILT ═══════ */
#hero-stage {
  transition: transform 0.35s var(--ease-out-expo);
  transform-style: preserve-3d;
}

/* ═══════ NAV ═══════ */
#nav.scrolled .mt-4 > div {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 40px -16px rgba(36, 25, 25, 0.18);
}

/* ═══════ PHASE DOTS pulse ═══════ */
.phase-card:hover .phase-dot { transform: scale(1.15); }
.phase-dot { transition: transform 0.3s var(--ease-spring); }

/* marquee pause on hover */
.marquee-anim:hover > div { animation-play-state: paused; }

/* ═══════ FILM GRAIN (whole page) ═══════ */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 70;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' 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 0.9s steps(4) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -2%); }
  75% { transform: translate(-3%, -3%); }
  100% { transform: translate(2%, 2%); }
}

/* ═══════ HERO WORD REVEAL ═══════ */
.wr-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(115%) rotate(3deg);
  transition: opacity 0.7s var(--ease-spring), transform 0.8s var(--ease-spring);
  transition-delay: var(--wd, 0s);
  will-change: transform, opacity;
}
#hero-title.play .wr-word {
  opacity: 1;
  transform: translateY(0) rotate(0);
}
#hero-title { text-shadow: 0 2px 34px rgba(0, 0, 0, 0.4); }

/* ═══════ SCROLL CUE (playagrande-style) ═══════ */
.scroll-cue {
  width: 1.5px;
  height: 54px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
  position: relative;
  display: block;
}
.scroll-cue::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 55%;
  background: linear-gradient(to bottom, transparent, #f27476);
  animation: scrollLine 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes scrollLine {
  0% { top: -100%; }
  60% { top: 110%; }
  100% { top: 110%; }
}

/* ═══════ SHINE SWEEP ON PRIMARY BUTTONS ═══════ */
.btn-shine { position: relative; overflow: hidden; isolation: isolate; }
.btn-shine::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-18deg);
  animation: shineSweep 3.2s var(--ease-fluid) infinite;
  z-index: 1;
}
.btn-shine > * { position: relative; z-index: 2; }
@keyframes shineSweep {
  0% { left: -60%; }
  55% { left: 130%; }
  100% { left: 130%; }
}

/* ═══════ AURORA BACKGROUND (final CTA) ═══════ */
.aurora-bg {
  background: conic-gradient(from 0deg,
    rgba(242, 116, 118, 0.16),
    rgba(210, 224, 254, 0.30),
    rgba(50, 170, 184, 0.16),
    rgba(255, 218, 216, 0.26),
    rgba(242, 116, 118, 0.16));
  filter: blur(50px);
  animation: auroraSpin 26s linear infinite;
}
@keyframes auroraSpin { to { transform: translate(-50%, -50%) rotate(360deg) scale(1.1); } }

/* ═══════ VIDEO HERO ═══════ */
#hero-video {
  object-fit: cover;
  filter: saturate(1.1);
}
@media (prefers-reduced-motion: reduce) {
  #hero-video { display: none; }
}

/* ═══════ YOUTUBE BACKGROUND (cover-scaling) ═══════
   Note: YT.Player REPLACES the #yt-bg div with the iframe,
   so this styles the iframe directly (it inherits the id). */
#yt-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw;        /* 16:9 */
  min-height: 100vh;
  min-width: 177.78vh;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}
