/*
 * Theme Presets — Adapted from Adventures in Claude Theme Studio
 *
 * Each preset overrides the base CSS variables from style.css via
 * [data-preset="name"] selectors on <html>. The cascade:
 *   1. style.css :root  →  base defaults
 *   2. presets.css [data-preset]  →  preset overrides
 *   3. <style> inline  →  user custom overrides (from theme_config.colors)
 *
 * Presets control backgrounds, text, borders, and fonts.
 * --primary (brand color) is NOT overridden — it stays user-configured.
 */

/* ── Terminal ─────────────────────────────────────────────────────────── */
[data-preset="terminal"] {
  --background: #f0f0e8;
  --surface: #e8e8df;
  --text: #1e3e1e;
  --muted: #4a6a4a;
  --accent: #1a3a1a;
  --heading-font: 'JetBrains Mono', monospace;
  --body-font: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;
  --border-color: #b8c0b0;
  --code-bg: #d8ddd0;
}

[data-preset="terminal"] .hero-content h1::before {
  content: "> ";
  opacity: 0.5;
}

[data-preset="terminal"] .card {
  border-style: dashed;
}

/* ── Manuscript ───────────────────────────────────────────────────────── */
[data-preset="manuscript"] {
  --background: #faf7f0;
  --surface: #f5f1e8;
  --text: #3a3228;
  --muted: #6b5f4f;
  --accent: #2c2416;
  --heading-font: 'Playfair Display', 'Georgia', serif;
  --body-font: 'Lora', 'Georgia', 'Times New Roman', serif;
  --border-color: #ddd5c8;
  --code-bg: #eee8dc;
  --border-radius: 4px;
}

[data-preset="manuscript"] h1,
[data-preset="manuscript"] h2 {
  font-style: italic;
}

/* ── Blueprint ────────────────────────────────────────────────────────── */
[data-preset="blueprint"] {
  --background: #f4f6fa;
  --surface: #edf0f7;
  --text: #212d4a;
  --muted: #4a5a7a;
  --accent: #1a2744;
  --heading-font: 'Space Grotesk', 'Inter', sans-serif;
  --body-font: 'Inter', 'Helvetica Neue', 'Arial', sans-serif;
  --border-color: #bcc6dd;
  --code-bg: #dce2f0;
  --border-radius: 2px;
}

[data-preset="blueprint"] .card {
  border-left: 3px solid var(--primary);
}

/* ── Amber ────────────────────────────────────────────────────────────── */
[data-preset="amber"] {
  --background: #faf5ee;
  --surface: #f4ede2;
  --text: #42301a;
  --muted: #8a6a3a;
  --accent: #3a2a12;
  --heading-font: 'IBM Plex Sans', sans-serif;
  --body-font: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
  --border-color: #daccb0;
  --code-bg: #eee4d0;
  --border-radius: 6px;
}

/* ── Claude ────────────────────────────────────────────────────────────── */
[data-preset="claude"] {
  --background: #faf8f6;
  --surface: #f5f0ec;
  --text: #2a221c;
  --muted: #6b5c50;
  --accent: #1a1410;
  --heading-font: 'DM Sans', sans-serif;
  --body-font: 'DM Sans', 'Helvetica Neue', sans-serif;
  --border-color: #e0d4c8;
  --code-bg: #f0e8e0;
  --border-radius: 12px;
}

/* ── Magazine ─────────────────────────────────────────────────────────── */
[data-preset="magazine"] {
  --background: #ffffff;
  --surface: #f8f8f8;
  --text: #222222;
  --muted: #555555;
  --accent: #111111;
  --heading-font: 'Playfair Display', 'Georgia', serif;
  --body-font: 'Inter', 'Helvetica Neue', sans-serif;
  --border-color: #d0d0d0;
  --code-bg: #f0f0f0;
  --max-width: 1280px;
  --border-radius: 2px;
}

[data-preset="magazine"] .section-header h2 {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
}

[data-preset="magazine"] .hero-content h1 {
  font-size: 3rem;
  letter-spacing: -0.03em;
}

@media (min-width: 768px) {
  [data-preset="magazine"] .hero-content h1 {
    font-size: 4.5rem;
  }
}

