/* =========================================================
   Divine Care — strong MPSDE-style scroll motion
   ========================================================= */

@keyframes motion-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes motion-revealIn {
  from {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes motion-floatIn {
  from {
    opacity: 0;
    transform: translate3d(0, 70px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes motion-slideLeft {
  from {
    opacity: 0;
    transform: translate3d(-88px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes motion-slideRight {
  from {
    opacity: 0;
    transform: translate3d(88px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes motion-topbarIn {
  from {
    opacity: 0;
    transform: translate3d(0, -10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes motion-zoomIn {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Hidden until .is-in — large travel so scroll motion is obvious */
[data-motion] {
  opacity: 0;
  will-change: opacity, transform, clip-path;
}

/* Clear finished animation so it can replay on scroll-up re-entry */
[data-motion]:not(.is-in) {
  animation: none !important;
}

[data-motion].is-in {
  opacity: 1;
}

[data-motion="fadeIn"].is-in {
  animation: motion-fadeIn 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

[data-motion="revealIn"] {
  clip-path: inset(0 100% 0 0);
}
[data-motion="revealIn"].is-in {
  animation: motion-revealIn 1.15s cubic-bezier(0.645, 0.045, 0.355, 1) both;
}

[data-motion="floatIn"] {
  transform: translate3d(0, 70px, 0);
}
[data-motion="floatIn"].is-in {
  animation: motion-floatIn 1.05s cubic-bezier(0.22, 1, 0.36, 1) both;
}

[data-motion="slideLeft"] {
  transform: translate3d(-88px, 0, 0);
}
[data-motion="slideLeft"].is-in {
  animation: motion-slideLeft 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

[data-motion="slideRight"] {
  transform: translate3d(88px, 0, 0);
}
[data-motion="slideRight"].is-in {
  animation: motion-slideRight 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Top bar soft entrance */
.top-bar__contact,
.top-bar__right {
  animation: motion-topbarIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.top-bar__right {
  animation-delay: 0.12s;
}

[data-motion="zoomIn"] {
  transform: scale(0.88);
}
[data-motion="zoomIn"].is-in {
  animation: motion-zoomIn 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

[data-motion-delay="1"].is-in { animation-delay: 0.12s; }
[data-motion-delay="2"].is-in { animation-delay: 0.28s; }
[data-motion-delay="3"].is-in { animation-delay: 0.44s; }
[data-motion-delay="4"].is-in { animation-delay: 0.6s; }
[data-motion-delay="5"].is-in { animation-delay: 0.76s; }

/* Legacy data-animate */
[data-animate]:not(.is-in) {
  opacity: 0;
}
[data-animate].is-in {
  opacity: 1;
  transform: none;
  transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1),
              transform 1.15s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-animate="fade-up"]:not(.is-in),
[data-animate="float"]:not(.is-in) { transform: translateY(96px); }
[data-animate="fade-left"]:not(.is-in) { transform: translateX(-88px); }
[data-animate="fade-right"]:not(.is-in) { transform: translateX(88px); }
[data-animate="zoom-in"]:not(.is-in) { transform: scale(0.88); }

.reveal:not(.is-visible):not(.is-in) {
  opacity: 0;
  transform: translateY(72px);
}
.reveal.is-visible,
.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 1.1s ease, transform 1.15s ease;
}

/* Hero media — JS parallax */
.hero__media,
.mountain-cta__media {
  will-change: transform;
  transition: none !important;
  animation: none !important;
}

/* Hero entrance — clear staggered float */
.hero__content > * {
  opacity: 0;
  transform: translateY(36px);
}
.hero--ready .hero__content > * {
  animation: motion-floatIn 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero--ready .hero__content > *:nth-child(1) { animation-delay: 0.15s; }
.hero--ready .hero__content > *:nth-child(2) { animation-delay: 0.35s; }
.hero--ready .hero__content > *:nth-child(3) { animation-delay: 0.5s; }
.hero--ready .hero__content > *:nth-child(4) { animation-delay: 0.65s; }
.hero--ready .hero__content > *:nth-child(5) { animation-delay: 0.85s; }

.hero__actions .btn {
  opacity: 0;
  transform: translateY(28px);
}
.hero--ready .hero__actions .btn {
  animation: motion-floatIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero--ready .hero__actions .btn:nth-child(1) { animation-delay: 0.7s; }
.hero--ready .hero__actions .btn:nth-child(2) { animation-delay: 0.82s; }
.hero--ready .hero__actions .btn:nth-child(3) { animation-delay: 0.94s; }
.hero--ready .hero__actions .btn:nth-child(4) { animation-delay: 1.06s; }
.hero--ready .hero__actions .btn:nth-child(5) { animation-delay: 1.18s; }

/* Wave stack — slight parallax via JS class */
.wave-stack {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.wave-stack__layer {
  position: absolute;
  left: -3%;
  right: -3%;
  bottom: 0;
  width: 106%;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% 100%;
  will-change: transform;
  transition: transform 0.1s linear;
}

.wave-stack__layer:nth-child(1) {
  height: 120px;
  opacity: 0.42;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 91 1920 209' preserveAspectRatio='none'%3E%3Cpath fill='%2300453e' d='M1920 291C1656.8 169.2 1323.3 91 960 91S262.5 169.2 0 291v9h1920v-9z'/%3E%3C/svg%3E");
}
.wave-stack__layer:nth-child(2) {
  height: 98px;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 91 1920 209' preserveAspectRatio='none'%3E%3Cpath fill='%23c5a059' d='M1920 291C1656.8 169.2 1323.3 91 960 91S262.5 169.2 0 291v9h1920v-9z'/%3E%3C/svg%3E");
}
.wave-stack__layer:nth-child(3) {
  height: 76px;
  opacity: 0.72;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 91 1920 209' preserveAspectRatio='none'%3E%3Cpath fill='%230f5c52' d='M1920 291C1656.8 169.2 1323.3 91 960 91S262.5 169.2 0 291v9h1920v-9z'/%3E%3C/svg%3E");
}
.wave-stack__layer:nth-child(4) {
  height: 54px;
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 91 1920 209' preserveAspectRatio='none'%3E%3Cpath fill='%23e8f2ee' d='M1920 291C1656.8 169.2 1323.3 91 960 91S262.5 169.2 0 291v9h1920v-9z'/%3E%3C/svg%3E");
}

.mountain-cta {
  position: relative;
  width: 100%;
  min-height: clamp(360px, 48vh, 480px);
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  color: #fff;
  isolation: isolate;
  background: #0a3d36;
}

.mountain-cta__media {
  position: absolute;
  left: 0;
  right: 0;
  top: -12%;
  bottom: -18%;
  z-index: -2;
  background-color: #0a3d36;
  background-image: url("../images/session.jpg");
  background-position: center 8%;
  background-size: cover;
  background-repeat: no-repeat;
  transform: translate3d(0, 0, 0) scale(1.14);
  will-change: transform;
}

.mountain-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0.22) 0%, rgba(10, 61, 54, 0.45) 70%),
    linear-gradient(180deg, rgba(10, 61, 54, 0.28) 0%, rgba(7, 46, 41, 0.5) 100%);
}

.mountain-cta__content {
  position: relative;
  z-index: 1;
  padding: 4rem 1.25rem;
}

.mountain-cta h2 {
  color: #fff;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  margin-bottom: 1.25rem;
}

.btn {
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.4s ease,
    color 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.35s ease;
}

.media-frame {
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(10, 61, 54, 0.14);
  transition: transform 0.55s ease, box-shadow 0.55s;
}
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.9s ease;
}
.media-frame:hover {
  transform: translateY(-6px);
}
.media-frame:hover img {
  transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
  [data-motion],
  [data-animate],
  .reveal,
  .hero__content > *,
  .hero__actions .btn,
  .hero__media,
  .mountain-cta__media {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}
