/* billz.me home: a scrolling story. Same tokens as the app (tokens.json). */
:root {
  --ink: #0F0B1E;
  --ink-raised: #1B1530;
  --ink-line: #2B2445;
  --paper: #F7F4FF;
  --lime: #C8FF2E;
  --pink: #FF4FA3;
  --blue: #5B8CFF;
  --gold: #FFC93C;
  --muted: #B9B2D6;
  --gutter: 16px;
  --display: "Bricolage Grotesque", Inter, system-ui, sans-serif;
  /* A spring (stiffness 170, damping 18) sampled into CSS. */
  --spring: linear(0, 0.13 4.1%, 0.48 10.6%, 0.86 18.7%, 1.03 24.4%, 1.1 29.4%,
    1.1 34.4%, 1.05 41.2%, 0.99 50.3%, 0.98 58%, 1 72%, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 17px/1.55 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.lime { color: var(--lime); }

/* Nav ---------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  background: rgba(15, 11, 30, 0.72);
  border-bottom: 1px solid rgba(185, 178, 214, 0.08);
}
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 56px; }
.logo { font-family: var(--display); font-weight: 800; font-size: 24px; color: var(--lime); text-decoration: none; }
.nav nav { margin-left: auto; display: flex; gap: 20px; align-items: center; font-size: 14px; }
.nav nav a { text-decoration: none; color: var(--muted); }
.nav nav a:hover { color: var(--paper); }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--lime); color: var(--ink) !important;
  font-weight: 700; text-decoration: none; border-radius: 999px;
  padding: 10px 18px; font-size: 15px;
  transition: transform 0.5s var(--spring);
}
.pill:hover { transform: scale(1.04); }
.pill:active { transform: scale(0.96); }
.nav .pill { padding: 7px 14px; font-size: 14px; }
@media (max-width: 560px) { .nav nav a:not(.pill) { display: none; } }

/* Hero ---------------------------------------------------------------------- */
.hero { padding: 72px 0 40px; text-align: center; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: -10% 0 auto; height: 620px; z-index: -1;
  background: radial-gradient(closest-side, rgba(200, 255, 46, 0.16), transparent 70%) 50% 60% / 720px 520px no-repeat,
              radial-gradient(closest-side, rgba(91, 140, 255, 0.18), transparent 70%) 20% 30% / 520px 420px no-repeat;
}
.eyebrow { font-size: 15px; font-weight: 700; color: var(--lime); letter-spacing: 0.02em; margin-bottom: 16px; }
.hero h1 { font-size: clamp(44px, 9vw, 96px); line-height: 0.98; }
.hero .sub { font-size: clamp(18px, 2.4vw, 22px); color: var(--muted); max-width: 560px; margin: 24px auto 0; }
.ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.store {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid rgba(185, 178, 214, 0.25); border-radius: 14px;
  padding: 9px 16px; text-align: left; text-decoration: none;
  background: rgba(27, 21, 48, 0.6);
}
.store svg { width: 22px; height: 22px; flex: none; }
.store small { display: block; font-size: 11px; color: var(--muted); line-height: 1.2; }
.store b { font-size: 15px; line-height: 1.2; }
.store.soon { opacity: 0.75; }

/* Phone and swipe deck --------------------------------------------------- */
.phone {
  width: min(320px, 82vw); aspect-ratio: 9 / 19.5;
  margin: 56px auto 0; position: relative;
  border-radius: 52px; padding: 12px;
  background: linear-gradient(145deg, #2a2440, #0b0816);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 40px 120px rgba(0, 0, 0, 0.6), 0 0 80px rgba(200, 255, 46, 0.08);
}
.screen {
  position: relative; height: 100%; border-radius: 42px; overflow: hidden;
  background: var(--ink); display: flex; flex-direction: column;
}
.island { position: absolute; top: 10px; left: 50%; translate: -50% 0; width: 92px; height: 26px; border-radius: 20px; background: #000; z-index: 3; }
.appbar { display: flex; align-items: center; justify-content: space-between; padding: 46px 18px 8px; }
.appbar b { font-family: var(--display); font-size: 22px; color: var(--lime); }
.appbar span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); opacity: 0.6; }
.deck { position: relative; flex: 1; margin: 6px 14px; }
.bill {
  position: absolute; inset: 0; border-radius: 26px; padding: 18px;
  background: var(--ink-raised); display: flex; flex-direction: column;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  will-change: transform; transform-origin: 50% 110%;
  text-align: left;
}
.bill .photo {
  flex: 1; border-radius: 16px; background: #fff; margin-bottom: 14px; overflow: hidden;
  display: flex; flex-direction: column; gap: 7px; padding: 0 12px 12px;
}
.bill .photo i { display: block; height: 8px; border-radius: 3px; background: #dedede; }
.bill .photo i.cover { background: #bdbdbd; height: 10px; }
.bill .photo .head { height: 34px; margin: 0 -12px 6px; }
.bill .photo .due { color: #111; font: 700 15px/1 Inter, sans-serif; margin-top: auto; }
.bill .photo .code { height: 34px; width: 58%; border-radius: 4px; }
.bill .tag { font-size: 12px; color: var(--muted); }
.bill .amt { font-family: var(--display); font-weight: 800; font-size: 40px; color: var(--lime); line-height: 1.05; }
.bill .what { font-weight: 700; font-size: 15px; line-height: 1.3; margin-top: 4px; }
.bill .glow { position: absolute; inset: 0; border-radius: 26px; pointer-events: none; opacity: 0; box-shadow: inset 0 0 0 3px var(--lime), 0 0 40px rgba(200, 255, 46, 0.35); }
.bill .stamp {
  position: absolute; top: 24px; left: 22px; rotate: -14deg; opacity: 0;
  border: 3px solid var(--lime); color: var(--lime); border-radius: 10px;
  font-family: var(--display); font-weight: 800; font-size: 20px; padding: 2px 10px;
}
.actions { display: flex; justify-content: center; gap: 22px; padding: 12px 0 26px; }
.actions span { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; border: 2px solid; }
.actions .skip { color: var(--pink); }
.actions .save { color: var(--blue); width: 38px; height: 38px; align-self: center; }
.actions .pay { color: var(--ink); background: var(--lime); border-color: var(--lime); }
.boat {
  position: absolute; left: 50%; top: 46%; translate: -50% -50%; opacity: 0; z-index: 2;
  font-family: var(--display); font-weight: 800; color: var(--paper); font-size: 14px; text-align: center; width: 80%;
}
.boat svg { width: 64px; display: block; margin: 0 auto 6px; }

/* Story chapters ---------------------------------------------------------- */
section { padding: 120px 0; }
.chapter { text-align: center; }
.kicker { font-size: 15px; font-weight: 700; color: var(--lime); margin-bottom: 14px; }
.chapter h2 { font-size: clamp(36px, 6.4vw, 72px); line-height: 1.02; max-width: 900px; margin: 0 auto; }
.chapter .lede { font-size: clamp(18px, 2.4vw, 22px); color: var(--muted); max-width: 620px; margin: 24px auto 0; }

.big-number { font-family: var(--display); font-weight: 800; font-size: clamp(88px, 20vw, 220px); line-height: 0.9; color: var(--lime); font-variant-numeric: tabular-nums; }

.lines { max-width: 860px; margin: 0 auto; text-align: left; }
/* Without JS everything is simply shown. */
.lines p {
  font-family: var(--display); font-weight: 800; font-size: clamp(30px, 5.4vw, 60px); line-height: 1.08;
  letter-spacing: -0.02em; color: var(--paper); transition: opacity 0.4s;
  margin-bottom: 18px;
}
.js .lines p { opacity: 0.18; }
.js .lines p.on { opacity: 1; }
.lines p .lime { color: var(--lime); }

/* Steps */
.steps { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); margin-top: 56px; text-align: left; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--ink-raised); border-radius: 28px; padding: 28px;
  border: 1px solid rgba(185, 178, 214, 0.08);
}
.step .n { font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--ink); background: var(--lime); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 18px; }
.step h3 { font-size: 24px; margin-bottom: 8px; }
.step p { color: var(--muted); }

/* Covered bill */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; text-align: left; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; gap: 40px; } }
.split h2 { font-size: clamp(34px, 5.4vw, 60px); line-height: 1.04; }
.split .lede { margin: 20px 0 0; max-width: none; text-align: left; }
.paper {
  background: #fff; border-radius: 20px; padding: 0 0 28px; overflow: hidden; max-width: 420px; width: 100%; margin: 0 auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); rotate: -2deg; color: #111; font-size: 13px;
}
.paper .top { background: #2060C8; color: #fff; font-weight: 700; padding: 18px 24px; font-size: 16px; letter-spacing: 0.02em; }
.paper .row { position: relative; margin: 12px 24px 0; width: fit-content; }
.paper .row::after {
  content: ""; position: absolute; inset: -4px -6px; border-radius: 6px; background: #c9c9c9;
  transform-origin: left;
}
.js .paper .row::after { transform: scaleX(0); }
.js .paper.covered .row::after { transform: scaleX(1); transition: transform 0.7s var(--spring); }
.paper.covered .row:nth-child(3)::after { transition-delay: 0.08s; }
.paper.covered .row:nth-child(4)::after { transition-delay: 0.16s; }
.paper.covered .row:nth-child(5)::after { transition-delay: 0.24s; }
.paper.covered .row:nth-child(6)::after { transition-delay: 0.32s; }
.paper .bars { margin: 18px 24px 0; display: grid; gap: 9px; }
.paper .bars i { display: block; height: 9px; background: #e6e6e6; border-radius: 3px; }
.paper .total { margin: 22px 24px 0; font-weight: 700; font-size: 22px; }
.checks { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.checks li { display: flex; gap: 12px; color: var(--muted); }
.checks li::before { content: "✓"; color: var(--lime); font-weight: 800; }
.checks b { color: var(--paper); }

/* Quiet */
.quiet h2 { font-size: clamp(40px, 7vw, 84px); line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 40px; }
.chips span { border: 1px solid var(--ink-line); border-radius: 999px; padding: 10px 18px; color: var(--muted); text-decoration: line-through; text-decoration-color: var(--pink); text-decoration-thickness: 2px; }
.milestones { display: flex; gap: 10px; justify-content: center; margin-top: 48px; flex-wrap: wrap; }
.milestones span {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 22px;
  background: var(--ink-raised); color: var(--muted); border: 2px solid var(--ink-line);
}
.milestones span.got { background: var(--lime); color: var(--ink); border-color: var(--lime); }

/* Closing */
.energy { text-align: center; padding: 140px 0 120px; position: relative; }
.energy::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(closest-side, rgba(200, 255, 46, 0.14), transparent) 50% 55% / 900px 600px no-repeat;
}
.energy h2 { font-size: clamp(52px, 12vw, 150px); line-height: 0.92; color: var(--lime); }
.energy .whale { width: 150px; margin: 0 auto 28px; display: block; }
.energy .lede { font-size: clamp(18px, 2.4vw, 24px); color: var(--paper); max-width: 640px; margin: 28px auto 0; }

footer { border-top: 1px solid var(--ink-line); padding: 32px 0 48px; font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--paper); }
footer .end { margin-left: auto; }

/* Reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(40px) scale(0.98); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.6s ease-out, transform 0.9s var(--spring); }
.reveal.in.d1 { transition-delay: 0.08s; }
.reveal.in.d2 { transition-delay: 0.16s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .reveal.in { opacity: 1; transform: none; transition: opacity 0.3s; }
  .lines p { opacity: 1; transition: none; }
  .js .paper .row::after { transform: scaleX(1); transition: none !important; }
  .pill { transition: none; }
}
