/* ==========================================================================
   gate-intro.css — the temple-gate opening scene (home page only)
   ========================================================================== */

.gate {
  position: fixed; inset: 0; z-index: var(--z-gate);
  background:
    radial-gradient(ellipse 70% 55% at 50% 22%, #FFF8E8 0%, rgba(251,247,239,0) 70%),
    linear-gradient(#F7EFE1, #EFE3CF 70%, #E6D6BD);
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--dur-reveal) var(--ease-standard);
  color: var(--ink-900);
}
.gate.is-visible { opacity: 1; }
.gate.is-done { opacity: 0; transition: opacity 900ms var(--ease-standard); pointer-events: none; }

.gate__scene {
  position: absolute; inset: 0;
  transition: transform 1700ms cubic-bezier(.55, 0, .85, .35), filter 1700ms ease;
  will-change: transform;
}
.gate-art { position: absolute; inset: 0; width: 100%; height: 100%; }

/* sky & divine light */
.gate-halo { opacity: .55; transition: opacity 1.4s var(--ease-standard); transform-box: fill-box; transform-origin: center; }
.gate-rays { opacity: 0; transition: opacity 1.6s var(--ease-standard); animation: gateRays 60s linear infinite; }
.gate.is-open .gate-halo { opacity: 1; animation: haloBreath 3.2s ease-in-out infinite alternate; }
.gate.is-open .gate-rays { opacity: .55; }
@keyframes gateRays { to { transform: rotate(360deg); } }
@keyframes haloBreath { from { transform: scale(1); } to { transform: scale(1.06); } }

/* small life in the scene */
.flame { transform-box: fill-box; transform-origin: 50% 100%; opacity: 0; transition: opacity .6s; }
.lamp-glow { opacity: 0; transition: opacity 1s; }
.gate.is-inked .flame { opacity: 1; animation: flicker 1.1s ease-in-out infinite alternate; }
.gate.is-inked .lamp-glow { opacity: 1; }
.flame:nth-of-type(2) { animation-delay: -.4s !important; }
@keyframes flicker { 0% { transform: scale(1, 1) rotate(-2deg); } 50% { transform: scale(.92, 1.08) rotate(2deg); } 100% { transform: scale(1.04, .94) rotate(-1deg); } }

.gate-bell { transform-box: view-box; }
.gate.is-open .gate-bell { animation: bell 1.2s ease-in-out 3 alternate; }
.gate.is-open .gate-bell + .gate-bell { animation-delay: .2s; }
@keyframes bell { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }

.dancer { transform-box: fill-box; transform-origin: 50% 100%; }
.gate.is-celebrating .dancer { animation: dance .55s ease-in-out infinite alternate; }
@keyframes dance { from { transform: rotate(-5deg) translateY(0); } to { transform: rotate(5deg) translateY(-4px); } }

.trunk { transform-box: fill-box; transform-origin: 8% 55%; transition: transform 900ms var(--ease-enter); }
.gate.is-celebrating .trunk { transform: rotate(-26deg); }
.elephant { transition: transform 1s; }

.banana { transform-box: fill-box; transform-origin: 50% 100%; }
.gate.is-celebrating .banana { animation: sway 2.4s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-1.4deg); } to { transform: rotate(1.4deg); } }

