/* Ketora design system — shared by the SEO site and the /app dashboard. */
/* Self-hosted Geist (SIL OFL) — no third-party request on the critical path. */
@font-face { font-family: "Geist"; src: url("/assets/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/assets/fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
/* Metric-matched fallback keeps layout stable while Geist loads. */
@font-face { font-family: "Geist Fallback"; src: local("Arial"); size-adjust: 104%; ascent-override: 92%; descent-override: 22%; line-gap-override: 0%; }
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-muted: #ecedea;
  --surface-sunken: #f0f1ee;
  --border: #dfe1dc;
  --border-strong: #c3c7c0;
  --text: #0e1110;
  --text-muted: #565c58;
  --text-faint: #636a65;
  --accent: #0c6b4a;
  --accent-hover: #09583d;
  --accent-soft: #dcefe5;
  --accent-contrast: #ffffff;
  --fat: #c98a12;
  --fat-soft: #f7ecd2;
  --protein: #3b44d1;
  --protein-soft: #e3e6fb;
  --carb: #c2410c;
  --carb-soft: #fbe4d8;
  --success: #15803d;
  --success-soft: #d9f4e1;
  --danger: #b91c1c;
  --danger-soft: #fbe1e1;
  --info: #1d4ed8;
  --info-soft: #dbe6fb;
  --glow-a: #0f7a5533;
  --glow-b: #3b44d126;
  --glow-c: #c98a1224;
  --ring: #0f7a55;
  --radius-sm: .5rem;
  --radius: .75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --shadow: 0 1px 2px #0000000a, 0 4px 16px #0000000a;
  --shadow-lg: 0 2px 4px #0000000d, 0 16px 48px #00000014;
  --font: "Geist", "Geist Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0b0f; --surface: #12141a; --surface-muted: #1a1d25; --surface-sunken: #0d0e13;
    --border: #252933; --border-strong: #353a47; --text: #eef0ee; --text-muted: #a3a9a5; --text-faint: #7b827e;
    --accent: #4fd59c; --accent-hover: #7be3b6; --accent-soft: #11291e; --accent-contrast: #06140e;
    --fat: #f0b947; --fat-soft: #2e2410; --protein: #8ea0ff; --protein-soft: #1b2150; --carb: #fb8b5c; --carb-soft: #33190f;
    --success: #4ade80; --success-soft: #11291c; --danger: #f87171; --danger-soft: #331919; --info: #60a5fa; --info-soft: #122236;
    --glow-a: #4fd59c2e; --glow-b: #8ea0ff26; --glow-c: #f0b94720; --ring: #4fd59c;
    --shadow: 0 1px 2px #00000066, 0 4px 16px #00000040; --shadow-lg: 0 16px 48px #00000080;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0b0f; --surface: #12141a; --surface-muted: #1a1d25; --surface-sunken: #0d0e13;
  --border: #252933; --border-strong: #353a47; --text: #eef0ee; --text-muted: #a3a9a5; --text-faint: #7b827e;
  --accent: #4fd59c; --accent-hover: #7be3b6; --accent-soft: #11291e; --accent-contrast: #06140e;
  --fat: #f0b947; --fat-soft: #2e2410; --protein: #8ea0ff; --protein-soft: #1b2150; --carb: #fb8b5c; --carb-soft: #33190f;
  --success: #4ade80; --success-soft: #11291c; --danger: #f87171; --danger-soft: #331919; --info: #60a5fa; --info-soft: #122236;
  --glow-a: #4fd59c2e; --glow-b: #8ea0ff26; --glow-c: #f0b94720; --ring: #4fd59c;
  --shadow: 0 1px 2px #00000066, 0 4px 16px #00000040; --shadow-lg: 0 16px 48px #00000080;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 650; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 2.75rem; padding: 0 1.25rem; border-radius: 999px; border: 1px solid transparent;
  font: 550 .95rem/1 var(--font); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s, color .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--accent-contrast); }
.btn-accent { background: var(--accent); color: var(--accent-contrast); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-muted); }
.btn-sm { height: 2.25rem; padding: 0 .9rem; font-size: .875rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Cards & chips */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: 999px;
  font-size: .78rem; font-weight: 550; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
}
.chip-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip-warn { background: var(--carb-soft); color: var(--carb); border-color: transparent; }
.chip-ok { background: var(--success-soft); color: var(--success); border-color: transparent; }
.chip-bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.eyebrow { font: 500 .75rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

/* Forms */
.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label { font-size: .875rem; font-weight: 550; }
.input, select.input, textarea.input {
  width: 100%; height: 2.75rem; padding: 0 .9rem; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: 400 1rem var(--font);
}
textarea.input { height: auto; padding: .7rem .9rem; min-height: 5rem; resize: vertical; }
.input:focus { outline: 2px solid var(--ring); outline-offset: 0; border-color: transparent; }

/* Macro colors */
.c-fat { color: var(--fat); } .c-protein { color: var(--protein); } .c-carb { color: var(--carb); }
.bg-fat { background: var(--fat); } .bg-protein { background: var(--protein); } .bg-carb { background: var(--carb); }
