/* Artistic Stage 2.2 overlays: accordions on #breath & #water,
   living forest sunlight on #program, gentle water surface glints on #water.
   Zero deformation of figures, zero light trails on rotating runes, pause when offscreen. */

/* 1. Accessible AGRATYS Accordions (#breathDetails, #waterDetails) */
.art-accordion {
  margin: 14px 0 18px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(230, 201, 138, 0.42);
  background: rgba(8, 16, 23, 0.92);
  box-shadow: inset 0 1px 0 rgba(246, 226, 180, 0.16), 0 12px 32px rgba(0, 0, 0, 0.42);
  max-width: 100%;
  box-sizing: border-box;
}
.art-accordion > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  color: #f3d799;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  list-style: none;
  user-select: none;
}
.art-accordion > summary::-webkit-details-marker { display: none; }
.art-accordion > summary::after { content: none; }
.art-accordion > summary:hover { color: #ffe7b3; background: rgba(230, 201, 138, 0.07); border-radius: 10px; }
.art-accordion > summary:focus-visible {
  outline: 2px solid #f4c977;
  outline-offset: 2px;
  border-radius: 10px;
}
.art-accordion > summary i {
  position: relative;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 1px solid rgba(230, 201, 138, 0.55);
}
.art-accordion > summary i::before,
.art-accordion > summary i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 1.5px;
  background: #f4d28b;
  transform: translate(-50%, -50%);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.art-accordion > summary i::after {
  transform: translate(-50%, -50%) rotate(90deg);
}
.art-accordion[open] > summary i::after {
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 0;
}
.art-accordion-body {
  padding: 2px 16px 16px;
  border-top: 1px solid rgba(230, 201, 138, 0.16);
}
.art-accordion[open] .art-accordion-body {
  animation: artAccordionOpen 0.22s ease forwards;
}
#breath .art-accordion-body p,
#water .art-accordion-body p,
.art-accordion-body p {
  margin: 10px 0 0;
  color: #edf4ef;
  opacity: 1;
  font-size: 14.5px;
  line-height: 1.72;
}
#breath .art-accordion-body .section-accent,
#water .art-accordion-body .section-accent,
.art-accordion-body .section-accent {
  color: #f6e2b4;
  font-weight: 600;
  margin-top: 12px;
}
@keyframes artAccordionOpen {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 680px) {
  .art-accordion > summary {
    padding: 12px 14px;
    font-size: 12px;
    letter-spacing: 0.05em;
  }
  .art-accordion-body {
    padding: 2px 14px 14px;
  }
  .art-accordion-body p {
    font-size: 14px;
    line-height: 1.65;
  }
}

/* 2. #program — Cinematic sunlight & canopy breathing behind cards (z-index: 0, container sits at z-index: 2) */
#program.program {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
#program > .container {
  position: relative;
  z-index: 2;
}
.program-nature-fx {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: layout style;
}
.pn-canopy-glow {
  position: absolute;
  inset: -8% -4% 12%;
  background:
    radial-gradient(ellipse at 22% 16%, rgba(255, 224, 152, 0.16), transparent 46%),
    radial-gradient(ellipse at 78% 24%, rgba(244, 198, 114, 0.12), transparent 50%),
    linear-gradient(180deg, rgba(255, 232, 178, 0.06) 0%, transparent 48%, rgba(5, 11, 16, 0.32) 100%);
  animation: pnCanopyShift 14s ease-in-out infinite alternate paused;
  will-change: opacity, transform;
}
.pn-ray {
  position: absolute;
  top: -18%;
  width: 34%;
  height: 125%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 230, 168, 0.03) 28%,
    rgba(255, 236, 184, 0.13) 50%,
    rgba(255, 230, 168, 0.03) 72%,
    transparent 100%
  );
  transform-origin: top center;
  animation: pnRayDrift 18s ease-in-out infinite alternate paused;
  will-change: transform, opacity;
}
.pn-ray-1 { left: 6%; transform: rotate(-18deg); animation-duration: 16s; }
.pn-ray-2 { left: 38%; width: 28%; transform: rotate(-15deg); animation-duration: 21s; animation-delay: -5s; }
.pn-ray-3 { left: 68%; width: 26%; transform: rotate(-20deg); animation-duration: 19s; animation-delay: -9s; }

.pn-motes {
  position: absolute;
  inset: 0;
}
.pn-motes i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff4d1 0%, #f3c46b 55%, transparent 100%);
  opacity: 0;
  animation: pnMoteFloat 11s ease-in-out infinite paused;
  will-change: transform, opacity;
}
.pn-motes i:nth-child(1) { left: 10%; top: 22%; animation-delay: 0s; animation-duration: 10s; }
.pn-motes i:nth-child(2) { left: 19%; top: 48%; animation-delay: 1.7s; animation-duration: 12s; }
.pn-motes i:nth-child(3) { left: 28%; top: 18%; width: 5px; height: 5px; animation-delay: 3.2s; animation-duration: 13s; }
.pn-motes i:nth-child(4) { left: 37%; top: 62%; animation-delay: 0.8s; animation-duration: 11s; }
.pn-motes i:nth-child(5) { left: 46%; top: 28%; animation-delay: 4.1s; animation-duration: 14s; }
.pn-motes i:nth-child(6) { left: 54%; top: 55%; width: 5px; height: 5px; animation-delay: 2.3s; animation-duration: 10.5s; }
.pn-motes i:nth-child(7) { left: 63%; top: 20%; animation-delay: 5.2s; animation-duration: 12.5s; }
.pn-motes i:nth-child(8) { left: 72%; top: 44%; animation-delay: 1.1s; animation-duration: 11.5s; }
.pn-motes i:nth-child(9) { left: 81%; top: 26%; animation-delay: 3.9s; animation-duration: 13.5s; }
.pn-motes i:nth-child(10) { left: 89%; top: 58%; width: 5px; height: 5px; animation-delay: 2.8s; animation-duration: 12s; }
.pn-motes i:nth-child(11) { left: 15%; top: 76%; animation-delay: 4.8s; animation-duration: 11s; }
.pn-motes i:nth-child(12) { left: 67%; top: 78%; animation-delay: 0.4s; animation-duration: 13s; }

