/* ============================================================
   Divvy — landing page
   Three sections, no filler. The demo and the shared receipt do
   the explaining; the copy just names things.
   ============================================================ */
:root {
  --bg: #f7f4ee;
  --bg-2: #fffdf8;
  --ink: #14120e;
  --ink-2: #423d34;
  --muted: #7d766a;
  --line: #e3ddd0;
  --line-2: #d4ccbb;
  --brand: #4f46e5;
  --brand-2: #7c6cf6;
  --brand-soft: #eeecff;
  --ok: #059669;
  --paper: #fffdf6;
  --chat-bg: #ece5db;
  --bubble-me: #dcf8c6;
  --bubble-them: #ffffff;
  --bubble-ink: #10231a;
  --r: 14px;
  --r-lg: 22px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sh: 0 1px 2px rgba(40, 30, 10, 0.05), 0 10px 30px rgba(40, 30, 10, 0.07);
  --sh-lg: 0 30px 70px rgba(40, 30, 10, 0.16);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --wrap: 1060px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0c11;
    --bg-2: #10131a;
    --ink: #f2f4f8;
    --ink-2: #c9cfdb;
    --muted: #8b93a4;
    --line: #222836;
    --line-2: #2e3648;
    --brand: #8b86ff;
    --brand-2: #a99cff;
    --brand-soft: #191d33;
    --ok: #34d399;
    --paper: #171a21;
    --chat-bg: #0d1418;
    --bubble-me: #10402f;
    --bubble-them: #1d252e;
    --bubble-ink: #e7eef0;
    --sh: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.4);
    --sh-lg: 0 30px 70px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter,
    Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2 { letter-spacing: -0.035em; line-height: 1.08; margin: 0; }
em { font-style: normal; }

/* ── buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 620;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: #fff;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 10px 26px rgba(79, 70, 229, 0.36); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-lg { padding: 15px 28px; font-size: 16px; }

/* ── nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 14px 24px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 750;
  font-size: 17px;
  letter-spacing: -0.03em;
  text-decoration: none;
  margin-right: auto;
}
.brand img { border-radius: 8px; }
.ghost-link {
  text-decoration: none;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 550;
}
.ghost-link:hover { color: var(--ink); }

/* ── hero ── */
.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 46px 24px 64px;
  display: grid;
  grid-template-columns: 1fr 0.92fr;
  gap: 52px;
  align-items: center;
}
.hero h1 { font-size: clamp(34px, 4.9vw, 54px); font-weight: 780; }
.hero h1 em {
  background: linear-gradient(180deg, transparent 62%, color-mix(in srgb, var(--brand) 26%, transparent) 0);
}
.lede {
  font-size: clamp(17px, 1.7vw, 20px);
  color: var(--ink-2);
  margin: 18px 0 28px;
  max-width: 22em;
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.microcopy { color: var(--muted); font-size: 13.5px; margin: 16px 0 0; }

/* Product Hunt badge — sits below the CTA, clearly separated from it so it
   reads as social proof rather than a second call to action. */
.ph-badge {
  display: inline-block;
  margin-top: 28px;
  line-height: 0;
  border-radius: 10px;
  transition: transform 0.15s var(--ease), opacity 0.2s var(--ease);
}
.ph-badge:hover { transform: translateY(-2px); }
.ph-badge:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}
.ph-badge img { width: 250px; height: 54px; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 28px; }
}

/* ── phone ── */
.hero-demo { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.phone {
  position: relative;
  width: 296px;
  height: 566px;
  border-radius: 42px;
  background: #0e1016;
  padding: 11px;
  box-shadow: var(--sh-lg), 0 0 0 1.5px rgba(255, 255, 255, 0.07) inset;
}
.phone-notch {
  position: absolute;
  top: 11px; left: 50%;
  transform: translateX(-50%);
  width: 106px; height: 22px;
  background: #0e1016;
  border-radius: 0 0 14px 14px;
  z-index: 3;
}
.phone-screen {
  position: relative;
  height: 100%;
  border-radius: 32px;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
}
@media (max-width: 380px) { .phone { width: 262px; height: 520px; } }

/* step pills double as the demo's controls */
.pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pills button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.pills button:hover { color: var(--ink); border-color: var(--ink-2); }
.pills button i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--line-2);
  transition: all 0.2s var(--ease);
}
.pills button.on {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-soft);
}
.pills button.on i { background: var(--brand); transform: scale(1.35); }

