/* HerSpace landing page. Tokens mirror src/shared/ui/tokens.ts */
:root {
  --background: #FFF9F7;
  --surface: #FFFFFF;
  --ink-secondary: #3B3845;
  --muted: #67646F;
  --faint: #85828E;
  --border: rgba(23, 23, 25, 0.09);
  --blush: #F6DDF1;
  --blush-soft: #FDF0F6;
  --powder: #D8F2FB;
  --peach: #FFDCCB;
  --salmon-light: #FCEBE6;
  --lilac: #B8B8EE;
  --lilac-soft: #E9E8FB;
  --mint: #BFEDE5;
  --periwinkle: #5F61C4;
  --track: #EEEAF3;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;

  --radius-tile: 28px;
  --radius-hero: 40px;
  --ease-spring: cubic-bezier(.22, 1, .36, 1);
  /* A damped spring that swings about 4% past its target and settles. Browsers without linear() keep --ease-spring */
  --spring: linear(0, 0.055 3.1%, 0.182 6.2%, 0.340 9.4%, 0.500 12.5%, 0.646 15.6%, 0.768 18.8%, 0.864 21.9%, 0.935 25%, 0.983 28.1%, 1.014 31.2%, 1.031 34.4%, 1.038 37.5%, 1.038 40.6%, 1.034 43.8%, 1.029 46.9%, 1.023 50%, 1.017 53.1%, 1.011 56.2%, 1.007 59.4%, 1.004 62.5%, 1.002 65.6%, 1 68.8%, 0.999 75%, 0.999 90.6%, 1);
  --shadow-soft: 0 1px 2px rgba(23, 23, 25, .04), 0 12px 40px -12px rgba(23, 23, 25, .12);
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--ink-secondary);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
.serif { font-family: var(--serif); font-weight: 400; }

.container { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: clamp(80px, 11vw, 150px); }
.center { display: flex; justify-content: center; margin-top: 48px; }
.center-text { text-align: center; }
.narrow-col { max-width: 760px; }

.display {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.lead {
  font-size: clamp(16px, 1.3vw, 18px);
  color: var(--ink-secondary);
  max-width: 470px;
  text-wrap: pretty;
}
.lead.narrow { max-width: 380px; margin-top: 16px; }
.center-text .lead, .lead.center-text { margin: 16px auto 0; }

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
}
/* Centre each label on its capital letters rather than Manrope's line box, which sits it up to a pixel off */
.btn-label { display: block; text-box: trim-both cap alphabetic; }
.btn-ink { background: var(--ink-secondary); color: #fff; }
/* Buttons dim like a pressed button in the app (usePressMotion): 82% opacity, in over 90ms, back over 140ms. They never move */
.btn, .nav-cta, .store-btn { transition: opacity .14s ease-out; }
:is(.btn, .nav-cta, .store-btn):hover { opacity: .82; transition-duration: .09s; }
.btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--periwinkle);
  outline-offset: 3px;
}

/* ---------- Phone mockup ---------- */
/* Screens sit on the page frameless, with the iPhone's own corner radius */
.phone {
  margin: 0;
  position: relative;
  aspect-ratio: 1320 / 2868;
  border-radius: 12.5% / 5.75%;
  overflow: hidden;
  background: var(--background);
  border: 1px solid var(--border);
  box-shadow: 0 24px 50px -24px rgba(80, 30, 60, .28), 0 4px 12px -6px rgba(23, 23, 25, .08);
}
.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 16px var(--gutter) auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
/* The app icon beside the HerSpace wordmark, the same mark the footer shows */
.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
}
.nav-logo img { width: 30px; height: 30px; border-radius: 9px; }
.nav-logo .nav-wordmark { width: 105px; height: auto; border-radius: 0; }
.nav-links {
  position: absolute;
  left: 50%;
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  transform: translateX(-50%);
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-secondary);
  transition: background .25s, color .25s;
}
.nav-links a:hover { background: var(--blush-soft); color: var(--ink-secondary); }
.nav-cta {
  height: 46px;
  display: inline-flex;
  align-items: center;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--ink-secondary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.nav-burger {
  position: absolute;
  right: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--border);
  display: none;
  place-content: center;
  gap: 5px;
}
.nav-burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink-secondary); transition: transform .35s var(--ease-spring); }
.nav-burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }


.mobile-menu {
  position: fixed;
  inset: 74px var(--gutter) auto;
  z-index: 49;
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  animation: menuIn .45s var(--ease-spring);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a:not(.btn) { padding: 12px 14px; border-radius: 14px; font-weight: 700; }
.mobile-menu a:not(.btn):hover { background: var(--blush-soft); }
.mobile-menu .btn { margin-top: 6px; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-10px) scale(.98); } }

/* ---------- Load-in animations ---------- */
[data-appear] { opacity: 0; transform: translateY(-24px); }
[data-appear-up] { opacity: 0; transform: translateY(64px); }
.is-loaded [data-appear],
.is-loaded [data-appear-up] {
  opacity: 1;
  transform: none;
  transition: opacity .9s var(--ease-spring) var(--d, 0s), transform 1.1s var(--ease-spring) var(--d, 0s);
}

.hero-title .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(.35em);
  filter: blur(8px);
  transition:
    opacity .7s var(--ease-spring),
    transform .9s var(--ease-spring),
    filter .7s var(--ease-spring);
  transition-delay: calc(.15s + var(--ci) * 22ms);
}
.is-loaded .hero-title .char { opacity: 1; transform: none; filter: blur(0); }
.hero-title .word { display: inline-block; white-space: nowrap; }

[data-reveal] {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .9s var(--ease-spring) var(--d, 0s), transform 1.1s var(--ease-spring) var(--d, 0s);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero { padding: 0 10px; }
.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 0 0 var(--radius-hero) var(--radius-hero);
  background: linear-gradient(180deg, var(--background) 0%, #FDEDF1 38%, #F9DCE8 100%);
  padding-top: clamp(120px, 15vh, 150px);
  text-align: center;
}
.hero-wash {
  position: absolute;
  inset: -20% -10% auto;
  height: 80%;
  background:
    radial-gradient(40% 50% at 22% 40%, rgba(216, 242, 251, .7), transparent 70%),
    radial-gradient(35% 45% at 80% 30%, rgba(233, 232, 251, .9), transparent 70%),
    radial-gradient(30% 40% at 55% 70%, rgba(255, 220, 203, .55), transparent 70%);
  filter: blur(30px);
  pointer-events: none;
  animation: washDrift 18s ease-in-out infinite alternate;
}
@keyframes washDrift {
  to { transform: translate3d(3%, 4%, 0) scale(1.05); }
}
.hero-copy { position: relative; z-index: 2; padding-inline: var(--gutter); }
.hero-title {
  margin: 22px auto 18px;
  font-weight: 700;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.hero-title .line { display: block; }
.hero-title .line:last-child { color: var(--ink-secondary); }
.hero-sub {
  max-width: 520px;
  margin: 0 auto 28px;
  font-size: clamp(16px, 1.4vw, 18px);
  color: var(--ink-secondary);
  text-wrap: pretty;
}
.hero-stage {
  position: relative;
  z-index: 1;
  height: clamp(440px, 58vw, 660px);
  margin-top: clamp(40px, 6vw, 70px);
}
.hero-phone {
  position: absolute;
  left: 50%;
  top: 0;
  width: clamp(230px, 24vw, 320px);
  will-change: transform;
}
.hero-phone-main {
  z-index: 3;
  transform: translate3d(-50%, var(--rise, 80px), 0);
}
.hero-phone-left,
.hero-phone-right {
  z-index: 2;
  width: clamp(200px, 20vw, 270px);
  top: 70px;
  opacity: var(--side-o, .0);
}
.hero-phone-left { transform: translate3d(calc(-50% - var(--spread, 0px)), var(--side-y, 120px), 0) rotate(calc(var(--tilt, 0deg) * -1)); }
.hero-phone-right { transform: translate3d(calc(-50% + var(--spread, 0px)), var(--side-y, 120px), 0) rotate(var(--tilt, 0deg)); }

/* ---------- Intro + bento ---------- */
.split-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: clamp(40px, 5vw, 64px);
}
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}
.tile {
  position: relative;
  overflow: hidden;
  padding: 22px 24px 28px;
  border-radius: var(--radius-tile);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(23, 23, 25, .03);
  transition: box-shadow .5s var(--ease-spring), transform .5s var(--ease-spring);
}
.tile:hover { box-shadow: var(--shadow-soft); }
.tile-fan, .tile-feel, .tile-stack, .tile-notes { grid-column: span 3; }
.tile-wins { grid-column: span 2; }
.tile-phones { grid-column: span 4; }
.tile-visual {
  position: relative;
  height: 300px;
  margin: -22px -24px 22px;
  overflow: hidden;
}
.tile-title { font-size: 20px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.tile-body { color: var(--muted); font-size: 15px; max-width: 440px; }

/* Fan of screens */
.fan-visual { display: grid; place-items: center; }
.fan-card {
  position: absolute;
  top: 40px;
  width: 140px;
  aspect-ratio: 1320 / 2868;
  object-fit: cover;
  border-radius: 12.5% / 5.75%;
  border: 1px solid var(--border);
  box-shadow: 0 18px 36px -16px rgba(80, 30, 60, .3);
  transition: transform .8s var(--ease-spring);
}
.fan-1 { transform: translateX(-62px) rotate(-10deg); }
.fan-2 { transform: translateY(-6px); z-index: 2; }
.fan-3 { transform: translateX(62px) rotate(10deg); z-index: 3; }
.tile-fan:hover .fan-1 { transform: translateX(-120px) translateY(10px) rotate(-16deg); }
.tile-fan:hover .fan-2 { transform: translateY(-18px) scale(1.03); }
.tile-fan:hover .fan-3 { transform: translateX(120px) translateY(10px) rotate(16deg); }

/* Feeling selector, captured from the Today screen */
.feel-visual { background: var(--background); }
.feel-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px 8px 4px;
  transition: transform .8s var(--ease-spring);
}
.tile-feel:hover .feel-visual img { transform: scale(1.04); }

