/* Hairology Studio — Warm Minimal motion
   Subtle live effects for the mockup. All animations use only
   transform and opacity. Nothing here hides content unless
   JavaScript has already added the motion-on class to <html>.
   If the script never runs, the page looks exactly as it did.
   Seasonal snow / lights (if present) sit above the hero shimmer.
*/

/* ---------- Feature classes (added by motion.js) ---------- */
/* html.motion-on            master switch, only when motion is allowed */
/* html.motion-logo          logo fade-in on load */
/* html.motion-reveal-on     section fade-and-rise on scroll */
/* html.motion-shimmer       drifting linen light in the hero */
/* html.motion-gallery       gentle photo zoom on hover */
/* html.motion-breathe       soft glow on Text to book */
/* html.motion-smooth        smooth in-page scrolling */

html.motion-smooth {
  scroll-behavior: smooth;
}

/* Hero stays a positioning context so the shimmer (and any
   seasonal snow later) can sit in the background. Overflow
   stays visible so seasonal decorations are not clipped. */
.hero {
  position: relative;
}

.hero > .wrap {
  position: relative;
  z-index: 2;
}

/* ---------- Logo fade-in ---------- */
@keyframes motion-logo-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

html.motion-on.motion-logo .hero-logo {
  animation: motion-logo-in 1.15s ease-out both;
}

/* ---------- Section reveal ---------- */
/* Hidden only after JS marks a below-the-fold section. */
html.motion-on.motion-reveal-on .motion-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.95s ease, transform 0.95s ease;
}

html.motion-on.motion-reveal-on .motion-reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Hero linen shimmer ---------- */
/* z-index 0 sits under the hero copy (wrap is 2, or 3 when a
   seasonal layer is active) and under seasonal snow / lights
   (those use z-index 1). pointer-events none, so it never
   blocks clicks or seasonal layers. */
.motion-linen {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.motion-linen span {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 252, 245, 0.7) 0%,
    rgba(250, 246, 240, 0.28) 42%,
    rgba(250, 246, 240, 0) 70%
  );
  animation-name: motion-linen-drift;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.motion-linen span:nth-child(1) {
  width: 70%;
  height: 80%;
  top: -18%;
  left: -8%;
  animation-duration: 28s;
}

.motion-linen span:nth-child(2) {
  width: 55%;
  height: 60%;
  top: 30%;
  right: -12%;
  left: auto;
  opacity: 0.7;
  animation-duration: 36s;
  animation-delay: -8s;
}

@keyframes motion-linen-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(6%, -5%) scale(1.08); }
}

/* ---------- Gallery hover zoom ---------- */
html.motion-on.motion-gallery .g-grid figure img,
html.motion-on.motion-gallery .ba-grid .frame img {
  transition: transform 0.8s ease;
  transform-origin: center center;
}

html.motion-on.motion-gallery .g-grid figure:hover img,
html.motion-on.motion-gallery .ba-grid figure:hover .frame img {
  transform: scale(1.04);
}

/* ---------- Text to book — soft breath ---------- */
html.motion-on.motion-breathe .hero .btn {
  position: relative;
  z-index: 0;
}

html.motion-on.motion-breathe .hero .btn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 130%;
  height: 180%;
  z-index: -1;
  pointer-events: none;
  border-radius: 2px;
  background: radial-gradient(
    ellipse at center,
    rgba(122, 78, 56, 0.32) 0%,
    rgba(122, 78, 56, 0.1) 42%,
    rgba(122, 78, 56, 0) 70%
  );
  transform: translate(-50%, -50%) scale(0.94);
  animation: motion-breathe 3.8s ease-in-out infinite;
}

@keyframes motion-breathe {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(0.94); }
  50%      { opacity: 0.75; transform: translate(-50%, -50%) scale(1.08); }
}

/* A quieter pulse on the header button of the same name */
html.motion-on.motion-breathe nav a.cta {
  position: relative;
  z-index: 0;
}

html.motion-on.motion-breathe nav a.cta::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120%;
  height: 160%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(122, 78, 56, 0.22) 0%,
    rgba(122, 78, 56, 0) 70%
  );
  transform: translate(-50%, -50%) scale(0.96);
  animation: motion-breathe 4.4s ease-in-out infinite;
  animation-delay: -1.2s;
}

/* ---------- Respect reduced motion, always ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  html.motion-on .hero-logo,
  html.motion-on.motion-breathe .hero .btn::after,
  html.motion-on.motion-breathe nav a.cta::after,
  .motion-linen span {
    animation: none !important;
  }

  html.motion-on.motion-reveal-on .motion-reveal,
  html.motion-on.motion-reveal-on .motion-reveal.is-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  html.motion-on.motion-gallery .g-grid figure img,
  html.motion-on.motion-gallery .ba-grid .frame img,
  html.motion-on.motion-gallery .g-grid figure:hover img,
  html.motion-on.motion-gallery .ba-grid figure:hover .frame img {
    transform: none !important;
    transition: none !important;
  }

  .motion-linen {
    display: none !important;
  }

  html.motion-on.motion-breathe .hero .btn::after,
  html.motion-on.motion-breathe nav a.cta::after {
    content: none !important;
  }
}
