/* SplitMates public site. No external fonts/scripts: fast, private, CSP-friendly.
   Design tokens mirror the Android app (ui/theme/Theme.kt). */
:root {
  --primary: #7b3ff2;
  --primary-deep: #5a24d6;
  --lilac: #a78bfa;
  --lavender: #f5efff;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #fcfaff;
  --surface: #ffffff;
  --surface-2: #f7f3ff;
  --pos: #15803d;
  --neg: #dc2626;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #7b3ff2 45%, #5a24d6 100%);
  --r-sm: 12px; --r-md: 16px; --r-lg: 24px; --r-xl: 32px;
  --e1: 0 1px 2px rgba(17, 24, 39, .06);
  --e2: 0 4px 14px rgba(91, 36, 214, .10);
  --e3: 0 12px 32px rgba(91, 36, 214, .14);
  --e4: 0 24px 60px rgba(91, 36, 214, .22);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #a78bfa; --primary-deep: #c4b5fd; --lilac: #8b5cf6; --lavender: #231a3d;
    --ink: #f3f0ff; --muted: #a9a3c2; --line: #2d2547; --bg: #0e0b19; --surface: #171228; --surface-2: #1e1834;
    --pos: #4ade80; --neg: #f87171;
    --e2: 0 4px 14px rgba(0, 0, 0, .35); --e3: 0 12px 32px rgba(0, 0, 0, .45); --e4: 0 24px 60px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary: #a78bfa; --primary-deep: #c4b5fd; --lilac: #8b5cf6; --lavender: #231a3d;
  --ink: #f3f0ff; --muted: #a9a3c2; --line: #2d2547; --bg: #0e0b19; --surface: #171228; --surface-2: #1e1834;
  --pos: #4ade80; --neg: #f87171; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); overflow-x: hidden;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 12px; }
p { margin: 0 0 12px; }
.wrap { width: min(1140px, 100% - 32px); margin-inline: auto; }
/* Animated pieces start slightly off to the side; never let that cause sideways scrolling on phones. */
main { overflow-x: clip; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; transition: background .3s, box-shadow .3s;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: saturate(1.4) blur(14px);
}
.site-header.scrolled { box-shadow: 0 1px 0 var(--line), var(--e2); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.logo-mark { width: 38px; height: 38px; display: block; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 760px) { .nav-links a:not(.btn) { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 24px; border-radius: 999px;
  font: inherit; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; font-size: 1rem;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.nav-links a.btn, .btn-primary { background: var(--grad); color: #fff; box-shadow: var(--e3); }
.nav-links a.btn { padding: 9px 18px; font-size: .9rem; color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn .stack { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.btn .stack small { font-weight: 500; font-size: .7rem; opacity: .85; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 56px 0 40px; overflow: hidden; isolation: isolate; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; z-index: -1; animation: drift 18s ease-in-out infinite alternate; }
.blob.b1 { width: 520px; height: 520px; background: #c4b5fd; top: -160px; right: -120px; }
.blob.b2 { width: 380px; height: 380px; background: #f0abfc; bottom: -120px; left: -120px; animation-delay: -6s; opacity: .35; }
.blob.b3 { width: 260px; height: 260px; background: #93c5fd; top: 40%; left: 45%; animation-delay: -12s; opacity: .25; }
@keyframes drift { to { transform: translate(40px, 30px) scale(1.12); } }
.hero-copy { text-align: center; max-width: 820px; margin: 0 auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--lavender); color: var(--primary); font-weight: 700; font-size: .85rem; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 20%, transparent);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.hero h1 { font-size: clamp(2.4rem, 6.4vw, 4.6rem); font-weight: 850; margin: 18px 0 16px; }
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span { display: inline-block; transform: translateY(110%); animation: rise .9s cubic-bezier(.2, .8, .2, 1) forwards; }
.hero h1 .line:nth-child(2) > span { animation-delay: .15s; }
@keyframes rise { to { transform: none; } }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 36em; margin: 0 auto 28px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.fade-up { opacity: 0; transform: translateY(16px); animation: fadeUp .8s .35s cubic-bezier(.2, .8, .2, 1) forwards; }
.fade-up.d2 { animation-delay: .5s; } .fade-up.d3 { animation-delay: .7s; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }

/* Cast of mates with coins flying between them */
.cast { position: relative; height: 260px; max-width: 760px; margin: 48px auto 0; }
.mate { position: absolute; bottom: 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; animation: bob 4s ease-in-out infinite; }
.mate .face {
  width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; font-size: 2.6rem;
  background: var(--surface); box-shadow: var(--e3), inset 0 0 0 4px var(--c, var(--lavender));
}
.mate b { font-size: .85rem; color: var(--ink); }
.mate .tag { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface); box-shadow: var(--e1); }
.mate .tag.pos { color: var(--pos); } .mate .tag.neg { color: var(--neg); }
.mate:nth-of-type(1) { left: 2%; --c: #ede9fe; }
.mate:nth-of-type(2) { left: 27%; bottom: 70px; --c: #fef3c7; animation-delay: -1s; }
.mate:nth-of-type(3) { left: 54%; bottom: 60px; --c: #dcfce7; animation-delay: -2s; }
.mate:nth-of-type(4) { right: 2%; --c: #fee2e2; animation-delay: -3s; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.coin {
  position: absolute; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #7c2d12; font-weight: 800; font-size: .85rem; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(245, 158, 11, .45);
  offset-rotate: 0deg; animation: fly 4.5s cubic-bezier(.45, 0, .55, 1) infinite; opacity: 0;
}
.coin.c1 { offset-path: path("M 80 150 C 180 20, 260 20, 250 90"); }
.coin.c2 { offset-path: path("M 690 150 C 600 10, 480 20, 450 100"); animation-delay: -1.5s; }
.coin.c3 { offset-path: path("M 260 110 C 330 40, 420 40, 450 100"); animation-delay: -3s; }
@keyframes fly { 0% { offset-distance: 0%; opacity: 0; transform: scale(.6); } 15% { opacity: 1; transform: scale(1); } 85% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; transform: scale(.6); } }
.bubble {
  position: absolute; padding: 8px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--e3);
  font-size: .82rem; font-weight: 600; white-space: nowrap; animation: pop 6s ease-in-out infinite; opacity: 0;
}
.bubble.q1 { top: 0; left: 8%; } .bubble.q2 { top: -10px; right: 6%; animation-delay: -3s; }
@keyframes pop { 0%, 100% { opacity: 0; transform: translateY(8px) scale(.9); } 10%, 45% { opacity: 1; transform: none; } 55% { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 640px) {
  /* Phones: the four mates sit in a tidy row and keep floating; two coins hop between neighbours. */
  .cast { height: auto; max-width: 380px; margin: 28px auto 0; padding-top: 52px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; align-items: end; }
  .cast .mate { position: static; }
  .cast .mate:nth-of-type(2), .cast .mate:nth-of-type(3) { margin-bottom: 22px; }
  .mate .face { width: 62px; height: 62px; font-size: 1.85rem; }
  .mate b { font-size: .78rem; }
  .mate .tag { font-size: .64rem; padding: 3px 7px; white-space: nowrap; }
  .bubble.q1 { top: 4px; left: 0; right: 0; margin-inline: auto; width: max-content; font-size: .78rem; }
  .bubble.q2 { display: none; }
  .coin { width: 24px; height: 24px; font-size: .72rem; }
  .coin.c1 { offset-path: path("M 44 120 C 64 54, 104 54, 132 96"); }
  .coin.c2 { offset-path: path("M 316 120 C 296 54, 256 54, 228 96"); }
  .coin.c3 { display: none; }
}

/* ---------- marquee ---------- */
.marquee { overflow: hidden; padding: 22px 0; border-block: 1px solid var(--line); background: var(--surface); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee .track { display: flex; gap: 14px; width: max-content; animation: slide 40s linear infinite; }
.marquee:hover .track { animation-play-state: paused; }
.marquee span { padding: 10px 18px; border-radius: 999px; background: var(--surface-2); font-weight: 600; white-space: nowrap; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
section { padding: 88px 0; }
.alt { background: var(--surface-2); }
.section-head { max-width: 680px; margin: 0 auto 44px; text-align: center; }
.kicker { display: inline-block; color: var(--primary); font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
.section-head p { color: var(--muted); font-size: 1.08rem; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2, .8, .2, 1), transform .8s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* problem chips (chaos -> order) */
.chaos { position: relative; height: 300px; max-width: 900px; margin: 0 auto; }
.chaos .chip {
  position: absolute; left: 50%; top: 50%; padding: 12px 18px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--e3);
  font-weight: 600; white-space: nowrap; transition: transform 1.1s cubic-bezier(.2, .8, .2, 1), opacity .8s;
  transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r));
}
.chaos .chip small { display: block; color: var(--muted); font-weight: 500; font-size: .78rem; }
.chaos.sorted .chip { transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) rotate(0); }
.chaos .total {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.6); opacity: 0;
  padding: 18px 26px; border-radius: var(--r-lg); background: var(--grad); color: #fff; text-align: center; box-shadow: var(--e4);
  transition: transform .8s .5s cubic-bezier(.2, .8, .2, 1), opacity .6s .5s;
}
.chaos .total b { display: block; font-size: 1.6rem; }
.chaos.sorted .total { transform: translate(-50%, -50%) scale(1); opacity: 1; }
@media (max-width: 640px) {
  /* Phones: the scattered spends drop into a neat grid under the trip total. */
  .chaos { height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .chaos .total { position: static; grid-column: 1 / -1; order: -1; transform: scale(.85); transition-delay: 0s; }
  .chaos.sorted .total { transform: none; }
  .chaos .chip { position: static; white-space: normal; font-size: .9rem; opacity: 0; transform: translate(var(--mx, -18px), 36px) rotate(var(--r)); }
  .chaos .chip:nth-of-type(even) { --mx: 18px; }
  .chaos.sorted .chip { opacity: 1; transform: none; }
  .chaos .chip:nth-of-type(1) { transition-delay: .25s; } .chaos .chip:nth-of-type(2) { transition-delay: .33s; }
  .chaos .chip:nth-of-type(3) { transition-delay: .41s; } .chaos .chip:nth-of-type(4) { transition-delay: .49s; }
  .chaos .chip:nth-of-type(5) { transition-delay: .57s; } .chaos .chip:nth-of-type(6) { transition-delay: .65s; }
}

/* ---------- scroll story (sticky phone) ---------- */
.story { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.story-phone { position: sticky; top: 100px; }
.story-steps .step { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; opacity: .3; transition: opacity .5s; }
.story-steps .step.active { opacity: 1; }
.story-steps .num { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; margin-bottom: 14px; box-shadow: var(--e2); }
.story-steps h3 { font-size: 1.7rem; }
.story-steps p { color: var(--muted); font-size: 1.05rem; max-width: 30em; }
@media (max-width: 860px) {
  /* Phones and tablets: no sticky scroll. The phone plays the four steps on its own; each step is a
     tappable card with a progress bar showing when the next one comes up. */
  .story { grid-template-columns: 1fr; gap: 22px; }
  .story-phone { position: relative; top: 0; }
  .story-phone .phone { width: min(260px, 72vw); }
  .story-steps { display: grid; gap: 10px; }
  .story-steps .step { min-height: 0; display: block; position: relative; overflow: hidden; padding: 16px 18px; border-radius: var(--r-lg);
    background: var(--surface); border: 1px solid var(--line); opacity: .6; cursor: pointer; transition: opacity .4s, box-shadow .4s, transform .4s, border-color .4s; }
  .story-steps .step.active { opacity: 1; box-shadow: var(--e3); transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
  .story-steps .step.active::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--grad); animation: stepfill var(--step-ms, 3600ms) linear forwards; }
  .story-steps .num { width: 32px; height: 32px; margin-bottom: 8px; font-size: .9rem; }
  .story-steps h3 { font-size: 1.15rem; margin-bottom: 4px; }
  .story-steps p { font-size: .95rem; margin: 0; }
}
@keyframes stepfill { to { width: 100%; } }

.phone {
  width: min(310px, 100%); margin-inline: auto; padding: 10px; border-radius: 44px; background: #15102a;
  box-shadow: var(--e4), inset 0 0 0 2px #2b2448; position: relative;
}
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; width: 90px; height: 22px; transform: translateX(-50%); background: #15102a; border-radius: 0 0 14px 14px; z-index: 3; }
.screen { position: relative; border-radius: 36px; overflow: hidden; background: #fcfaff; aspect-ratio: 9 / 18.5; color: #111827; }
.scene { position: absolute; inset: 0; padding: 46px 16px 16px; opacity: 0; transform: translateY(16px) scale(.98); transition: opacity .55s, transform .55s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; gap: 10px; }
.scene.on { opacity: 1; transform: none; }
.s-head { border-radius: 20px; padding: 14px; background: linear-gradient(135deg, #8b5cf6, #5a24d6); color: #fff; }
.s-head small { opacity: .85; font-size: .72rem; } .s-head b { display: block; font-size: 1.35rem; }
.s-card { background: #fff; border-radius: 16px; padding: 11px 12px; box-shadow: 0 2px 10px rgba(91, 36, 214, .08); font-size: .8rem; display: flex; align-items: center; gap: 10px; }
.s-card .em { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #f5efff; font-size: 1rem; flex: none; }
.s-card .grow { flex: 1; min-width: 0; } .s-card small { display: block; color: #6b7280; font-size: .68rem; }
.s-card .amt { font-weight: 800; } .amt.pos { color: #15803d; } .amt.neg { color: #dc2626; }
.s-btn { margin-top: auto; text-align: center; padding: 12px; border-radius: 999px; background: linear-gradient(135deg, #8b5cf6, #5a24d6); color: #fff; font-weight: 700; font-size: .85rem; }
.receipt { position: relative; background: #fff; border-radius: 14px; padding: 14px; font: .72rem/1.7 ui-monospace, Consolas, monospace; box-shadow: 0 2px 10px rgba(0, 0, 0, .08); overflow: hidden; }
.receipt .row { display: flex; justify-content: space-between; }
.receipt .scanline { position: absolute; left: 0; right: 0; height: 3px; background: #7b3ff2; box-shadow: 0 0 16px 4px rgba(123, 63, 242, .5); animation: scan 2.2s ease-in-out infinite alternate; }
@keyframes scan { from { top: 0; } to { top: calc(100% - 3px); } }
.picks { display: flex; gap: 6px; flex-wrap: wrap; }
.picks span { padding: 5px 10px; border-radius: 999px; background: #f5efff; font-size: .7rem; font-weight: 700; color: #5a24d6; }
.picks span.on { background: #7b3ff2; color: #fff; }
.check { width: 64px; height: 64px; border-radius: 50%; background: #22c55e; display: grid; place-items: center; margin: 18px auto 4px; box-shadow: 0 10px 30px rgba(34, 197, 94, .45); }
.scene.on .check { animation: popIn .6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes popIn { from { transform: scale(0); } }
.center { text-align: center; }

/* ---------- features ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--e2); border: 1px solid var(--line); transition: transform .3s, box-shadow .3s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--e3); }
.card h3 { font-size: 1.15rem; margin-top: 14px; }
.card p { color: var(--muted); margin: 0; }
.ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; background: var(--lavender); }

/* ---------- invite demo ---------- */
.duo { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .duo { grid-template-columns: 1fr; } }
.duo h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
.duo p { color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; }
.ticks li::before { content: "✓"; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--lavender); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.invite-demo { position: relative; display: grid; gap: 14px; }
.invite-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--e3); }
.invite-card .top { display: flex; gap: 12px; align-items: center; }
.invite-card .em { width: 46px; height: 46px; border-radius: 14px; background: var(--lavender); display: grid; place-items: center; font-size: 1.4rem; }
.invite-card small { color: var(--muted); display: block; }
.invite-card .acts { display: flex; gap: 8px; margin-top: 14px; }
.invite-card .acts span { flex: 1; text-align: center; padding: 9px; border-radius: 999px; font-weight: 700; font-size: .88rem; }
.acts .yes { background: var(--grad); color: #fff; } .acts .no { box-shadow: inset 0 0 0 1.5px var(--line); }
.invite-demo .sms { justify-self: start; max-width: 85%; padding: 10px 14px; border-radius: 18px 18px 18px 4px; background: var(--surface); box-shadow: var(--e2); font-size: .9rem; }
.invite-demo .joined { justify-self: end; padding: 10px 16px; border-radius: 999px; background: color-mix(in srgb, var(--success) 15%, var(--surface)); color: var(--pos); font-weight: 700; }
.invite-demo.in .sms { animation: fadeUp .6s both; }
.invite-demo.in .invite-card { animation: fadeUp .6s .5s both; }
.invite-demo.in .acts .yes { animation: press .5s 1.6s both; }
.invite-demo.in .joined { animation: fadeUp .6s 2.1s both; }
.invite-demo .sms, .invite-demo .invite-card, .invite-demo .joined { opacity: 0; }
.invite-demo.in .sms, .invite-demo.in .invite-card, .invite-demo.in .joined { opacity: 1; }
@keyframes press { 50% { transform: scale(.92); box-shadow: 0 0 0 8px color-mix(in srgb, var(--primary) 25%, transparent); } }

/* ---------- export fan ---------- */
.files { position: relative; height: 280px; display: flex; justify-content: center; align-items: center; }
.file {
  position: absolute; width: 150px; height: 190px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e3);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 14px; transition: transform 1s cubic-bezier(.2, .8, .2, 1);
}
.file .badge { position: absolute; top: 14px; left: 14px; padding: 4px 10px; border-radius: 8px; color: #fff; font-weight: 800; font-size: .78rem; }
.file .bars { display: flex; gap: 5px; align-items: flex-end; height: 70px; margin-bottom: 10px; }
.file .bars i { flex: 1; border-radius: 4px 4px 0 0; background: var(--lilac); opacity: .8; }
.file small { color: var(--muted); font-weight: 600; }
.files.in .f1 { transform: translateX(-140px) rotate(-10deg); }
.files.in .f3 { transform: translateX(140px) rotate(10deg); }
.files.in .f2 { transform: translateY(-12px); }
@media (max-width: 520px) { .files.in .f1 { transform: translateX(-90px) rotate(-10deg); } .files.in .f3 { transform: translateX(90px) rotate(10deg); } .file { width: 120px; height: 160px; } }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { text-align: center; padding: 22px 12px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--e2); border: 1px solid var(--line); }
.stat b { display: block; font-size: 2rem; font-weight: 850; }
.stat span { color: var(--muted); font-size: .9rem; }

/* ---------- split types ---------- */
.split-types { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pill { padding: 10px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); color: var(--muted); }
.pill b { color: var(--ink); }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 20px; box-shadow: var(--e1); }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary); transition: transform .3s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 16px; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 48px; background: var(--grad); color: #fff;
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; box-shadow: var(--e4);
}
.cta-band::before, .cta-band::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12); animation: drift 12s ease-in-out infinite alternate; }
.cta-band::before { width: 260px; height: 260px; right: -60px; top: -80px; }
.cta-band::after { width: 180px; height: 180px; left: 30%; bottom: -90px; animation-delay: -5s; }
.cta-band > * { position: relative; }
.cta-wrap { margin-top: 88px; }
@media (max-width: 640px) { .cta-wrap { margin-top: 56px; } }
.cta-band h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.cta-band p { opacity: .9; margin: 0; }
.cta-band .btn { background: #fff; color: var(--primary-deep); }
@media (max-width: 600px) { .cta-band { padding: 32px 24px; } }

/* ---------- join page ---------- */
.join { min-height: calc(100vh - 68px - 140px); display: grid; place-items: center; padding: 48px 0; position: relative; overflow: hidden; isolation: isolate; }
.join-card { width: min(460px, 100%); text-align: center; background: var(--surface); border-radius: var(--r-xl); padding: 36px 28px; box-shadow: var(--e4); border: 1px solid var(--line); }
.join-card .big { font-size: 3rem; animation: bob 3s ease-in-out infinite; }
.code { display: inline-block; margin: 14px 0 18px; padding: 12px 22px; border-radius: var(--r-md); background: var(--lavender); color: var(--primary); font: 800 1.6rem/1 ui-monospace, Consolas, monospace; letter-spacing: .18em; }
.join-card .btn { width: 100%; justify-content: center; margin-top: 10px; }
.join-card .muted { color: var(--muted); font-size: .92rem; }

/* ---------- footer ---------- */
.site-footer { padding: 36px 0 48px; color: var(--muted); font-size: .92rem; border-top: 1px solid var(--line); margin-top: 88px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: center; }
.foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ---------- legal pages ---------- */
.legal { padding: 48px 0 0; }
.legal article { max-width: 780px; }
.legal h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.legal h2 { font-size: 1.25rem; margin: 32px 0 8px; }
.legal p, .legal li { color: var(--muted); }
.legal table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .95rem; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { color: var(--ink); }
.updated { color: var(--muted); font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal, .fade-up, .hero h1 .line > span, .invite-demo .sms, .invite-demo .invite-card, .invite-demo .joined { opacity: 1 !important; transform: none !important; }
  .coin, .bubble { display: none; }
  .chaos .chip { transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) !important; }
  .chaos .total { opacity: 1; transform: translate(-50%, -50%); }
}

/* ---------- room sharing demo ---------- */
.room-demo { display: grid; gap: 10px; }
.room-month { border-radius: var(--r-lg); padding: 18px 20px; background: var(--grad); color: #fff; box-shadow: var(--e3); }
.room-month small { display: block; opacity: .85; font-size: .82rem; }
.room-month b { display: block; font-size: 1.9rem; margin: 2px 0; }
.room-bill { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e2); }
.room-bill .em { width: 40px; height: 40px; border-radius: 12px; background: var(--lavender); display: grid; place-items: center; font-size: 1.2rem; flex: none; }
.room-bill .grow { flex: 1; font-weight: 700; }
.room-bill small { display: block; color: var(--muted); font-weight: 500; font-size: .8rem; }
.room-bill .tag { font-weight: 700; font-size: .85rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.room-bill .tag.ok { color: var(--pos); background: color-mix(in srgb, var(--success) 14%, var(--surface)); }
.room-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.room-chips span { padding: 8px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .88rem; }
.room-demo.in .room-bill { animation: fadeUp .6s both; }
.room-demo.in .room-bill:nth-child(3) { animation-delay: .15s; }
.room-demo.in .room-bill:nth-child(4) { animation-delay: .3s; }

@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  .chaos .chip, .chaos .total { opacity: 1 !important; transform: none !important; }
  .coin { display: none; }
}

/* ---------- phone polish ---------- */
@media (max-width: 640px) {
  section { padding: 56px 0; }
  .section-head { margin-bottom: 28px; }
  .section-head h2 { font-size: 1.65rem; }
  .hero { padding-top: 36px; }
  .lead { font-size: 1.02rem; }
  .cta-row .btn { flex: 1 1 auto; justify-content: center; }
  /* Feature cards: icon beside the text instead of tall stacked cards. */
  .grid-3 { gap: 12px; }
  .grid-3 .card { display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; row-gap: 2px; padding: 16px 18px; align-items: start; }
  .grid-3 .card .ico { grid-row: span 2; width: 44px; height: 44px; font-size: 1.3rem; }
  .grid-3 .card h3 { margin: 2px 0 2px; font-size: 1.05rem; }
  .grid-3 .card p { font-size: .93rem; }
  /* Export fan: narrower so the file names stay readable. */
  .files { height: 220px; }
  .file { width: 112px; height: 148px; padding: 12px; }
  .file .bars { height: 52px; }
  .file small { font-size: .72rem; }
  .files.in .f1 { transform: translateX(-104px) rotate(-8deg); }
  .files.in .f3 { transform: translateX(104px) rotate(8deg); }
  .duo { gap: 28px; }
  .stats { gap: 10px; }
  .stat b { font-size: 1.7rem; }
  .split-types { gap: 8px; }
  .pill { padding: 8px 12px; font-size: .9rem; }
  .cta-band { margin-top: 0; text-align: center; justify-content: center; }
  .cta-band .btn { width: 100%; justify-content: center; }
  .site-footer { margin-top: 56px; }
  .foot { flex-direction: column; align-items: flex-start; }
}
