/* Art direction: Legal editorial / law review meets longform journalism
   Palette: Cool & restrained — deep navy primary, muted gold accent, cream/off-white surfaces
   Typography: Cormorant Garamond (display serif) + Inter (body sans-serif) — authority meets clarity
   Density: Spacious editorial — generous whitespace, 65ch measure, 1.7 line-height */

/* ============================================
   TYPE SCALE
   ============================================ */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1.0625rem, 1rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  /* 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;

  /* FONTS */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Lora', 'Century Schoolbook', 'Georgia', serif;

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

  /* TRANSITIONS */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* CONTENT WIDTHS */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;
}

/* ============================================
   LIGHT MODE (DEFAULT)
   ============================================ */
:root, [data-theme="light"] {
  /* Surfaces — warm cream/off-white */
  --color-bg:               #f8f6f1;
  --color-surface:          #faf8f4;
  --color-surface-2:        #fcfbf8;
  --color-surface-offset:   #f0ede6;
  --color-surface-offset-2: #e8e4dc;
  --color-surface-dynamic:  #e0dcd4;
  --color-divider:          #d4d0c8;
  --color-border:           #c8c3ba;

  /* Text — deep charcoal/navy */
  --color-text:             #1a1f2e;
  --color-text-muted:       #5a6070;
  --color-text-faint:       #9a9ea8;
  --color-text-inverse:     #f8f6f1;

  /* Primary — deep navy */
  --color-primary:          #1a2744;
  --color-primary-hover:    #0f1a30;
  --color-primary-active:   #0a1220;

  /* Accent — muted gold/amber (used sparingly) */
  --color-accent:           #9a7b3c;
  --color-accent-hover:     #7d6230;
  --color-accent-active:    #604b24;
  --color-accent-highlight: #f0e8d4;

  /* Semantic */
  --color-success:          #3a7a2a;
  --color-error:            #a12c3c;

  /* Shadows */
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 60 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 60 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 60 / 0.12);

  /* Hero surfaces */
  --color-hero-bg:          #263a5e;
  --color-hero-text:        #f5efe0;
  --color-hero-muted:       #b0a898;
  --color-hero-accent:      #c8a862;

  /* Blockquote */
  --color-blockquote-bg:    #f0ede6;
  --color-blockquote-border: #9a7b3c;

  /* Table */
  --color-check:            #3a7a2a;
  --color-cross:            #a12c3c;
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
  --color-bg:               #111318;
  --color-surface:          #171a21;
  --color-surface-2:        #1c2029;
  --color-surface-offset:   #1a1d25;
  --color-surface-offset-2: #20242e;
  --color-surface-dynamic:  #282c38;
  --color-divider:          #2a2e3a;
  --color-border:           #363b4a;

  --color-text:             #d0d3da;
  --color-text-muted:       #8890a0;
  --color-text-faint:       #565e70;
  --color-text-inverse:     #111318;

  --color-primary:          #8aa0c8;
  --color-primary-hover:    #6d88b8;
  --color-primary-active:   #5474a8;

  --color-accent:           #c8a862;
  --color-accent-hover:     #b89448;
  --color-accent-active:    #a88030;
  --color-accent-highlight: #2a2620;

  --color-success:          #5aaa42;
  --color-error:            #d44858;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45);

  --color-hero-bg:          #0d0f14;
  --color-hero-text:        #e8e0d0;
  --color-hero-muted:       #7a7268;
  --color-hero-accent:      #c8a862;

  --color-blockquote-bg:    #1a1d25;
  --color-blockquote-border: #c8a862;

  --color-check:            #5aaa42;
  --color-cross:            #d44858;
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:               #111318;
    --color-surface:          #171a21;
    --color-surface-2:        #1c2029;
    --color-surface-offset:   #1a1d25;
    --color-surface-offset-2: #20242e;
    --color-surface-dynamic:  #282c38;
    --color-divider:          #2a2e3a;
    --color-border:           #363b4a;
    --color-text:             #d0d3da;
    --color-text-muted:       #8890a0;
    --color-text-faint:       #565e70;
    --color-text-inverse:     #111318;
    --color-primary:          #8aa0c8;
    --color-primary-hover:    #6d88b8;
    --color-primary-active:   #5474a8;
    --color-accent:           #c8a862;
    --color-accent-hover:     #b89448;
    --color-accent-active:    #a88030;
    --color-accent-highlight: #2a2620;
    --color-success:          #5aaa42;
    --color-error:            #d44858;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45);
    --color-hero-bg:          #0d0f14;
    --color-hero-text:        #e8e0d0;
    --color-hero-muted:       #7a7268;
    --color-hero-accent:      #c8a862;
    --color-blockquote-bg:    #1a1d25;
    --color-blockquote-border: #c8a862;
    --color-check:            #5aaa42;
    --color-cross:            #d44858;
  }
}