#program.is-inview .pn-canopy-glow,
#program.is-inview .pn-ray,
#program.is-inview .pn-motes i {
  animation-play-state: running;
}

@keyframes pnCanopyShift {
  0% { opacity: 0.55; transform: scale(1) translateY(0); }
  100% { opacity: 0.92; transform: scale(1.02) translateY(-6px); }
}
@keyframes pnRayDrift {
  0% { opacity: 0.38; transform: rotate(-18deg) translateX(-14px); }
  100% { opacity: 0.85; transform: rotate(-15deg) translateX(18px); }
}
@keyframes pnMoteFloat {
  0%, 100% { opacity: 0; transform: translate3d(0, 12px, 0) scale(0.75); }
  35% { opacity: 0.85; transform: translate3d(6px, -8px, 0) scale(1.1); }
  70% { opacity: 0.5; transform: translate3d(-5px, -22px, 0) scale(0.95); }
}
@media (max-width: 680px) {
  .pn-ray-3 { display: none; }
  .pn-motes i:nth-child(n+7) { display: none; }
}

/* 3. #water — Water reflection shimmer strictly on water surface & right waterfall strip */
#water.water-section {
  isolation: isolate;
}
.water-fx-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0 40%, rgba(0, 0, 0, 0.75) 66%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0 40%, rgba(0, 0, 0, 0.75) 66%, #000 100%);
}
.water-fx-stream {
  position: absolute;
  inset: -15% -5%;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 28px,
    rgba(168, 244, 255, 0.055) 28px 34px,
    transparent 34px 72px,
    rgba(255, 224, 152, 0.045) 72px 76px,
    transparent 76px 118px
  );
  animation: waterFallStream 12s linear infinite paused;
  will-change: transform, opacity;
}
.water-fx-surface {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  /* Protect upper portrait region (woman face/shoulders/arms); illuminate only bottom water pool & right edge */
  -webkit-mask-image: linear-gradient(180deg, transparent 0 58%, rgba(0, 0, 0, 0.6) 72%, #000 90%);
  mask-image: linear-gradient(180deg, transparent 0 58%, rgba(0, 0, 0, 0.6) 72%, #000 90%);
}
.w-caustics {
  position: absolute;
  inset: 52% -10% -4%;
  background:
    repeating-linear-gradient(
      -8deg,
      transparent 0 18px,
      rgba(176, 245, 255, 0.08) 18px 23px,
      transparent 23px 54px
    );
  mix-blend-mode: screen;
  animation: waterGlintSlide 9s ease-in-out infinite alternate paused;
  will-change: transform, opacity;
}
.w-gold-bands {
  position: absolute;
  inset: 58% -8% 0;
  background:
    radial-gradient(ellipse at 30% 60%, rgba(255, 223, 152, 0.22), transparent 55%),
    radial-gradient(ellipse at 76% 45%, rgba(164, 242, 255, 0.18), transparent 52%);
  mix-blend-mode: screen;
  animation: waterGoldPulse 7.5s ease-in-out infinite alternate paused;
  will-change: transform, opacity;
}
.w-sparks {
  position: absolute;
  inset: 0;
}
.w-sparks i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e6fbff;
  box-shadow: 0 0 8px rgba(178, 247, 255, 0.9), 0 0 14px rgba(255, 218, 138, 0.6);
  opacity: 0;
  animation: sparkTwinkle 4.5s ease-in-out infinite paused;
  will-change: transform, opacity;
}
.w-sparks i:nth-child(1) { left: 16%; bottom: 14%; animation-delay: 0.2s; }
.w-sparks i:nth-child(2) { left: 31%; bottom: 20%; animation-delay: 1.4s; }
.w-sparks i:nth-child(3) { left: 46%; bottom: 10%; animation-delay: 2.3s; }
.w-sparks i:nth-child(4) { left: 68%; bottom: 18%; animation-delay: 0.9s; }
.w-sparks i:nth-child(5) { left: 82%; bottom: 24%; animation-delay: 3.1s; }
.w-sparks i:nth-child(6) { left: 88%; bottom: 12%; animation-delay: 1.9s; }

#water.is-inview .water-fx-stream,
#water.is-inview .w-caustics,
#water.is-inview .w-gold-bands,
#water.is-inview .w-sparks i {
  animation-play-state: running;
}

@keyframes waterFallStream {
  0% { transform: translate3d(0, -18px, 0); opacity: 0.5; }
  50% { opacity: 0.85; }
  100% { transform: translate3d(0, 18px, 0); opacity: 0.5; }
}
@keyframes waterGlintSlide {
  0% { transform: translate3d(-10px, 0, 0); opacity: 0.45; }
  100% { transform: translate3d(12px, -3px, 0); opacity: 0.85; }
}
@keyframes waterGoldPulse {
  0% { opacity: 0.45; transform: scale(0.99); }
  100% { opacity: 0.88; transform: scale(1.02); }
}
@keyframes sparkTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.6) translateY(3px); }
  45% { opacity: 0.95; transform: scale(1.25) translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .art-accordion[open] .art-accordion-body,
  .pn-canopy-glow,
  .pn-ray,
  .pn-motes i,
  .water-fx-stream,
  .w-caustics,
  .w-gold-bands,
  .w-sparks i {
    animation: none !important;
    transition: none !important;
  }
}
