/* The gate: a night sky with an aurora, snowfall and a snow globe. Tap it to open the menu. */
.gated { overflow: hidden; }
/* the page renders underneath while the gate shows, so its first paint is done before the tap */
.gated .music, .gated .skip { visibility: hidden; }

.gate { position: fixed; inset: 0; z-index: 100; cursor: pointer; overflow: hidden; outline: none; -webkit-tap-highlight-color: transparent;
  background: radial-gradient(130% 90% at 50% 100%, #1a2c55 0%, #0d1736 40%, #060b1d 75%, #03050f 100%); }
.gate canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* aurora: three soft bands drifting on the compositor */
.aurora { position: absolute; inset: -10% -20% 35% -20%; pointer-events: none; will-change: transform, opacity; }
.aurora i { position: absolute; left: 0; right: 0; height: 60%; border-radius: 50%; will-change: transform; }
.aurora .a1 { top: 8%; background: radial-gradient(50% 50% at 50% 50%, rgba(80, 255, 170, .30), rgba(40, 220, 160, .12) 45%, rgba(20, 180, 140, 0) 70%);
  animation: aur1 13s ease-in-out infinite alternate; }
.aurora .a2 { top: 22%; background: radial-gradient(45% 45% at 40% 50%, rgba(90, 200, 255, .22), rgba(60, 160, 255, .08) 50%, rgba(40, 120, 255, 0) 72%);
  animation: aur2 17s ease-in-out infinite alternate; }
.aurora .a3 { top: 0; background: radial-gradient(40% 40% at 65% 50%, rgba(190, 110, 255, .22), rgba(150, 80, 255, .07) 50%, rgba(120, 60, 255, 0) 72%);
  animation: aur3 21s ease-in-out infinite alternate; }
@keyframes aur1 { from { transform: translateX(-12%) skewX(-12deg) scaleY(.8); } to { transform: translateX(10%) skewX(10deg) scaleY(1.15); } }
@keyframes aur2 { from { transform: translateX(14%) skewX(8deg) scaleY(1.1); } to { transform: translateX(-10%) skewX(-10deg) scaleY(.85); } }
@keyframes aur3 { from { transform: translateX(-6%) scale(1, .9); } to { transform: translateX(12%) scale(1.1, 1.2); } }

.g-eyebrow, .g-title { will-change: transform, opacity; }
.g-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; text-align: center; pointer-events: none; }
.g-eyebrow { font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: #cfe0ff; opacity: 0; animation: gIn 1.4s .3s ease forwards; }
.g-title { font-family: var(--serif); font-weight: 600; font-size: clamp(40px, 9vw, 86px); line-height: 1.02; margin-top: 8px;
  background: linear-gradient(100deg, #a87a22 0%, #f7e3a1 22%, #fff6d6 50%, #f2d78a 78%, #a87a22 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; animation: gTitle 1.8s .5s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes gIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes gTitle { from { opacity: 0; transform: translateY(14px) scale(.96); letter-spacing: .1em; } to { opacity: 1; transform: none; letter-spacing: -.01em; } }

.globe-wrap { position: relative; width: min(64vw, 40vh, 360px); aspect-ratio: 300 / 340; margin-top: 22px; opacity: 0; animation: gGlobe 1.6s .9s cubic-bezier(.2, .9, .3, 1.15) forwards; will-change: transform; }
@keyframes gGlobe { from { opacity: 0; transform: translateY(30px) scale(.85); } to { opacity: 1; transform: none; } }
.globe { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.globe-wrap::after { content: ""; position: absolute; left: 8%; right: 8%; bottom: -5%; height: 12%; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0)); }
.g-glow { position: absolute; left: 50%; top: 41%; width: 130%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 120, .32) 0%, rgba(255, 190, 90, .12) 38%, rgba(255, 170, 60, 0) 66%); animation: gBreath 3.2s ease-in-out infinite alternate; will-change: opacity, transform; }
@keyframes gBreath { from { opacity: .7; transform: translate(-50%, -50%) scale(.95); } to { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } }
.g-ring { position: absolute; left: 50%; top: 41%; width: 78%; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(247, 227, 161, .6);
  transform: translate(-50%, -50%) scale(.9); opacity: 0; animation: gRing 2.8s 2.4s ease-out infinite; will-change: transform, opacity; }
.g-ring.r2 { animation-delay: 3.8s; }
@keyframes gRing { 0% { opacity: .8; transform: translate(-50%, -50%) scale(.9); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } }
.g-inner-snow { position: absolute; left: 12%; top: 7.6%; width: 76%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; pointer-events: none; }
.g-inner-snow span { position: absolute; top: -6%; width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: .9; animation: gFlake linear infinite; will-change: transform; }
@keyframes gFlake { to { transform: translate3d(var(--dx, 6px), 260px, 0); } }

.g-tap { margin-top: 26px; opacity: 0; animation: gIn 1s 2.2s ease forwards; }
.g-tap span { display: inline-block; padding: 12px 28px; border-radius: 999px; font-weight: 600; font-size: 16px; letter-spacing: .06em; color: #2a1406;
  background: linear-gradient(180deg, #fbe7ad, #d8b35a); box-shadow: 0 0 0 1px rgba(255, 255, 255, .4) inset, 0 8px 30px rgba(255, 200, 100, .45);
  animation: gPulse 2.4s 3.2s ease-in-out infinite; }
@keyframes gPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.g-music { margin-top: 10px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #9fb4dc; opacity: 0; animation: gIn 1s 2.6s ease forwards; }
.gate:focus-visible .g-tap span { outline: 3px solid #fff; outline-offset: 4px; }

.g-flash { position: fixed; inset: 0; z-index: 101; pointer-events: none; opacity: 0; will-change: opacity;
  background: radial-gradient(circle at 50% 46%, #fffbe8 0%, rgba(255, 230, 160, .9) 25%, rgba(255, 200, 100, .4) 50%, rgba(255, 180, 80, 0) 75%); }

/* the opening: shake, flare, burst, dive */
.gate.opening { cursor: default; }
.gate.opening .globe-wrap { animation: gShake .45s ease-in-out, gDive 1.2s .42s cubic-bezier(.6, 0, .9, .5) forwards; opacity: 1; }
@keyframes gShake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-7deg); } 45% { transform: rotate(6deg); } 70% { transform: rotate(-4deg); } 85% { transform: rotate(2deg); } }
@keyframes gDive { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(7); opacity: 0; } }
.gate.opening .g-glow { animation: none; opacity: 0; transform: translate(-50%, -50%) scale(1.25); transition: opacity .45s ease, transform .45s ease; }
.gate.opening .g-ring, .gate.opening .g-inner-snow { display: none; }
.gate.opening .g-ring, .gate.opening .g-tap, .gate.opening .g-music { animation: none; opacity: 0; transition: opacity .2s; }
.gate.opening .g-title, .gate.opening .g-eyebrow { animation: none; opacity: 0; transform: translateY(-30px) scale(1.15); transition: opacity .5s .35s, transform .9s .35s cubic-bezier(.6, 0, .9, .5); }
.gate.opening .aurora { transform: scale(1.4) translateY(-6%); opacity: 0; transition: transform .7s cubic-bezier(.6, 0, .9, .5), opacity .7s ease-in; }
.gate.opening .g-stars { opacity: 0; transition: opacity .7s ease-in; }
.g-flash.on { animation: gFlash 1.6s .5s ease-out forwards; }
@keyframes gFlash { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 0; } }
.gate.leaving { display: none; }

@media (prefers-reduced-motion: reduce) {
  .g-eyebrow, .g-title, .globe-wrap, .g-tap, .g-music { opacity: 1; animation: none; }
  .aurora i, .g-ring, .g-glow, .g-inner-snow span, .g-tap span { animation: none; }
}
