/* =====================================================================
   Водопада — ambient motion layer
   Decorative only: water, leaves, light. Everything here is transform /
   opacity driven, sits behind content, ignores the pointer, pauses when
   off-screen and disappears for prefers-reduced-motion.
   ===================================================================== */

/* ---------- Ambient particle layer (built by js/motifs.js) ---------- */
.amb-host { isolation: isolate; }
.amb {
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none; overflow: hidden;
  contain: layout paint style;
}
.amb-p {
  position: absolute; display: block;
  width: var(--s); height: var(--s);
  opacity: 0;
  animation: amb-drift 20s linear infinite;
  will-change: transform, opacity;
}
.amb-i {
  display: block; width: 100%; height: 100%;
  animation: amb-sway 5s ease-in-out infinite alternate;
}
.amb-i svg { display: block; width: 100%; height: 100%; overflow: visible; }

@keyframes amb-drift {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  14%  { opacity: var(--o); }
  82%  { opacity: var(--o); }
  100% { transform: translate3d(var(--dx), var(--dy), 0); opacity: 0; }
}
@keyframes amb-sway {
  from { transform: translate3d(calc(var(--sw) * -1), 0, 0) rotate(var(--r0)) rotateX(0deg); }
  to   { transform: translate3d(var(--sw), 0, 0) rotate(var(--r1)) rotateX(var(--tx)); }
}

/* light dust in the air */
.amb-mote .amb-i {
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 246, 226, 0.95) 0%, rgba(255, 238, 205, 0.4) 45%, rgba(255, 238, 205, 0) 70%);
}
/* warm out-of-focus lights */
.amb-bokeh .amb-i {
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 200, 140, 0.55) 0%, rgba(220, 176, 110, 0.22) 45%, rgba(220, 176, 110, 0) 70%);
  animation-name: amb-breathe;
}
@keyframes amb-breathe {
  from { transform: translate3d(calc(var(--sw) * -1), 0, 0) scale(0.85); opacity: 0.55; }
  to   { transform: translate3d(var(--sw), 0, 0) scale(1.08); opacity: 1; }
}
/* depth-of-field: the occasional leaf drifting close to the lens */
.amb-soft .amb-i { filter: blur(1.6px); }

/* ---------- Hero: mist moving through the trees ---------- */
.hero-mist { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.hero-mist::before, .hero-mist::after {
  content: ""; position: absolute; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(232, 238, 224, 0.16), rgba(232, 238, 224, 0));
  will-change: transform;
}
.hero-mist::before { width: 80vw; height: 46vh; left: -20vw; bottom: -12vh; animation: mist-a 42s ease-in-out infinite alternate; }
.hero-mist::after  { width: 60vw; height: 34vh; right: -18vw; top: 18vh; opacity: 0.7; animation: mist-b 56s ease-in-out infinite alternate; }
@keyframes mist-a { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(22vw, -3vh, 0); } }
@keyframes mist-b { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-18vw, 4vh, 0); } }

/* gentle depth while scrolling past the hero (desktop only, set by JS) */
.hero.has-parallax .hero-img { top: -70px; height: calc(100% + 140px); translate: 0 var(--hero-shift, 0px); }
.hero.has-parallax .hero-content { translate: 0 calc(var(--hero-shift, 0px) * -0.35); }

/* ---------- Water: the recurring motif ---------- */
/* The hairlines beside every section label become a slow ripple of water */
.eyebrow::before, .section-head .eyebrow::after {
  width: 40px; height: 6px; opacity: 0.75;
  -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='6' viewBox='0 0 16 6'%3E%3Cpath d='M0 3 Q4 0.6 8 3 T16 3' fill='none' stroke='black' stroke-width='1.1'/%3E%3C/svg%3E") 0 50% / 16px 6px repeat-x;
          mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='6' viewBox='0 0 16 6'%3E%3Cpath d='M0 3 Q4 0.6 8 3 T16 3' fill='none' stroke='black' stroke-width='1.1'/%3E%3C/svg%3E") 0 50% / 16px 6px repeat-x;
  animation: water-line 3.6s linear infinite;
}
.section-head .eyebrow::after { animation-direction: reverse; }
@keyframes water-line { from { -webkit-mask-position: 0 50%; mask-position: 0 50%; } to { -webkit-mask-position: -16px 50%; mask-position: -16px 50%; } }

/* A living water surface where one section flows into the next */
.wave-edge {
  position: absolute; left: 0; right: 0; top: -1px; height: 30px; z-index: 3;
  overflow: hidden; pointer-events: none; color: var(--wave-color, var(--color-cream));
}
.wave-edge svg {
  position: absolute; top: 0; left: 0; width: 200%; height: 100%;
  animation: wave-slide 26s linear infinite; will-change: transform;
}
.wave-edge svg.wave-back { opacity: 0.4; animation-duration: 38s; animation-direction: reverse; }
@keyframes wave-slide { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }

