/* ==========================================================================
   Krishna Utsab Resort — premium animated logo intro (first-visit overlay).
   --------------------------------------------------------------------------
   Fully self-contained: a fixed, opaque opening screen that draws a gold
   circular border around the existing logo, reveals the logo, then expands
   and dissolves into the homepage. Uses only CSS/SVG (no video, no images
   beyond the existing logo) and has zero impact on page layout.

   Loaded after style.css so it can safely override a few motion rules.
   ========================================================================== */

/* ---------- Overlay shell ---------- */
.ku-intro {
  position: fixed;
  inset: 0;
  z-index: 12000;                 /* above navbar, lightbox, cursor, keypad */
  display: grid;
  place-items: center;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  color: #fff;
  background-color: var(--ku-intro-bg, #0b3d2e);
  background:
    radial-gradient(140% 120% at 50% 36%, color-mix(in srgb, var(--ku-intro-bg, #0b3d2e) 72%, #17674e) 0%, var(--ku-intro-bg, #0b3d2e) 46%, color-mix(in srgb, var(--ku-intro-bg, #0b3d2e) 70%, #000) 100%);
  will-change: opacity;
  -webkit-user-select: none;
  user-select: none;
  /* Safety net: even if JS fails to drive the sequence, the overlay always
     fades away on its own. Overridden by the play sequence below. */
  animation: kuOverlayOut .7s ease var(--ku-intro-duration, 3s) both;
}
.ku-intro[hidden] { display: none !important; }
.ku-intro.preview-play .ku-intro-logo { animation: kuLogoIn .8s cubic-bezier(.22,.61,.36,1) .15s both; }
.ku-intro.preview-play .ku-ring-progress { animation: kuRingDraw 1.2s cubic-bezier(.65,0,.35,1) both; }
.ku-intro.preview-play .ku-intro-word { animation: kuWordIn .75s ease .35s both; }
.ku-intro.preview-play .ku-intro-stage { animation: kuStageOut .75s cubic-bezier(.55,0,.75,0) var(--ku-intro-stage-delay, 2.15s) forwards; }
.ku-intro.preview-play { animation: kuOverlayOut .65s ease var(--ku-intro-out-delay, 2.3s) forwards; }

/* Soft ambient light layers */
.ku-intro::before {
  content: "";
  position: absolute;
  inset: -25%;
  pointer-events: none;
  background:
    radial-gradient(34% 34% at 50% 44%, rgba(200,162,74,.20), rgba(200,162,74,0) 70%),
    radial-gradient(30% 30% at 20% 80%, rgba(42,157,117,.26), rgba(42,157,117,0) 72%),
    radial-gradient(28% 28% at 82% 18%, rgba(42,157,117,.20), rgba(42,157,117,0) 72%);
  animation: kuAmbient 10s ease-in-out infinite alternate;
}
.ku-intro::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 50%, rgba(0,0,0,0) 55%, rgba(0,0,0,.35) 100%);
}
@keyframes kuAmbient {
  from { transform: scale(1) rotate(0deg); }
  to   { transform: scale(1.14) rotate(5deg); }
}

/* Already seen this session → hide instantly, before first paint */
html.ku-intro-none .ku-intro { display: none !important; }

/* Lock scrolling during the intro without a scrollbar layout shift */
html.ku-intro-lock { overflow: hidden; scrollbar-gutter: stable; }
html.ku-intro-lock body { overflow: hidden; }

/* ---------- Centered stage ---------- */
.ku-intro-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 4vh, 40px);
  padding: 24px;
}
.ku-intro-stage {
  position: relative;
  width: clamp(200px, 48vw, 300px);
  height: clamp(200px, 48vw, 300px);
  display: grid;
  place-items: center;
  transform-origin: center;
  will-change: transform, opacity;
}

/* Gold glow behind the logo */
.ku-intro-glow {
  position: absolute;
  width: 74%;
  height: 74%;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  opacity: 1;
  transform: scale(1);
  background: radial-gradient(circle, rgba(200,162,74,.42), rgba(200,162,74,0) 66%);
  filter: blur(8px);
}

