/* ===========================================================================
   ROSE ETERNELLE

   Layout model
   ------------
   #stage is a single fixed viewport-sized element holding every moving image
   in the site. Every content section scrolls OVER it with a transparent
   background. That is what lets one continuous camera move sit underneath six
   chapters of copy without any of them owning a background of their own.

   Two rules keep the composition intact at every width:
     · the left third is typography, always. #scrim protects its legibility.
     · the product is never cropped. It is positioned by transform from JS and
       its size is capped against the viewport, never against a parent box.

   Animation rules
   ---------------
   Only transform and opacity are animated. Nothing here animates width,
   height, top or left, so no frame in the film can trigger layout.
   =========================================================================== */

:root{
  /* drawn from the supplied artwork rather than invented */
  --pale:#FBEFEC;  --blush:#F6DAD7; --mist:#EFD3D2;
  --rose:#D6808E;  --deep:#B0606C;  --wine:#8C3A47;
  --ink:#5A3A3E;   --ink-soft:#7B5A5E; --gold:#C99070;
  --paper:#FFF9F7;

  --serif:"Cormorant Garamond",Georgia,"Times New Roman",serif;
  --sans:"Jost",ui-sans-serif,system-ui,"Segoe UI",sans-serif;

  --gut:clamp(20px,5vw,86px);      /* page gutter */
  --nav-h:clamp(62px,7vh,86px);

  /* real measured viewport height, published by responsive.js — mobile URL
     bars make 100vh unreliable and this is the fallback where dvh is absent */
  --vh:1vh;
}

*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  font-family:var(--sans);font-weight:300;color:var(--ink);
  background:var(--blush);
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}
body.loading{overflow:hidden}
img,video,canvas{display:block;max-width:100%}
/* `hidden` has to win: several elements below set display, which would
   otherwise override the attribute and show an empty bag badge */
[hidden]{display:none !important}
svg{fill:none;stroke:currentColor;stroke-width:1.1;stroke-linecap:round;stroke-linejoin:round}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}

::selection{background:var(--rose);color:#fff}

/* visually hidden, still read by assistive tech and by crawlers */
.vh{
  position:absolute;width:1px;height:1px;margin:-1px;padding:0;
  overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;
}
.skip-link{
  position:fixed;top:10px;left:10px;z-index:999;
  transform:translateY(-160%);transition:transform .25s ease;
  background:var(--paper);color:var(--ink);
  padding:10px 16px;border-radius:2px;font-size:12px;letter-spacing:.14em;text-transform:uppercase;
}
.skip-link:focus{transform:none}

:focus-visible{outline:1px solid var(--deep);outline-offset:4px}

/* ===========================================================================
   LOADING STATE
   =========================================================================== */
#loader{
  position:fixed;inset:0;z-index:200;
  display:grid;place-content:center;justify-items:center;gap:34px;
  background:linear-gradient(170deg,#FBEFEC 0%,#F4DAD8 55%,#EFCFCE 100%);
  transition:opacity .9s ease;
}
#loader.gone{opacity:0;pointer-events:none}
.load-mark{text-align:center;display:grid;gap:10px}
.load-name{
  font-family:var(--serif);font-weight:300;
  font-size:clamp(26px,4.4vw,50px);letter-spacing:.30em;
  text-transform:uppercase;color:var(--wine);
  /* the extra tracking pushes the optical centre right; pull it back */
  text-indent:.30em;
}
.load-sub{
  font-size:clamp(9px,1vw,11px);letter-spacing:.52em;text-transform:uppercase;
  color:var(--deep);opacity:.7;text-indent:.52em;
}
.load-bar{
  width:min(210px,42vw);height:1px;background:rgba(140,58,71,.16);overflow:hidden;
}
.load-bar i{
  display:block;height:100%;background:var(--deep);
  transform:scaleX(0);transform-origin:0 50%;
  transition:transform .5s cubic-bezier(.22,1,.36,1);
}

/* ===========================================================================
   THE FILM
   =========================================================================== */
#intro{
  position:fixed;inset:0;z-index:60;background:#EFCFCE;
  opacity:1;transition:opacity var(--fade,1400ms) cubic-bezier(.4,0,.2,1);
}
#intro.gone{opacity:0;pointer-events:none}
#intro-vid{
  width:100%;height:100%;object-fit:cover;
  /* the flacon sits right of centre in the film; bias the crop so it survives
     a narrow viewport instead of being sliced */
  object-position:62% 50%;
}

/* ===========================================================================
   THE STAGE
   =========================================================================== */
