/* ANVIL v5 — home page. Tokens, sky, header, footer and the stage theme
   custom properties live in base.css. */

/* ================================================================
   PRELOADER
   ================================================================ */
.preloader{
  position:fixed; inset:0; z-index:100;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:22px;
  background: var(--color-gold);
  transition: opacity .6s ease, visibility .6s ease;
}
.preloader.is-hidden{ opacity:0; visibility:hidden; pointer-events:none; }
.preloader__mark{ color: var(--color-black); opacity:.85; }
.preloader__bar{ width: 220px; height:3px; background: rgba(13,9,6,0.25); border-radius:3px; overflow:hidden; }
.preloader__fill{ width:0%; height:100%; background: var(--color-black); transition: width .15s ease; }
.preloader__pct{ font-size:.8rem; letter-spacing:.1em; color: var(--color-black); opacity:.75; }

/* ================================================================
   THE EXPERIENCE — one sticky stage for hero + flavours.
   Its height is written by home.js from CONFIG.scroll, so the pace of
   the whole thing is tuned in one place rather than in the CSS.
   ================================================================ */
.experience{ height: var(--exp-h, 620vh); position:relative; }
.stage{
  position: sticky; top:0;
  height: 100vh; width:100%;
  overflow:hidden;
}
.anchor{ position:absolute; top:43%; }

/* The oversized flavour name, tone-on-tone on its ground. Centering is
   GSAP's xPercent/yPercent baseline in home.js, so no CSS transform. */
.stage__word{
  position:absolute; left:50%; top: var(--jar-y);
  font-family: var(--font-display); font-weight:900; font-stretch:62%; text-transform:uppercase;
  font-size: clamp(4rem, 15vw, 16rem); line-height:.86; white-space:nowrap;
  color: var(--stage-word);
  z-index:1; pointer-events:none; user-select:none;
  will-change: transform, opacity;
}
#flavourWord{ opacity:0; }

/* The hero ANVIL is sized on its own: five characters can take the width
   the flavour names cannot. Faint bone, so the flanking copy reads over it. */
#heroWord{
  font-size: clamp(8rem, 36vw, 46rem);
  color: rgba(243,234,217,0.13);
}

/* --- jar: canvas during the hero, two <img>s during the flavours --- */
/* No CSS filter on the canvas: a drop-shadow on a full-stage canvas is
   re-rendered on every scrubbed frame, and the hero renders carry their
   own studio lighting. */
.stage__canvas{
  position:absolute; inset:0; width:100%; height:100%;
  z-index:3; pointer-events:none;
}
.stage__jars{
  position:absolute; inset:0; z-index:3;
  transform-origin: 50% var(--jar-y);
  opacity:0; will-change: opacity, transform;
}
.stage__jar{
  position:absolute; left:50%; top: var(--jar-y);
  z-index:2; height: var(--jar-h); width:auto; max-width:none;
  filter: drop-shadow(0 30px 40px var(--pt-shadow));
  will-change: clip-path, opacity;
}
#jarCur{ view-transition-name: jar; }

/* --- ingredient particles ---------------------------------------
   A bounded box centred on the jar, so the percentage anchors hold their
   relationship to the jar at any window size. Shadows take the stage's
   --pt-shadow, tinted to each ground, so they read on light grounds too.
   ---------------------------------------------------------------- */
.stage__particles-wrap{
  position:absolute; left:50%; top: var(--jar-y);
  transform: translate(-50%,-50%);
  width: min(94vw, 1180px); height: min(88vh, 720px);
  z-index:2; pointer-events:none;
  opacity:0; will-change: opacity;
}
.stage__particles{ position:absolute; inset:0; will-change: transform, opacity; }
.pt{
  position:absolute; left: var(--x); top: var(--y);
  width: var(--s); opacity: var(--o, 1);
  transform: translate(-50%, -50%);
  animation: ptFloat var(--dur, 8s) ease-in-out var(--delay, 0s) infinite alternate;
  will-change: transform;
}
.pt img{
  width:100%; height:auto;
  transform: rotate(var(--r, 0deg));
  filter: blur(var(--blur, 0px)) drop-shadow(0 16px 18px var(--pt-shadow));
  animation: ptRock var(--dur2, 11s) ease-in-out var(--delay, 0s) infinite alternate;
  will-change: transform;
}
@keyframes ptFloat{
  from{ transform: translate(-50%,-50%) translate3d(0, 0, 0); }
  to  { transform: translate(-50%,-50%) translate3d(var(--dx, 0px), var(--dy, 0px), 0); }
}
@keyframes ptRock{
  from{ transform: rotate(var(--r, 0deg)); }
  to  { transform: rotate(calc(var(--r, 0deg) + var(--dr, 0deg))); }
}

