/* ============================================
   VARIABLES
   ============================================ */

:root {
  /* Colors - Organic Palette */
  --color-background: #F5F1E8;
  --color-background-alt: #EDE8D0;
  --color-surface: #FFFFFF;
  
  --color-primary: #2D4A3E;
  --color-primary-hover: #1F352C;
  --color-primary-light: #E8F0E9;
  
  --color-accent: #D4A373;
  --color-accent-hover: #B8935F;
  --color-accent-light: #F5E6D3;
  
  --color-text: #4A3728;
  --color-text-muted: #7A6555;
  --color-text-light: #F5F1E8;
  
  --color-success: #5A7D5A;
  --color-warning: #C8835A;
  --color-danger: #A65D57;
  
  --color-border: #D4C9B0;
  
  /* Typography */
  --font-heading: Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  
  --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: 2rem;
  --text-4xl: 2.5rem;
  
  --line-height-tight: 1.2;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.8;
  
  /* Spacing Scale (0–96px) */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 6rem;
  
  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* Shadows - Warm, Natural */
  --shadow-sm: 0 1px 2px 0 rgba(74, 55, 40, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(74, 55, 40, 0.1), 0 2px 4px -1px rgba(74, 55, 40, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(74, 55, 40, 0.1), 0 4px 6px -2px rgba(74, 55, 40, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(74, 55, 40, 0.1), 0 10px 10px -5px rgba(74, 55, 40, 0.04);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/* ============================================
   RESET / NORMALIZE
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@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;
    scroll-behavior: auto !important;
  }
}

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

input,
button,
textarea,
select {
  font: inherit;
}

/* ============================================
   BASE STYLES
   ============================================ */

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-4);
  }

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

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

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

ul, ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-5);
}

li {
  margin-bottom: var(--space-2);
}

hr {
  border: none;
  height: 1px;
  background-color: var(--color-border);
  margin: var(--space-6) 0;
}

/* ============================================
   UTILITIES
   ============================================ */

.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

@media (max-width: 768px) {
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.grid {
  display: grid;
}

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

/* ============================================
   COMPONENTS
   ============================================ */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1;
  color: var(--color-text-light)!important;
  background-color: var(--color-primary);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-accent);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-primary)!important;
  border-color: var(--color-primary);
}

.btn--secondary:hover {
  background-color: var(--color-primary-light);
  color: var(--color-primary)!important;
}

.btn--accent {
  background-color: var(--color-accent);
  color: var(--color-text)!important;
}

.btn--accent:hover {
  background-color: var(--color-accent-hover);
}

/* Form Elements */
.input,
.textarea,
.select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(45, 74, 62, 0.1);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--color-text-muted);
}

.input:disabled,
.textarea:disabled,
.select:disabled {
  background-color: var(--color-background-alt);
  cursor: not-allowed;
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

/* Cards */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card--flat {
  background-color: var(--color-background-alt);
  box-shadow: none;
  border: none;
}

.card--flat:hover {
  box-shadow: var(--shadow-sm);
}