/* Nestify Theme - Single Source of Truth for Styling */

:root {
  /* Color Tokens */
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --accent: #3b82f6;
  --accent-contrast: #ffffff;
  --border: #e5e7eb;
  --surface: #f9fafb;
  --success: #10b981;
  --warning: #f59e0b;
  
  /* Typography Scale */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 2.5rem;    /* 40px */
  --font-h1: 2rem;           /* 32px */
  --font-h2: 1.5rem;         /* 24px */
  --font-body: 1rem;         /* 16px */
  --font-small: 0.875rem;    /* 14px */
  
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.6;
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Spacing Scale */
  --space-xs: 0.5rem;   /* 8px */
  --space-s: 1rem;      /* 16px */
  --space-m: 1.5rem;    /* 24px */
  --space-l: 2rem;      /* 32px */
  --space-xl: 3rem;     /* 48px */
  --space-2xl: 4rem;    /* 64px */
  --space-3xl: 6rem;    /* 96px */
  
  /* Border Radius */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Layout */
  --max-width: 1200px;
  --container-padding: var(--space-s);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
}

/* Mobile breakpoints */
@media (min-width: 640px) {
  :root {
    --font-display: 3rem;      /* 48px */
    --font-h1: 2.25rem;        /* 36px */
    --container-padding: var(--space-m);
  }
}

@media (min-width: 768px) {
  :root {
    --font-display: 3.5rem;    /* 56px */
    --font-h1: 2.5rem;         /* 40px */
    --container-padding: var(--space-l);
  }
}

@media (min-width: 1024px) {
  :root {
    --font-display: 4rem;      /* 64px */
    --font-h1: 3rem;           /* 48px */
    --container-padding: var(--space-xl);
  }
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

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

/* Typography Classes */
.text-display {
  font-size: var(--font-display);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

.text-h1 {
  font-size: var(--font-h1);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

.text-h2 {
  font-size: var(--font-h2);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

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

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

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

/* Layout Utilities */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section {
  padding: var(--space-2xl) 0;
}

.section-sm {
  padding: var(--space-xl) 0;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}