#stage{
  position:fixed;inset:0;z-index:0;
  opacity:0;transition:opacity 1.1s ease;
  contain:strict;
}
#stage.live{opacity:1}

#plate{
  position:absolute;inset:0;
  background:url("../assets/env/hero_plate.webp") center/cover no-repeat;
  opacity:1;transition:opacity 1.5s cubic-bezier(.4,0,.2,1);
}
body.plate-out #plate{opacity:0}

#gl,#gl-fg{position:absolute;inset:0;width:100%;height:100%}
#gl{z-index:1}
#gl-fg{z-index:3;pointer-events:none}

#bottle{
  position:absolute;top:50%;left:50%;z-index:2;
  margin:0;transform-origin:50% 50%;
  /* JS owns transform; this is only the centring offset baked into the origin */
  translate:-50% -50%;
  opacity:0;transition:opacity 1.2s ease .2s;
  filter:drop-shadow(0 34px 46px rgba(128,58,70,.20));
}
body.product-ready.plate-out #bottle{opacity:1}

/* the inside of the cloud — above every canvas, below the document */
#veil{
  position:absolute;inset:-6%;z-index:4;opacity:0;pointer-events:none;
  transform-origin:50% 55%;
  background:
    radial-gradient(58% 52% at 50% 46%, #FFF2EF 0%, #FBDEDC 38%, #F3C6C6 72%, #EEBCBE 100%);
  will-change:opacity,transform;
}

/* Reserves the left as quiet ground for typography. Deliberately soft and
   asymmetric — a flat scrim would read as a panel and flatten the depth. */
#scrim{
  position:absolute;inset:0;z-index:5;pointer-events:none;
  background:
    linear-gradient(96deg,
      rgba(255,247,244,.74) 0%,
      rgba(255,246,243,.52) 22%,
      rgba(252,238,236,.20) 42%,
      transparent 60%),
    linear-gradient(0deg, rgba(246,218,215,.34) 0%, transparent 26%);
}

/* no WebGL: the plate stands in as a static backdrop */
body.no-gl #plate{opacity:1 !important}
body.no-gl #gl,body.no-gl #gl-fg{display:none}

/* ===========================================================================
   NAVIGATION
   =========================================================================== */
#nav{
  position:fixed;top:0;left:0;right:0;z-index:80;
  height:var(--nav-h);
  display:grid;grid-template-columns:1fr auto 1fr;align-items:center;
  padding:0 var(--gut);
  color:var(--wine);
  transition:color .5s ease;
}
/* contrast from a whisper of a gradient, never a filled bar */
#nav::before{
  content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:linear-gradient(180deg,rgba(255,247,245,.78),rgba(255,247,245,0));
  opacity:.58;transition:opacity .6s ease;
}
#nav.solid::before{opacity:1}
#nav.on-light{color:var(--wine)}

.brand{display:grid;gap:3px;line-height:1}
.brand-name{
  font-family:var(--serif);font-size:clamp(14px,1.35vw,19px);
  letter-spacing:.30em;text-transform:uppercase;text-indent:.30em;
}
.brand-sub{
  font-size:8.5px;letter-spacing:.46em;text-transform:uppercase;
  opacity:.62;text-indent:.46em;
}

.menu{
  display:flex;gap:clamp(16px,2.4vw,38px);list-style:none;justify-self:center;
}
.menu a{
  position:relative;font-size:10.5px;letter-spacing:.22em;text-transform:uppercase;
  opacity:.78;transition:opacity .35s ease;padding:6px 0;
}
.menu a::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:1px;
  background:currentColor;transform:scaleX(0);transform-origin:0 50%;
  transition:transform .5s cubic-bezier(.22,1,.36,1);
}
.menu a:hover{opacity:1}
.menu a:hover::after,.menu a.here::after{transform:scaleX(1)}
.menu a.here{opacity:1}

.tools{display:flex;align-items:center;gap:16px;justify-self:end}
.tools button{width:34px;height:34px;display:grid;place-items:center;opacity:.8;transition:opacity .3s ease}
.tools button:hover{opacity:1}
.tools svg{width:17px;height:17px}
.bag{position:relative}
#bag-count{
  position:absolute;top:1px;right:-1px;
  min-width:15px;height:15px;padding:0 4px;border-radius:9px;
  background:var(--deep);color:#fff;
  font-size:9px;font-weight:400;display:grid;place-items:center;
}
#nav-toggle{display:none}

