/* ============================================================
   LEDGER SQUARED — Core Tokens: Color + Type
   "The ledger book, made modern."
   Load this file, then use the semantic vars (--h1, --fg-1, --card …)
   ============================================================ */

/* ---- Webfonts (Google Fonts CDN; see fonts/ for offline note) ---- */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&family=Hanken+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* ============ COLOR — RAW PALETTE ============ */

  /* Warm paper neutrals */
  --paper-0:  #F7F3EA;  /* page background — warm cream */
  --paper-1:  #FFFFFF;  /* card / raised surface */
  --paper-2:  #EFE9DB;  /* subtle fill / hover row */
  --paper-3:  #E6DECC;  /* pressed / track */

  /* Warm hairlines */
  --line:        #E2DAC9;
  --line-strong: #CEC5B0;

  /* Ink — deep green-black text ramp */
  --ink-1: #1B2620;  /* primary text */
  --ink-2: #45504A;  /* secondary text */
  --ink-3: #79827B;  /* muted / captions */
  --ink-4: #A7AEA7;  /* disabled / placeholder */

  /* Brand — Ledger Green */
  --green-900: #0F362E;
  --green-800: #14443A;  /* PRIMARY brand */
  --green-700: #1C5A4B;
  --green-600: #25705C;
  --green-500: #2E8169;
  --green-300: #8FBEAE;
  --green-100: #E2EFE8;  /* tint surface */
  --green-050: #EFF6F1;

  /* Accent — Brass / Gold ("the bottom line") */
  --gold-700: #9A6F25;
  --gold-600: #B5852F;  /* PRIMARY accent */
  --gold-500: #C2913F;
  --gold-400: #D6AE62;
  --gold-200: #ECD9AC;
  --gold-100: #F4E9CF;

  /* Semantic — finance-tuned */
  --positive: #2F7D52;  /* credit / up / paid */
  --positive-bg: #E4F0E7;
  --negative: #BD4A33;  /* debit / down / overdue (muted terracotta) */
  --negative-bg: #F6E3DD;
  --warning:  #C2871C;  /* due soon */
  --warning-bg: #F8EDD3;
  --info:     #2C6E8C;  /* informational */
  --info-bg:  #E1EDF2;

  /* ============ COLOR — SEMANTIC ROLES ============ */
  --bg:            var(--paper-0);
  --bg-raised:     var(--paper-1);
  --bg-sunken:     var(--paper-2);
  --card:          var(--paper-1);
  --card-border:   var(--line);

  --fg-1:          var(--ink-1);
  --fg-2:          var(--ink-2);
  --fg-3:          var(--ink-3);
  --fg-on-brand:   #F4F1E8;          /* text on green */
  --fg-on-gold:    #2A1E07;          /* text on gold  */

  --brand:         var(--green-800);
  --brand-hover:   var(--green-900);
  --brand-tint:    var(--green-100);
  --accent:        var(--gold-600);
  --accent-hover:  var(--gold-700);
  --accent-tint:   var(--gold-100);

  --focus-ring:    color-mix(in oklch, var(--green-600) 55%, white);

  /* ============ TYPE — FAMILIES ============ */
  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans:    'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* numeric figures: tabular for ledgers */
  --num-tabular: 'tnum' 1, 'lnum' 1; /* @kind other */

  /* ============ TYPE — SCALE (semantic) ============ */
  /* Display & headings use the serif; UI/body use the grotesque. */
  --display-font:   var(--font-display);
  --display-size:   clamp(40px, 4.6vw, 60px);
  --display-line:   1.04; /* @kind other */
  --display-weight: 600;
  --display-spacing: -0.015em;

  --h1-font: var(--font-display);  --h1-size: 44px; --h1-line: 1.08; /* @kind other */ --h1-weight: 600; --h1-spacing: -0.012em;
  --h2-font: var(--font-display);  --h2-size: 32px; --h2-line: 1.14; /* @kind other */ --h2-weight: 600; --h2-spacing: -0.008em;
  --h3-font: var(--font-sans);     --h3-size: 23px; --h3-line: 1.25; /* @kind other */ --h3-weight: 600; --h3-spacing: -0.006em;
  --h4-font: var(--font-sans);     --h4-size: 18px; --h4-line: 1.35; /* @kind other */ --h4-weight: 600; --h4-spacing: 0;

  --body-lg-size: 18px; --body-lg-line: 1.6; /* @kind other */
  --body-size:    16px; --body-line: 1.6; /* @kind other */
  --body-sm-size: 14px; --body-sm-line: 1.55; /* @kind other */
  --caption-size: 13px; --caption-line: 1.45; /* @kind other */

  /* Eyebrow / label — grotesque, uppercase, tracked */
  --eyebrow-size: 12px; --eyebrow-weight: 600; --eyebrow-spacing: 0.14em;

  /* Mono / figures */
  --mono-size: 14px; --mono-line: 1.5; /* @kind other */

  /* ============ SPACING (4px base) ============ */
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
  --space-5: 20px;  --space-6: 24px;  --space-8: 32px;  --space-10: 40px;
  --space-12: 48px; --space-16: 64px; --space-20: 80px; --space-24: 96px;

  /* ============ RADII (restrained / squared) ============ */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  /* ============ SHADOWS (soft, warm-tinted, low) ============ */
  --shadow-xs: 0 1px 2px rgba(20, 30, 25, 0.06);
  --shadow-sm: 0 1px 3px rgba(20, 30, 25, 0.08), 0 1px 2px rgba(20, 30, 25, 0.05);
  --shadow-md: 0 6px 18px -6px rgba(20, 30, 25, 0.14), 0 2px 6px -2px rgba(20, 30, 25, 0.07);
  --shadow-lg: 0 18px 44px -14px rgba(20, 30, 25, 0.20), 0 6px 14px -8px rgba(20, 30, 25, 0.10);
  --shadow-focus: 0 0 0 3px var(--focus-ring);

  /* ============ MOTION ============ */
  --ease-out: cubic-bezier(0.2, 0.6, 0.2, 1); /* @kind other */
  --ease-in-out: cubic-bezier(0.5, 0, 0.2, 1); /* @kind other */
  --dur-fast: 130ms; /* @kind other */
  --dur: 190ms; /* @kind other */
  --dur-slow: 280ms; /* @kind other */
}

