/* Bloom — home page */

/* === Sections ======================================================== */
.section { padding-block: 112px; }
.section--blush { background: var(--blush-cream); }

.section__title {
  font-size: clamp(30px, 3.5vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.section__intro {
  max-width: 34em;
  margin-top: 16px;
  font-size: 19px;
  line-height: 1.6;
}

/* === Hero ============================================================ */
.hero { padding-block: 48px 104px; }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 72px;
  align-items: center;
}

.hero__title {
  font-size: clamp(36px, 4.7vw, 66px);
  line-height: 1.05;
  letter-spacing: -0.024em;
}

.hero__title span { display: block; }

.hero__lede {
  max-width: 30em;
  margin-top: 24px;
  font-size: 20px;
  line-height: 1.6;
}

.hero .store-links { margin-top: 36px; }

.hero__note {
  margin-top: 16px;
  font-size: 15px;
  color: var(--text-muted);
}

/* === Timelapse player and growth ruler =============================== */
.timelapse {
  --p: 0;
  width: 100%;
  max-width: 470px;
  justify-self: end;
}

.timelapse__frame {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-photo);
  background: var(--blush-cream);
  box-shadow: var(--shadow-photo);
}

.timelapse__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timelapse__age,
.timelapse__toggle {
  position: absolute;
  bottom: 16px;
  color: #fff;
  background: rgba(51, 38, 30, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.timelapse__age {
  left: 16px;
  padding: 5px 14px 6px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.timelapse__toggle {
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.timelapse__toggle:hover { background: rgba(51, 38, 30, 0.8); }
.timelapse__toggle:focus-visible { outline-color: #fff; border-radius: 50%; }
.timelapse__toggle svg { width: 18px; height: 18px; fill: currentColor; }
.timelapse__toggle .icon-play { display: none; margin-left: 2px; }
.timelapse.is-paused .timelapse__toggle .icon-play { display: block; }
.timelapse.is-paused .timelapse__toggle .icon-pause { display: none; }

.ruler {
  --thumb: 28px;
  --inset: 22px;
  --baseline: 68px;
  position: relative;
  height: 112px;
  margin-top: 20px;
}

.ruler__scale {
  position: absolute;
  inset: 0 var(--inset);
}

/* One small tick per year, age 1 to 18. */
.ruler__scale::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--baseline);
  width: calc(100% + 1px);
  height: 6px;
  background: repeating-linear-gradient(
    to right,
    rgba(107, 90, 82, 0.5) 0 1px,
    transparent 1px calc((100% - 1px) / 17)
  );
}

.ruler__line,
.ruler__progress {
  position: absolute;
  left: 0;
  top: var(--baseline);
  height: 1px;
  width: 100%;
  background: rgba(107, 90, 82, 0.5);
}

.ruler__progress {
  top: calc(var(--baseline) - 1px);
  height: 3px;
  width: calc(var(--p) * 100%);
  border-radius: 2px;
  background: var(--clay-rose);
}

.ruler__mark {
  position: absolute;
  left: calc(var(--f) * 100%);
  top: 0;
  width: 0;
  height: 100%;
}

.ruler__mark::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--baseline);
  width: 1px;
  height: 12px;
  background: var(--text-secondary);
}

.ruler__photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid var(--warm-white);
  border-radius: 50%;
  overflow: hidden;
  transform: translateX(-50%);
  background: var(--blush-cream);
  box-shadow: 0 0 0 1px var(--hairline), 0 6px 12px -6px rgba(58, 47, 47, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.ruler__photo:hover { transform: translateX(-50%) scale(1.08); }
.ruler__photo:focus-visible { border-radius: 50%; }
.ruler__photo img { width: 100%; height: 100%; object-fit: cover; }

.ruler__label {
  position: absolute;
  top: calc(var(--baseline) + 18px);
  left: 0;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 100, 'WONK' 0;
  font-variant-numeric: oldstyle-nums;
  font-size: 17px;
  line-height: 1.2;
  color: var(--text-secondary);
  white-space: nowrap;
}

.ruler__input {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: calc(var(--baseline) - 22px);
  left: calc(var(--inset) - var(--thumb) / 2);
  width: calc(100% - 2 * (var(--inset) - var(--thumb) / 2));
  height: 44px;
  margin: 0;
  background: none;
  cursor: grab;
  touch-action: pan-y;
}

.ruler__input:active { cursor: grabbing; }
.ruler__input:focus { outline: none; }

.ruler__input::-webkit-slider-runnable-track { height: 44px; background: none; }
.ruler__input::-moz-range-track { height: 44px; background: none; }

.ruler__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  box-sizing: border-box;
  width: var(--thumb);
  height: var(--thumb);
  margin-top: 8px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--clay-rose);
  box-shadow: 0 0 0 1px rgba(58, 47, 47, 0.12), 0 4px 10px rgba(58, 47, 47, 0.3);
}

