/* ==========================================================================
   Step Step · landing page
   Parallax values come from /home.js as CSS custom properties on .hero:
     --mx, --my   pointer position, -1..1, smoothed
     --sp         how far the hero has scrolled away, 0..1
   Every transform below falls back to its resting pose when they are unset.
   ========================================================================== */

/* A solid colour, not gradient text: iOS Safari drops background-clip: text
   inside the fading reveal and the line came out near-invisible. */
h1 em, h2 em {
  font-style: italic;
  color: var(--frost);
  padding-right: 0.06em;
}

/* ------------------------------------------------------------------ hero
   Devices first: the fan of phones (and the watch) sits at the top of the
   page, fading out at the bottom, and the headline rises over that fade. */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + clamp(0px, 1.5vh, 18px)) 20px 0;
  text-align: center;
  overflow-x: clip;
}

.hero-devices {
  --pw: clamp(220px, min(21vw, calc((100svh - 60px) * 0.36)), 310px);
  --lift: calc(var(--pw) * 0.3);   /* headroom for the ring's glow inside the mask */
  position: relative;
  z-index: 1;
  height: calc(var(--pw) * 1.4 + var(--lift));
  margin: 0 auto;
  perspective: 1800px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 52%, rgba(0,0,0,.35) 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 52%, rgba(0,0,0,.35) 80%, transparent 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}
.hero-devices::before {
  /* A pool of navy light under the phones. */
  content: "";
  position: absolute;
  left: 50%;
  top: calc(var(--lift) + var(--pw) * 0.05);
  width: calc(var(--pw) * 3.6);
  height: calc(var(--pw) * 1.3);
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(66, 92, 180, 0.34), rgba(40, 56, 120, 0.12) 55%, transparent);
}

.hero-halo {
  position: absolute;
  left: 50%;
  top: calc(var(--lift) - var(--pw) * 0.24);
  width: calc(var(--pw) * 3.3);
  height: auto;
  max-width: none;
  overflow: visible;
  transform: translate3d(-50%, calc(var(--sp, 0) * -30px), 0) scale(calc(1 + var(--sp, 0) * 0.18));
  opacity: calc(0.9 - var(--sp, 0) * 0.6);
}
.halo-track { fill: none; stroke: rgba(150, 170, 230, 0.13); stroke-width: 7; }
.halo-arc {
  fill: none;
  stroke: url(#halo-grad);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 403;
  stroke-dashoffset: 403;
  animation: halo-draw 2.6s var(--ease-out) .35s forwards;
}
.halo-arc-glow {
  stroke-width: 14;
  opacity: .5;
  animation: halo-draw 2.6s var(--ease-out) .35s forwards, halo-breathe 6s ease-in-out 3s infinite;
}

.hero-rig {
  position: absolute;
  left: 50%;
  top: var(--lift);
  width: var(--pw);
  margin-left: calc(var(--pw) / -2);
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--my, 0) * -3deg)) rotateY(calc(var(--mx, 0) * 4.5deg));
  will-change: transform;
}
.hp {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}
.hp > .iphone, .hp > .watch { animation: phone-in 1.5s var(--ease-out) .15s both; }
.hp-center {
  transform: translate3d(calc(var(--mx, 0) * 8px), calc(var(--sp, 0) * -46px), 70px);
}
.hp-left {
  transform:
    translate3d(calc(-64% - var(--sp, 0) * 18% + var(--mx, 0) * -14px), calc(9% + var(--sp, 0) * 34px), -40px)
    rotateY(calc(22deg + var(--sp, 0) * 10deg));
  filter: brightness(.72) saturate(.9);
}
.hp-right {
  transform:
    translate3d(calc(64% + var(--sp, 0) * 18% + var(--mx, 0) * -14px), calc(9% + var(--sp, 0) * 34px), -40px)
    rotateY(calc(-22deg - var(--sp, 0) * 10deg));
  filter: brightness(.72) saturate(.9);
}
.hp-left > .iphone, .hp-right > .iphone { animation-delay: .35s; }
/* The watch rides in front, overlapping the centre phone's lower right. */
.hp-watch {
  width: 52%;
  transform:
    translate3d(calc(128% + var(--mx, 0) * 16px + var(--sp, 0) * 20%), calc(36% - var(--sp, 0) * 40%), 150px)
    rotateY(-12deg) rotateZ(3deg);
}
.hp-watch > .watch { animation-delay: .55s; }

