/*
 * Sarthe site — shared design system.
 *
 * Tokens mirror src/constants/theme.ts exactly, including the one rule that
 * is easy to get wrong: `--accent` is the brand gold and is only ever a
 * FILL. As text on white it lands near 1.7:1, so light mode uses the bronze
 * `--accent-text` for anything read as words. Against near-black the gold
 * clears 9:1, so dark mode uses the real thing for both.
 *
 * Light and dark both ship because the app itself does. The phone mockups
 * are the exception — they always render the app's dark theme, since they
 * depict a device with its own UI rather than part of this page.
 */
:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --surface: #f5f3ef;
  --surface-2: #ebe5d9;
  --fg: #141414;
  --muted: #6b665e;
  --line: #ebe5d9;
  --accent: #e9bd77;      /* fill only */
  --accent-text: #8f6a24; /* words */
  --accent-ink: #141414;  /* ink ON the gold — never --fg, see theme.ts */
  --danger: #d2554d;

  --gutter: 20px;
  --measure: 720px;
  --wide: 1080px;
  --radius: 16px;

  --font-display: Archivo, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0c;
    --surface: #1b1a17;
    --surface-2: #292520;
    --fg: #f5f3ef;
    --muted: #a39d93;
    --line: #292520;
    --accent: #e9bd77;
    --accent-text: #e9bd77;
    --accent-ink: #141414;
    --danger: #e4695f;
  }
}

* { box-sizing: border-box; }

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

/* The nav is sticky, so a section jumped to from a nav link would otherwise
   land underneath it. Reserve the nav's height plus a little air. */
[id] { scroll-margin-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 var(--font-body);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-text); }

h1, h2, h3 { font-family: var(--font-display); }

img { max-width: 100%; }

/* Visible focus for keyboard users, on every interactive thing. */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 0 0 10px 0; font-weight: 700; z-index: 100;
}
.skip:focus { left: 0; top: 0; }

/* ---------- shared chrome ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  max-width: var(--wide); margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex; align-items: center; gap: 24px;
}
.nav-mark { display: flex; align-items: center; margin-right: auto; }
.nav-mark img { height: 26px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a {
  color: var(--muted); text-decoration: none;
  font-size: 15px; font-weight: 500;
}
.nav-links a:hover { color: var(--fg); }
@media (max-width: 640px) {
  .nav-links { display: none; }
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 48px var(--gutter) 96px; }

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.site-footer-in {
  max-width: var(--wide); margin: 0 auto;
  padding: 40px var(--gutter);
  display: flex; flex-wrap: wrap; gap: 20px 40px;
  align-items: center; justify-content: space-between;
  color: var(--muted); font-size: 14px;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--fg); text-decoration: underline; }
.site-footer .legal { margin: 0; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 24px; border-radius: 14px;
  font-size: 16px; font-weight: 700; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #f0d6ac; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); }

.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; border-radius: 20px; }

/* Store buttons. `is-soon` is the pre-launch state: not a link, because
   there is nothing to link to yet and a dead <a> is worse than a label. */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 20px; border-radius: 14px;
  text-decoration: none; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg);
}
.store:hover { border-color: var(--muted); }
.store svg { flex-shrink: 0; }
.store-txt { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store-top { font-size: 11px; color: var(--muted); letter-spacing: 0.3px; }
.store-btm { font-size: 16px; font-weight: 700; font-family: var(--font-display); }
.store.is-soon { opacity: 0.55; cursor: default; }
.store.is-soon:hover { border-color: var(--line); }

/* ---------- long-form pages (privacy, terms, support) ---------- */

.wrap h1 { font-size: 30px; line-height: 1.2; letter-spacing: -0.5px; margin: 0 0 8px; }
.wrap h2 { font-size: 20px; line-height: 1.3; letter-spacing: -0.2px; margin: 40px 0 12px; }
.wrap h3 { font-size: 16px; margin: 24px 0 8px; font-family: var(--font-body); }
.updated { color: var(--muted); font-size: 14px; margin: 0 0 40px; }
.lede { font-size: 17px; }

table {
  border-collapse: collapse; width: 100%; margin: 16px 0;
  font-size: 15px; display: block; overflow-x: auto;
}
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; white-space: nowrap; }

.note {
  background: var(--surface); border-radius: 14px;
  padding: 16px 18px; margin: 24px 0; font-size: 15px;
}

.wrap ul { padding-left: 22px; }
.wrap li { margin: 6px 0; }
code { background: var(--surface); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }

/* The legal pages carry their own inline <footer>. Keep its old look. */
.wrap > footer {
  margin-top: 64px; padding-top: 24px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