/* Concentric ripples, as if a drop just met still water */
.ripples {
  position: absolute; z-index: -1; width: 560px; height: 560px; pointer-events: none;
  color: rgba(176, 133, 83, 0.38);
}
.ripples span {
  position: absolute; inset: 0; border-radius: 50%; border: 1px solid currentColor;
  opacity: 0; transform: scale(0.15);
  animation: ripple 13s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
  will-change: transform, opacity;
}
.ripples span:nth-child(2) { animation-delay: 4.3s; }
.ripples span:nth-child(3) { animation-delay: 8.6s; }
@keyframes ripple {
  0%   { transform: scale(0.15); opacity: 0; }
  12%  { opacity: 0.9; }
  100% { transform: scale(1); opacity: 0; }
}
.reserve .ripples { left: -170px; top: 40px; }
.site-footer .ripples { right: -180px; bottom: -220px; color: rgba(220, 192, 147, 0.16); }

/* ---------- Reservation: the phone icon breathes, the button does not ---------- */
.phone-cta { position: relative; }
.phone-cta::before {
  content: ""; position: absolute; left: 0; top: calc(50% - 3px); width: 54px; height: 54px; margin-top: -27px;
  border-radius: 50%; border: 1px solid var(--color-wood); pointer-events: none;
  animation: breathe 4.8s cubic-bezier(0.25, 0.6, 0.3, 1) infinite;
}
@keyframes breathe { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(1.65); opacity: 0; } }

/* ---------- Events: a slow, warm slideshow in place of the video ---------- */
.events-stage { position: absolute; inset: 0; overflow: hidden; background: var(--forest); }
.events-stage img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; will-change: transform, opacity;
  animation: stage 27s linear infinite both;
}
.events-stage img:nth-child(1) { transform-origin: 30% 60%; }
.events-stage img:nth-child(2) { transform-origin: 70% 40%; animation-delay: 9s; }
.events-stage img:nth-child(3) { transform-origin: 50% 30%; animation-delay: 18s; }
@keyframes stage {
  0%   { opacity: 0; transform: scale(1.14); }
  6%   { opacity: 1; }
  33%  { opacity: 1; }
  40%  { opacity: 0; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1.02); }
}

/* live music: a quiet pulse beside the section label */
.eyebrow.has-sound::before { display: none; }
.sound-wave { display: inline-flex; align-items: center; gap: 3px; height: 14px; }
.sound-wave i {
  display: block; width: 2px; height: 100%; border-radius: 2px; background: currentColor; opacity: 0.85;
  transform-origin: 50% 50%; transform: scaleY(0.3);
  animation: sound 1.4s ease-in-out infinite alternate;
}
.sound-wave i:nth-child(1) { animation-duration: 1.3s; }
.sound-wave i:nth-child(2) { animation-duration: 0.9s; animation-delay: -0.4s; }
.sound-wave i:nth-child(3) { animation-duration: 1.1s; animation-delay: -0.8s; }
.sound-wave i:nth-child(4) { animation-duration: 0.8s; animation-delay: -0.2s; }
.sound-wave i:nth-child(5) { animation-duration: 1.5s; animation-delay: -0.6s; }
@keyframes sound { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }

/* ---------- Gallery: cinematic entrances ---------- */
html .gallery-item.reveal {
  transform: translate3d(0, 36px, 0) scale(0.975);
  clip-path: inset(9% 0 0 0 round var(--radius));
  transition: opacity 1000ms var(--ease), transform 1300ms var(--ease), clip-path 1300ms var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
html .gallery-item.reveal.in-view { transform: none; clip-path: inset(0 0 0 0 round var(--radius)); }
html .gallery-item.reveal img { transform: scale(1.14); transition: transform 1700ms var(--ease); transition-delay: var(--reveal-delay, 0ms); }
html .gallery-item.reveal.in-view img { transform: scale(1); }

/* offering cards drift in with a touch more depth */
html .offering-card.reveal { transform: translate3d(0, 40px, 0) scale(0.97); }
html .offering-card.reveal.in-view { transform: none; }

/* ---------- Pause everything that is off-screen ---------- */
.is-offscreen, .is-offscreen *, .is-offscreen *::before, .is-offscreen *::after,
.amb-paused .amb-p, .amb-paused .amb-i { animation-play-state: paused !important; }

/* ---------- Small screens: lighter, shorter, calmer ---------- */
@media (max-width: 768px) {
  .wave-edge { height: 18px; }
  .ripples { width: 340px; height: 340px; }
  .reserve .ripples { left: -150px; top: 10px; }
  .hero-mist::after { display: none; }
  html .gallery-item.reveal { clip-path: none; transform: translate3d(0, 24px, 0); }
  html .gallery-item.reveal img { transform: scale(1.08); }
  .amb-soft .amb-i { filter: none; }
}

/* ---------- Reduced motion: keep it still ---------- */
@media (prefers-reduced-motion: reduce) {
  .amb, .hero-mist, .ripples, .sound-wave { display: none !important; }
  .eyebrow.has-sound::before { display: block; }
  .wave-edge svg, .eyebrow::before, .section-head .eyebrow::after, .phone-cta::before { animation: none !important; }
  .phone-cta::before { opacity: 0; }
  .events-stage img { animation: none !important; opacity: 0; transform: none; }
  .events-stage img:first-child { opacity: 1; }
  html .gallery-item.reveal, html .gallery-item.reveal img, html .offering-card.reveal { transform: none; clip-path: none; }
}
