/* Hilal motion module: chapters.
   The scroll choreography of everything after the hero. Every rule is scoped to .m-chapters, which
   <html> carries only while chapters.js runs: without it this file does nothing.

   A. Arrivals. Eyebrows, headlines, text, lists, cards, plans, privacy rows and questions wait in
      a hidden state and get .mc-in from chapters.js when they scroll into view (with --md, the
      delay that staggers things arriving together). .mc-now finishes one with no transition.
   B. Phones. chapters.js writes each phone's 3D pose from the scroll position; this file gives the
      stage its perspective and draws the light that crosses the glass. */

/* ---------- Hand-over from the core ----------
   These containers no longer fade as one block: their children arrive on their own. */
.m-chapters .chapter__head.rv,
.m-chapters .chapter__grid > .rv:not(.lantern),
.m-chapters .qibla-row > .stage.rv,
.m-chapters .close > .wrap.rv,
.m-chapters .keeps > li.rv{opacity:1;transform:none;transition:none}
/* These keep their own .rv class but arrive the module's way: the core's shift and its
   transition are switched off, so nothing slides a second time when the core marks them. */
.m-chapters .chapter .eyebrow.rv,
.m-chapters .chapter :is(.cards .card,.plans .plan).rv{transform:none}
.m-chapters .chapter :is(.cards .card,.plans .plan).rv{transition:none}
/* The closing block's icon is not this module's. The scenes module looks after it; when that one
   is not running, the icon keeps the core's own fade (the core still marks the block .is-in). */
.m-chapters:not(.m-scenes) .close > .wrap.rv > .close__icon{opacity:0;transform:translateY(26px);
  transition:opacity .9s var(--ease),transform .9s var(--ease)}
.m-chapters:not(.m-scenes) .close > .wrap.rv.is-in > .close__icon{opacity:1;transform:none}
/* Turned phones and travelling light are cut at the section's edge, never at the body's. */
.m-chapters .chapter{overflow-x:clip}

.m-chapters .mc-now,.m-chapters .mc-now *,.m-chapters .mc-now::before,.m-chapters .mc-now::after,
.m-chapters .mc-now *::before,.m-chapters .mc-now *::after{transition:none !important}

/* ---------- Eyebrow: the name lands, the rule draws, the label settles ---------- */
.m-chapters .chapter .eyebrow{opacity:0;transition:opacity .5s ease var(--md,0ms)}
.m-chapters .chapter .eyebrow b{transform:translate3d(0,10px,0);transition:transform .9s var(--ease) var(--md,0ms)}
.m-chapters .chapter .eyebrow i{transform:scaleX(0);transform-origin:0 50%;
  transition:transform .9s var(--ease-io) calc(var(--md,0ms) + 160ms)}
.m-chapters .chapter .eyebrow .mc-lab{opacity:0;transform:translate3d(-16px,0,0);
  transition:opacity .7s ease calc(var(--md,0ms) + 420ms),transform 1s var(--ease) calc(var(--md,0ms) + 420ms)}
.m-chapters .chapter .eyebrow.mc-in{opacity:1}
.m-chapters .chapter .eyebrow.mc-in b,
.m-chapters .chapter .eyebrow.mc-in i,
.m-chapters .chapter .eyebrow.mc-in .mc-lab{opacity:1;transform:none}
.m-chapters .chapter .eyebrow.mc-in i{opacity:.6}

/* ---------- Headline: two breaths through a mask ----------
   chapters.js wraps each word (.mc-w is the mask, .mc-wi the word). The plain words rise first,
   the italic ones a beat later (--wd). Words stay inline-blocks, so wrapping is unchanged. */
.m-chapters :is(.chapter,.close) .h2:not(.mc-h){visibility:hidden}
.m-chapters .mc-w{display:inline-block;clip-path:inset(-.14em -.24em -.27em -.24em)}
/* The same window cut as a plain box (padding out, margin back in): no mask to composite, and
   the word keeps its place and its baseline. The clip-path above is for browsers without it. */
@supports (overflow:clip){
  .m-chapters .mc-w{clip-path:none;overflow:clip;padding:.14em .24em .27em;margin:-.14em -.24em -.27em}
  .m-chapters .mc-done .mc-w{overflow:visible}
}
.m-chapters .mc-wi{display:inline-block;transform:translate3d(0,128%,0) rotate(5deg);transform-origin:0 100%;
  transition:transform 1.05s var(--ease) calc(var(--md,0ms) + var(--wd,0ms))}
.m-chapters .serif .mc-wi{transition-duration:1.25s}
.m-chapters .mc-in .mc-wi{transform:none}
.m-chapters .mc-done .mc-w{clip-path:none}

/* ---------- Ledes, body text, the closing lines ---------- */
.m-chapters :is(.chapter,.close) :is(.lede,.body,.livesky__note),
.m-chapters .quiet__copy p,
.m-chapters .close :is(.close__cta,.close__fine){opacity:0;transform:translate3d(0,24px,0);
  transition:opacity .9s var(--ease) var(--md,0ms),transform 1.1s var(--ease) var(--md,0ms)}
