/* ==========================================================================
   Vitamin Horgoš — animations.css (ORBIS rebuild)
   Calm motion only: 700ms reveals, 350ms hovers, a gentle hero entrance, line draws.
   Nothing bounces, nothing floats; reduced motion keeps plain opacity changes.
   ========================================================================== */

/* Reveal (Orbis premium 2): one choreography everywhere. Hidden only while JS runs, so content never disappears
   without it. Fade + 24px rise in 700ms on cubic-bezier(.2,.7,.2,1) (tokens in css/motion.css), once. Items that
   arrive together step 90ms apart, a [data-seq] block keeps its order (both set --d, main.js). Once played (.is-done)
   these rules let go, so the element's own hover / focus transitions apply again. */
.js [data-reveal]:not(.is-in) { opacity: 0; transform: translate3d(0, var(--reveal-rise, 24px), 0); }
.js [data-reveal]:not(.is-done) {
  transition: opacity var(--reveal-dur, 700ms) var(--ease-reveal), transform var(--reveal-dur, 700ms) var(--ease-reveal);
  transition-delay: var(--d, 0ms);
}
.js :is([data-reveal="fade"], [data-reveal="scale"], [data-reveal="left"], [data-reveal="right"], [data-reveal="lines"], [data-reveal="image"]):not(.is-in) { transform: none; }
.js [data-reveal="none"] { opacity: 1 !important; transform: none !important; }
.js [data-reveal]:target { opacity: 1; transform: none; transition: none; }

/* h1 / h2: line by line. main.js wraps each word in .rl-w (numbered by rendered line, --l) as the heading arrives;
   each line rises ≤ 24px out of its own clip box, 90ms after the one above. The words are unwrapped afterwards. */
.js [data-reveal="lines"].rl { opacity: 1; transition: none; }
.rl .rl-w {
  display: inline-block;
  clip-path: inset(-0.2em -0.12em -0.3em -0.12em);
  transition: clip-path var(--reveal-dur, 700ms) var(--ease-reveal), transform var(--reveal-dur, 700ms) var(--ease-reveal);
  transition-delay: calc(var(--d, 0ms) + var(--l, 0) * var(--reveal-step, 90ms));
}
.js .rl:not(.is-in) .rl-w { clip-path: inset(100% -0.12em -0.3em -0.12em); transform: translate3d(0, min(0.45em, var(--reveal-rise, 24px)), 0); }

/* photo frames (premium 3): a burgundy curtain wipes off left → right (clip-path, 700ms), then the picture settles
   from 1.08 to 1 (700ms, starting 250ms in). The curtain needs a positioned frame: zero specificity, so a frame that
   its own class positions keeps that. Until the photo itself has loaded, a blurred 20px preview shows (motion.js). */
:where(.js [data-reveal="image"]) { position: relative; }
.js [data-reveal="image"]:not(.is-in) { opacity: 1; }
.js [data-reveal="image"]:not(.is-done) { overflow: clip; }
.js [data-reveal="image"]:not(.is-in) :is(img, video, canvas) { scale: 1.08; }
.js [data-reveal="image"]:not(.is-done) :is(img, video, canvas) { transition: opacity 500ms var(--ease-reveal, var(--ease-out)); } /* 1 → 1.08 at set-up: instant */
.js [data-reveal="image"].is-in:not(.is-done) :is(img, video, canvas) { transition: scale 700ms var(--ease-reveal, cubic-bezier(0.2, 0.7, 0.2, 1)) calc(var(--d, 0ms) + 250ms), opacity 500ms var(--ease-reveal, var(--ease-out)); }
.rv-curtain {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--ground-burgundy, #4A0E12);
  clip-path: inset(0 0 0 0);
  pointer-events: none;
  transition: clip-path 700ms var(--ease-reveal, cubic-bezier(0.2, 0.7, 0.2, 1)) var(--d, 0ms);
}
.is-in > .rv-curtain { clip-path: inset(0 0 0 100%); }
.no-js .rv-curtain { display: none; }

/* Hairlines draw from the left in 500ms (scaleX), just after their block has started to fade in */
.draw-line {
  display: block;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-line) var(--ease-out);
}
.draw-line.is-in, .no-js .draw-line { transform: scaleX(1); }
/* eyebrow hairlines (premium 3): a 700ms draw that starts as the label has faded half way in */
.eyebrow--line::after, .hairline, .sigband__rule, .rcard__rule, .ccard__rule {
  transition: transform 700ms var(--ease-reveal, cubic-bezier(0.2, 0.7, 0.2, 1)) calc(var(--d, 0ms) + 250ms), width var(--dur-hover) var(--ease-out);
}
.js [data-reveal]:not(.is-in) .eyebrow--line::after,
.js .eyebrow--line[data-reveal]:not(.is-in)::after,
.js [data-reveal]:not(.is-in) :is(.hairline, .sigband__rule, .rcard__rule, .ccard__rule),
.js :is(.hairline, .sigband__rule)[data-reveal]:not(.is-in) { transform: scaleX(0); }

