/* Homepage entrance only. Legacy experience pages retain their own entrance. */
#pgl-curtain-stage.pgl-cloth-stage {
  width: 100%; height: 100%; height: 100dvh;
  isolation: isolate;
  transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  background: #000000 !important;
  overscroll-behavior: contain; touch-action: manipulation;
}

/* Ensure the homepage hero, header, and content remain 100% invisible until the opening sequence finishes */
html.pgl-entrance-active .edgtf-wrapper,
html.pgl-entrance-active header.edgtf-page-header,
html.pgl-entrance-active .edgtf-top-bar {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.pgl-cloth-stage .pgl-stage-world {
  position: absolute; inset: 0; background: transparent; z-index: 3;
  transform-origin: 50% 44%; pointer-events: none;
}
.pgl-cloth-stage .pgl-theatre-shell {
  position: absolute; inset: 0; z-index: 3;
  opacity: 1; transition: opacity .45s ease; pointer-events: none;
}
.pgl-cloth-stage.pgl-dark-pause .pgl-theatre-shell { opacity: 0; }
.pgl-cloth-stage .pgl-legend-backdrop {
  position: absolute; inset: 0; z-index: 1; overflow: hidden;
  opacity: 0; visibility: hidden; transition: opacity 3s ease-in-out; pointer-events: none;
}
.pgl-cloth-stage.pgl-art-visible .pgl-legend-backdrop { opacity: 1; visibility: visible; }
.pgl-cloth-stage .pgl-legend-backdrop picture,
.pgl-cloth-stage .pgl-legend-backdrop img,
.pgl-cloth-stage .pgl-dancer-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pgl-cloth-stage .pgl-legend-backdrop img { object-fit: cover; }
.pgl-cloth-stage .pgl-dancer-canvas { opacity: 0; }
.pgl-cloth-stage .pgl-legend-backdrop.pgl-dancer-ready .pgl-dancer-canvas { opacity: 1; }
.pgl-cloth-stage .pgl-dancer-figure { position: absolute; inset: 10% 0 0; }
.pgl-cloth-stage .pgl-dancer-figure img { object-fit: contain; }
.pgl-cloth-stage .pgl-dancer-ready .pgl-dancer-figure img { visibility: hidden; }
.pgl-cloth-stage.pgl-art-leaving .pgl-legend-backdrop {
  opacity: 0; transition: opacity 3.6s ease-in-out;
}
@media (orientation: portrait) {
  .pgl-cloth-stage .pgl-dancer-figure { inset: 17% 0 9%; }
}
.pgl-cloth-stage .pgl-legend-backdrop::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 48%, #00000030, transparent 72%);
}

/* 2x Slower Zoom Animation: 8s cubic-bezier */
.pgl-cloth-stage.pgl-entering-world .pgl-stage-world {
  animation: pglEnterWorld 8s cubic-bezier(.35, 0, .2, 1) both;
  will-change: transform, opacity;
}
@keyframes pglEnterWorld {
  0% { transform: scale(1); opacity: 1; }
  75% { transform: scale(3.5); opacity: 1; }
  100% { transform: scale(4.2); opacity: 0; }
}

