/*!
 * motion.css — Site Me motion tokens + states v1.0.0 (2026-06-10)
 * Ships VERBATIM with every Site Me build, linked BEFORE the build's own
 * stylesheet. Never edit per-site — give each build its own motion character
 * by overriding the tokens below in the build's :root, e.g.:
 *
 *   :root { --reveal-duration: 700ms; --reveal-distance: 36px; }   (languid)
 *   :root { --reveal-duration: 420ms; --reveal-distance: 16px; }   (snappy)
 *
 * Every hidden-initial state is scoped under html.js (set by the inline boot
 * snippet) so a no-JS visitor sees the entire page, static. The
 * prefers-reduced-motion block at the bottom is the second guarantee.
 */

:root {
  /* Easing (from the sitemefrontend animation framework) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  /* Reveal character — override per build */
  --reveal-duration: 600ms;
  --reveal-distance: 28px;
  --reveal-scale: 0.96;

  /* Micro-interactions */
  --micro-duration: 160ms;
  --lift-distance: -4px;
  --lift-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

/* ------------------------------------------------------- scroll reveals -- */
/* Hidden states ONLY under html.js — no-JS users see everything. */

/* Pre-reveal slide-left/right transforms protrude past the viewport edge and
   would expand the page's horizontal scroll area (the classic reveal-library
   bug). overflow-x: clip kills that bleed without creating a scroll container.
   It must be on BOTH html and body: the root's overflow propagates to the
   viewport and the root's own used value resets to visible, so body has to
   clip its content too (verified empirically in Chromium — either one alone
   still reports horizontal overflow). Scoped under html.js so no-JS rendering
   is untouched; vertical scrolling and position:sticky are unaffected. */
html.js,
html.js body {
  overflow-x: clip;
}
html.js [data-animate] {
  opacity: 0;
  transition:
    opacity var(--reveal-duration) var(--ease-out),
    transform var(--reveal-duration) var(--ease-out),
    clip-path var(--reveal-duration) var(--ease-out);
}
html.js [data-animate='fade-up'] {
  transform: translateY(var(--reveal-distance));
}
html.js [data-animate='fade-down'] {
  transform: translateY(calc(var(--reveal-distance) * -1));
}
html.js [data-animate='scale-in'] {
  transform: scale(var(--reveal-scale));
}
html.js [data-animate='slide-left'] {
  transform: translateX(calc(var(--reveal-distance) * 1.6));
}
html.js [data-animate='slide-right'] {
  transform: translateX(calc(var(--reveal-distance) * -1.6));
}
/* clip-reveal clips the CHILDREN, never the observed element itself —
   Chromium factors an element's own clip-path into IntersectionObserver's
   intersection ratio, so an element clipped to zero area NEVER reports as
   intersecting and the reveal never fires (found on a real build, 2026-06-11).
   Children keep their own geometry for the curtain wipe; the observed parent
   stays fully measurable. */
html.js [data-animate='clip-reveal'] {
  opacity: 1;
  clip-path: none;
}
html.js [data-animate='clip-reveal'] > * {
  clip-path: inset(0 0 100% 0);
  transition: clip-path var(--reveal-duration) var(--ease-out);
  transition-delay: inherit; /* picks up the parent's data-delay */
}
html.js [data-animate].in {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
}
html.js [data-animate='clip-reveal'].in > * {
  clip-path: inset(0 0 0 0);
}

/* --------------------------------------------------- micro-interactions -- */
.hover-lift {
  transition:
    transform var(--micro-duration) var(--ease-out),
    box-shadow var(--micro-duration) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .hover-lift:hover {
    transform: translateY(var(--lift-distance));
    box-shadow: var(--lift-shadow);
  }
}

/* Buttons must feel pressed (sitemefrontend Part 4). Apply .press to CTAs. */
.press {
  transition: transform var(--micro-duration) var(--ease-out);
}
.press:active {
  transform: scale(0.97);
}

/* Animated link underline — left-to-right draw on hover/focus. */
.link-underline {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 240ms var(--ease-out);
  text-decoration: none;
  padding-bottom: 2px;
}
.link-underline:hover,
.link-underline:focus-visible {
  background-size: 100% 1px;
}

/* Image zoom inside a card — pair with overflow:hidden on .zoom-frame. */
.zoom-frame {
  overflow: hidden;
}
.zoom-frame img {
  transition: transform 600ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .zoom-frame:hover img {
    transform: scale(1.04);
  }
}

/* Count-up stats never reflow while counting. */
[data-count-to] {
  font-variant-numeric: tabular-nums;
}

/* data-magnetic moves via inline transform from motion.js. */
[data-magnetic] {
  transition: transform 240ms var(--ease-out);
  will-change: transform;
}

/* ----------------------------------------------------------- scroll nav -- */
/* Base hook only — builds style .nav--scrolled (background, shadow, CTA). */
[data-nav] {
  transition:
    background-color 300ms var(--ease-out),
    box-shadow 300ms var(--ease-out);
}

/* --------------------------------------------------------------- marquee -- */
/* Base overflow guard applies in every state (no-JS, reduced motion, pre-init)
   so a nowrap marquee row can never cause horizontal page scroll. */
[data-marquee] {
  overflow: hidden;
}
[data-marquee].marquee--on {
  display: flex;
  overflow: hidden;
  gap: var(--marquee-gap, 3rem);
}
[data-marquee].marquee--on .marquee__group {
  display: flex;
  align-items: center;
  gap: var(--marquee-gap, 3rem);
  flex-shrink: 0;
  min-width: 100%;
  animation: marquee-scroll var(--marquee-duration, 30s) linear infinite;
}
[data-marquee].marquee--on:hover .marquee__group {
  animation-play-state: paused;
}
@keyframes marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-100% - var(--marquee-gap, 3rem)));
  }
}

