/* ==========================================================================
   Modern Royal Gold — Happy Diwali TV Experience
   Designed for 16:9 HD / 4K Smart TVs, HDMI Displays & Ambient Projection
   ========================================================================== */

:root {
  --bg-zenith: #030613;
  --bg-mid: #081029;
  --bg-royal: #0e1738;
  --bg-horizon: #1b1328;

  --gold-ivory: #fff5d6;
  --gold-bright: #ffe08a;
  --gold-24k: #f5b942;
  --gold-rich: #d4942a;
  --gold-antique: #996515;

  --safe-x: clamp(24px, 3.4vw, 72px);
  --safe-y: clamp(20px, 3.6vh, 56px);
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-zenith);
  color: var(--gold-ivory);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

body.is-idle,
body.is-idle * {
  cursor: none !important;
}

/* --------------------------------------------------------------------------
   Layer 1: Deep Royal Midnight Sky Backdrop
   -------------------------------------------------------------------------- */
.sky-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    #030510 0%,
    #060c21 28%,
    #0b1433 58%,
    #141634 80%,
    #1f1529 94%,
    #120c18 100%
  );
  pointer-events: none;
}

.sky-nebula {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse 58% 46% at 50% 44%, rgba(245, 185, 66, 0.085) 0%, rgba(180, 118, 28, 0.03) 45%, transparent 75%),
    radial-gradient(ellipse 45% 35% at 22% 28%, rgba(44, 72, 158, 0.16) 0%, transparent 70%),
    radial-gradient(ellipse 45% 35% at 78% 30%, rgba(68, 42, 125, 0.14) 0%, transparent 70%);
  animation: nebulaBreath 14s ease-in-out infinite alternate;
}

.horizon-glow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36vh;
  background: radial-gradient(
    ellipse 75% 85% at 50% 100%,
    rgba(245, 168, 52, 0.19) 0%,
    rgba(196, 110, 28, 0.08) 42%,
    transparent 78%
  );
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 82% 78% at 50% 48%,
    transparent 52%,
    rgba(2, 4, 12, 0.62) 100%
  );
}

@keyframes nebulaBreath {
  0% {
    opacity: 0.85;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1.04);
  }
}

/* --------------------------------------------------------------------------
   Layer 2: High-DPI Scene Canvas (Stars, Fireworks, Bokeh, Diyas, Reflections)
   -------------------------------------------------------------------------- */
#scene-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Layer 3: Sacred Royal Gold Filigree Mandala
   -------------------------------------------------------------------------- */
.mandala-stage {
  position: fixed;
  left: 50%;
  top: 44.5%;
  transform: translate(-50%, -50%);
  width: min(62vmin, 640px);
  height: min(62vmin, 640px);
  z-index: 3;
  pointer-events: none;
  display: grid;
  place-items: center;
  opacity: 0.56;
  animation: mandalaPulse 9s ease-in-out infinite alternate;
}

.mandala {
  grid-area: 1 / 1;
  will-change: transform;
}

.mandala-outer {
  width: 100%;
  height: 100%;
  animation: spinClockwise 150s linear infinite;
}

.mandala-inner {
  width: 68%;
  height: 68%;
  animation: spinCounterClockwise 110s linear infinite;
}

@keyframes spinClockwise {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes spinCounterClockwise {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

@keyframes mandalaPulse {
  0% {
    opacity: 0.44;
    filter: drop-shadow(0 0 12px rgba(245, 185, 66, 0.12));
  }
  100% {
    opacity: 0.66;
    filter: drop-shadow(0 0 26px rgba(245, 185, 66, 0.25));
  }
}

/* --------------------------------------------------------------------------
   Layer 4: Architectural Royal Gold TV Safe-Zone Frame
   -------------------------------------------------------------------------- */
.royal-frame {
  position: fixed;
  inset: var(--safe-y) var(--safe-x);
  z-index: 4;
  pointer-events: none;
  color: rgba(245, 193, 86, 0.62);
}

.frame-border {
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(245, 193, 86, 0.16);
  border-radius: 8px;
  box-shadow: inset 0 0 40px rgba(245, 185, 66, 0.03);
}

.corner {
  position: absolute;
  width: clamp(46px, 5.2vmin, 78px);
  height: clamp(46px, 5.2vmin, 78px);
  filter: drop-shadow(0 0 8px rgba(245, 185, 66, 0.25));
}

.corner-tl {
  top: 0;
  left: 0;
}

.corner-tr {
  top: 0;
  right: 0;
  transform: scaleX(-1);
}

.corner-bl {
  bottom: 0;
  left: 0;
  transform: scaleY(-1);
}

.corner-br {
  bottom: 0;
  right: 0;
  transform: scale(-1, -1);
}

/* --------------------------------------------------------------------------
   Layer 5: Centerpiece English Typography Stage
   -------------------------------------------------------------------------- */
.greeting-stage {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--safe-y) clamp(32px, 8vw, 160px) clamp(110px, 16vh, 195px);
  text-align: center;
  pointer-events: none;
}

.greeting-halo {
  position: absolute;
  width: min(74vw, 960px);
  height: min(42vh, 380px);
  background: radial-gradient(
    ellipse at center,
    rgba(6, 11, 28, 0.62) 0%,
    rgba(6, 11, 28, 0.34) 46%,
    transparent 76%
  );
  z-index: -1;
  border-radius: 50%;
}

/* Overline / Eyebrow */
.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.3vw, 20px);
  margin-bottom: clamp(10px, 1.8vh, 22px);
  animation: fadeRise 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.eyebrow-label {
  font-size: clamp(0.72rem, 1.15vmin + 0.32rem, 1.18rem);
  font-weight: 500;
  letter-spacing: 0.42em;
  padding-left: 0.42em; /* Optical balance for letter-spacing */
  color: rgba(255, 236, 184, 0.9);
  text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75);
}

