/* ScentMe landing page (scentme.app/ and scentme.app/ar).
   Palette and type follow the iPhone app (DESIGN.md): Alexandria for both
   scripts, aubergine structure, purple interaction, lavender on dark.
   Motion lives in landing.js. Every element is visible without it: the
   script adds .js to <html> before any entrance state applies. */

@font-face {
  font-family: "Alexandria";
  src: url("/fonts/Alexandria.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --night: #1C1722;
  --night-2: #2A2233;
  --night-line: rgba(255, 255, 255, 0.1);
  --porcelain: #FAF9F6;
  --paper: #FFFFFF;
  --warm: #F1EDE4;
  --ink: #241F2B;
  --body: #3A362D;
  --muted: #726E64;
  --line: rgba(36, 31, 43, 0.09);
  --violet: #6944CD;
  --violet-deep: #51329E;
  --violet-pale: #EEE8FF;
  --track: #E7E1EF;
  --lilac: #B79AFA;
  --on-night-muted: #B7AECA;

  --gutter: clamp(16px, 4.5vw, 64px);
  --max: 1240px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Alexandria", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
  accent-color: var(--violet);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--lilac) var(--night);
}

body {
  margin: 0;
  background: var(--night);
  color: var(--body);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 350;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

html[lang="ar"] body { line-height: 1.85; }

::selection { background: var(--lilac); color: var(--ink); }

img { display: block; max-width: 100%; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--lilac);
  outline-offset: 3px;
  border-radius: 8px;
}

.skip {
  position: absolute;
  inset-inline-start: 16px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 16px; }

.shell {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.night { background: var(--night); color: #fff; }

/* ---------- Masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(28, 23, 34, 0);
  transition: background-color 300ms var(--ease), box-shadow 300ms var(--ease);
}
.masthead.scrolled {
  background: rgba(28, 23, 34, 0.94);
  box-shadow: 0 10px 30px rgba(10, 6, 16, 0.35);
}
.masthead .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
}
.masthead .brand img { width: 120px; height: auto; }

.masthead nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 30px);
  font-size: 15px;
}
.masthead nav a {
  position: relative;
  color: var(--on-night-muted);
  text-decoration: none;
  transition: color 150ms;
}
.masthead nav a:not(.lang)::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -4px;
  height: 2px;
  border-radius: 2px;
  background: var(--lilac);
  transform: scaleX(0);
  transform-origin: var(--start, left);
  transition: transform 250ms var(--ease);
}
html[dir="rtl"] .masthead nav a { --start: right; }
.masthead nav a:hover { color: #fff; }
.masthead nav a:hover::after { transform: scaleX(1); }

.masthead nav .lang {
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #fff;
  transition: border-color 150ms, background-color 150ms;
}
.masthead nav .lang:hover { border-color: var(--lilac); background: rgba(183, 154, 250, 0.12); }

@media (max-width: 600px) {
  .masthead nav .hide-sm { display: none; }
  .masthead .brand img { width: 104px; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: -76px;
  padding-top: 76px;
}

.hero .mist,
.closing .mist {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-inline-end: -12%;
  top: 4%;
  width: min(78vw, 900px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(105, 68, 205, 0.6), rgba(105, 68, 205, 0));
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  min-height: min(92svh, 900px);
  padding-block: clamp(24px, 5vw, 64px) clamp(72px, 9vw, 120px);
}

.hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(48px, 7.2vw, 96px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}
html[lang="ar"] .hero h1 {
  font-size: clamp(46px, 6.6vw, 90px);
  line-height: 1.28;
  letter-spacing: 0;
}
.hero h1 .line { display: block; }
.hero h1 .line + .line { color: var(--lilac); }
.hero h1 .w { display: inline-block; }

.hero .lede {
  max-width: 33em;
  margin: clamp(22px, 3vw, 34px) 0 0;
  color: var(--on-night-muted);
  font-size: clamp(17px, 1.45vw, 20px);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: clamp(28px, 4vw, 44px);
}

.store-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  padding: 13px 24px 13px 18px;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  line-height: 1.15;
  box-shadow: 0 14px 34px rgba(105, 68, 205, 0.35);
}
html[dir="rtl"] .store-badge { padding: 13px 18px 13px 24px; }
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge small { display: block; font-size: 12px; color: var(--muted); }
.store-badge strong { display: block; font-size: 18px; font-weight: 700; }
/* A slow light sweep across the badge: the one looping accent on the CTA. */
.store-badge::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(183, 154, 250, 0.45) 50%, transparent 70%);
  transform: translateX(-120%);
}