/* ── screens inside the phone ── */
.scr {
  position: absolute;
  inset: 0;
  padding: 44px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: scr-in 0.42s var(--ease) both;
}
@keyframes scr-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.scr h4 { margin: 0; font-size: 17px; font-weight: 720; letter-spacing: -0.03em; }
.scr .sub { font-size: 12px; color: var(--muted); margin-top: -6px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-2);
  animation: pop 0.32s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: scale(0.82); } to { opacity: 1; transform: none; } }
.chip .d { width: 8px; height: 8px; border-radius: 50%; }
.chip.tag { font-size: 11.5px; padding: 5px 9px; border-width: 1.5px; background: transparent; }
.chip.tag.on { border-color: currentColor; background: color-mix(in srgb, currentColor 10%, transparent); }

.mini {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  padding: 11px 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  display: grid;
  gap: 7px;
}
.mini .row { display: flex; justify-content: space-between; gap: 10px; }
.mini .dash { border-top: 1.5px dashed var(--line-2); margin: 2px 0; }
.mini .muted { color: var(--muted); }

.dish {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: var(--bg-2);
  display: grid;
  gap: 8px;
  animation: pop 0.32s var(--ease) both;
}
.dish .dh { display: flex; justify-content: space-between; font-size: 13px; font-weight: 620; }
.dish .dh span:last-child { font-family: var(--mono); }
.dish .per { font-size: 10.5px; color: var(--muted); font-family: var(--mono); }

.scanbox {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  padding: 16px 14px;
  overflow: hidden;
  display: grid;
  gap: 8px;
}
.scanbox i {
  display: block;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--line-2), var(--line), var(--line-2));
  background-size: 200% 100%;
  animation: shim 1.4s linear infinite;
}
.scanbox i:nth-child(1) { width: 70%; }
.scanbox i:nth-child(2) { width: 92%; animation-delay: 0.1s; }
.scanbox i:nth-child(3) { width: 55%; animation-delay: 0.2s; }
.scanbox i:nth-child(4) { width: 84%; animation-delay: 0.3s; }
.scanbox i:nth-child(5) { width: 64%; animation-delay: 0.4s; }
@keyframes shim { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.beam {
  position: absolute;
  left: 0; right: 0;
  height: 40px; top: -40px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--brand) 32%, transparent), transparent);
  animation: beam 1.6s var(--ease) infinite;
}
@keyframes beam { to { top: 100%; } }
.ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 9px;
  border-radius: 999px;
}

.sharecard {
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 16px 14px 18px;
  font-family: var(--mono);
  font-size: 12px;
  display: grid;
  gap: 9px;
}
.sharecard .ttl { text-align: center; font-weight: 750; letter-spacing: 0.14em; font-size: 11px; color: var(--muted); }
.sharecard .who { display: flex; justify-content: space-between; }
.stamp {
  margin: 6px auto 0;
  border: 2.5px solid #c8102e;
  color: #c8102e;
  border-radius: 8px;
  padding: 5px 14px;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 15px;
  transform: rotate(-8deg);
  opacity: 0.85;
  animation: stampin 0.4s var(--ease) both;
}
@keyframes stampin {
  from { opacity: 0; transform: rotate(-8deg) scale(1.7); }
  to { opacity: 0.85; transform: rotate(-8deg) scale(1); }
}
.sent { display: flex; align-items: center; gap: 7px; justify-content: center; font-size: 12px; color: var(--ok); font-weight: 650; }

/* ── sections ── */
.section { max-width: var(--wrap); margin: 0 auto; padding: 68px 24px; }

/* everyone pays for what they ate */
.fair-wrap { border-top: 1px solid var(--line); }
.fair {
  display: grid;
  grid-template-columns: 1fr 0.92fr;
  gap: 56px;
  align-items: start;
}
.fair h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 770; }
.fair p { color: var(--ink-2); margin: 18px 0 0; font-size: 16.5px; line-height: 1.68; }
.fair-vis {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 22px;
  font-family: var(--mono);
  font-size: 13px;
  display: grid;
  gap: 15px;
  box-shadow: var(--sh);
}
.fv-row { display: grid; gap: 7px; }
.fv-top { display: flex; justify-content: space-between; font-size: 12.5px; }
.fv-bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.fv-bar span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 0.9s var(--ease); }
.fv-note {
  color: var(--muted);
  font-size: 12.5px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  border-top: 1px dashed var(--line-2);
  padding-top: 13px;
}
@media (max-width: 900px) { .fair { grid-template-columns: 1fr; gap: 32px; } }

/* the shared receipt, sitting in a chat */
.share {
  display: grid;
  grid-template-columns: 1fr 0.86fr;
  gap: 56px;
  align-items: start;
  border-top: 1px solid var(--line);
}
.share h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 770; }
.share p {
  color: var(--ink-2);
  margin: 18px 0 0;
  max-width: 27em;
  font-size: 16.5px;
  line-height: 1.68;
}
@media (max-width: 900px) { .share { grid-template-columns: 1fr; gap: 34px; } }