.ornament-line {
  width: clamp(36px, 6.5vw, 110px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 193, 86, 0.8));
}

.ornament-line.right {
  background: linear-gradient(270deg, transparent, rgba(245, 193, 86, 0.8));
}

.diamond {
  width: 6px;
  height: 6px;
  background: var(--gold-bright);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(255, 218, 120, 0.8);
}

/* Hero Title — Liquid 24K Gold Display Serif */
.hero-title-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  animation: fadeRise 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.hero-title,
.hero-title-glow {
  grid-area: 1 / 1;
  font-family: 'Cinzel Decorative', 'Cormorant Garamond', 'Didot', 'Bodoni MT', 'Times New Roman', serif;
  font-weight: 700;
  font-size: clamp(2.8rem, 7.6vmin + 1rem, 7.4rem);
  line-height: 1.08;
  letter-spacing: 0.03em;
  padding: 0.06em 0.15em;
}

/* Crisp 3D Shadow & Warm Royal Glow Behind Gradient Clip (Sibling avoids WebKit clip-text bug) */
.hero-title-glow {
  color: transparent;
  pointer-events: none;
  text-shadow:
    0 4px 24px rgba(0, 0, 0, 0.88),
    0 0 38px rgba(245, 185, 66, 0.34),
    0 0 80px rgba(212, 148, 42, 0.18);
}

.hero-title {
  position: relative;
  background: linear-gradient(
    110deg,
    #fff7dc 0%,
    #ffe291 18%,
    #f3b238 36%,
    #fff8e3 50%,
    #e6a42e 66%,
    #ffd978 84%,
    #fff4cf 100%
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold-bright);
  animation: goldShimmer 10s linear infinite;
}

@keyframes goldShimmer {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 220% center;
  }
}

/* Ornamental Lotus Flourish */
.lotus-divider {
  width: clamp(190px, 24vmin, 320px);
  margin: clamp(8px, 1.4vh, 18px) auto clamp(12px, 2vh, 24px);
  filter: drop-shadow(0 2px 12px rgba(245, 185, 66, 0.35));
  animation: fadeRise 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

.lotus-divider svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Rotating Festive English Wishes */
.wish-text {
  max-width: min(76vw, 840px);
  font-family: 'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.18rem, 2.3vmin + 0.45rem, 2.25rem);
  line-height: 1.42;
  letter-spacing: 0.015em;
  color: rgba(255, 244, 214, 0.93);
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.92),
    0 0 28px rgba(245, 185, 66, 0.18);
  transition: opacity 0.95s ease, transform 0.95s ease;
  animation: fadeRise 1.7s cubic-bezier(0.22, 1, 0.36, 1) 0.38s both;
}

.wish-text.is-fading {
  opacity: 0;
  transform: translateY(6px);
}

@keyframes fadeRise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   Layer 6: Discreet Auto-Hiding TV Controls Pill
   -------------------------------------------------------------------------- */
.tv-hud {
  position: fixed;
  right: calc(var(--safe-x) + 18px);
  bottom: calc(var(--safe-y) + 14px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(8, 13, 31, 0.72);
  border: 1px solid rgba(245, 193, 86, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

body.is-idle .tv-hud {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.hud-btn {
  appearance: none;
  border: 1px solid rgba(245, 193, 86, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 241, 204, 0.9);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.hud-btn:hover,
.hud-btn:focus-visible {
  background: rgba(245, 185, 66, 0.16);
  border-color: rgba(245, 193, 86, 0.6);
  outline: none;
}

.hud-btn:active {
  transform: scale(0.96);
}

.hud-btn-primary {
  background: linear-gradient(135deg, rgba(245, 185, 66, 0.26), rgba(186, 122, 24, 0.26));
  border-color: rgba(255, 214, 112, 0.48);
  color: #fff6da;
}

.hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-24k);
  box-shadow: 0 0 8px var(--gold-24k);
}

/* Reduced Motion Accessibility Fallback */
@media (prefers-reduced-motion: reduce) {
  .mandala-outer,
  .mandala-inner,
  .hero-title {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
