/* =====================================================================
   Letstick — motion components ported from 21st.dev (Magic UI, Dillion Verma)
   React/Tailwind originals rebuilt in plain CSS + magic.js:
   Blur Fade text · Sparkles Text · Animated Shiny Text · Shimmer Button ·
   Shine Border · Border Beam · Magic Card · Number Ticker
   ===================================================================== */
@property --mu-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* ---------- Blur Fade (word by word; Arabic words stay whole so letters keep joining) ---------- */
.mu-line { display: inline; }
.mu-w { display: inline-block; white-space: pre; }
.mu-anim .mu-w { animation: muBlur .75s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 95ms + var(--d, 0ms)); }
@keyframes muBlur { from { opacity: 0; filter: blur(10px); transform: translateY(14px); } }

/* ---------- Sparkles Text ---------- */
.mu-spark-host { position: relative; }
.mu-sparks { position: absolute; inset: -18% -6%; pointer-events: none; }
.mu-sparks svg { position: absolute; width: var(--s, 18px); height: var(--s, 18px); translate: -50% -50%;
  animation: muStar var(--t, 1.6s) ease-in-out forwards; filter: drop-shadow(0 0 6px rgba(242, 220, 142, .55)); }
@keyframes muStar { 0% { opacity: 0; transform: scale(0) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(90deg); } 100% { opacity: 0; transform: scale(0) rotate(180deg); } }

/* ---------- Animated Shiny Text ---------- */
.mu-shiny {
  background: linear-gradient(100deg, currentColor 0%, currentColor 38%, #FFFBEF 50%, currentColor 62%, currentColor 100%) 0 0 / 250% 100% no-repeat;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: muShiny 3.6s cubic-bezier(.6, .1, .3, 1) infinite;
}
@keyframes muShiny { from { background-position: 0% 0; } 60%, to { background-position: 100% 0; } }

/* ---------- Shimmer Button: a spark runs round the pill's edge ---------- */
.btn--ink {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--ivory), var(--ivory)) padding-box,
    conic-gradient(from var(--mu-a), rgba(201, 164, 92, .35) 0deg, rgba(201, 164, 92, .35) 250deg, #FFF6D6 300deg, var(--gold) 330deg, rgba(201, 164, 92, .35) 360deg) border-box;
  animation: muSpin 3.2s linear infinite;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .35), 0 0 26px rgba(242, 220, 142, .18), inset 0 -6px 12px rgba(201, 164, 92, .18);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
}
.btn--ink:active { transform: scale(.97); }
@keyframes muSpin { to { --mu-a: 360deg; } }

