/* ============================================
   FoldedSkies Design System
   "The Digital Sky" - Calm, Premium, Breathable
   ============================================ */

/* ---------- Custom Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

@font-face {
  font-family: 'Caster';
  src: url('../assets/fonts/Caster-Regular.woff2') format('woff2');
  font-weight: normal;
  font-display: swap;
}

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Typography */
  --font-display: 'Caster', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Font Sizes */
  --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;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  --text-7xl: 4.5rem;
  --text-hero: clamp(3rem, 8vw, 6rem);
  
  /* Shape Language */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-card: 32px;
  --radius-button: 9999px;
  --radius-modal: 32px;
  
  /* 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;
  
  /* Elevation - "Floating Islands" */
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 15px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 20px rgba(0, 0, 0, 0.12);
  --shadow-float: 0 20px 25px rgba(0, 0, 0, 0.15);
  --shadow-float-hover: 0 28px 35px rgba(0, 0, 0, 0.20);
  --shadow-glow: 0 0 30px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-float: 600ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-Index Scale */
  --z-base: 0;
  --z-above: 10;
  --z-nav: 100;
  --z-modal: 200;
  --z-overlay: 300;
}

/* ============================================
   THEME SYSTEM - 8 Themes (4 Light + 4 Dark)
   ============================================ */

/* ---------- LIGHT THEMES ---------- */

/* Pearl (Default Light) */
[data-theme="pearl"], :root {
  --bg: #f8f9fa;
  --bg-secondary: #f1f3f5;
  --card: #ffffff;
  --card-hover: #fefefe;
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --primary-glow: rgba(14, 165, 233, 0.4);
  --text: #1a1a2e;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: rgba(0, 0, 0, 0.08);
  --glass-tint: rgba(14, 165, 233, 0.08);
  --gradient-start: #e0f2fe;
  --gradient-end: #f0f9ff;
}

/* Amber (Sunrise) */
[data-theme="amber"] {
  --bg: #fffbeb;
  --bg-secondary: #fef3c7;
  --card: #fffdf5;
  --card-hover: #ffffff;
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --primary-glow: rgba(245, 158, 11, 0.4);
  --text: #1a1a2e;
  --text-secondary: #78716c;
  --text-muted: #a8a29e;
  --border: rgba(245, 158, 11, 0.15);
  --glass-tint: rgba(245, 158, 11, 0.1);
  --gradient-start: #fef3c7;
  --gradient-end: #fffbeb;
}

/* Rose (Sunset) */
[data-theme="rose"] {
  --bg: #fff1f2;
  --bg-secondary: #ffe4e6;
  --card: #fff5f6;
  --card-hover: #ffffff;
  --primary: #f43f5e;
  --primary-hover: #e11d48;
  --primary-glow: rgba(244, 63, 94, 0.4);
  --text: #1a1a2e;
  --text-secondary: #71717a;
  --text-muted: #a1a1aa;
  --border: rgba(244, 63, 94, 0.12);
  --glass-tint: rgba(244, 63, 94, 0.08);
  --gradient-start: #fecdd3;
  --gradient-end: #fff1f2;
}

/* Ocean (Breeze) */
[data-theme="ocean"] {
  --bg: #f0f9ff;
  --bg-secondary: #e0f2fe;
  --card: #f8fafc;
  --card-hover: #ffffff;
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --primary-glow: rgba(14, 165, 233, 0.4);
  --text: #0c4a6e;
  --text-secondary: #0369a1;
  --text-muted: #7dd3fc;
  --border: rgba(14, 165, 233, 0.15);
  --glass-tint: rgba(14, 165, 233, 0.1);
  --gradient-start: #bae6fd;
  --gradient-end: #f0f9ff;
}

/* ---------- DARK THEMES ---------- */

/* Obsidian (Default Dark) */
[data-theme="obsidian"] {
  --bg: #1a1b1e;
  --bg-secondary: #25262b;
  --card: #25262b;
  --card-hover: #2c2d32;
  --primary: #a855f7;
  --primary-hover: #9333ea;
  --primary-glow: rgba(168, 85, 247, 0.5);
  --text: #f8f9fa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: rgba(255, 255, 255, 0.08);
  --glass-tint: rgba(168, 85, 247, 0.15);
  --gradient-start: #2e1065;
  --gradient-end: #1a1b1e;
}

/* Midnight (Sapphire) */
[data-theme="midnight"] {
  --bg: #1a1e2d;
  --bg-secondary: #21253b;
  --card: #21253b;
  --card-hover: #282d47;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.5);
  --text: #f8f9fa;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(255, 255, 255, 0.08);
  --glass-tint: rgba(37, 99, 235, 0.15);
  --gradient-start: #1e3a5f;
  --gradient-end: #1a1e2d;
}

/* Ruby (Ember) */
[data-theme="ruby"] {
  --bg: #2d1a1a;
  --bg-secondary: #3b2121;
  --card: #3b2121;
  --card-hover: #452828;
  --primary: #ef4444;
  --primary-hover: #dc2626;
  --primary-glow: rgba(239, 68, 68, 0.5);
  --text: #fef2f2;
  --text-secondary: #fca5a5;
  --text-muted: #f87171;
  --border: rgba(255, 255, 255, 0.08);
  --glass-tint: rgba(239, 68, 68, 0.15);
  --gradient-start: #450a0a;
  --gradient-end: #2d1a1a;
}

/* Emerald (Aurora) */
[data-theme="emerald"] {
  --bg: #1a2d1e;
  --bg-secondary: #213b25;
  --card: #213b25;
  --card-hover: #28472c;
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-glow: rgba(16, 185, 129, 0.5);
  --text: #ecfdf5;
  --text-secondary: #6ee7b7;
  --text-muted: #34d399;
  --border: rgba(255, 255, 255, 0.08);
  --glass-tint: rgba(16, 185, 129, 0.15);
  --gradient-start: #064e3b;
  --gradient-end: #1a2d1e;
}

/* ============================================
   BASE RESET & DEFAULTS
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: normal;
  line-height: 1.2;
  color: var(--text);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- Utility Classes ---------- */

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
