/* Subtle scroll-triggered fade-in — the only motion used on this site.
   Scoped under .js (set by an inline script in <head>) so content stays
   fully visible if JavaScript fails or hasn't run yet — no-JS visitors
   and crawlers always see complete content. */
.js .fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.js .fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Continuous breathing pulse on every photo placeholder/photo, everywhere
   on the site — a slow, gentle scale echoing the brand's breathwork theme. */
@keyframes media-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.015);
  }
}

.media__surface {
  animation: media-pulse 7s ease-in-out infinite;
}

/* Ken Burns zoom layers. .zoom-in--onload settles once automatically when
   a hero paints; .zoom-in--onscroll settles once when its parent .story
   section scrolls into view (driven by the existing .fade-in/.is-visible
   IntersectionObserver in main.js — .story carries both classes). */
@keyframes zoom-settle {
  from {
    transform: scale(1.05);
  }
  to {
    transform: scale(1);
  }
}

.zoom-in--onload {
  animation: zoom-settle 2.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.zoom-in--onscroll {
  transform: scale(1.06);
  transition: transform 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.js .story.is-visible .zoom-in--onscroll {
  transform: scale(1);
}

/* Intro veil — "embrace the flow within" appears like ink from a pen
   (a soft-edged mask sweeping left to right) while a thin wave draws
   underneath at the same pace and then keeps swaying. At 2.6s the veil
   lifts upward, its wavy lower edge passing over the page like a wave
   pulling back. Only under html.arrive (head script); main.js adds
   .arrival--skip on click or key press and removes the veil at the end. */
@keyframes arrival-ink {
  to {
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
  }
}

@keyframes arrival-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes arrival-sway {
  50% {
    transform: scaleY(0.4);
  }
}

@keyframes arrival-lift {
  to {
    transform: translateY(-115%);
    visibility: hidden;
  }
}

.arrive .arrival {
  animation: arrival-lift 1s cubic-bezier(0.7, 0, 0.3, 1) 2.6s forwards;
}

.arrive .arrival--skip {
  animation: arrival-lift 0.6s cubic-bezier(0.7, 0, 0.3, 1) forwards;
}

.arrive .arrival__mark {
  -webkit-mask-image: linear-gradient(90deg, black 40%, transparent 60%);
  mask-image: linear-gradient(90deg, black 40%, transparent 60%);
  -webkit-mask-size: 250% 100%;
  mask-size: 250% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
  animation: arrival-ink 1.8s cubic-bezier(0.45, 0, 0.25, 1) 0.2s forwards;
}

.arrive .arrival__wave path {
  stroke-dasharray: 270;
  stroke-dashoffset: 270;
  animation: arrival-draw 1.8s cubic-bezier(0.45, 0, 0.25, 1) 0.2s forwards;
}

.arrive .arrival__wave {
  animation: arrival-sway 2.2s ease-in-out 2s infinite;
}

/* Breathing guide — one 12s cycle: 4s inhale, 2s hold, 4s exhale, 2s
   rest. Circle and labels share the same duration/clock so they stay in
   sync forever without JS. */
@keyframes breath-cycle {
  0% {
    transform: scale(0.58);
  }
  33.33% {
    transform: scale(1);
  }
  50% {
    transform: scale(1);
  }
  83.33% {
    transform: scale(0.58);
  }
  100% {
    transform: scale(0.58);
  }
}

.breath__circle {
  animation: breath-cycle 12s ease-in-out infinite;
}

@keyframes breath-label-in {
  0%, 33%, 100% { opacity: 0; }
  5%, 28% { opacity: 1; }
}

@keyframes breath-label-hold {
  0%, 33%, 50%, 100% { opacity: 0; }
  37%, 46% { opacity: 1; }
}

@keyframes breath-label-out {
  0%, 50%, 83%, 100% { opacity: 0; }
  55%, 78% { opacity: 1; }
}

@keyframes breath-label-rest {
  0%, 83%, 100% { opacity: 0; }
  87%, 96% { opacity: 1; }
}

.breath__label--in {
  animation: breath-label-in 12s linear infinite;
}
.breath__label--hold {
  animation: breath-label-hold 12s linear infinite;
}
.breath__label--out {
  animation: breath-label-out 12s linear infinite;
}
.breath__label--rest {
  animation: breath-label-rest 12s linear infinite;
}

/* Reduced motion. The wave band (Home, About) and the testimonial
   carousel are driven by js/main.js, which checks the same preference and
   leaves them still. */
@media (prefers-reduced-motion: reduce) {
  .js .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .media__surface {
    animation: none;
  }

  .zoom-in--onload,
  .zoom-in--onscroll {
    animation: none;
    transition: none;
    transform: scale(1);
  }

  .arrival,
  .arrive .arrival {
    display: none;
  }

  .breath__circle {
    animation: none;
    transform: scale(0.8);
  }

  .breath__label {
    animation: none;
    opacity: 0;
  }
}