/* --- mobile panel --- */
#nav-panel{
  position:fixed;inset:0;z-index:-1;
  display:grid;align-content:center;justify-items:center;gap:38px;
  background:linear-gradient(165deg,#FBEFEC,#F1D2D1);
  opacity:0;visibility:hidden;
  transition:opacity .5s ease,visibility .5s;
}
#nav-panel ul{list-style:none;display:grid;gap:22px;text-align:center}
#nav-panel a{
  font-family:var(--serif);font-size:clamp(24px,7vw,36px);
  letter-spacing:.14em;text-transform:uppercase;color:var(--wine);
  opacity:0;transform:translateY(14px);
  transition:opacity .5s ease,transform .5s cubic-bezier(.22,1,.36,1);
}
.panel-mark{
  font-size:9px;letter-spacing:.44em;text-transform:uppercase;color:var(--deep);opacity:.55;
}
body.nav-open{overflow:hidden}
body.nav-open #nav-panel{opacity:1;visibility:visible;z-index:1}
body.nav-open #nav-panel a{opacity:1;transform:none}
body.nav-open #nav-panel li:nth-child(1) a{transition-delay:.06s}
body.nav-open #nav-panel li:nth-child(2) a{transition-delay:.11s}
body.nav-open #nav-panel li:nth-child(3) a{transition-delay:.16s}
body.nav-open #nav-panel li:nth-child(4) a{transition-delay:.21s}
body.nav-open #nav-panel li:nth-child(5) a{transition-delay:.26s}
body.nav-open #nav-panel li:nth-child(6) a{transition-delay:.31s}

/* ===========================================================================
   SHARED EDITORIAL TYPE
   =========================================================================== */
.kicker{
  font-size:10px;letter-spacing:.44em;text-transform:uppercase;
  color:var(--deep);opacity:.82;margin-bottom:20px;text-indent:.44em;
}
.ch-title{
  font-family:var(--serif);font-weight:300;
  font-size:clamp(38px,5.6vw,86px);line-height:.98;letter-spacing:.01em;
  color:var(--wine);margin-bottom:22px;
}
.ch-line{
  font-family:var(--serif);font-weight:300;font-style:italic;
  font-size:clamp(17px,1.7vw,25px);line-height:1.62;
  color:var(--ink-soft);max-width:22ch;
}

/* one reveal law for the whole site */
.reveal{
  opacity:0;transform:translateY(22px);
  transition:opacity 1.1s cubic-bezier(.22,1,.36,1),transform 1.1s cubic-bezier(.22,1,.36,1);
}
.reveal.in{opacity:1;transform:none}

/* ===========================================================================
   ACT I — HERO
   =========================================================================== */
.hero{
  position:relative;z-index:10;
  min-height:100vh;min-height:100dvh;
  display:grid;align-content:center;
  padding:var(--nav-h) var(--gut) 0;
}
.hero-copy{max-width:min(38ch,46vw)}

.hero h1{
  font-family:var(--serif);font-weight:300;
  font-size:clamp(58px,9.4vw,164px);line-height:.82;
  color:var(--wine);margin-bottom:26px;
}
.hero h1 span{
  display:block;letter-spacing:.06em;text-transform:uppercase;
}
.hero h1 em{
  display:block;font-style:italic;font-weight:300;
  font-size:.62em;letter-spacing:.01em;color:var(--deep);
  margin-top:.06em;margin-left:.06em;
}
.hero .sub{
  font-size:11px;letter-spacing:.40em;text-transform:uppercase;
  color:var(--deep);margin-bottom:26px;text-indent:.40em;
}
.hero .lede{
  font-family:var(--serif);font-size:clamp(17px,1.55vw,22px);
  line-height:1.72;color:var(--ink-soft);max-width:32ch;margin-bottom:44px;
}
.hero .reveal:nth-child(1){transition-delay:.05s}
.hero .reveal:nth-child(2){transition-delay:.14s}
.hero .reveal:nth-child(3){transition-delay:.23s}
.hero .reveal:nth-child(4){transition-delay:.32s}
.hero .reveal:nth-child(5){transition-delay:.41s}

.cta{
  display:inline-flex;align-items:center;gap:14px;
  font-size:11px;letter-spacing:.30em;text-transform:uppercase;color:var(--wine);
  padding-bottom:10px;border-bottom:1px solid rgba(140,58,71,.32);
  transition:gap .45s cubic-bezier(.22,1,.36,1),border-color .45s ease;
}
.cta svg{width:19px;height:19px;transition:transform .45s cubic-bezier(.22,1,.36,1)}
.cta:hover{gap:20px;border-color:var(--wine)}
.cta:hover svg{transform:translateX(4px)}

