/* Motion (Nov 2026, reworked 11 Nov 2026), tuned to Cira's calm "Perfumer's Atelier" look.
   Loaded after site.css on every page built by page() (not the /lp/ landing page).
   Rules: content is readable from the first frame; nothing loops forever; no springy overshoot.
   NAVIGATION (every page)
   1. Header slides in on load: logo, menu, buttons one after another.
   2. Menu links: an ivory pill grows in behind the link on hover; the current page's pill is already there.
   3. Header "Get a quote": espresso-to-terracotta sweep, a light shine and a short nudge, three or four times, then it rests.
   4. LINE disc in the header: a soft ring pulses out 4 times.
   5. Mobile menu: links drop in one after another when it opens. Mobile bottom bar: "Get a quote" shines 3 times.
   6. Main buttons everywhere: lift on hover, press in on click.
   HOMEPAGE (body[data-page="index"])
   7. Hero, the one authored moment: Pim's portrait opens like the curtain behind her, and the terracotta
      promise ("from just 100 bottles") settles out of a soft blur, the way a scent settles. Everything else is there at once.
   8. Below the first screen only: why-us cards, process steps (their top rule draws across), gallery photos and
      split photos reveal as they arrive. Anything already on screen when the page loads is never hidden.
   9. Hover: cards and gallery photos lift; range chips lift; FAQ answers slide open.
   10. Final CTA band: when it scrolls into view, the button's two-tone drift and shine play twice, then rest.
   Visitors with "reduce motion" turned on get a still site: no movement, gentle fades and colour changes only. */

@keyframes cm-down { from { opacity: 0; translate: 0 -12px; } to { opacity: 1; translate: 0 0; } }
@keyframes cm-up { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
@keyframes cm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cm-sweep { to { background-position: -250% 0; } }
@keyframes cm-drift { 50% { background-position: 100% 0; } }
@keyframes cm-shine { 0%, 72% { left: -60%; } 100% { left: 130%; } }
@keyframes cm-nudge {
  0%, 86%, 100% { rotate: 0deg; scale: 1; }
  88% { rotate: -3deg; scale: 1.04; }
  90% { rotate: 2.5deg; scale: 1.04; }
  92% { rotate: -1.5deg; scale: 1.02; }
  94% { rotate: 1deg; scale: 1; }
  96% { rotate: 0deg; }
}
@keyframes cm-ring { 0%, 70% { box-shadow: 0 0 0 0 rgba(138, 90, 68, .5); } 95%, 100% { box-shadow: 0 0 0 10px rgba(138, 90, 68, 0); } }
@keyframes cm-curtain { from { clip-path: inset(0 50% 0 50% round var(--card)); } to { clip-path: inset(0 0 0 0 round var(--card)); } }
@keyframes cm-settle { from { scale: 1.06; } to { scale: 1; } }
@keyframes cm-scent { from { opacity: .15; filter: blur(12px); } to { opacity: 1; filter: blur(0); } }
@keyframes cm-open { from { opacity: 0; translate: 0 -6px; } to { opacity: 1; translate: 0 0; } }

/* ---------- 1. Header entrance ---------- */
.hdr > .wm { animation: cm-down .6s cubic-bezier(.16, 1, .3, 1) both; }
.hdr > .nav { animation: cm-down .6s cubic-bezier(.16, 1, .3, 1) .08s both; }
.hdr > .hdr-r { animation: cm-down .6s cubic-bezier(.16, 1, .3, 1) .16s both; }
.hdr > .menu-btn { animation: cm-down .6s cubic-bezier(.16, 1, .3, 1) .16s both; }
.wm img { transition: transform .3s cubic-bezier(.16, 1, .3, 1); }
.wm:hover img { transform: scale(1.04) rotate(-1.5deg); }

/* ---------- 2. Menu links: pill grows in on hover ---------- */
.nav a { position: relative; z-index: 0; transition: color .2s; }
.nav a::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--ivory);
  opacity: 0; scale: .7; transition: opacity .22s, scale .3s cubic-bezier(.16, 1, .3, 1);
}
.nav a:hover { opacity: 1; }
.nav a:hover::before { opacity: 1; scale: 1; }
.nav a[aria-current]::before { opacity: 1; scale: 1; }
.lang a { transition: background-color .2s, box-shadow .2s, transform .18s cubic-bezier(.16, 1, .3, 1); }
.lang a:not([aria-current]):hover { transform: translateY(-1px); background: var(--cream); opacity: 1; }

