/* Home page only: hero, the pinned four-step story, the privacy band. The top bar and footer are in style.css. Tokens come from style.css (:root).
   The story pins only after landing.js adds .story-on to <html>; without it the steps are a plain list. */
:root { --ease-out: cubic-bezier(.22, .8, .3, 1); }
body { overflow-x: clip; }   /* clip, not hidden: hidden turns the body into a scroll container, which stops the pinned story from sticking on iPhone Safari */

.landing-display { font: 600 clamp(40px, 7vw, 76px)/1.02 Fraunces, Georgia, serif; letter-spacing: -1.5px; margin: 0; }
.landing-title { font: 600 clamp(28px, 4vw, 42px)/1.08 Fraunces, Georgia, serif; letter-spacing: -0.8px; margin: 0 0 12px; }
.landing-lead { color: var(--muted); font-size: clamp(16px, 2vw, 19px); margin: 16px auto 0; max-width: 46ch; text-wrap: balance; }
.landing-note { display: inline-flex; padding: 8px 14px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-deep); font-weight: 700; font-size: 14px; border: 1px solid var(--gold-line); }
.store-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.store-dot.store-one { background: var(--store-one); } .store-dot.store-two { background: var(--store-two); }
.amount { font: 600 16px/1 Fraunces, Georgia, serif; font-variant-numeric: tabular-nums; }

/* Hero: the headline with four grocery icons that rise and fall a few pixels in place. */
.landing-hero { min-height: 92vh; display: grid; place-items: center; text-align: center; padding: 120px 16px 40px; position: relative; overflow: hidden; }
.hero-text .landing-lead { max-width: none; }
.hero-note { margin: 26px 0 0; }
.hero-item { position: absolute; width: clamp(44px, 6vw, 64px); height: auto; opacity: .9; animation: hero-arrive 1.2s var(--ease-out) backwards, hero-float 2.6s ease-in-out infinite alternate; }
.hero-text > * { animation: hero-arrive .9s var(--ease-out) backwards; }
.hero-text > :nth-child(2) { animation-delay: .15s; } .hero-text > :nth-child(3) { animation-delay: .3s; }
@keyframes hero-arrive { from { opacity: 0; translate: 0 30px; } }
@keyframes hero-float { from { transform: translateY(-3px); } to { transform: translateY(3px); } }

/* Calendly-style surface: flat white, a hairline in the ink colour, and three faint cool shadows instead of one dark one. */
:root {
  --hairline: rgba(21, 20, 18, .07);
  --shadow-soft: 0 4px 5px rgba(95, 109, 119, .04), 0 10px 15px rgba(95, 109, 119, .04), 0 40px 50px rgba(95, 109, 119, .10);
  --shadow-lifted: 0 4px 5px rgba(95, 109, 119, .04), 0 8px 15px rgba(95, 109, 119, .03), 0 30px 50px rgba(95, 109, 119, .08);
  --font-mono: 'Geist Mono', ui-monospace, Menlo, monospace;
}

/* Story steps: a list of titles; the current one is a white card with its description and a progress bar.
   Without the script every step shows its description. */