.hero-copy {
  position: relative;
  z-index: 5;
  max-width: 980px;
  margin: calc(var(--hero-overlap, 40px) * -1) auto 0;
  transform: translate3d(0, calc(var(--sp, 0) * -50px), 0);
  opacity: calc(1 - var(--sp, 0) * 1.3);
  will-change: transform, opacity;
}

.hero-rating {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 15px 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--soft);
  text-decoration: none;
  background: rgba(10, 13, 26, 0.6);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fade-up 1s var(--ease-out) .3s both;
  transition: border-color .2s, background .2s;
}
.hero-rating b { color: var(--ink); font-weight: 600; }
.hero-rating .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.hero-rating:hover { border-color: rgba(242, 220, 160, 0.35); background: rgba(242, 220, 160, 0.06); }

.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 13px; height: 13px; fill: var(--gold); }

.hero-title {
  margin: 0;
  font-size: clamp(2.7rem, 10.5vw, 6.4rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
}
.hero-title .line {
  display: block;
  overflow: hidden;
  padding: 0 0.08em 0.1em;
  margin-bottom: -0.1em;
}
.hero-title .line > * {
  display: inline-block;
  animation: line-rise 1.3s var(--ease-out) .35s both;
}
.hero-title em { animation: line-rise 1.3s var(--ease-out) .47s both; }

.hero-sub {
  max-width: 34em;
  margin: 20px auto 0;
  font-size: clamp(16px, 1.3vw, 18.5px);
  line-height: 1.6;
  color: var(--muted);
  animation: fade-up 1.1s var(--ease-out) .55s both;
}

.hero-cta {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: fade-up 1.1s var(--ease-out) .65s both;
}
.hero-note { font-size: 13px; color: var(--faint); letter-spacing: 0.01em; }
.hero-rating { margin: 22px 0 clamp(30px, 6vh, 70px); animation-delay: .75s; }

@media (max-width: 700px) {
  .hero { padding-left: 16px; padding-right: 16px; }
  .hero-devices { --pw: min(58vw, 270px); }
  .hero-copy { --hero-overlap: 44px; }
  .hero-rating { font-size: 12px; gap: 8px; padding: 6px 12px 6px 10px; }
  .hero-rating-devices, .hero-rating .dot { display: none; }
  .hero-sub { margin-top: 16px; font-size: 15.5px; }
  .hero-cta { margin-top: 22px; }
  .hero-halo { top: calc(var(--lift) - var(--pw) * 0.22); width: calc(var(--pw) * 3); }
  .hp-left { transform: translate3d(-60%, 10%, -60px) rotateY(20deg); }
  .hp-right { transform: translate3d(60%, 10%, -60px) rotateY(-20deg); }
  .hp-center { transform: translate3d(0, calc(var(--sp, 0) * -30px), 70px); }
  .hp-watch { width: 48%; transform: translate3d(122%, 36%, 150px) rotateY(-10deg) rotateZ(3deg); }
}

/* Short phones (iPhone SE class): smaller devices so the headline still fits. */
@media (max-width: 700px) and (max-height: 720px) {
  .hero-devices { --pw: min(46vw, 200px); }
  .hero-title { margin-top: 12px; font-size: 2.55rem; }
  .hero-sub { margin-top: 12px; font-size: 14.5px; line-height: 1.5; }
  .hero-cta { margin-top: 16px; gap: 8px; }
  .appstore-badge img { height: 48px; }
}

/* ------------------------------------------------------------- showcase */
.section-head {
  max-width: 780px;
  margin: 0 auto clamp(40px, 7vh, 72px);
  text-align: center;
}
.section-head h2 {
  margin-top: 14px;
  font-size: clamp(2.5rem, 6vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.showcase {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(60px, 10vh, 120px) 24px clamp(40px, 8vh, 90px);
}
.showcase .section-head { margin-bottom: 0; }
.showcase-head h2 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); }
/* Scrolling drives the showcase: the track is one screen tall plus a step
   per extra feature, and the phone and list stay pinned while it passes.
   /home.js maps how far through the track you are to the active feature. */
.showcase-track { --step: 70svh; }
html.js .showcase-track { height: calc(100svh + (var(--n) - 1) * var(--step)); }
.showcase-pin {
  padding-top: var(--nav-h);
}
html.js .showcase-pin {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  align-items: center;
}
.showcase-pin > .showcase-grid { width: 100%; }
.showcase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(32px, 6vw, 100px);
}
.showcase-side { display: flex; flex-direction: column; gap: clamp(24px, 4vh, 40px); }

