/* ============================================
   COUNCIL OF SEVEN KINGS — Design Tokens
   Dark regal palette: near-black, gold, jewel tones
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400..900&family=Manrope:wght@300..700&display=swap');

:root {
  /* --- Type Scale (fluid) --- */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.9rem  + 0.5vw,  1.125rem);
  --text-lg:   clamp(1.125rem, 0.95rem + 0.85vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1rem    + 1.5vw,  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);

  /* --- 4px Spacing System --- */
  --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;

  /* --- Font Families --- */
  --font-display: 'Cinzel', 'Georgia', serif;
  --font-body: 'Manrope', 'Helvetica Neue', sans-serif;

  /* --- Radius --- */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --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%;
}

/* ============================================
   DARK MODE (default)
   ============================================ */
:root, [data-theme="dark"] {
  --color-bg:             #0d0b07;
  --color-surface:        #1a1714;
  --color-surface-2:      #231f1b;
  --color-surface-offset: #1e1a16;
  --color-surface-offset-2: #282420;
  --color-surface-dynamic: #322e29;
  --color-divider:        #3a352e;
  --color-border:         #4a443c;

  --color-text:           #e8e2d4;
  --color-text-muted:     #8a8478;
  --color-text-faint:     #5e584e;
  --color-text-inverse:   #0d0b07;

  --color-primary:        #c9a84c;
  --color-primary-hover:  #d4af37;
  --color-primary-active: #b8972e;
  --color-primary-highlight: #3a3422;

  --color-secondary:      #8b2d3a;
  --color-secondary-hover: #a33445;
  --color-secondary-active: #731f2c;
  --color-secondary-highlight: #3a2228;

  --color-tertiary:       #2d6b4f;
  --color-tertiary-hover: #358a62;
  --color-tertiary-active: #245640;
  --color-tertiary-highlight: #22352c;

  --color-error:          #a33445;
  --color-success:        #2d6b4f;
  --color-warning:        #c9a84c;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.5);
}

/* ============================================
   LIGHT MODE
   ============================================ */
[data-theme="light"] {
  --color-bg:             #f5f0e6;
  --color-surface:        #faf7f0;
  --color-surface-2:      #ffffff;
  --color-surface-offset: #ede8dc;
  --color-surface-offset-2: #e5dfd2;
  --color-surface-dynamic: #ddd7c9;
  --color-divider:        #d4cec0;
  --color-border:         #c4beb0;

  --color-text:           #1a1610;
  --color-text-muted:     #6b6558;
  --color-text-faint:     #9e9888;
  --color-text-inverse:   #f5f0e6;

  --color-primary:        #8b6914;
  --color-primary-hover:  #7a5c10;
  --color-primary-active: #6a4f0c;
  --color-primary-highlight: #f0e6c8;

  --color-secondary:      #8b2d3a;
  --color-secondary-hover: #a33445;
  --color-secondary-active: #731f2c;
  --color-secondary-highlight: #f5dde1;

  --color-tertiary:       #1d5a3f;
  --color-tertiary-hover: #2d6b4f;
  --color-tertiary-active: #154d34;
  --color-tertiary-highlight: #d8ede3;

  --color-error:          #8b2d3a;
  --color-success:        #1d5a3f;
  --color-warning:        #8b6914;

  --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.08);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 80 / 0.1);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 80 / 0.14);
}

/* System preference fallback */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --color-bg:             #f5f0e6;
    --color-surface:        #faf7f0;
    --color-surface-2:      #ffffff;
    --color-surface-offset: #ede8dc;
    --color-surface-offset-2: #e5dfd2;
    --color-surface-dynamic: #ddd7c9;
    --color-divider:        #d4cec0;
    --color-border:         #c4beb0;
    --color-text:           #1a1610;
    --color-text-muted:     #6b6558;
    --color-text-faint:     #9e9888;
    --color-text-inverse:   #f5f0e6;
    --color-primary:        #8b6914;
    --color-primary-hover:  #7a5c10;
    --color-primary-active: #6a4f0c;
    --color-primary-highlight: #f0e6c8;
    --color-secondary:      #8b2d3a;
    --color-secondary-hover: #a33445;
    --color-secondary-active: #731f2c;
    --color-secondary-highlight: #f5dde1;
    --color-tertiary:       #1d5a3f;
    --color-tertiary-hover: #2d6b4f;
    --color-tertiary-active: #154d34;
    --color-tertiary-highlight: #d8ede3;
    --color-error:          #8b2d3a;
    --color-success:        #1d5a3f;
    --color-warning:        #8b6914;
    --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.08);
    --shadow-md: 0 4px 12px oklch(0.2 0.01 80 / 0.1);
    --shadow-lg: 0 12px 32px oklch(0.2 0.01 80 / 0.14);
  }
}
