:root {
  /* Dark mode (default) */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-elevated: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-glow: #818cf8;
  --glass-bg: rgba(17, 24, 39, 0.7);
  --glass-border: rgba(99, 102, 241, 0.15);
  
  --max-width: 1024px;
  --radius: 12px;
  --radius-lg: 16px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-elevated: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --accent-primary: #4f46e5;
  --accent-secondary: #7c3aed;
  --accent-glow: #6366f1;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(79, 70, 229, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background-color 0.3s, color 0.3s;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent-secondary); }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1rem 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.branding { display: flex; align-items: center; gap: 1rem; }
.logo-img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 10px rgba(99,102,241,0.5); }
.logo-text { font-weight: 700; font-size: 1.25rem; color: var(--text-primary); }

.site-nav { display: flex; gap: 1.5rem; align-items: center; }
.site-nav a {
  color: var(--text-secondary);
  font-weight: 500;
  position: relative;
}
.site-nav a:hover, .site-nav a.active { color: var(--text-primary); }
.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.3s;
}
.site-nav a:hover::after, .site-nav a.active::after { width: 100%; }

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.5rem;
}
.theme-toggle:hover { color: var(--accent-primary); }

/* Main */
.site-main { padding: 4rem 0; min-height: 80vh; }

/* Hero */
.hero {
  position: relative;
  padding: 4rem 2rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
  border: 1px solid var(--glass-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 4rem;
  animation: fadeIn 1s ease-out;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 40%);
  opacity: 0.05;
  animation: rotate 20s linear infinite;
}
.hero-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 4px solid var(--bg-primary);
  box-shadow: 0 0 20px var(--accent-glow);
  margin-bottom: 1.5rem;
  z-index: 1;
}
.hero h1 { font-size: clamp(2.5rem, 6vw, 4rem); margin: 0 0 0.5rem 0; font-weight: 800; z-index: 1; }
.hero .subtitle { font-size: 1.25rem; color: var(--accent-primary); font-weight: 600; margin-bottom: 1rem; z-index: 1; height: 1.5em; }
.hero p.lead { font-size: 1.1rem; max-width: 800px; color: var(--text-secondary); z-index: 1; }

.impact-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 1;
}
.stat {
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
}
.stat-num { font-size: 1.5rem; font-weight: 700; color: var(--accent-secondary); }
.stat-label { font-size: 0.875rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}
.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.5);
}

/* Cards Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  border-color: var(--accent-primary);
}
.card-img { width: 100%; height: 180px; object-fit: cover; border-bottom: 1px solid var(--glass-border); }
.card-content { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.card-badge { align-self: flex-start; background: rgba(99,102,241,0.1); color: var(--accent-primary); padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; margin-bottom: 0.75rem; }
.card-title { font-size: 1.25rem; margin: 0 0 0.5rem 0; font-weight: 600; }
.card-title a { color: var(--text-primary); }
.card-title a:hover { color: var(--accent-primary); }
.card-desc { color: var(--text-secondary); font-size: 0.95rem; margin: 0; }

/* Feature Cards (What I Do) */
.feature-card { position: relative; }
.feature-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}
.feature-card:nth-child(2)::before {
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
}
.feature-card:nth-child(3)::before {
  background: linear-gradient(90deg, #ec4899, #f43f5e);
}
.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--accent-primary);
}
.feature-card:nth-child(1) .feature-icon { color: var(--accent-primary); }
.feature-card:nth-child(2) .feature-icon { color: #3b82f6; }
.feature-card:nth-child(3) .feature-icon { color: #ec4899; }


/* Filter Tabs */
.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  justify-content: center;
}
.filter-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* Resume Layout */
.resume-layout {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 3rem;
}
@media (max-width: 768px) { .resume-layout { grid-template-columns: 1fr; } }
.sidebar-section { margin-bottom: 2rem; }
.sidebar-title { font-size: 1.1rem; color: var(--text-primary); border-bottom: 1px solid var(--glass-border); padding-bottom: 0.5rem; margin-bottom: 1rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag { background: var(--bg-elevated); color: var(--text-secondary); padding: 0.25rem 0.75rem; border-radius: 4px; font-size: 0.85rem; border: 1px solid var(--glass-border); }
.timeline-item { position: relative; padding-left: 2rem; margin-bottom: 2rem; }
.timeline-item::before {
  content: ''; position: absolute; left: 0; top: 0.5rem; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent-primary);
}
.timeline-item::after {
  content: ''; position: absolute; left: 5px; top: 1.5rem; bottom: -1rem; width: 2px;
  background: var(--glass-border);
}
.timeline-item:last-child::after { display: none; }
.timeline-header { display: flex; justify-content: space-between; margin-bottom: 0.25rem; flex-wrap: wrap; }
.timeline-org { font-weight: 700; font-size: 1.1rem; }
.timeline-period { color: var(--text-secondary); font-size: 0.9rem; }
.timeline-role { color: var(--accent-secondary); font-weight: 600; margin-bottom: 0.5rem; }

/* Page Content */
.page-header { text-align: center; margin-bottom: 3rem; }
.page-header h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.accent-line { width: 60px; height: 4px; background: var(--accent-primary); margin: 0 auto; border-radius: 2px; }
.content-box {
  background: var(--bg-secondary);
  padding: 2.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
}
.content-box img { max-width: 100%; border-radius: var(--radius); }

/* Forms */
.form-group { margin-bottom: 1.5rem; }
label { display: block; margin-bottom: 0.5rem; color: var(--text-secondary); }
input, select, textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--glass-border);
  padding: 3rem 0;
  text-align: center;
  color: var(--text-secondary);
}
.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}
.social-links a { color: var(--text-secondary); font-size: 1.5rem; }
.social-links a:hover { color: var(--accent-primary); }

/* Utilities */
.hidden { display: none !important; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.animate-on-scroll { opacity: 0; transform: translateY(20px); transition: opacity 0.6s, transform 0.6s; }
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* Mobile Menu */
.menu-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; }
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%; left: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem;
  }
  .site-nav.active { display: flex; }
}
