@layer reset, tokens, base, components, utilities, overrides;

/* CSS Custom Properties - Default Theme */
@layer tokens {
:root {
  /* Primary brand color */
  --color-primary: #3b82f6;
  --color-primary-light: #60a5fa;
  --color-primary-dark: #2563eb;
  --color-link: #1d4ed8;
  --color-link-hover: #1e40af;

  /* Semantic roles for expressive H1/H2 inline Markdown. */
  --heading-accent: var(--color-primary);
  --heading-mark-bg: color-mix(in srgb, var(--color-primary) 82%, var(--color-text) 18%);
  --heading-mark-fg: var(--color-background);
  --heading-code-bg: color-mix(in srgb, var(--color-surface) 72%, var(--color-primary) 28%);
  --heading-code-fg: var(--color-text);
  --heading-link-decoration: var(--color-primary);
  --heading-rule: color-mix(in srgb, var(--color-text) 72%, var(--heading-accent) 28%);

  /* Semantic colors */
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-background: #ffffff;
  --color-surface: #f9fafb;
  --color-border: #e5e7eb;

  /* Status colors */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;

  /* Article/Content background (for readability over decorative backgrounds) */
  --article-bg: var(--color-background);
  --article-bg-opacity: 0.95;
  --article-blur: 0px;
  --article-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

  /* Font families */
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: var(--font-body);
  --font-mono: ui-monospace, 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
  --leading-heading-expressive: 1.35;

  /* Font sizes (modular scale) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* Line heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* Spacing scale */
  --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-12: 3rem;
  --space-16: 4rem;

  /* Layout */
  --content-width: 65ch;
  --content-max-width: var(--content-width);
  --page-width: 1200px;
  --grid-max-width: 1400px;
  --radius: 0.375rem;
  --radius-lg: 0.5rem;

  /* Article reading progress indicator - minimal, no glow */
  --article-progress-height: 3px;
  --article-progress-track: color-mix(in srgb, var(--color-text) 20%, var(--color-background) 80%);
  --article-progress-start: var(--color-text-muted);
  --article-progress-end: var(--color-text);
  --article-progress-glow: transparent;

  /* Accent gradients - editorial, subdued tones */
  --gradient-accent: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  /* Warm earth tones instead of AI purple/pink */
  --gradient-vibrant: linear-gradient(135deg, #c75b39, #d4856a, #e8b4a2);
  --gradient-warm: linear-gradient(135deg, #b85450, #cd7b5a, #d4a574);
  --gradient-cool: linear-gradient(135deg, #5a7a6c, #7a9e8c, #9eb9ae);
  --gradient-sunset: linear-gradient(135deg, #c76b50, #d4966a, #e2c08d);
  --gradient-ocean: linear-gradient(135deg, #4a6b7c, #6b8fa3, #8fb3c4);

  /* Palette-specific gradients - desaturated, harmonious */
  --gradient-catppuccin: linear-gradient(135deg, #b8a5c8, #d4c4d9, #e8dde8);
  --gradient-nord: linear-gradient(135deg, #7a8fa3, #8fa3b8, #a3b8c7);
  --gradient-dracula: linear-gradient(135deg, #9a8ab8, #b8a8c8, #c8bcd8);
  --gradient-gruvbox: linear-gradient(135deg, #c4a06c, #d4b07c, #e4c89c);
  --gradient-rose-pine: linear-gradient(135deg, #b8a8c4, #d4c4c8, #e8dcd8);
  --gradient-solarized: linear-gradient(135deg, #6a8a9c, #8aa8b8, #aac4d0);
  --gradient-tokyo-night: linear-gradient(135deg, #7a8cb8, #9aacd8, #b8cce8);

  /* Media border settings */
  --media-border-width: 3px;
  --media-border-style: solid;
  --media-border-color: var(--color-border);
  --media-border-gradient: none;
  --media-border-radius: var(--radius-lg);

}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --color-text: #f9fafb;
    --color-text-muted: #9ca3af;
    --color-background: #111827;
    --color-surface: #1f2937;
    --color-border: #374151;
    --color-link: #93c5fd;
    --color-link-hover: #bfdbfe;

    /* Darker article shadow for dark mode */
    --article-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --article-progress-track: color-mix(in srgb, var(--color-background) 65%, white 35%);
    --article-progress-glow: color-mix(in srgb, var(--color-primary) 50%, transparent 60%);
  }
}
}