.pgl-cloth-stage .pgl-theatre-background,
.pgl-cloth-stage .pgl-stage-drapes-overlay,
.pgl-cloth-stage .pgl-cloth-canvas,
.pgl-cloth-stage .pgl-fallback-fabric {
  position: absolute; top: 0; left: 50%; width: 100%; height: 100%;
  transform: translateX(-50%); background-size: 100% 100% !important;
}
#pgl-curtain-stage.pgl-cloth-stage .pgl-theatre-background {
  background-image: url('/imgs/pgl_theatre_stage_open.png');
  /* Retain the illuminated floor; the foreground artwork supplies the arch. */
  mask-image: linear-gradient(to bottom, transparent 76%, #000 86%);
  transform: translateX(-50%); filter: none; transition: none;
}
#pgl-curtain-stage.pgl-cloth-stage .pgl-stage-drapes-overlay {
  display: none !important;
}
.pgl-cloth-stage .pgl-cloth-canvas { z-index: 5; pointer-events: none; }
.pgl-cloth-stage .pgl-fallback-fabric { z-index: 4; pointer-events: none; }
.pgl-cloth-stage.pgl-webgl-ready .pgl-fallback-fabric,
.pgl-cloth-stage.curtain-opened .pgl-fallback-fabric,
.pgl-cloth-stage.pgl-curtain-opening .pgl-fallback-fabric {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
#pgl-curtain-stage.pgl-cloth-stage .pgl-curtain-panel {
  top: 7%; height: 84%; width: 40%; box-shadow: none;
  background: #440810 url('/imgs/pgl-velvet-cloth-v2.webp') center / 100% 100% no-repeat;
  transform: none; transform-origin: left top;
  transition: transform 2.9s cubic-bezier(.45, 0, .14, 1), clip-path 2.9s cubic-bezier(.45, 0, .14, 1);
}
#pgl-curtain-stage.pgl-cloth-stage .pgl-curtain-left { left: 10.2%; }
#pgl-curtain-stage.pgl-cloth-stage .pgl-curtain-right { right: 10.2%; transform-origin: right top; }
#pgl-curtain-stage.pgl-cloth-stage.curtain-opened .pgl-curtain-left {
  transform: translateX(-120%) !important;
  clip-path: none !important;
}
#pgl-curtain-stage.pgl-cloth-stage.curtain-opened .pgl-curtain-right {
  transform: translateX(120%) !important;
  clip-path: none !important;
}
#pgl-curtain-stage.pgl-cloth-stage.curtain-opened { pointer-events: auto; }

.pgl-cloth-stage .pgl-curtain-hero-logo-wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto 16px auto;
  display: flex;
  justify-content: center;
  align-items: center;
}
.pgl-cloth-stage .pgl-curtain-hero-logo {
  width: 100%;
  max-width: 560px !important;
  max-height: none !important;
  height: auto;
  display: block;
}