/* ---------- Home hero entrance (body.is-loaded): eyebrow → title → text → buttons, 120ms apart ---------- */
.js .hero__title .mask > span { display: inline-block; animation: hero-in var(--dur-hero) var(--ease-out) 3s both; }
.js .is-loaded .hero__title .mask > span { animation-name: hero-in-2; animation-delay: calc(var(--l, 0) * 120ms); }
.js .hero [data-hero-in] { animation: hero-in var(--dur-hero) var(--ease-out) 3s both; }
.js .is-loaded .hero [data-hero-in] { animation-name: hero-in-2; animation-delay: calc(var(--i, 0) * 120ms + 200ms); }

@keyframes hero-in { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
@keyframes hero-in-2 { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
@keyframes line-up { from { opacity: 0; transform: translate3d(0, 0.25em, 0); } to { opacity: 1; transform: none; } }
@keyframes line-up-2 { from { opacity: 0; transform: translate3d(0, 0.25em, 0); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes draw-2 { to { stroke-dashoffset: 0; } }

/* ---------- Inner page heroes (main.js playHero): eyebrow → title lines → crumbs → hairline → lead → actions ----------
   Until main.js has split the title it stays hidden; the 3s CSS fallback shows everything if scripts never run. */
/* premium 2: no hidden pre-state – the hero text paints in its final state under the intro overlay (so it is the early
   LCP), and only when the entrance plays (.is-play, the same frame as the split / .hseq) do the `both` fills snap it
   to the from-state and run. Nothing is hidden if scripts never run. */
/* premium 3: the title lines rise out of their own clip box (clip-path + ≤ 0.45em rise, 700ms, lines 120ms apart, as the
   line reveal of section headings), then the breadcrumbs fade in (.hseq--fade) and a 64px gold hairline draws under the
   title (.hrule, --rule-d). The hairline is part of the static design (no JS / reduced motion: simply there). */
.hw { display: inline-block; vertical-align: top; }
.hw > span { display: inline-block; }
.js .is-play .is-split .hw { animation: hero-clip 700ms var(--ease-reveal, cubic-bezier(0.2, 0.7, 0.2, 1)) var(--d, 0ms) both; }
.js .is-play .is-split .hw > span { animation: hero-rise 700ms var(--ease-reveal, cubic-bezier(0.2, 0.7, 0.2, 1)) var(--d, 0ms) both; }
.js .is-play .hseq { animation: hero-in-2 700ms var(--ease-reveal, cubic-bezier(0.2, 0.7, 0.2, 1)) var(--d, 0ms) both; }
.js .is-play .hseq.hseq--fade { animation: fade-in 500ms var(--ease-reveal, cubic-bezier(0.2, 0.7, 0.2, 1)) var(--d, 0ms) both; }
.js .is-play .hseq--line { animation: line-draw-2 var(--dur-page) var(--ease-in-out) var(--d, 0ms) both; }
.js .hseq.is-shown, .js .hero [data-hero-in].is-shown { animation: none; } /* focused before the entrance played (main.js) */
@keyframes line-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes line-draw-2 { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes hero-clip { from { clip-path: inset(100% -0.2em -0.35em -0.2em); } to { clip-path: inset(-0.3em -0.2em -0.35em -0.2em); } }
@keyframes hero-rise { from { transform: translate3d(0, 0.45em, 0); } to { transform: none; } }
.phero:not(.phero--home) .phero__title, .pdp__title { position: relative; }
.phero:not(.phero--home) .phero__title::after, .pdp__title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 64px;
  height: 1px;
  margin-left: -32px;
  background: var(--gold);
  pointer-events: none;
}
.phero--cat .phero__title::after, .pdp__title::after, .phero .hrule--start::after { left: 0; margin-left: 0; transform-origin: 0 50%; }
.js .is-play .hrule::after { animation: line-draw-2 700ms var(--ease-reveal, cubic-bezier(0.2, 0.7, 0.2, 1)) var(--rule-d, 0ms) both; }

/* ---------- Keyframes kept for feature stylesheets ---------- */
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes callout-float { from { translate: 0 0; } to { translate: 0 2px; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes reveal-main { to { visibility: visible; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Reduced motion: plain opacity, no drift, no zoom ---------- */
@media (prefers-reduced-motion: reduce) {
  html, html.smooth-scroll { scroll-behavior: auto; }
  .js [data-reveal] { transform: none !important; }
  .js [data-reveal]:not(.is-done) { transition: opacity var(--dur-reveal) linear !important; }
  .rv-curtain { display: none; }
  .js [data-reveal="image"] :is(img, video, canvas) { scale: none !important; }
  .js .hero__title .mask > span, .js .is-split .hw > span, .js .is-split .hw, .js .hseq--line, .js .hrule::after { animation: none !important; transform: none !important; opacity: 1; }
  .js .is-split .hw { clip-path: none !important; }
  .js .hseq:not(.hseq--line), .js .hero [data-hero-in] { transform: none !important; animation: fade-in var(--dur-reveal) linear both !important; }
  .draw-line, .eyebrow--line::after, .hairline, .sigband__rule, .rcard__rule, .ccard__rule { transform: none !important; transition: none !important; }
  .msg--typing i { animation: none !important; }
}
