/* DinnerSum website. Every colour, radius, duration and curve comes from
   design-system/project/tokens.json. Each colour has one job:
   paper = page, ink = text, teal = action and receipt-confirmed prices,
   saffron = the highlighter behind one total, paprika = errors only. */

:root {
  color-scheme: light dark;

  --paper: #f4f3ef;
  --paper-raised: #ffffff;
  --paper-sunken: #e9e8e2;
  --ink: #17201f;
  --ink-muted: #525b59;
  --line: #dcdad3;
  --line-strong: #7a807d;
  --teal: #0f5f5b;
  --teal-pressed: #0a4a47;
  --teal-soft: #dcedea;
  --on-teal: #ffffff;
  --saffron: #f2c14b;
  --saffron-soft: #fbedc4;
  --on-saffron: #17201f;
  --paprika: #b03a1f;
  --paprika-soft: #fae3da;

  --font-sans: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --tap-min: 48px;

  --dur-press: 90ms;
  --dur-fade: 160ms;
  --dur-move: 260ms;
  --dur-signature: 620ms;
  --ease-arrive: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-settle: cubic-bezier(0.34, 1.25, 0.64, 1);

  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111615;
    --paper-raised: #1a201f;
    --paper-sunken: #0b0f0e;
    --ink: #eceeeb;
    --ink-muted: #a1aaa7;
    --line: #2a3230;
    --line-strong: #6e7875;
    --teal: #5dbfb3;
    --teal-pressed: #4aa89c;
    --teal-soft: #15332f;
    --on-teal: #0a1716;
    --saffron: #edbd48;
    --saffron-soft: #3a3016;
    --paprika: #ff8b6d;
    --paprika-soft: #3b1e17;
  }
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ease-settle: linear(0, 0.059 4.8%, 0.195 9.7%, 0.362 14.5%, 0.528 19.4%, 0.719 25.8%, 0.861 32.3%, 0.971 40.3%, 1.023 48.4%, 1.038 58.1%, 1.027 71%, 1.011 83.9%, 1);
  }
}

@media (min-width: 768px) {
  :root { --gutter: 32px; }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; }
img, svg { max-width: 100%; }

a { color: var(--teal); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: var(--gutter); top: -80px; z-index: 10;
  display: inline-flex; align-items: center; min-height: var(--tap-min); padding: 0 var(--space-4);
  background: var(--paper-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
}
.skip:focus { top: var(--space-2); }

.wrap { width: 100%; max-width: 1136px; margin-inline: auto; padding-inline: var(--gutter); }

.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.num { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Header ---------- */

.top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-block: var(--space-2); }
.wordmark { display: inline-flex; align-items: center; min-height: var(--tap-min); color: var(--ink); font-size: 1.375rem; line-height: 1.75rem; font-weight: 700; text-decoration: none; }
.top-nav { display: flex; margin-right: -10px; }
.top-nav a { display: inline-flex; align-items: center; min-height: var(--tap-min); min-width: var(--tap-min); justify-content: center; padding: 0 10px; font-size: 0.9375rem; text-decoration: none; }
.top-nav a:hover { text-decoration: underline; }
.top-nav a[aria-current="page"] { color: var(--ink); }

@media (min-width: 768px) {
  .top { padding-block: var(--space-4); }
  .top-nav { margin-right: -16px; }
  .top-nav a { padding: 0 var(--space-4); font-size: 1.0625rem; }
}

/* ---------- Tear line: the receipt's own divider ---------- */

.tear { display: block; width: 100%; height: 4px; overflow: hidden; }
.tear line { stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 10 8; stroke-linecap: round; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap-min); padding: 0 var(--space-6);
  font: inherit; font-size: 1.0625rem; line-height: 1.5rem; font-weight: 700; text-decoration: none;
  color: var(--ink); background: var(--paper-raised);
  border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--dur-move) var(--ease-settle);
}
.btn:active { transform: scale(0.98); transition-duration: var(--dur-press); transition-timing-function: ease-out; }
.btn:focus-visible { border-radius: var(--radius-md); }
.btn--primary { color: var(--on-teal); background: var(--teal); border-color: var(--teal); }
.btn--primary:active { background: var(--teal-pressed); border-color: var(--teal-pressed); }
.btn[disabled] { cursor: default; color: var(--ink-muted); background: var(--paper-sunken); border-color: var(--line-strong); transform: none; }