.showcase-stage {
  /* Sized so the whole phone fits a laptop screen. */
  --sw: clamp(220px, min(21vw, calc((100svh - 170px) / 2.12)), 300px);
  --dir: 1;
  position: relative;
  min-height: calc(var(--sw) * 2.12 + 60px);
  perspective: 1400px;
}
.showcase-stage.is-back { --dir: -1; }
.stage-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--sw) * 1.9);
  height: calc(var(--sw) * 1.9);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background-color: rgb(120, 140, 220);
  opacity: 0.2;
  filter: blur(70px);
  transition: background-color 1s ease;
  pointer-events: none;
}
.showcase-stage[data-active="streaks"] .stage-glow { background-color: rgb(200, 205, 235); }
.showcase-stage[data-active="workouts"] .stage-glow { background-color: rgb(46, 158, 91); }
.showcase-stage[data-active="medals"] .stage-glow { background-color: rgb(242, 196, 90); }
.showcase-stage[data-active="weight"] .stage-glow { background-color: rgb(175, 82, 222); }
.showcase-stage[data-active="insights"] .stage-glow { background-color: rgb(50, 173, 230); }
.showcase-stage[data-active="themes"] .stage-glow { background-color: rgb(255, 125, 174); }
.showcase-stage[data-active="watch"] .stage-glow { background-color: rgb(255, 122, 24); opacity: .16; }

/* Each feature is a phone and a watch. Waiting slides sit off to one side,
   turned away; the active one swings in; the previous one swings out the
   other way. --dir flips it all when stepping backwards. */
.stage-slide {
  position: absolute;
  inset: 0;
  pointer-events: none;
  perspective: 1400px;
}
.stage-slide.is-active { pointer-events: auto; }
/* Phone-only features centre the phone. */
.stage-slide.no-watch .slide-phone { margin-left: calc(var(--sw) * -0.5); }
.slide-phone, .slide-watch {
  position: absolute;
  top: 50%;
  left: 50%;
  opacity: 0;
  transition: transform 1s var(--ease-out), opacity .55s ease;
}
.slide-phone {
  width: var(--sw);
  margin: calc(var(--sw) * -1.06) 0 0 calc(var(--sw) * -0.7);
  transform: translate3d(calc(var(--dir) * 140px), 24px, -180px) rotateY(calc(var(--dir) * -26deg));
}
.slide-watch {
  z-index: 2;
  width: calc(var(--sw) * 0.6);
  /* Over the phone's bottom-right corner, covering only its edge. */
  margin: calc(var(--sw) * 0.2) 0 0 calc(var(--sw) * 0.12);
  transform: translate3d(calc(var(--dir) * 180px), 40px, -120px) rotateY(calc(var(--dir) * -30deg));
}
.stage-slide.is-active .slide-phone,
.stage-slide.is-active .slide-watch { opacity: 1; transform: none; }
.stage-slide.is-active .slide-phone { transition-delay: .08s; }
.stage-slide.is-active .slide-watch { transition-delay: .2s; }
.stage-slide.is-leaving .slide-phone {
  transform: translate3d(calc(var(--dir) * -150px), -12px, -200px) rotateY(calc(var(--dir) * 24deg));
}
.stage-slide.is-leaving .slide-watch {
  transform: translate3d(calc(var(--dir) * -170px), 20px, -160px) rotateY(calc(var(--dir) * 26deg));
  transition-duration: .8s, .4s;
}
/* Waiting slides jump straight to their start position (they are invisible),
   so a change of direction never drags the next slide in from the wrong side. */