/* Small wins marquee */
.wins-visual {
  padding: 0 24px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}
.wins-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  animation: marqueeUp 22s linear infinite;
}
.tile-wins:hover .wins-track { animation-play-state: paused; }
.wins-track li {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
}
.tick {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--mint);
  position: relative;
}
.tick::after {
  content: "";
  position: absolute;
  left: 8px; top: 5px;
  width: 6px; height: 11px;
  border: solid #1E6A5B;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
@keyframes marqueeUp { to { transform: translateY(calc(-50% - 5px)); } }

/* Three phones */
.phones-visual { display: flex; justify-content: center; }
.mini-phone {
  position: absolute;
  top: 34px;
  width: 170px;
  transition: transform .8s var(--ease-spring);
}
.p-mid { z-index: 2; transform: translateY(-8px); }
.p-left { transform: translateX(-160px) translateY(26px) rotate(-6deg); }
.p-right { transform: translateX(160px) translateY(26px) rotate(6deg); }
.tile-phones:hover .p-mid { transform: translateY(-22px); }
.tile-phones:hover .p-left { transform: translateX(-196px) translateY(16px) rotate(-9deg); }
.tile-phones:hover .p-right { transform: translateX(196px) translateY(16px) rotate(9deg); }
.phones-visual::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 70px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff);
  z-index: 3;
}

