/* =============================================================
   Baydah — home.css  (home page · hero slider)
   Needs base.css + bottle.css first (tokens, header, bottle effects).
   The hero composition is the same in every language: .stage is
   always ltr; only the header follows <html dir>.
   ============================================================= */

/* bottle height: everything on the bottle scales from this */
body[data-page="home"]{ --bh:min(64vh,112vw) }

/* ---------- hero stage ---------- */
body[data-page="home"] .hero{position:relative; height:100vh; height:100svh}
body[data-page="home"] .stage{
  direction:ltr;   /* the hero composition is identical in every language; only the header follows dir */
  position:relative; height:100%; overflow:hidden;
  background:radial-gradient(ellipse 60% 55% at 50% 58%,var(--stage1) 0%,var(--stage2) 55%,var(--stage3) 100%);
}
body[data-page="home"] .floor{                              /* soft light under the bottle */
  position:absolute; left:50%; top:calc(50% + var(--bh)*.524 - 3vmin);   /* physical on purpose */
  width:46vmin; height:6vmin; transform:translateX(-50%);
  background:radial-gradient(ellipse,var(--floor),transparent 70%);
}

/* ---------- bottle ---------- */
body[data-page="home"] .bw{                                 /* physical on purpose: centred in the viewport in both directions */
  position:absolute; left:50%; top:50%; z-index:5; will-change:transform;
  height:var(--bh); aspect-ratio:896/1200;
  margin:calc(var(--bh)/-2.1) 0 0 calc(var(--bh)*-.3735);
}
body[data-page="home"] .bw>img{                             /* one bottle photo per slide, cross-faded by home.js */
  position:absolute; inset:0; width:100%; height:100%; object-fit:contain;
  filter:drop-shadow(0 3vh 4vh var(--bottle-shadow));
  -webkit-mask-image:linear-gradient(to bottom,#000 93%,transparent 100%);
          mask-image:linear-gradient(to bottom,#000 93%,transparent 100%);
}

/* ---------- floating ingredients (positions are set by home.js) ---------- */
body[data-page="home"] .els{position:absolute; inset:0; z-index:4}
body[data-page="home"] .els.front{z-index:6}
body[data-page="home"] .el{position:absolute; left:0; top:0; will-change:transform,opacity; pointer-events:none}
body[data-page="home"] .el img{display:block; width:100%; height:auto}

/* ---------- callout lines + labels (built by home.js) ---------- */
body[data-page="home"] .lines{position:absolute; inset:0; width:100%; height:100%; z-index:3; pointer-events:none}
body[data-page="home"] .lines *{vector-effect:non-scaling-stroke}
/* ألوان الخطوط (كانت مكتوبة داخل home.js) — بتتغير مع الوضع */
body[data-page="home"] .lines .c-line{stroke:rgba(var(--w),.42)}
body[data-page="home"] .lines .c-dot{fill:var(--t1)}
body[data-page="home"] .lines .c-ring{stroke:rgba(var(--w),.45)}
body[data-page="home"] .lines .c-end{fill:var(--ln-end)}
body[data-page="home"] #ring{stroke:var(--orbit)}                 /* حلقة المدار (كانت في index.html) */
body[data-page="home"] .fx{position:absolute; inset:0; width:100%; height:100%; z-index:6; pointer-events:none}   /* orbit ring + orbs */
body[data-page="home"] .tg{
  position:absolute; z-index:7; opacity:0; white-space:nowrap; pointer-events:none; will-change:transform,opacity;
  font-size:10px; letter-spacing:.2em; color:var(--tg);
}
html[lang="ar"] body[data-page="home"] .tg{font-size:13px}

/* ---------- big slide title ---------- */
body[data-page="home"] .ttlwrap{
  position:absolute; inset-inline-start:4vw; bottom:5vh; z-index:8;
  width:92vw; height:1.12em; overflow:hidden; pointer-events:none;
  font:700 clamp(40px,9.5vw,150px)/1.12 var(--san); color:var(--t1);   /* same family as the nav, bold */
}
body[data-page="home"] .ttlwrap div{position:absolute; inset-inline-start:0; top:0; white-space:nowrap; will-change:transform,opacity}

/* ---------- small UI ---------- */
body[data-page="home"] .prog{position:absolute; inset-inline-end:3vw; top:32vh; z-index:7; width:1px; height:34vh; background:rgba(var(--w),.18)}
body[data-page="home"] .prog i{position:absolute; inset-inline-start:-1px; top:0; width:3px; height:0; background:var(--gold-bg)}
body[data-page="home"] .side{
  position:absolute; left:2.4vw; top:50%; z-index:7;   /* physical: logical insets follow the writing mode, which is vertical here */
  writing-mode:vertical-rl; transform:translateY(-50%) rotate(180deg);
  font-size:10px; letter-spacing:.32em; color:var(--mut);
}
html[lang="ar"] body[data-page="home"] .side{font-size:13px}
@media (max-width:720px){ body[data-page="home"] .side{display:none} }   /* hidden on phones */
body[data-page="home"] .fab{                              /* WhatsApp button with a soft pulsing ring */
  position:absolute; inset-inline-end:3vw; bottom:calc(3vh + 4px); z-index:9;
  display:grid; place-items:center; width:46px; height:46px; border-radius:50%;
  background:#25d366; animation:home-wa-pulse 2.4s ease-out infinite;
}
body[data-page="home"] .fab:after{content:""; position:absolute; inset:0; border-radius:50%; animation:home-wa-pulse 2.4s ease-out 1.2s infinite}
@keyframes home-wa-pulse{
  0%{box-shadow:0 0 0 0 rgba(37,211,102,.55)}
  70%,100%{box-shadow:0 0 0 26px rgba(37,211,102,0)}
}
@media (prefers-reduced-motion:reduce){ body[data-page="home"] .fab,body[data-page="home"] .fab:after{animation:none} }

/* ---------- "اكتشف العطور" button (appears after the last slide) ---------- */
body[data-page="home"] .go{
  position:absolute; left:50%; bottom:calc(3vh + 4px); z-index:9;   /* physical on purpose: centred, same baseline as the WhatsApp button */
  display:inline-flex; align-items:center; gap:10px; height:46px; padding:0 26px; border-radius:999px;
  background:var(--gold-bg); color:#0a0908; font:700 15px var(--san); text-decoration:none; white-space:nowrap;font-weight: normal;
  opacity:0; visibility:hidden; transform:translate(-50%,18px);
  transition:opacity .7s,transform .9s cubic-bezier(.2,.8,.2,1),visibility 0s .9s,background-color .25s;
}
body[data-page="home"] .go.show{opacity:1; visibility:visible; transform:translate(-50%,0); transition-delay:0s,0s,0s,0s; animation:home-go-pulse 2.6s ease-out 1.2s infinite}
body[data-page="home"] .go:hover{background:var(--btn-bg); color:var(--btn-fg)}
body[data-page="home"] .go svg{width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; transition:translate .25s}
html[dir="rtl"] body[data-page="home"] .go{direction:rtl}
html[dir="ltr"] body[data-page="home"] .go{direction:ltr}
body[data-page="home"] .go:hover svg{translate:-4px 0}
html[dir="ltr"] body[data-page="home"] .go svg{scale:-1 1}              /* arrow points "forward" in both directions */
html[dir="ltr"] body[data-page="home"] .go:hover svg{translate:4px 0}
@keyframes home-go-pulse{0%{box-shadow:0 0 0 0 var(--go-pulse)} 70%,100%{box-shadow:0 0 0 20px var(--go-pulse0)}}
@media (max-width:480px){ body[data-page="home"] .go{padding:0 20px; font-size:14px} }
@media (prefers-reduced-motion:reduce){ body[data-page="home"] .go.show{animation:none} }

/* ---------- preloader (same as loading.png: light bg + dunes, logo, name, copyright) ---------- */
body[data-page="home"] #pre{
  --pu:max(1vw,7px);                       /* وحدة القياس: كل الأحجام بتتناسب مع عرض الشاشة */
  position:fixed; inset:0; z-index:100; direction:ltr; color:#8a8a8a;
  background:#e4e4e4 center/cover no-repeat;     /* صورة الخلفية inline على #pre */
  transition:transform 1s cubic-bezier(.77,0,.18,1),border-radius 1s cubic-bezier(.77,0,.18,1);
}
@media (max-width:720px){ body[data-page="home"] #pre{--pu:2.4vw} }   /* على الموبايل أكبر شوية عشان يبان */
body[data-page="home"] #pre.out{transform:translateY(-100%); border-radius:0 0 50% 50%/0 0 14vh 14vh}

body[data-page="home"] .pre-logo,body[data-page="home"] .pre-name,body[data-page="home"] .pre-copy{
  position:absolute; left:50%; margin:0; transform:translate(-50%,-50%);
}                                          /* ثابتين: بيطلعوا مع الخلفية كلها مش بيختفوا قبلها */

body[data-page="home"] .pre-logo{top:50%; width:calc(var(--pu)*10.05); height:auto; animation:home-pre-pop .9s cubic-bezier(.2,1.3,.4,1) both}
body[data-page="home"] .pre-name{top:75.3%; width:calc(var(--pu)*10.6); height:auto; animation:home-pre-fade .8s ease .45s both}
body[data-page="home"] .pre-bar{                                  /* بار اللودينج: بنفس عرض الاسم المرئي تحته */
  position:absolute; left:50%; top:80.5%; width:calc(var(--pu)*9); height:max(calc(var(--pu)*.2),2px);
  transform:translateX(-50%); border-radius:2px; background:rgba(42,42,42,.14); overflow:hidden;
  animation:home-pre-fade .8s ease .6s both;
}
body[data-page="home"] .pre-bar i{display:block; height:100%; background:#2a2a2a; transform-origin:left; transform:scaleX(0); animation:home-pre-bar 1.8s cubic-bezier(.6,0,.3,1) .5s forwards}
body[data-page="home"] .pre-copy{
  top:96.2%; white-space:nowrap; text-align:center;
  font:300 max(calc(var(--pu)*.9),10px)/1 Jost,"Helvetica Neue",Arial,sans-serif;
  animation:home-pre-fade .8s ease .6s both;
}

@keyframes home-pre-pop{from{opacity:0; transform:translate(-50%,-50%) scale(.6)}}
@keyframes home-pre-fade{from{opacity:0}}
@keyframes home-pre-bar{to{transform:scaleX(1)}}
@media (prefers-reduced-motion:reduce){
  body[data-page="home"] .pre-logo,body[data-page="home"] .pre-name,body[data-page="home"] .pre-copy,body[data-page="home"] .pre-bar,body[data-page="home"] .pre-bar i{animation:none} body[data-page="home"] .pre-bar i{transform:none}
  body[data-page="home"] #pre,body[data-page="home"] #pre.out{transition:opacity .4s; border-radius:0} body[data-page="home"] #pre.out{transform:none; opacity:0}
}

/* visually hidden, still read by screen readers and crawlers (the page's one <h1>) */
body[data-page="home"] .sr{position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0}
