/* ==========================================================================
   SRR — Entrance preloader (temple doors opening)
   Ported from the supplied design, kept as close to the original as
   possible. Shown once per browser session — see partials/preloader.php.
   ========================================================================== */

#srr-preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f5f2ed;
  font-family: inherit;
  color: inherit;
  perspective: 1800px;
  isolation: isolate;
  transition: opacity 1s ease, visibility 1s ease;
}

#srr-preloader *,
#srr-preloader *::before,
#srr-preloader *::after {
  box-sizing: border-box;
  font-family: inherit;
}

#srr-preloader.srr-exit {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.srr-preloading { overflow: hidden; }

/* BACKGROUND */

.srr-background {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #fff 0%, #f7f3ed 65%, #eae3da 100%);
}

.srr-glow {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(213,177,140,.24), transparent 70%);
  animation: srr-glow 4s ease-in-out infinite alternate;
}

/* BRAND REVEAL */

.srr-welcome {
  position: absolute;
  z-index: 2;
  width: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(18px) scale(.9);
  animation: srr-welcome 1.2s ease forwards;
  animation-delay: 2.2s;
}

.srr-brand-logo {
  width: clamp(75px, 10vw, 115px);
  height: clamp(75px, 10vw, 115px);
  object-fit: contain;
  margin-bottom: 12px;
}

.srr-title {
  color: #2c2117;
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 700;
  font-family: var(--f-display, inherit);
}

.srr-subtitle {
  margin-top: 10px;
  font-size: 11px;
  color: #98735c;
  letter-spacing: 2px;
}

.srr-divider {
  width: 90px;
  height: 1px;
  margin: 22px 0;
  background: #a66b50;
  opacity: .5;
}

.srr-mantra {
  color: #95634d;
  font-size: 18px;
}

/* TEMPLE ARCHITECTURE */