/* ============================================================
   OPTIONAL HELPER CLASSES — apply the semantic type styles
   ============================================================ */
.ls-display { font-family: var(--display-font); font-size: var(--display-size); line-height: var(--display-line); font-weight: var(--display-weight); letter-spacing: var(--display-spacing); color: var(--fg-1); }
.ls-h1 { font-family: var(--h1-font); font-size: var(--h1-size); line-height: var(--h1-line); font-weight: var(--h1-weight); letter-spacing: var(--h1-spacing); color: var(--fg-1); }
.ls-h2 { font-family: var(--h2-font); font-size: var(--h2-size); line-height: var(--h2-line); font-weight: var(--h2-weight); letter-spacing: var(--h2-spacing); color: var(--fg-1); }
.ls-h3 { font-family: var(--h3-font); font-size: var(--h3-size); line-height: var(--h3-line); font-weight: var(--h3-weight); letter-spacing: var(--h3-spacing); color: var(--fg-1); }
.ls-h4 { font-family: var(--h4-font); font-size: var(--h4-size); line-height: var(--h4-line); font-weight: var(--h4-weight); color: var(--fg-1); }
.ls-body-lg { font-family: var(--font-sans); font-size: var(--body-lg-size); line-height: var(--body-lg-line); color: var(--fg-2); }
.ls-body { font-family: var(--font-sans); font-size: var(--body-size); line-height: var(--body-line); color: var(--fg-2); }
.ls-body-sm { font-family: var(--font-sans); font-size: var(--body-sm-size); line-height: var(--body-sm-line); color: var(--fg-2); }
.ls-caption { font-family: var(--font-sans); font-size: var(--caption-size); line-height: var(--caption-line); color: var(--fg-3); }
.ls-eyebrow { font-family: var(--font-sans); font-size: var(--eyebrow-size); font-weight: var(--eyebrow-weight); letter-spacing: var(--eyebrow-spacing); text-transform: uppercase; color: var(--accent); }
.ls-mono { font-family: var(--font-mono); font-size: var(--mono-size); line-height: var(--mono-line); font-feature-settings: var(--num-tabular); }
.ls-figure { font-family: var(--font-mono); font-feature-settings: var(--num-tabular); font-variant-numeric: tabular-nums; }
