/* cartmath.app: the same tokens and type as the app (DESIGN.md). */

@font-face { font-family: Manrope; font-weight: 500; font-display: swap; src: url('/fonts/Manrope_500Medium.ttf') format('truetype'); }
@font-face { font-family: Manrope; font-weight: 700; font-display: swap; src: url('/fonts/Manrope_700Bold.ttf') format('truetype'); }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url('/fonts/Manrope_800ExtraBold.ttf') format('truetype'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 600; font-display: swap; src: url('/fonts/IBMPlexMono_600SemiBold.ttf') format('truetype'); }

:root {
  --paper: #f7f5f0;
  --surface: #ffffff;
  --ink: #17201b;
  --on-ink: #ffffff;
  --ink-muted: #5a6660;
  --price-was: #646d69;
  --line: #e4e0d8;
  --savings: #1f7a4d;
  --savings-tint: #e7f2ec;
  --tag: #f5b83d;
  --on-tag: #17201b;
  --over: #b3261e;
  --focus: #1f7a4d;
  --bezel: #17201b;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101512;
    --surface: #1a211d;
    --ink: #eef1ec;
    --on-ink: #17201b;
    --ink-muted: #a3ada7;
    --price-was: #8a938e;
    --line: #2c3530;
    --savings: #4cc38a;
    --savings-tint: #163021;
    --over: #f07a6e;
    --focus: #4cc38a;
    --bezel: #2c3530;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 1rem/1.5 Manrope, system-ui, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-weight: 600; font-variant-numeric: tabular-nums; }
.green { color: var(--savings); }
.muted { color: var(--ink-muted); }
.strong { font-weight: 700; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
.wrap.narrow { max-width: 720px; }
.section { padding-top: 96px; padding-bottom: 96px; }
.band { background: var(--surface); padding: 96px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

h1 { font-weight: 800; font-size: 2.5rem; line-height: 1.08; letter-spacing: -1px; }
h2 { font-weight: 800; font-size: 2rem; line-height: 1.15; letter-spacing: -0.6px; }
h3 { font-weight: 700; font-size: 1.0625rem; line-height: 1.35; }
.lede { color: var(--ink-muted); font-size: 1.125rem; line-height: 1.6; }
.sub { color: var(--ink-muted); margin-top: 8px; }
.eyebrow { color: var(--ink-muted); font-weight: 800; font-size: 0.75rem; line-height: 1rem; letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 12px; }
@media (min-width: 900px) {
  h1 { font-size: 3.5rem; letter-spacing: -1.5px; }
  h2 { font-size: 2.5rem; letter-spacing: -1px; }
}

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 12px max(24px, env(safe-area-inset-right)) 12px max(24px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 24px; }
.wordmark { font: 600 0.875rem/1.25rem 'IBM Plex Mono', ui-monospace, monospace; letter-spacing: 2px; text-decoration: none; }
.nav { display: none; gap: 24px; margin-left: auto; font-weight: 700; font-size: 0.9375rem; }
.nav a { text-decoration: none; color: var(--ink-muted); }
.nav a:hover { color: var(--ink); }
.topbar .button-small { margin-left: auto; }
@media (min-width: 760px) {
  .nav { display: flex; }
  .topbar .button-small { margin-left: 0; }
}

/* Buttons and form */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 28px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--on-ink);
  font: 700 1rem/1 Manrope, system-ui, sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.button:disabled { opacity: 0.6; cursor: default; }
.button-small { min-height: 44px; padding: 0 18px; font-size: 0.9375rem; }

.join { display: grid; gap: 12px; margin-top: 28px; max-width: 520px; }
.join-fields { display: flex; gap: 8px; }
.join input {
  min-height: 56px; min-width: 0; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink);
  font: 500 1rem/1 Manrope, system-ui, sans-serif;
}
.join input[name='email'] { flex: 1; }
.join input.zip { width: 104px; flex: none; }
.join input::placeholder { color: var(--ink-muted); }
.join .hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.form-note { color: var(--ink-muted); font-weight: 600; font-size: 0.8125rem; line-height: 1.4; }
.join.joined .join-fields, .join.joined button { display: none; }
.join.joined .form-note { color: var(--savings); font-size: 1rem; font-weight: 700; }
@media (min-width: 560px) {
  .join { grid-template-columns: 1fr auto; align-items: start; }
  .join .form-note { grid-column: 1 / -1; }
}

/* Hero */
.hero { display: grid; gap: 56px; padding-top: 56px; padding-bottom: 72px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 16px; }
.pill { align-self: flex-start; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 700; font-size: 0.8125rem; }
.example-note { color: var(--ink-muted); font-weight: 600; font-size: 0.8125rem; }
.hero .example-note { text-align: center; }
@media (min-width: 960px) {
  .hero { grid-template-columns: 1.05fr 1fr; padding-top: 80px; }
  .hero .example-note { grid-column: 2; margin-top: -32px; }
}

/* Phone mockups: drawn in HTML with the app's own tokens */
.phone {
  width: 264px; height: 540px; flex: none;
  padding: 10px; border-radius: 44px; background: var(--bezel);
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.35);
}
.screen {
  height: 100%; overflow: hidden; border-radius: 34px; background: var(--paper); color: var(--ink);
  padding: 30px 14px 14px; display: flex; flex-direction: column; gap: 8px;
  font-size: 11px; line-height: 1.35;
}
.phone-dark { --paper: #101512; --surface: #1a211d; --ink: #eef1ec; --ink-muted: #a3ada7; --line: #2c3530; --savings: #4cc38a; --savings-tint: #163021; --bezel: #2c3530; }
.phone-dark .screen { color: var(--ink); }
.s-eyebrow { color: var(--ink-muted); font-weight: 800; font-size: 8.5px; letter-spacing: 0.5px; text-transform: uppercase; }
.s-title { font-weight: 800; font-size: 19px; line-height: 1.15; letter-spacing: -0.3px; }
.s-small { font-size: 10px; font-weight: 600; }
.s-card { background: var(--surface); border-radius: 14px; padding: 10px; }
.s-total { display: flex; justify-content: space-between; background: var(--surface); border-radius: 999px; padding: 8px 12px; font-weight: 700; }
.s-aisle { color: var(--ink-muted); font-weight: 800; font-size: 8.5px; letter-spacing: 0.5px; text-transform: uppercase; margin-top: 4px; }
.s-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.s-row:last-child { border-bottom: 0; }
.s-item { flex: 1; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.s-row.done .s-item { text-decoration: line-through; color: var(--ink-muted); }
.box { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; }
.s-row.done .box { background: var(--savings); border-color: var(--savings); color: #fff; }
.box svg { width: 10px; height: 10px; }
.s-progress { display: flex; gap: 10px; align-items: center; }
.s-progress strong { display: block; }
.ring { width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: 10px; flex: none; }
.s-dinner { display: grid; gap: 3px; }
.s-day { color: var(--ink-muted); font-weight: 800; font-size: 8px; letter-spacing: 0.5px; text-transform: uppercase; }
.s-line { display: flex; justify-content: space-between; gap: 8px; }
.s-meta { color: var(--ink-muted); display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 10px; }
.s-hero-saved { background: var(--savings-tint); display: grid; gap: 2px; }
.s-figure { font-weight: 800; font-size: 40px; line-height: 1.1; letter-spacing: -1px; }
.s-bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 8px; font-size: 10px; font-weight: 600; }
.bar i { height: 9px; border-radius: 999px; background: var(--line); position: relative; overflow: hidden; }
.bar i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 999px; }
.muted-fill::after { background: var(--ink-muted); }
.green-fill::after { background: var(--savings); }
.tape { align-self: center; width: 88%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 3px; font-size: 9.5px; }
.tape-title { letter-spacing: 2px; }
.tape-line { display: flex; justify-content: space-between; }
.s-option { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; font-weight: 700; }
.s-option.selected { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.s-button { margin-top: auto; text-align: center; border: 1px solid var(--line); border-radius: 999px; padding: 10px; font-weight: 700; background: var(--surface); }
.s-result { margin-top: auto; background: var(--savings-tint); border-radius: 14px; padding: 12px; font-size: 12px; }

/* Sale tag: marigold with a notched left edge, like a shelf tag (DESIGN.md) */
.tag {
  display: inline-flex; align-items: center; padding: 1px 6px 1px 9px;
  background: var(--tag); color: var(--on-tag); border-radius: 3px;
  font-family: Manrope, system-ui, sans-serif; font-weight: 800; font-size: 0.6em; letter-spacing: 0.5px; text-transform: uppercase;
  clip-path: polygon(5px 0, 100% 0, 100% 100%, 5px 100%, 0 50%);
}

.hero-phones { position: relative; height: 580px; display: flex; justify-content: center; align-items: center; }
.hero-phones .phone { position: absolute; }
.phone-back { transform: translateX(-34%) rotate(-6deg) scale(0.92); opacity: 0.97; }
.phone-front { transform: translateX(26%) rotate(4deg); }
.chip {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 12px 30px -12px rgb(0 0 0 / 0.3); font-weight: 700; font-size: 0.875rem; white-space: nowrap;
}
.chip .tag { font-size: 0.6875rem; }
.chip-sale { bottom: 21%; left: -4%; }
.chip-saved { bottom: 9%; right: -2%; }
@media (max-width: 480px) {
  .hero-phones { height: 520px; }
  .hero-phones .phone { width: 228px; height: 470px; }
  .phone-back { transform: translateX(-30%) rotate(-6deg) scale(0.9); }
  .phone-front { transform: translateX(22%) rotate(4deg); }
  .chip { font-size: 0.8125rem; padding: 8px 12px; }
  .chip-sale { left: -4px; }
  .chip-saved { right: -4px; }
}

/* How it works */
.steps { list-style: none; margin: 48px 0 0; padding: 0; display: grid; gap: 16px; }
.steps li { background: var(--paper); border-radius: 24px; padding: 24px; display: grid; gap: 8px; }
.steps p, .features p, .card p { color: var(--ink-muted); }
.step-n { width: 36px; height: 36px; border-radius: 999px; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; margin-bottom: 8px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }

/* What's included */
.included { margin-top: 56px; display: grid; gap: 48px; justify-items: center; align-items: center; }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; width: 100%; max-width: 520px; }
.features li { display: flex; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.features h3 { margin-bottom: 4px; }
.icon { width: 44px; height: 44px; border-radius: 12px; background: var(--paper); display: grid; place-items: center; flex: none; color: var(--ink); }
.icon svg { width: 24px; height: 24px; }
.section > .example-note { margin-top: 24px; }
@media (min-width: 900px) { .included { grid-template-columns: auto 1fr; gap: 72px; } }

/* Why */
.cards { margin-top: 48px; display: grid; gap: 16px; }
.card { background: var(--paper); border-radius: 24px; padding: 28px; display: grid; gap: 10px; align-content: start; }
.card .icon { background: var(--surface); margin-bottom: 8px; }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(3, 1fr); } }