/* Circular drawing border */
.ku-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 2;
  pointer-events: none;
  transform: rotate(-90deg);      /* start the draw at 12 o'clock */
}
.ku-ring-track {
  fill: none;
  stroke: rgba(200,162,74,.22);
  stroke-width: 1.4;
}
.ku-ring-progress {
  fill: none;
  stroke: url(#kuRingGrad);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 1;            /* normalised via pathLength="1" */
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 6px rgba(200,162,74,.45));
}
.ku-ring-inner {
  fill: none;
  stroke: rgba(216,186,106,.55);
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.ku-ring-shimmer {
  fill: none;
  stroke: #f6eccf;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: .035 .965;
  stroke-dashoffset: 0;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  filter: drop-shadow(0 0 8px rgba(246,236,207,.9));
}

/* Logo — the original brand mark, untouched */
.ku-intro-logo {
  position: relative;
  z-index: 3;
  width: var(--ku-intro-size, 42%);
  display: grid;
  place-items: center;
  opacity: 1;
  transform: none;
  filter: none;
  will-change: transform, opacity, filter;
}
.ku-intro-logo img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 34px rgba(0,0,0,.4));
}

/* Wordmark */
.ku-intro-word {
  font-family: var(--font-body, sans-serif);
  text-transform: uppercase;
  letter-spacing: .42em;
  font-size: clamp(.62rem, 1.7vw, .8rem);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  color: var(--ku-gold-400, #d8ba6a);
  padding-left: .42em;            /* visually balance trailing letter-spacing */
  opacity: 1;
  transform: none;
}

/* Skip control */
.ku-intro-skip {
  position: absolute;
  left: 50%;
  bottom: clamp(26px, 7vh, 70px);
  z-index: 5;
  transform: translateX(-50%);
  padding: .5rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.75);
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 1;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.ku-intro-skip:hover,
.ku-intro-skip:focus-visible {
  color: #fff;
  border-color: rgba(200,162,74,.75);
  background: rgba(255,255,255,.1);
  outline: none;
}

/* ==========================================================================
   Play sequence (~2.9s total) — driven by html.ku-intro-play
   ========================================================================== */
html.ku-intro-play .ku-intro        { animation: kuOverlayOut .65s ease var(--ku-intro-out-delay, 2.3s) forwards; }
html.ku-intro-play .ku-intro-stage  { animation: kuStageOut .75s cubic-bezier(.55,0,.75,0) var(--ku-intro-stage-delay, 2.15s) forwards; }
html.ku-intro-play .ku-ring-progress{ animation: kuRingDraw 1.2s cubic-bezier(.65,0,.35,1) var(--ku-intro-ring-delay, .05s) both; }
html.ku-intro-play .ku-ring-inner   { animation: kuRingDraw 1s cubic-bezier(.65,0,.35,1) var(--ku-intro-inner-delay, .95s) both; }
html.ku-intro-play .ku-ring-shimmer { animation: kuShimmerIn .4s ease var(--ku-intro-shimmer-delay, 1.25s) both, kuSpin 7s linear var(--ku-intro-logo-delay, 1.45s) infinite; }
html.ku-intro-play .ku-intro-glow   { animation: kuGlowIn .9s ease var(--ku-intro-glow-delay, 1.05s) both; }
html.ku-intro-play .ku-intro-logo   { animation: kuLogoIn .8s cubic-bezier(.22,.61,.36,1) var(--ku-intro-logo-delay, 1.2s) both; }
html.ku-intro-play .ku-intro-word   { animation: kuWordIn .75s ease var(--ku-intro-word-delay, 1.55s) both; }
html.ku-intro-play .ku-intro-skip   { animation: kuFadeOnly .6s ease var(--ku-intro-skip-delay, 1.8s) both; }

@keyframes kuOverlayOut { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }
@keyframes kuRingDraw   { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes kuSpin       { to { transform: rotate(360deg); } }
@keyframes kuShimmerIn  { from { opacity: 0; } to { opacity: .9; } }
@keyframes kuGlowIn     { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes kuFadeOnly   { from { opacity: 0; } to { opacity: 1; } }
@keyframes kuLogoIn {
  0%   { opacity: 0; transform: scale(.5) rotate(-7deg); filter: blur(10px); }
  55%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); filter: blur(0); }
}
@keyframes kuWordIn {
  from { opacity: 0; transform: translateY(12px); letter-spacing: .7em; }
  to   { opacity: 1; transform: translateY(0);    letter-spacing: .42em; }
}
@keyframes kuStageOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.42); }
}