/* ── Brutalist ────────────────────────────────────────────────────────── */
[data-preset="brutalist"] {
  --background: #ffffff;
  --surface: #ffffff;
  --text: #111111;
  --muted: #333333;
  --accent: #000000;
  --heading-font: 'Space Grotesk', 'Arial', sans-serif;
  --body-font: 'Space Grotesk', 'Arial', sans-serif;
  --border-color: #000000;
  --code-bg: #f0f0f0;
  --border-radius: 0;
}

[data-preset="brutalist"] .card {
  border-width: 3px;
  border-color: #000000;
}

[data-preset="brutalist"] h1,
[data-preset="brutalist"] h2,
[data-preset="brutalist"] h3 {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

[data-preset="brutalist"] .btn {
  border-width: 3px;
  border-color: currentColor;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── E-ink ────────────────────────────────────────────────────────────── */
[data-preset="e-ink"] {
  --background: #f9f9f6;
  --surface: #f4f4f0;
  --text: #333333;
  --muted: #666666;
  --accent: #222222;
  --heading-font: 'Lora', 'Georgia', serif;
  --body-font: 'Lora', 'Georgia', serif;
  --border-color: #cccccc;
  --code-bg: #eeeeea;
  --max-width: 960px;
  --border-radius: 0;
}

[data-preset="e-ink"] img {
  filter: grayscale(100%);
}

/* ── Cyberpunk ────────────────────────────────────────────────────────── */
[data-preset="cyberpunk"] {
  --background: #e8eaf0;
  --surface: #dde0e8;
  --text: #221840;
  --muted: #4a3a6a;
  --accent: #1a1030;
  --heading-font: 'Space Grotesk', sans-serif;
  --body-font: 'JetBrains Mono', 'Fira Code', monospace;
  --border-color: #8080aa;
  --code-bg: #d0cce0;
  --border-radius: 0;
}

[data-preset="cyberpunk"] .card {
  border-left: 3px solid var(--primary);
  border-right: 3px solid var(--primary);
}

[data-preset="cyberpunk"] h1,
[data-preset="cyberpunk"] h2 {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Colorful ─────────────────────────────────────────────────────────── */
[data-preset="colorful"] {
  --background: #fffbf5;
  --surface: #fff5eb;
  --text: #2a1a50;
  --muted: #6b4c9a;
  --accent: #1e1040;
  --heading-font: 'Space Grotesk', sans-serif;
  --body-font: 'DM Sans', 'Helvetica Neue', sans-serif;
  --border-color: #e0d0f0;
  --code-bg: #f3ecff;
  --border-radius: 12px;
}

[data-preset="colorful"] .card {
  border-image: linear-gradient(135deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3) 1;
  border-width: 2px;
  border-style: solid;
  border-radius: 0; /* border-image requires 0 radius */
}

/* ── Unicorn ──────────────────────────────────────────────────────────── */
[data-preset="unicorn"] {
  --background: #FFF8F9;
  --surface: #FFF2F5;
  --text: #4A3D50;
  --muted: #7A6B80;
  --accent: #3A2D3D;
  --heading-font: 'Quicksand', 'DM Sans', sans-serif;
  --body-font: 'Quicksand', 'DM Sans', sans-serif;
  --border-color: #E8D8EE;
  --code-bg: #FFF0F3;
  --border-radius: 16px;
}

[data-preset="unicorn"] h1,
[data-preset="unicorn"] h2 {
  background: linear-gradient(135deg, #E88FC4, #B08FE8, #8FB8E8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-preset="unicorn"] .card {
  border: 2px solid transparent;
  background-image:
    linear-gradient(var(--surface), var(--surface)),
    linear-gradient(135deg, #E88FC4, #B08FE8, #8FB8E8);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

@keyframes unicorn-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

[data-preset="unicorn"] .hero-content h1 {
  background-size: 200% 200%;
  animation: unicorn-shimmer 6s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════════════
   Author Genre Presets (AUTM-1100)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Literary Classic ──────────────────────────────────────────────── */
[data-preset="literary-classic"] {
  --background: #fdfaf5;
  --surface: #f5f0e8;
  --text: #2c1810;
  --muted: #6b5f4f;
  --accent: #2c1810;
  --heading-font: 'Cormorant Garamond', 'Georgia', serif;
  --body-font: 'Lora', 'Georgia', 'Times New Roman', serif;
  --border-color: #d4c5a0;
  --border-radius: 4px;
}

[data-preset="literary-classic"] h1,
[data-preset="literary-classic"] h2 {
  font-style: italic;
  letter-spacing: 0.02em;
}

/* ── Modern Thriller ───────────────────────────────────────────────── */
[data-preset="modern-thriller"] {
  --background: #0d0d0d;
  --surface: #1a1a1a;
  --text: #e8e8e8;
  --muted: #999999;
  --accent: #111111;
  --heading-font: 'Josefin Sans', 'Arial', sans-serif;
  --body-font: 'Inter', 'Helvetica Neue', sans-serif;
  --border-color: #333333;
  --border-radius: 0;
}

[data-preset="modern-thriller"] h1,
[data-preset="modern-thriller"] h2,
[data-preset="modern-thriller"] h3 {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

[data-preset="modern-thriller"] .btn-primary {
  background-color: #e53e3e;
}

/* ── Romance Elegance ──────────────────────────────────────────────── */
[data-preset="romance-elegance"] {
  --background: #fff9fb;
  --surface: #fce4ec;
  --text: #3d1a2e;
  --muted: #7a4a60;
  --accent: #5c2d4a;
  --heading-font: 'Cormorant Garamond', 'Georgia', serif;
  --body-font: 'Lora', 'Georgia', 'Times New Roman', serif;
  --border-color: #e8c0d0;
  --border-radius: 8px;
}

[data-preset="romance-elegance"] h1,
[data-preset="romance-elegance"] h2 {
  font-style: italic;
  letter-spacing: 0.01em;
}

[data-preset="romance-elegance"] .btn-primary {
  background-color: #c06080;
}

/* ── Business Authority ────────────────────────────────────────────── */
[data-preset="business-authority"] {
  --background: #ffffff;
  --surface: #eef2f7;
  --text: #1a3a5c;
  --muted: #4a6a8a;
  --accent: #1a3a5c;
  --heading-font: 'Montserrat', 'Arial', sans-serif;
  --body-font: 'Inter', 'Helvetica Neue', sans-serif;
  --border-color: #c0d0e0;
  --border-radius: 4px;
}

[data-preset="business-authority"] .card {
  border-left: 3px solid var(--primary);
}

/* ── Poetry Minimal ────────────────────────────────────────────────── */
[data-preset="poetry-minimal"] {
  --background: #ffffff;
  --surface: #f8f8f8;
  --text: #2d2d2d;
  --muted: #888888;
  --accent: #2d2d2d;
  --heading-font: 'DM Serif Display', 'Georgia', serif;
  --body-font: 'EB Garamond', 'Georgia', 'Times New Roman', serif;
  --border-color: #e0e0e0;
  --max-width: 680px;
  --border-radius: 0;
  --section-spacing: 4rem;
}

[data-preset="poetry-minimal"] h1,
[data-preset="poetry-minimal"] h2,
[data-preset="poetry-minimal"] h3 {
  text-align: center;
}

[data-preset="poetry-minimal"] .section-header h2 {
  letter-spacing: 0.04em;
}

/* ── Children's Playful ────────────────────────────────────────────── */
[data-preset="childrens-playful"] {
  --background: #fffef7;
  --surface: #fff3e0;
  --text: #333333;
  --muted: #666666;
  --accent: #ff6b35;
  --heading-font: 'Nunito', 'Arial', sans-serif;
  --body-font: 'Nunito', 'Arial', sans-serif;
  --border-color: #ffd0a0;
  --border-radius: 16px;
}

[data-preset="childrens-playful"] .card {
  border-width: 3px;
  border-color: #4ecdc4;
}

[data-preset="childrens-playful"] .hero-content h1 {
  color: #ff6b35;
}

/* ── Dark Academia ─────────────────────────────────────────────────── */
[data-preset="dark-academia"] {
  --background: #1a1610;
  --surface: #2c2416;
  --text: #c8b89a;
  --muted: #8a7a60;
  --accent: #d4c5a9;
  --heading-font: 'Cormorant Garamond', 'Georgia', serif;
  --body-font: 'Libre Baskerville', 'Georgia', 'Times New Roman', serif;
  --border-color: #3a3228;
  --border-radius: 4px;
}

[data-preset="dark-academia"] .card {
  border-style: dashed;
}

[data-preset="dark-academia"] h1,
[data-preset="dark-academia"] h2 {
  font-style: italic;
  letter-spacing: 0.02em;
}
