/* Tammeni website. Colours, glass and shapes follow brand.md (liquid-glass gradient, round, gentle).
   Long reading text sits on solid white cards, never on glass.
   Motion lives under html.motion, which assets/site.js adds only when the visitor allows motion; without it
   (no JS, or "reduce motion") every section is static and fully readable. */
:root {
  --ink: #1E1838;
  --ink-soft: #4A4366;
  --violet: #6A44E0;
  --violet-deep: #4B2BA4;
  --lav-tint: #F1ECFF;
  --gold: #F5B83D;
  --gold-pale: #FFF4DC;
  --blush: #FDECEF;
  --alert: #C62828;
  --grad: linear-gradient(170deg, #A94286 0%, #9F4BB4 22%, #8247CB 48%, #6739C6 74%, #4B2BA4 100%);
  --glass: rgba(40, 12, 96, .24);
  --glass-rim: rgba(255, 255, 255, .34);
  --glass-shine: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, 0) 45%);
  --shadow: 0 14px 36px rgba(30, 8, 80, .28);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', Tahoma, 'Noto Sans Arabic', sans-serif;
  --dir: 1;
  color-scheme: light;
}
html[dir="rtl"] { --dir: -1; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: #fff;
  background: #6739C6 var(--grad) no-repeat;
  overflow-wrap: break-word;
}
html[lang="ar"] body { line-height: 1.85; }
img, svg { display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 10px; }
.doc-body :focus-visible, .plan-family :focus-visible { outline-color: var(--violet); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Soft blobs of colour that stay behind the page (they drift slowly with motion on) */
body::before {
  content: "";
  position: fixed;
  inset: -15vmax;
  pointer-events: none;
  background:
    radial-gradient(40vmax 30vmax at 22% 18%, rgba(232, 56, 79, .22), transparent 70%),
    radial-gradient(46vmax 38vmax at 82% 42%, rgba(60, 30, 150, .30), transparent 70%),
    radial-gradient(30vmax 26vmax at 40% 85%, rgba(155, 123, 255, .14), transparent 70%);
}
body > * { position: relative; }

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -80px;
  z-index: 5;
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* Header */
.top {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 4px 14px rgba(30, 8, 80, .35), 0 0 0 1px rgba(255, 255, 255, .3); }
.brand-name { font-size: 1.5rem; line-height: 1; }
html[lang="en"] .brand-name { font-family: 'Pacifico', var(--font); font-size: 1.4rem; padding-bottom: 4px; }
html[lang="ar"] .brand-name { font-family: 'Aref Ruqaa', var(--font); font-weight: 700; font-size: 1.8rem; }

.lang-switch, .soon, .promises li {
  background: var(--glass-shine), var(--glass);
  border: 1px solid var(--glass-rim);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 6px 18px rgba(30, 8, 80, .18);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 20px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .15s ease, translate .25s var(--ease), background-color .25s ease;
}
.lang-switch:active, .mail-pill a:active, .scroll-cue:active { transform: scale(.96); }
@media (hover: hover) {
  .lang-switch:hover { translate: 0 -2px; background-color: rgba(255, 255, 255, .08); }
  .mail-pill a:hover { translate: 0 -3px; box-shadow: 0 18px 40px rgba(30, 8, 80, .42); }
}

/* Home: hero with the app's intro layers (figures glide together, the light blooms, the name appears) */
.home { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.hero { text-align: center; padding: 4px 0 24px; }
.mark-wrap { margin: 0; font-size: 1rem; }
/* overflow: hidden keeps the figures' slide-in from widening the page on phones */
.mark { position: relative; display: block; overflow: hidden; margin: 0 auto; width: min(354px, 84vw); aspect-ratio: 494 / 472; --gx: 52%; --gy: 43%; }
html[lang="ar"] .mark { width: min(184px, 46vw); aspect-ratio: 256 / 544; --gx: 57%; --gy: 36%; }
.mark img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mark .l-glow { transform-origin: var(--gx) var(--gy); }
.hero-logo {
  width: 128px;
  height: 128px;
  margin: 0 auto;
  border-radius: 34px;
  box-shadow: 0 20px 44px rgba(40, 10, 90, .45), 0 0 0 1px rgba(255, 255, 255, .4);
}
.tagline { max-width: 640px; margin: 8px auto 0; font-size: clamp(1.35rem, 3.6vw, 1.85rem); font-weight: 500; line-height: 1.4; }
.tagline .w { display: inline-block; }
.lede { max-width: 560px; margin: 16px auto 0; font-size: 1.125rem; }
.soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 0;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
}
.soon svg, .scroll-cue svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.scroll-cue { display: flex; align-items: center; justify-content: center; gap: 6px; width: max-content; margin: 18px auto 0; min-height: 44px; padding: 8px 14px; font-weight: 600; text-decoration: none; transition: transform .15s ease; }

.home h2 { margin: 72px 0 24px; text-align: center; font-size: clamp(1.5rem, 4vw, 1.9rem); font-weight: 600; line-height: 1.3; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card {
  padding: 26px;
  border-radius: 28px;
  background: var(--glass-shine), var(--glass);
  border: 1px solid var(--glass-rim);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), var(--shadow);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
}
.card h3 { margin: 18px 0 6px; font-size: 1.2rem; font-weight: 600; line-height: 1.4; }
.card p { margin: 0; }
.ico {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #C9B8FF, #9B7BFF 52%, #7B57EE);
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, .55), inset 0 -3px 6px rgba(60, 20, 150, .35), 0 8px 18px rgba(40, 10, 90, .35);
}
.ico svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.promises { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.promises li { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; border-radius: 999px; font-weight: 500; }
html[dir="rtl"] .promises li { padding: 10px 12px 10px 18px; }
.promises li::before, .ticks li::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--violet);
}
/* Gold tick on a violet disc (brand: gold only on violet) */
.promises li, .ticks li { position: relative; }
.promises li::after, .ticks li::after, .tick::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 11px;
  border: solid var(--gold);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.promises li::after { inset-inline-start: 20px; top: calc(50% - 7.5px); }