/* ---------- 3. Header "Get a quote" (plays a few times, then rests on espresso) ---------- */
.hdr-r .btn-p { position: relative; overflow: hidden; isolation: isolate; }
.hdr-r .btn-p {
  background: linear-gradient(100deg, var(--ink) 0%, #4A3428 35%, var(--accent) 50%, #4A3428 65%, var(--ink) 100%);
  background-size: 250% 100%;
  animation: cm-sweep 6s linear 3, cm-nudge 7s ease-in-out 1.5s 4;
}
.hdr-r .btn-p::after, .mbar .q::after, .cta .btn-p::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: skewX(-20deg);
}
.hdr-r .btn-p::after { animation: cm-shine 5s ease-in-out 1s 3; }

/* ---------- 4. LINE disc ring ---------- */
.hdr-r .btn-s .disc { animation: cm-ring 7s ease-out 2s 4; }
.btn-s .disc { transition: transform .25s cubic-bezier(.16, 1, .3, 1); }
.btn-s:hover .disc { transform: rotate(-12deg) scale(1.08); }

/* ---------- 5. Mobile menu + bottom bar ---------- */
@media (max-width: 1280px) {
  .hdr.open .nav a { animation: cm-down .35s cubic-bezier(.16, 1, .3, 1) both; }
  .hdr.open .nav a:nth-child(2) { animation-delay: .04s; }
  .hdr.open .nav a:nth-child(3) { animation-delay: .08s; }
  .hdr.open .nav a:nth-child(4) { animation-delay: .12s; }
  .hdr.open .nav a:nth-child(5) { animation-delay: .16s; }
  .hdr.open .nav a:nth-child(6) { animation-delay: .2s; }
  .hdr.open .nav a:nth-child(n+7) { animation-delay: .24s; }
}
.mbar .q { position: relative; overflow: hidden; isolation: isolate; }
.mbar .q::after { animation: cm-shine 5s ease-in-out 2s 3; }
.mbar a { transition: transform .15s cubic-bezier(.16, 1, .3, 1); }
.mbar a:active { transform: scale(.96); }

/* ---------- 6. Lift and press (all main buttons) ---------- */
.btn { transition: transform .2s cubic-bezier(.16, 1, .3, 1), box-shadow .2s, background-color .18s, color .18s; }
.btn:hover { opacity: 1; transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 22px -10px rgba(43, 35, 30, .5); }
.btn:active { transform: translateY(1px) scale(.97); box-shadow: none; transition-duration: .1s; }
.hdr-r .btn-p:hover { animation-play-state: paused; }

/* ---------- 7. Homepage hero: curtain + settling scent ---------- */
.hero-home .hero-img { overflow: hidden; border-radius: var(--card); }
.hero-home .hero-img img { animation: cm-curtain 1.15s cubic-bezier(.65, 0, .25, 1) .1s both, cm-settle 2.2s cubic-bezier(.16, 1, .3, 1) .1s both; }
.hero-home h1 em { animation: cm-scent 1s cubic-bezier(.16, 1, .3, 1) .2s both; }
.hero-tag { animation: cm-up .5s cubic-bezier(.16, 1, .3, 1) 1.05s both; }

