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

:root {
  --bg: #ffffff;
  --fg: #111827;
  --muted: #6b7280;
  --subtle: #374151;
  --border: #e5e7eb;
  --surface: #f9fafb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --max-w: 740px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  font-size: 1rem;
}

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

/* ── Layout ─────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-logo {
  font-weight: 600;
  font-size: 1rem;
  color: var(--fg);
}
.nav-logo:hover { text-decoration: none; }

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav ul a {
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.15s;
}
nav ul a:hover,
nav ul a.active {
  color: var(--fg);
  text-decoration: none;
}

/* ── Main ───────────────────────────────────────────── */
main {
  padding: 3.5rem 0 5rem;
}

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

/* ── Home / Hero ────────────────────────────────────── */
.hero {
  padding: 4rem 0 2rem;
}
.hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.hero .tagline {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.hero .bio {
  font-size: 1.05rem;
  color: var(--subtle);
  max-width: 520px;
  margin-bottom: 2rem;
}
.hero-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-outline {
  border: 1px solid var(--border);
  color: var(--fg);
  background: transparent;
}
.btn-outline:hover { background: var(--surface); text-decoration: none; }

/* ── Page headings ───────────────────────────────────── */
.page-heading {
  margin-bottom: 2.5rem;
}
.page-heading h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
}
.page-heading p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ── Portfolio ───────────────────────────────────────── */
.projects-grid {
  display: grid;
  gap: 1.25rem;
}
.project-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: block;
  color: inherit;
}
.project-card:hover {
  border-color: #9ca3af;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  text-decoration: none;
}
.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.project-card h3 {
  font-size: 1rem;
  font-weight: 600;
}
.project-card .arrow {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}
.project-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--subtle);
}

/* ── Blog ────────────────────────────────────────────── */
.post-list {
  display: grid;
  gap: 0;
}
.post-item {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}
.post-item:first-child { border-top: 1px solid var(--border); }
.post-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.post-item h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.post-item h2 a {
  color: var(--fg);
}
.post-item h2 a:hover {
  color: var(--accent);
  text-decoration: none;
}
.post-excerpt {
  color: var(--subtle);
  font-size: 0.92rem;
}
.empty-state {
  padding: 4rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ── Resume ──────────────────────────────────────────── */
.resume-header {
  margin-bottom: 3rem;
}
.resume-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}
.resume-header .resume-title {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 1rem;
}
.resume-header .contact-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
}
.resume-header .contact-links a { color: var(--muted); }
.resume-header .contact-links a:hover { color: var(--fg); text-decoration: none; }

.resume-section {
  margin-bottom: 2.75rem;
}
.resume-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.resume-item {
  margin-bottom: 1.75rem;
}
.resume-item:last-child { margin-bottom: 0; }
.resume-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.2rem;
}
.resume-item-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}
.resume-item .period {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.resume-item .org {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.resume-item ul {
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--subtle);
}
.resume-item ul li { margin-bottom: 0.2rem; }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.skill-group h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.skill-group p {
  font-size: 0.875rem;
  color: var(--subtle);
}
.resume-actions {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.75rem; }
  nav ul { gap: 1.25rem; }
  .resume-item-header { flex-direction: column; gap: 0.1rem; }
  .resume-item .period { align-self: flex-start; }
}