/* --- hero copy: flanks the jar on its centre line ------------------- */
.stage__hero-copy{
  position:absolute; inset:0; z-index:5; pointer-events:none;
  will-change: transform, opacity;
}
.stage__hero-lead, .stage__hero-act{
  position:absolute; top: var(--jar-y); transform: translateY(-50%);
  width: min(300px, 24vw); pointer-events:auto;
  display:flex; flex-direction:column; gap:14px;
}
.stage__hero-lead{ left: max(24px, calc(50% - 566px)); }
.stage__hero-act{ right: max(24px, calc(50% - 566px)); align-items:flex-end; text-align:right; }
.stage__hero-title{ font-size: clamp(2.4rem, 3.6vw, 3.4rem); color: var(--color-gold); }
.stage__hero-sub{ margin:0; font-size:1.05rem; line-height:1.5; color: rgba(243,234,217,0.72); max-width: 28ch; }
.stage__hero-act .btn{ padding: 16px 30px; }
.stage__hero-hint{ margin:0; font-size:.88rem; color: rgba(243,234,217,0.6); }

/* --- flavour copy, buy strip and tabs ------------------------------
   Boxless, straight on the flavour ground, in the stage ink. */
.stage__info{
  position:absolute; left:50%; bottom:0; transform: translateX(-50%);
  z-index:5; width: min(calc(100% - 48px), 1132px);
  display:grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 40px; align-items:end;
  color: var(--stage-ink);
  opacity:0; will-change: opacity;
}
.stage__info-copy{ text-align:left; padding-bottom: 26px; }
.stage__info h2{ font-size: clamp(2.2rem, 3.4vw, 3rem); color: inherit; margin-bottom:8px; }
.stage__info p{ margin:0; font-size:1rem; line-height:1.45; max-width: 52ch; color: color-mix(in srgb, var(--stage-ink) 80%, transparent); }
.stage__macros{ margin-top:8px !important; font-size:.86rem !important; font-weight:700; color: var(--stage-ink) !important; }
.stage__info-buy{ display:flex; align-items:center; gap:20px; padding-bottom: 30px; }
.stage__price{ font-size:1.9rem; font-weight:800; line-height:1; }
.stage__info .btn--solid{ background: var(--stage-ink); color: var(--stage-btn-text); padding: 14px 26px; font-size:.95rem; }
.stage__info .textlink{ color: inherit; display:inline-flex; align-items:center; gap:4px; }

/* Tabs replace v4's 9px dots: the same progress read-out, named, with a
   56px hit area. The bar over each fills (--fill, written by home.js) as
   its flavour is scrolled through. Clicking scrolls; it never jumps state. */
.stage__tabs{
  grid-column: 1 / -1;
  display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px;
  border-top: 1px solid color-mix(in srgb, var(--stage-ink) 22%, transparent);
}
.stage__tabs button{
  position:relative; min-height:56px; padding: 14px 0; margin:0;
  background:none; border:0; color:inherit; font: inherit; font-size:.9rem; font-weight:500;
  text-align:left; cursor:pointer; opacity:.62;
  transition: opacity .25s var(--ease-out);
}
.stage__tabs button:hover{ opacity:.9; }
.stage__tabs button.is-active{ opacity:1; font-weight:700; }
.stage__tabs button::before{
  content:''; position:absolute; left:0; right:0; top:-2px; height:3px;
  background: var(--stage-ink);
  transform-origin: left center; transform: scaleX(var(--fill, 0));
}

/* ================================================================
   REVIEWS — a lead quote and two short ones on a 12-col band.
   ================================================================ */
.reviews{ padding: 110px 0 70px; }
.reviews__band{
  display:grid; grid-template-columns: repeat(12, 1fr); gap: 0 clamp(24px, 4vw, 64px); margin-top: 40px;
}
.reviews blockquote{ margin:0; }
.reviews blockquote p{ margin:0 0 18px; color: rgba(243,234,217,0.88); }
.reviews__lead{ grid-column: 1 / 8; }
.reviews__lead p{ font-size: clamp(1.5rem, 2.6vw, 2.3rem); font-weight:600; line-height:1.3; letter-spacing:-0.01em; }
.reviews__side{ grid-column: 8 / -1; display:grid; align-content:start; }
.reviews__short{ padding: 18px 0; border-top: 1px solid var(--hairline); }
.reviews__short:first-child{ border-top:0; padding-top: 8px; }
.reviews__short p{ font-size:1.02rem; line-height:1.55; }
.reviews footer{ display:flex; flex-direction:column; gap:2px; font-size:.86rem; }
.reviews__name{ color: var(--color-bone); font-weight:600; }
.reviews__meta{ color: var(--text-muted); }

/* ================================================================
   THE RANGE — the closing scene. Four full-height columns on the
   stage's flavour grounds (--ground/--glow/--edge/--ink set per item
   by home.js from js/flavours.js).
   ================================================================ */
.range{ padding: 90px 0 0; }
.range__head{
  display:flex; justify-content:space-between; align-items:flex-end; flex-wrap:wrap;
  gap: 16px 40px; margin-bottom: 44px;
}
.range__head .section-title{ margin:0; font-size: clamp(3.2rem, 8vw, 6.8rem); }
.range__sub{ color: var(--text-muted); margin:0; text-align:right; line-height:1.55; }

