/* site.css - Updated Design System */
:root {
  /* Light mode tokens */
  --brand: #8B5FBF;
  --brand-muted: #9D7BC9;
  --bg: #FAF9FD;
  --surface: #FFFFFF;
  --text: #2D3748;
  --muted: #718096;
  --success: #38A169;
  --warning: #D69E2E;
  --danger: #E53E3E;
  --border: #E2E8F0;
  
  /* Typography */
  --font-display: 'Inter', system-ui, sans-serif;
  --font-text: 'Inter', system-ui, sans-serif;
  
  /* 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;
  
  /* Radius */
  --radius-sm: 0.125rem;
  --radius-base: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 1.125rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-base: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Motion */
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 350ms;
}

/* Dark mode */
.dark {
  --brand: #9D7BC9;
  --brand-muted: #8B5FBF;
  --bg: #0F0F1A;
  --surface: #1A1A2E;
  --text: #F7FAFC;
  --muted: #A0AEC0;
  --success: #68D391;
  --warning: #F6E05E;
  --danger: #FC8181;
  --border: #2D3748;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--duration-base), color var(--duration-base);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all var(--duration-base);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  padding: 0 var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text);
}

.brand img {
  height: 80px;
  width: auto;
}

.nav {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  transition: all var(--duration-base);
  position: relative;
}

.nav a:hover {
  color: var(--text);
  background: var(--bg);
}

.nav a:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: var(--brand);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-6);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-base);
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  background: var(--brand-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

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

.btn:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--brand);
  transform: none;
  box-shadow: none;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: auto;
  padding: var(--space-8) 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.muted {
  color: var(--muted);
  font-size: 0.875rem;
}

/* Grid system */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Hero section */
.hero {
  padding: var(--space-16) 0;
  background: linear-gradient(135deg, var(--bg) 0%, color-mix(in srgb, var(--brand) 5%, transparent) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--brand) 10%, transparent) 0%, transparent 50%);
  pointer-events: none;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--space-6);
  background: linear-gradient(135deg, var(--text) 0%, var(--brand) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: var(--muted);
  margin-bottom: var(--space-8);
  max-width: 600px;
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    height: 64px;
    padding: 0 var(--space-4);
  }
  
  .brand img {
    height: 32px;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1.125rem;
  }
  
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .footer-inner {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .btn:hover {
    transform: none;
  }
  
  .card:hover {
    transform: none;
  }
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; /* prevent line breaks */
  border: 0;
}

/* Elements are visually hidden until focused/active (e.g., skip link) */
.visually-hidden-focusable:not(:focus):not(:active) {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}