.cue{
  position:absolute;left:var(--gut);bottom:clamp(24px,5vh,52px);
  display:grid;gap:12px;justify-items:start;
  color:var(--deep);opacity:.72;
}
.cue small{font-size:9px;letter-spacing:.42em;text-transform:uppercase;text-indent:.42em}
.cue i{
  display:block;width:1px;height:52px;background:currentColor;transform-origin:50% 0;
  animation:cue 2.8s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes cue{
  0%{transform:scaleY(0);opacity:0}
  32%{opacity:.9}
  100%{transform:scaleY(1);opacity:0}
}

/* ===========================================================================
   PINNED SECTIONS
   Each section supplies scroll distance; .pin is what stays on screen.
   --span is a unitless number of viewport heights, set from CONFIG.
   =========================================================================== */
#approach,.chapter{
  position:relative;z-index:10;
  height:calc(var(--span,300) * 1vh);
}
.pin{
  position:sticky;top:0;
  height:100vh;height:100dvh;
  display:grid;align-content:center;
  padding:var(--nav-h) var(--gut) 0;
}
.copy{max-width:min(34ch,42vw)}

/* the passage is wordless by design */
#portal{
  position:relative;z-index:10;
  height:calc(var(--span,260) * 1vh);
  pointer-events:none;
}

/* --- notes --- */
.notes{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(16px,2.4vw,42px);margin-top:38px;max-width:none;
}
.note-group{
  opacity:0;transform:translateY(16px);
  transition:opacity .9s cubic-bezier(.22,1,.36,1) calc(.1s + var(--i) * .12s),
             transform .9s cubic-bezier(.22,1,.36,1) calc(.1s + var(--i) * .12s);
}
.reveal.in .note-group{opacity:1;transform:none}
.note-label{
  font-size:9.5px;letter-spacing:.36em;text-transform:uppercase;
  color:var(--deep);padding-bottom:12px;margin-bottom:14px;
  border-bottom:1px solid rgba(140,58,71,.20);text-indent:.36em;
}
.note-group ul{list-style:none;display:grid;gap:9px}
.note-group li{
  font-family:var(--serif);font-size:clamp(15px,1.35vw,20px);
  color:var(--ink-soft);
}

/* ===========================================================================
   THE PRODUCT PANEL
   The film ends here: this section is opaque and the stage is behind it.
   =========================================================================== */
#final{
  position:relative;z-index:20;
  display:grid;grid-template-columns:1.05fr .95fr;align-items:stretch;
  background:var(--paper);
}
.final-media{
  background:url("../assets/env/final.webp") center/cover no-repeat;
  min-height:clamp(420px,86vh,900px);
}
.final-panel{
  display:grid;align-content:center;gap:0;
  padding:clamp(48px,7vw,110px) clamp(28px,5vw,88px);
}
#p-name{
  font-family:var(--serif);font-weight:300;
  font-size:clamp(38px,4.6vw,72px);line-height:1;color:var(--wine);margin-bottom:12px;
}
.p-kind{
  font-size:10.5px;letter-spacing:.40em;text-transform:uppercase;
  color:var(--deep);margin-bottom:26px;text-indent:.40em;
}
.p-blurb{
  font-family:var(--serif);font-size:clamp(16px,1.4vw,21px);line-height:1.72;
  color:var(--ink-soft);max-width:38ch;margin-bottom:34px;
}
.p-row{
  display:flex;align-items:baseline;gap:22px;
  padding-bottom:26px;margin-bottom:30px;
  border-bottom:1px solid rgba(140,58,71,.16);
}
.p-size{font-size:10.5px;letter-spacing:.32em;text-transform:uppercase;color:var(--deep)}
.p-price{font-family:var(--serif);font-size:clamp(24px,2.4vw,34px);color:var(--wine)}

.p-buy{display:flex;gap:16px;align-items:stretch;flex-wrap:wrap;margin-bottom:22px}
.qty{
  display:flex;align-items:center;gap:6px;
  border:1px solid rgba(140,58,71,.22);padding:0 8px;
}
.qty button{width:34px;height:46px;color:var(--deep);font-size:16px;transition:color .3s ease}
.qty button:hover{color:var(--wine)}
#qty{min-width:26px;text-align:center;font-size:14px}