/* ---------- Hero ---------- */

.hero { padding-block: var(--space-8) 56px; display: grid; gap: 40px; }
.hero h1 {
  font-size: clamp(2.125rem, 1.35rem + 3.4vw, 3.5rem);
  line-height: 1.08; font-weight: 700; letter-spacing: -0.02em;
  max-width: 13em; text-wrap: balance;
}
.hero-lead { margin-top: var(--space-4); font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem); line-height: 1.45; max-width: 31em; }
.hero-cta { margin-top: var(--space-8); max-width: 31rem; }
.hero-price { margin-top: var(--space-6); max-width: 31rem; font-size: 0.9375rem; line-height: 1.375rem; color: var(--ink-muted); }

@media (min-width: 940px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 72px; align-items: start; padding-block: 56px 96px; }
  .hero-demo { margin-top: var(--space-2); }
}

/* ---------- Waitlist form ---------- */

.field-label { display: block; margin-bottom: var(--space-2); font-size: 0.9375rem; line-height: 1.25rem; font-weight: 600; }
.wl-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.wl-row .input { flex: 1 1 15rem; min-width: 0; }
.wl-row .btn { flex: 0 0 auto; }
.input {
  width: 100%; min-height: var(--tap-min); padding: 0 var(--space-4);
  font: inherit; font-size: 1.0625rem; color: var(--ink);
  background: var(--paper-sunken); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
}
.input::placeholder { color: var(--ink-muted); opacity: 1; }
.input:focus-visible { border-radius: var(--radius-md); }
.input[aria-invalid="true"] { border-color: var(--paprika); border-width: 2px; }
.wl-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.wl-note { margin-top: var(--space-3); font-size: 0.9375rem; line-height: 1.375rem; color: var(--ink-muted); }
.wl-msg { display: flex; align-items: flex-start; gap: var(--space-2); margin-top: var(--space-3); font-size: 0.9375rem; line-height: 1.375rem; font-weight: 600; }
.wl-msg .ico { margin-top: 2px; }
.wl-msg--error { color: var(--paprika); }
.wl-msg--busy { color: var(--ink-muted); }
.wl-msg[hidden] { display: none; }
.wl-done { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-md); }
.wl-done .ico { width: 24px; height: 24px; margin-top: 2px; }
.wl-done strong { display: block; font-size: 1.1875rem; line-height: 1.75rem; }
.wl-done:focus-visible { border-radius: var(--radius-md); }
@media (max-width: 420px) { .wl-row .btn { flex: 1 1 100%; } }

/* ---------- Product UI: week total, list, price tags ---------- */

.demo-label { margin-bottom: var(--space-2); font-size: 0.9375rem; line-height: 1.25rem; font-weight: 600; color: var(--ink-muted); }
.demo-note { margin-top: var(--space-3); font-size: 0.9375rem; line-height: 1.375rem; color: var(--ink-muted); }
.hero-demo { max-width: 420px; }

.total { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-4) var(--space-6); }
.total-kicker { font-size: 0.8125rem; line-height: 1.125rem; color: var(--ink-muted); }
.total-label { margin: var(--space-3) 0 var(--space-1); font-size: 0.9375rem; line-height: 1.25rem; font-weight: 600; }
.total-amount { font-family: var(--font-mono); font-size: 2.125rem; line-height: 2.5rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.highlight { display: inline-block; background: var(--saffron); color: var(--on-saffron); border-radius: var(--radius-sm); padding: 0 var(--space-2); }
.meter { height: 8px; margin: var(--space-4) 0 var(--space-2); border-radius: 4px; background: var(--paper-sunken); overflow: hidden; }
.meter > span { display: block; width: 86.6%; height: 100%; border-radius: 4px; background: var(--ink); }
.status { display: flex; align-items: center; gap: var(--space-1); font-size: 0.9375rem; line-height: 1.25rem; font-weight: 600; }
.receipts { display: flex; gap: 3px; margin: var(--space-6) 0 var(--space-2); }
.receipts > i { flex: 1; height: 10px; border-radius: 2px; border: 1px dashed var(--line-strong); transition: background-color var(--dur-fade) linear, border-color var(--dur-fade) linear; }
.receipts > i.r { background: var(--teal); border: 1px solid var(--teal); }
.receipts-note { font-size: 0.8125rem; line-height: 1.125rem; color: var(--ink-muted); }
.receipts-note b { color: var(--teal); font-weight: 600; }

.list { margin-top: var(--space-3); background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-md); list-style: none; }
.item { display: flex; align-items: center; gap: var(--space-3); min-height: var(--tap-min); padding: var(--space-3) var(--space-4); }
.item + .item { border-top: 1px solid var(--line); }
.item-name { flex: 1; min-width: 0; }
.item-meta { display: block; font-size: 0.8125rem; line-height: 1.125rem; color: var(--ink-muted); }
.item-price { flex: none; text-align: right; }