.m-chapters :is(.chapter,.close) :is(.lede,.body,.livesky__note).mc-in,
.m-chapters .quiet__copy p.mc-in,
.m-chapters .close :is(.close__cta,.close__fine).mc-in{opacity:1;transform:none}

/* ---------- Lists: one after another, each crescent turning into place ---------- */
.m-chapters .chapter .ticks li{opacity:0;transform:translate3d(0,18px,0);
  transition:opacity .8s var(--ease) var(--md,0ms),transform 1s var(--ease) var(--md,0ms)}
.m-chapters .chapter .ticks li::before{opacity:0;transform:rotate(-170deg) scale(.2);
  transition:opacity .35s ease calc(var(--md,0ms) + 140ms),transform 1.2s var(--spring) calc(var(--md,0ms) + 140ms)}
.m-chapters .chapter .ticks li.mc-in{opacity:1;transform:none}
.m-chapters .chapter .ticks li.mc-in::before{opacity:1;transform:none}

/* Reciters pop in. */
.m-chapters .chapter .chips li{opacity:0;transform:scale(.55);
  transition:opacity .35s ease var(--md,0ms),transform .95s var(--spring) var(--md,0ms)}
.m-chapters .chapter .chips li.mc-in{opacity:1;transform:none}

/* ---------- Cards and plans: up from the floor, then they follow the pointer ----------
   The arrival is a keyframe animation that hands transform back when it ends (fill: backwards),
   so chapters.js can tilt the card with an inline transform afterwards. */
.m-chapters .chapter :is(.cards .card,.plans .plan){position:relative;opacity:0}
/* A glass card blurs what is behind it. That is costly on a moving element, so the blur waits
   until the card has landed (.mc-set); over the smooth sky the change cannot be seen. */
.m-chapters .chapter .cards .card:not(.mc-set){-webkit-backdrop-filter:none;backdrop-filter:none}
.m-chapters .chapter :is(.cards .card,.plans .plan).mc-in{opacity:1;animation:mc-card 1.2s var(--ease) var(--md,0ms) backwards}
.m-chapters .chapter :is(.cards .card,.plans .plan).mc-still{animation:none}
.m-chapters .chapter :is(.cards .card,.plans .plan).mc-hot{will-change:transform}
@keyframes mc-card{
  from{opacity:0;transform:perspective(1100px) translate3d(0,56px,0) rotateX(15deg) scale(.93)}
  to{opacity:1;transform:perspective(1100px) translate3d(0,0,0) rotateX(0deg) scale(1)}
}
.m-chapters .card > :is(.card__k,h3,p),
.m-chapters .plan > :is(h3,p){opacity:0;transform:translate3d(0,14px,0);
  transition:opacity .7s ease calc(var(--md,0ms) + var(--k,0) * 80ms + 220ms),
    transform 1s var(--ease) calc(var(--md,0ms) + var(--k,0) * 80ms + 220ms)}
.m-chapters .card > h3,.m-chapters .plan > p{--k:1}
.m-chapters .card > p{--k:2}
.m-chapters .card.mc-in > :is(.card__k,h3,p),
.m-chapters .plan.mc-in > :is(h3,p){opacity:1;transform:none}
/* The light under the pointer: a soft pool on the glass and a glint along the edge. */
.m-chapters :is(.mc-spot,.mc-rim){position:absolute;inset:0;border-radius:inherit;overflow:hidden;pointer-events:none;
  opacity:0;transition:opacity .5s ease}
.m-chapters .mc-rim{inset:-1px;padding:1px;
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;
  mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0)}
.m-chapters .mc-hot > :is(.mc-spot,.mc-rim){opacity:1}
.m-chapters :is(.mc-spot,.mc-rim) i{position:absolute;left:-260px;top:-260px;width:520px;height:520px;border-radius:50%;
  background:radial-gradient(circle closest-side,rgba(255,238,204,.26),rgba(255,238,204,.08) 46%,transparent)}
.m-chapters .mc-rim i{background:radial-gradient(circle closest-side,rgba(246,214,150,.95),rgba(246,214,150,.3) 42%,transparent 72%)}

/* ---------- Privacy rows: each border draws from the left, a glint at its head ---------- */
.m-chapters .keeps{position:relative;border-top-color:transparent}
.m-chapters .keeps li{position:relative;border-bottom-color:transparent}
.m-chapters .keeps::before,
.m-chapters .keeps li::after{content:'';position:absolute;left:0;right:0;height:1px;background:var(--line);
  transform:scaleX(0);transform-origin:0 50%;transition:transform 1.25s var(--ease-io) calc(var(--md,0ms) + 80ms)}
.m-chapters .keeps::before{top:-1px}
.m-chapters .keeps li::after{bottom:-1px}
/* The glint grows with the line (same scale, same easing), so it always sits at the line's head. */
.m-chapters .keeps li::before{content:'';position:absolute;left:0;right:0;bottom:-1px;height:1px;opacity:0;
  background:linear-gradient(90deg,transparent calc(100% - 220px),var(--gold));
  transform:scaleX(0);transform-origin:0 50%}