.stage-slide:not(.is-active):not(.is-leaving) .slide-phone,
.stage-slide:not(.is-active):not(.is-leaving) .slide-watch { transition: none; }

.showcase-list { display: flex; flex-direction: column; gap: 6px; }
.sl-item {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: baseline;
  width: 100%;
  padding: 13px 20px 15px 16px;
  font: inherit;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 18px;
  cursor: pointer;
  transition: background .4s ease, border-color .4s ease;
}
.sl-index {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--faint);
  transition: color .4s;
}
.sl-title {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  line-height: 1.15;
  color: var(--faint);
  transition: color .4s;
}
.sl-blurb {
  grid-column: 2;
  display: block;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  transition: max-height .6s var(--ease-out), opacity .5s ease, margin .5s var(--ease-out);
}
.sl-bar {
  grid-column: 2;
  display: block;
  height: 2px;
  margin-top: 0;
  border-radius: 2px;
  background: transparent;
  overflow: hidden;
  transition: margin .5s var(--ease-out), background .4s;
}
.sl-bar i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--moonlight), var(--gold));
  transform: scaleX(0);
  transform-origin: left center;
}

.sl-item.is-active { background: var(--card); border-color: var(--hairline); }
.sl-item.is-active .sl-title { color: var(--ink); }
.sl-item.is-active .sl-index { color: var(--gold); }
.sl-item.is-active .sl-blurb { max-height: 7em; opacity: 1; margin-top: 8px; }
.sl-item.is-active .sl-bar { margin-top: 16px; background: var(--hairline); }
/* The bar fills as you scroll through the feature (--p, 0..1, from /home.js). */
.sl-item.is-active .sl-bar i { transform: scaleX(var(--p, 0)); }
@media (hover: hover) {
  .sl-item:not(.is-active):hover .sl-title { color: var(--soft); }
}

@media (max-width: 900px) {
  .showcase { padding-left: 0; padding-right: 0; }
  .showcase-track { --step: 60svh; }
  .showcase-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "stage" "list";
    gap: 18px;
  }
  .showcase-side { display: contents; }
  .showcase-head { padding: 0 20px; }
  .showcase-stage { grid-area: stage; }
  .showcase-list { grid-area: list; }
  .showcase-head h2 { font-size: clamp(2.3rem, 10vw, 3.4rem); }
  .showcase-stage { --sw: min(50vw, calc((100svh - 330px) / 2.12), 270px); min-height: calc(var(--sw) * 2.12 + 20px); }

  /* The list becomes a swipeable row of cards under the phone. */
  .showcase-list {
    flex-direction: row;
    gap: 10px;
    padding: 2px 20px 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 20px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .showcase-list::-webkit-scrollbar { display: none; }
  .sl-item {
    flex: 0 0 min(80vw, 340px);
    scroll-snap-align: center;
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 16px 18px 16px 14px;
    background: var(--card);
    border-color: var(--hairline);
  }
  .sl-title { font-size: 1.35rem; color: var(--muted); }
  .sl-blurb { max-height: none; opacity: .6; margin-top: 6px; font-size: 14.5px; }
  .sl-bar { margin-top: 14px; background: var(--hairline); }
  .sl-item.is-active { background: var(--card-strong); border-color: var(--card-border); }
  .sl-item.is-active .sl-blurb { max-height: none; margin-top: 6px; }
  .sl-item.is-active .sl-bar { margin-top: 14px; }
}

