:root {
  --primary: #0f172a;
  --secondary: #334155;
  --accent: #3b82f6;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --header-bg: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] {
  --primary: #f8fafc;
  --secondary: #cbd5e1;
  --accent: #60a5fa;
  --bg: #0f172a;
  --card-bg: #1e293b;
  --border: #334155;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --header-bg: rgba(15, 23, 42, 0.8);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background: var(--bg);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

header {
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo { font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }

nav { display: flex; align-items: center; }

nav a {
  margin-right: 1.5rem;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
}

#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-main);
  display: flex;
  align-items: center;
}

.hidden { display: none; }

.container { max-width: 1040px; margin: 0 auto; padding: 4rem 1.5rem; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 3rem; margin-bottom: 4rem; }
.hero-title { font-size: 3.5rem; font-weight: 800; color: var(--primary); letter-spacing: -0.04em; line-height: 1.1; }
.hero-subtitle { margin-top: 1.5rem; color: var(--secondary); max-width: 600px; }

.btn {
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  margin-top: 1.5rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
}

.btn-primary { background: var(--accent); color: white; margin-right: 0; }
.btn-primary:hover { opacity: 0.9; }
.btn-outline { border: 1px solid var(--border); color: var(--text-main); background: transparent; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.hero-actions .btn { margin-top: 0; }

.social-links { display: flex; gap: 0.5rem; }

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.social-btn:hover { border-color: var(--accent); color: var(--accent); }

.hero-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.hero-card h2 { font-size: 0.75rem; color: var(--accent); text-transform: uppercase; margin-bottom: 1rem; letter-spacing: 0.05em; }
.hero-card ul { list-style: none; }
.hero-card li { padding: 0.75rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; color: var(--text-main); }
.hero-card li:last-child { border-bottom: none; padding-bottom: 0; }

/* General Sections */
.grid-content { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; padding: 4rem 0; border-top: 1px solid var(--border); }
section h2 { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 1.5rem; }

.list-item-title { font-weight: 700; display: block; color: var(--primary); margin-top: 1rem; }
.list-item-sub { font-size: 0.9rem; color: var(--text-muted); display: block; }
.list-item-gap { margin-bottom: 1.5rem; }
.project-link { margin-top: 0.75rem; }

/* Lists */
.cert-list, .pub-list { list-style: none; padding-left: 0; }
.cert-list li { 
  background: var(--bg); 
  border: 1px solid var(--border); 
  padding: 0.5rem 1rem; 
  border-radius: 6px; 
  margin-bottom: 0.5rem; 
  font-size: 0.85rem; 
  font-weight: 500;
  display: inline-block;
  margin-right: 0.5rem;
}
.pub-list li { margin-bottom: 1rem; font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }
.pub-list strong { color: var(--text-main); }

/* Pills */
.pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.pill { background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.8rem; }

footer { text-align: center; padding: 4rem; color: var(--text-muted); font-size: 0.8rem; border-top: 1px solid var(--border); }

@media (max-width: 768px) {
  .hero, .grid-content { grid-template-columns: 1fr; gap: 2rem; }
  .hero-title { font-size: 2.5rem; }
}

/* --- Force Light Mode for Printing --- */
@media print {
  [data-theme="dark"] {
    --primary: #0f172a !important;
    --secondary: #334155 !important;
    --accent: #3b82f6 !important;
    --bg: #f8fafc !important;
    --card-bg: #ffffff !important;
    --border: #e2e8f0 !important;
    --text-main: #1e293b !important;
    --text-muted: #64748b !important;
    --header-bg: rgba(255, 255, 255, 1) !important;
  }

  #theme-toggle {
    display: none !important;
  }
  
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}