/* Spotlight */
.spotlight { display: grid; gap: 48px; align-items: center; justify-items: center; }
.spotlight > div:first-child { display: grid; gap: 16px; max-width: 520px; }
.spotlight h2 { margin-bottom: 4px; }
@media (min-width: 900px) { .spotlight { grid-template-columns: 1fr auto; justify-items: start; } }

/* FAQ */
details { border-bottom: 1px solid var(--line); }
details:first-of-type { margin-top: 40px; border-top: 1px solid var(--line); }
summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; font-weight: 700; font-size: 1.0625rem; }
summary::-webkit-details-marker { display: none; }
summary svg { width: 20px; height: 20px; flex: none; color: var(--ink-muted); transition: transform 0.2s; }
details[open] summary svg { transform: rotate(180deg); }
details p { color: var(--ink-muted); padding-bottom: 20px; max-width: 640px; }

/* Closing */
.closing { display: grid; justify-items: center; text-align: center; gap: 8px; }
.closing .join { width: 100%; text-align: left; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--ink-muted); font-weight: 600; font-size: 0.8125rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.footer .wordmark { color: var(--ink); }
.footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-left: auto; }
.footer nav a { min-height: 44px; display: inline-flex; align-items: center; }

/* Terms, Privacy and 404 (built by build.ts) */
.page { width: 100%; max-width: 560px; margin: 0 auto; padding: 24px max(24px, env(safe-area-inset-right)) 32px max(24px, env(safe-area-inset-left)); flex: 1; display: flex; flex-direction: column; }
.page .hero { display: flex; flex-direction: column; justify-content: center; gap: 16px; flex: 1; padding: 48px 0; }
.page .button { align-self: flex-start; margin-top: 16px; }
.page footer { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--ink-muted); font-weight: 600; font-size: 0.8125rem; line-height: 1.4; }
.page footer p { flex-basis: 100%; }
.page footer a { min-height: 44px; display: inline-flex; align-items: center; }
.doc { padding: 32px 0 48px; }
.doc h1 { font-size: 2.125rem; letter-spacing: -0.6px; margin-bottom: 8px; }
.doc h2 { margin: 24px 0 4px; font-size: 1.375rem; line-height: 1.75rem; letter-spacing: -0.3px; }