/* ------------------------------------------------------------- watch band */
.wrist {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 100px) 20px clamp(20px, 5vh, 60px);
}
.wrist .section-head { margin-bottom: clamp(10px, 3vh, 30px); }
.wrist .section-head h2 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); }
.wrist-sub { max-width: 32em; margin: 18px auto 0; color: var(--muted); font-size: clamp(15.5px, 1.25vw, 17.5px); }
.wrist-art {
  position: relative;
  /* Melt the photo's edges into the page so it reads as part of the sky. */
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 58%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 58%, transparent 100%);
}
.wrist-art img { width: 100%; height: auto; }
@media (max-width: 700px) {
  .wrist { padding-left: 0; padding-right: 0; }
  .wrist .section-head { padding: 0 20px; }
  .wrist-art {
    width: 150%;
    margin-left: -25%;
    -webkit-mask-image: radial-gradient(ellipse 42% 50% at 50% 50%, #000 55%, transparent 100%);
    mask-image: radial-gradient(ellipse 42% 50% at 50% 50%, #000 55%, transparent 100%);
  }
}

/* ---------------------------------------------------------------- values */
.values {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(30px, 6vh, 70px) 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.value {
  padding: 30px 28px 28px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(232, 230, 240, 0.05), rgba(232, 230, 240, 0.02));
  border: 1px solid var(--hairline);
}
.value svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--moonlight);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.value h3 { margin: 20px 0 8px; font-size: 1.7rem; }
.value p { color: var(--muted); font-size: 15px; line-height: 1.6; }

@media (max-width: 820px) {
  .values { grid-template-columns: 1fr; gap: 10px; padding-left: 16px; padding-right: 16px; }
  .value {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    column-gap: 16px;
    padding: 20px 20px 20px 18px;
  }
  .value svg { grid-row: span 2; width: 30px; height: 30px; margin-top: 3px; }
  .value h3 { margin: 0 0 4px; font-size: 1.45rem; }
  .value p { font-size: 14.5px; }
}

/* --------------------------------------------------------------- devices
   A plain grid of the wearables that sync to Apple Health. */
.devices {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(70px, 12vh, 140px) 24px clamp(40px, 8vh, 90px);
}
.devices .section-head { margin-bottom: clamp(30px, 5vh, 56px); }
.devices-sub { max-width: 34em; margin: 18px auto 0; color: var(--muted); font-size: clamp(15.5px, 1.25vw, 17.5px); }

.flow { position: relative; }
.flow-trails {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.brand-grid {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 16px;
}
.brand-tile {
  position: relative;
  transition: transform .5s var(--ease-out), filter .5s var(--ease-out);
}
.brand-tile picture, .brand-tile img { display: block; width: 100%; height: auto; }
/* The reveal sets its own transform; hover only lifts once it has played. */
html.js .brand-tile[data-reveal].is-in { transition: opacity .9s var(--ease-out), transform .5s var(--ease-out), filter .5s var(--ease-out); transition-delay: 0s; }
@media (hover: hover) {
  .brand-tile:hover, html.js .brand-tile[data-reveal].is-in:hover {
    transform: translateY(-4px) scale(1.025);
    filter: brightness(1.12) drop-shadow(0 14px 30px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 26px rgba(143, 184, 255, 0.16));
  }
}

/* Apple Health, then Step Step: where the trails from the tiles end up. */
.flow-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.flow-hub { margin-top: clamp(120px, 16vh, 180px); }
.flow-sink { margin-top: clamp(90px, 12vh, 130px); }
.flow-tile {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 22%;
  transition: transform .35s var(--ease-out), box-shadow .6s var(--ease-out);
}
.flow-health { box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); }
.flow-app { width: 96px; height: 96px; box-shadow: 0 0 0 1px rgba(232, 230, 240, 0.08), 0 20px 60px rgba(66, 92, 180, 0.45); }
.flow-node.is-pulse .flow-tile { transform: scale(1.06); }
.flow-hub.is-pulse .flow-health { box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), 0 0 50px rgba(255, 120, 150, 0.35); }
/* Step Step doesn't pulse: a soft halo breathes behind it, and swells with
   --charge (0..1) as stars arrive. /trails.js draws the orbiting stars. */
