/* ============================================================
   ACCOUNTABILITY TRACK — DESIGN TOKENS
   Sober / archival / investigative. Deep charcoal-ink dark mode,
   warm paper light mode. Single institutional accent (ochre/amber).
   ============================================================ */

@import url('https://api.fontshare.com/v2/css?f[]=general-sans@400,500,600,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400;1,6..72,500&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Type scale — fluid, 12px floor */
  --text-xs: clamp(0.75rem, 0.71rem + 0.2vw, 0.8125rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.2vw, 0.9375rem);
  --text-base: clamp(0.9375rem, 0.9rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.0625rem, 1rem + 0.5vw, 1.375rem);
  --text-xl: clamp(1.375rem, 1.15rem + 1.1vw, 2.125rem);
  --text-2xl: clamp(1.75rem, 1.2rem + 2vw, 3rem);
  --text-3xl: clamp(2.25rem, 1.2rem + 3.5vw, 4.25rem);

  /* Spacing — 4px base */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-full: 9999px;

  /* Fonts */
  --font-display: 'Newsreader', 'Source Serif 4', Georgia, serif;
  --font-body: 'General Sans', 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  --transition: 160ms cubic-bezier(0.16, 1, 0.3, 1);
  --content-wide: 1240px;
  --content-default: 900px;
  --content-narrow: 680px;
}

/* ---------------- LIGHT MODE (warm off-white paper) ---------------- */
:root,
[data-theme='light'] {
  --color-bg: #f2ede2;
  --color-surface: #f8f4ea;
  --color-surface-2: #fdfbf5;
  --color-surface-offset: #ece5d5;
  --color-border: #d7cdb8;
  --color-divider: #e0d7c3;

  --color-text: #211d16;
  --color-text-muted: #5c5545;
  --color-text-faint: #9a917a;
  --color-text-inverse: #f8f4ea;

  --color-accent: #97621c;
  --color-accent-hover: #7a4e15;
  --color-accent-active: #613d10;
  --color-accent-highlight: #ecdcb9;
  --color-accent-text-on: #f8f4ea;

  --color-alleged: #a13c1f;
  --color-alleged-bg: #f4dccb;
  --color-documented: #2f5d43;
  --color-documented-bg: #d8e6da;
  --color-contested: #8a6a10;
  --color-contested-bg: #f0e3bd;
  --color-unresolved: #5c5545;
  --color-unresolved-bg: #e5ddca;

  --color-danger: #9a2b2b;
  --color-danger-bg: #f2d8d3;
  --color-success: #2f6a3f;
  --color-success-bg: #d9e8d9;
  --color-warning-flag: #96590f;
  --color-warning-flag-bg: #f3e2c1;

  --shadow-sm: 0 1px 2px rgba(40, 32, 16, 0.08);
  --shadow-md: 0 4px 16px rgba(40, 32, 16, 0.1);
  --shadow-lg: 0 16px 40px rgba(40, 32, 16, 0.16);
}

/* ---------------- DARK MODE (deep charcoal ink) ---------------- */
[data-theme='dark'] {
  --color-bg: #171613;
  --color-surface: #1d1c18;
  --color-surface-2: #23221d;
  --color-surface-offset: #29281f;
  --color-border: #3c3a30;
  --color-divider: #302f27;

  --color-text: #e9e4d6;
  --color-text-muted: #a39c87;
  --color-text-faint: #6e6858;
  --color-text-inverse: #171613;

  --color-accent: #d3a15a;
  --color-accent-hover: #e0b477;
  --color-accent-active: #c88f3f;
  --color-accent-highlight: #3a3021;
  --color-accent-text-on: #171613;

  --color-alleged: #dd8b6a;
  --color-alleged-bg: #3c261b;
  --color-documented: #7fb894;
  --color-documented-bg: #1f3327;
  --color-contested: #dfc267;
  --color-contested-bg: #3a331b;
  --color-unresolved: #a39c87;
  --color-unresolved-bg: #2e2c22;

  --color-danger: #e08a7a;
  --color-danger-bg: #3a211d;
  --color-success: #85c090;
  --color-success-bg: #1f3323;
  --color-warning-flag: #dba85a;
  --color-warning-flag-bg: #3a2f19;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']):not([data-theme='dark']) {
    --color-bg: #171613;
    --color-surface: #1d1c18;
    --color-surface-2: #23221d;
    --color-surface-offset: #29281f;
    --color-border: #3c3a30;
    --color-divider: #302f27;
    --color-text: #e9e4d6;
    --color-text-muted: #a39c87;
    --color-text-faint: #6e6858;
    --color-text-inverse: #171613;
    --color-accent: #d3a15a;
    --color-accent-hover: #e0b477;
    --color-accent-active: #c88f3f;
    --color-accent-highlight: #3a3021;
    --color-accent-text-on: #171613;
    --color-alleged: #dd8b6a;
    --color-alleged-bg: #3c261b;
    --color-documented: #7fb894;
    --color-documented-bg: #1f3327;
    --color-contested: #dfc267;
    --color-contested-bg: #3a331b;
    --color-unresolved: #a39c87;
    --color-unresolved-bg: #2e2c22;
    --color-danger: #e08a7a;
    --color-danger-bg: #3a211d;
    --color-success: #85c090;
    --color-success-bg: #1f3323;
    --color-warning-flag: #dba85a;
    --color-warning-flag-bg: #3a2f19;
  }
}