/* doorway (HTML overlay positioned over the SVG door opening) */
.gate__doorway { position: absolute; perspective: 900px; }
.gate__light {
  position: absolute; inset: 0; overflow: hidden;
  background: radial-gradient(ellipse at 50% 60%, #FFFDF4 0%, #FFE9B8 40%, #C7A66C 100%);
  opacity: .0; transition: opacity 900ms var(--ease-standard);
}
.gate__light-core {
  position: absolute; left: 50%; top: 58%; width: 260%; aspect-ratio: 1; transform: translate(-50%, -50%) scale(.4);
  background: radial-gradient(circle, rgba(255,253,244,1) 0%, rgba(255,240,200,.6) 30%, rgba(255,240,200,0) 62%);
  transition: transform 2s var(--ease-enter);
}
.gate.is-open .gate__light { opacity: 1; }
.gate.is-open .gate__light-core { transform: translate(-50%, -50%) scale(1); }
.gate.is-open .gate__doorway { filter: drop-shadow(0 0 30px rgba(255, 230, 170, .9)); }

.gate__door {
  position: absolute; top: 0; bottom: 0; width: 50%;
  transition: transform 1900ms cubic-bezier(.45, .05, .2, 1);
  transform-style: preserve-3d; backface-visibility: hidden;
}
.gate__door svg { width: 100%; height: 100%; }
.gate__door--l { left: 0; transform-origin: 0 50%; }
.gate__door--r { right: 0; transform-origin: 100% 50%; }
.gate.is-open .gate__door--l { transform: rotateY(-104deg); }
.gate.is-open .gate__door--r { transform: rotateY(104deg); }

/* entering: glide through the gateway */
.gate.is-entering .gate__scene { transform: scale(7); filter: blur(1px) brightness(1.15); }
.gate__flash {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 50%, #FFFDF5 0%, #FBF3E2 55%, #F4EBDD 100%);
  opacity: 0; transition: opacity 1100ms var(--ease-standard); pointer-events: none;
  padding: 24px;
}
.gate.is-entering .gate__flash { opacity: 1; transition-delay: 700ms; }
.gate__welcome { opacity: 0; transform: translateY(12px) scale(.985); transition: opacity 900ms var(--ease-enter), transform 900ms var(--ease-enter); }
.gate.is-welcome .gate__welcome { opacity: 1; transform: none; }
.gate__names {
  font-family: var(--font-display); font-weight: 400; color: var(--ink-900);
  font-size: var(--fs-display-xl); line-height: 1; margin: 14px 0 12px;
  display: flex; flex-wrap: wrap; gap: .1em .3em; justify-content: center; align-items: baseline;
}
.gate__names em { font-family: var(--font-script); font-style: normal; color: var(--gold-600); font-size: .8em; }
.gate__welcome-line { font-family: var(--font-display); font-style: italic; font-size: var(--fs-h3); color: var(--ink-700); }

/* text & controls */
.gate__petals { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.gate__top {
  position: absolute; top: clamp(16px, 3.5vh, 40px); left: 0; right: 0; text-align: center; z-index: 4;
  opacity: 0; transform: translateY(-8px); transition: opacity 1s var(--ease-enter) .2s, transform 1s var(--ease-enter) .2s;
  padding-inline: 16px;
}
.gate.is-inked .gate__top { opacity: 1; transform: none; }
.gate.is-entering .gate__top { opacity: 0; transition-delay: 0s; }
.gate__blessing { font-size: clamp(1.05rem, .8rem + 1.2vw, 1.7rem); color: var(--maroon-700); letter-spacing: .04em; }
.gate__translit { font-family: var(--font-display); font-style: italic; font-size: clamp(.9rem, .8rem + .4vw, 1.1rem); color: var(--ink-700); margin-top: 2px; }

.gate__actions {
  position: absolute; left: 0; right: 0; bottom: clamp(18px, 5vh, 46px); display: flex; justify-content: center; z-index: 5;
  opacity: 0; transform: translateY(8px); transition: opacity .8s var(--ease-enter) .5s, transform .8s var(--ease-enter) .5s;
}
.gate.is-inked .gate__actions { opacity: 1; transform: none; }
.gate.is-open .gate__actions { opacity: 0; pointer-events: none; transition-delay: 0s; }
.gate__enter { box-shadow: 0 10px 30px -12px rgba(87,43,42,.6); }

.gate__skip {
  position: absolute; top: 14px; right: 14px; z-index: 6;
  background: rgba(251,247,239,.75); border: 1px solid var(--paper-300); border-radius: var(--r-control);
  padding: 10px 14px; min-height: 44px; cursor: pointer;
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-700);
}
.gate__skip:hover { color: var(--maroon-700); border-color: var(--maroon-700); }

@media (max-aspect-ratio: 19/20) {
  .gate__top { top: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .gate-rays, .gate.is-open .gate-halo { animation: none; }
  .gate.is-entering .gate__scene { transform: none; filter: none; }
}
.gate-art { overflow: visible; }
.gate__date { margin-top: 18px; font-size: var(--fs-eyebrow); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--gold-700); }

/* music toggle stays reachable during the intro */