.pgl-cloth-stage .pgl-curtain-center { top: 49%; max-height: calc(100% - 100px); }
.pgl-cloth-stage .pgl-curtain-royal-frame-btn { min-height: 48px; }
.pgl-cloth-stage button:focus-visible { outline: 2px solid #f4d48b !important; outline-offset: 6px; }
/* Skip Intro / Animation Button (Desktop & Mobile) */
.pgl-cloth-stage .pgl-curtain-skip {
  position: absolute;
  z-index: 50;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  min-width: 94px;
  min-height: 44px;
  border: 1px solid #bd9655;
  border-radius: 24px;
  padding: 10px 18px;
  background: #160908e8;
  color: #f3dba4;
  font: 14px Georgia, serif;
  letter-spacing: .04em;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  transition: opacity 0.3s ease, background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.pgl-cloth-stage .pgl-curtain-skip:hover {
  background: #2b120fe8;
  border-color: #ffd700;
  color: #fff2cc;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.45);
}
.pgl-cloth-stage .pgl-curtain-skip:active {
  transform: scale(0.96);
  background: #3d1512;
}
.pgl-cloth-stage .pgl-curtain-skip[hidden] {
  display: none !important;
}

/* Enable Skip Animation Button on Mobile Screen */
@media (max-width: 768px) {
  .pgl-cloth-stage .pgl-curtain-skip {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    position: absolute !important;
    z-index: 9999 !important;
    right: max(14px, env(safe-area-inset-right)) !important;
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    min-width: 86px !important;
    min-height: 40px !important;
    padding: 8px 15px !important;
    font-size: 13px !important;
    letter-spacing: 0.04em !important;
    border-radius: 20px !important;
    background: rgba(22, 9, 8, 0.92) !important;
    border: 1px solid rgba(189, 150, 85, 0.85) !important;
    color: #f3dba4 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7) !important;
    pointer-events: auto !important;
    cursor: pointer !important;
  }
}
@media (max-width: 480px) {
  .pgl-cloth-stage .pgl-curtain-skip {
    right: max(12px, env(safe-area-inset-right)) !important;
    bottom: max(14px, env(safe-area-inset-bottom)) !important;
    min-width: 80px !important;
    min-height: 38px !important;
    padding: 7px 13px !important;
    font-size: 12px !important;
  }
}

/* Quote overlay & Sand Canvas */
.pgl-cloth-stage .pgl-theatrical-quote-overlay {
  z-index: 10;
  pointer-events: none;
  transition: opacity 1.6s ease, visibility 1.6s ease;
}
.pgl-cloth-stage .pgl-quote-text {
  font-size: clamp(19px, 2.4vw, 35px);
}
.pgl-cloth-stage .pgl-quote-word {
  display: inline-block;
  white-space: nowrap;
}

/* 2x Slower Quote Appearance */
.pgl-cloth-stage .pgl-quote-stars {
  opacity: 0;
  transform: scale(0.5);
  filter: blur(8px);
  transition: transform 2.0s cubic-bezier(0.16, 1, 0.3, 1), opacity 2.0s ease, filter 2.0s ease;
}
.pgl-cloth-stage .pgl-theatrical-quote-overlay.coalesce .pgl-quote-stars {
  opacity: 0.95;
  transform: scale(1);
  filter: blur(0px);
}
.pgl-cloth-stage .pgl-quote-char {
  will-change: transform, opacity, filter;
  opacity: 0;
  transform: translate3d(var(--rnd-x, 0px), var(--rnd-y, 25px), 0) scale(var(--rnd-scale, 0.6)) rotate(var(--rnd-rot, 0deg));
  filter: blur(10px);
  transition: transform 2.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 2.4s ease, filter 2.4s ease;
}
.pgl-cloth-stage .pgl-theatrical-quote-overlay.coalesce .pgl-quote-char {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
  filter: blur(0px);
}
.pgl-cloth-stage .pgl-quote-signature {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(6px);
  transition: transform 2.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 2.4s ease, filter 2.4s ease;
}
.pgl-cloth-stage .pgl-theatrical-quote-overlay.coalesce .pgl-quote-signature {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0px);
}

/* Fixed canvas spanning viewport for golden sand particles */
.pgl-sand-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 25;
}

/* Gentle wind dissipation animations for quote characters and elements */
.pgl-quote-char.disperse,
.pgl-theatrical-quote-overlay.disperse .pgl-quote-char {
  opacity: 0 !important;
  transform: translate3d(var(--blow-x, 60px), var(--blow-y, -25px), 0) scale(0.15) rotate(var(--blow-rot, 25deg)) !important;
  filter: blur(12px) !important;
  transition-delay: 0s !important;
  transition: transform 1.1s cubic-bezier(0.4, 0, 1, 1), opacity 0.8s ease, filter 0.9s ease !important;
}
.pgl-quote-stars.disperse,
.pgl-theatrical-quote-overlay.disperse .pgl-quote-stars {
  opacity: 0 !important;
  transform: translate3d(60px, -20px, 0) scale(0.3) !important;
  filter: blur(10px) !important;
  transition-delay: 0s !important;
  transition: transform 1.0s cubic-bezier(0.4, 0, 1, 1), opacity 0.8s ease, filter 0.9s ease !important;
}
.pgl-quote-signature.disperse,
.pgl-theatrical-quote-overlay.disperse .pgl-quote-signature {
  opacity: 0 !important;
  transform: translate3d(50px, -20px, 0) scale(0.4) !important;
  filter: blur(10px) !important;
  transition-delay: 0s !important;
  transition: transform 1.0s cubic-bezier(0.4, 0, 1, 1), opacity 0.8s ease, filter 0.9s ease !important;
}