/* ---------- Shine Border (soft light drifting round a frame) ---------- */
.mu-shine {
  position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 4;
  background: radial-gradient(transparent, transparent, var(--butter), var(--gold), #FFF6D6, transparent, transparent) 0 0 / 300% 300%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: muShine 9s linear infinite;
}
@keyframes muShine { 0% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } 100% { background-position: 0% 0%; } }
.scratch:not(.is-revealed) .scratch__card { transform: none; } /* no tilt while scratching */
.scratch { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.product .mu-shine { opacity: 0; transition: opacity .4s; padding: 2px; }
.product.is-ready .mu-shine { opacity: 1; animation-duration: 4s; }

/* ---------- Border Beam (one bright comet circling the compare frame) ---------- */
.mu-beam {
  position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none; z-index: 5;
  background: conic-gradient(from var(--mu-a), transparent 0deg, transparent 300deg, var(--gold) 335deg, #FFF6D6 352deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: muSpin 5s linear infinite;
}

/* ---------- Magic Card: quiz answers as cards with a spotlight under the finger ---------- */
.screen--quiz::before {
  background:
    linear-gradient(180deg, rgba(18, 13, 10, .45) 0%, rgba(18, 13, 10, .1) 22%, rgba(18, 13, 10, .55) 46%, rgba(18, 13, 10, .94) 62%, var(--espresso) 78%),
    url("scenes/hair-macro.jpg?v=2") center 62% / cover no-repeat, var(--espresso);
}
.quiz__opts, .quiz__opts.is-three { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-top: 0; }
.quiz__opts.is-three .quiz__opt:last-child { grid-column: 1 / -1; }
.quiz__opt, .quiz__opt:hover {
  --mx: 50%; --my: 50%;
  position: relative; display: flex; align-items: flex-end; justify-content: flex-start; min-height: 96px; padding: 16px 16px 14px;
  border-radius: 20px; border: 1px solid transparent; text-align: start;
  font-family: var(--display); font-size: 1.35rem; font-weight: 700; color: var(--ivory);
  background:
    radial-gradient(160px circle at var(--mx) var(--my), rgba(242, 220, 142, .16), transparent 70%) padding-box,
    linear-gradient(rgba(30, 21, 15, .82), rgba(22, 15, 11, .9)) padding-box,
    radial-gradient(180px circle at var(--mx) var(--my), rgba(242, 220, 142, .85), rgba(246, 238, 225, .14) 60%) border-box;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 18px 30px rgba(0, 0, 0, .35);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
}
.quiz__opt:active { transform: scale(.97); }
.quiz__opt::after { position: absolute; top: 14px; inset-inline-end: 14px; width: 20px; height: 20px; }
.quiz__opt.is-picked {
  color: var(--espresso);
  background: linear-gradient(135deg, #FFF3C4, var(--butter) 55%, var(--gold)) padding-box, linear-gradient(var(--butter), var(--gold)) border-box;
  box-shadow: 0 0 0 4px rgba(242, 220, 142, .18), 0 18px 40px rgba(201, 164, 92, .35);
}
.quiz__opt.is-picked::after { background: var(--espresso); border-color: var(--espresso); box-shadow: inset 0 0 0 4px var(--butter); }
.screen--quiz.is-active .quiz__opt { animation: muCardIn .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes muCardIn { from { opacity: 0; transform: translateY(18px) scale(.96); filter: blur(6px); } }

/* ---------- splash: the voice says the welcome line, so the photo stays clean ---------- */
.splash__sub { display: none; }
.splash__title { margin-top: 6px; }


/* =====================================================================
   Stage + result as a real column: photo on top, controls fill the rest.
   (before: photo pinned to the top, dock pinned to the bottom → an empty band
   between them and the "see the difference" button landing on the chips)
   ===================================================================== */
#s-stage, #s-result { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 0;
  padding: 0 0 calc(10px + env(safe-area-inset-bottom)); }
/* the photo: full width, as tall as a 3:4 frame allows while leaving ~250px for the controls */
#s-stage .mirror, #s-stage .mirror.is-camera, #s-result .compare {
  position: relative; inset: auto; flex: none; width: 100%; aspect-ratio: auto; max-height: none;
  height: min(150vw, calc(100dvh - 236px)); min-height: 320px;
}
#s-stage .mirror__glass { position: absolute; inset: 0; }
#s-stage .mirror::after, #s-result .compare::after {
  background: linear-gradient(180deg, rgba(18, 13, 10, .72) 0%, transparent 22%, transparent 76%, var(--espresso) 100%);
}
/* controls block, centred in the space under the photo */
#s-stage .chips { position: static; translate: none; display: flex; flex-wrap: wrap; justify-content: center; align-content: center;
  gap: 6px; min-height: 76px; margin: auto 0 0; padding: 4px 16px 10px; }
#s-stage .shelf { margin: 0 14px; }
#s-stage .stage__next { margin: 4px 24px 0; align-self: stretch; }
#s-stage .disclaimer { position: static; margin: auto 0 0; padding-top: 12px; }
#s-stage .caption-slot { margin: 0 14px 10px; }
#s-stage .ingr { bottom: 24px; }
#s-result .screen__title { top: calc(70px + env(safe-area-inset-top)); }
#s-result .compare__hint { margin: auto 0 12px; }
#s-result .row { margin: 0 24px auto; width: auto; }

/* ---------- Number Ticker ---------- */
.offer__now { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .mu-anim .mu-w, .mu-sparks svg, .mu-shiny, .btn--ink, .mu-shine, .mu-beam, .screen--quiz.is-active .quiz__opt { animation: none !important; }
  .mu-sparks { display: none; }
}
