/*
 * Kiwi Eats — public site.
 *
 * The palette is NOT invented here. Every value is lifted from the driver app's
 * locked theme (`KiwiEats-Driver-App/src/theme/palette.ts`), so the website and
 * the app a driver installs are recognisably the same brand. If the app's palette
 * changes, change it here too — there is deliberately no build-time link between
 * the two repos, so this is a copy that has to be maintained by hand.
 *
 * Fonts are SELF-HOSTED. Loading Poppins from Google on the page that carries a
 * privacy policy would send every reader's IP to a third party in order to render
 * the document telling them how their data is handled. 23 KB is a small price.
 */

@font-face { font-family: Poppins; font-weight: 400; font-display: swap;
             src: url(/fonts/poppins-400.woff2) format('woff2'); }
@font-face { font-family: Poppins; font-weight: 600; font-display: swap;
             src: url(/fonts/poppins-600.woff2) format('woff2'); }
@font-face { font-family: Poppins; font-weight: 800; font-display: swap;
             src: url(/fonts/poppins-800.woff2) format('woff2'); }

:root {
  --gold: #F4A300;
  --gold-deep: #C97A00;   /* gold fails contrast on cream; this is the text gold */
  --crimson: #D7263D;
  --ink: #1C1B19;
  --muted: #6B655C;
  --cream: #FBF4E6;
  --surface: #FFFDF8;
  --border: #E8DCC4;
  --grad-top: #FFFDF8;
  --grad-mid: #FBF4E6;
  --grad-base: #F1E6CC;
  --measure: 34rem;       /* legal prose is unreadable much wider than this */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Poppins, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: linear-gradient(180deg, var(--grad-top) 0%, var(--grad-mid) 50%, var(--grad-base) 100%);
  background-attachment: fixed;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.5rem; }
.prose { max-width: var(--measure); }

/* ── masthead ─────────────────────────────────────────────────────── */
header.site {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.5rem 0;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; }
/* The wordmark must never break across lines — "Kiwi / Eats" stacked reads as two
   words rather than one brand, and it is the first thing on the page. */
.brand strong { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; white-space: nowrap; }
.brand strong em { font-style: normal; color: var(--gold-deep); }
nav.site { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
nav.site a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; }
nav.site a:hover { color: var(--gold-deep); }

/* On a narrow phone the masthead cannot hold brand + three links on one line.
   Stack rather than wrap mid-nav, which looked accidental. */
@media (max-width: 32rem) {
  header.site { flex-direction: column; align-items: flex-start; gap: .75rem; padding-bottom: 1rem; }
  nav.site { gap: 0 1rem; }
}

/* ── hero ─────────────────────────────────────────────────────────── */
.hero { padding: 3.5rem 0 2.5rem; }
.hero h1 {
  font-weight: 800; font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.08; letter-spacing: -.03em; margin: 0 0 1rem;
}
.hero h1 em { font-style: normal; color: var(--gold-deep); }
.hero p.lede { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted); max-width: 32rem; margin: 0; }
.eyebrow {
  font-weight: 800; font-size: .78rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold-deep); margin: 0 0 .75rem;
}

/* ── cards ────────────────────────────────────────────────────────── */
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 2rem 0; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 1rem; padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(28,27,25,.04), 0 8px 24px rgba(28,27,25,.05);
}
.card h3 { margin: .25rem 0 .5rem; font-weight: 800; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.step { font-weight: 800; color: var(--gold); font-size: 1.6rem; line-height: 1; }

section { padding: 2.5rem 0; }
section h2 { font-weight: 800; font-size: clamp(1.5rem, 3.5vw, 2rem); letter-spacing: -.02em; margin: 0 0 .5rem; }
section > p { color: var(--muted); max-width: var(--measure); }

/* ── legal documents ──────────────────────────────────────────────── */
.doc { padding: 1rem 0 4rem; }
.doc h1 { font-weight: 800; font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.02em; margin: 0 0 .35rem; }
.doc h2 { font-weight: 800; font-size: 1.15rem; margin: 2.25rem 0 .5rem; }
.doc p, .doc li { font-size: .97rem; }
.doc ul, .doc ol { padding-left: 1.25rem; }
.doc li { margin: .35rem 0; }
.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em;
  background: #F3EAD6; padding: .12em .4em; border-radius: .3rem;
}
.doc a { color: var(--gold-deep); }
.doc table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .9rem; }
.doc th, .doc td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc th { font-weight: 600; color: var(--muted); }

/* A blockquote in these documents is always an aside the reader should notice —
   a caveat, a reviewer note, a statement of what we deliberately do NOT do. */
.doc blockquote {
  margin: 1.25rem 0; padding: .9rem 1.1rem;
  border-left: 3px solid var(--gold); background: #FDF6E7;
  border-radius: 0 .6rem .6rem 0; color: var(--ink);
}
.doc blockquote p { margin: .35rem 0; }

.docmeta { color: var(--muted); font-size: .85rem; margin: 0 0 2rem; }
.badge {
  display: inline-block; background: var(--crimson); color: #fff;
  font-weight: 800; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .2rem .55rem; border-radius: .35rem; margin-right: .5rem;
}

/* ── footer ───────────────────────────────────────────────────────── */
footer.site {
  border-top: 1px solid var(--border); margin-top: 2rem;
  padding: 2rem 0 3rem; color: var(--muted); font-size: .88rem;
}
footer.site a { color: var(--gold-deep); }
footer.site .legalname { margin-top: .75rem; }

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F7F3EA; --muted: #A79E90; --cream: #14130F;
    --surface: #1C1A15; --border: #2E2A22;
    --grad-top: #221F17; --grad-mid: #15140F; --grad-base: #0E0D0A;
    --gold-deep: #F4A300;   /* on dark, the raw gold is the readable one */
  }
  .doc code { background: #2A251B; }
  .doc blockquote { background: #221E15; }
}
