/* Tap Loyalty marketing site
   Palette "Ink & Marigold". Kraft is reserved for the old paper card only. */
:root {
  --ink: #1D3A5F;
  --ink-deep: #142a46;
  --marigold: #F2B230;
  --teal: #3F6E72;
  --milk: #EEF1F4;
  --white: #FFFFFF;
  --text: #14181D;
  --muted: #525B66;
  --line: #D5DBE2;
  --kraft: #C9A878;
  --kraft-dark: #A9875A;

  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --body: "Figtree", system-ui, sans-serif;

  /* Type scale (perfect fourth) */
  --t-1: clamp(2.6rem, 1.4rem + 5.2vw, 5.4rem);
  --t-2: clamp(2rem, 1.3rem + 2.8vw, 3.4rem);
  --t-3: 1.42rem;
  --t-body: 1.125rem;
  --t-small: .94rem;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1200px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--milk);
  color: var(--text);
  font: 400 var(--t-body)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); margin: 0; color: var(--ink); }
h1 {
  font-size: var(--t-1);
  font-weight: 800;
  font-variation-settings: "wdth" 78, "opsz" 96;
  line-height: .94;
  letter-spacing: -.025em;
  text-wrap: balance;
}
h2 {
  font-size: var(--t-2);
  font-weight: 700;
  font-variation-settings: "wdth" 85, "opsz" 72;
  line-height: 1.02;
  letter-spacing: -.02em;
  max-width: 20ch;
  text-wrap: balance;
}
h3 { font-size: var(--t-3); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; max-width: 60ch; }

