/* ============================================================
   SCROLL GATE — The Illuminated Reveal
   ============================================================ */

.scroll-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow-y: auto;
  overflow-x: hidden;
  background: #0a0a0a;
  color: #f5e6d0;
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;

  --sg-bg: #0a0a0a;
  --sg-cream: #f5e6d0;
  --sg-cream-dim: rgba(245, 230, 208, 0.55);
  --sg-gold: #A1B300;
  --sg-lantern-dark: #2a0a0a;
  --sg-glow: rgba(255, 140, 50, 0.4);
  --sg-font-display: 'Cormorant Garamond', 'Georgia', serif;
  --sg-font-body: 'Inter', 'Helvetica Neue', sans-serif;
  --sg-font-chinese: 'Noto Serif SC', serif;
}

.scroll-gate.sg-exiting {
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  pointer-events: none;
}

/* ---- Sticky Pinning ---- */
.scroll-gate .sg-section-wrapper {
  position: relative;
}

.scroll-gate .sg-section-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--sg-bg);
}

/* ============================================================
   LANTERN — starts centered, moves up on scroll
   ============================================================ */
.scroll-gate .sg-lantern-anchor {
  position: absolute;
  width: 90px;
  height: 175px;
  z-index: 10;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
  -webkit-transform: translate3d(-50%, -50%, 0);
}

.scroll-gate .sg-lantern-svg {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

.scroll-gate .sg-lantern-body {
  fill: var(--sg-lantern-dark);
  stroke: #8B4513;
  stroke-width: 1;
}

.scroll-gate .sg-lantern-character {
  font-family: var(--sg-font-chinese);
  font-size: 52px;
  fill: #3a1a1a;
  font-weight: 600;
}

.scroll-gate .sg-lantern-glow {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  will-change: width, height, opacity;
  width: 0;
  height: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 140, 50, 0.25) 0%,
    rgba(255, 100, 30, 0.12) 20%,
    rgba(255, 80, 20, 0.05) 40%,
    rgba(255, 60, 10, 0.02) 60%,
    rgba(255, 60, 10, 0.005) 80%,
    transparent 100%
  );
  filter: blur(20px);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
}

/* ============================================================
   PILL-SHAPED PHOTO
   ============================================================ */
.scroll-gate .sg-pill-photo {
  position: relative;
  z-index: 5;
  width: min(320px, 70vw);
  height: min(480px, 75vh);
  border-radius: 999px;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.95) translate3d(0,0,0);
  will-change: transform, opacity;
  box-shadow: 0 0 0 rgba(255, 140, 50, 0);
  -webkit-backface-visibility: hidden;
}

.scroll-gate .sg-pill-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

/* ============================================================
   ENTER BUTTON
   ============================================================ */
.scroll-gate .sg-enter-btn {
  position: relative;
  z-index: 15;
  margin-top: 2rem;
  padding: 14px 52px;
  font-family: var(--sg-font-body);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid #FF5039;
  background: transparent;
  color: #FF5039;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: background 0.3s ease, border-color 0.3s ease;
  pointer-events: none;
  will-change: opacity, transform;
}

.scroll-gate .sg-enter-btn.sg-active {
  pointer-events: auto;
}

.scroll-gate .sg-enter-btn:hover {
  background: rgba(255, 80, 57, 0.1);
}

/* ============================================================
   PASSWORD OVERLAY
   ============================================================ */
.scroll-gate .sg-password-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sg-bg);
  transition: opacity 0.8s ease;
}

.scroll-gate .sg-password-overlay.sg-fading {
  opacity: 0;
  pointer-events: none;
}

.scroll-gate .sg-password-content {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scroll-gate .sg-password-logo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 2rem;
}

.scroll-gate .sg-password-label {
  font-family: 'Affigue', var(--sg-font-display);
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--sg-cream-dim);
  text-transform: none;
  margin-bottom: 10px;
  font-weight: 300;
}

.scroll-gate .sg-password-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scroll-gate .sg-password-input {
  font-family: var(--sg-font-body);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-align: left;
  padding: 0.8rem 1.5rem;
  border: 1px solid rgba(245, 230, 208, 0.2);
  border-radius: 100px;
  background: transparent;
  color: var(--sg-cream);
  outline: none;
  width: 240px;
  transition: border-color 0.3s ease;
}

.scroll-gate .sg-password-input::placeholder {
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  color: rgba(245, 230, 208, 0.25);
}

.scroll-gate .sg-password-input:focus {
  border-color: rgba(245, 230, 208, 0.45);
}

.scroll-gate .sg-password-enter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(245, 230, 208, 0.2);
  border-radius: 50%;
  color: var(--sg-cream-dim);
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.scroll-gate .sg-password-enter:hover {
  background: rgba(245, 230, 208, 0.08);
  border-color: rgba(245, 230, 208, 0.45);
  color: var(--sg-cream);
}

.scroll-gate .sg-password-error {
  font-family: var(--sg-font-body);
  font-size: 0.75rem;
  font-weight: 300;
  color: #d4837a;
  margin-top: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
  height: 18px;
}

.scroll-gate .sg-password-error.sg-visible {
  opacity: 1;
}

/* ============================================================
   SCROLL PROMPT
   ============================================================ */
.scroll-gate .sg-scroll-prompt {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--sg-cream-dim);
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.scroll-gate .sg-scroll-arrow {
  animation: sg-bounce 2s infinite;
}

@keyframes sg-bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(6px); }
  60% { transform: translateY(3px); }
}

/* ============================================================
   PARTICLES
   ============================================================ */
.scroll-gate .sg-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.scroll-gate .sg-particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 160, 50, 0.9) 0%, rgba(255, 100, 20, 0.4) 100%);
  pointer-events: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .scroll-gate .sg-lantern-anchor {
    width: 60px;
    height: 120px;
  }

  .scroll-gate .sg-pill-photo {
    width: min(260px, 65vw);
    height: min(390px, 65vh);
  }

  .scroll-gate .sg-password-input {
    width: 220px;
    font-size: 1rem;
  }

  .scroll-gate .sg-enter-btn {
    padding: 12px 36px;
    font-size: 0.7rem;
  }
}
