/* =====================================================================
   OZAURA — hero2.css
   Scroll-driven cinematic hero for hero2.php. The cleanser arrives on load,
   then three scroll acts play out on a pinned stage: a second cleanser
   joins it from depth, both dissolve into the hand plate, and the page
   opens with the call to action.

   Layout is an editorial split — copy holds the left column, the 3D scene
   owns the right — so a big product and a big headline never have to
   fight over the same pixels. Phones stack it: scene on top, copy under.

   Everything is authored in its SETTLED state (act one, fully arrived).
   hero2.js overwrites those values the moment GSAP is available, so a
   blocked CDN or a JS error still leaves a composed, legible hero.
   ===================================================================== */

/* ScrollTrigger and CSS smooth-scroll fight each other — a pinned stage
   jumps when the browser is mid-animation and ScrollTrigger sets a scroll
   position. hero2.js re-implements smooth anchor jumps with GSAP instead.
   Scoped to this page because hero2.css only loads here. */
html{ scroll-behavior:auto; }

.h2{
  position:relative;
  /* height stays auto until hero2.js confirms it can pin — see SCROLL there */
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255,255,255,.92), transparent 60%),
    linear-gradient(180deg, #fffdf8, var(--cream) 62%, #fffdf8);
}
.h2-stage{
  position:relative; overflow:hidden;
  height:100vh; height:100svh;
  /* one shared 3D space so depth reads consistently across every layer */
  perspective:1500px; perspective-origin:60% 46%;
}

.h2-grid{
  position:relative; z-index:3; height:100%;
  width:min(1280px, 92%); margin-inline:auto;
  display:grid; grid-template-columns:1.02fr .98fr; align-items:center;
  gap:clamp(1rem, 3vw, 3rem);
  /* nudge the composition up — at scroll 0 the header eats the stage's
     bottom strip, and this keeps the content off that edge */
  padding-bottom:6svh;
}
.h2-col{ position:relative; height:76svh; }

/* ---------- backdrop washes — cross-faded, one per act ---------- */
.h2-wash{ position:absolute; inset:0; z-index:0; pointer-events:none; }
.h2-wash--a{
  background:
    radial-gradient(46% 42% at 72% 42%, rgba(224,138,46,.22), transparent 70%),
    radial-gradient(80% 60% at 50% 104%, rgba(201,162,75,.12), transparent 70%);
}
.h2-wash--b{
  opacity:0;
  background:
    radial-gradient(52% 44% at 68% 42%, rgba(122,102,178,.22), transparent 70%),
    radial-gradient(80% 60% at 50% 104%, rgba(109,74,114,.12), transparent 70%);
}
.h2-wash--c{
  opacity:0;
  background:
    radial-gradient(56% 48% at 66% 40%, rgba(201,162,75,.22), transparent 72%),
    radial-gradient(90% 60% at 50% 106%, rgba(94,110,68,.10), transparent 70%);
}
.h2-vignette{
  position:absolute; inset:0; z-index:6; pointer-events:none;
  box-shadow:inset 0 0 22vmax 6vmax rgba(29,27,22,.07);
}

/* slow concentric rings, centred on the scene column */
.h2-rings{
  position:absolute; left:72%; top:46%; z-index:0; pointer-events:none;
  width:min(96svh, 80vw); aspect-ratio:1; translate:-50% -50%; opacity:.55;
}
.h2-rings circle{ fill:none; stroke:rgba(94,110,68,.16); stroke-width:.35; }
.h2-rings circle:nth-child(even){ stroke:rgba(201,162,75,.22); stroke-dasharray:1.6 5; }

.h2-contours{
  position:absolute; inset:0; z-index:1; width:100%; height:100%;
  pointer-events:none; opacity:.5;
}
.h2-contours path{ fill:none; stroke:rgba(94,110,68,.34); stroke-width:1.1; }

/* =====================================================================
   the 3D scene (right column)
   ===================================================================== */
.h2-scene{ position:absolute; inset:0; transform-style:preserve-3d; }

/* Three nested nodes on purpose: the outer one is the scroll's to command,
   the middle holds the static composition offset, the inner bobs forever.
   Nothing ever has to share a transform with something else. */
