/* ================================================
   PORTFOLIO & CHEATSHEETS - Modern Design
   ================================================ */

:root {
  /* Colors - Light Mode */
  --bg-primary: #0a0a0b;
  --bg-secondary: #111113;
  --bg-card: #18181b;
  --bg-card-hover: #1f1f23;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --gradient-1: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --gradient-2: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  /* Code */
  --code-bg: #1e1e2e;
  --code-text: #cdd6f4;

  /* Spacing & Sizing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --maxw: 1200px;
  --maxw-content: 900px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px var(--accent-glow);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================================================
   LAYOUT
   ================================================ */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px;
}

.container-narrow {
  max-width: var(--maxw-content);
}

/* ================================================
   HEADER / NAVBAR
   ================================================ */
header.site {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
}

.logo-text {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.logo-text span {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

header nav {
  display: flex;
  gap: 8px;
}

header nav a {
  padding: 8px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

header nav a:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

header nav a.active {
  color: var(--accent);
  background: var(--accent-glow);
}

/* Legacy header support */
.title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.title small {
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 8px;
  font-size: 0.85rem;
}

/* ================================================
   HERO SECTION
   ================================================ */
.hero {
  position: relative;
  padding: 80px 24px 100px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.03em;
}

.hero h1 .gradient {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin: 0 0 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ================================================
   BUTTONS
   ================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 60px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-hover);
}

.btn-outline:hover {
  background: var(--bg-card);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.nav-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 24px;
  max-width: var(--maxw);
  margin: 24px auto 0;
}

/* ================================================
   SECTION TITLES
   ================================================ */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin: 0;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
  margin: 0 0 16px;
}

/* ================================================
   CARDS GRID
   ================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card:hover::before {
  opacity: 1;
}

.card .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
  font-weight: 500;
}

.card .tag img {
  height: 16px;
  width: auto;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.5rem;
}

/* ================================================
   SKILLS / STATS SECTION
   ================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px;
  margin: 48px 0;
}

.stat-item {
  text-align: center;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.skill-tag:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.skill-tag img {
  height: 20px;
  width: auto;
}

/* ================================================
   CODE BLOCKS
   ================================================ */
code, pre, tt {
  font-family: var(--font-mono);
}

code {
  background: var(--bg-card);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  border: 1px solid var(--border);
}

pre {
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  overflow-x: auto;
  position: relative;
  margin: 16px 0;
}

pre > code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.copy-btn.copied {
  color: #22c55e;
  border-color: #22c55e;
}

/* ================================================
   TABLES
   ================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

thead th {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-primary);
}

tbody tr:hover {
  background: var(--bg-card-hover);
}

/* ================================================
   LISTS
   ================================================ */
ul, ol {
  padding-left: 24px;
  margin: 16px 0;
}

li {
  margin: 8px 0;
  color: var(--text-secondary);
}

li code {
  color: var(--accent);
}

/* ================================================
   FOOTER
   ================================================ */
footer.site {
  text-align: center;
  padding: 48px 24px;
  border-top: 1px solid var(--border);
  margin-top: 80px;
  color: var(--text-muted);
}

footer.site a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

.footer-links a {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================================================
   UTILITIES
   ================================================ */
.text-center { text-align: center; }
.text-gradient {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mt-8 { margin-top: 32px; }
.mb-8 { margin-bottom: 32px; }

/* ================================================
   TIP & WARNING BOXES
   ================================================ */
.tip {
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.warning {
  background: rgba(245, 158, 11, 0.1);
  border-left: 4px solid #f59e0b;
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.tip strong, .warning strong {
  color: var(--text-primary);
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  .hero {
    padding: 60px 20px 80px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero .subtitle {
    font-size: 1rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  header .inner {
    padding: 12px 16px;
  }

  header nav {
    display: none;
  }

  .container {
    padding: 16px;
  }

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

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 20px;
  }
}

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

.animate-in {
  animation: fadeInUp 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ================================================
   CHEATSHEET SPECIFIC STYLES
   ================================================ */
.section-icon {
  margin-right: 8px;
}

/* Syntax highlighting for code blocks */
.keyword { color: #569cd6; font-weight: 600; }
.comment { color: #6a9955; font-style: italic; }
.string { color: #ce9178; }
.function { color: #dcdcaa; }
.number { color: #b5cea8; }
