/* Scroll story. Scenes 1–3 pin the real iPhone mockup (.phone from stage.css with app screenshots);
   memories, privacy and the price race animate as they scroll past.
   Without JS or with reduced motion, every scene renders in its final, static state. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Pinned story (scenes 1–3) ---------- */
.story { padding-block-start: var(--section-space); }
.story-pin {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--spacing-12);
  width: min(var(--container-features), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}
.story-copy { position: relative; display: flex; flex-direction: column; gap: var(--spacing-12); }
.story-step { display: flex; flex-direction: column; align-items: flex-start; gap: var(--spacing-4); }
.story-step h3, .scene-memories h2, .scene-privacy h2, .scene-race h2 {
  font-size: clamp(40px, 5vw, 72px);
  line-height: .98;
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
.story-step p:last-child { max-width: 34ch; color: var(--color-body); font-size: 19px; line-height: 29px; }
.story-dots { display: none; }

.story-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--spacing-6); }
.story-cloud {
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  padding: 10px 18px 10px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-page);
  box-shadow: 0 0 0 1px var(--color-line), 0 12px 28px -18px rgb(15 38 98 / 45%);
}
.story-cloud svg { width: 34px; height: 34px; color: var(--color-accent-band); }
.story-cloud p { color: var(--color-muted); font-size: 15px; }
.story-cloud strong { color: var(--color-ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.story-fly { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.story-fly img { position: absolute; top: 0; left: 0; width: 64px; height: 64px; object-fit: cover; border-radius: 10px; opacity: 0; box-shadow: 0 10px 20px -10px rgb(0 0 0 / 45%); }

.story-phone { width: 310px; }
.story-screens { position: relative; z-index: 1; overflow: hidden; border-radius: 38px; }
.story-screens .phone-screen { border-radius: 0; }
.sc-free { position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: 0; }
.story-banner {
  position: absolute;
  top: 54px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgb(246 246 248 / 92%);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 24px -12px rgb(0 0 0 / 35%);
  opacity: 0;
  transform: translateY(-140%);
}
.story-banner-icon { display: grid; flex: none; width: 30px; height: 30px; place-items: center; border-radius: 8px; background: #d33b2c; color: #fff; }
.story-banner-icon svg { width: 18px; height: 18px; }
.story-banner strong { display: block; color: var(--color-ink); font-size: 12.5px; line-height: 16px; }
.story-banner span:not(.story-banner-icon) { display: block; color: var(--color-muted); font-size: 11.5px; line-height: 15px; }

.story-storage {
  position: absolute;
  z-index: 2;
  bottom: 110px;
  left: calc(50% - 330px);
  width: 230px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgb(255 255 255 / 90%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px var(--color-line), 0 20px 40px -24px rgb(15 38 98 / 50%);
}
.story-storage-top { display: flex; justify-content: space-between; gap: 8px; color: var(--color-muted); font-size: 12px; }
.story-storage-top b { color: var(--color-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.story-bar { height: 8px; margin-top: 8px; overflow: hidden; border-radius: 4px; background: #e2e2e7; }
.story-bar i { display: block; width: 38%; height: 100%; border-radius: 4px; background: #1f9d63; }
.story-storage-note { position: relative; height: 18px; margin-top: 6px; font-size: 12px; font-weight: 600; }
.story-storage-note span { position: absolute; top: 0; left: 0; }
.story-warn { color: #d33b2c; opacity: 0; }
.story-freed { color: #1f9d63; }

/* Static fallback shows the end of the story: Free Up Space screen, no storage card. */
html:not(.story-on) .sc-free { opacity: 1; }
html:not(.story-on) .story-storage { display: none; }

/* Scroll-driven mode (story.js adds .story-on). */
.story-on .story { padding-block-start: 0; }
.story-on .story-pin { min-height: 100vh; min-height: 100svh; padding-block: 80px 40px; }
.story-on .story-copy { display: grid; }
.story-on .story-step { grid-area: 1 / 1; }
.story-on .story-step:not([data-step="1"]) { opacity: 0; visibility: hidden; }
.story-on .story-dots { display: flex; gap: 8px; margin: var(--spacing-12) 0 0; padding: 0; list-style: none; }
.story-on .story-dots li { width: 8px; height: 8px; border-radius: 4px; background: var(--color-line); transition: width .3s, background-color .3s; }
.story-on .story-dots li.is-on { width: 24px; background: var(--color-ink); }
.story-on .story-bar i { width: 62%; background: var(--color-accent-band); }
.story-on .story-freed { opacity: 0; }

/* ---------- Memories ---------- */
.scene-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: var(--spacing-12); }
.scene-memories .lede { max-width: 34ch; color: var(--color-body); }
.mem-fan { position: relative; height: 440px; }
.mem-fan img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 210px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  margin: -140px 0 0 -105px;
  border: 6px solid var(--color-page);
  border-radius: 16px;
  box-shadow: 0 24px 40px -22px rgb(20 26 40 / 55%);
}
/* Final (fanned) positions; the scroll animation starts them stacked in the middle. */
.mem-fan img:nth-child(1) { transform: translate(-230px, 30px) rotate(-14deg); }
.mem-fan img:nth-child(2) { transform: translate(-118px, -4px) rotate(-7deg); }
.mem-fan img:nth-child(3) { z-index: 3; transform: translate(0, -18px) rotate(0deg); }
.mem-fan img:nth-child(4) { z-index: 2; transform: translate(118px, -4px) rotate(7deg); }
.mem-fan img:nth-child(5) { z-index: 1; transform: translate(230px, 30px) rotate(14deg); }
.mem-chip {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-ink);
  color: var(--color-page);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

/* ---------- Privacy ---------- */
.scene-privacy-head { display: flex; flex-direction: column; align-items: center; gap: var(--spacing-4); text-align: center; }
.scene-privacy-head .lede { max-width: 36ch; color: var(--color-body); }
.privacy-shield { display: grid; width: 76px; height: 76px; place-items: center; border-radius: 24px; background: var(--color-accent-pale); color: var(--color-accent-band); }
.privacy-shield svg { width: 40px; height: 40px; }
.privacy-rows { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--spacing-6); margin: var(--spacing-16) 0 0; }
.privacy-rows > div { position: relative; display: flex; flex-direction: column; gap: var(--spacing-2); padding-top: var(--spacing-4); }
.privacy-rows > div::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--color-ink); transform-origin: left; }
.privacy-rows dd { color: var(--color-body); }
.privacy-more { display: inline-block; margin-top: var(--spacing-6); }

/* ---------- Price race ---------- */
.scene-race { display: flex; flex-direction: column; align-items: flex-start; gap: var(--spacing-4); }
.race { display: flex; flex-direction: column; gap: var(--spacing-6); width: 100%; margin-top: var(--spacing-12); }
.race-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) 90px; align-items: center; gap: var(--spacing-6); }
.race-name { color: var(--color-ink); font-weight: 600; }
.race-track { height: 56px; overflow: hidden; border-radius: 14px; background: var(--color-band); }
.race-track i { display: block; height: 100%; border-radius: 14px; }
.race-google .race-track i { width: 100%; background: #c9cbd3; }
.race-us .race-track i { width: 45.4%; background: linear-gradient(90deg, #1f9d63, #2ec27e); }
.race-price { color: var(--color-ink); font-size: 32px; font-weight: 600; letter-spacing: -.03em; text-align: right; font-variant-numeric: tabular-nums; }
.race-us .race-price { color: #1f9d63; }
.race-note { color: var(--color-muted); font-size: var(--text-label); }

/* Two remaining feature cards */
.feature-grid-two .feature-card { grid-column: span 6; }

@media (max-width: 860px) {
  .story-pin, .scene-split { grid-template-columns: 1fr; gap: var(--spacing-6); }
  .story-step h3, .scene-memories h2, .scene-privacy h2, .scene-race h2 { font-size: 40px; }
  .story-step p:last-child { font-size: 17px; line-height: 26px; }
  .story-on .story-pin { align-content: start; padding-block: 76px 16px; }
  .story-on .story-dots { margin-top: var(--spacing-4); }
  .story-stage { transform-origin: top center; }
  .story-on .story-stage { scale: .74; margin-top: -10px; }
  .story-on .story-cloud { display: none; }
  .story-storage { left: auto; right: 0; bottom: 40px; width: 240px; }
  .story-storage-top { white-space: nowrap; }
  .mem-fan { height: 340px; }
  .mem-fan { overflow: clip; }
  .mem-fan img { width: 130px; margin: -87px 0 0 -65px; border-width: 4px; }
  .mem-fan img:nth-child(1) { transform: translate(-100px, 24px) rotate(-14deg); }
  .mem-fan img:nth-child(2) { transform: translate(-52px, -2px) rotate(-7deg); }
  .mem-fan img:nth-child(4) { transform: translate(52px, -2px) rotate(7deg); }
  .mem-fan img:nth-child(5) { transform: translate(100px, 24px) rotate(14deg); }
  .privacy-rows { grid-template-columns: 1fr; gap: var(--spacing-4); margin-top: var(--spacing-12); }
  .race-row { grid-template-columns: 1fr auto; gap: var(--spacing-2) var(--spacing-4); }
  .race-name { grid-column: 1 / -1; }
  .race-track { height: 40px; }
  .race-price { font-size: 24px; }
  .feature-grid-two .feature-card { grid-column: 1 / -1; }
}

/* Privacy rule lines drawn by story.js replace the static ones. */
.privacy-line { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--color-ink); transform-origin: left; }
.privacy-lines .privacy-rows > div::before { display: none; }

/* ---------- Folders (Files card): back panel, contents peeking out, frosted front pocket ---------- */
.folders { display: flex; justify-content: center; align-items: flex-end; gap: clamp(12px, 2.5vw, 28px); margin-top: auto; padding: 8px clamp(16px, 3vw, 32px) 28px; }
.fold { display: flex; flex-direction: column; align-items: center; text-align: center; }
.fold-body { position: relative; width: 150px; height: 118px; zoom: 1.12; filter: drop-shadow(0 16px 18px rgb(24 32 60 / 18%)); }
.fold-back {
  position: absolute;
  inset: 14px 0 0;
  border-radius: 14px;
  background: var(--fold-back);
}
.fold-back::before { /* the tab on the back panel */
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  width: 58px;
  height: 22px;
  border-radius: 10px 12px 0 0;
  background: var(--fold-back);
}
.fold-paper, .fold-photo {
  position: absolute;
  top: 2px;
  left: 18px;
  width: 74px;
  height: 84px;
  border-radius: 8px;
  background:
    linear-gradient(var(--color-line), var(--color-line)) 12px 18px / 44px 4px no-repeat,
    linear-gradient(var(--color-line), var(--color-line)) 12px 28px / 34px 4px no-repeat,
    linear-gradient(var(--color-line), var(--color-line)) 12px 38px / 40px 4px no-repeat,
    #fff;
  box-shadow: 0 4px 10px -4px rgb(0 0 0 / 22%);
  transform: rotate(-7deg);
}
.fold-paper-2, .fold-photo-2 { left: 58px; top: 6px; transform: rotate(6deg); }
.fold-photo { object-fit: cover; border: 3px solid #fff; }
.fold-front {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 150px;
  height: 78px;
  clip-path: path("M0 12 Q0 0 12 0 H52 Q60 0 65 5 L71 11 Q75 15 83 15 H138 Q150 15 150 27 V66 Q150 78 138 78 H12 Q0 78 0 66 Z");
  background: var(--fold-front);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  backdrop-filter: blur(8px) saturate(140%);
}
.fold-front::after { /* soft top highlight and a faint label line */
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgb(255 255 255 / 45%), rgb(255 255 255 / 0) 34%),
    linear-gradient(rgb(255 255 255 / 30%), rgb(255 255 255 / 30%)) 16px 62px / 118px 2px no-repeat;
}
.fold-chip, .fold-tag {
  position: absolute;
  z-index: 1;
  right: 10px;
  top: 24px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgb(255 255 255 / 55%);
  color: var(--fold-ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 15px;
}
.fold-ok { display: inline-flex; align-items: center; gap: 5px; color: #17683c; background: rgb(255 255 255 / 75%); }
.fold-ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #1f9d63; }
.fold-tag { right: 12px; top: 26px; padding: 4px 8px; border-radius: 6px; background: #c9372c; color: #fff; letter-spacing: .04em; box-shadow: 0 3px 6px -2px rgb(120 20 10 / 45%); transform: rotate(6deg); }
.fold-name { margin-top: 14px; color: var(--color-ink); font-size: 16px; font-weight: 600; line-height: 20px; }
.fold-meta { color: var(--color-muted); font-size: 13px; line-height: 18px; }
.fold-blue { --fold-back: #3f6fe0; --fold-front: linear-gradient(180deg, rgb(120 160 248 / 88%), rgb(78 124 236 / 96%)); --fold-ink: #173a8f; }
.fold-yellow { --fold-back: #e9a92a; --fold-front: linear-gradient(180deg, rgb(255 214 110 / 88%), rgb(246 190 64 / 96%)); --fold-ink: #6b4a05; }
.fold-glass { --fold-back: #8d8f9c; --fold-front: linear-gradient(180deg, rgb(232 233 240 / 72%), rgb(206 208 218 / 88%)); --fold-ink: #3c3e48; }
.fold-blue .fold-chip { color: #fff; background: rgb(255 255 255 / 22%); }

@media (max-width: 599px) {
  .folders { gap: 8px; padding-inline: 8px; }
  .fold-body { zoom: .6; }
  .fold-name { font-size: 14px; margin-top: 8px; }
  .fold-meta { font-size: 12px; }
}

/* ---------- More features: a quiet list under the two cards ---------- */
.more-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--spacing-6) var(--spacing-12); margin: var(--spacing-12) 0 0; padding: var(--spacing-12) 0 0; border-top: 1px solid var(--color-line); list-style: none; }
.more-features li { display: flex; align-items: flex-start; gap: var(--spacing-4); }
.mf-icon { display: grid; flex: none; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: var(--color-accent-pale); color: var(--color-accent-band); }
.mf-icon svg { width: 22px; height: 22px; }
.more-features strong { display: block; color: var(--color-ink); font-weight: 600; line-height: 24px; }
.more-features span:not(.mf-icon) { display: block; color: var(--color-body); font-size: 15px; line-height: 22px; }
.more-note { margin-top: var(--spacing-6); color: var(--color-muted); font-size: var(--text-label); }
@media (max-width: 860px) { .more-features { grid-template-columns: 1fr; gap: var(--spacing-4); } }
