/* ── Swapped · landing page ──────────────────────────────────────────
   Mobile-first. No frameworks, no web fonts. This has to render fast
   inside the TikTok in-app browser.
   ------------------------------------------------------------------ */

:root {
  color-scheme: light;            /* stop browsers auto-inverting the page */

  --bg:          #FBF7F0;
  --surface:     #FFFFFF;
  --ink:         #1C211D;
  --muted:       #6C7269;
  --line:        #E7DFD3;

  --green:       #1F6F4A;
  --green-deep:  #185839;
  --green-soft:  #E8F3EC;

  --warm:        #B8492A;
  --warm-soft:   #FBEDE8;

  --radius:      14px;
  --gutter:      20px;
  --measure:     30rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main { overflow-x: hidden; }

section, footer {
  padding: 0 var(--gutter);
  margin-inline: auto;
  max-width: var(--measure);
}

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.18; }
p  { margin: 0; }

/* ── hero ───────────────────────────────────────────────────────── */

.hero { padding-top: 40px; padding-bottom: 48px; }

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 14px;
}

.hero h1 { font-size: clamp(1.9rem, 7.5vw, 2.5rem); font-weight: 700; }

.sub {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.55;
}

/* ── form ───────────────────────────────────────────────────────── */

#capture-form { margin-top: 26px; }

.field + .field { margin-top: 12px; }

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  font: inherit;
  font-size: 16px;                /* < 16px makes iOS zoom on focus */
  padding: 15px 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder { color: #A8A79E; }

.field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.field input.invalid { border-color: var(--warm); }

.or-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: #A8A79E;
  font-size: 0.8125rem;
}

.or-line::before,
.or-line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.attach {
  display: block;
  width: 100%;
  padding: 15px 14px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--green);
  background: var(--surface);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.attach:active { background: var(--green-soft); }

.attach[data-attached="true"] {
  border-style: solid;
  border-color: var(--green);
  background: var(--green-soft);
}

.attach-name {
  margin-top: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--green);
  overflow-wrap: anywhere;
}

.attach-hint {
  margin-top: 8px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}

.error {
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--warm);
}

.btn {
  display: block;
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #fff;
  background: var(--green);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.06s ease;
}

.btn:active { background: var(--green-deep); transform: scale(0.99); }
.btn[disabled] { opacity: 0.6; cursor: default; }