.price {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; gap: var(--space-1);
  min-height: 32px; padding: 0 var(--space-2);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 1.0625rem; line-height: 1.5rem; font-weight: 500;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  transition: color var(--dur-fade) linear;
}
.price--receipt { background: var(--teal-soft); color: var(--teal); }
.price--estimate { color: var(--ink-muted); border: 1px dashed var(--line-strong); }
.price--pantry { background: var(--paper-sunken); color: var(--ink-muted); font-family: var(--font-sans); font-size: 0.9375rem; font-weight: 600; }
.price-label { display: block; margin-top: 2px; font-size: 0.8125rem; line-height: 1.125rem; color: var(--ink-muted); text-align: right; }

/* Settle motion parts, added by site.js only while an estimate becomes a receipt price. */
.price.is-settling { border-color: transparent; }
.price.is-real { color: var(--teal); }
.settle-fill { position: absolute; inset: -1px; z-index: -1; border-radius: var(--radius-sm); background: var(--teal-soft); clip-path: inset(0 100% 0 0); }
.settle-edge { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); overflow: visible; pointer-events: none; max-width: none; }
.settle-edge rect { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 4 4; }
.settle-icon { display: inline-flex; width: 0; margin-right: -4px; opacity: 0; overflow: hidden; }
.settle-icon path { stroke-dasharray: 1; }
.price-approx { display: inline-block; overflow: hidden; white-space: nowrap; }
.roll { display: inline-flex; align-items: flex-start; white-space: nowrap; }
.roll > span { display: block; }
.roll-col { overflow: hidden; }
.roll-strip, .roll-strip > span { display: block; }

/* The highlighter stroke draws once, when the page first shows the total. */
@keyframes stroke {
  from { clip-path: polygon(0 0, 10px 0, 0 100%, 0 100%); }
  to { clip-path: polygon(0 0, calc(100% + 10px) 0, 100% 100%, 0 100%); }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.highlight--draw { animation: stroke var(--dur-signature) var(--ease-arrive) 200ms backwards; }

/* ---------- Sections ---------- */

.band { padding-block: 56px; }
.split { display: grid; gap: var(--space-6); }
.band h2 { font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2rem); line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
.band-intro { margin-top: var(--space-3); color: var(--ink-muted); max-width: 30em; }
h3 { font-size: 1.1875rem; line-height: 1.625rem; font-weight: 700; }

@media (min-width: 940px) {
  .band { padding-block: 88px; }
  .split { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 72px; }
}

/* How it works: three receipt lines, name on the left, the thing you get on the right. */
.steps { list-style: none; counter-reset: step; border-top: 1px solid var(--line); }
.step { counter-increment: step; display: grid; grid-template-columns: 2rem minmax(0, 1fr); column-gap: var(--space-3); row-gap: var(--space-3); padding-block: var(--space-6); border-bottom: 1px solid var(--line); }
.step::before { content: counter(step); font-family: var(--font-mono); font-size: 1.1875rem; line-height: 1.625rem; font-weight: 700; }
.step p { margin-top: var(--space-1); color: var(--ink-muted); max-width: 30em; }
.step-out { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--space-2); border-radius: var(--radius-sm); background: var(--paper-sunken); font-size: 0.9375rem; font-weight: 600; }
.step-sum { font-family: var(--font-mono); font-size: 1.1875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.step-out .ico { color: var(--ink-muted); }

@media (min-width: 640px) {
  .step { grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: start; }
  .step-out { grid-column: 3; justify-content: flex-end; max-width: 15.5rem; padding-top: 2px; }
}

/* Teal means real */
.real-copy p + p { margin-top: var(--space-3); }
.real-copy { max-width: 30em; }
.real-demo .list { margin-top: 0; }
.real-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin-top: var(--space-4); }
.real-status { font-size: 0.9375rem; line-height: 1.375rem; color: var(--ink-muted); }

