:root {
  --royal: #2743ff;
  --royal-bright: #4a66ff;
  --violet: #6a4bff;
  --accent: #4d8bff;

  --white: #ffffff;
  --ink-navy: #0a1240;

  --w-90: rgba(255,255,255,0.92);
  --w-70: rgba(255,255,255,0.70);
  --w-55: rgba(255,255,255,0.55);
  --w-40: rgba(255,255,255,0.40);

  --glass: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.12);
  --border-2: rgba(255,255,255,0.24);

  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 34px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --maxw: 1120px;
}

* { box-sizing: border-box; }
/* overflow-x on body alone isn't enough — the medals hang off the icon and can
   widen the document, so clip at the root too and kill any sideways scroll */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; max-width: 100%; }

body {
  margin: 0;
  background: #05081f;
  color: var(--white);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: 'Sora', 'Inter', sans-serif; }

/* ============ Background — black top → deep royal blue ============ */
.bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background: linear-gradient(180deg, #000000 0%, #02040f 18%, #050b28 46%, #071040 76%, #081244 100%);
}
/* soft, slowly-drifting mesh blobs (transform only → smooth, no jank) */
.bg__glow { position: absolute; border-radius: 50%; pointer-events: none; will-change: transform; }
.bg__glow--main {
  width: 112vmax; height: 80vmax; left: -28vmax; bottom: -34vmax;
  background: radial-gradient(closest-side, rgba(40,82,255,.42), transparent 66%);
  animation: meshA 30s ease-in-out infinite alternate;
}
.bg__glow--violet {
  display: block;
  width: 80vmax; height: 62vmax; right: -20vmax; bottom: -26vmax;
  background: radial-gradient(closest-side, rgba(150,178,255,.22), transparent 64%);
  animation: meshB 24s ease-in-out infinite alternate;
}
.bg__glow--white {
  width: 60vmax; height: 46vmax; left: 24%; bottom: -18vmax;
  background: radial-gradient(closest-side, rgba(214,228,255,.22), transparent 64%);
  animation: meshC 15s ease-in-out infinite;
}
/* the white pool breathes: drifts around, morphs shape (asymmetric scale)
   and swells brighter / fades dimmer as it moves */
@keyframes meshC {
  0%   { transform: translate(0,0) scale(1,1); opacity: .55; }
  22%  { transform: translate(-5vmax,-4vmax) scale(1.18,.94); opacity: 1; }
  48%  { transform: translate(-9vmax,-1vmax) scale(.9,1.14); opacity: .42; }
  74%  { transform: translate(-3vmax,-7vmax) scale(1.26,1.02); opacity: .88; }
  100% { transform: translate(0,0) scale(1,1); opacity: .55; }
}
@keyframes meshA { from { transform: translate(0,0) scale(1); } to { transform: translate(14vmax,-7vmax) scale(1.12); } }
@keyframes meshB { from { transform: translate(0,0) scale(1); } to { transform: translate(-13vmax,4vmax) scale(1.14); } }