.microtrust {
  margin-top: 14px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ── coming-soon badge + store lines ────────────────────────────── */

.badge {
  display: inline-block;
  margin-top: 18px;
  padding: 7px 13px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
}

.field-help {
  margin-top: 12px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

/* Plain text, not Apple/Google's badge assets. Those have usage rules and
   we don't have an app yet. Naming the stores is fine. */
.stores {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
}

.stores li {
  padding: 8px 13px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* ── demo ───────────────────────────────────────────────────────── */

.demo { padding-bottom: 44px; }
.demo h2, .how h2 { font-size: 1.3rem; margin-bottom: 16px; }

.swap-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
}

/* One photo identifies the dish. Deliberately NOT a before/after pair:
   the converted version hasn't been cooked, so there's nothing honest to show. */
.dish-photo {
  margin: -20px -20px 18px;        /* bleed to the card edges */
  aspect-ratio: 4 / 3;             /* reserve the box so nothing jumps on load */
  overflow: hidden;
  border-radius: 18px 18px 0 0;
  background: #F0EADF;
}

.dish-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* The thumbnail is the creator's frame, so the credit sits with it, and it
   doubles as the way to go and check the original. */
.credit {
  margin: 0 0 14px;
  font-size: 0.8125rem;
}

.credit a {
  display: block;               /* natural text flow: long handles wrap cleanly */
  text-decoration: none;
  color: inherit;
}

.credit-sep { color: #C3B9A8; padding: 0 5px; }

.credit-handle {
  font-weight: 700;
  color: var(--ink);
}

.credit-action {
  font-weight: 600;
  color: var(--green);
}

.credit a:active .credit-action { opacity: 0.6; }

.assumptions {
  margin-top: 14px;
  padding: 11px 13px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
  background: var(--bg);
  border-radius: 10px;
}

.assumptions strong { color: #565C54; }

.swap-card h3 { font-size: 1.125rem; }

.swap-card .problem {
  margin-top: 6px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
}

.ings {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9375rem;
}

.ings li {
  padding: 3px 0 3px 18px;
  position: relative;
  color: #4A5048;
}

.ings li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: #A8A79E;
}

.delta {
  margin-top: 16px;
  text-align: center;
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 10px;
  padding: 12px;
}

.notes {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.notes li { padding: 6px 0 6px 20px; position: relative; line-height: 1.5; }
.notes li::before { content: "→"; position: absolute; left: 0; color: var(--green); }

.src { margin-top: 12px; font-size: 0.75rem; color: #9A9A91; }
.src a { color: inherit; }

.ghost-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--green);
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.ghost-btn:active { background: var(--green-soft); }

/* ── how it works ───────────────────────────────────────────────── */

.how { padding-bottom: 44px; }

.steps { list-style: none; margin: 0; padding: 0; }

.steps li {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.steps li:last-child { border-bottom: 1px solid var(--line); }

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.steps h3 { font-size: 1.0625rem; }
.steps p { margin-top: 4px; color: var(--muted); font-size: 0.9375rem; }

/* ── repeat CTA ─────────────────────────────────────────────────── */

.cta-repeat {
  padding-top: 36px;
  padding-bottom: 40px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.cta-repeat h2 { font-size: 1.3rem; }
.cta-repeat p  { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; }
.cta-repeat .btn { margin-top: 20px; }

/* ── footer ─────────────────────────────────────────────────────── */

footer { padding-bottom: 40px; text-align: center; }

.disclaimer {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #9A9A91;
}

.wordmark {
  margin-top: 18px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #C3B9A8;
}

/* ── thanks ─────────────────────────────────────────────────────── */

.thanks { padding-top: 56px; padding-bottom: 56px; text-align: center; }

.tick {
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 1.5rem;
  line-height: 52px;
  font-weight: 700;
}

.thanks h1 { font-size: 1.6rem; }
.thanks .sub { margin-inline: auto; }

.questions {
  margin-top: 38px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
}

.q-intro { font-size: 0.9375rem; color: var(--muted); }

.q {
  border: none;
  margin: 22px 0 0;
  padding: 0;
}

.q legend {
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.q button {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  font: inherit;
  font-size: 0.9375rem;
  text-align: left;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.q button:active { background: var(--green-soft); }

.q button[aria-pressed="true"] {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green-deep);
  font-weight: 600;
}

.q[data-answered="true"] button:not([aria-pressed="true"]) { opacity: 0.45; }

.q-done {
  margin-top: 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--green);
}

.thanks .disclaimer { margin-top: 32px; }

/* ── wider screens ──────────────────────────────────────────────── */

@media (min-width: 640px) {
  .demo { max-width: 40rem; }
  .hero { padding-top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ══ card internals ═══════════════════════════════════════════════════ */

.section-label {
  margin: 20px 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

/* one row per actual change; the unchanged lines never get printed twice */
.swaps { list-style: none; margin: 0; padding: 0; }

.swaps li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.swaps li + li { margin-top: 8px; }

.swap-from { display: block; color: var(--warm); }
.swap-to   { display: block; color: var(--green-deep); font-weight: 600; }

.swap-arrow {
  display: block;
  margin: 3px 0;
  font-size: 0.8125rem;
  color: #A8A79E;
}

/* native disclosure: no JS, keyboard-accessible, works everywhere */
.unchanged, .working {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.unchanged summary, .working summary {
  padding: 12px 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green);
  cursor: pointer;
  list-style: none;
}

.unchanged summary::-webkit-details-marker,
.working summary::-webkit-details-marker { display: none; }

.unchanged summary::before, .working summary::before {
  content: "+ ";
  font-weight: 700;
}

.unchanged[open] summary::before, .working[open] summary::before { content: "– "; }

.unchanged .ings { padding-bottom: 12px; }
.working-body { padding-bottom: 4px; }
.working-body .notes { margin-top: 0; }

/* ── carb bar ─────────────────────────────────────────────────────────
   Bars share one baseline and scale to the larger value, so the ratio is
   read from length. Labels sit outside the fill so a short bar still
   carries its number. 4px data-end radius, 2px gap between rows. */

.carb-bars {
  margin: 18px 0 0;
  padding: 16px 14px;
  background: var(--bg);
  border-radius: 14px;
}

.carb-bars figcaption {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.bar-row + .bar-row { margin-top: 14px; }

.bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.bar-name  { font-size: 0.875rem; font-weight: 600; }
.bar-value { font-size: 1.0625rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.bar-track {
  height: 14px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  min-width: 4px;
}

.bar-fill.is-before { background: var(--warm); }
.bar-fill.is-after  { background: var(--green); }

.bar-row:first-of-type .bar-value { color: var(--warm); }
.bar-row:last-of-type  .bar-value { color: var(--green); }
.carb-bars + .delta { margin-top: 14px; }
