/* =====================================================
   PAGE TRANSITIONS
   Atmospheric dark dissolve between modes
   Mode indicator dots
   ===================================================== */

/* ── Mode curtain ─────────────────────────────────────
   A near-white atmospheric overlay.
   backdrop-filter blurs + brightens the scene behind it
   as the overlay fades in — creating a depth-of-field
   dissolve without touching any content elements.
   GSAP animates only opacity (0 → 1 → 0).
   ===================================================== */
#mode-curtain {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  background: #fdfcfa;
  backdrop-filter: blur(20px) brightness(1.8);
  -webkit-backdrop-filter: blur(20px) brightness(1.8);
  opacity: 0;
  will-change: opacity;
}

/* No colored fills, no text — pure atmosphere */
.curtain-face,
.curtain-label {
  display: none;
}

/* ── Mode indicator dots ──────────────────────────────
   Three dots on the right edge, showing current mode.
   ===================================================== */
#mode-indicator {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

body:not(.modal-open) #mode-indicator {
  opacity: 1;
}

body:has(#gallery-overlay.is-open) #mode-indicator,
body.teaching-detail-open #mode-indicator {
  opacity: 0;
}

.mode-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(28, 25, 23, 0.22);
  transition: background 0.35s ease,
              transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.mode-dot.is-active {
  background: #D96535;
  transform: scale(1.7);
}

.mode-dot-wrap {
  position: relative;
  display: flex;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
}

.mode-dot-label {
  position: absolute;
  right: 16px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: rgba(28, 25, 23, 0.50);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

#mode-indicator:hover .mode-dot-label {
  opacity: 1;
  transform: translateX(0);
}

.mode-dot-wrap.is-active .mode-dot-label {
  color: #D96535;
}

/* ── Panel entrance animation ─────────────────────────
   Inner card rises when panel becomes :target.
   ===================================================== */
@keyframes panel-inner-rise {
  from {
    transform: translateY(52px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.panel:target .panel-inner {
  animation: panel-inner-rise 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.08s;
}

/* ── Transition lock ──────────────────────────────────
   Block pointer events during the dissolve.
   ===================================================== */
body.is-transitioning {
  pointer-events: none;
}

/* ── Reduced motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #mode-curtain {
    display: none !important;
  }
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 480px) {
  #mode-indicator {
    right: 10px;
  }
  .mode-dot-label {
    display: none;
  }
}
