/* ============================================================
   Shishi Cosmetics — motion layer
   Loaded after each page's inline <style>, so it wins ties.
   Every effect here degrades to "no motion" under
   prefers-reduced-motion OR the site's a11y "stop animations"
   toggle (body.a11y-motion). See the guards at the bottom.
   ============================================================ */

:root{
  /* one easing for the whole site — slow out, no bounce */
  --mo-ease: cubic-bezier(.19,1,.22,1);
}

/* ---------- 0. opening title sequence (built by intro.js) ---------- */
html.mo-intro-active, html.mo-intro-active body{overflow:hidden;}

/* The curtain lives in the page markup but is display:none by default, and is
   only switched on by intro.js. If that script never runs, there is no curtain
   at all — the site can never be left covered by one that won't lift.
   pointer-events must stay ON: it swallows the tap that skips the intro.
   With pointer-events:none the tap would fall through and open whatever
   link happens to sit under the finger — on a phone that is a real hazard. */
.mo-intro{display:none;}
html.mo-intro-play .mo-intro{
  display:block; position:fixed; inset:0; z-index:9999; pointer-events:auto;
}
.mo-intro-panel{
  position:absolute; inset-inline:0; height:50.2%;
  background:var(--cream,#FBF5F0);
  animation:moPanel .85s var(--mo-ease) 1.45s both;
}
.mo-intro-top{top:0; --mo-panel-exit:-100%;}
.mo-intro-bottom{bottom:0; --mo-panel-exit:100%;}
@keyframes moPanel{from{transform:translateY(0);} to{transform:translateY(var(--mo-panel-exit));}}

.mo-intro-mark{
  position:absolute; inset:0;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:9px; text-align:center;
  animation:moMarkOut .35s ease 1.25s both;
}
.mo-intro-1, .mo-intro-2{
  font-family:'Frank Ruhl Libre', serif; color:var(--ink,#2E2622);
  display:block; opacity:0;
}
/* sized off vw so the mark fills a phone screen properly — most visitors are on one */
.mo-intro-1{
  font-size:clamp(34px,11vw,58px); font-weight:300; letter-spacing:.2em;
  padding-inline-start:.2em; /* balance the trailing letter-space */
  animation:moMarkIn .85s var(--mo-ease) .1s both;
}
.mo-intro-2{
  font-size:clamp(10px,2.6vw,13px); font-weight:300; letter-spacing:.42em;
  padding-inline-start:.42em; color:var(--rose-deep,#C98D8A);
  animation:moMarkIn .85s var(--mo-ease) .24s both;
}
@keyframes moMarkIn{from{opacity:0; transform:translateY(14px);} to{opacity:1; transform:none;}}
@keyframes moMarkOut{from{opacity:1;} to{opacity:0;}}

/* clicking or any keypress cuts it short */
.mo-intro.mo-intro-skip .mo-intro-mark{animation:moMarkOut .18s ease both;}
.mo-intro.mo-intro-skip .mo-intro-panel{animation:moPanel .26s var(--mo-ease) .06s both;}

/* ---------- 1. scroll progress hairline ---------- */
.mo-progress{
  position:fixed; top:0; inset-inline-start:0;
  height:2px; width:100%;
  background:linear-gradient(90deg, var(--rose), var(--rose-deep));
  transform:scaleX(0); transform-origin:0 50%;
  z-index:200; pointer-events:none; will-change:transform;
}
html[dir="rtl"] .mo-progress{transform-origin:100% 50%;}

/* ---------- 2. header condenses on scroll ---------- */
header{transition:box-shadow .4s ease, background .4s ease;}
header .nav{transition:padding .4s var(--mo-ease);}
header .logo-text{transition:transform .4s var(--mo-ease);}
header.mo-stuck{box-shadow:0 14px 34px -22px rgba(46,38,34,.75);}
header.mo-stuck .nav{padding-top:9px; padding-bottom:9px;}
header.mo-stuck .logo-text{transform:scale(.91);}

/* ---------- 3. headings reveal word by word ---------- */
.mo-mask{display:inline-block; overflow:hidden; vertical-align:bottom;}
.mo-word{
  display:inline-block;
  transform:translateY(112%); opacity:0;
  transition:transform .95s var(--mo-ease), opacity .95s var(--mo-ease);
}
.mo-in .mo-word{transform:translateY(0); opacity:1;}

/* ---------- 4. photographs wipe up into place ---------- */
.mo-img{
  clip-path:inset(0 0 100% 0);
  transform:scale(1.07);
  transition:clip-path 1.15s var(--mo-ease), transform 1.5s var(--mo-ease);
}
.mo-in .mo-img, .mo-in.mo-img{clip-path:inset(0 0 0 0); transform:scale(1);}

/* ---------- 5. soft rise for blocks ---------- */
.mo-rise{
  opacity:0; transform:translateY(30px);
  transition:opacity .85s var(--mo-ease), transform .85s var(--mo-ease);
}
.mo-in.mo-rise{opacity:1; transform:none;}

/* ---------- 6. card + image hover ---------- */
.gallery-item, .result-card, .ig-item{overflow:hidden;}
.gallery-item img, .result-card img, .ig-item img, .about-photo img{
  transition:transform 1s var(--mo-ease);
}
.gallery-item:hover img, .result-card:hover img, .ig-item:hover img{transform:scale(1.06);}

.service-card{transition:transform .55s var(--mo-ease), box-shadow .55s ease, border-color .35s ease;}
.service-card:hover{transform:translateY(-6px);}
.service-icon{transition:transform .55s var(--mo-ease);}
.service-card:hover .service-icon{transform:scale(1.08) rotate(-4deg);}

/* products page cards keep their own lift, just smooth the easing */
.p-item{transition:box-shadow .5s ease, transform .5s var(--mo-ease), border-color .35s ease;}
.p-row-img img{transition:transform 1s var(--mo-ease);}
.p-item:hover .p-row-img img{transform:scale(1.05);}

/* ---------- 7. buttons fill from the bottom ---------- */
.btn{
  background-repeat:no-repeat;
  background-size:100% 0%;
  background-position:50% 100%;
  transition:background-size .5s var(--mo-ease), color .35s ease, border-color .35s ease, transform .35s var(--mo-ease);
}
.btn:active{transform:translateY(1px);}
/* the pages declare `background:` (a shorthand) on :hover, which would reset
   background-image/size — so the fill has to be re-declared at :hover too */
.btn.btn-primary{background-image:linear-gradient(var(--rose-deep),var(--rose-deep));}
.btn.btn-primary:hover{
  background-color:var(--ink); color:#fff;
  background-image:linear-gradient(var(--rose-deep),var(--rose-deep));
  background-repeat:no-repeat; background-position:50% 100%;
  background-size:100% 100%;
}
.btn.btn-ghost:hover, .btn.btn-soft:hover{
  background-image:linear-gradient(var(--rose-wash),var(--rose-wash));
  background-repeat:no-repeat; background-position:50% 100%;
  background-size:100% 100%;
}
.nav-wa{transition:transform .35s var(--mo-ease), background .3s ease;}
.nav-wa:hover{transform:translateY(-2px);}

/* ---------- 8. nav underline draws in ---------- */
nav.links a{position:relative;}
nav.links a::after{
  content:""; position:absolute; inset-inline:0; bottom:-7px; height:1px;
  background:currentColor; transform:scaleX(0); transform-origin:50% 50%;
  transition:transform .5s var(--mo-ease);
}
nav.links a:hover::after, nav.links a.active::after{transform:scaleX(1);}

/* ---------- 9. hero parallax + settle ---------- */
.hero img{will-change:transform;}
.hero-content, .hero-logo{will-change:transform, opacity;}

/* ============================================================
   Display headings — Bellefair.
   Only the large display headings move to it; card <h3>s and the
   SHISHI logotype stay on Frank Ruhl Libre. Bellefair ships a single
   weight (400), so the old font-weight:300 has nothing to apply to —
   the size and tracking below compensate for how light it reads.
   ============================================================ */
.section-title,
.hero-content h1,
.mo-statement-text,
.p-hero .section-title{
  font-family:'Bellefair', 'Frank Ruhl Libre', serif;
  font-weight:400;
  letter-spacing:.6px;
}
.section-title{font-size:clamp(31px, 4.4vw, 46px);}
.hero-content h1{font-size:clamp(31px, 4.4vw, 50px);}
@media (max-width:520px){
  .section-title{font-size:29px;}
  .hero-content h1{font-size:30px;}
}

/* ============================================================
   9a. PAGE RHYTHM
   The page was one long run of "title + text + card grid" on one
   cream background, eight times over — which is what made scrolling
   feel flat. These give it alternating rooms to move through.
   ============================================================ */
.services{background:var(--paper,#fff);}
.tm{background:var(--rose-wash,#F7E8E4);}

/* ---- full-bleed statement: the page's one dramatic pause ---- */
.mo-statement{
  position:relative;
  height:150vh;               /* the extra height is the scroll runway */
  height:150svh;              /* svh where supported; vh above is the fallback */
  padding:0; margin:0;
  background:var(--ink,#2E2622);
}
.mo-statement-stage{
  position:sticky; top:0;
  height:100vh; height:100svh; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
}
.mo-statement-stage img{
  position:absolute; inset:0;
  width:100%; height:100%; object-fit:cover;
  /* blurred + scaled so a busy clinic photo reads as texture, not clutter,
     and the type is the only thing competing for attention */
  filter:blur(4px);
  transform:scale(1.12);
}
.mo-statement-stage::after{
  content:""; position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(46,38,34,.80), rgba(46,38,34,.90));
}
.mo-statement-inner{
  position:relative; z-index:2;
  max-width:820px; padding:0 30px; text-align:center;
}
.mo-statement-text{
  font-family:'Frank Ruhl Libre', serif; font-weight:300;
  color:#fff; line-height:1.35;
  font-size:clamp(27px, 7.4vw, 58px);
}
.mo-statement-sub{
  display:block; margin-top:22px;
  font-family:'Assistant', sans-serif; font-weight:600;
  font-size:12.5px; letter-spacing:3px; text-transform:uppercase;
  color:var(--rose,#E7B7B4);
  opacity:0; transition:opacity .8s var(--mo-ease) .5s;
}
.mo-in .mo-statement-sub{opacity:1;}

/* ---- before/after conveyor ----
   Same mechanic as the products page: two identical passes of the set inside
   a max-content track, animated to translateX(-50%) so the loop is seamless.
   direction:ltr MUST sit on the viewport (the container). In an RTL page a
   max-content block anchors by its RIGHT edge and overflows left, which opens
   on the last item and drains into empty space — the exact bug that made the
   products conveyor look broken. */
.ba-viewport{
  direction:ltr;
  overflow:hidden; padding:6px 0;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent);
  mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent);
}
.ba-track{
  display:flex; width:max-content;
  animation:baScroll 40s linear infinite;
}
@keyframes baScroll{from{transform:translateX(0);} to{transform:translateX(-50%);}}
.ba-item{
  width:260px; margin-right:18px; flex-shrink:0;   /* margin, not gap — half the
                                                      track must equal one set */
  border-radius:16px; overflow:hidden;
  box-shadow:var(--shadow, 0 20px 50px -25px rgba(60,40,30,.25));
  aspect-ratio:3/4; background:var(--cream,#FBF5F0);
}
.ba-item img{width:100%; height:100%; object-fit:cover; display:block;}
@media (max-width:520px){
  .ba-item{width:210px; margin-right:14px;}
}
@media (prefers-reduced-motion: reduce){
  .ba-track{animation:none;}
  .ba-viewport{overflow-x:auto;}
}
body.a11y-motion .ba-track{animation:none !important;}
body.a11y-motion .ba-viewport{overflow-x:auto;}

/* ---- tap a before/after photo to hold it large for a few seconds ---- */
.ba-item{cursor:zoom-in;}
.ba-item:focus-visible{outline:2px solid var(--rose-deep,#C98D8A); outline-offset:3px;}
.ba-track.ba-paused{animation-play-state:paused;}

.ba-zoom{
  position:fixed; inset:0; z-index:9998;
  display:none; align-items:center; justify-content:center;
  padding:20px; background:rgba(46,38,34,.92);
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  cursor:zoom-out;
}
.ba-zoom.open{display:flex; animation:baZoomIn .32s var(--mo-ease) both;}
.ba-zoom img{
  max-width:100%; max-height:86vh;
  border-radius:16px; box-shadow:0 30px 80px -30px rgba(0,0,0,.8);
  animation:baZoomPop .42s var(--mo-ease) both;
}
.ba-zoom-hint{
  position:absolute; inset-inline:0; bottom:26px;
  text-align:center; color:rgba(255,255,255,.72);
  font-family:'Assistant',sans-serif; font-size:13px; letter-spacing:.5px;
}
@keyframes baZoomIn{from{opacity:0;} to{opacity:1;}}
@keyframes baZoomPop{from{opacity:0; transform:scale(.94);} to{opacity:1; transform:none;}}

/* ---- slow brand marquee ---- */
.mo-marquee{
  direction:ltr;               /* MUST sit on the container, not the track —
                                  in RTL a max-content track anchors right and
                                  overflows left, which reads as "broken" */
  overflow:hidden; background:var(--ink,#2E2622);
  padding:15px 0; border-block:1px solid rgba(255,255,255,.08);
}
.mo-marquee-track{
  display:flex; width:max-content;
  animation:moMarquee 42s linear infinite;
}
.mo-marquee span{
  font-family:'Frank Ruhl Libre', serif; font-weight:300;
  font-size:16px; letter-spacing:2.5px;
  color:rgba(255,255,255,.82);
  padding-inline-end:46px; white-space:nowrap;
}
.mo-marquee span::after{content:"·"; padding-inline-start:46px; color:var(--rose,#E7B7B4);}
@keyframes moMarquee{from{transform:translateX(0);} to{transform:translateX(-50%);}}
@media (prefers-reduced-motion: reduce){.mo-marquee-track{animation:none;}}
body.a11y-motion .mo-marquee-track{animation:none !important;}

/* ============================================================
   9b. TESTIMONIALS
   Real customer messages, transcribed as text rather than embedded
   as screenshots — so no customer name, profile photo or phone
   metadata ever reaches the page, and the section stays fast,
   translatable and readable by a screen reader.
   ============================================================ */
.tm{padding:0 0 110px;}
.tm-head{text-align:center; max-width:620px; margin:0 auto 44px;}
.tm-head .lead{margin:0 auto;}

.tm-rail{
  display:flex; gap:16px;
  overflow-x:auto; scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
  padding:4px 4px 18px;
  scrollbar-width:none;
}
.tm-rail::-webkit-scrollbar{display:none;}

.tm-card{
  scroll-snap-align:center;
  flex:0 0 82%;
  background:var(--paper,#fff);
  border:1px solid var(--line,#EDE1D8);
  border-radius:22px;
  padding:30px 26px 26px;
  display:flex; flex-direction:column;
  box-shadow:0 18px 44px -34px rgba(60,40,30,.5);
}
.tm-mark{
  font-family:'Frank Ruhl Libre', serif;
  font-size:52px; line-height:.7; color:var(--rose,#E7B7B4);
  margin-bottom:10px; user-select:none;
}
.tm-text{
  color:#413731; font-size:16px; line-height:1.8; flex:1;
  white-space:pre-line; /* keeps the line breaks people actually typed */
}
.tm-who{
  margin-top:18px; padding-top:14px;
  border-top:1px solid var(--line,#EDE1D8);
  font-size:12.5px; font-weight:600; letter-spacing:.5px;
  color:var(--rose-deep,#C98D8A);
}
.tm-note{
  text-align:center; margin-top:6px;
  font-size:12.5px; color:var(--muted,#8A7B73);
}

@media (min-width:861px){
  .tm-rail{
    display:grid; grid-template-columns:repeat(3,1fr);
    gap:22px; overflow:visible; padding:0;
  }
  .tm-card{flex:none;}
}
@media (max-width:520px){
  .tm-card{flex-basis:88%; padding:26px 20px 22px;}
  .tm-text{font-size:15.5px;}
}

/* ============================================================
   10. STICKY BOOKING BAR — phones only.
   Not decoration: the header's "book" button scrolls out of view
   exactly when a visitor is being convinced, so on a phone there is
   nothing to tap at the moment of intent. This keeps booking and
   WhatsApp one thumb-reach away for the whole page.
   It is therefore NOT disabled by the reduced-motion path.
   ============================================================ */
.mo-cta{
  position:fixed; inset-inline:0; bottom:0; z-index:150;
  display:none; gap:10px;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  background:rgba(255,255,255,.95);
  -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  border-top:1px solid var(--line,#EDE1D8);
  transform:translateY(115%);
  transition:transform .45s var(--mo-ease);
}
.mo-cta.mo-cta-in{transform:translateY(0);}
.mo-cta a{
  flex:1; display:flex; align-items:center; justify-content:center; gap:7px;
  min-height:50px; /* comfortably above the 44px minimum tap target */
  border-radius:999px; text-decoration:none;
  font-family:'Assistant',sans-serif; font-size:15.5px; font-weight:600;
  line-height:1;
}
.mo-cta-book{background:var(--ink,#2E2622); color:#fff;}
.mo-cta-wa{background:var(--rose-wash,#F7E8E4); color:var(--ink,#2E2622); border:1px solid var(--rose,#E7B7B4);}
.mo-cta svg{width:18px; height:18px; flex:none;}

@media (max-width:860px){
  .mo-cta{display:flex;}
  /* reserve the space up front so the footer is never covered and the bar
     never causes a layout jump when it appears */
  body{padding-bottom:calc(78px + env(safe-area-inset-bottom));}
  /* lift the accessibility button clear of the bar */
  .a11y-btn{bottom:calc(90px + env(safe-area-inset-bottom)) !important;}
  .a11y-panel{bottom:calc(146px + env(safe-area-inset-bottom)) !important;}
}

/* ============================================================
   MOTION OFF — accessibility toggle and OS-level preference.
   Anything that starts hidden must be forced visible here,
   otherwise turning motion off would blank the page.
   ============================================================ */
body.a11y-motion .mo-progress{display:none;}
body.a11y-motion .mo-word,
body.a11y-motion .mo-rise{transform:none !important; opacity:1 !important;}
body.a11y-motion .mo-img{clip-path:none !important; transform:none !important;}
body.a11y-motion .hero img,
body.a11y-motion .hero-content,
body.a11y-motion .hero-logo{transform:none !important; opacity:1 !important;}

@media (prefers-reduced-motion: reduce){
  .mo-progress{display:none;}
  .mo-word, .mo-rise{transform:none !important; opacity:1 !important; transition:none !important;}
  .mo-img{clip-path:none !important; transform:none !important; transition:none !important;}
  .gallery-item:hover img, .result-card:hover img, .ig-item:hover img,
  .p-item:hover .p-row-img img, .service-card:hover .service-icon{transform:none !important;}
  header .nav, header .logo-text{transition:none !important;}
}

/* Latin-style numerals with a trailing sign flip in RTL ("100+" renders as
   "+100"). Forcing LTR on the number itself keeps the sign where it belongs. */
.stat b{direction:ltr; unicode-bidi:isolate; display:inline-block;}

/* Product cards used to size to their own text, so a product with a longer
   tagline (MULTI-NEEDS PROTECTOR wraps to 3 lines) stuck out as a taller box.
   Stretching the row and letting the body absorb the slack keeps every card
   in a row identical. */
.p-item{display:flex; flex-direction:column;}
.p-item > summary{display:block;}
.p-row-body{flex:1 0 auto;}
.p-row-tag{min-height:2.9em;}
/* Long product names ("MULTI-NEEDS PROTECTOR") wrap to two lines and dragged
   their whole grid row taller. Reserving two lines on every card makes them
   all identical instead. */
.p-row-body h3{line-height:1.25; min-height:2.5em; display:flex; align-items:center; justify-content:center;}

/* About photo on phones: the box was 16/11 (landscape) while the photo is a
   tall portrait pinned to `top`, so the crop showed only the wall above her
   head. Portrait box + a face-height offset puts Shireen back in frame.
   Phones only — desktop layout is untouched. */
@media (max-width:860px){
  .about-photo{aspect-ratio:4/5;}
  .about-photo img{object-position:center 44%;}
}