.range__shelf{
  list-style:none; margin:0; padding:0;
  display:grid; grid-template-columns: repeat(4, minmax(0, 1fr));
}
.range__item{
  position:relative; overflow:hidden; color: var(--ink);
  min-height: clamp(540px, 74vh, 700px);
  display:grid; grid-template-rows: 1fr auto;
  background: radial-gradient(ellipse 80% 55% at 50% 34%, var(--glow) 0%, var(--ground) 58%, var(--edge) 100%);
}
.range__jar{ display:grid; place-items:center; padding: 48px 20px 12px; }
.range__jar img{
  height: clamp(220px, 32vh, 330px); width:auto;
  filter: drop-shadow(0 24px 28px var(--shadow));
  transition: transform .6s var(--ease-out);
}
.range__item:hover .range__jar img,
.range__item:focus-within .range__jar img{ transform: translateY(-10px) scale(1.03); }

.range__body{ display:grid; gap:10px; padding: 0 clamp(20px, 2.2vw, 34px) 30px; }
.range__item h3{
  font-family: var(--font-display); font-stretch:62%; font-weight:900; text-transform:uppercase;
  line-height:.9; font-size: clamp(2rem, 2.9vw, 2.8rem);
}
/* grid-template-rows 0fr -> 1fr opens the extra copy without animating height */
.range__extra{ display:grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease-out); }
.range__extra > div{ overflow:hidden; opacity:0; transition: opacity .4s var(--ease-out); }
.range__item:hover .range__extra,
.range__item:focus-within .range__extra{ grid-template-rows: 1fr; }
.range__item:hover .range__extra > div,
.range__item:focus-within .range__extra > div{ opacity:1; }
.range__tagline{ margin:0 0 8px; font-size:.95rem; line-height:1.45; }
.range__macros{ margin:0; font-size:.82rem; font-weight:700; }
.range__buy{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:4px; }
.range__price{ margin:0; font-weight:700; font-size:1.02rem; }
.range__item .btn--ghost{ color: var(--ink); border: 1px solid color-mix(in srgb, var(--ink) 55%, transparent); }
.range__item .btn--ghost:hover{ background: var(--ink); color: var(--btn-text); }
.range__item :focus-visible{ outline-color: var(--ink); }
@media (hover: none){
  .range__extra{ grid-template-rows: 1fr; }
  .range__extra > div{ opacity:1; }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1100px){
  .range__shelf{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .range__item{ min-height: 560px; }
}

@media (max-width: 900px){
  .reviews__lead{ grid-column: 1 / -1; }
  .reviews__side{ grid-column: 1 / -1; margin-top: 24px; }
  .reviews__short:first-child{ border-top: 1px solid var(--hairline); padding-top:18px; }
}

@media (max-width: 768px){
  .reviews{ padding: 84px 0 64px; }
  .range{ padding-top: 64px; }
  .range__head{ flex-direction:column; align-items:flex-start; margin-bottom: 28px; }
  .range__sub{ text-align:left; }
  .range__shelf{
    display:flex; overflow-x:auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width:none;
  }
  .range__shelf::-webkit-scrollbar{ display:none; }
  .range__item{ flex: 0 0 80vw; min-height: 500px; scroll-snap-align: start; }

  :root{ --jar-h: clamp(280px, 42vh, 420px); --jar-y: 39%; }
  .stage__word{ font-size: clamp(3rem, 19vw, 6rem); }
  #heroWord{ font-size: clamp(5rem, 38vw, 12rem); }

  /* the flanks stack under the jar: what it is, then the way in */
  .stage__hero-lead, .stage__hero-act{
    top:auto; transform:none; left:16px; right:16px; width:auto;
    align-items:center; text-align:center;
  }
  .stage__hero-lead{ bottom: calc(4vh + 104px); gap:8px; }
  .stage__hero-act{ bottom: 4vh; gap:10px; }
  .stage__hero-title{ font-size: 2.4rem; }
  .stage__hero-sub{ max-width: 34ch; font-size:.95rem; }

  .stage__info{ width: calc(100% - 32px); grid-template-columns: 1fr; }
  .stage__info-copy{ padding-bottom: 12px; }
  .stage__info h2{ font-size: 2rem; }
  .stage__info-buy{ gap:14px; padding-bottom: 16px; }
  .stage__price{ font-size: 1.5rem; }
  .stage__tabs{ gap: 0 10px; }
  .stage__tabs button{ min-height: 52px; font-size:.72rem; line-height:1.2; }

  .pt--extra{ display:none; }
  .pt{ left: var(--mx, var(--x)); top: var(--my, var(--y)); }
  .pt img{ filter: blur(var(--blur, 0px)) drop-shadow(0 10px 12px var(--pt-shadow)); }
}

/* ================================================================
   REDUCED MOTION — the composed still, nothing loops or scrubs.
   ================================================================ */
@media (prefers-reduced-motion: reduce){
  .pt, .pt img{ animation: none !important; }
  .range__extra, .range__extra > div, .range__jar img{ transition: none; }
}