/* ------------------------------------------------------------- accordion -- */
/* Markup contract (components.md): button[aria-expanded] then .acc-panel.   */
.acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms var(--ease-in-out);
}
.acc-panel > * {
  overflow: hidden;
  min-height: 0;
}
button[aria-expanded='true'] + .acc-panel {
  grid-template-rows: 1fr;
}
/* No-JS: panels render open (collapse only when the runtime is present). */
html:not(.js) .acc-panel {
  grid-template-rows: 1fr;
}

/* --------------------------------------------------------------- carousel -- */
/* No-JS / pre-init: slides stack vertically, all readable. */
[data-carousel].carousel--on {
  position: relative;
}
[data-carousel].carousel--on .carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 600ms var(--ease-out);
}
[data-carousel].carousel--on .carousel__slide.is-active {
  position: relative;
  opacity: 1;
}
.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 1.25rem;
}
.carousel__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
  cursor: pointer;
  transition: opacity var(--micro-duration) var(--ease-out), transform var(--micro-duration) var(--ease-out);
}
.carousel__dot.is-active {
  opacity: 1;
  transform: scale(1.2);
}

/* --------------------------------------------------------- hotspot pulse -- */
/* Signature centerpiece hotspots (sitemefrontend Part 11 technique). */
.hotspot {
  position: relative;
}
.hotspot::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid var(--accent, currentColor);
  border-radius: 50%;
  opacity: 0;
  animation: hotspot-pulse 2s ease-out infinite;
}
@keyframes hotspot-pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* ------------------------------------------------------- reduced motion -- */
/* Movement is removed; opacity/colour feedback stays (sitemefrontend Part 8).
   Covers [data-animate] and the legacy [data-reveal] attribute (vault
   accessibility-checklist.md hardcodes [data-reveal]). */
@media (prefers-reduced-motion: reduce) {
  html.js [data-animate],
  html.js [data-animate='clip-reveal'] > *,
  html.js [data-reveal],
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
  }
  [data-parallax],
  [data-magnetic] {
    transform: none !important;
    transition: none !important;
  }
  [data-marquee].marquee--on .marquee__group {
    animation: none !important;
  }
  .hotspot::after {
    animation: none !important;
    opacity: 0 !important;
  }
  .hover-lift,
  .zoom-frame img,
  .press {
    transition: none !important;
  }
  .hover-lift:hover {
    transform: none !important;
  }
  .zoom-frame:hover img {
    transform: none !important;
  }
  [data-carousel].carousel--on .carousel__slide {
    transition: opacity 1ms linear;
  }
}