.h2-prod{
  position:absolute; inset:0; z-index:3;
  display:grid; place-items:center;
  transform-style:preserve-3d;
  /* hero2.js tweens filter:blur() on this element (the intro's arrival
     blur, and act one's depth blur on prodB) alongside transform/opacity —
     will-change has to name all three or Chrome doesn't reliably keep this
     layer composited through the blur change. Caught as: scrolling the
     pinned hero back and forth left the product fully transparent at rest,
     with computed opacity:1 (the style was right, the paint wasn't).
     backface-visibility:hidden is the standard companion fix for a 3D
     transform layer that intermittently drops a frame instead of painting it. */
  will-change:transform, opacity, filter;
  backface-visibility:hidden;
}
.h2-prod-shift{ translate:0 var(--shift, -3svh); transform-style:preserve-3d; backface-visibility:hidden; }
.h2-prod-float{ width:var(--pw); transform-style:preserve-3d; backface-visibility:hidden; }
.h2-prod img{
  width:100%; height:auto;
  filter:drop-shadow(0 34px 44px rgba(29,27,22,.26));
}
/* the tube is ~1:2, so --pw caps its height at roughly twice this */
.h2-prod--a{ --pw:min(32svh, 26vw); }
/* the second cleanser belongs to act two — hidden until the scroll brings
   it out of depth, and it stays hidden when there is no scroll timeline
   (reduced motion, or GSAP never arriving) rather than stacking on the first */
.h2-prod--b{ --pw:min(30svh, 24vw); opacity:0; visibility:hidden; }

.h2-floor{
  position:absolute; left:50%; top:calc(50% + 32svh); z-index:2;
  width:min(26vw, 320px); height:min(6svh, 46px); translate:-50% -50%;
  background:radial-gradient(50% 50% at 50% 50%, rgba(29,27,22,.24), transparent 72%);
  filter:blur(7px); pointer-events:none;
}

/* ---------- the hand plate (act two) ---------- */
.h2-hand,
.h2-hand-ring{
  position:absolute; left:50%; top:47%;
  width:min(52svh, 30vw); aspect-ratio:1; translate:-50% -50%;
  border-radius:50%;
}
.h2-hand{
  z-index:4; overflow:hidden;
  box-shadow:0 44px 90px -34px rgba(29,27,22,.5);
  clip-path:circle(0% at 50% 50%);   /* opened by script */
  opacity:0; will-change:transform, opacity, clip-path;
}
/* two stacked photos — act two reveals the first, act three crossfades to
   the second, so "in your hands" and "begin your ritual" each get their
   own picture instead of the plate just shrinking with nothing new in it */
.h2-hand-img{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
}
.h2-hand-img--2{ opacity:0; }
.h2-hand-ring{
  z-index:5; border:1px solid rgba(201,162,75,.55);
  pointer-events:none; opacity:0;
}

/* act four's two extra circles — smaller, flanking the main plate.
   Default hidden (like .h2-hand) so a script-less load never shows them
   parked mid-scene; the scroll timeline is what brings them in. */
.h2-hand-side{
  position:absolute; top:47%; z-index:3;
  width:min(30svh, 17vw); aspect-ratio:1; border-radius:50%; overflow:hidden;
  box-shadow:0 30px 60px -26px rgba(29,27,22,.45);
  border:1px solid rgba(201,162,75,.4);
  opacity:0; visibility:hidden; will-change:transform, opacity;
}
.h2-hand-side img{ width:100%; height:100%; object-fit:cover; }
.h2-hand-side--l{ left:9%;  translate:-50% -50%; }
.h2-hand-side--r{ right:9%; translate:50% -50%; }

/* ---------- ingredient badges ----------
   Fixed to the outer edges of the scene column — never over the product,
   whichever tube is on stage — as small circular tokens with the name
   captioned underneath, rather than pills laid over the packaging. */