/* ---------- 8. Reveals below the first screen (classes added by the motion script; without JS nothing is hidden) ---------- */
.js-motion .rv { opacity: 0; translate: 0 24px; transition: opacity .7s cubic-bezier(.16, 1, .3, 1), translate .7s cubic-bezier(.16, 1, .3, 1); transition-delay: var(--d, 0s); }
.js-motion .rv.in { opacity: 1; translate: 0 0; }
.js-motion .rv-img { clip-path: inset(0 12% 0 12% round var(--card)); opacity: .2; transition: clip-path 1s cubic-bezier(.65, 0, .25, 1), opacity .6s; transition-delay: var(--d, 0s); }
.js-motion .rv-img.in { clip-path: inset(0 0 0 0 round var(--card)); opacity: 1; }
.js-motion .steps li.rv { border-top-color: transparent; position: relative; }
.js-motion .steps li.rv::after { content: ''; position: absolute; left: 0; top: -1px; height: 1px; width: 100%; background: var(--ink); scale: 0 1; transform-origin: left; transition: scale 1s cubic-bezier(.65, 0, .25, 1); transition-delay: calc(var(--d, 0s) + .1s); }
.js-motion .steps li.rv.in::after { scale: 1 1; }
@media print { .js-motion .rv, .js-motion .rv-img { opacity: 1 !important; translate: none !important; clip-path: none !important; } }

/* ---------- 9. Homepage hover ---------- */
[data-page="index"] .card { transition: transform .3s cubic-bezier(.16, 1, .3, 1), box-shadow .3s; }
[data-page="index"] .card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px -18px rgba(43, 35, 30, .35); }
[data-page="index"] .card .n { display: inline-block; transition: translate .3s cubic-bezier(.16, 1, .3, 1); }
[data-page="index"] .card:hover .n { translate: 4px 0; }
[data-page="index"] .gfig img { transition: transform .5s cubic-bezier(.16, 1, .3, 1), box-shadow .5s; }
[data-page="index"] .gfig:hover img { transform: translateY(-4px) scale(1.015); box-shadow: 0 18px 36px -20px rgba(43, 35, 30, .45); }
[data-page="index"] .range span { transition: transform .2s cubic-bezier(.16, 1, .3, 1), background-color .2s; }
[data-page="index"] .range span:hover { transform: translateY(-2px); background: #fff; }
.faq details[open] p { animation: cm-open .35s cubic-bezier(.16, 1, .3, 1) both; }
.faq summary { transition: color .2s; }
.faq summary:hover { color: var(--accent); }

/* ---------- 10. Final CTA button: plays when the band arrives, then rests ---------- */
.cta .btn-p { position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(100deg, var(--ivory), #EAD6C7 50%, var(--ivory)); background-size: 200% 100%; }
.cta .btn-p::after { background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .8), transparent); }
.cta.in .btn-p { animation: cm-drift 6s ease-in-out 2; }
.cta.in .btn-p::after { animation: cm-shine 4s ease-in-out .4s 2; }

/* Still site for "reduce motion": no movement, gentle fades and colour changes stay */
@media (prefers-reduced-motion: reduce) {
  .hdr > *, .hdr .nav a, .hdr-r .btn-p, .hdr-r .btn-s .disc, .cta.in .btn-p, .faq details[open] p,
  .hero-home .hero-img img, .hero-tag { animation: none !important; }
  .hero-home h1 em { animation: cm-fade .6s ease-out both !important; }
  .hdr-r .btn-p::after, .mbar .q::after, .cta .btn-p::after { display: none; }
  .js-motion .rv, .js-motion .rv-img { opacity: 1 !important; translate: none !important; scale: none !important; clip-path: none !important; }
  .js-motion .steps li.rv { border-top-color: var(--ink); }
  .js-motion .steps li.rv::after { display: none; }
  .nav a::before { scale: 1 !important; }
  .btn:hover, .btn:active, .lang a:hover, .wm:hover img, .btn-s:hover .disc, .mbar a:active, .pv-grid a:hover, .pv-grid a:hover .ico,
  [data-page="index"] .card:hover, [data-page="index"] .card:hover .n, [data-page="index"] .gfig:hover img, [data-page="index"] .range span:hover { transform: none !important; translate: none !important; }
}