/* Proof cards match ProofCard.tsx. Sizes are in --u, one app pixel, so a card can be scaled to fit its frame */
.proof-card {
  padding: calc(var(--u, 1px) * 20);
  border-radius: calc(var(--u, 1px) * 26);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
}
.proof-card > :not(.proof-art) { position: relative; }
.proof-art {
  position: absolute;
  right: calc(var(--u, 1px) * -22);
  bottom: calc(var(--u, 1px) * -22);
  width: 62%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  opacity: .18;
  pointer-events: none;
}
.proof-type { font-size: calc(var(--u, 1px) * 12); font-weight: 500; letter-spacing: calc(var(--u, 1px) * 1.4); text-transform: uppercase; color: var(--ink-secondary); }
.proof-date { margin-top: calc(var(--u, 1px) * 16); font-size: calc(var(--u, 1px) * 14); color: var(--muted); font-variant-numeric: tabular-nums; }
.proof-story { display: grid; gap: calc(var(--u, 1px) * 4); margin-top: calc(var(--u, 1px) * 24); }
.proof-title { font-size: calc(var(--u, 1px) * 14); font-weight: 700; line-height: calc(var(--u, 1px) * 19); letter-spacing: calc(var(--u, 1px) * 1.2); text-transform: uppercase; color: var(--ink-secondary); }
.proof-did { font-size: calc(var(--u, 1px) * 15); line-height: calc(var(--u, 1px) * 21); color: var(--ink-secondary); }
.proof-rule { border: 0; height: 1px; margin: calc(var(--u, 1px) * 20) 0; background: rgba(23, 23, 25, .14); }
.proof-label { font-size: calc(var(--u, 1px) * 11); font-weight: 500; letter-spacing: calc(var(--u, 1px) * 1.4); text-transform: uppercase; color: var(--ink-secondary); }
.proof-proves {
  margin-top: calc(var(--u, 1px) * 12);
  font-size: calc(var(--u, 1px) * 60);
  line-height: 1.15;
  letter-spacing: calc(var(--u, 1px) * -1);
  color: var(--ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Proof card stack. Built at the app's real size, then scaled into the tile */
.stack-visual { display: grid; place-items: center; --s: .6; }
.stack-visual .proof-card {
  position: absolute;
  top: 26px;
  width: 320px;
  /* One height for the whole deck, like the app's minHeight, sized to the tallest card */
  height: 464px;
  box-shadow: 0 24px 44px -20px rgba(80, 30, 60, .3);
  transform-origin: top center;
  transition: transform .8s var(--ease-spring);
}
.pc-1 { transform: translateX(-70px) rotate(-9deg) scale(var(--s)); }
.pc-2 { transform: translateY(-8px) rotate(2deg) scale(var(--s)); z-index: 2; }
.pc-3 { transform: translateX(72px) translateY(6px) rotate(10deg) scale(var(--s)); z-index: 3; }
.tile-stack:hover .pc-1 { transform: translateX(-130px) translateY(6px) rotate(-14deg) scale(var(--s)); }
.tile-stack:hover .pc-2 { transform: translateY(-20px) rotate(0deg) scale(var(--s)); }
.tile-stack:hover .pc-3 { transform: translateX(132px) translateY(12px) rotate(15deg) scale(var(--s)); }

/* Notifications */
.notes-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 0 28px;
}
.note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px -14px rgba(80, 30, 60, .3);
  opacity: 0;
  transform: translateY(-18px) scale(.96);
  transition: opacity .7s var(--ease-spring), transform .9s var(--ease-spring);
  transition-delay: calc(.25s + var(--n) * .35s);
}
.note:nth-child(2) { margin-left: 18px; }
.note:nth-child(3) { margin-left: 36px; }
.tile-notes.is-in .note { opacity: 1; transform: none; }