.ticks { list-style: none; margin: 18px 0 0; padding: 0; }
.ticks li { margin: 10px 0; padding-inline-start: 34px; }
.ticks li::before { position: absolute; inset-inline-start: 0; top: calc((1.6em - 22px) / 2); }
.ticks li::after { inset-inline-start: 8px; top: calc((1.6em - 22px) / 2 + 4px); }
html[lang="ar"] .ticks li::before { top: calc((1.85em - 22px) / 2); }
html[lang="ar"] .ticks li::after { top: calc((1.85em - 22px) / 2 + 4px); }

/* How it works: a phone that tells the story. Static: four screens with their captions.
   With motion: one sticky phone whose screen changes as each beat scrolls past (site.js sets data-beat). */
.story { --w: min(230px, 62vw); }
.story .stage { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px 24px; }
.story .phone, .story .caps { display: contents; }
.dots, .beats { display: none; }
.s1 { order: 1; } .cap[data-b="1"] { order: 2; }
.s2 { order: 3; } .cap[data-b="2"] { order: 4; }
.s3 { order: 5; } .cap[data-b="3"] { order: 6; }
.s4 { order: 7; } .cap[data-b="4"] { order: 8; }
.cap { max-width: 320px; margin: 0 0 28px; text-align: center; font-size: 1.15rem; font-weight: 500; line-height: 1.45; }
.cap strong { font-weight: 600; }
.screen {
  position: relative;
  width: var(--w);
  height: calc(var(--w) * 2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--w) * .03);
  padding: calc(var(--w) * .12) calc(var(--w) * .07) calc(var(--w) * .08);
  overflow: hidden;
  border: calc(var(--w) * .035) solid rgba(255, 255, 255, .38);
  border-radius: calc(var(--w) * .16);
  background: radial-gradient(circle at 50% 28%, rgba(255, 255, 255, .14), transparent 55%), linear-gradient(170deg, #A94286, #8247CB 55%, #4B2BA4);
  box-shadow: 0 24px 60px rgba(20, 6, 60, .45);
  color: #fff;
  font-size: calc(var(--w) * .05);
  line-height: 1.35;
  text-align: center;
}
.chip, .ph-later, .n-actions span + span { padding: .35em 1em; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .4); font-weight: 600; font-size: .8em; }
.sphere, .big-tick {
  display: grid;
  place-items: center;
  width: calc(var(--w) * .36);
  aspect-ratio: 1;
  margin-top: calc(var(--w) * .06);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .55), rgba(255, 255, 255, .1) 62%);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: inset 0 -6px 14px rgba(60, 20, 150, .3), 0 14px 30px rgba(20, 6, 60, .35);
}
.sphere svg { width: 44%; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transform-origin: 50% 20%; }
.big-tick { background: radial-gradient(circle at 34% 28%, #9B7BFF, #6A44E0 70%); }
.ph-title { margin-top: .3em; font-size: 1.45em; font-weight: 600; line-height: 1.25; }
.ph-sub { font-size: .85em; }
.voice { display: flex; align-items: center; gap: .55em; margin-top: .3em; padding: .6em .8em; border-radius: 1em; background: rgba(40, 12, 96, .32); font-size: .72em; text-align: start; }
.bars { display: inline-flex; align-items: center; gap: 2px; height: 1.6em; flex: none; }
.bars i { width: 3px; height: 45%; border-radius: 2px; background: #fff; }
.ph-done { display: flex; align-items: center; justify-content: center; gap: .5em; width: 100%; margin-top: auto; padding: .7em; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 600; font-size: 1.05em; box-shadow: 0 8px 20px rgba(20, 6, 60, .3); }
.tick { position: relative; display: inline-block; flex: none; width: 1.25em; height: 1.25em; border-radius: 50%; background: var(--violet); font-size: 1em; }
.tick::after { left: 36%; top: 17%; width: 28%; height: 50%; border-width: 0 .14em .14em 0; }
.big-tick .tick { font-size: calc(var(--w) * .2); background: none; }
.ripple { position: absolute; left: 50%; bottom: 10%; width: 30%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, .45); opacity: 0; transform: translate(-50%, 50%) scale(0); }
.fam { align-items: stretch; text-align: start; padding-top: calc(var(--w) * .14); }
.ph-head { font-size: 1.4em; font-weight: 600; }
.fam-card { display: grid; grid-template-columns: auto 1fr; column-gap: .6em; align-items: center; padding: .8em; border-radius: 1.1em; background: rgba(40, 12, 96, .3); border: 1px solid rgba(255, 255, 255, .3); }
.av { grid-row: span 2; display: grid; place-items: center; width: 2.4em; height: 2.4em; border-radius: 50%; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .5); font-weight: 600; }
.fam-name { font-weight: 600; }
.ok, .st { display: inline-flex; align-items: center; gap: .4em; font-size: .8em; font-weight: 600; white-space: nowrap; }
.fam-row { display: flex; justify-content: space-between; align-items: center; gap: .5em; padding: .7em .8em; border-radius: .9em; background: rgba(40, 12, 96, .22); font-size: .85em; }
.notif { display: flex; align-items: flex-start; gap: .6em; padding: .8em; border-radius: 1.1em; background: #fff; color: var(--ink); font-size: .82em; box-shadow: 0 12px 30px rgba(20, 6, 60, .35); }
.n-ico { display: grid; place-items: center; flex: none; width: 1.9em; height: 1.9em; border-radius: 50%; background: var(--alert); color: #fff; font-weight: 700; }
.n-body { display: flex; flex-direction: column; gap: .15em; }
.n-app { font-size: .85em; font-weight: 600; color: var(--ink-soft); }
.n-actions { display: flex; gap: .5em; }
.n-actions span { flex: 1; padding: .6em; border-radius: 999px; text-align: center; font-weight: 600; font-size: .85em; }
.n-actions span:first-child { background: #fff; color: var(--violet); }
@media (min-width: 1000px) {
  .story .stage { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: auto auto; grid-auto-flow: column; }
  .cap { margin: 0; }
}

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 880px; margin: 0 auto; }
.plan { padding: 30px; border-radius: 32px; transition: translate .35s var(--ease), box-shadow .35s ease; }
@media (hover: hover) {
  .plan:hover { translate: 0 -8px; box-shadow: 0 28px 60px rgba(30, 8, 80, .42); }
}
.plan:focus-within { translate: 0 -8px; }
.plan:active { translate: 0 -4px; }
.plan h3 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.price { margin: 10px 0 0; font-size: 2.2rem; font-weight: 600; line-height: 1.2; }
.price span { font-size: 1.05rem; font-weight: 400; }
.price-sub { margin: 2px 0 0; font-weight: 600; }
.price-alt { margin: 4px 0 0; font-size: .95rem; }
.plan-family { background: #fff; color: var(--ink); box-shadow: 0 22px 50px rgba(30, 8, 80, .38); }
.plan-family .price { color: var(--violet); }
.plan-family .price-alt { color: var(--ink-soft); }
.trial {
  position: relative;
  display: inline-block;
  overflow: hidden;
  margin: 12px 0 2px;
  padding: 7px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #FFE7A8, #F5B83D);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(245, 184, 61, .45);
}
.plan-note { max-width: 640px; margin: 22px auto 0; text-align: center; }

/* Contact */
.contact { text-align: center; }
.contact p { margin: 0 auto; max-width: 560px; }
.mail-pill { margin-top: 20px !important; }
.mail-pill a {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 10px 28px;
  border-radius: 999px;
  background: #fff;
  color: var(--violet);
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(30, 8, 80, .32);
  transition: transform .15s ease, translate .25s var(--ease), box-shadow .25s ease;
}

/* Policy pages */
.doc-head { max-width: 860px; margin: 0 auto; padding: 20px 20px 30px; }
.doc-head h1 { margin: 0; font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 600; line-height: 1.25; }
.updated { margin: 10px 0 0; }
.doc-body {
  width: min(860px, calc(100% - 24px));
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px);
  border-radius: 32px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(30, 8, 80, .32);
}
.doc-body h2 { margin: 40px 0 10px; font-size: 1.3rem; font-weight: 600; line-height: 1.4; color: var(--violet-deep); }
.doc-body > :first-child, .doc-body > .summary:first-child h2 { margin-top: 0; }
.doc-body p { margin: 0 0 12px; }
.doc-body ul:not(.ticks), .doc-body ol:not(.steps) { margin: 0 0 12px; padding-inline-start: 1.4em; }
.doc-body li { margin: 6px 0; }
.doc-body a { color: var(--violet); text-underline-offset: 3px; }
.doc-body strong { font-weight: 600; }
.intro { font-size: 1.15rem; }
.summary { padding: 22px 26px; margin-bottom: 8px; border-radius: 24px; background: var(--lav-tint); }
.summary h2 { margin-top: 0; }
.summary .ticks { margin: 8px 0 0; }
.doc-body .ticks { margin-bottom: 18px; }
.callout { padding: 18px 24px; margin: 4px 0 12px; border-radius: 24px; background: var(--blush); }
.callout p { margin: 0; }
.steps { list-style: none; counter-reset: step; margin: 0 0 12px; padding: 0; }
.steps li { counter-increment: step; position: relative; margin: 12px 0; padding-inline-start: 46px; min-height: 32px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--violet);
  color: #fff;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1;
}

/* Footer */
.foot { max-width: 1080px; margin: 80px auto 0; padding: 28px 20px 40px; border-top: 1px solid rgba(255, 255, 255, .28); text-align: center; }
.doc-page .foot { margin-top: 56px; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; }
.foot nav a { display: inline-block; padding: 10px 2px; font-weight: 500; text-underline-offset: 4px; }
.foot-mail { margin: 8px 0 0; }
.foot-mail a, .foot-note a { display: inline-block; padding: 8px 2px; text-underline-offset: 4px; }
.foot-note { max-width: 640px; margin: 10px auto 0; font-size: .95rem; }

.lost { text-align: center; padding-bottom: 80px; }
.lost a { color: #fff; }

@media (max-width: 760px) {
  .grid, .plans { grid-template-columns: minmax(0, 1fr); }
  .home h2 { margin-top: 56px; }
  .card, .plan { padding: 24px; }
}
@media (max-width: 420px) {
  .top { padding: 12px 16px; }
  .home { padding: 0 16px; }
  .brand-name { font-size: 1.3rem; }
}

/* ---------- Motion (html.motion only) ---------- */
.motion body::before { animation: drift 28s ease-in-out infinite alternate; }
@keyframes drift {
  50% { transform: translate3d(3vmax, 2vmax, 0) scale(1.05); }
  100% { transform: translate3d(-2vmax, 4vmax, 0) scale(.98); }
}

/* Hero intro, about 3.4 s like the app's opening */
.motion .mark .l-white { animation: from-left 1.3s var(--ease) .15s both; }
.motion .mark .l-gold { animation: from-right 1.3s var(--ease) .15s both; }
.motion .mark .l-glow { animation: bloom 1.3s ease-out 1.05s both, breathe 4s ease-in-out 2.4s infinite alternate; }
.motion .mark .l-front { animation: flash 1.1s ease-out 1.2s both; }
.motion .mark .l-word { animation: rise 1s var(--ease) 1.85s both; }
.motion .tagline .w { animation: word .7s var(--ease) both; animation-delay: calc(2.3s + var(--i, 0) * .09s); }
.motion .hero .lede { animation: rise .8s var(--ease) 3s both; }
.motion .hero .soon { animation: rise .8s var(--ease) 3.15s both; }
.motion .hero .scroll-cue { animation: rise .8s var(--ease) 3.3s both; }
.motion .scroll-cue svg { animation: cue 1.8s ease-in-out 4s infinite; }
@keyframes from-left { from { opacity: 0; transform: translateX(-16%); } }
@keyframes from-right { from { opacity: 0; transform: translateX(16%); } }
@keyframes bloom { 0% { opacity: 0; transform: scale(.4); } 60% { opacity: 1; transform: scale(1.18); } 100% { opacity: 1; transform: scale(1); } }
@keyframes breathe { to { transform: scale(1.12); opacity: .85; } }
@keyframes flash { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: .9; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
@keyframes word { from { opacity: 0; transform: translateY(.45em); filter: blur(5px); } }
@keyframes cue { 50% { transform: translateY(5px); } }

/* Sections reveal as they scroll in; side items come in from the reading start (right in Arabic) */
.motion .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s ease, transform .8s var(--ease), translate .35s var(--ease), box-shadow .35s ease;
  transition-delay: calc(var(--i, 0) * 110ms), calc(var(--i, 0) * 110ms), 0s, 0s;
}
.motion .reveal.side { transform: translateX(calc(var(--dir) * -30px)); }
.motion .reveal.in { opacity: 1; transform: none; }

/* Floating glass cards: gentle parallax where the browser supports scroll-driven animation */
@supports (animation-timeline: view()) {
  .motion .grid .card { animation: float linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
  .motion .grid .card:nth-child(even) { --p: 34px; }
  @keyframes float { from { translate: 0 var(--p, 16px); } to { translate: 0 calc(var(--p, 16px) * -1); } }
}

.motion .trial::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .8) 50%, transparent 65%);
  transform: translateX(calc(var(--dir) * -120%));
  animation: shine 3.6s ease-in-out 1.2s infinite;
}
@keyframes shine { 45%, 100% { transform: translateX(calc(var(--dir) * 120%)); } }

/* The sticky phone */
.motion .story { --w: min(300px, 70vw, calc((100svh - 230px) * .5)); }
.motion .story h2 { margin-bottom: 0; }
.motion .story .stage {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.motion .story .beats { display: block; margin-top: -100vh; margin-top: -100svh; }
.motion .story .beat { display: block; height: 90vh; height: 90svh; }
.motion .dots { display: flex; gap: 6px; }
.motion .dots i { width: 28px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .3); transition: background-color .3s ease; }
.motion [data-beat="1"] .dots i:nth-child(-n+1),
.motion [data-beat="2"] .dots i:nth-child(-n+2),
.motion [data-beat="3"] .dots i:nth-child(-n+3),
.motion [data-beat="4"] .dots i { background: #fff; }
.motion .story .phone {
  display: block;
  position: relative;
  flex: none;
  width: var(--w);
  height: calc(var(--w) * 2);
  border-radius: calc(var(--w) * .16);
  background: linear-gradient(150deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .12) 40%, rgba(255, 255, 255, .28));
  box-shadow: 0 30px 80px rgba(20, 6, 60, .55), inset 0 0 0 1px rgba(255, 255, 255, .55);
  animation: bob 6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-8px); } }