.cta-note { color: var(--on-night-muted); font-size: 15px; }

/* Photo arch with floating app fragments */
.hero-visual {
  position: relative;
  justify-self: center;
  width: min(100%, 430px);
  padding-bottom: 44px;
}
.hero-visual .arch {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 999px 999px 34px 34px;
  aspect-ratio: 4 / 5;
  background: var(--night-2);
  box-shadow: 0 40px 80px rgba(8, 4, 16, 0.5);
}
.hero-visual .arch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
}
.hero-visual .podium {
  position: absolute;
  inset-inline: -14%;
  bottom: 0;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(180deg, #8161DA, #51329E);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 6px 0 rgba(255, 255, 255, 0.18);
}

.chip {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 1px;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.3;
  box-shadow: 0 18px 40px rgba(12, 6, 26, 0.45);
  translate: var(--px, 0) var(--py, 0);
  transition: translate 600ms var(--ease);
}
.chip small { font-size: 12px; }
.chip b { font-weight: 800; }

.chip.price {
  inset-inline-start: -16%;
  bottom: 20%;
  min-width: 176px;
  background: var(--violet);
  color: #fff;
}
.chip.price small { color: #DCD0FF; }
.chip.price b { font-size: 28px; letter-spacing: -0.01em; }
.chip.price span { font-size: 13px; }

.chip.rating {
  inset-inline-end: -12%;
  top: 30%;
  background: #fff;
  color: var(--ink);
}
.chip.rating b { font-size: 22px; }
.chip.rating b::before { content: "★ "; color: var(--violet); }
.chip.rating small { color: var(--muted); }

.chip.match {
  inset-inline-end: -4%;
  bottom: 12%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: var(--ink);
}
.chip.match img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.chip.match b { font-size: 15px; }
.chip.match small { display: block; color: var(--muted); }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-visual { width: min(74%, 340px); margin-top: 8px; }
  .chip.price { inset-inline-start: -22%; }
  .chip.rating { inset-inline-end: -20%; }
  .chip.match { display: none; }
}

/* ---------- Houses marquee ---------- */

.houses {
  position: relative;
  padding-block: 34px;
  border-block: 1px solid var(--night-line);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.houses .track {
  display: flex;
  width: max-content;
  direction: ltr;
}
.houses ul {
  display: flex;
  align-items: center;
  gap: clamp(48px, 6vw, 88px);
  margin: 0;
  padding: 0 clamp(24px, 3vw, 44px);
  list-style: none;
}
.houses img {
  width: auto;
  height: 34px;
  opacity: 0.72;
  transition: opacity 200ms;
}
.houses img.tall { height: 44px; }
.houses li:hover img { opacity: 1; }

/* ---------- Families: blotter accordion ---------- */

.families {
  position: relative;
  padding-block: clamp(80px, 10vw, 140px);
}

.section-head { display: grid; gap: 16px; max-width: 38em; }
.section-head h2 {
  margin: 0;
  font-size: clamp(34px, 4.6vw, 60px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
html[lang="ar"] .section-head h2 { line-height: 1.35; letter-spacing: 0; }
.section-head p { margin: 0; font-size: clamp(17px, 1.4vw, 19px); }
.night .section-head p { color: var(--on-night-muted); }

.strips {
  display: flex;
  gap: clamp(8px, 1vw, 14px);
  height: clamp(420px, 44vw, 520px);
  margin: clamp(44px, 6vw, 72px) 0 0;
  padding: 0;
  list-style: none;
}

.strip {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px 16px 999px 999px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.35);
  transition: flex-grow 700ms var(--ease), border-radius 700ms var(--ease), transform 700ms var(--ease);
}
.strip.active {
  flex-grow: 4.2;
  border-radius: 24px 24px 999px 999px;
}

.strip:nth-child(1) { --c: #CE633C; --i: 0; }
.strip:nth-child(2) { --c: #779AEF; --i: 1; }
.strip:nth-child(3) { --c: #FFC640; --i: 2; }
.strip:nth-child(4) { --c: #F36480; --i: 3; }
.strip:nth-child(5) { --c: #13834D; --i: 4; }
.strip:nth-child(6) { --c: #47C7D0; --i: 5; }
.strip:nth-child(7) { --c: #FFAC72; --i: 6; }
.strip:nth-child(8) { --c: #AB5980; --i: 7; }
.strip:nth-child(9) { --c: #9361D1; --i: 8; }

.strip .label {
  position: relative;
  flex: 1;
  min-height: 0;
}
.strip .name {
  position: absolute;
  inset: 18px 0 auto;
  display: flex;
  justify-content: center;
  writing-mode: vertical-rl;
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 700;
  white-space: nowrap;
  transition: opacity 300ms var(--ease);
}
html[lang="en"] .strip .name { transform: rotate(180deg); inset: auto 0 18px; }

.strip .about {
  position: absolute;
  inset: 26px 26px auto;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 300ms var(--ease), transform 400ms var(--ease);
}
.strip .about b {
  display: block;
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
html[lang="ar"] .strip .about b { letter-spacing: 0; line-height: 1.5; }
.strip .about span { display: block; margin-top: 6px; color: var(--muted); font-size: 15px; line-height: 1.5; }

.strip.active .name { opacity: 0; }
.strip.active .about { opacity: 1; transform: none; transition-delay: 250ms; }

.strip .ink {
  position: relative;
  height: 46%;
  border-top: 4px solid var(--c);
  overflow: hidden;
}
.strip .ink img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1200ms var(--ease);
}
.strip.active .ink img { transform: scale(1.08); }

@media (max-width: 760px) {
  .strips { flex-direction: column; height: auto; gap: 8px; }
  .strip {
    flex: none;
    flex-direction: row;
    height: 64px;
    border-radius: 16px 999px 999px 16px;
    transition: height 600ms var(--ease);
  }
  html[dir="rtl"] .strip { border-radius: 999px 16px 16px 999px; }
  .strip.active { height: 188px; border-radius: 20px 999px 999px 20px; }
  html[dir="rtl"] .strip.active { border-radius: 999px 20px 20px 999px; }
  .strip .ink { height: auto; width: 42%; border-top: 0; border-inline-start: 4px solid var(--c); }
  .strip .name, html[lang="en"] .strip .name {
    inset: 0 auto 0 20px;
    align-items: center;
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 17px;
  }
  html[dir="rtl"] .strip .name { inset: 0 20px 0 auto; }
  .strip .about { inset: 20px 20px auto; }
  .strip .about b { font-size: 22px; }
}

/* ---------- Story: sticky phone ---------- */

.story {
  position: relative;
  background: var(--porcelain);
  color: var(--body);
}
.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 7vw, 110px);
}
.story-phone {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  place-items: center;
}
.story-steps { padding-block: 12svh; }
.step {
  min-height: 88svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.35;
  transition: opacity 500ms var(--ease);
}
.step.current { opacity: 1; }
.step h2 { color: var(--ink); }

.points { display: grid; gap: 12px; margin: 28px 0 0; padding: 0; list-style: none; }
.points li { position: relative; padding-inline-start: 26px; }
.points li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.62em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--violet);
}
html[lang="ar"] .points li::before { top: 0.8em; }

/* Progress dots beside the phone name the four screens in order. */
.dots {
  position: absolute;
  inset-inline-end: -34px;
  top: 50%;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  transform: translateY(-50%);
}
.dots li {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--track);
  transition: height 400ms var(--ease), background-color 400ms;
}

.phone {
  --step: 0;
  position: relative;
  width: 330px;
  height: 690px;
  padding: 12px;
  border-radius: 54px;
  background: #16121B;
  box-shadow: 0 50px 90px rgba(36, 31, 43, 0.28), 0 0 0 1px rgba(36, 31, 43, 0.4), inset 0 0 0 2px #3B3348;
}
.phone::before {
  content: "";
  position: absolute;
  z-index: 5;
  top: 24px;
  left: 50%;
  width: 96px;
  height: 28px;
  margin-left: -48px;
  border-radius: 20px;
  background: #0A080D;
}
.phone .screen-wrap {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 42px;
  background: var(--warm);
}
.phone[data-step="0"] ~ .dots li:nth-child(1),
.phone[data-step="1"] ~ .dots li:nth-child(2),
.phone[data-step="2"] ~ .dots li:nth-child(3),
.phone[data-step="3"] ~ .dots li:nth-child(4) { height: 28px; background: var(--violet); }

.screen {
  position: absolute;
  inset: 0;
  padding: 64px 16px 20px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(40px) scale(0.96);
  filter: blur(8px);
  transition: opacity 500ms var(--ease), transform 700ms var(--ease), filter 500ms var(--ease), visibility 0s 700ms;
}
.phone[data-step="0"] .s0,
.phone[data-step="1"] .s1,
.phone[data-step="2"] .s2,
.phone[data-step="3"] .s3 {
  opacity: 1;
  visibility: visible;
  transform: none;
  filter: none;
  transition: opacity 500ms var(--ease) 120ms, transform 700ms var(--ease) 120ms, filter 500ms var(--ease) 120ms, visibility 0s;
}

.screen .title {
  margin: 0 4px 14px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.card {
  padding: 16px;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(36, 31, 43, 0.06), 0 12px 28px rgba(36, 31, 43, 0.07);
}
.card + .card { margin-top: 10px; }
.card h3 { margin: 0; color: var(--ink); font-size: 16px; font-weight: 800; line-height: 1.35; }
.card .sub { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }

.fineprint { margin: 12px 4px 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }

/* Screen 0: price comparison */
.product { display: flex; align-items: center; gap: 12px; }
.bottle {
  position: relative;
  flex: none;
  width: 50px;
  height: 62px;
  border-radius: 12px;
  background: var(--warm);
}
.bottle::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 22px;
  height: 31px;
  margin-left: -11px;
  border-radius: 5px;
  background: linear-gradient(180deg, #D9CCF7, #A58BE8);
}
.bottle::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 40px;
  width: 10px;
  height: 8px;
  margin-left: -5px;
  border-radius: 2px;
  background: var(--ink);
}
.best {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--violet);
  color: #fff;
}
.best .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.best small { color: #DCD0FF; font-size: 12.5px; }
.best .save {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  white-space: nowrap;
}
.best .price { margin-top: 4px; font-size: 40px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.best .price small { color: #fff; font-size: 16px; font-weight: 500; }
.best .store { font-size: 13.5px; }
.others { margin: 8px 0 0; padding: 0; list-style: none; }
.others li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 4px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.others li:first-child { border-top: 0; }
.others b { color: var(--ink); font-weight: 700; }

/* Screen 1: ratings */
.metric + .metric { margin-top: 14px; }
.metric .label { display: flex; justify-content: space-between; gap: 10px; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.metric .label span { color: var(--violet); font-weight: 800; }
.segments { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: 7px; }
.segments i {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track);
}
.segments i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--violet);
  transform: scaleX(0);
  transform-origin: var(--start, left);
}
html[dir="rtl"] .segments i::after, html[dir="rtl"] .split .bar::after { --start: right; }
.segments i.on::after { transform: scaleX(1); }
.segments i.half::after { transform: scaleX(0.5); }

.split { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: 10px; font-size: 12.5px; }
.split span:last-child { text-align: end; }
.split + .split { margin-top: 12px; }
.split .bar { position: relative; height: 8px; overflow: hidden; border-radius: 999px; background: var(--track); }
.split .bar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--violet);
  transform-origin: var(--start, left);
  transform: scaleX(var(--p));
}
.split .bar.p33 { --p: 0.33; }
.split .bar.p43 { --p: 0.43; }
.split .bar.p67 { --p: 0.67; }

.quote { display: flex; gap: 12px; align-items: flex-start; }
.quote .avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--violet-pale);
  color: var(--violet);
  font-weight: 800;
}
.quote p { margin: 0; font-size: 13.5px; line-height: 1.55; }
.quote b { display: block; color: var(--ink); font-size: 13.5px; }

/* Screen 2: top 10 */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 2px 12px; }
.tabs span {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--paper);
  font-size: 12.5px;
  font-weight: 600;
}
.tabs span.on { background: var(--violet); color: #fff; }
.rank { margin: 0; padding: 0; list-style: none; }
.rank li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.rank li:first-child { border-top: 0; padding-top: 0; }
.rank .n {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--violet-pale);
  color: var(--violet);
  font-size: 13px;
  font-weight: 800;
}
.rank li:first-child .n { background: var(--violet); color: #fff; }
.rank .t b { display: block; color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.35; }
.rank .t small { color: var(--muted); font-size: 12px; }
.rank .score { color: var(--ink); font-size: 14px; font-weight: 800; white-space: nowrap; }
.rank .score::before { content: "★ "; color: var(--violet); }

/* Screen 3: taste quiz */
.progress { display: flex; gap: 6px; margin-bottom: 6px; }
.progress i { position: relative; flex: 1; height: 4px; overflow: hidden; border-radius: 999px; background: var(--track); }
.progress i::after { content: ""; position: absolute; inset: 0; background: var(--violet); transform: scaleX(0); transform-origin: var(--start, left); }
html[dir="rtl"] .progress i::after { --start: right; }
.progress i.on::after { transform: scaleX(1); }
.step-count { color: var(--muted); font-size: 12px; }
.quiz-q { margin: 4px 0 12px; color: var(--ink); font-size: 19px; font-weight: 800; line-height: 1.3; }
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 0; padding: 0; list-style: none; }
.picks li {
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--warm);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}
.picks img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.picks span { display: block; padding: 5px 2px 7px; }
.picks li.on { border-color: var(--violet); background: var(--violet-pale); }
.picks li.on::after {
  content: "";
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--violet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.quiz-next {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--violet);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 900px) {
  .story-grid { display: block; }
  .story-phone {
    top: 58px;
    z-index: 2;
    height: auto;
    padding-block: 12px 18px;
    background: linear-gradient(var(--porcelain) 88%, rgba(250, 249, 246, 0));
  }
  .phone { zoom: 0.56; }
  .step .points { display: none; }
  .dots { display: none; }
  .story-steps { padding-block: 0 20svh; }
  .step { min-height: 70svh; justify-content: flex-end; padding-bottom: 5svh; }
  .step p { font-size: 16px; }
  .step .section-head h2 { font-size: 30px; }
}
@media (max-width: 900px) and (max-height: 760px) {
  .phone { zoom: 0.48; }
}