.ruler__input::-moz-range-thumb {
  box-sizing: border-box;
  width: var(--thumb);
  height: var(--thumb);
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--clay-rose);
  box-shadow: 0 0 0 1px rgba(58, 47, 47, 0.12), 0 4px 10px rgba(58, 47, 47, 0.3);
}

.ruler__input:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--clay-deep); outline-offset: 3px; }
.ruler__input:focus-visible::-moz-range-thumb { outline: 2px solid var(--clay-deep); outline-offset: 3px; }

.timelapse__caption {
  margin-top: 6px;
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
}

/* === How it works ==================================================== */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px;
  margin-top: 64px;
  counter-reset: step;
}

.step { counter-increment: step; }

.step__visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
}

.step__title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 28px;
  font-size: 25px;
  line-height: 1.2;
}

.step__title::before {
  content: counter(step);
  flex: none;
  font-variant-numeric: oldstyle-nums;
  color: var(--clay-red);
}

.step__text {
  margin-top: 10px;
  padding-left: calc(12px + 0.62em * 25 / 17);
}

/* 1 — the snapshot, as taken */
.snapshot {
  position: relative;
  width: 60%;
  overflow: hidden;
  border: 7px solid #fff;
  border-radius: 16px;
  transform: rotate(-2.5deg);
  box-shadow: var(--shadow-photo);
}

.snapshot img { width: 100%; }

/* where Bloom finds the face */
.snapshot__face {
  position: absolute;
  left: 20.4%;
  top: 30.7%;
  width: 59.5%;
  height: 37.8%;
  border: 2px solid #fff;
  border-radius: 12px;
  box-shadow: 0 0 0 999px rgba(58, 47, 47, 0.24);
}

/* 2 — the aligned crop */
.aligned {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-photo);
  box-shadow: var(--shadow-photo);
}

.aligned img { width: 100%; }

.aligned__eyes {
  position: absolute;
  left: 0;
  top: 51%;
  width: 100%;
  border-top: 1.5px dashed rgba(255, 255, 255, 0.85);
}

.aligned__eyes::before,
.aligned__eyes::after {
  content: '';
  position: absolute;
  top: -11px;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  border: 2px solid #fff;
  border-radius: 50%;
}

.aligned__eyes::before { left: 39.7%; }
.aligned__eyes::after { left: 60.3%; }

/* 3 — frames, one per photo (a 4 × 4 sprite) */
.frames {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.frames span {
  aspect-ratio: 1;
  border-radius: 12px;
  background-image: url('assets/img/frames-4x4.webp');
  background-size: 400% 400%;
  background-position: calc(var(--x) * 100% / 3) calc(var(--y) * 100% / 3);
}

/* === The app ========================================================= */
.phones {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 64px;
  margin-top: 72px;
}

.phone {
  flex: none;
  width: 264px;
}

.phone:nth-child(2) { margin-top: 48px; }

.phone__body {
  position: relative;
  padding: 7px;
  border-radius: 40px;
  background: var(--warm-charcoal);
  box-shadow: var(--shadow-photo);
}

.phone__body::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  width: 29%;
  height: 20px;
  border-radius: 12px;
  background: #1f1716;
  transform: translateX(-50%);
}

.phone__body img {
  width: 100%;
  border-radius: 33px;
}

.phone__caption {
  margin-top: 22px;
  padding-inline: 6px;
  font-size: 16px;
  line-height: 1.5;
}