html.pgl-entrance-active { overflow: hidden !important; }
html.pgl-entrance-active body { overflow: hidden !important; }
@media (max-aspect-ratio: 4/5) {
  .pgl-cloth-stage .pgl-stage-world { transform-origin: 50% 46%; }
  .pgl-cloth-stage .pgl-theatre-background,
  .pgl-cloth-stage .pgl-stage-drapes-overlay,
  .pgl-cloth-stage .pgl-cloth-canvas,
  .pgl-cloth-stage .pgl-fallback-fabric { width: 130%; }
  .pgl-cloth-stage .pgl-curtain-center { width: 88%; }
  .pgl-cloth-stage .pgl-quote-box { padding: 18px 6px; }
  .pgl-cloth-stage .pgl-quote-text { font-size: clamp(18px, 5.2vw, 25px) !important; letter-spacing: .025em; }
}
@media (max-height: 520px) {
  .pgl-cloth-stage .pgl-curtain-center { top: 46%; gap: 0; }
  
  .pgl-cloth-stage .pgl-curtain-hero-logo-wrap { max-width: 340px !important; margin-bottom: 14px !important; }
  .pgl-cloth-stage .pgl-curtain-hero-logo { max-width: 340px !important; }

  .pgl-cloth-stage .pgl-curtain-crest-wrap { width: 48px !important; margin-bottom: 6px !important; }
  .pgl-cloth-stage .pgl-crest-img { max-height: 64px !important; }
  .pgl-cloth-stage .pgl-curtain-title-wrap { max-width: 230px !important; margin-bottom: 5px !important; }
  .pgl-cloth-stage .pgl-curtain-tagline { margin-bottom: 5px !important; font-size: 13px !important; }
  .pgl-cloth-stage #pgl-enter-btn-wrap { max-width: 245px !important; margin-top: 4px !important; }
}
@media (prefers-reduced-motion: reduce) {
  #pgl-curtain-stage.pgl-cloth-stage { transition-duration: .15s; }
  #pgl-curtain-stage.pgl-cloth-stage * { animation: none !important; transition-duration: .15s !important; filter: none !important; }
}

/* Theatrical Red Velvet Curtains (Full-bleed, rich texture) */
#pgl-curtain-stage .pgl-fallback-fabric {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

#pgl-curtain-stage.pgl-webgl-ready .pgl-fallback-fabric,
#pgl-curtain-stage.curtain-opened .pgl-fallback-fabric,
#pgl-curtain-stage.pgl-curtain-opening .pgl-fallback-fabric {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#pgl-curtain-stage .pgl-curtain-panel {
  position: absolute;
  top: 0;
  width: 50.5%;
  height: 100%;
  z-index: 5;
  transition: transform 2.6s cubic-bezier(0.77, 0, 0.175, 1);
  will-change: transform;
}

#pgl-curtain-stage .pgl-curtain-left {
  left: 0;
  background-image: url('/imgs/pgl_main_curtain_left.png') !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: right center !important;
  box-shadow: 15px 0 50px rgba(0, 0, 0, 0.95);
}

#pgl-curtain-stage .pgl-curtain-right {
  right: 0;
  background-image: url('/imgs/pgl_main_curtain_right.png') !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: left center !important;
  box-shadow: -15px 0 50px rgba(0, 0, 0, 0.95);
}

#pgl-curtain-stage.curtain-opened .pgl-curtain-left {
  transform: translateX(-100%) !important;
}

#pgl-curtain-stage.curtain-opened .pgl-curtain-right {
  transform: translateX(100%) !important;
}

/* Proscenium Frame & Drapes Overlay */
#pgl-curtain-stage .pgl-stage-frame-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: url('/imgs/pgl_stage_proscenium_frame.png') center center / 100% 100% no-repeat;
  z-index: 9;
  pointer-events: none;
  display: block !important;
}

#pgl-curtain-stage .pgl-stage-drapes-overlay {
  display: none !important;
}

/* Scenery Backdrop (Woman & Red Mountain Atmosphere) */
#pgl-curtain-stage .pgl-legend-backdrop {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 2.4s ease-in-out;
  pointer-events: none;
}

#pgl-curtain-stage.pgl-art-visible .pgl-legend-backdrop,
#pgl-curtain-stage.curtain-opened .pgl-legend-backdrop {
  opacity: 1 !important;
  visibility: visible !important;
}

#pgl-curtain-stage .pgl-legend-backdrop picture,
#pgl-curtain-stage .pgl-legend-backdrop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