/* ---------- Bilingual ---------- */

.bilingual {
  position: relative;
  overflow: hidden;
  padding-block: clamp(80px, 11vw, 150px);
  background: var(--violet-pale);
  color: var(--body);
  text-align: center;
}
.morph {
  position: relative;
  display: grid;
  margin: 0 auto;
  color: var(--violet);
  font-size: clamp(64px, 13vw, 180px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
}
.morph span { grid-area: 1 / 1; }
html:not(.js) .morph span:not(:first-child) { display: none; }
.morph .ar { font-size: 0.92em; letter-spacing: 0; }
.bilingual h2 {
  max-width: 18em;
  margin: clamp(18px, 3vw, 30px) auto 0;
  color: var(--ink);
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
html[lang="ar"] .bilingual h2 { line-height: 1.5; letter-spacing: 0; }
.bilingual p { max-width: 36em; margin: 16px auto 0; }

/* ---------- Closing ---------- */

.closing {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(96px, 13vw, 170px);
  text-align: center;
}
.closing::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: -75%;
  width: min(130vw, 1200px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(105, 68, 205, 0.55), rgba(105, 68, 205, 0));
}
.closing .shell { position: relative; z-index: 2; }
.closing .section-head { margin-inline: auto; justify-items: center; }
.closing .section-head h2 { font-size: clamp(40px, 6.4vw, 84px); }
.closing .cta-row { justify-content: center; }

/* ---------- Footer ---------- */

.site-foot {
  padding-block: 32px 40px;
  border-top: 1px solid var(--night-line);
  color: var(--on-night-muted);
  font-size: 14px;
}
.site-foot .shell { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 32px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-foot a { color: #fff; text-decoration: none; text-underline-offset: 4px; }
.site-foot a:hover { color: var(--lilac); text-decoration: underline; }
.site-foot p { margin: 0; max-width: 40em; }

/* =====================================================================
   Motion. Only applies when landing.js has run and the visitor has not
   asked for reduced motion.
   ===================================================================== */

@media (prefers-reduced-motion: no-preference) {

  /* Hero words condense out of the spray: blurred and spread, then sharp. */
  .js .hero h1 .w {
    animation: condense 1100ms var(--ease) both;
    animation-delay: calc(var(--d, 0) * 1ms + 550ms);
  }
  @keyframes condense {
    from { opacity: 0; filter: blur(16px); transform: translateY(18px) scale(1.06); }
    60% { opacity: 1; }
    to { opacity: 1; filter: blur(0); transform: none; }
  }
  .js .hero .lede,
  .js .hero .cta-row {
    animation: settle 900ms var(--ease) both;
    animation-delay: 1150ms;
  }
  .js .hero .cta-row { animation-delay: 1300ms; }
  @keyframes settle {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }

  .js .hero-visual .arch { animation: arch-in 1400ms var(--ease) both 100ms; }
  @keyframes arch-in {
    from { clip-path: inset(100% 0 0 0 round 999px 999px 34px 34px); }
    to { clip-path: inset(0 0 0 0 round 999px 999px 34px 34px); }
  }
  .js .hero-visual .arch img { animation: breathe 14s ease-in-out infinite alternate; }
  @keyframes breathe { from { transform: scale(1.02); } to { transform: scale(1.1); } }

  .js .chip { animation: chip-in 900ms var(--ease) both, bob 6s ease-in-out infinite; }
  .js .chip.price { animation-delay: 1500ms, 2400ms; }
  .js .chip.rating { animation-delay: 1750ms, 2650ms; animation-duration: 900ms, 7s; }
  .js .chip.match { animation-delay: 2000ms, 2900ms; animation-duration: 900ms, 8s; }
  @keyframes chip-in {
    from { opacity: 0; transform: translateY(24px) scale(0.85); filter: blur(6px); }
    to { opacity: 1; transform: none; filter: none; }
  }
  @keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
  }

  .js .store-badge::after { animation: sweep 5.5s var(--ease) infinite 2.6s; }
  @keyframes sweep {
    0% { transform: translateX(-120%); }
    30%, 100% { transform: translateX(120%); }
  }

  .js .houses .track { animation: drift 48s linear infinite; }
  .js .houses:hover .track { animation-play-state: paused; }
  @keyframes drift { to { transform: translateX(-50%); } }

  /* Strips are dipped into place once, left to right in reading order. */
  .js .strips:not(.seen) .strip { transform: translateY(80px); opacity: 0; }
  .js .strips.seen .strip {
    animation: dip 1000ms var(--ease) both;
    animation-delay: calc(var(--i) * 70ms);
  }
  @keyframes dip {
    from { transform: translateY(80px); opacity: 0; }
    to { transform: none; opacity: 1; }
  }

  /* Screen details replay each time their screen comes forward. */
  .segments i::after { transition: transform 600ms var(--ease); }
  .split .bar::after { transition: transform 900ms var(--ease) 300ms; }
  .progress i::after { transition: transform 700ms var(--ease); }
  .phone:not([data-step="1"]) .s1 .segments i::after,
  .phone:not([data-step="1"]) .s1 .split .bar::after { transform: scaleX(0); transition: none; }
  .phone[data-step="1"] .s1 .segments i:nth-child(2)::after { transition-delay: 80ms; }
  .phone[data-step="1"] .s1 .segments i:nth-child(3)::after { transition-delay: 160ms; }
  .phone[data-step="1"] .s1 .segments i:nth-child(4)::after { transition-delay: 240ms; }
  .phone[data-step="1"] .s1 .segments i:nth-child(5)::after { transition-delay: 320ms; }

  .phone[data-step="0"] .s0 .best { animation: pop 700ms var(--ease) both 350ms; }
  .phone[data-step="0"] .s0 .others li { animation: slide 600ms var(--ease) both; }
  .phone[data-step="0"] .s0 .others li:nth-child(1) { animation-delay: 700ms; }
  .phone[data-step="0"] .s0 .others li:nth-child(2) { animation-delay: 800ms; }
  .phone[data-step="0"] .s0 .others li:nth-child(3) { animation-delay: 900ms; }
  .phone[data-step="0"] .s0 .save { animation: pop 500ms var(--ease) both 1500ms; }
  @keyframes pop {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: none; }
  }
  @keyframes slide {
    from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 24px)); }
    to { opacity: 1; transform: none; }
  }
  html[dir="rtl"] { --dir: -1; }

  .phone[data-step="1"] .s1 .quote { animation: slide 700ms var(--ease) both 900ms; }

  .phone[data-step="2"] .s2 .tabs span.on { animation: pop 500ms var(--ease) both 200ms; }
  .phone[data-step="2"] .s2 .rank li { animation: slide 650ms var(--ease) both; }
  .phone[data-step="2"] .s2 .rank li:nth-child(1) { animation-delay: 300ms; }
  .phone[data-step="2"] .s2 .rank li:nth-child(2) { animation-delay: 400ms; }
  .phone[data-step="2"] .s2 .rank li:nth-child(3) { animation-delay: 500ms; }
  .phone[data-step="2"] .s2 .rank li:nth-child(4) { animation-delay: 600ms; }
  .phone[data-step="2"] .s2 .rank li:nth-child(5) { animation-delay: 700ms; }

  .phone:not([data-step="3"]) .s3 .progress i.on::after { transform: scaleX(0); transition: none; }
  .phone[data-step="3"] .s3 .progress i:nth-child(2)::after { transition-delay: 250ms; }
  .phone[data-step="3"] .s3 .picks li.on { animation: choose 600ms var(--ease) both; }
  .phone[data-step="3"] .s3 .picks li.on:nth-child(1) { animation-delay: 700ms; }
  .phone[data-step="3"] .s3 .picks li.on:nth-child(3) { animation-delay: 1200ms; }
  .phone[data-step="3"] .s3 .picks li.on:nth-child(5) { animation-delay: 1700ms; }
  @keyframes choose {
    0% { border-color: transparent; background: var(--warm); transform: scale(1); }
    40% { transform: scale(0.94); }
    100% { transform: none; }
  }
  .phone[data-step="3"] .s3 .picks li.on::after { animation: pop 400ms var(--ease) both; animation-delay: inherit; }
  .phone[data-step="3"] .s3 .quiz-next { animation: pop 500ms var(--ease) both 2200ms; }

  /* Bilingual word swap: one word dissolves as its pair condenses. */
  .js .morph span { transition: opacity 700ms var(--ease), filter 700ms var(--ease), transform 900ms var(--ease); }
  .js .morph span:not(.on) { opacity: 0; filter: blur(14px); transform: translateY(20px) scale(0.96); }
}

@media (prefers-reduced-motion: reduce) {
  .js .morph span:not(.on) { opacity: 0; }
  .js .morph span { transition: opacity 400ms; }
}
.phone-holder { position: relative; }
