/*
 * Lifestyle App Studios — shared demo base styles
 * Behaviour that is identical across every demo lane. Palette/typography tokens
 * live per-page (each lane has its own), this file only carries motion plumbing,
 * resets and a11y safety. Loaded alongside Tailwind (CDN) on each demo page.
 */

/* Smooth in-page anchor scrolling, but never fight reduced-motion users. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/*
 * Pre-hide animated elements ONLY when motion will actually run. The <head>
 * inline script adds `.has-motion` to <html> when the user has NOT requested
 * reduced motion. If JS/GSAP fails, motion.js forces these visible again, and
 * reduced-motion users never get the class — so content is never trapped behind
 * a broken animation. (GR-safe: no content hidden behind JS that can fail.)
 */
.has-motion [data-reveal],
.has-motion [data-stagger] > * { opacity: 0; will-change: transform, opacity; }

/* Parallax layers must not create horizontal scrollbars while they drift. */
[data-parallax] { will-change: transform; }
section { overflow: hidden; }

/* Accessible focus ring, consistent across lanes (uses each lane's ring token). */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--color-ring, #92400E);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Honour prefers-reduced-motion for the Spline 3D embed used on some lanes. */
@media (prefers-reduced-motion: reduce) {
  spline-viewer { display: none; }
}

/* Utility: subtle grain/vignette hooks some lanes opt into. */
.vignette::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 120% at 50% 0%, transparent 55%, rgba(0,0,0,0.45) 100%);
}