.motion .screen {
  position: absolute;
  inset: calc(var(--w) * .035);
  width: auto;
  height: auto;
  border: 0;
  border-radius: calc(var(--w) * .13);
  box-shadow: none;
  font-size: calc(var(--w) * .047);
  opacity: 0;
  transform: scale(.97);
  transition: opacity .45s ease, transform .55s var(--ease);
}
.motion [data-beat="1"] .s1, .motion [data-beat="2"] .s2, .motion [data-beat="3"] .s3, .motion [data-beat="4"] .s4 { opacity: 1; transform: none; }
.motion .story .caps { display: block; position: relative; width: min(560px, 100%); height: 6.4em; }
.motion .cap {
  position: absolute;
  inset: 0 0 auto 0;
  max-width: none;
  margin: 0;
  font-size: clamp(1.15rem, 4.6vw, 1.6rem);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .45s ease, transform .55s var(--ease);
}
.motion [data-beat="1"] .cap[data-b="1"], .motion [data-beat="2"] .cap[data-b="2"],
.motion [data-beat="3"] .cap[data-b="3"], .motion [data-beat="4"] .cap[data-b="4"] { opacity: 1; transform: none; }

/* What happens on each screen when its beat arrives */
.motion [data-beat="1"] .s1 .sphere { animation: ring 1.4s ease-out infinite; }
.motion [data-beat="1"] .s1 .sphere svg { animation: wiggle 1.4s ease-in-out infinite; }
.motion [data-beat="1"] .s1 .bars i { animation: bar .9s ease-in-out infinite; }
.motion .bars i:nth-child(2) { animation-delay: .15s !important; }
.motion .bars i:nth-child(3) { animation-delay: .3s !important; }
.motion .bars i:nth-child(4) { animation-delay: .45s !important; }
.motion [data-beat="1"] .s1 .ph-done { animation: nudge 2.4s ease-in-out .8s infinite; }
.motion [data-beat="2"] .s2 .big-tick { animation: pop .7s cubic-bezier(.2, 1.4, .4, 1) .1s both; }
.motion [data-beat="2"] .s2 .ripple { animation: ripple .9s ease-out both; }
.motion [data-beat="3"] .s3 .fam-card { animation: slide-in .6s var(--ease) .1s both; }
.motion [data-beat="3"] .s3 .fam-row { animation: slide-in .6s var(--ease) .25s both; }
.motion [data-beat="3"] .s3 .fam-row + .fam-row { animation-delay: .4s; }
.motion [data-beat="3"] .s3 .ok .tick { animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) .55s both; }
.motion [data-beat="4"] .s4 .notif { animation: drop .7s cubic-bezier(.2, 1.2, .4, 1) .15s both; }
.motion [data-beat="4"] .s4 .n-ico { animation: pulse-red 1.6s ease-out .9s infinite; }
.motion [data-beat="4"] .s4 .n-actions { animation: rise .5s var(--ease) .6s both; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .45), 0 14px 30px rgba(20, 6, 60, .35); } 100% { box-shadow: 0 0 0 calc(var(--w) * .12) rgba(255, 255, 255, 0), 0 14px 30px rgba(20, 6, 60, .35); } }
@keyframes wiggle { 0%, 50%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } }
@keyframes bar { 50% { height: 100%; } }
@keyframes nudge { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.04); } }
@keyframes pop { from { opacity: 0; transform: scale(.3); } }
@keyframes ripple { 0% { opacity: .7; transform: translate(-50%, 50%) scale(0); } 100% { opacity: 0; transform: translate(-50%, 50%) scale(5); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(calc(var(--dir) * -24px)); } }
@keyframes drop { from { opacity: 0; transform: translateY(-140%); } }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(198, 40, 40, .5); } 100% { box-shadow: 0 0 0 .7em rgba(198, 40, 40, 0); } }

@media (min-width: 900px) {
  .motion .story { --w: min(290px, calc((100svh - 140px) * .5)); }
  .motion .story .stage { flex-direction: row; gap: 72px; }
  .motion .story .dots { position: absolute; top: 28px; }
  .motion .story .caps { width: 400px; height: 9em; }
  .motion .cap { text-align: start; font-size: 2rem; line-height: 1.3; top: 50%; transform: translateY(calc(-50% + 14px)); }
  .motion [data-beat="1"] .cap[data-b="1"], .motion [data-beat="2"] .cap[data-b="2"],
  .motion [data-beat="3"] .cap[data-b="3"], .motion [data-beat="4"] .cap[data-b="4"] { transform: translateY(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
