/* ==========================================================================
   JCINEM DESIGN TOKENS
   Single source of truth for the entire platform. Every component consumes
   these variables — never hard-code a color, size, or timing value elsewhere.

   DESIGN CONCEPT: "The Ledger"
   A calculator platform should feel like a precision instrument: a beautiful
   old adding machine crossed with a modern financial ledger. Headlines are
   set in a confident serif (editorial authority, E-E-A-T). Every number the
   platform produces is set in tabular monospace inside a printed "readout"
   card with a brass rule that draws in on calculation — this is the site's
   signature moment. Body copy stays in a clean humanist sans for readability
   at long-form article length.
   ========================================================================== */

:root {
  /* ---------- Color: Light (Paper) ---------- */
  --color-bg: #FAF7F0;
  --color-bg-alt: #F1ECE0;
  --color-surface: #FFFFFF;
  --color-surface-raised: #FFFFFF;
  --color-ink: #14213D;
  --color-ink-soft: #3C4A63;
  --color-border: #E4DFD1;
  --color-border-strong: #CFC8B4;
  --color-brass: #B4801F;
  --color-brass-strong: #8F6416;
  --color-brass-tint: #F6E9CE;
  --color-forest: #2F7A4B;
  --color-forest-tint: #E3F1E7;
  --color-rust: #B23A2E;
  --color-rust-tint: #F8E4E1;
  --color-focus: #1D5FD6;

  /* ---------- Elevation ---------- */
  --shadow-sm: 0 1px 2px rgba(20, 33, 61, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 33, 61, 0.08), 0 1px 3px rgba(20, 33, 61, 0.06);
  --shadow-lg: 0 16px 40px rgba(20, 33, 61, 0.14), 0 4px 12px rgba(20, 33, 61, 0.08);
  --shadow-readout: inset 0 1px 0 rgba(255,255,255,0.6), 0 2px 10px rgba(20,33,61,0.06);

  /* ---------- Typography ---------- */
  --font-display: 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 3rem;
  --fs-4xl: 3.75rem;

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-normal: 1.6;
  --lh-relaxed: 1.75;

  /* ---------- Spacing scale (4px base) ---------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3rem;
  --space-9: 4rem;
  --space-10: 5rem;
  --space-11: 6.5rem;

  /* ---------- Layout ---------- */
  --container-max: 1280px;
  --container-narrow: 840px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* ---------- Motion ---------- */
  --ease-standard: cubic-bezier(0.2, 0.7, 0.3, 1);
  --duration-fast: 120ms;
  --duration-base: 220ms;
  --duration-slow: 420ms;

  /* ---------- Z-index ---------- */
  --z-header: 100;
  --z-dropdown: 200;
  --z-modal: 300;
  --z-toast: 400;
}

/* ---------- Color: Dark (Ink) ---------- */
:root[data-theme="dark"] {
  --color-bg: #0F1524;
  --color-bg-alt: #141B2E;
  --color-surface: #1A2236;
  --color-surface-raised: #202A42;
  --color-ink: #F3F1E9;
  --color-ink-soft: #B9C0D4;
  --color-border: #2B3552;
  --color-border-strong: #3A466A;
  --color-brass: #E0B25A;
  --color-brass-strong: #F1CB84;
  --color-brass-tint: #2E2718;
  --color-forest: #5FBE85;
  --color-forest-tint: #163826;
  --color-rust: #E17B6B;
  --color-rust-tint: #3A1E1A;
  --color-focus: #6E9EFF;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
  --shadow-readout: inset 0 1px 0 rgba(255,255,255,0.04), 0 2px 10px rgba(0,0,0,0.3);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
  }
}