a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--white); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  background: var(--ink); color: var(--white);
  font: 600 1rem/1 var(--body); text-decoration: none;
  transition: transform .25s var(--ease), background-color .25s var(--ease);
}
.btn:hover { background: var(--ink-deep); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn-small { min-height: 44px; padding: 0 18px; font-size: .94rem; }
.btn-light { background: var(--marigold); color: var(--ink); }
.btn-light:hover { background: #f6c357; }
.link { font-weight: 600; text-underline-offset: 4px; }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  background: var(--milk);
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 700 1.15rem var(--display); text-decoration: none; color: var(--ink); }
.wordmark svg { width: 30px; height: 30px; }
.nav nav { display: flex; align-items: center; gap: 28px; }
.nav nav a:not(.btn) { padding-block: 10px; text-decoration: none; font-weight: 500; font-size: .98rem; color: var(--text); }
.nav nav a:not(.btn):hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
@media (max-width: 760px) { .nav nav a:not(.btn) { display: none; } }

/* ---------- Hero: intro, then one order scrubbed by scroll ---------- */
main > section.intro { padding: calc(76px + 4vw) var(--gutter) 0; display: grid; gap: 18px; justify-items: start; }
.intro .lede { color: var(--muted); font-size: 1.2rem; max-width: 36ch; }
.story-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.hint { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--t-small); margin-top: 6px; }
.hint i { width: 8px; height: 8px; border-radius: 50%; background: var(--marigold); animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

.story { position: relative; height: 420vh; margin-top: 8px; }
.stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto; padding-top: 72px;
}
.captions { position: relative; height: 118px; margin-top: 8px; }
.cap { position: absolute; inset: 0; padding: 0 var(--gutter); max-width: 560px; margin: 0 auto; opacity: 0; transform: translateY(10px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.cap.on { opacity: 1; transform: none; }
.cap b { display: block; font: 700 1.4rem/1.15 var(--display); font-variation-settings: "wdth" 85; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
.cap > span { display: block; color: var(--muted); margin-top: 6px; font-size: 1rem; }
.cap .num { text-decoration: underline; text-decoration-color: var(--marigold); text-decoration-thickness: 3px; text-underline-offset: 3px; }

.scene { position: relative; }
.phone {
  position: absolute; left: 50%; top: 50%; width: min(46vw, 230px); aspect-ratio: 9 / 19; border-radius: 34px;
  background: #141A22; box-shadow: 0 24px 48px -28px rgba(20, 30, 45, .6), inset 0 0 0 2px #2A333F;
  transform: translate(-50%, -50%); will-change: transform;
}
.phone .screen { position: absolute; inset: 8px; border-radius: 27px; background: #F6F8FB; overflow: hidden; display: grid; }
.phone .cam { position: absolute; top: 14px; left: 50%; width: 28%; height: 9px; border-radius: 999px; background: #141A22; transform: translateX(-50%); z-index: 2; }
.phone .cam.dot { width: 9px; }

/* Staff phone: counter screen and live screen stacked, crossfaded */
.staff .screen > div { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 26px 10px 14px; transition: opacity .35s var(--ease); }
.counter .venue { align-self: flex-start; font-size: .62rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 5px; }
.counter .venue i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.counter .stamp { width: 54%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); color: var(--white); font: 700 clamp(.9rem, 3.4vw, 1.25rem)/1 var(--display); display: grid; place-items: center; margin-top: 8px; box-shadow: 0 10px 24px -12px rgba(29, 58, 95, .6); transition: transform .15s var(--ease); }
.counter .cups { display: flex; align-items: center; gap: 8px; background: var(--white); border-radius: 999px; padding: 4px 6px; box-shadow: 0 4px 12px -8px rgba(0, 0, 0, .3); margin-top: 8px; }
.counter .cups b { width: 22px; height: 22px; border-radius: 50%; background: var(--milk); color: var(--text); display: grid; place-items: center; font-size: .8rem; font-weight: 600; }
.counter .cups span { min-width: 18px; text-align: center; font-weight: 700; color: var(--text); font-size: .95rem; }
.counter .cupl { font-size: .62rem; color: var(--muted); }
.live { background: var(--ink); color: var(--white); opacity: 0; }
.live b { font: 700 clamp(.85rem, 3.2vw, 1.1rem)/1.2 var(--display); text-align: center; letter-spacing: -.01em; }
.live .ring { width: 56%; aspect-ratio: 1; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); position: relative; display: grid; place-items: center; }
.live .ring::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid var(--white); border-right-color: transparent; border-bottom-color: transparent; transform: rotate(var(--ringrot, 0deg)); }
.live .ring span { font-weight: 700; font-size: clamp(1rem, 4vw, 1.4rem); }
.live small { font-size: .6rem; opacity: .85; text-align: center; }

/* NFC field: rings centred on the staff phone */
.field { position: absolute; left: 50%; top: 50%; width: min(60vw, 300px); aspect-ratio: 1; transform: translate(-50%, -60%); pointer-events: none; opacity: 0; transition: opacity .3s var(--ease); }
.field i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--marigold); opacity: 0; }
.field.on i { animation: ripple 2.2s linear infinite; }
.field i:nth-child(2) { animation-delay: .73s; }
.field i:nth-child(3) { animation-delay: 1.46s; }
@keyframes ripple { 0% { transform: scale(.45); opacity: .6; } 100% { transform: scale(1.15); opacity: 0; } }