/* Price: written as a bill */
.bill { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-md); list-style: none; }
.bill-row { display: flex; align-items: baseline; gap: var(--space-4); padding: var(--space-4); }
.bill-row + .bill-row { border-top: 1px solid var(--line); }
.bill-what { flex: 1; min-width: 0; }
.bill-what strong { display: block; }
.bill-what span { display: block; font-size: 0.9375rem; line-height: 1.375rem; color: var(--ink-muted); }
.bill-price { flex: none; text-align: right; font-family: var(--font-mono); font-size: 1.0625rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.bill-price b { font-weight: 700; }
.bill-price small { display: block; font-family: var(--font-sans); font-size: 0.8125rem; color: var(--ink-muted); }
.fine { margin-top: var(--space-4); font-size: 0.9375rem; line-height: 1.375rem; color: var(--ink-muted); max-width: 38em; }
.fine + .fine { margin-top: var(--space-2); }

/* Privacy facts */
.facts { display: grid; gap: var(--space-6); list-style: none; }
.fact { padding-top: var(--space-4); border-top: 1px solid var(--line-strong); }
.fact p { margin-top: var(--space-2); color: var(--ink-muted); }
.after-facts { margin-top: var(--space-6); }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); } }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 56px; padding-block: var(--space-3); font-size: 1.0625rem; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 12px; height: 12px; margin-right: 4px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-3px) rotate(45deg); }
.faq details[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.faq details p { padding-bottom: var(--space-4); color: var(--ink-muted); max-width: 38em; }

/* Closing action */
.closing { max-width: 31rem; }
.closing h2 { margin-bottom: var(--space-6); }

/* ---------- Footer ---------- */

.foot { padding-block: var(--space-8) 48px; font-size: 0.9375rem; line-height: 1.375rem; color: var(--ink-muted); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 0 var(--space-6); margin: var(--space-4) 0 var(--space-3) ; list-style: none; }
.foot-nav a { display: inline-flex; align-items: center; min-height: var(--tap-min); }
.foot p + p { margin-top: var(--space-2); }

/* ---------- Document pages: privacy, terms, support, delete account ---------- */

.doc { max-width: 46rem; padding-block: var(--space-6) 72px; }
.doc h1 { font-size: clamp(1.875rem, 1.5rem + 1.8vw, 2.625rem); line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.doc-meta { margin-top: var(--space-3); color: var(--ink-muted); }
.doc h2 { margin-top: 48px; font-size: 1.375rem; line-height: 1.75rem; font-weight: 700; scroll-margin-top: var(--space-4); }
.doc h3 { margin-top: var(--space-6); }
.doc p, .doc ul, .doc ol, .doc .table-wrap, .doc .card { margin-top: var(--space-3); }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc li + li { margin-top: var(--space-2); }
.doc li::marker { color: var(--ink-muted); }
.card { padding: var(--space-4); background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-md); }
.card > :first-child { margin-top: 0; }
.card h2 { margin-top: 0; font-size: 1.1875rem; line-height: 1.625rem; }
.toc { columns: 2 15rem; column-gap: var(--space-8); }
.toc li { break-inside: avoid; }
.toc a { font-weight: 400; display: inline-block; padding-block: 6px; }
.doc .toc li + li { margin-top: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper-raised); }
.table-wrap:focus-visible { border-radius: var(--radius-md); }
table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.375rem; }
th, td { padding: var(--space-3) var(--space-4); text-align: left; vertical-align: top; }
th { font-weight: 700; }
tbody tr { border-top: 1px solid var(--line); }
.ph { padding: 0 4px; border: 1px dashed var(--line-strong); border-radius: 4px; background: var(--saffron-soft); color: var(--ink); font-family: var(--font-mono); font-size: 0.9em; font-weight: 500; }
.path { font-weight: 700; }

/* ---------- Reduced motion: movement becomes a short fade ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .highlight--draw { animation: fade-in var(--dur-fade) linear backwards; }
  .btn, .btn:active { transition: none; transform: none; }
}