.srr-entrance {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.srr-arch {
  position: relative;
  width: min(78vw, 700px);
  height: min(88vh, 760px);
  height: min(88dvh, 760px);
  display: flex;
  justify-content: center;
  align-items: stretch;
  perspective: 1800px;
}

.srr-arch-outline {
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 12px solid #92745e;
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 22% 22% 0 0;
  outline: 2px solid #dfcbb3;
  outline-offset: -19px;
  background: repeating-linear-gradient(45deg, transparent 0 12px, rgba(112,76,51,.07) 13px 15px);
}

.srr-pillar {
  position: absolute;
  top: 13%;
  bottom: 0;
  width: 8%;
  background: linear-gradient(90deg, #a78a72, #f0e2d1, #b89b81, #8b6b53);
  border: 2px solid #80604a;
  box-shadow: inset 0 0 12px rgba(62,35,20,.3);
}

.srr-pillar-left { left: -7%; }
.srr-pillar-right { right: -7%; }

.srr-pillar::before {
  content: "❋";
  position: absolute;
  left: -25%;
  top: 0;
  width: 150%;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #75513c;
  font-size: 27px;
  background: #d4bba0;
  border: 2px solid #8a674d;
}

/* WOODEN DOORS */

.srr-gate {
  position: relative;
  width: 50%;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 2px, transparent 2px 14px),
    linear-gradient(90deg, #38231c, #79533d 25%, #65412f 70%, #38241c);
  border: 5px solid #38251e;
  border-top-width: 10px;
  box-shadow: inset 0 0 25px rgba(0,0,0,.55), inset 0 0 0 4px #b28d6e, 0 0 15px rgba(48,28,17,.3);
  transform-style: preserve-3d;
  transition: transform 2.8s cubic-bezier(.77,0,.18,1);
}

.srr-gate-left { transform-origin: left center; border-radius: 100% 0 0 0 / 28% 0 0 0; }
.srr-gate-right { transform-origin: right center; border-radius: 0 100% 0 0 / 0 28% 0 0; }

.srr-carved-panel {
  position: absolute;
  inset: 12px;
  border: 2px solid #d9bea0;
  outline: 1px solid #38251c;
  outline-offset: -8px;
  background: linear-gradient(135deg, rgba(255,255,255,.05), transparent 45%, rgba(0,0,0,.15));
  pointer-events: none;
}

.srr-door-decoration {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #e2c9a8;
  text-shadow: 0 3px 5px #21120c;
  font-size: 34px;
}
.srr-door-decoration.top { top: 5%; }
.srr-door-decoration.bottom { bottom: 5%; font-size: 22px; letter-spacing: 5px; }

.srr-door-jaali {
  position: absolute;
  left: 17%;
  right: 17%;
  top: 26%;
  height: 13%;
  border: 3px double #ddc3a3;
  background:
    repeating-linear-gradient(45deg, transparent 0 9px, rgba(235,216,187,.6) 10px 11px, transparent 12px 18px),
    repeating-linear-gradient(-45deg, transparent 0 9px, rgba(235,216,187,.5) 10px 11px, transparent 12px 18px);
}

/* CIRCULAR RAM / SITA FRAMES — styled Devanagari monogram, no external image */

.srr-deity-frame {
  position: absolute;
  z-index: 8;
  top: 62%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(72px, 14vw, 112px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, #f3e4cd, #e7d5bd 70%);
  border: 4px solid #c9a77e;
  outline: 2px solid #76553c;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(226,204,174,.55), inset 0 0 12px rgba(52,29,14,.3), 0 5px 12px rgba(0,0,0,.35);
  pointer-events: none;
}

.srr-deity-frame::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 4px;
  border: 1px solid rgba(255,235,207,.9);
  border-radius: 50%;
  pointer-events: none;
}

.srr-deity-frame img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  display: block;
}

.srr-rama-frame { left: 50%; }
.srr-sita-frame { left: 50%; }

.srr-deity-frame .srr-frame-flower {
  position: absolute;
  z-index: 4;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  color: #f0d1a7;
  font-size: 13px;
}

.srr-door-handle {
  position: absolute;
  z-index: 9;
  top: 52%;
  width: 12px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(90deg, #77533c, #e4c7a2, #805538);
  border: 1px solid #352117;
}
.srr-gate-left .srr-door-handle { right: 8px; }
.srr-gate-right .srr-door-handle { left: 8px; }

.srr-toran {
  position: absolute;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 75%;
  text-align: center;
  color: #e58b36;
  font-size: clamp(15px, 2.5vw, 26px);
  letter-spacing: 5px;
  text-shadow: 0 2px 3px rgba(50,20,10,.3);
}
.srr-toran span { color: #b84832; }

/* FALLING ROSE PETALS */

.srr-petals {
  position: absolute;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
}

.srr-petal {
  position: absolute;
  top: -100px;
  left: var(--left);
  width: var(--size);
  height: calc(var(--size) * 1.25);
  opacity: 0;
  transform-origin: center;
  animation: srr-rose-fall var(--duration) var(--delay) linear infinite;
  filter: drop-shadow(0 3px 4px rgba(45,0,8,.2));
}
.srr-petal svg { display: block; width: 100%; height: 100%; }

@keyframes srr-rose-fall {
  0%   { transform: translate3d(0,-5vh,0) rotate(var(--rotation)) scale(.8); opacity: 0; }
  10%  { opacity: .98; }
  25%  { transform: translate3d(var(--drift),25vh,0) rotate(calc(var(--rotation) + 100deg)); }
  50%  { transform: translate3d(var(--drift2),50vh,0) rotate(calc(var(--rotation) + 230deg)); }
  75%  { transform: translate3d(var(--drift3),75vh,0) rotate(calc(var(--rotation) + 360deg)); }
  90%  { opacity: .95; }
  100% { transform: translate3d(var(--drift4),110vh,0) rotate(calc(var(--rotation) + 520deg)); opacity: 0; }
}

.srr-loading-indicator {
  position: absolute;
  bottom: 30px;
  z-index: 30;
  display: flex;
  gap: 9px;
  opacity: 0;
  animation: srr-indicator 1s ease forwards;
  animation-delay: 2s;
}
.srr-loading-indicator span {
  width: 6px;
  height: 6px;
  background: #a66b50;
  border-radius: 50%;
  animation: srr-dots .9s ease-in-out infinite alternate;
}
.srr-loading-indicator span:nth-child(2) { animation-delay: .2s; }
.srr-loading-indicator span:nth-child(3) { animation-delay: .4s; }

/* DOOR OPENING */

#srr-preloader.srr-open .srr-gate-left { transform: translateX(-5%) rotateY(-110deg); }
#srr-preloader.srr-open .srr-gate-right { transform: translateX(5%) rotateY(110deg); }
#srr-preloader.srr-open .srr-deity-frame { opacity: 0; transition: opacity .5s ease; }

@keyframes srr-glow { from { transform: scale(.85); opacity: .6; } to { transform: scale(1.15); opacity: 1; } }
@keyframes srr-welcome { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes srr-indicator { to { opacity: 1; } }
@keyframes srr-dots { from { opacity: .3; transform: translateY(0); } to { opacity: 1; transform: translateY(-5px); } }

@media (max-width: 600px) {
  .srr-arch { width: 76vw; height: 73vh; height: 73dvh; }
  .srr-pillar { width: 9%; }
  .srr-gate { border-width: 3px; }
  .srr-carved-panel { inset: 7px; }
  .srr-door-decoration { font-size: 25px; }
  .srr-door-decoration.bottom { font-size: 15px; }
  .srr-door-jaali { height: 12%; }
  .srr-deity-frame { width: clamp(58px, 15vw, 85px); border-width: 3px; outline-offset: 2px; }
  .srr-toran { letter-spacing: 2px; }
  .srr-title { font-size: 25px; }
  .srr-subtitle { font-size: 8px; letter-spacing: 1px; }
  .srr-brand-logo { width: 75px; height: 75px; }
}

@media (prefers-reduced-motion: reduce) {
  .srr-glow, .srr-welcome, .srr-petal, .srr-loading-indicator, .srr-loading-indicator span {
    animation: none !important;
  }
  .srr-welcome { opacity: 1; transform: none; }
}