.flow-sink::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 230px;
  height: 230px;
  margin: -67px 0 0 -115px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 220, 160, 0.34) 0%, rgba(120, 140, 230, 0.22) 38%, transparent 68%);
  opacity: calc(0.35 + var(--charge, 0) * 0.65);
  pointer-events: none;
  animation: halo-breathe 5.5s ease-in-out infinite;
  transition: opacity 1.2s ease;
}
.flow-sink .flow-app {
  position: relative;
  box-shadow: 0 0 0 1px rgba(232, 230, 240, 0.1), 0 20px 60px rgba(66, 92, 180, 0.45), 0 0 calc(30px + var(--charge, 0) * 50px) rgba(242, 220, 160, calc(0.1 + var(--charge, 0) * 0.25));
}
.flow-sink .flow-label { left: calc(50% + 136px); }
@keyframes halo-breathe {
  0%, 100% { transform: scale(0.92); }
  50% { transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) { .flow-sink::before { animation: none; } }
/* Labels sit beside the tiles, clear of the stream running between them. */
.flow-label {
  position: absolute;
  left: calc(50% + 62px);
  top: 50%;
  translate: 0 -50%;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.flow-hub .flow-label { left: calc(50% + 52px); }

.devices-note { margin: 28px auto 0; max-width: 46em; text-align: center; color: var(--faint); font-size: 13px; }

@media (max-width: 820px) {
  .devices { padding-left: 16px; padding-right: 16px; }
  /* Smaller tiles and tighter gaps, so the tiles, Apple Health and Step Step
     all fit on one phone screen. */
  .brand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 300px; margin: 0 auto; }
  .flow-hub { margin-top: 64px; }
  .flow-sink { margin-top: 52px; }
  .flow-health { width: 56px; height: 56px; }
  .flow-app { width: 72px; height: 72px; }
  .flow-label { left: calc(50% + 54px); font-size: 10px; }
  .flow-hub .flow-label { left: calc(50% + 44px); }
  .flow-sink::before { width: 180px; height: 180px; margin: -54px 0 0 -90px; }
  .flow-sink .flow-label { left: calc(50% + 104px); }
}

/* --------------------------------------------------------------- privacy
   The Step Step ring as a vault: health data floats inside it, the things
   other apps let in drift away outside, and a lock closes the ring's gap. */
.privacy {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(30px, 6vh, 70px) 24px clamp(60px, 10vh, 110px);
}
.privacy-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(40px, 6vw, 72px);
  border-radius: 36px;
  background:
    radial-gradient(60% 70% at 78% 40%, rgba(66, 92, 180, 0.32), transparent 70%),
    radial-gradient(40% 50% at 10% 100%, rgba(242, 220, 160, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(232, 230, 240, 0.045), rgba(232, 230, 240, 0.015));
  border: 1px solid var(--hairline);
  overflow: hidden;
}
.privacy-copy h2 {
  margin-top: 14px;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
}
.privacy-sub { max-width: 28em; margin-top: 18px; color: var(--muted); font-size: clamp(15.5px, 1.25vw, 17.5px); }
.privacy-link {
  display: inline-block;
  margin-top: 22px;
  color: var(--gold);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.privacy-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.vault {
  position: relative;
  width: min(440px, 100%);
  aspect-ratio: 1;
  justify-self: center;
}
.vault-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.vault-arc { fill: none; stroke: url(#vault-grad); stroke-width: 22; stroke-linecap: round; }
.vault-arc-glow { stroke-width: 30; opacity: .55; }
.vault-lock rect, .vault-lock path, .vault-lock circle {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vault-lock circle { fill: var(--gold); stroke: none; }

.vault-in, .vault-out { list-style: none; margin: 0; padding: 0; }
.vault-in {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.vault-in li {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 2.3vw, 1.75rem);
  line-height: 1.2;
  color: var(--moonlight);
  animation: vault-float 6s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -1.3s);
}
.vault-in li:nth-child(odd) { color: #D6DEFF; }
.vault-out li {
  position: absolute;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: .9;
  animation: vault-drift 7s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -1.7s);
}
.vault-out s { text-decoration-color: rgba(242, 220, 160, 0.55); text-decoration-thickness: 1px; }
.vault-out li:nth-child(1) { left: -2%; top: 6%; --dx: -8px; --dy: -6px; }
.vault-out li:nth-child(2) { right: -2%; top: 10%; --dx: 8px; --dy: -6px; }
.vault-out li:nth-child(3) { left: -8%; top: 54%; --dx: -10px; --dy: 0px; }
.vault-out li:nth-child(4) { right: -8%; top: 62%; --dx: 10px; --dy: 2px; }
.vault-out li:nth-child(5) { left: 2%; bottom: 2%; --dx: -6px; --dy: 8px; }
@keyframes vault-float { from { transform: translateY(-3px); } to { transform: translateY(3px); } }
@keyframes vault-drift { from { transform: none; opacity: .85; } to { transform: translate(var(--dx), var(--dy)); opacity: .45; } }

.privacy-facts {
  grid-column: 1 / -1;
  list-style: none;
  margin: 0;
  padding: clamp(24px, 4vh, 36px) 0 0;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.privacy-facts svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--moonlight);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.privacy-facts h3 { margin: 14px 0 6px; font-size: 1.35rem; }
.privacy-facts p { color: var(--muted); font-size: 14.5px; line-height: 1.55; }

@media (max-width: 960px) {
  .privacy-card { grid-template-columns: 1fr; text-align: center; }
  .privacy-sub { margin-left: auto; margin-right: auto; }
  .vault { width: min(400px, 88%); }
  .privacy-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); text-align: left; }
}
@media (max-width: 560px) {
  .privacy { padding-left: 12px; padding-right: 12px; }
  .privacy-card { padding: 36px 20px 28px; border-radius: 28px; }
  /* No room around the ring, so the kept-out list sits underneath it. */
  .vault { margin-bottom: 64px; }
  .vault-out {
    position: absolute;
    left: 50%;
    top: 100%;
    width: 120%;
    translate: -50% 4px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
  }
  .vault-out li { position: static; font-size: 11px; letter-spacing: 0.1em; animation: none; }
  .privacy-facts { grid-template-columns: 1fr; gap: 18px; }
  .privacy-facts li { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 14px; }
  .privacy-facts svg { grid-row: span 2; margin-top: 2px; }
  .privacy-facts h3 { margin: 0 0 4px; }
}

/* --------------------------------------------------------------- reviews */
.reviews { padding: clamp(60px, 10vh, 120px) 0 clamp(30px, 6vh, 60px); }
.reviews .section-head { padding: 0 24px; margin-bottom: clamp(30px, 5vh, 48px); }
.reviews .section-head h2 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); }
.rating-big { display: inline-flex; align-items: center; gap: 14px; }
.rating-num { font-family: var(--serif); font-size: clamp(3rem, 6vw, 4.2rem); line-height: 1; }
.rating-big .stars svg { width: 20px; height: 20px; }