/* Customer phone: lock screen with the banner, then the Wallet card */
.cust .screen { background: linear-gradient(180deg, #1C2B3F, #0E1726); color: var(--white); }
.cust .screen > div { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; padding: 34px 10px 12px; transition: opacity .35s var(--ease); }
.lock .time { font-size: clamp(1.6rem, 7vw, 2.4rem); font-weight: 300; letter-spacing: -.02em; margin-top: 6px; }
.lock .date { font-size: .62rem; opacity: .8; }
.lock .banner { margin-top: 14px; width: 92%; background: rgba(255, 255, 255, .92); color: var(--text); border-radius: 14px; padding: 8px 10px; display: flex; gap: 8px; align-items: center; opacity: 0; transform: translateY(-14px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.lock .banner.on { opacity: 1; transform: none; }
.lock .banner svg { width: 24px; height: 24px; flex: none; }
.lock .banner b { display: block; font-size: .62rem; }
.lock .banner span { display: block; font-size: .58rem; color: var(--muted); }
.wallet { opacity: 0; }
.wallet .pass { width: 94%; border-radius: 14px; background: var(--ink); color: var(--white); padding: 10px 11px 12px; box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .8); margin-top: 8px; }
.wallet .ph { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .62rem; font-weight: 700; white-space: nowrap; }
.wallet .ph > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wallet .ph > span:last-child { flex: none; }
.wallet .ph i { width: 16px; height: 16px; border-radius: 4px; background: var(--white); display: inline-grid; place-items: center; margin-right: 5px; vertical-align: middle; }
.wallet .ph i::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--marigold); }
.wallet .lab { font-size: .5rem; letter-spacing: .06em; opacity: .75; }
.wallet .grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 12px 4px 10px; }
.wallet .grid i { aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(242, 178, 48, .5); position: relative; }
.wallet .grid i::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; background: radial-gradient(circle, #1D3A5F 0 30%, #F2B230 31%); transform: scale(0); }
.wallet .grid i.f::after { transform: scale(1); }
.wallet .grid i.n::after { animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.wallet .pf { display: flex; justify-content: space-between; font-size: .62rem; }
.wallet .pf .r { text-align: right; }
.wallet .pf b { display: block; font-size: .78rem; }
.wallet .toast { margin-top: 12px; background: var(--white); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: .68rem; font-weight: 700; opacity: 0; transform: translateY(8px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.wallet .toast.on { opacity: 1; transform: none; }
.wallet .toast.win { background: var(--marigold); }

/* Confetti when the card is full */
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; width: 8px; height: 8px; border-radius: 2px; background: var(--marigold); opacity: 0; }
.burst.on i { animation: fly .9s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes fly { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(260deg); opacity: 0; } }

.dots { display: flex; justify-content: center; gap: 8px; padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px)); }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background .2s, transform .2s; }
.dots i.on { background: var(--marigold); transform: scale(1.3); }

@media (min-width: 900px) {
  /* Desktop: captions on the left, the two phones on the right. */
  .stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-rows: minmax(0, 1fr) auto; max-width: var(--max); margin: 0 auto; width: 100%; column-gap: 24px; padding: 72px var(--gutter) 0; }
  .captions { grid-row: 1; grid-column: 1; align-self: center; height: auto; min-height: 220px; margin: 0; }
  .cap { max-width: 460px; margin: 0; padding: 0; }
  .cap b { font-size: 2.3rem; }
  .cap > span { font-size: 1.12rem; margin-top: 10px; }
  .scene { grid-row: 1; grid-column: 2; }
  .dots { grid-column: 1 / -1; }
  .phone { width: 270px; }
  .field { width: 360px; }
}

/* Phones: the three counter steps read as cards, not a bare list */
@media (max-width: 760px) {
  .steps { gap: 12px; }
  .steps li { grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 4px; padding: 18px 18px 18px 16px; background: var(--white); border-radius: 20px; }
  .steps li::before { grid-row: 1 / 3; font-size: 1.9rem; color: var(--marigold); }
  .steps h3 { font-size: 1.15rem; }
  .counter-steps h2, .reasons h2 { margin-bottom: 28px; }
  .wallet .ph .lab { display: none; }
}

/* ---------- Quiet sections ---------- */
main > section:not(.story) { max-width: var(--max); margin: 0 auto; padding: clamp(80px, 12vw, 150px) var(--gutter) 0; }

.counter-steps h2 { margin-bottom: 56px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 56px); counter-reset: step; }
.steps li { counter-increment: step; display: grid; gap: 12px; align-content: start; }
.steps li::before {
  content: counter(step);
  font: 700 2.4rem/1 var(--display); font-variation-settings: "wdth" 80;
  color: var(--ink);
}
.steps p { color: var(--muted); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.reasons h2 { margin-bottom: 56px; }
.reason-list { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: clamp(32px, 6vw, 96px); row-gap: 48px; }
.reason-list article { display: grid; align-content: start; gap: 10px; padding-top: 20px; border-top: 2px solid var(--ink); }
.reason-list p { color: var(--muted); }
@media (max-width: 760px) { .reason-list { grid-template-columns: 1fr; row-gap: 36px; } }

.pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 6vw, 96px); align-items: end; }
.pricing-copy { display: grid; gap: 16px; }
.pricing-copy p { color: var(--muted); }
.price-block { display: grid; gap: 18px; justify-items: start; padding: 32px; background: var(--white); border-radius: 28px; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.amount { font: 800 5.2rem/1 var(--display); font-variation-settings: "wdth" 75; color: var(--ink); letter-spacing: -.03em; }
.per { color: var(--muted); }
.founding { color: var(--text); }
.founding strong { color: var(--ink); }
@media (max-width: 760px) { .pricing { grid-template-columns: minmax(0, 1fr); } .price-block { padding: 24px; } }

.faq h2 { margin-bottom: 32px; }
.faq details { border-bottom: 1px solid var(--line); max-width: 760px; }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative;
  font: 600 1.2rem/1.35 var(--body); color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 14px; height: 14px; margin-top: -9px;
  border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink);
  transform: rotate(45deg); transition: transform .3s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 0 24px; color: var(--muted); }

