/*
===========================================
Soul Realms AI - Typography System
===========================================

Typography System:
- Logo Wordmark: Gaoel (special logo treatment)
- Headlines: Cormorant Garamond (elegant serif)
- Body Text: Inter (clean sans-serif)
- Display: Cinzel (decorative, mystical)

Created: 2026-01-13
===========================================
*/

/* =========================================
   1. CSS CUSTOM PROPERTIES (Variables)
   ========================================= */

:root {
  /* Font Families */
  --font-logo: 'Gaoel', 'Times New Roman', serif;
  --font-heading: 'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
  --font-body: 'Inter', 'Arial', 'Helvetica', sans-serif;
  --font-display: 'Cinzel', 'Times New Roman', serif;
  
  /* Typography Scale - Headings */
  --text-h1: 3rem; /* 48px */
  --text-h2: 2.5rem; /* 40px */
  --text-h3: 2rem; /* 32px */
  --text-h4: 1.75rem; /* 28px */
  --text-h5: 1.5rem; /* 24px */
  --text-h6: 1.25rem; /* 20px */
  
  /* Typography Scale - Body */
  --text-body-large: 1.125rem; /* 18px */
  --text-body: 1rem; /* 16px */
  --text-body-small: 0.875rem; /* 14px */
  --text-caption: 0.75rem; /* 12px */
  
  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Line Heights */
  --line-height-tight: 1.1;
  --line-height-snug: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  --line-height-loose: 2;
  
  /* Letter Spacing */
  --letter-spacing-tight: -0.02em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;
  --letter-spacing-wider: 0.05em;
  --letter-spacing-widest: 0.1em;
}

/* =========================================
   2. BASE TYPOGRAPHY STYLES
   ========================================= */

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary, #1a1a1a);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   3. HEADING STYLES
   ========================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--line-height-tight);
  margin-top: 0;
  margin-bottom: 0.5em;
  color: inherit;
}

h1 {
  font-size: var(--text-h1);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
}

h2 {
  font-size: var(--text-h2);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-tight);
}

h3 {
  font-size: var(--text-h3);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-normal);
}

h4 {
  font-size: var(--text-h4);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-normal);
}

h5 {
  font-size: var(--text-h5);
  font-weight: var(--font-weight-regular);
  letter-spacing: var(--letter-spacing-normal);
}

h6 {
  font-size: var(--text-h6);
  font-weight: var(--font-weight-regular);
  letter-spacing: var(--letter-spacing-wide);
}

/* =========================================
   4. BODY TEXT STYLES
   ========================================= */

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

.text-body-large {
  font-size: var(--text-body-large);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-relaxed);
}

.text-body {
  font-size: var(--text-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
}

.text-body-small {
  font-size: var(--text-body-small);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
}

.text-caption {
  font-size: var(--text-caption);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-snug);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wider);
  color: var(--color-text-secondary, #666666);
}

/* =========================================
   5. DISPLAY TYPOGRAPHY
   ========================================= */

.font-display {
  font-family: var(--font-display);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
}

.font-logo {
  font-family: var(--font-logo);
}

/* =========================================
   6. FONT WEIGHT CLASSES
   ========================================= */

.font-light { font-weight: var(--font-weight-light); }
.font-regular { font-weight: var(--font-weight-regular); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* =========================================
   7. ITALIC STYLES
   ========================================= */

.font-italic {
  font-style: italic;
}

h1.font-italic, h2.font-italic, h3.font-italic {
  /* Cormorant Garamond italic variant */
}

/* =========================================
   8. LINE HEIGHT CLASSES
   ========================================= */

.leading-tight { line-height: var(--line-height-tight); }
.leading-snug { line-height: var(--line-height-snug); }
.leading-normal { line-height: var(--line-height-normal); }
.leading-relaxed { line-height: var(--line-height-relaxed); }
.leading-loose { line-height: var(--line-height-loose); }

/* =========================================
   9. LETTER SPACING CLASSES
   ========================================= */

.tracking-tight { letter-spacing: var(--letter-spacing-tight); }
.tracking-normal { letter-spacing: var(--letter-spacing-normal); }
.tracking-wide { letter-spacing: var(--letter-spacing-wide); }
.tracking-wider { letter-spacing: var(--letter-spacing-wider); }
.tracking-widest { letter-spacing: var(--letter-spacing-widest); }

/* =========================================
   10. TEXT TRANSFORM CLASSES
   ========================================= */

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

/* =========================================
   11. RESPONSIVE TYPOGRAPHY
   ========================================= */

@media (max-width: 768px) {
  :root {
    /* Scale down headings for mobile */
    --text-h1: 2.25rem; /* 36px */
    --text-h2: 1.875rem; /* 30px */
    --text-h3: 1.5rem; /* 24px */
    --text-h4: 1.25rem; /* 20px */
    --text-h5: 1.125rem; /* 18px */
    --text-h6: 1rem; /* 16px */
    
    /* Keep body sizes readable on mobile */
    --text-body-large: 1.0625rem; /* 17px */
    --text-body: 1rem; /* 16px */
    --text-body-small: 0.875rem; /* 14px */
    --text-caption: 0.6875rem; /* 11px */
  }
  
  /* Increase line heights on mobile for readability */
  h1, h2, h3, h4, h5, h6 {
    line-height: var(--line-height-snug);
  }
}

@media (max-width: 480px) {
  :root {
    /* Further scale down for very small screens */
    --text-h1: 2rem; /* 32px */
    --text-h2: 1.5rem; /* 24px */
    --text-h3: 1.25rem; /* 20px */
  }
}

/* =========================================
   12. UTILITY CLASSES
   ========================================= */

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.break-words {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.no-underline {
  text-decoration: none;
}

/* =========================================
   13. LINK STYLES
   ========================================= */

a {
  color: var(--color-primary, #450086);
  text-decoration: underline;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-hover, #5f00b9);
}

a:focus {
  outline: 2px solid var(--color-primary, #450086);
  outline-offset: 2px;
}

/* =========================================
   14. ACCESSIBILITY ENHANCEMENTS
   ========================================= */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  body {
    color: #000000;
  }
  h1, h2, h3, h4, h5, h6 {
    color: #000000;
  }
}

/* =========================================
   15. PRINT STYLES
   ========================================= */

@media print {
  body {
    font-size: 12pt;
    color: #000;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
}