.buy{
  flex:1 1 200px;min-height:46px;
  display:inline-flex;align-items:center;justify-content:center;gap:14px;
  background:var(--wine);color:#fff;
  font-size:11px;letter-spacing:.28em;text-transform:uppercase;
  padding:0 26px;transition:background .45s ease,gap .45s cubic-bezier(.22,1,.36,1);
}
.buy svg{width:18px;height:18px}
.buy:hover{background:#7a303c;gap:20px}
.buy.added{background:var(--gold)}

.wish{
  display:inline-flex;align-items:center;gap:10px;justify-self:start;
  font-size:10px;letter-spacing:.26em;text-transform:uppercase;
  color:var(--deep);opacity:.8;transition:opacity .3s ease;
}
.wish:hover{opacity:1}
.wish svg{width:17px;height:17px;transition:fill .35s ease}
.wish.on svg{fill:var(--deep)}

/* ===========================================================================
   FOOTER
   =========================================================================== */
footer{
  position:relative;z-index:20;background:var(--paper);
  border-top:1px solid rgba(140,58,71,.12);
  display:grid;gap:22px;justify-items:center;text-align:center;
  padding:clamp(48px,7vw,86px) var(--gut);
}
.f-mark{
  font-family:var(--serif);font-size:clamp(18px,2vw,26px);
  letter-spacing:.30em;text-transform:uppercase;color:var(--wine);text-indent:.30em;
}
.f-links{display:flex;gap:30px;list-style:none}
.f-links a{
  font-size:10px;letter-spacing:.26em;text-transform:uppercase;
  color:var(--deep);opacity:.8;transition:opacity .3s ease;
}
.f-links a:hover{opacity:1}
footer small{font-size:9.5px;letter-spacing:.24em;text-transform:uppercase;color:var(--ink-soft);opacity:.55}

/* ===========================================================================
   RESPONSIVE
   Not a shrunken desktop: the composition re-stacks, the product stays the
   hero, and the passage is preserved at every width.
   =========================================================================== */

@media (max-width:1280px){
  .hero-copy{max-width:min(36ch,52vw)}
}

@media (max-width:1024px){
  .menu{gap:18px}
  .menu a{font-size:9.5px;letter-spacing:.16em}
  .hero-copy{max-width:min(34ch,58vw)}
  .copy{max-width:min(32ch,56vw)}
  #final{grid-template-columns:1fr}
  .final-media{min-height:52vh;order:-1}
}

@media (max-width:819px){
  .menu{display:none}
  #nav-toggle{display:grid}
  #nav{grid-template-columns:1fr auto}
  .brand{justify-self:start}

  /* The layout stacks, so the copy moves to the lower half and the product is
     lifted into the upper half by CONFIG.mobileProduct. The scrim flips from a
     left-side gradient to a bottom-up one to match, and is denser than the
     desktop one: on a phone the copy sits directly over the branch rather
     than beside it. */
  #scrim{
    background:
      linear-gradient(180deg, rgba(255,247,245,.34) 0%, transparent 20%),
      linear-gradient(0deg,
        rgba(250,231,229,.94) 0%,
        rgba(250,231,229,.86) 30%,
        rgba(250,231,229,.58) 48%,
        transparent 68%);
  }

  .hero{align-content:end;padding-bottom:clamp(104px,21vh,176px)}
  .hero-copy{max-width:none}
  .hero h1{font-size:clamp(52px,15vw,86px)}
  /* kept narrow so the measure never runs out under the branch on the right */
  .hero .lede{max-width:28ch;margin-bottom:36px}
  .cue{bottom:clamp(18px,3.4vh,34px)}
  .cue i{height:36px}

  .pin{align-content:end;padding-bottom:clamp(70px,16vh,130px)}
  .copy{max-width:none}
  .ch-line{max-width:30ch}

  /* three compact columns, not a stack: stacking triples the height of this
     block and pushes it into the product's band */
  .notes{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:26px}
  .note-label{margin-bottom:10px;padding-bottom:9px;font-size:8.5px;letter-spacing:.24em;text-indent:.24em}
  .note-group ul{gap:7px}
  .note-group li{font-size:14px;line-height:1.3}

  .p-buy{flex-direction:column}
  .buy{flex:1 1 auto}
}

@media (max-width:520px){
  .hero h1{font-size:clamp(46px,16vw,70px)}
  .hero .lede{font-size:16px;max-width:26ch}
  .notes{gap:9px}
  .note-group li{font-size:13px}
}

/* short landscape phones: the pinned copy would otherwise collide with the nav */
@media (max-height:520px) and (orientation:landscape){
  .hero,.pin{align-content:center;padding-bottom:0}
  .hero h1{font-size:clamp(38px,7vw,58px)}
  .cue{display:none}
}

/* ===========================================================================
   REDUCED MOTION
   The film is replaced by its final frame, the passage still happens (it is
   the structure of the page, not decoration) but nothing drifts on its own.
   =========================================================================== */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{
    animation-duration:.001ms !important;animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
  }
  .reveal{opacity:1;transform:none}
  .cue i{animation:none;opacity:.5}
  #loader{transition:opacity .3s ease}
}
