/* CryptoBlog design tokens, shared by the public site (site.css) and the admin panel (admin.css).
   Style: editorial "Swiss modern". Neutral stone greys, one amber accent, generous whitespace.
   Contrast (WCAG 2.2): every text/background pair below is >= 4.5:1 in both themes.
   Theme: follows the OS by default; <html data-theme="light|dark"> forces one. */

:root {
  color-scheme: light;

  /* Type */
  --font-sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Newsreader', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --font-display: 'Oswald', 'Arial Narrow', 'Roboto Condensed', Impact, sans-serif; /* condensed labels and section titles */
  --text-xs: 0.75rem;     /* 12px, labels only */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-md: 1.125rem;    /* 18px, article body */
  --text-lg: 1.25rem;     /* 20px */
  --text-xl: 1.5rem;      /* 24px */
  --text-2xl: 2rem;       /* 32px */
  --text-3xl: 2.5rem;     /* 40px */
  --text-4xl: 3.25rem;    /* 52px */
  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;

  /* Colour: surfaces */
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --surface-2: #F5F5F4;
  --surface-3: #E7E5E4;
  --border: #E7E5E4;
  --border-strong: #D6D3D1;

  /* Colour: text */
  --text: #0C0A09;
  --text-2: #44403C;
  --text-3: #57534E;     /* muted, still 7:1 */
  --link: #A1490A;
  --link-hover: #7C3A0A;

  /* Colour: brand accent (amber). Use as a fill behind --on-accent text, never as text on light bg. */
  --accent: #F59E0B;
  --accent-hover: #FBBF24;
  --accent-strong: #D97706;
  --on-accent: #1C1917;
  --accent-soft: #FEF3C7;
  --on-accent-soft: #92400E;

  /* Colour: status (text colour / soft background / text on soft) */
  --success: #15803D;  --success-soft: #DCFCE7;  --on-success-soft: #166534;
  --warning: #B45309;  --warning-soft: #FEF3C7;  --on-warning-soft: #92400E;
  --danger:  #B91C1C;  --danger-soft:  #FEE2E2;  --on-danger-soft:  #991B1B;
  --info:    #1D4ED8;  --info-soft:    #DBEAFE;  --on-info-soft:    #1E40AF;

  /* Focus ring (>= 3:1 against both surfaces) */
  --ring: #A1490A;
  --ring-width: 2px;
  --ring-offset: 2px;

  /* Shape and depth */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(12, 10, 9, 0.06);
  --shadow: 0 1px 3px rgba(12, 10, 9, 0.08), 0 4px 12px rgba(12, 10, 9, 0.05);
  --shadow-lg: 0 10px 30px rgba(12, 10, 9, 0.12);

  /* Spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Layout */
  --container: 1200px;
  --container-narrow: 760px;
  --measure: 68ch;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 320ms;

  /* Layers */
  --z-sticky: 20;
  --z-header: 40;
  --z-overlay: 90;
  --z-modal: 100;
  --z-toast: 1000;
}

/* Dark theme values. Declared twice: forced via [data-theme="dark"], or by OS preference. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E0E10;
  --surface: #16161A;
  --surface-2: #1D1D22;
  --surface-3: #27272D;
  --border: #2A2A31;
  --border-strong: #3A3A42;
  --text: #F5F5F4;
  --text-2: #D6D3D1;
  --text-3: #A8A29E;
  --link: #FBBF24;
  --link-hover: #FCD34D;
  --accent: #F59E0B;
  --accent-hover: #FBBF24;
  --accent-strong: #FBBF24;
  --on-accent: #1C1917;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --on-accent-soft: #FCD34D;
  --success: #4ADE80;  --success-soft: rgba(74, 222, 128, 0.14);  --on-success-soft: #86EFAC;
  --warning: #FBBF24;  --warning-soft: rgba(251, 191, 36, 0.14);  --on-warning-soft: #FCD34D;
  --danger:  #F87171;  --danger-soft:  rgba(248, 113, 113, 0.14); --on-danger-soft:  #FCA5A5;
  --info:    #60A5FA;  --info-soft:    rgba(96, 165, 250, 0.14);  --on-info-soft:    #93C5FD;
  --ring: #FBBF24;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E0E10;
    --surface: #16161A;
    --surface-2: #1D1D22;
    --surface-3: #27272D;
    --border: #2A2A31;
    --border-strong: #3A3A42;
    --text: #F5F5F4;
    --text-2: #D6D3D1;
    --text-3: #A8A29E;
    --link: #FBBF24;
    --link-hover: #FCD34D;
    --accent: #F59E0B;
    --accent-hover: #FBBF24;
    --accent-strong: #FBBF24;
    --on-accent: #1C1917;
    --accent-soft: rgba(245, 158, 11, 0.14);
    --on-accent-soft: #FCD34D;
    --success: #4ADE80;  --success-soft: rgba(74, 222, 128, 0.14);  --on-success-soft: #86EFAC;
    --warning: #FBBF24;  --warning-soft: rgba(251, 191, 36, 0.14);  --on-warning-soft: #FCD34D;
    --danger:  #F87171;  --danger-soft:  rgba(248, 113, 113, 0.14); --on-danger-soft:  #FCA5A5;
    --info:    #60A5FA;  --info-soft:    rgba(96, 165, 250, 0.14);  --on-info-soft:    #93C5FD;
    --ring: #FBBF24;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.55);
  }
}

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