/* Calendar. The card copies ComingUpCard: rows of synced events and the moments made from them */
.tile-calendar {
  grid-column: span 6;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: center;
  gap: 40px;
  padding: 0 0 0 clamp(24px, 4vw, 48px);
}
.tile-calendar .tile-body { max-width: 400px; }
.tile-calendar .calendar-visual { margin: 0; height: auto; padding: 36px clamp(20px, 3vw, 40px); background: var(--background); }
.coming-up { display: grid; gap: 12px; max-width: 460px; margin: 0 auto; }
.coming-up-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.coming-up-head strong { font-size: 20px; line-height: 26px; font-weight: 700; }
.coming-up svg { width: 20px; height: 20px; fill: none; stroke: var(--ink-secondary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.coming-up-head svg { width: 24px; height: 24px; }
.cal-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s var(--ease-spring), transform .9s var(--ease-spring);
  transition-delay: calc(.25s + var(--n) * .18s);
}
.tile-calendar.is-in .cal-row { opacity: 1; transform: none; }
.cal-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--powder); }
.cal-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cal-copy strong { font-size: 16px; line-height: 22px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-copy span { font-size: 13px; line-height: 19px; font-weight: 500; color: var(--muted); }
.cal-btn { flex: none; display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; line-height: 16px; font-weight: 600; color: var(--ink-secondary); }
.cal-btn-powder { background: var(--powder); }
.cal-btn-lilac { background: var(--lilac-soft); }
.tile-notes:hover .note:nth-child(2) { transform: translateX(-9px); }
.tile-notes:hover .note:nth-child(3) { transform: translateX(-18px); }
.note img { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.note div { display: grid; flex: 1; min-width: 0; }
.note strong { font-size: 13px; font-weight: 800; }
.note span { font-size: 13px; color: var(--ink-secondary); line-height: 1.35; }
.note time { align-self: flex-start; font-size: 11px; color: var(--faint); }

/* ---------- How it works ---------- */
.how { padding-inline: 10px; }
.how-card {
  border-radius: var(--radius-hero);
  background: linear-gradient(180deg, #FDEDF1 0%, #F9DCE8 65%, #FFF9F7 100%);
  padding-block: clamp(70px, 9vw, 120px) 0;
  overflow: hidden;
}
.how-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 40px;
  margin-top: clamp(40px, 5vw, 64px);
  align-items: start;
}
.how-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.how-step button {
  width: 100%;
  text-align: left;
  padding: 20px 22px 18px;
  border-radius: 24px;
  border: 1px solid transparent;
  transition: background .5s var(--ease-spring), border-color .5s, box-shadow .5s;
}
.how-step h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.how-step p { color: var(--ink-secondary); font-size: 15px; opacity: .7; transition: opacity .4s; }
.how-step.is-active button {
  background: rgba(255, 255, 255, .85);
  border-color: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-soft);
}
.how-step.is-active p { opacity: 1; }
.how-progress {
  display: block;
  height: 3px;
  margin-top: 16px;
  border-radius: 3px;
  background: var(--track);
  overflow: hidden;
  opacity: 0;
  transition: opacity .3s;
}
.how-progress i { display: block; height: 100%; width: 0; background: var(--periwinkle); border-radius: inherit; }
.how-step.is-active .how-progress { opacity: 1; }
.how-step.is-active .how-progress i { animation: progress var(--how-dur, 6s) linear forwards; }
.how-steps.is-paused .how-progress i { animation-play-state: paused; }
@keyframes progress { to { width: 100%; } }
.how-phones {
  position: relative;
  height: clamp(460px, 48vw, 600px);
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent);
          mask-image: linear-gradient(180deg, #000 72%, transparent);
}
.how-phone {
  position: absolute;
  top: 10px;
  left: 6%;
  width: clamp(220px, 23vw, 290px);
  transition: transform 1s var(--ease-spring), opacity .8s var(--ease-spring), filter .8s;
  will-change: transform;
}
.how-phone[data-rel="0"] { z-index: 3; transform: translateY(0) rotate(-3deg); }
.how-phone[data-rel="1"] { z-index: 2; transform: translateX(46%) translateY(40px) rotate(5deg) scale(.9); filter: saturate(.9) brightness(.98); }
.how-phone[data-rel="2"] { z-index: 1; transform: translateX(88%) translateY(80px) rotate(11deg) scale(.8); filter: saturate(.8) brightness(.95); }
.how-phone[data-rel="3"] { z-index: 0; opacity: 0; transform: translateX(-20%) translateY(60px) rotate(-8deg) scale(.85); }

/* ---------- Moments ---------- */
.moment-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 0;
  border-radius: var(--radius-tile);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.moment-feature-img {
  position: relative;
  background: var(--blush-soft);
  min-height: 380px;
  overflow: hidden;
}
/* Photos fill their frame; object-position keeps each subject in view as the frame changes shape */
.moment-feature-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; transition: transform 1.2s var(--ease-spring); }
.moment-feature:hover .moment-feature-img img { transform: scale(1.04); }
.moment-feature-body {
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}
.moment-feature-body h3 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 700; line-height: 1.1; letter-spacing: -0.035em; text-wrap: balance; }
.moment-feature-body p { color: var(--ink-secondary); max-width: 420px; }
.moment-feature-body .btn { margin-top: auto; }
.moment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}
.moment-card {
  padding: 0 0 22px;
  overflow: hidden;
  border-radius: var(--radius-tile);
  background: var(--surface);
  border: 1px solid var(--border);
}
.moment-img {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--tint);
  overflow: hidden;
  margin-bottom: 18px;
}
.moment-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); transition: transform 1s var(--ease-spring); }
.moment-card:hover .moment-img img { transform: scale(1.05); }
.moment-card h3 { padding: 0 22px; font-size: 19px; font-weight: 700; line-height: 1.3; }

