/* Truecal Design System — Core CSS variables
 * Use this file as the canonical token source for any HTML artifact, slide,
 * mock or production prototype. It merges the Foodnoms-derived export with
 * the in-progress Truecal redesign tokens.
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap");

:root {
  /* ---------- BASE COLORS ---------- */
  /* Surfaces */
  --color-canvas: #fafaf7;          /* App background. warm daily-use base */
  --color-surface: #ffffff;         /* Cards, sheets, dialogs */
  --color-surface-2: #f5f5f5;       /* Recessed blocks, subtle fills */
  --color-warm-gray: #f5f5f5;       /* alias */

  /* Text / ink */
  --color-ink: #1a1a1a;             /* Headings, hero numerics */
  --color-body: #2f2f2f;            /* Body text */
  --color-muted: #6a7280;           /* Captions, helpers, inactive */
  --color-hairline: #e6e6e0;        /* Borders, dividers */

  /* Brand action */
  --color-tangerine: #ff5406;       /* PRIMARY brand action — CTAs, focus, active nav */
  --color-sunshine: #ff6d00;        /* Streaks, small positive emphasis */
  --color-crimson: #ff3400;         /* Alt CTA, urgency */

  /* Semantic */
  --color-success: #00b33f;         /* Goal hit, on track */
  --color-warning: #ff3400;         /* Over target, destructive confirm */
  --color-info: #00a9dd;            /* Informational */

  /* Macro data colors (data, not UI accents) */
  --color-carbs: #00a9dd;
  --color-protein: #5856de;
  --color-fat: #f5a524;

  /* Foodnoms heritage aliases (kept for export compatibility) */
  --color-white-canvas: #ffffff;
  --color-graphite-text: #2f2f2f;
  --color-raven-black: #000000;
  --color-tangerine-accent: #ff5406;
  --color-sunshine-orange: #ff6d00;
  --color-vivid-green: #00b33f;
  --color-sky-blue: #00a9dd;
  --color-deep-purple: #5856de;

  /* ---------- TYPOGRAPHY ---------- */
  /* Truecal uses a SINGLE family — Inter — across UI, body, headings, and
   * numerals. Numerals use tabular + lining figures for normalized stroke width
   * and column alignment. No display serif; weight + size + tabular-nums do
   * the work. */
  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

  /* Numerics — keep tabular for calorie/macro alignment */
  --num-features: "tnum" on, "lnum" on;

  /* Type scale (px) */
  --text-caption: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-heading: 22px;
  --text-heading-lg: 30px;
  --text-display: 60px;

  /* Line heights */
  --leading-tight: 1.2;
  --leading-snug: 1.4;
  --leading-normal: 1.6;
  --leading-loose: 1.8;

  /* Weights */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* ---------- SPACING ---------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-14: 56px;
  --space-16: 64px;
  --space-24: 96px;

  /* ---------- RADII ----------
   * Truecal explicitly uses VARIED radii (anti-clone vs. Foodnoms' 26px-everywhere). */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;

  /* ---------- ELEVATION ----------
   * Warm-tinted shadows; do not introduce blue-gray SaaS shadows. */
  --shadow-sm: 0 1px 2px rgba(60, 40, 20, 0.04), 0 0 0 1px rgba(60, 40, 20, 0.04);
  --shadow-md: 0 4px 12px rgba(60, 40, 20, 0.06), 0 0 0 1px rgba(60, 40, 20, 0.04);
  --shadow-lg: 0 12px 32px rgba(60, 40, 20, 0.10), 0 0 0 1px rgba(60, 40, 20, 0.04);

  /* ---------- MOTION ---------- */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-ring: 700ms;
}

/* ---------- SEMANTIC TYPE STYLES ---------- */
html, body {
  font-family: var(--font-ui);
  color: var(--color-body);
  background: var(--color-canvas);
  font-size: var(--text-base);
  line-height: var(--leading-snug);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, .h1 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--text-heading-lg);
  line-height: var(--leading-snug);
  color: var(--color-ink);
  letter-spacing: -0.01em;
  margin: 0;
}

h2, .h2 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--text-heading);
  line-height: var(--leading-snug);
  color: var(--color-ink);
  margin: 0;
}

h3, .h3 {
  font-family: var(--font-ui);
  font-weight: var(--fw-semibold);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  color: var(--color-ink);
  margin: 0;
}

p, .body {
  font-family: var(--font-ui);
  font-weight: var(--fw-regular);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-body);
  text-wrap: pretty;
}

.caption, small {
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  line-height: var(--leading-tight);
  color: var(--color-muted);
}

.numeric, .tabular {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: var(--num-features);
}

.display {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--text-display);
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--color-ink);
}

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.95em;
  background: var(--color-surface-2);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}