.bg__dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.055) 1px, transparent 1.4px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(85% 60% at 50% 42%, #000 12%, transparent 76%);
  mask-image: radial-gradient(85% 60% at 50% 42%, #000 12%, transparent 76%);
  opacity: .32;
}
/* sparse twinkling star-dots, here and there */
.bg__stars { position: absolute; inset: 0; pointer-events: none; }
.bg__stars::before, .bg__stars::after {
  /* base element sits at 0,0 — keep it transparent so only the box-shadow
     "stars" show (otherwise a stray white dot is pinned in the top-left corner) */
  content: ""; position: absolute; top: 0; left: 0; width: 2px; height: 2px; border-radius: 50%; background: transparent;
  box-shadow:
    26vw 41vh 0 0 rgba(255,255,255,.55), 24vw 64vh 0 0 rgba(170,205,255,.7), 70vw 38vh 0 0 rgba(255,255,255,.6),
    58vw 48vh 0 0 rgba(190,215,255,.7), 73vw 28vh 0 0 rgba(255,255,255,.7), 88vw 70vh 0 0 rgba(170,205,255,.6),
    16vw 88vh 0 0 rgba(255,255,255,.6), 67vw 84vh 0 0 rgba(200,220,255,.6), 34vw 38vh 0 0 rgba(255,255,255,.5);
  /* negative delay → starts mid-cycle (already lit), so the field doesn't
     "reset"/fade in from dark when the page first loads in the webview */
  animation: twinkle 6s ease-in-out infinite -2.6s;
}
.bg__stars::after {
  box-shadow:
    12vw 52vh 0 0 rgba(255,255,255,.7), 48vw 76vh 0 0 rgba(180,210,255,.6), 82vw 12vh 0 0 rgba(255,255,255,.6),
    63vw 62vh 0 0 rgba(255,255,255,.5), 48vw 44vh 0 0 rgba(200,220,255,.6), 92vw 44vh 0 0 rgba(255,255,255,.6),
    7vw 70vh 0 0 rgba(180,210,255,.5), 52vw 26vh 0 0 rgba(255,255,255,.6);
  animation: twinkle 7s ease-in-out infinite -4.1s;
}
@keyframes twinkle { 0%,100% { opacity: .34; } 50% { opacity: .78; } }
.bg__grain {
  position: absolute; inset: 0; opacity: .04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ Intro "eye open" reveal ============ */
.intro { position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
.intro__lid {
  position: absolute; left: 0; right: 0; height: 50.5%; background: #000;
}
/* top lid: glows on its lower edge, then rises fully past the top and vanishes */
.intro__lid--top { top: 0; box-shadow: 0 6px 46px 8px rgba(70,120,255,.5); animation: lidTop 1.15s var(--ease) .12s forwards; }
/* bottom lid: glows on its upper edge and settles at the bottom (stays) */
.intro__lid--bottom { bottom: 0; box-shadow: 0 -6px 50px 8px rgba(70,120,255,.5); animation: lidBottom 1.05s var(--ease) .12s forwards; }
.intro__glow {
  position: absolute; left: 50%; top: 50%; width: 120vw; height: 36vh;
  transform: translate(-50%,-50%);
  background: radial-gradient(closest-side, rgba(60,110,255,.45), transparent 70%);
  opacity: 0; animation: introGlow 1.05s ease-out forwards;
}
@keyframes lidTop { to { transform: translateY(-118%); } }
@keyframes lidBottom { to { transform: translateY(100%); } }
@keyframes introGlow { 0% { opacity: 0; } 30% { opacity: .9; } 100% { opacity: 0; } }

/* ============ Reveal ============ */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .85s var(--ease), transform .85s var(--ease); }
html.js .reveal.in { opacity: 1; transform: none; }

/* ============ Layout ============ */
main, section { position: relative; z-index: 1; }
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(34px, 7vw, 66px) 22px 0; }
.divider { max-width: var(--maxw); margin: clamp(8px, 3vw, 26px) 22px 0; height: 1px; background: var(--border); }
@media (min-width: 1164px) { .divider { margin-left: auto; margin-right: auto; } }

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: max(24px, env(safe-area-inset-top)) 22px 24px;
  max-width: 640px; margin: 0 auto;
}

.icon-wrap {
  position: relative; margin: clamp(16px, 3.6vh, 40px) 0 2px;
  animation: heroIconIn 1s var(--ease) both;
}
.icon-3d {
  width: clamp(158px, 45vw, 212px); height: auto;
  filter: drop-shadow(0 34px 60px rgba(6,16,90,.7));
  animation: floaty 6s ease-in-out 1.15s infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(0) } 50% { transform: translateY(-12px) rotate(-1.5deg) } }
@keyframes heroIconIn {
  0%   { opacity: 0; transform: perspective(760px) rotateX(-52deg) translateY(-8px) scale(.74); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: perspective(760px) rotateX(0) translateY(0) scale(1); }
}

.app-name {
  margin: 16px 0 0; font-family: 'Inter', sans-serif; font-weight: 500;
  font-size: clamp(15px, 3.8vw, 18px); letter-spacing: .04em;
  color: var(--w-70);
}
.app-name span { color: var(--w-40); }