.h2-chips{ position:absolute; inset:0; z-index:5; pointer-events:none; }
.h2-chip{
  position:absolute;
  display:flex; flex-direction:column; align-items:center; gap:.5rem;
  opacity:0; translate:0 12px;
}
.h2-chip--l{ left:-1%; }
.h2-chip--r{ right:-1%; }
.h2-chip-ic{
  width:52px; height:52px; border-radius:50%;
  display:grid; place-items:center; font-size:1.05rem; color:var(--sage-deep);
  background:rgba(255,255,255,.92); backdrop-filter:blur(7px);
  border:1px solid var(--line); box-shadow:0 12px 28px -14px rgba(29,27,22,.42);
}
.h2-chip-label{
  white-space:nowrap; padding:.28rem .7rem; border-radius:999px;
  background:rgba(255,255,255,.86); border:1px solid var(--line);
  font-size:.68rem; font-weight:600; letter-spacing:.03em; color:var(--ink-soft);
}

/* =====================================================================
   copy (left column) — all four acts stack in the same box
   ===================================================================== */
.h2-copy{
  position:absolute; left:0; right:0; top:50%; z-index:7;
  translate:0 -50%; max-width:34rem; text-align:left;
  /* same fragile combination as .h2-prod above (transform + opacity + a
     tweened blur filter) — named here pre-emptively rather than after a
     second bug report */
  will-change:opacity, transform, filter;
  backface-visibility:hidden;
}
.h2-copy--2, .h2-copy--3, .h2-copy--4{ opacity:0; visibility:hidden; }

.h2-copy .eyebrow{ margin-bottom:.9rem; }
.h2-title{
  font-family:var(--serif); font-weight:400;
  font-size:clamp(2.1rem, 4.4vw, 3.9rem); line-height:1.04; letter-spacing:-.02em;
  perspective:900px;   /* so each line can hinge in 3D */
}
.h2-line{ display:block; overflow:hidden; padding-bottom:.09em; }
.h2-line > span{ display:block; transform-origin:50% 0%; }
.h2-title em{
  font-style:normal; font-family:var(--script); color:var(--sage-deep);
  font-size:1.22em; line-height:.8;
}
.h2-sub{
  margin-top:1.1rem; max-width:40ch;
  color:var(--ink-soft); font-size:clamp(.92rem, 1.3vw, 1.02rem);
}

.h2-tags{ display:flex; gap:.6rem; flex-wrap:wrap; margin-top:1.25rem; }
.h2-tag{
  display:inline-flex; align-items:baseline; gap:.5rem;
  padding:.55rem 1rem; border-radius:999px;
  background:rgba(255,255,255,.92); border:1px solid var(--line);
  box-shadow:0 12px 30px -18px rgba(29,27,22,.5);
  font-size:.82rem; font-weight:600; color:var(--ink);
}
.h2-tag small{ color:var(--muted); font-weight:500; }
.h2-tag b{ color:var(--sage-deep); }

.h2-cta{ display:flex; gap:.7rem; flex-wrap:wrap; margin-top:1.5rem; }
.h2-trust{
  display:flex; gap:.5rem; align-items:center; flex-wrap:wrap;
  margin-top:1.2rem; font-size:.8rem; color:var(--muted);
}
.h2-trust .stars{ color:var(--gold); letter-spacing:.1em; }
.h2-trust .dot{ opacity:.5; }

/* ---------- act rail ---------- */
.h2-rail{
  position:absolute; right:clamp(.8rem, 2.2vw, 2rem); top:50%; z-index:8;
  translate:0 -50%; display:grid; gap:1.05rem;
}
.h2-rail-item{ display:flex; align-items:center; gap:.7rem; justify-content:flex-end; }
.h2-rail-label{
  font-size:.62rem; font-weight:700; letter-spacing:.2em; text-transform:uppercase;
  color:var(--muted); opacity:0; translate:6px 0; transition:var(--tr);
}
.h2-rail-item.on .h2-rail-label{ opacity:1; translate:0 0; color:var(--sage-deep); }
.h2-rail-dot{ width:7px; height:7px; border-radius:50%; background:rgba(29,27,22,.18); transition:var(--tr); }
.h2-rail-item.on .h2-rail-dot{ background:var(--sage-deep); scale:1.5; }

/* ---------- scroll cue ---------- */
/* 14svh keeps the cue clear of the fold at scroll 0, where the header
   still eats the bottom of the stage */