/* User pressed "Skip intro" → quick graceful exit (must out-specify the play rule) */
html.ku-intro-play .ku-intro.is-skipping { animation: kuOverlayOut .22s ease forwards !important; }

/* ==========================================================================
   Cinematic crossfade: hold the hero entrance until the intro opens
   ========================================================================== */
html.ku-intro-play:not(.ku-intro-done) .ku-hero-slide.is-active .hs-content > * {
  opacity: 0 !important;
  transform: translateY(28px) !important;
  transition: none !important;
}
html.ku-intro-play:not(.ku-intro-done) .ku-hero-slide.is-active .hs-zoom {
  animation: none !important;
}

/* ==========================================================================
   Replay control (appears after the intro)
   ========================================================================== */
.ku-intro-replay {
  position: fixed;
  left: clamp(12px, 2vw, 22px);
  bottom: clamp(12px, 2vh, 22px);
  z-index: 1045;
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ku-gold-400, #d8ba6a);
  background: rgba(11,61,46,.88);
  border: 1px solid rgba(200,162,74,.5);
  box-shadow: 0 10px 24px rgba(6,37,27,.32);
  opacity: .4;
  transition: opacity .25s ease, transform .3s cubic-bezier(.34,1.56,.64,1), background .25s ease;
}
.ku-intro-replay:hover,
.ku-intro-replay:focus-visible {
  opacity: 1;
  transform: translateY(-3px) rotate(-30deg);
  background: var(--ku-emerald-700, #14624a);
  outline: none;
}

/* ==========================================================================
   Responsive tuning
   ========================================================================== */
@media (max-width: 575.98px) {
  .ku-intro-word { letter-spacing: .34em; padding-left: .34em; }
  .ku-intro-skip { bottom: clamp(20px, 5vh, 44px); font-size: .68rem; }
  .ku-intro-replay { width: 38px; height: 38px; }
}

/* ==========================================================================
   Print — never print the opening overlay or replay control
   ========================================================================== */
@media print {
  .ku-intro, .ku-intro-replay { display: none !important; }
}

/* ==========================================================================
   Reduced-motion fallback — show the logo without the drawing motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html.ku-intro-play .ku-intro { animation: kuOverlayOut .4s ease 1.05s forwards !important; }
  html.ku-intro-play .ku-intro-stage,
  html.ku-intro-play .ku-intro-glow,
  html.ku-intro-play .ku-intro-logo,
  html.ku-intro-play .ku-intro-word,
  html.ku-intro-play .ku-intro-skip,
  html.ku-intro-play .ku-ring-progress,
  html.ku-intro-play .ku-ring-inner,
  html.ku-intro-play .ku-ring-shimmer { animation: none !important; }

  html.ku-intro-play .ku-intro-glow,
  html.ku-intro-play .ku-intro-logo,
  html.ku-intro-play .ku-intro-word { opacity: 1 !important; transform: none !important; filter: none !important; }
  html.ku-intro-play .ku-intro-skip { opacity: .78 !important; }
  html.ku-intro-play .ku-ring-progress,
  html.ku-intro-play .ku-ring-inner { stroke-dashoffset: 0 !important; }
  html.ku-intro-play .ku-ring-shimmer { opacity: 0 !important; }
  .ku-intro::before { animation: none !important; }
}
