/* ==========================================================================
   Motion layer. Everything here is progressive enhancement:
   - content is fully visible without JavaScript
   - everything is switched off under prefers-reduced-motion
   ========================================================================== */

/* ---------- loader (first visit per browser session only) ---------- */
.loader {
  position: fixed; inset: 0; z-index: 1000; display: none; place-items: center;
  background: var(--ink); color: var(--cream);
  background-image: radial-gradient(circle at 50% 45%, rgba(232, 24, 32, .28), transparent 55%);
}
html.show-loader .loader { display: grid; animation: loaderFailsafe .01s linear 2.6s forwards; }
html.show-loader.loader-done .loader { animation: none; opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s .45s; }
.loader__inner { display: grid; justify-items: center; gap: 1.6rem; }
.loader__logo { width: min(66vw, 380px); animation: loaderPop .75s cubic-bezier(.2, 1.4, .4, 1) both; }
.loader__bar { width: min(54vw, 260px); height: 8px; background: rgba(255, 246, 227, .2); overflow: hidden; }
.loader__bar::after { content: ""; display: block; height: 100%; width: 100%; background: var(--yellow); transform: translateX(-100%); animation: loaderBar 1s .15s ease-out forwards; }
.loader__burst { position: absolute; width: min(120vw, 900px); opacity: .1; animation: spin 14s linear infinite; pointer-events: none; }

@keyframes loaderPop { from { transform: scale(.55) rotate(-8deg); opacity: 0; } to { transform: scale(1) rotate(-3deg); opacity: 1; } }
@keyframes loaderBar { to { transform: translateX(0); } }
@keyframes loaderFailsafe { to { opacity: 0; visibility: hidden; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- hero entrance: one orchestrated moment ---------- */
html.js .hero__logo, html.js .hero__title span, html.js .hero__lead, html.js .hero__cta {
  opacity: 0; transform: translateY(26px);
}
html.js.ready .hero__title span:nth-child(1) { animation: heroIn .8s .2s var(--ease) forwards; }
html.js.ready .hero__title span:nth-child(2) { animation: heroIn .8s .38s var(--ease) forwards; }
html.js.ready .hero__lead { animation: heroIn .8s .55s var(--ease) forwards; }
html.js.ready .hero__cta { animation: heroIn .8s .7s var(--ease) forwards; }
@keyframes heroIn { to { opacity: 1; transform: none; } }
html.js.ready .hero__logo { animation: heroLogo .9s .05s var(--ease) forwards; }
@keyframes heroLogo { from { opacity: 0; transform: translateY(26px) rotate(-8deg) scale(.9); } to { opacity: 1; transform: rotate(-3deg); } }

/* ---------- scroll reveals ---------- */
html.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
html.js .reveal.is-in { opacity: 1; transform: none; }
html.js .reveal-left { opacity: 0; transform: translateX(-36px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
html.js .reveal-left.is-in { opacity: 1; transform: none; }
html.js .reveal-right { opacity: 0; transform: translateX(36px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
html.js .reveal-right.is-in { opacity: 1; transform: none; }

/* image wipe: the frame stays put (so IntersectionObserver can see it), its content opens, the photo settles */
html.js .img-reveal img { transform: scale(1.18); transition: transform 1.4s var(--ease) var(--d, 0s); }
html.js .img-reveal > img, html.js .img-reveal > a {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1s var(--ease) var(--d, 0s), transform 1.4s var(--ease) var(--d, 0s);
}
html.js .img-reveal.is-in > img, html.js .img-reveal.is-in > a { clip-path: inset(0 0 0 0); }
html.js .img-reveal.is-in img { transform: none; }
html.js .img-reveal.is-in:hover img, html.js .img-reveal.is-in a.photo-link:hover img { transform: scale(1.06); transition-duration: .7s; transition-delay: 0s; }
html.js .photo.tilt-l, html.js .photo.tilt-r { backface-visibility: hidden; }

/* ---------- floating decorative elements ---------- */
.float { animation: floaty 7s ease-in-out infinite; }
.float--slow { animation-duration: 10s; }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-14px) rotate(calc(var(--r, 0deg) + 3deg)); } }
.spin-slow { animation: spin 28s linear infinite; }
.sticker { --r: -12deg; }

/* ---------- marquee ---------- */
.marquee__track { animation: marquee 38s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- page transition ---------- */
html.js body { animation: pageIn .5s ease both; }
html.js body.is-leaving { opacity: 0; transition: opacity .22s ease; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- cursor follower (fine pointers only) ---------- */
.cursor-ring {
  position: fixed; left: 0; top: 0; z-index: 900; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 3px solid var(--yellow); border-radius: 50%; pointer-events: none; opacity: 0;
  mix-blend-mode: difference; transition: opacity .25s, width .25s var(--ease), height .25s var(--ease), margin .25s var(--ease), background-color .25s;
  will-change: transform;
}
.cursor-ring.is-visible { opacity: .95; }
.cursor-ring.is-active { width: 62px; height: 62px; margin: -31px 0 0 -31px; background: rgba(248, 240, 0, .35); }
@media (hover: none), (pointer: coarse) { .cursor-ring { display: none; } }

/* ---------- reduced motion: no movement, everything visible ---------- */
@media (prefers-reduced-motion: reduce) {
  html.js .reveal, html.js .reveal-left, html.js .reveal-right { opacity: 1; transform: none; transition: none; }
  html.js .img-reveal > img, html.js .img-reveal > a { clip-path: none; transition: none; }
  html.js .img-reveal img { transform: none; transition: none; }
  html.js .hero__logo, html.js .hero__title span, html.js .hero__lead, html.js .hero__cta { opacity: 1; transform: none; animation: none !important; }
  html.js.ready .hero__logo { transform: rotate(-3deg); }
  .float, .spin-slow, .loader__burst { animation: none; }
  .marquee__track { animation: none; flex-wrap: wrap; width: auto; }
  .marquee__group[aria-hidden="true"] { display: none; }
  .marquee__group { flex-wrap: wrap; justify-content: center; padding-inline: 1rem; }
  html.js body { animation: none; }
  html.show-loader .loader { animation: none; display: none; }
  .cursor-ring { display: none; }
  .zoomable img, .btn, .chip, .pour, .social-btn { transition: none; }
  * { scroll-behavior: auto !important; }
}

/* no-JS: loader never shows */
.no-js .loader { display: none !important; }
