:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --text: #1f2328;
  --text-muted: #57606a;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-soft: #eef2ff;
  --border: #d0d7de;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(31, 35, 40, 0.08);
  --shadow-hover: 0 8px 24px rgba(31, 35, 40, 0.12);
  --max-width: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

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

.container.narrow {
  max-width: 760px;
}

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

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  line-height: 1.25;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
}

.nav-github {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.8rem;
  color: var(--text) !important;
}

.nav-github:hover {
  border-color: var(--accent);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--accent-soft) 0%, #ffffff 60%, #ecfeff 100%);
  border-bottom: 1px solid var(--border);
  padding: 5.5rem 0 4.5rem;
}

.hero-eyebrow {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  margin: 0 0 0.5rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin: 0 0 1rem;
}

.hero-lede {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 0 2rem;
}

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

.btn {
  display: inline-block;
  padding: 0.65rem 1.3rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.btn:hover {
  text-decoration: none;
}

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

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

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

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

/* Sections */
.section {
  padding: 4rem 1.5rem;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2 {
  font-size: 2rem;
  margin: 0 0 0.75rem;
}

.section-intro {
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 0 2rem;
}

.subsection-title {
  font-size: 1.15rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 2.5rem 0 1.25rem;
}

/* Project cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.15rem;
}

.card-title a {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
}

.card-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.card-stars {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.card-desc {
  color: var(--text-muted);
  margin: 0;
  flex-grow: 1;
  font-size: 0.95rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tag-list li {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.4rem;
  font-size: 0.9rem;
}

/* Blog posts */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.post-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.post-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-item h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.post-item h3 a {
  color: var(--text);
}

.post-item h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-summary {
  color: var(--text-muted);
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
}

/* About */
.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.skill-list li {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Contact */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

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

.site-footer p {
  margin: 0;
}

@media (max-width: 640px) {
  .hero {
    padding: 3.5rem 0 3rem;
  }

  .nav-links {
    gap: 0.9rem;
  }

  .nav-links a {
    font-size: 0.88rem;
  }

  .section {
    padding: 3rem 1.5rem;
  }
}