.phone__caption strong {
  display: block;
  margin-bottom: 2px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px;
  margin-top: 96px;
}

.feature {
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}

.feature__title { font-size: 22px; line-height: 1.25; }

.feature__text {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.6;
}

.plan-tag {
  display: inline-block;
  margin-top: 14px;
  padding: 3px 12px 4px;
  border-radius: 999px;
  background: rgba(196, 125, 94, 0.14);
  color: var(--clay-deep);
  font-size: 13px;
  font-weight: 600;
}

/* === Privacy ========================================================= */
.privacy__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 88px;
  align-items: start;
}

.privacy__more { margin-top: 28px; }

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 44px 48px;
}

.fact__icon {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--clay-red);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fact__title { margin-top: 14px; font-size: 22px; line-height: 1.25; }
.fact__text { margin-top: 6px; font-size: 16px; line-height: 1.6; }

/* === Closing ========================================================= */
.closing {
  padding-block: 120px;
  background: var(--warm-charcoal);
  color: var(--peach-on-dark);
}

.closing :focus-visible { outline-color: var(--peach-on-dark); }

.closing__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 72px;
  align-items: center;
}

.closing__title {
  font-size: clamp(36px, 4.4vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--light-on-dark);
}

.closing__lede {
  max-width: 28em;
  margin-top: 18px;
  font-size: 20px;
  line-height: 1.6;
}

.closing .store-links { margin-top: 36px; }
.closing .store-other { color: var(--peach-on-dark); }
.closing .text-link { color: var(--light-on-dark); }
.closing .store-badge img { outline: 1px solid rgba(255, 255, 255, 0.28); outline-offset: -1px; border-radius: 9px; }

.closing__note {
  max-width: 40em;
  margin-top: 24px;
  font-size: 15px;
  color: rgba(232, 196, 160, 0.82);
}

.qr {
  width: 184px;
  padding: 18px 18px 14px;
  border-radius: var(--radius-card);
  background: var(--warm-white);
}

.qr img { width: 100%; }

.qr figcaption {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  color: var(--text-secondary);
}

/* A phone can open the store itself; the code is for computers. */
[data-os='ios'] .qr,
[data-os='android'] .qr { display: none; }

/* === Tablet ========================================================== */
@media (max-width: 1080px) {
  .hero__grid { gap: 48px; }
  .phones { gap: 32px; }
  .phone { width: 232px; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 48px; }
  .privacy__grid { grid-template-columns: 1fr; gap: 56px; }
  .steps { gap: 36px; }
}

/* === Phone =========================================================== */
@media (max-width: 760px) {
  .section { padding-block: 72px; }
  .section__intro { font-size: 18px; }

  .hero { padding-block: 20px 64px; }

  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  /* Headline, then the timelapse, then the rest of the copy. */
  .hero__copy { display: contents; }
  .hero__title { order: 1; font-size: clamp(31px, 9vw, 40px); }
  .timelapse { order: 2; max-width: none; margin-top: 24px; justify-self: stretch; }
  .hero__lede { order: 3; margin-top: 20px; font-size: 18px; }
  .hero .store-links { order: 4; margin-top: 24px; }
  .hero__note { order: 5; margin-top: 14px; }

  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
    margin-top: 48px;
  }

  .step__visual { max-width: 340px; margin-inline: auto; }
  .step:first-child .step__visual { aspect-ratio: auto; padding-block: 8px 16px; }
  .snapshot { width: 56%; }
  .step__title { font-size: 24px; }

  /* Screens become a swipeable row; the next phone peeks in to show there is more. */
  .phones {
    justify-content: flex-start;
    gap: 20px;
    margin-top: 48px;
    margin-inline: calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 32px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }

  .phones::-webkit-scrollbar { display: none; }
  .phone { width: 236px; scroll-snap-align: start; }
  .phone:nth-child(2) { margin-top: 0; }

  .features {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    margin-top: 40px;
  }

  .facts { grid-template-columns: minmax(0, 1fr); gap: 36px; }

  .closing { padding-block: 80px; }
  .closing__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .closing__lede { font-size: 18px; }
  .qr { display: none; }
}