.m-chapters .keeps.mc-in::before,
.m-chapters .keeps li.mc-in::after{transform:none}
.m-chapters .keeps li.mc-in::before{animation:mc-glint 1.25s var(--ease-io) calc(var(--md,0ms) + 80ms) both}
.m-chapters .keeps li.mc-still::before{animation:none}
@keyframes mc-glint{
  0%{opacity:0;transform:scaleX(0)}
  12%{opacity:1}
  72%{opacity:1}
  100%{opacity:0;transform:none}
}
.m-chapters .keeps li > :is(strong,span){opacity:0;transform:translate3d(0,16px,0);
  transition:opacity .8s var(--ease) calc(var(--md,0ms) + var(--k,0) * 90ms + 120ms),
    transform 1s var(--ease) calc(var(--md,0ms) + var(--k,0) * 90ms + 120ms)}
.m-chapters .keeps li > span{--k:1}
.m-chapters .keeps li.mc-in > :is(strong,span){opacity:1;transform:none}

/* ---------- Questions: rows swing up into place; opening and closing ease ---------- */
.m-chapters .faq{perspective:1200px}
.m-chapters .faq details.rv{opacity:0;transform:translate3d(0,30px,-40px) rotateX(-14deg);transform-origin:50% 0;
  transition:opacity .8s var(--ease) var(--md,0ms),transform 1.1s var(--ease) var(--md,0ms)}
.m-chapters .faq details.rv.mc-in{opacity:1;transform:none}
/* While a question closes it is still [open]; the chevron turns back at once. */
.m-chapters .faq details.mc-closing[open] summary::after{transform:rotate(45deg) translate(-3px,-3px)}

/* ---------- Phones on a stage ---------- */
.m-chapters .stage{perspective:900px}
@media (min-width:1020px){.m-chapters .stage{perspective:1200px}}
/* The glow behind the phones breathes with the scroll (--gs, --go). A blurred box that changes
   every frame is costly, so here the softness is in the gradient itself and the blur is off. */
.m-chapters .stage::before{filter:none;background:radial-gradient(closest-side,var(--card-2),transparent);
  transform:scale(var(--gs,1));opacity:var(--go,1)}
.m-chapters .stage--pair .phone:first-child{z-index:1}
.m-chapters .stage.mc-live .phone,
.m-chapters .stage.mc-live::before,
.m-chapters #sky-pair.mc-live::after,
.m-chapters .stage.mc-live .mc-sheen > *{will-change:transform,opacity}
/* Light on the glass: a glint that crosses as the phone turns flat (i) and a broad glare as it
   tips away again (b). Both are clipped to the phone's own corners. */
.m-chapters .mc-sheen,
.m-chapters .mc-shade{position:absolute;inset:0;z-index:2;border-radius:inherit;overflow:hidden;pointer-events:none}
.m-chapters .mc-shade{background:#04061a;opacity:0}
.m-chapters .mc-sheen > *{position:absolute;opacity:0}
.m-chapters .mc-sheen i{top:-15%;bottom:-15%;left:-75%;width:250%;
  background:linear-gradient(102deg,transparent 35%,rgba(10,14,46,.06) 40.5%,rgba(255,255,255,.16) 45.5%,
    rgba(255,255,255,.56) 50%,rgba(255,255,255,.16) 54.5%,rgba(10,14,46,.06) 59.5%,transparent 65%)}
/* A light screenshot: the band carries a soft shade on both sides of its bright line, or it
   would vanish on white. */
.m-chapters .mc-sheen--day i{background:linear-gradient(102deg,transparent 33%,rgba(26,32,84,.1) 40%,rgba(26,32,84,.045) 45%,
  rgba(255,255,255,.8) 50%,rgba(26,32,84,.045) 55%,rgba(26,32,84,.1) 60%,transparent 67%)}
.m-chapters .mc-sheen b{left:-10%;right:-10%;top:-75%;height:250%;
  background:linear-gradient(176deg,transparent 38%,rgba(255,255,255,.07) 44%,rgba(255,255,255,.26) 50%,
    rgba(255,255,255,.07) 56%,transparent 62%)}
/* The sky pair: moonlight on the night screen, the afternoon sun on the other. */
.m-chapters .mc-sheen--moon i{background:linear-gradient(102deg,transparent 36%,rgba(150,170,255,.1) 43%,
  rgba(214,224,255,.5) 50%,rgba(150,170,255,.1) 57%,transparent 64%)}
.m-chapters .mc-sheen--sun i{background:linear-gradient(102deg,transparent 35%,rgba(255,150,70,.1) 41%,rgba(255,190,110,.3) 46%,
  rgba(255,228,170,.7) 50%,rgba(255,190,110,.3) 54%,rgba(255,150,70,.1) 59%,transparent 65%)}
.m-chapters #sky-pair::after{content:'';position:absolute;z-index:-1;inset:-4% -24% -12% 16%;border-radius:50%;
  background:radial-gradient(closest-side,rgba(255,190,112,.7),rgba(255,156,92,.4) 38%,rgba(255,140,84,.13) 68%,transparent);
  opacity:var(--warm,0);transform:scale(calc(.78 + var(--warm,0) * .32))}