.headline {
  margin: 14px 0 0; font-weight: 800; letter-spacing: -.04em; line-height: .97;
  font-size: clamp(40px, 11.3vw, 70px);
  color: var(--white);
  text-shadow: 0 10px 44px rgba(0,0,0,.4);
}
.hl-predict {
  font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400;
  font-size: 1.16em; letter-spacing: 0;
  /* #0231FD is the app's real brand blue; the lighter band is just the sweep */
  background: linear-gradient(100deg, #0231FD 0%, #0231FD 36%, #7fb0ff 50%, #0231FD 64%, #0231FD 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 22px rgba(2,49,253,.62));
  animation: predictShine 5s ease-in-out infinite;
}
@keyframes predictShine { 0% { background-position: 145% 0; } 45%,100% { background-position: -45% 0; } }
.hl-accent {
  display: block; line-height: 1.02; padding-bottom: .06em;
  color: #ffffff;
}
@keyframes heroUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.hero__sub {
  margin: 22px auto 0; max-width: 430px;
  font-size: clamp(15px, 3.4vw, 17px); color: var(--w-70); font-weight: 400;
}

/* ============ Live traffic (top-right, subtle social proof) ============ */
.traffic {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 16px; z-index: 5;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 500; color: var(--w-40); letter-spacing: .01em;
}
.traffic b { color: var(--w-70); font-weight: 700; }
/* odometer: each digit rolls vertically (old drops down, new comes from top) */
.roll { display: inline-flex; align-items: stretch; line-height: 1; }
.roll__d { display: inline-block; height: 1em; overflow: hidden; }
.roll__s { display: block; white-space: pre; text-align: center; font-variant-numeric: tabular-nums; }
.roll.on .roll__s { transition: transform .6s cubic-bezier(.2,.75,.2,1); }
.roll__sep { display: inline-block; }

/* ============ Discount medals (float beside the app icon) ============ */
.medal {
  position: absolute; z-index: 2;
  display: grid; place-items: center;
  overflow: hidden;              /* keeps the shine sweep from widening the page */
  width: 88px; height: 88px;
  /* 12-point starburst seal */
  clip-path: polygon(50% 1%, 60.09% 12.33%, 74.5% 7.56%, 77.58% 22.42%, 92.44% 25.5%, 87.67% 39.91%, 99% 50%, 87.67% 60.09%, 92.44% 74.5%, 77.58% 77.58%, 74.5% 92.44%, 60.09% 87.67%, 50% 99%, 39.91% 87.67%, 25.5% 92.44%, 22.42% 77.58%, 7.56% 74.5%, 12.33% 60.09%, 1% 50%, 12.33% 39.91%, 7.56% 25.5%, 22.42% 22.42%, 25.5% 7.56%, 39.91% 12.33%);
}
.medal__txt {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center; line-height: 1;
}
.medal__txt b { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.medal__txt em { font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: .02em; margin-top: 4px; opacity: .92; }

/* monthly — quiet: dark seal with a static dashed stroke, no glow */
.medal--m {
  /* offsets scale with the viewport so the seals never crowd the screen edge
     on small phones (overflow-x is clipped, so an overhang would be cut off) */
  left: clamp(-64px, -16vw, -40px); top: 46px;
  color: #dbe6ff;
  background: linear-gradient(158deg, #1b2552, #0a1030 72%);
  filter: drop-shadow(1.5px 2.5px 0 rgba(3,7,26,.9)) drop-shadow(0 6px 12px rgba(0,0,0,.45));
  animation: medalFloatA 4.6s ease-in-out infinite alternate;
}
.medal__dash { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
/* thin, widely-spaced dashes to match the feature cards' dashed borders */
.medal__dash path {
  fill: none; stroke: rgba(140,170,255,.62); stroke-width: 1.3; stroke-linecap: round;
  stroke-dasharray: 3.5 6.5;
}

/* yearly — the hero deal: glossy royal blue with a shine sweep */
.medal--y {
  right: clamp(-58px, -14vw, -36px); top: 66%;
  color: #fff;
  background: linear-gradient(158deg, #5f7bff, #2743ff 56%, #1b2ecb);
  filter: drop-shadow(1.5px 2.5px 0 #16228c) drop-shadow(0 11px 22px rgba(39,67,255,.62));
  animation: medalFloatB 4s ease-in-out infinite alternate;
}
.medal--y .medal__shine,
.medal--w .medal__shine {
  position: absolute; top: -26%; left: -44px; width: 24px; height: 152%; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.78), transparent);
  transform: translateX(0) rotate(20deg);
  animation: medalShine 7s ease-in-out infinite;
}

/* weekly — the plan we push hardest: bright pearl seal, star + "Most Popular".
   Reads as the standout of the three without introducing a new hue. */
.medal--w {
  /* sits in the band between the traffic chip above and the yearly seal below */
  right: clamp(-62px, -15vw, -38px); top: -16px;
  width: 94px; height: 94px;   /* the hero badge: a touch bigger than the other two */
  color: var(--royal);
  background: linear-gradient(158deg, #ffffff, #e6eeff 56%, #c3d7ff);
  filter: drop-shadow(1.5px 2.5px 0 rgba(88,118,190,.5)) drop-shadow(0 12px 26px rgba(150,185,255,.5));
  animation: medalFloatC 4.3s ease-in-out infinite alternate;
}
.medal--w .medal__shine { background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent); animation-delay: 3.5s; }
.medal--w .medal__txt { margin-top: 7px; }   /* leaves room for the star above */
.medal--w .medal__txt b { font-size: 18px; letter-spacing: -.025em; }
.medal--w .medal__txt em {
  font-size: 7.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  margin-top: 3px; opacity: 1; color: var(--royal-bright); white-space: nowrap;
}
/* pulled out of the text flow so "Weekly" reads centred in the seal */
.medal__star {
  position: absolute; top: 17px; left: 50%; margin-left: -6px; z-index: 3;
  width: 12px; height: 12px; color: var(--royal-bright);
}
/* single smooth glide that fully clears the badge on both ends, then a long
   pause (no mid-badge freeze like the old %-based sweep, and less frequent) */
@keyframes medalShine {
  0% { transform: translateX(0) rotate(20deg); }
  14% { transform: translateX(170px) rotate(20deg); }
  100% { transform: translateX(170px) rotate(20deg); }
}
@keyframes medalFloatA { from { transform: rotate(-9deg) translateY(0); } to { transform: rotate(-6deg) translateY(-7px); } }
@keyframes medalFloatB { from { transform: rotate(8deg) translateY(-6px); } to { transform: rotate(5deg) translateY(2px); } }
@keyframes medalFloatC { from { transform: rotate(6deg) translateY(2px); } to { transform: rotate(9deg) translateY(-6px); } }

/* slim countdown line under the store buttons */
.sale-line {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 17px auto 0; font-size: 13px; font-weight: 500; color: var(--w-70);
}
.sale-line__dot {
  width: 6px; height: 6px; border-radius: 50%; background: #4d8bff; flex-shrink: 0;
  animation: offerDot 2s ease-out infinite;
}
.sale-line b { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
@keyframes offerDot {
  0% { box-shadow: 0 0 0 0 rgba(77,139,255,.65); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(77,139,255,0); }
}

/* ============ Store buttons — big white pills, stacked ============ */
.cta {
  display: flex; flex-direction: column; gap: 13px;
  width: 100%; max-width: 360px; margin: 30px auto 0;
}
.store {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 17px 26px; border-radius: 999px;
  background: var(--white); color: var(--ink-navy);
  box-shadow: 0 16px 38px -14px rgba(3,8,50,.75), inset 0 1px 0 rgba(255,255,255,.6);
  transition: transform .35s var(--ease), box-shadow .35s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.store > * { pointer-events: none; }
.store:hover { transform: translateY(-3px); box-shadow: 0 24px 50px -16px rgba(3,8,50,.8); }
.store:active { transform: translateY(-1px) scale(.99); }
.store__icon { display: grid; place-items: center; width: 26px; height: 26px; flex-shrink: 0; color: var(--ink-navy); }
.store--google .store__icon svg { color: var(--royal); }
.store__text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.store__text small { font-size: 11px; color: #6a7398; font-weight: 500; letter-spacing: .02em; }
.store__text strong { font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: var(--ink-navy); }
.store__shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.65) 50%, transparent 58%);
  transform: translateX(-120%); transition: transform 1s var(--ease);
}
.store:hover .store__shine { transform: translateX(120%); }

/* Device highlight: matching store first & solid; other → frosted glass */
body.is-ios .store--apple, body.is-android .store--google { order: -1; }
body.is-ios .store--google,
body.is-android .store--apple {
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.34);
  color: #fff;
}
body.is-ios .store--google .store__text small,
body.is-android .store--apple .store__text small { color: rgba(255,255,255,.7); }
body.is-ios .store--google .store__text strong,
body.is-android .store--apple .store__text strong,
body.is-ios .store--google .store__icon,
body.is-android .store--apple .store__icon,
body.is-ios .store--google .store__icon svg,
body.is-android .store--apple .store__icon svg { color: #fff; }

/* ============ Loved-by vector ============ */
.loved {
  position: relative; width: min(248px, 66%); margin: 26px auto 0;
}
.loved img { width: 100%; height: auto; opacity: .95; }
.loved__shine {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  -webkit-mask: url("assets/loved-by.svg") no-repeat center / contain;
  mask: url("assets/loved-by.svg") no-repeat center / contain;
}
.loved__shine::before {
  content: ""; position: absolute; top: -20%; bottom: -20%; width: 42%; left: -60%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.85), transparent);
  transform: skewX(-18deg);
  animation: lovedShine 4.5s ease-in-out 1.6s infinite;
}
@keyframes lovedShine { 0% { left: -60%; } 30%,100% { left: 130%; } }

/* ============ Section heading bits ============ */
.eyebrow { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; color: #4d8bff; margin-bottom: 14px; text-shadow: 0 0 20px rgba(77,139,255,.5); }

/* ============ Coach section ============ */
.section__head { text-align: center; max-width: 560px; margin: 0 auto clamp(34px, 6vw, 52px); }
.section__head h2 { margin: 0; font-size: clamp(30px, 6.2vw, 46px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; color: var(--white); }
.section__head > p { margin: 18px auto 0; color: var(--w-70); font-size: clamp(15px, 2.4vw, 17px); max-width: 460px; }

/* ---- feature cards (dark glass, dashed border, live analytics) ---- */
.fcards { display: grid; grid-template-columns: 1fr; gap: 15px; max-width: 820px; margin: 0 auto clamp(28px, 5vw, 46px); }
@media (min-width: 560px) { .fcards { grid-template-columns: 1fr 1fr; } }
.fcard {
  position: relative; outline: none;
  padding: 22px 22px 24px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(26,38,92,.42), rgba(12,18,54,.5));
  border: 1.5px dashed rgba(120,155,255,.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  transition: transform .4s var(--ease), border-color .35s, box-shadow .35s, background .35s;
  cursor: pointer;
}
.fcard:hover, .fcard:focus-visible, .fcard:active {
  transform: translateY(-4px); border-color: #4d8bff;
  background: linear-gradient(180deg, rgba(34,52,130,.5), rgba(14,22,66,.55));
  box-shadow: 0 0 0 1px rgba(77,139,255,.45), 0 26px 56px -26px rgba(77,139,255,.55), inset 0 1px 0 rgba(255,255,255,.1);
}
.fcard__top { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.fcard__ic {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; flex-shrink: 0; color: #fff;
  background: linear-gradient(160deg, var(--royal-bright), var(--royal));
  box-shadow: 0 10px 20px -8px rgba(39,67,255,.6);
}
.fcard__ic svg { width: 22px; height: 22px; }
.fcard__top h3 { flex: 1; margin: 0; font-size: 16.5px; font-weight: 800; letter-spacing: -.02em; color: #fff; text-align: left; white-space: nowrap; }
.fcard p { margin: 13px 0 0; font-size: 13.5px; color: var(--w-55); line-height: 1.5; }
.fcard__tag { flex-shrink: 0; font-size: 12px; font-weight: 700; color: #86b3ff; background: rgba(77,139,255,.16); padding: 5px 10px; border-radius: 999px; }

/* shared viz area: open, airy mini-scene (no boxed background) — values are
   swapped live by JS every few seconds, easing via CSS transitions */
.fviz { position: relative; height: 102px; }

/* --- 1. Height Prediction: fades out, then the line grows again from zero --- */
.chart { position: absolute; left: 2px; right: 2px; top: 4px; width: calc(100% - 4px); height: calc(100% - 24px); overflow: visible; transition: opacity .3s ease; }
.chart.off { opacity: 0; }
.chart__hist { stroke-dasharray: 100; stroke-dashoffset: 100; filter: drop-shadow(0 3px 8px rgba(77,139,255,.4)); }
.chart__cast, .chart__area, .chart__dot { opacity: 0; }
.chart.run .chart__hist { animation: chartDraw 1.9s cubic-bezier(.33,.65,.3,1) both; }
.chart.run .chart__area { animation: chartFade 1.2s ease .35s both; }
.chart.run .chart__cast { animation: chartFade .6s ease 1.7s both; }
.chart.run .chart__dot { animation: chartFade .5s ease 1.9s both, dotPulse 2.6s ease-in-out 2.4s infinite; }
.chart__dot { filter: drop-shadow(0 0 6px rgba(140,190,255,.95)); }
@keyframes chartDraw { to { stroke-dashoffset: 0; } }
@keyframes chartFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dotPulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.chart__mo {
  position: absolute; left: 2px; right: 2px; bottom: 0;
  display: flex; justify-content: space-between;
  font-size: 8.5px; font-weight: 600; letter-spacing: .08em; color: rgba(214,228,255,.38);
}

/* --- 2. Posture Scan: the Tallio spine swept by a scan beam + live score ring --- */
.fviz--scan { display: flex; gap: 10px; }
.scan__stage { position: relative; flex: 1; overflow: hidden; }
.scan__stage > i { position: absolute; width: 12px; height: 12px; border: 1.5px solid rgba(140,170,255,.32); }
.scan__stage > i:nth-of-type(1) { top: 2px; left: 8px; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.scan__stage > i:nth-of-type(2) { top: 2px; right: 8px; border-left: 0; border-bottom: 0; border-radius: 0 4px 0 0; }
.scan__stage > i:nth-of-type(3) { bottom: 2px; left: 8px; border-right: 0; border-top: 0; border-radius: 0 0 0 4px; }
.scan__stage > i:nth-of-type(4) { bottom: 2px; right: 8px; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }
.scan__spine { position: absolute; left: 50%; top: 4px; height: calc(100% - 8px); transform: translateX(-50%); }
.sv { opacity: .35; }
.sv1 { animation: vertPop 5s ease-in-out .3s infinite; }
.sv2 { animation: vertPop 5s ease-in-out .68s infinite; }
.sv3 { animation: vertPop 5s ease-in-out 1.06s infinite; }
.sv4 { animation: vertPop 5s ease-in-out 1.44s infinite; }
@keyframes vertPop { 0% { opacity: .35; } 6% { opacity: 1; } 50% { opacity: .85; } 62%,100% { opacity: .35; } }
.scan__beam {
  position: absolute; left: 10px; right: 10px; top: -4px; height: 15px; border-radius: 8px;
  background: linear-gradient(180deg, transparent, rgba(90,140,255,.26) 42%, rgba(150,195,255,.65) 50%, rgba(90,140,255,.26) 58%, transparent);
  animation: beamY 5s ease-in-out infinite;
}
@keyframes beamY {
  0% { transform: translateY(0); opacity: 0; }
  5% { opacity: 1; }
  36% { transform: translateY(84px); opacity: 1; }
  44%,100% { transform: translateY(84px); opacity: 0; }
}
.scan__gauge {
  width: 86px; flex-shrink: 0; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.scan__gauge svg { width: 58px; height: 58px; }
.scan__gauge b { position: absolute; top: 30px; font-size: 15px; font-weight: 800; color: #fff; }
.scan__gauge em { font-style: normal; font-size: 8.5px; font-weight: 700; letter-spacing: .14em; color: var(--w-40); }
.scan__ring { transition: stroke-dashoffset .9s var(--ease); }

/* --- 3. Sleep Score: a week of sleep bars, heights re-flow live --- */
.sleep__star { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; animation: twinkle 4.2s ease-in-out infinite; }
.sleep__star--a { top: 8px; left: 14px; }
.sleep__star--b { top: 1px; right: 96px; animation-delay: 1.6s; }
.sleep__chip {
  position: absolute; top: 0; right: 2px; z-index: 2;
  font-size: 10.5px; font-weight: 700; color: #cfe0ff;
  background: rgba(77,139,255,.16); box-shadow: inset 0 0 0 1px rgba(122,158,255,.3);
  padding: 3px 8px; border-radius: 999px;
  transition: opacity .3s;
}
.sleep__bars {
  position: absolute; left: 2px; right: 2px; top: 26px; bottom: 17px;
  display: flex; gap: 9px; align-items: flex-end;
}
.sleep__bars i {
  flex: 1; height: var(--h); border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, rgba(134,179,255,.45), rgba(39,67,255,.62));
  transition: height .9s var(--ease), background .5s, box-shadow .5s;
}
.sleep__bars i.hi { background: linear-gradient(180deg, #a6c6ff, #3b5bff); box-shadow: 0 0 14px rgba(90,140,255,.5); }
.sleep__days {
  position: absolute; left: 2px; right: 2px; bottom: 0;
  display: flex; gap: 9px;
  font-size: 8.5px; font-weight: 600; color: rgba(214,228,255,.38);
}
.sleep__days span { flex: 1; text-align: center; }

/* --- 4. Daily Plans: checklist ticks live (JS drives the .done state) --- */
.fviz--plan { display: flex; flex-direction: column; justify-content: space-between; padding: 4px 2px 2px; }
.task { display: flex; align-items: center; gap: 9px; }
.task__c {
  position: relative; width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0;
  border: 1.6px solid rgba(255,255,255,.28); box-sizing: border-box;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.task__c::after {
  content: ""; position: absolute; left: 3.6px; top: 1.2px; width: 4px; height: 7.5px;
  border: solid #fff; border-width: 0 1.7px 1.7px 0;
  transform: rotate(40deg) scale(0);
  transition: transform .3s var(--ease) .05s;
}
.task__t { position: relative; font-size: 12px; font-weight: 600; color: var(--w-70); line-height: 1.2; transition: opacity .35s; }
.task__t::after {
  content: ""; position: absolute; left: -2px; right: -2px; top: 50%; height: 1.3px;
  background: rgba(160,190,255,.7); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.task > b { margin-left: auto; font-size: 10px; font-weight: 600; color: var(--w-40); }
.task.done .task__c { background: var(--royal-bright); border-color: var(--royal-bright); }
.task.done .task__c::after { transform: rotate(40deg) scale(1); }
.task.done .task__t { opacity: .45; }
.task.done .task__t::after { transform: scaleX(1); }
.plan__prog { display: block; height: 5px; border-radius: 99px; background: rgba(255,255,255,.09); overflow: hidden; }
.plan__prog i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #86b3ff, var(--royal-bright));
  transform-origin: left; transform: scaleX(.05);
  transition: transform .55s var(--ease);
}

/* ---- Chat mockup (light card, like a real app screen) ---- */
.chat {
  position: relative; border-radius: 26px; overflow: hidden;
  background: #f3f5fb;
  box-shadow: 0 46px 90px -34px rgba(2,6,50,.92), 0 0 0 1px rgba(255,255,255,.12), 0 0 60px -20px rgba(74,102,255,.5);
  max-width: 400px; width: 100%; margin: 0 auto;
}
.chat__badge {
  position: absolute; top: 15px; right: 15px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: #fff; letter-spacing: .01em;
  padding: 5px 11px 5px 5px; border-radius: 999px;
  background: linear-gradient(135deg, var(--royal-bright), var(--royal));
  box-shadow: 0 6px 16px -5px rgba(39,67,255,.75);
}
.chat__badge img { width: 16px; height: 16px; border-radius: 5px; }
.chat__head { display: flex; align-items: center; gap: 11px; padding: 15px 18px; background: #fff; border-bottom: 1px solid #e8ecf5; }
.chat__avatar { width: 38px; height: 38px; border-radius: 11px; overflow: hidden; flex-shrink: 0; box-shadow: 0 5px 14px -5px rgba(20,40,120,.5); }
.chat__avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat__id strong { display: block; font-size: 15px; color: #0e1533; }
.chat__id small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #7c88aa; }
.chat__id .dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.chat__body { padding: 16px; display: flex; flex-direction: column; gap: 9px; }
.bubble { font-size: 14px; line-height: 1.45; padding: 10px 14px; border-radius: 18px; max-width: 82%; }
.bubble--ai { align-self: flex-start; background: #e8ecf5; color: #1b2240; border-bottom-left-radius: 6px; }
.bubble--me { align-self: flex-end; background: linear-gradient(160deg, var(--royal-bright), var(--royal)); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 8px 18px -8px rgba(39,67,255,.6); }
.bubble--ai b { color: var(--royal); }
.bubble--typing { align-self: flex-start; display: flex; gap: 4px; padding: 14px 15px; background: #e8ecf5; border-radius: 18px; border-bottom-left-radius: 6px; }
.bubble--typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa6c4; animation: typing 1.3s ease-in-out infinite; }
.bubble--typing i:nth-child(2) { animation-delay: .18s; }
.bubble--typing i:nth-child(3) { animation-delay: .36s; }
@keyframes typing { 0%,60%,100% { opacity: .35; transform: translateY(0) } 30% { opacity: 1; transform: translateY(-3px) } }
.chat__input {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 4px 14px 16px; padding: 9px 9px 9px 16px; border-radius: 999px;
  background: #fff; border: 1px solid #e2e7f1; color: #9aa4bf; font-size: 13.5px;
}
.chat__input .send { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(160deg, var(--royal-bright), var(--royal)); color: #fff; flex-shrink: 0; font-style: normal; }
.chat__input .send svg { transform: translate(-1px, -1px); }

/* ============ Footer (NXT-style) ============ */
.footer { position: relative; z-index: 1; max-width: var(--maxw); margin: clamp(70px, 11vw, 120px) auto 0; padding: 0 22px 38px; }
.footer__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 34px 24px;
  padding: 44px 0 34px; border-top: 1px solid var(--border);
}
@media (min-width: 680px) { .footer__grid { grid-template-columns: 2.2fr 1fr 1fr; } }
.footer__brand-col { grid-column: 1 / -1; max-width: 340px; }
@media (min-width: 680px) { .footer__brand-col { grid-column: auto; } }
.footer__brand { display: inline-flex; align-items: center; gap: 12px; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 17px; letter-spacing: -.01em; color: var(--white); }
.footer__logo { width: auto; height: 27px; filter: brightness(0) invert(1) drop-shadow(0 3px 9px rgba(120,150,255,.3)); }
.footer__tagline { margin: 16px 0 0; font-size: 14px; color: var(--w-55); line-height: 1.6; }
.footer__col { display: flex; flex-direction: column; gap: 13px; }
.footer__head { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--w-40); margin-bottom: 3px; }
.footer__col a { font-size: 14.5px; color: var(--w-70); font-weight: 400; transition: color .25s; width: fit-content; }
.footer__col a:hover { color: var(--white); }

.footer__bar {
  display: flex; flex-wrap: nowrap; gap: 16px; align-items: center; justify-content: space-between;
  padding: 22px 0; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--w-40);
}
.footer__copy { flex: 1 1 auto; min-width: 0; line-height: 1.5; }
.footer__note { display: block; color: var(--w-40); }

/* language selector */
.lang { position: relative; margin-left: auto; flex-shrink: 0; }
.lang__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--border-2); color: var(--w-90);
  font-size: 14px; font-weight: 500; font-family: inherit; transition: background .2s;
}
.lang__btn:hover { background: var(--glass-2); }
.lang__chev { transition: transform .25s; }
.lang.open .lang__chev { transform: rotate(180deg); }
.lang__menu {
  position: absolute; right: 0; bottom: calc(100% + 8px); width: 176px; max-width: calc(100vw - 44px);
  padding: 6px; border-radius: 14px;
  background: #0e1740; border: 1px solid var(--border-2);
  box-shadow: 0 22px 46px -18px rgba(0,0,0,.85);
  animation: langIn .2s var(--ease) both;
}
.lang__menu[hidden] { display: none; }
.lang__menu button {
  display: block; width: 100%; text-align: left; padding: 10px 14px; border: none; border-radius: 9px;
  background: transparent; color: var(--w-70); font-size: 14px; font-weight: 500; font-family: inherit; cursor: pointer;
}
.lang__menu button:hover, .lang__menu button[aria-selected="true"] { background: rgba(255,255,255,.09); color: var(--white); }
@keyframes langIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.footer__fine { font-size: 12px; color: var(--w-40); text-align: center; padding-top: 6px; }

/* ============ "Open in browser" prompt ============ */
.openhint[hidden] { display: none; }
.openhint {
  display: flex; align-items: center; justify-content: center;
  position: fixed; inset: 0; z-index: 300; padding: 24px;
  background: rgba(3, 6, 22, 0.94);
  animation: fadeIn .25s ease both;
  touch-action: none; overscroll-behavior: contain;
}
.openhint__card {
  max-width: 384px; width: 100%; text-align: center;
  padding: 36px 30px; border-radius: 28px;
  background: linear-gradient(180deg, #111c52, #0a1030);
  border: 1.5px dashed rgba(122,158,255,.4);
  box-shadow: 0 34px 80px -28px rgba(0,0,0,.88);
  animation: popIn .35s var(--ease) both;
}
.openhint__card h3 { margin: 14px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -.025em; color: #fff; }
.openhint__card p { margin: 13px 0 0; font-size: 15.5px; color: var(--w-70); line-height: 1.55; }
.openhint__card b { color: var(--accent); font-weight: 700; }
.openhint__ok {
  margin-top: 24px; width: 100%; padding: 15px; border: none; border-radius: 999px;
  background: #fff; color: var(--ink-navy); font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 26px -10px rgba(0,0,0,.5);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.96) } to { opacity: 1; transform: none } }

/* ---- in-app "hold to open" affordances ---- */
.lbl-hold { display: none; }
.store__hold { display: none; }
body.is-inapp .lbl-tap { display: none; }
body.is-inapp .lbl-hold { display: block; }
body.is-inapp .store__hold {
  display: block;
  position: absolute; right: 26px; top: 50%; width: 6px; height: 6px; margin-top: -3px;
  border-radius: 50%; background: currentColor; opacity: .8;
}
body.is-inapp .store__hold::before,
body.is-inapp .store__hold::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px;
  border-radius: 50%; border: 1.5px solid currentColor;
  /* base state matches the 0% keyframe (centered + invisible) so the ring
     never flashes off-center on the very first frame before the animation
     is applied */
  opacity: 0; transform: translate(-50%,-50%) scale(.5);
  animation: pressPulse 2.4s ease-out infinite;
}
body.is-inapp .store__hold::after { animation-delay: 1.2s; }
@keyframes pressPulse {
  0% { transform: translate(-50%,-50%) scale(.5); opacity: .55; }
  100% { transform: translate(-50%,-50%) scale(3); opacity: 0; }
}

.hold-hint { display: none; }
body.is-inapp .hold-hint {
  display: block; margin: 16px auto 0; max-width: 320px;
  font-size: 13px; font-weight: 500; color: var(--w-70); line-height: 1.5;
}
.hold-hint b { color: var(--accent); font-weight: 700; }

/* ---- animated "press & hold → Open Link" tutorial ---- */
.howto { position: relative; width: 240px; height: 176px; margin: 6px auto 14px; }
.howto__btn {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 214px; margin: 0 auto; padding: 14px; border-radius: 999px;
  background: #fff; color: var(--ink-navy); font-weight: 700; font-size: 15.5px;
  box-shadow: 0 12px 28px -10px rgba(0,0,0,.55);
}
.howto__btn-ic { display: inline-grid; place-items: center; }
.howto__hand {
  position: absolute; left: 50%; top: 12px; margin-left: -13px; width: 26px; height: 26px;
  transform-origin: 50% 8%;
  filter: drop-shadow(0 3px 6px rgba(6,14,60,.5)); opacity: 0;
}
.howto__hand svg { width: 26px; height: 26px; display: block; }
.howto__hand::after {
  content: ""; position: absolute; left: 50%; top: -1px; width: 12px; height: 12px; margin-left: -6px; margin-top: -6px;
  border-radius: 50%; border: 2px solid rgba(120,175,255,.95);
  opacity: 0;
}
.howto__menu {
  position: absolute; left: 50%; top: 72px; transform: translateX(-50%);
  width: 190px; border-radius: 14px; overflow: hidden;
  background: rgba(38,42,58,.98); border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 16px 32px -12px rgba(0,0,0,.6);
  opacity: 0;
}
.howto__row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; font-size: 13px; color: #fff; }
.howto__row + .howto__row { border-top: 1px solid rgba(255,255,255,.08); }
.howto__row b { color: rgba(255,255,255,.55); font-weight: 500; }
/* animations run only while .howto has .anim — JS re-toggles it on every
   open so the press-and-hold demo replays on every button tap (WebKit won't
   restart these on its own when the overlay is merely un-hidden). */
.howto.anim .howto__hand { animation: htHand 3.6s ease-in-out infinite; }
.howto.anim .howto__hand::after { animation: htRipple 3.6s ease-out infinite; }
.howto.anim .howto__menu { animation: htMenu 3.6s ease-out infinite; }
.howto.anim .howto__row--hl { animation: htHl 3.6s ease-in-out infinite; }
@keyframes htRipple {
  0%,14% { opacity: 0; transform: scale(.35); }
  22% { opacity: .85; transform: scale(1); }
  40% { opacity: 0; transform: scale(2.4); }
  55% { opacity: 0; transform: scale(.35); }
  64% { opacity: .85; transform: scale(1); }
  80% { opacity: 0; transform: scale(2.4); }
  100% { opacity: 0; }
}
@keyframes htHand {
  0% { top: 6px; opacity: 0; transform: scale(1); }
  10% { opacity: 1; }
  18% { top: 18px; opacity: 1; transform: scale(1); }
  26% { transform: scale(.85); }
  40% { top: 18px; transform: scale(1); }
  56% { top: 80px; opacity: 1; transform: scale(1); }
  64% { transform: scale(.85); }
  78% { top: 80px; transform: scale(1); }
  92%,100% { top: 18px; opacity: 0; }
}
@keyframes htMenu { 0%,42% { opacity:0; transform: translateX(-50%) translateY(6px) } 52%,90% { opacity:1; transform: translateX(-50%) translateY(0) } 100% { opacity:0 } }
@keyframes htHl { 0%,54% { background: rgba(39,67,255,.2) } 64%,82% { background: rgba(74,102,255,.8) } 100% { background: rgba(39,67,255,.2) } }

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; }
}