.story-stage { max-width: 680px; margin: 0 auto; padding: 40px 16px; }
.story-step + .story-step { margin-top: 4px; }
.step-card { position: relative; overflow: hidden; display: grid; grid-template-columns: 36px 1fr; padding: 18px 22px; border-radius: 20px; border: 1px solid transparent;
  transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.step-number { font: 500 13px/28px var(--font-mono); color: var(--muted); letter-spacing: .02em; transition: color .2s; }
.step-title { font: 700 clamp(19px, 1.9vw, 23px)/28px Manrope, system-ui, sans-serif; letter-spacing: -0.4px; margin: 0; color: var(--text); transition: color .2s; }
.step-more { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .2s var(--ease-out), opacity .2s var(--ease-out); }
.step-more > div { overflow: hidden; }
.step-lead { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0; padding-top: 6px; text-wrap: balance; }
/* Progress: a pill under the description, in the text column. The fill slides in from the left, so its end stays round. */
.step-progress { display: none; height: 4px; margin: 16px 0 4px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.step-progress-fill { display: block; height: 100%; border-radius: 999px; background: var(--gold); transform: translateX(-100%); will-change: transform; }
.story-visual { display: none; }

/* Story pinned: steps stay stacked on the left; scrolling moves the current step and the cards on the right */
/* svh: the screen's height with the phone's address bar showing. vh follows the bar sliding away, which resizes the pinned stage mid-scroll. */
.story-on .landing-story { height: 480vh; height: 480svh; position: relative; }
.story-on .story-stage { position: sticky; top: 0; height: 100vh; height: 100svh; max-width: none; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 24px; padding: 68px clamp(16px, 5vw, 64px) 20px; }
.story-on .story-copy { max-width: 470px; justify-self: end; width: 100%; }
.story-on .story-step:not(.current) .step-title { color: #A29D94; }
.story-on .story-step:not(.current) .step-more { grid-template-rows: 0fr; opacity: 0; }
.story-on .story-step.current .step-card { background-color: var(--surface); border-color: var(--hairline); box-shadow: var(--shadow-soft); }
.story-on .story-step.current .step-number { color: var(--gold); }
.story-on .step-progress { display: block; }
.story-on .story-visual { display: block; position: relative; height: 520px; }
.visual-scaler { position: absolute; inset: 0; transform-origin: 50% 50%; }
.visual-scaler > * { position: absolute; left: 50%; top: 50%; will-change: transform, opacity; }

.cart-receipt { width: 250px; margin: -150px 0 0 -125px; background: var(--surface); border-radius: 22px; padding: 18px 20px; border: 1px solid var(--hairline); box-shadow: var(--shadow-soft); }
.receipt-store { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--hairline); }
.receipt-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.receipt-row img { width: 26px; height: 26px; }
.receipt-row .receipt-item { flex: 1; }
.receipt-tear { border-top: 2px dashed var(--line); margin: 8px 0; }
.receipt-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 13px; letter-spacing: .08em; }
.receipt-barcode { height: 18px; margin-top: 10px; opacity: .18; background: repeating-linear-gradient(90deg, var(--text) 0 2px, transparent 2px 4px, var(--text) 4px 5px, transparent 5px 8px); }
.ordered-stamp { width: 140px; margin: -40px 0 0 -70px; text-align: center; padding: 8px; border: 3px solid var(--green); color: var(--green); border-radius: 10px; font-weight: 700; letter-spacing: .14em; background: rgba(255, 255, 255, .88); opacity: 0; }
.share-chip { width: 104px; margin: -28px 0 0 -52px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; text-align: center; box-shadow: var(--shadow-lifted); opacity: 0; }
.share-chip b { display: block; font-size: 14px; } .share-chip .amount { color: var(--gold-deep); }
.synced-row { width: 228px; margin: 150px 0 0 -114px; display: flex; gap: 8px; align-items: center; justify-content: center; padding: 10px 16px; border-radius: 999px; background: var(--green); color: #fff; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lifted); opacity: 0; }
.synced-tick path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.story-on .synced-tick path { stroke-dashoffset: 1; transition: stroke-dashoffset .35s var(--ease-out); }   /* the tick draws itself once the pill has landed */
.story-on .synced-row.is-synced .synced-tick path { stroke-dashoffset: 0; }
.reminder-card { width: 300px; margin: -40px 0 0 -150px; padding: 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--shadow-soft); display: flex; gap: 14px; align-items: center; opacity: 0; }
.reminder-card img { width: 52px; height: 52px; padding: 6px; border-radius: 14px; background: var(--gold-soft); }
.reminder-card small { color: var(--muted); display: block; line-height: 1.4; }

/* Privacy band: white on ink. Order lines drift in readable on the left and leave as cipher text on the right; the lock sits where they change. */
.privacy-band { position: relative; overflow: hidden; margin-bottom: clamp(76px, 8vw, 104px); padding: 76px 16px 84px; text-align: center; background: var(--text); color: #fff; }   /* the space under it matches the space the story leaves above it, so the band sits between them, not on the footer */
.band-content { position: relative; z-index: 1; }
.band-content::before { content: ''; position: absolute; inset: -60px 50%; width: min(760px, 100vw); translate: -50% 0; z-index: -1; background: radial-gradient(closest-side, var(--text) 62%, transparent); }   /* clears the backdrop behind the words */
.privacy-band .landing-lead { color: #B9B4AA; }
.privacy-band a { color: #fff; }
.band-link { margin: 18px 0 0; font-weight: 700; }
.cipher-backdrop { position: absolute; inset: 0; pointer-events: none; font: 500 13px/1 var(--font-mono);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.cipher-layer { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-evenly; }
.cipher-layer.readable { clip-path: inset(0 50% 0 0); color: rgba(255, 255, 255, .22); }   /* the same moving rows three times: plain text left of centre, */
.cipher-layer.scrambled { clip-path: inset(0 0 0 50%); color: rgba(255, 255, 255, .12); }   /* cipher text right of it, letter for letter in the same place, */
.cipher-layer.readable-before { clip-path: inset(0 0 0 50%); color: rgba(255, 255, 255, .22); opacity: 0; }   /* and plain text on the right, shown only until the lock shuts */
.cipher-row { display: flex; width: max-content; white-space: pre; animation: cipher-drift linear infinite; will-change: transform; }
.cipher-row span { flex: none; overflow: hidden; }
.privacy-band.cipher-paused .cipher-row { animation-play-state: paused; }   /* set by landing.js while the band is far off-screen */
@keyframes cipher-drift { from { transform: translateX(-50%); } to { transform: translateX(0); } }   /* each row holds its lines twice; half a row later the picture is the same */

/* Lock card: a faint tile with a thin light edge. Drawn shut by default; with the script running it waits hidden, then
   builds once when it scrolls into view: card pops in, lock rises open, shackle swings shut on its hinge, keyhole turns,
   the card dips like a pressed button, a light runs once round its edge and the text behind flickers into cipher. */
.lock-card { position: relative; width: 96px; height: 96px; margin: 0 auto 26px; border-radius: 28px; overflow: hidden; display: grid; place-items: center; background: rgba(255, 255, 255, .16); }
.lock-card::before { content: ''; position: absolute; inset: -50%; background: conic-gradient(transparent 0 250deg, #fff 345deg, transparent 360deg); opacity: 0; }   /* the light; only its rim shows past the cover below */
.lock-card::after { content: ''; position: absolute; inset: 1.5px; border-radius: 26.5px; background: #24221F; }
.lock-art { position: relative; z-index: 1; display: block; overflow: visible; }
.lock-shackle { transform-box: view-box; transform-origin: 42px 31px; }   /* hinge: the foot of the right leg */
.lock-keyhole { transform-box: fill-box; transform-origin: 50% 50%; }
.lock-pulse { position: absolute; z-index: 1; inset: 14px; border-radius: 50%; border: 1.5px solid #fff; opacity: 0; }

.lock-armed .lock-card, .lock-armed .lock-art { opacity: 0; }
.lock-armed .lock-shackle { transform: translateY(-6px) rotate(-36deg); }
.lock-armed .readable-before { opacity: 1; }
.lock-armed .scrambled { opacity: 0; }
.lock-armed.lock-play .lock-card { animation: lock-card-pop .6s var(--ease-out) both, lock-card-press .32s ease-out 1.5s; }
.lock-armed.lock-play .lock-art { animation: lock-rise .55s var(--ease-out) .3s both; }
.lock-armed.lock-play .lock-shackle { animation: lock-shut .5s cubic-bezier(.5, 0, .2, 1) 1.05s both; }
.lock-armed.lock-play .lock-keyhole { animation: lock-keyhole-turn .3s var(--ease-out) 1.5s both; }
.lock-armed.lock-play .lock-pulse { animation: lock-pulse .7s ease-out 1.52s both; }
.lock-armed.lock-play .lock-card::before { animation: lock-edge-light 1.15s cubic-bezier(.4, 0, .3, 1) 1.52s both; }
.lock-armed.lock-play .readable-before { animation: cipher-flicker-out .7s steps(1, end) 1.52s both; }
.lock-armed.lock-play .scrambled { animation: cipher-flicker-in .7s steps(1, end) 1.52s both; }
@keyframes lock-card-pop { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
@keyframes lock-card-press { 40% { transform: scale(.94); } }
@keyframes lock-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes lock-shut { from { transform: translateY(-6px) rotate(-36deg); } 62% { transform: translateY(-6px) rotate(0deg); } to { transform: none; } }   /* swing closed, then drop in */
@keyframes lock-keyhole-turn { from { transform: none; } to { transform: rotate(90deg); } }
@keyframes lock-pulse { from { opacity: .55; transform: scale(.6); } to { opacity: 0; transform: scale(1.6); } }
@keyframes lock-edge-light { from { opacity: 1; transform: rotate(0deg); } 85% { opacity: 1; } to { opacity: 0; transform: rotate(360deg); } }
@keyframes cipher-flicker-in { 0% { opacity: 0; } 15% { opacity: 1; } 30% { opacity: 0; } 45% { opacity: 1; } 58% { opacity: .3; } 72%, 100% { opacity: 1; } }
@keyframes cipher-flicker-out { 0% { opacity: 1; } 15% { opacity: 0; } 30% { opacity: 1; } 45% { opacity: 0; } 58% { opacity: .5; } 72%, 100% { opacity: 0; visibility: hidden; } }

.story-on .measuring * { transition: none !important; }   /* landing.js opens each step once to measure the tallest, without any visible fold */

/* Snapping: the page always comes to rest on a stop, and scroll-snap-stop: always stops a flick from passing one. Stops: the hero,
   one per step (placed by landing.js halfway through each step), the privacy band, the footer. Off without the script. */
.story-on { scroll-snap-type: y mandatory; }
.story-on .landing-hero { scroll-snap-align: start; scroll-snap-stop: always; }
.story-on .snap-stop { position: absolute; left: 0; width: 1px; height: 1px; pointer-events: none; scroll-snap-align: start; scroll-snap-stop: always; }
.story-on .privacy-band { scroll-snap-align: center; scroll-snap-stop: always; }
.story-on .site-footer { scroll-snap-align: end; scroll-snap-stop: always; }

/* Phone: titles stay stacked, only the current step shows its description, the cards sit below */
@media (max-width: 760px) {
  .story-on .story-stage { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-items: start; gap: 8px; padding: 68px 16px 12px; }
  .story-on .story-copy { justify-self: stretch; max-width: none; }
  .story-step + .story-step { margin-top: 0; }
  .step-card { grid-template-columns: 30px 1fr; padding: 10px 14px; border-radius: 16px; }
  .step-number { font-size: 12px; line-height: 24px; }
  .step-title { font-size: 16.5px; line-height: 24px; }
  .step-lead { font-size: 14px; line-height: 1.45; padding-top: 2px; }
  .step-progress { margin: 10px 0 4px; }
  .story-on .story-visual { height: 100%; min-height: 0; }
  .hero-item { opacity: .55; }
  .privacy-band { padding: 60px 16px 68px; }
  .cipher-backdrop { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { .hero-item, .hero-text > *, .cipher-row { animation: none; } }