/* ---------- FAQ ---------- */
.faq { background: linear-gradient(180deg, var(--background), #FDF1F4 50%, var(--background)); }
.faq-list { margin-top: 48px; border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 4px;
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 700;
  cursor: pointer;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-plus {
  flex: none;
  position: relative;
  width: 28px; height: 28px;
  transition: transform .5s var(--ease-spring);
}
.faq-plus::before, .faq-plus::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 12px; height: 2px;
  margin: -1px 0 0 -6px;
  border-radius: 2px;
  background: var(--ink-secondary);
}
.faq-plus::after { transform: rotate(90deg); }
.faq-item[open] .faq-plus { transform: rotate(135deg); }
.faq-item.is-closing .faq-plus { transform: none; }
.faq-a { overflow: hidden; }
.faq-a p { padding: 0 4px 24px; color: var(--ink-secondary); max-width: 640px; }
.faq-a p:has(+ ul) { padding-bottom: 14px; }
.faq-a ul { display: grid; gap: 12px; margin: 0; padding: 0 4px 24px 24px; color: var(--ink-secondary); max-width: 640px; }
.faq-a li::marker { color: var(--periwinkle); }
.faq-a strong { font-weight: 700; }

/* ---------- Download ---------- */
.download { padding-bottom: 0; overflow: hidden; }
.store-row { display: flex; justify-content: center; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 22px 0 18px;
  border-radius: 16px;
  background: var(--ink-secondary);
  color: #fff;
}
.store-btn svg { width: 26px; height: 26px; fill: #fff; }
.store-btn span { display: grid; text-align: left; font-size: 19px; font-weight: 700; line-height: 1.05; }
.store-btn small { font-size: 11px; font-weight: 600; opacity: .85; }

/* ---------- Fanned cards under the download buttons ---------- */
.footer-fan {
  position: relative;
  height: clamp(340px, 38vw, 540px);
  margin-top: clamp(40px, 5vw, 70px);
  display: flex;
  justify-content: center;
}
.fan-tile {
  position: absolute;
  top: 0;
  width: clamp(200px, 23.6vw, 340px);
  aspect-ratio: 340 / 448;
  border-radius: 28px;
  outline-offset: 6px;
  perspective: 1600px;
  will-change: transform;
}
.fan-tile:hover, .fan-tile:focus-visible, .fan-tile.is-flipped { z-index: 4; }

/* Footer cards turn over on hover, focus or tap to show a proof */
.flip-inner {
  position: relative;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 1.1s var(--ease-spring), scale .6s var(--ease-spring), translate .6s var(--ease-spring);
  transition: transform 1.1s var(--spring), scale .6s var(--ease-spring), translate .6s var(--ease-spring);
}
/* The card lifts towards you as it turns, then settles */
.fan-tile:hover .flip-inner,
.fan-tile:focus-visible .flip-inner,
.fan-tile.is-flipped .flip-inner { scale: 1.04; translate: 0 -10px; }
.fan-tile:hover .flip-inner,
.fan-tile:focus-visible .flip-inner,
.fan-tile.is-flipped .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 50px -24px rgba(23, 23, 25, .22);
  overflow: hidden;
  transition: box-shadow .6s var(--ease-spring);
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.fan-tile:hover :is(.flip-front, .flip-back),
.fan-tile.is-flipped :is(.flip-front, .flip-back) { box-shadow: 0 40px 70px -28px rgba(80, 30, 60, .32); }
.fan-front { background: var(--tint); }
.fan-front img { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; }
.flip-back { transform: rotateY(180deg); container-type: size; }
/* Scale the app's card to whichever side runs out first. The design is 340 x 448 app pixels */
.flip-back > * { --u: min(calc(100cqw / 340), calc(100cqh / 448)); }
.flip-back.proof-card { padding: 0; }
.flip-back-inner { display: flex; flex-direction: column; height: 100%; padding: calc(var(--u) * 24); }
.flip-back .proof-proves { font-size: calc(var(--u) * 50); }
.ft-1 { transform: translate3d(calc(var(--fan, 1) * -70%), calc(var(--fan-y, 0) * 1px + 20px), 0) rotate(calc(var(--fan, 1) * -10deg)); }
.ft-2 { z-index: 2; transform: translate3d(0, calc(var(--fan-y, 0) * 1px), 0); }
.ft-3 { transform: translate3d(calc(var(--fan, 1) * 70%), calc(var(--fan-y, 0) * 1px + 20px), 0) rotate(calc(var(--fan, 1) * 10deg)); }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  overflow: hidden;
  padding-top: clamp(80px, 15vw, 220px);
  background: linear-gradient(180deg, var(--background) 0%, var(--blush-soft) 100%);
}
.footer .container { width: min(1056px, 100% - 2 * var(--gutter)); }
.wordmark {
  width: min(1187px, 100% - 2 * var(--gutter));
  margin-inline: auto;
  /* Clip so the mark rises in from below its own baseline */
  overflow: hidden;
}
.wordmark img {
  width: 100%;
  transform: translateY(105%);
  transition: transform 1.2s var(--ease-spring);
}
.wordmark.is-in img { transform: none; }
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  padding-top: clamp(48px, 6vw, 80px);
}
.footer-tag { font-size: 24px; font-weight: 500; line-height: 1.35; letter-spacing: -0.01em; color: var(--ink-secondary); }
.footer-cols { display: flex; gap: clamp(40px, 7vw, 100px); }
.footer-cols h4 {
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}
.footer-cols a { display: block; padding: 0 0 17px; font-size: 16px; font-weight: 500; color: var(--ink-secondary); transition: color .2s; }
.footer-cols a:hover { color: var(--ink-secondary); }
.footer-base {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: clamp(60px, 10vw, 140px) 40px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-legal a { color: var(--ink-secondary); }
.footer-legal a:hover { color: var(--ink-secondary); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: grid; }
  .split-head { flex-direction: column; align-items: flex-start; }
  .bento { grid-template-columns: 1fr; }
  .bento > .tile { grid-column: auto; }
  .tile-calendar { grid-template-columns: 1fr; gap: 0; padding: 0 0 28px; }
  .tile-calendar .tile-copy { order: 2; padding: 22px 24px 0; }
  .tile-calendar .calendar-visual { padding: 24px 16px; }
  .cal-row { gap: 12px; padding: 12px; }
  .cal-btn { padding: 0 10px; }
  .cal-copy strong { white-space: normal; }
  .how-grid { grid-template-columns: 1fr; }
  .how-phones { height: 520px; }
  .how-phone { left: 50%; margin-left: -130px; width: 260px; }
  .how-phone[data-rel="1"] { transform: translateX(30%) translateY(36px) rotate(5deg) scale(.9); }
  .how-phone[data-rel="2"] { transform: translateX(-30%) translateY(36px) rotate(-5deg) scale(.9); }
  .how-phone[data-rel="3"] { transform: translateY(60px) scale(.85); }
  .moment-feature { grid-template-columns: 1fr; }
  .moment-feature-img { min-height: 0; aspect-ratio: 3 / 2; }
  .moment-grid { grid-template-columns: 1fr; }
  .footer-grid { flex-direction: column; }
}
@media (max-width: 640px) {
  .hero { padding: 0; }
  .hero-card { border-radius: 0 0 32px 32px; }
  .hero-phone { width: 220px; }
  .hero-phone-left, .hero-phone-right { width: 170px; }
  .hero-stage { height: 470px; }
  .mini-phone { width: 130px; }
  .p-left { transform: translateX(-108px) translateY(26px) rotate(-6deg); }
  .p-right { transform: translateX(108px) translateY(26px) rotate(6deg); }
  .tile-phones:hover .p-left { transform: translateX(-120px) translateY(16px) rotate(-9deg); }
  .tile-phones:hover .p-right { transform: translateX(120px) translateY(16px) rotate(9deg); }
  .fan-card { width: 120px; }
  .tile-fan:hover .fan-1 { transform: translateX(-88px) translateY(10px) rotate(-14deg); }
  .tile-fan:hover .fan-3 { transform: translateX(88px) translateY(10px) rotate(14deg); }
  .stack-visual { --s: .52; }
  .tile-stack:hover .pc-1 { transform: translateX(-88px) rotate(-12deg) scale(var(--s)); }
  .tile-stack:hover .pc-3 { transform: translateX(90px) translateY(10px) rotate(12deg) scale(var(--s)); }
  .notes-visual { padding: 0 16px; }
  .note:nth-child(2), .note:nth-child(3) { margin-left: 0; }
  .how { padding-inline: 0; }
  .how-card { border-radius: 32px; }
  .how-phone { width: 230px; margin-left: -115px; }
  .footer-fan { height: 300px; }
  .footer-base { flex-direction: column; }
  .footer-cols { gap: 32px; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  html { scroll-behavior: auto; }
}
