:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #18181b;
  --text-muted: #52525b;
  --border: #e4e4e7;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --badge-bg: #eff6ff;
  --badge-text: #1d4ed8;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #181b21;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --border: #27272a;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --badge-bg: #1e293b;
  --badge-text: #93c5fd;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s;
}

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

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.icon-btn:hover {
  border-color: var(--text-muted);
}

/* Sections */
section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: none;
}

h1 {
  font-size: 2.5rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

/* Hero */
.eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.bio-text {
  max-width: 620px;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
}

.btn.primary:hover {
  background: var(--accent-hover);
}

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn.secondary:hover {
  border-color: var(--text-muted);
}

/* Skills */
.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tag-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Projects */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  margin-bottom: 0;
}

.filter-group {
  display: flex;
  gap: 0.4rem;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.15rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card.hidden {
  display: none;
}

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

.badge {
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.card-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
}

.card-link:hover {
  color: var(--accent);
}

.card h3 {
  font-size: 1.1rem;
}

.card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  flex-grow: 1;
}

.card-tech {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Contact */
.contact-section p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.contact-box {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.contact-box code {
  font-size: 0.95rem;
}

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

.social-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

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

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  h1 {
    font-size: 2rem;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
}