.closing {
  max-width: none !important; margin-top: clamp(80px, 12vw, 150px) !important;
  padding: clamp(80px, 12vw, 140px) var(--gutter) !important;
  background: var(--ink); color: rgba(255,255,255,.8);
  display: grid; justify-items: center; text-align: center; gap: 22px;
}
.closing h2 { color: var(--white); max-width: 18ch; }

.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 28px var(--gutter); background: var(--ink-deep); color: rgba(255,255,255,.7); font-size: var(--t-small);
}
.footer a { color: rgba(255,255,255,.85); }

/* ---------- Section reveals: quiet, one pass per section ---------- */
.js [data-reveal] h2,
.js .steps li,
.js .reason-list article > *,
.js .price-block,
.js .pricing-copy p,
.js .faq details,
.js .closing > * { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }

.js [data-reveal].in h2,
.js .in .steps li,
.js .in .reason-list article > *,
.js .in .price-block,
.js .in .pricing-copy p,
.js .faq.in details,
.js .closing.in > * { opacity: 1; transform: none; }

/* Counter is a real sequence, so steps arrive in order */
.js .in .steps li:nth-child(2) { transition-delay: .2s; }
.js .in .steps li:nth-child(3) { transition-delay: .4s; }

/* Reasons: the rule above each one draws in, then the text */
.reason-list article { border-top: 0; position: relative; }
.reason-list article::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: var(--ink);
  transform-origin: left;
}
.js .reason-list article::before { transform: scaleX(0); transition: transform .9s var(--ease); }
.js .reasons.in .reason-list article::before { transform: scaleX(1); }
.js .in .reason-list article > * { transition-delay: .25s; }

.js .in .price-block { transition-delay: .1s; }
.js .faq.in details:nth-of-type(n+2) { transition-delay: .06s; }
.js .closing.in > :nth-child(2) { transition-delay: .1s; }
.js .closing.in > :nth-child(3) { transition-delay: .2s; }

/* Reduced motion: no pinned story, show the finished state as a still. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .story { height: auto; }
  .stage { position: static; height: auto; padding-top: 24px; }
  .scene { height: min(70vh, 560px); }
  .captions { height: auto; display: grid; gap: .8em; }
  .cap { position: static; opacity: 1; transform: none; }
  .hint i, .field i, .wallet .grid i.n::after, .burst i { animation: none !important; }
  .wallet .grid i.n::after { transform: scale(1); }
  .js [data-reveal] *, .js [data-reveal] *::before { transition: none !important; }
}

.closing :focus-visible { outline-color: var(--marigold); }

/* ---------- Legal pages ---------- */
.legal-page .nav-static { position: static; background: var(--milk); }
.legal-page .nav nav a { display: inline; }
.legal { max-width: 720px; margin: 0 auto; padding: 32px var(--gutter) 80px; display: grid; gap: 14px; }
.legal h1 { font-size: var(--t-2); margin-bottom: 4px; }
.legal h2 { font-size: var(--t-3); max-width: none; margin-top: 18px; }
.legal p, .legal li { max-width: 68ch; }
.legal ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.legal table { border-collapse: collapse; width: 100%; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.legal th { width: 34%; font-weight: 600; }
.legal .muted { color: var(--muted); }
.draft-note { padding: 10px 14px; border: 1px dashed var(--ink); border-radius: 10px; font-size: var(--t-small); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.small-print { color: var(--muted); font-size: var(--t-small); }

/* Phones: 44px tap targets for footer and legal links */
@media (max-width: 760px) {
  .footer a, .legal-page .nav nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer { align-items: center; }
}