.chat {
  background: var(--chat-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 16px 20px;
  display: grid;
  gap: 10px;
  justify-items: end;
  box-shadow: var(--sh);
}
.chat-day {
  justify-self: center;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  background: color-mix(in srgb, var(--bubble-them) 70%, transparent);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 2px;
}
.bubble {
  max-width: 84%;
  border-radius: 14px;
  padding: 9px 11px;
  font-size: 14px;
  color: var(--bubble-ink);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
  animation: rise 0.5s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.bubble.me { background: var(--bubble-me); border-bottom-right-radius: 4px; padding: 8px 8px 6px; }
.bubble.them {
  background: var(--bubble-them);
  justify-self: start;
  border-bottom-left-radius: 4px;
  animation-delay: 0.5s;
}
.bubble.them:last-child { animation-delay: 0.85s; }
.bubble .who { display: block; font-size: 11.5px; font-weight: 700; color: var(--brand); margin-bottom: 1px; }
.bubble .tick { display: block; text-align: right; font-size: 10.5px; color: color-mix(in srgb, var(--bubble-ink) 55%, transparent); margin-top: 4px; }

/* the receipt image inside the bubble */
.rcpt {
  --z: 7px;
  background: #fffdf6;
  color: #1a1712;
  font-family: var(--mono);
  padding: 16px 14px 14px;
  display: grid;
  gap: 6px;
  -webkit-mask:
    radial-gradient(circle var(--z) at 50% 0, #0000 97%, #000 100%) top center / calc(var(--z) * 2.15) var(--z) repeat-x,
    radial-gradient(circle var(--z) at 50% 100%, #0000 97%, #000 100%) bottom center / calc(var(--z) * 2.15) var(--z) repeat-x,
    linear-gradient(#000, #000) center / 100% calc(100% - var(--z) * 2) no-repeat;
  mask:
    radial-gradient(circle var(--z) at 50% 0, #0000 97%, #000 100%) top center / calc(var(--z) * 2.15) var(--z) repeat-x,
    radial-gradient(circle var(--z) at 50% 100%, #0000 97%, #000 100%) bottom center / calc(var(--z) * 2.15) var(--z) repeat-x,
    linear-gradient(#000, #000) center / 100% calc(100% - var(--z) * 2) no-repeat;
}
.rcpt-top { text-align: center; font-size: 9.5px; font-weight: 700; letter-spacing: 0.2em; color: #8b8271; }
.rcpt-name { text-align: center; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.rcpt-date { text-align: center; font-size: 10.5px; color: #8b8271; margin-top: -3px; }
.rcpt-rule { border-top: 1.5px dashed #d9d1bf; margin: 4px 0 2px; }
.rcpt-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.rcpt-row b { font-weight: 700; }
.rcpt-row.total { font-weight: 800; font-size: 13.5px; }
.rcpt-stamp {
  justify-self: center;
  margin-top: 4px;
  border: 2px solid #c8102e;
  color: #c8102e;
  border-radius: 6px;
  padding: 3px 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 13px;
  transform: rotate(-7deg);
  opacity: 0.85;
}
.rcpt-foot { text-align: center; font-size: 9.5px; color: #8b8271; margin-top: 4px; }

/* ── closer ── */
/* Left-aligned like everything else: one rail down the whole page. */
.closer { padding-block: 72px 92px; border-top: 1px solid var(--line); }
.closer h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 770; }
.closer-copy {
  max-width: 30em;
  margin: 18px 0 30px;
  color: var(--ink-2);
  font-size: 16.5px;
  line-height: 1.68;
}

/* ── footer ── */
.foot { border-top: 1px solid var(--line); background: var(--bg-2); }
.foot-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 26px 24px 8px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.foot-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -0.02em; }
.foot-brand img { border-radius: 6px; }
.foot nav { margin-left: auto; display: flex; gap: 20px; }
.foot nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.foot nav a:hover { color: var(--ink); }
.foot-note { max-width: var(--wrap); margin: 0 auto; padding: 0 24px 28px; color: var(--muted); font-size: 12.5px; }

/* Stacking on phones doubles the height, so pull the padding in */
@media (max-width: 700px) {
  .section { padding: 46px 20px; }
  .hero { padding: 22px 20px 44px; }
  .closer { padding-block: 52px 68px; }
  .chat { padding: 14px 12px 16px; }
  .foot-inner { padding: 22px 20px 8px; }
  .foot-note { padding: 0 20px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