.h2-cue{
  position:absolute; left:clamp(1rem, 4vw, 3.4rem); bottom:14svh; z-index:8;
  display:grid; justify-items:center; gap:.45rem;
  font-size:.62rem; font-weight:700; letter-spacing:.24em; text-transform:uppercase;
  color:var(--muted);
}
.h2-cue-track{
  width:1px; height:38px; background:linear-gradient(var(--line), transparent);
  position:relative; overflow:hidden;
}
.h2-cue-track i{
  position:absolute; inset:0; background:linear-gradient(var(--sage-deep), transparent);
  animation:h2cue 1.9s cubic-bezier(.6,.05,.3,1) infinite;
}
@keyframes h2cue{ 0%{ translate:0 -100% } 60%,100%{ translate:0 100% } }

/* =====================================================================
   stacked layout — scene on top, copy beneath
   ===================================================================== */
@media (max-width: 980px){
  .h2-grid{
    grid-template-columns:1fr; gap:0;
    /* start-aligned, not centred: .h2-stage is a hard 100svh for the
       scroll-pin to work, but the stacked content's natural height
       varies a lot with the device — centring it split any leftover
       space above AND below, which on a short (landscape-phone) screen
       clipped the headline off the top through the stage's overflow:
       hidden. Anchoring to the top means only the least-important
       trailing space ever goes short, never the copy. */
    align-content:start; padding-top:6svh; padding-bottom:4svh;
    width:min(560px, 90%);
  }
  .h2-col{ height:auto; }
  /* copy sits above the scene here (DOM order), so it gets the taller row
     and hangs off the BOTTOM of it — any overflow from a long headline
     then runs upward into empty space instead of across the product */
  .h2-col--copy{ height:42svh; }
  .h2-col--scene{ height:36svh; }
  .h2-copy{ top:auto; bottom:0; translate:0 0; max-width:none; text-align:center; }
  .h2-prod--a{ --pw:min(17svh, 38vw); }
  .h2-prod--b{ --pw:min(16svh, 36vw); }
  .h2-prod-shift{ --shift:0; }
  .h2-hand, .h2-hand-ring{ width:min(34svh, 64vw); top:50%; }
  .h2-floor{ top:calc(50% + 21svh); width:min(52vw, 260px); }
  .h2-rings{ left:50%; top:26%; width:min(70svh, 108vw); }
  .h2-chips{ display:none; }
  .h2-rail{ display:none; }
  .h2-hand-side{ display:none; }
  .h2-cue{ left:50%; translate:-50% 0; bottom:2.4svh; }
  .h2-tags, .h2-cta, .h2-trust{ justify-content:center; }
  .h2-sub{ margin-inline:auto; }
}
@media (max-width: 560px){
  .h2-title{ font-size:clamp(1.85rem, 8vw, 2.5rem); }
  .h2-sub{ font-size:.88rem; }
  .h2-cue{ display:none; }
}

/* ---------- short viewports (landscape phones mostly) ----------
   Independent of width: a phone rotated sideways keeps its ~380–430px
   width bucket above but drops to ~330–420px of HEIGHT, and the stacked
   layout's copy+scene stack (routinely 600px+ tall) no longer fits
   inside the pinned 100svh stage. Compact every block enough that the
   whole hero clears a 420px-tall viewport without cropping anything. */
@media (max-width: 980px) and (max-height: 500px){
  .h2-grid{ padding-top:3svh; padding-bottom:1.5svh; }
  /* copy keeps its absolute/bottom-anchored box (it has to — the four
     acts are stacked on top of each other and only one is ever
     visible); it just gets a smaller box and lighter content to
     match, instead of `auto`, which would let every hidden act's
     `visibility:hidden` copy reserve flow space and blow the layout up */
  .h2-col--copy{ height:30svh; }
  .h2-col--scene{ height:32svh; }
  .h2-copy .eyebrow{ display:none; }
  .h2-title{ font-size:clamp(1.3rem, 5vh, 1.9rem); margin-bottom:.15rem; }
  .h2-sub{ display:none; }               /* the headline + CTA is what a 5-second glance needs */
  .h2-cta{ margin-top:.55rem; }
  .h2-tags{ margin-top:.5rem; }
  .h2-trust{ display:none; }
  .h2-cue{ display:none; }
}

/* ---------- reduced motion — everything settles, nothing moves ---------- */
@media (prefers-reduced-motion: reduce){
  .h2-cue-track i{ animation:none; }
  .h2-rings{ display:none; }
}
