/* =========================================================
   PIYAVARA — Design tokens
   Palette: warm surfaces, hydra teal accent, mustard warning.
   Type: Instrument Serif (display) + Inter (body) via Fontshare/Google.
   ========================================================= */

:root,
[data-theme='light'] {
  /* Surfaces */
  --color-bg: #f7f6f2;
  --color-surface: #f9f8f5;
  --color-surface-2: #fbfbf9;
  --color-surface-offset: #f3f0ec;
  --color-surface-offset-2: #edeae5;
  --color-divider: #dcd9d5;
  --color-border: #d4d1ca;

  /* Text */
  --color-text: #28251d;
  --color-text-muted: #6b6a65;
  --color-text-faint: #a6a49f;
  --color-text-inverse: #f9f8f4;

  /* Primary (Hydra Teal) */
  --color-primary: #01696f;
  --color-primary-hover: #0c4e54;
  --color-primary-active: #0f3638;
  --color-primary-highlight: #cedcd8;
  --color-primary-tint: #d9e8e9;

  /* Semantic */
  --color-warning: #964219;
  --color-warning-tint: #f2e6dc;
  --color-error: #a12c7b;
  --color-success: #437a22;
  --color-success-tint: #d4dfcc;

  /* Info strip */
  --color-info-bg: #f2ead6;
  --color-info-border: #d9c98a;
  --color-info-text: #3b3312;

  /* Type scale */
  --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.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.25rem);
  --text-hero: clamp(2.75rem, 1.2rem + 5vw, 5.25rem);

  /* Spacing */
  --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, shadow, transition */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

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

  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  --font-display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-lanka: 'Noto Sans Sinhala', 'Noto Sans Tamil', var(--font-body);
}

[data-theme='dark'] {
  --color-bg: #17160f;
  --color-surface: #1c1b15;
  --color-surface-2: #211f18;
  --color-surface-offset: #1a1912;
  --color-surface-offset-2: #22201a;
  --color-divider: #2a2822;
  --color-border: #3a382f;

  --color-text: #ece9df;
  --color-text-muted: #a09d92;
  --color-text-faint: #6a675e;
  --color-text-inverse: #17160f;

  --color-primary: #6bb1b8;
  --color-primary-hover: #86c7cd;
  --color-primary-active: #a6dbdf;
  --color-primary-highlight: #253536;
  --color-primary-tint: #1e2a2b;

  --color-warning: #d78b56;
  --color-warning-tint: #3a2b1c;
  --color-error: #d878b3;
  --color-success: #7ab84f;
  --color-success-tint: #263a1a;

  --color-info-bg: #2a2515;
  --color-info-border: #5c4d1c;
  --color-info-text: #e9dfb8;

  --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);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #17160f;
    --color-surface: #1c1b15;
    --color-surface-2: #211f18;
    --color-surface-offset: #1a1912;
    --color-surface-offset-2: #22201a;
    --color-divider: #2a2822;
    --color-border: #3a382f;
    --color-text: #ece9df;
    --color-text-muted: #a09d92;
    --color-text-faint: #6a675e;
    --color-text-inverse: #17160f;
    --color-primary: #6bb1b8;
    --color-primary-hover: #86c7cd;
    --color-primary-active: #a6dbdf;
    --color-primary-highlight: #253536;
    --color-primary-tint: #1e2a2b;
    --color-warning: #d78b56;
    --color-warning-tint: #3a2b1c;
    --color-error: #d878b3;
    --color-success: #7ab84f;
    --color-success-tint: #263a1a;
    --color-info-bg: #2a2515;
    --color-info-border: #5c4d1c;
    --color-info-text: #e9dfb8;
  }
}