.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.marquee-track {
  display: flex;
  gap: 14px;
  width: max-content;
  padding: 6px 0;
  animation: marquee 70s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.review {
  width: clamp(268px, 27vw, 360px);
  padding: 22px 24px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
}
.review .stars svg { width: 12px; height: 12px; }
.review blockquote {
  flex: 1;
  margin: 14px 0 16px;
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.3;
  color: var(--ink);
}
.review figcaption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--faint);
}

@media (prefers-reduced-motion: reduce) {
  .marquee { overflow-x: auto; }
  .marquee-track { animation: none; }
}

/* ---------------------------------------------------------------- finale */
canvas.flock {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}
.finale {
  position: relative;
  min-height: clamp(600px, 96svh, 900px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 24px clamp(60px, 11vh, 120px);
  text-align: center;
}
.finale-copy { position: relative; z-index: 2; pointer-events: none; }
.finale-copy .appstore-badge { pointer-events: auto; margin-top: 28px; }
.finale h2 { font-size: clamp(2.7rem, 7vw, 5.4rem); line-height: 0.96; letter-spacing: -0.03em; }
.finale-copy p { margin-top: 16px; color: var(--muted); font-size: 16.5px; }

/* The readout inside the star ring: counts up to the goal, then the pill
   pops and confetti bursts. Position and size come from the ring itself via
   --cx / --cy / --r (px), set by home.js from flock.js's layout event. */
.ring-readout {
  --r: 140px;
  position: absolute;
  left: var(--cx, 50%);
  top: var(--cy, 32%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -46%) scale(.94);
  transition: opacity 1s ease, transform 1.2s var(--ease-out);
}
.ring-readout.is-shown { opacity: 1; transform: translate(-50%, -50%); }
.ring-readout::before {
  /* A soft bloom that flares when the goal is hit. */
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--r) * 2.3);
  height: calc(var(--r) * 2.3);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(.7);
  background: radial-gradient(closest-side, rgba(242, 220, 160, 0.28), rgba(143, 184, 255, 0.1) 55%, transparent);
  opacity: 0;
  z-index: -1;
}
.ring-readout.is-hit::before { animation: goal-bloom 2.4s var(--ease-out) forwards; }
.rr-label {
  font-size: max(11px, calc(var(--r) * 0.085));
  font-weight: 500;
  color: var(--soft);
  letter-spacing: 0.01em;
}
.rr-count {
  margin-top: calc(var(--r) * 0.02);
  font-family: var(--serif);
  font-size: calc(var(--r) * 0.44);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
  text-shadow: 0 0 calc(var(--r) * 0.18) rgba(214, 222, 255, 0.35);
  transition: color .6s ease, text-shadow .6s ease;
}
.ring-readout.is-hit .rr-count {
  color: #fff;
  text-shadow: 0 0 calc(var(--r) * 0.22) rgba(242, 220, 160, 0.45);
}
.rr-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: calc(var(--r) * 0.07);
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  font: 600 max(10px, calc(var(--r) * 0.07))/1 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0B0E17;
  background: var(--moonlight);
  box-shadow: 0 6px 24px rgba(242, 220, 160, 0.25);
  opacity: 0;
  transform: translateY(8px) scale(.6);
}
.rr-pill svg {
  width: 1.35em;
  height: 1.35em;
  fill: #0B0E17;
  stroke: var(--moonlight);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rr-pill svg circle { stroke: none; }
.ring-readout.is-hit .rr-pill { animation: pill-pop .7s cubic-bezier(.3, 1.6, .5, 1) forwards; }

canvas.confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

@keyframes goal-bloom {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  100% { opacity: .45; transform: translate(-50%, -50%) scale(1); }
}
@keyframes pill-pop {
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ keyframes */
@keyframes line-rise {
  from { transform: translate3d(0, 105%, 0); }
  to { transform: none; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to { opacity: 1; transform: none; }
}
@keyframes phone-in {
  from { opacity: 0; transform: translate3d(0, 110px, 0) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes halo-draw { to { stroke-dashoffset: 0; } }
@keyframes halo-breathe { 50% { opacity: .3; } }
@keyframes marquee { to { transform: translate3d(calc(-50% - 7px), 0, 0); } }

@media (prefers-reduced-motion: reduce) {
  .halo-arc { stroke-dashoffset: 0; }
}
