/* ==========================================================================
   Mark Bell Author Website - Main Stylesheet
   Color System: Warm, cozy author brand
   Typography: Serif headings, clean sans-serif body
   ========================================================================== */

/* CSS Custom Properties - Design System
   ========================================================================== */

:root {
  /* Color Palette - Warm, cozy, aged paper tones */
  
  /* Primary Colors */
  --color-cream-base: #F8F5F0;        /* RGB(248, 245, 240) | CMYK(1, 3, 6, 3) */
  --color-parchment: #F1EBE1;         /* RGB(241, 235, 225) | CMYK(3, 6, 12, 5) */
  --color-aged-paper: #E6D8C5;        /* RGB(230, 216, 197) | CMYK(8, 13, 22, 10) */
  --color-warm-cream: #EBE0D1;        /* RGB(235, 224, 209) | CMYK(6, 10, 18, 8) */
  
  /* Accent Colors - Saturated for focal points */
  --color-amber-light: #D4A574;       /* RGB(212, 165, 116) | CMYK(20, 35, 55, 17) */
  --color-amber: #C4945A;             /* RGB(196, 148, 90) | CMYK(25, 40, 65, 23) */
  --color-amber-dark: #A67C47;        /* RGB(166, 124, 71) | CMYK(30, 45, 70, 35) */
  
  /* Deep red for call-to-action elements */
  --color-red-deep: #8B333A;          /* RGB(139, 51, 58) | CMYK(35, 85, 70, 45) */
  --color-red-warm: #A44B52;          /* RGB(164, 75, 82) | CMYK(30, 75, 65, 36) */
  
  /* Text Colors */
  --color-text-primary: #3A2F2A;      /* RGB(58, 47, 42) | CMYK(50, 60, 65, 77) */
  --color-text-secondary: #5A4B43;    /* RGB(90, 75, 67) | CMYK(40, 50, 55, 65) */
  --color-text-light: #7A6B61;        /* RGB(122, 107, 97) | CMYK(35, 45, 50, 52) */
  
  /* Border Colors */
  --color-border-light: #D9CAB8;      /* RGB(217, 202, 184) | CMYK(12, 18, 25, 15) */
  --color-border-medium: #C4B0A0;     /* RGB(196, 176, 160) | CMYK(20, 25, 30, 23) */
  
  /* Typography Scale & System */
  --font-serif: "Crimson Text", "Georgia", "Times New Roman", serif;
  --font-sans: "Source Sans Pro", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "Source Code Pro", "Consolas", "Monaco", monospace;
  
  /* Font Sizes - Modular Scale (1.25 ratio) */
  --text-xs: 0.8rem;        /* 12.8px */
  --text-sm: 1rem;          /* 16px - base */
  --text-base: 1rem;        /* 16px */
  --text-lg: 1.25rem;       /* 20px */
  --text-xl: 1.563rem;      /* 25px */
  --text-2xl: 1.953rem;     /* 31.25px */
  --text-3xl: 2.441rem;     /* 39px */
  --text-4xl: 3.052rem;     /* 48.8px */
  --text-5xl: 3.815rem;     /* 61px */
  
  /* Line Heights - Baseline Grid (24px base) */
  --leading-tight: 1.25;    /* 20px */
  --leading-snug: 1.375;    /* 22px */
  --leading-normal: 1.5;    /* 24px - baseline */
  --leading-relaxed: 1.625; /* 26px */
  --leading-loose: 1.75;    /* 28px */
  
  /* Spacing Scale - Based on 24px baseline grid */
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-6: 1.5rem;     /* 24px - baseline */
  --space-8: 2rem;       /* 32px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */
  
  /* Container & Layout */
  --container-max-width: 1200px;
  --container-padding: var(--space-6);
  --grid-gap: var(--space-6);
  
  /* Border Radius */
  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(58, 47, 42, 0.1);
  --shadow-md: 0 4px 6px rgba(58, 47, 42, 0.1);
  --shadow-lg: 0 8px 16px rgba(58, 47, 42, 0.15);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */

/* Box Sizing Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margins */
* {
  margin: 0;
  padding: 0;
}

/* HTML & Body */
html {
  font-size: 100%; /* 16px base */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-cream-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Typography System
   ========================================================================== */

/* Headings - Serif font family for warmth */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--space-6);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  margin-bottom: var(--space-8);
}

h2 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-6);
}

h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-6);
}

h4 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

h5 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

h6 {
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
}

/* Body text */
p {
  margin-bottom: var(--space-6);
  max-width: 70ch; /* Optimal reading line length */
}

/* Links */
a {
  color: var(--color-amber-dark);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--color-red-deep);
  text-decoration: underline;
}

/* Lists */
ul, ol {
  margin-bottom: var(--space-6);
  padding-left: var(--space-6);
}

li {
  margin-bottom: var(--space-2);
}

/* Blockquotes - For reader testimonials */
blockquote {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-style: italic;
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  border-left: 4px solid var(--color-amber);
  padding-left: var(--space-6);
  margin: var(--space-8) 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Layout & Grid System
   ========================================================================== */

/* Container */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Grid system */
.grid {
  display: grid;
  gap: var(--grid-gap);
}

.grid--2-col {
  grid-template-columns: 1fr 1fr;
}

.grid--3-col {
  grid-template-columns: repeat(3, 1fr);
}

/* Flexbox utilities */
.flex {
  display: flex;
}

.flex--column {
  flex-direction: column;
}

.flex--center {
  align-items: center;
  justify-content: center;
}

.flex--between {
  justify-content: space-between;
}

.flex--align-center {
  align-items: center;
}

/* Spacing utilities */
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

/* ==========================================================================
   Responsive Design - Mobile First
   ========================================================================== */

/* Tablet and up */
@media (max-width: 768px) {
  :root {
    --container-padding: var(--space-4);
    --text-4xl: 2.441rem;  /* Scale down heading sizes */
    --text-3xl: 1.953rem;
    --text-2xl: 1.563rem;
  }
  
  .grid--2-col,
  .grid--3-col {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 var(--space-4);
  }
}

/* Mobile */
@media (max-width: 480px) {
  :root {
    --container-padding: var(--space-3);
    --grid-gap: var(--space-4);
  }
  
  h1 {
    font-size: var(--text-3xl);
  }
  
  h2 {
    font-size: var(--text-2xl);
  }
  
  h3 {
    font-size: var(--text-xl);
  }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* Focus styles */
*:focus {
  outline: 2px solid var(--color-amber);
  outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-text-primary: #000000;
    --color-text-secondary: #333333;
    --color-cream-base: #FFFFFF;
  }
}