/* 
 * Design System - shafenkhan.com
 * Modern, minimalist, premium aesthetic
 * Performance-first, accessible, no dependencies
 */

/* ========================================
   1. Design Tokens
   ======================================== */
:root {
  /* Type Scale - Major Third (1.25) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;
  --text-5xl: 3.75rem;
  
  /* Spacing Scale - 8px base */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;
  
  /* Colors - Light Mode */
  --color-primary: #1a1a2e;
  --color-surface: #ffffff;
  --color-surface-alt: #f8f9fa;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-accent: #3b82f6;
  --color-accent-hover: #2563eb;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-border: rgba(0,0,0,0.08);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --gradient-subtle: linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface-alt) 100%);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  
  /* Focus */
  --focus-ring: 0 0 0 3px rgba(59,130,246,0.5);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  
  /* Layout */
  --max-width: 1200px;
  --header-height: 4rem;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #f1f5f9;
    --color-surface: #0f172a;
    --color-surface-alt: #1e293b;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-accent: #60a5fa;
    --color-accent-hover: #3b82f6;
    --color-success: #34d399;
    --color-warning: #fbbf24;
    --color-border: rgba(255,255,255,0.08);
    --gradient-primary: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.25);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5);
  }
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

h1 { font-size: var(--text-5xl); }
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); }

@media (max-width: 768px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
}

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

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

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

a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 2px;
}

strong {
  font-weight: 600;
}

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

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

.section--hero {
  padding: var(--space-5xl) 0;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

@media (min-width: 768px) {
  .grid--hero {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: var(--space-3xl);
  }
}

.flex {
  display: flex;
}

.flex--center {
  align-items: center;
  justify-content: center;
}

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

.flex--wrap {
  flex-wrap: wrap;
}

/* ========================================
   4. Components
   ======================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-base);
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn--primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
}

.btn--secondary {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

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

.btn-group {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--space-xl);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-accent);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.card:hover::before {
  transform: scaleX(1);
}

.card__title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--color-primary);
}

.card__description {
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.card__link {
  color: var(--color-accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  transition: gap var(--transition-fast);
}

.card__link:hover {
  gap: var(--space-sm);
}

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
}

.hero__content {
  position: relative;
  z-index: 2;
}

.hero__title {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-lg);
  animation: fadeInUp 0.8s ease-out;
}

.hero__subtitle {
  font-size: var(--text-xl);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2xl);
  max-width: 600px;
  animation: fadeInUp 0.8s ease-out 0.1s both;
}

.hero__image {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: var(--shadow-2xl);
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Social Links */
.social-links {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-surface-alt);
  color: var(--color-text);
  transition: all var(--transition-base);
}

.social-links a:hover {
  background: var(--color-accent);
  color: white;
  transform: translateY(-2px);
}

/* Blog List */
.blog-list {
  list-style: none;
}

.blog-item {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--color-border);
}

.blog-item:last-child {
  border-bottom: none;
}

.blog-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.blog-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.blog-excerpt {
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Footer */
.footer {
  background: var(--color-surface-alt);
  padding: var(--space-3xl) 0 var(--space-xl);
  margin-top: var(--space-5xl);
  border-top: 1px solid var(--color-border);
}

.footer__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xl);
}

.footer__nav {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.footer__nav a {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.footer__nav a:hover {
  color: var(--color-accent);
}

/* ========================================
   5. Animations
   ======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========================================
   6. Accessibility
   ======================================== */
.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;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: white;
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  z-index: 9999;
}

.skip-link:focus {
  top: 0;
}