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

/* ── Base ──────────────────────────────────────────────────────────── */
:root {
  --accent: #0066cc;
  --accent-hover: #0052a3;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1a202c;
  --muted: #64748b;
  --tag-bg: #e8f0fe;
  --tag-color: #1a56db;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 6px rgba(0,0,0,0.1), 0 8px 24px rgba(0,0,0,0.1);
}

html { font-size: 16px; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ── Header / Nav ──────────────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
}
.site-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-title:hover { color: var(--text); text-decoration: none; }

/* ── Main ──────────────────────────────────────────────────────────── */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
  flex: 1;
  width: 100%;
}

/* ── Hero ──────────────────────────────────────────────────────────── */
.hero { margin-bottom: 2rem; }
.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}
.hero-sub { color: var(--muted); font-size: 1.05rem; }

/* ── Project Grid ──────────────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ── Project Card ──────────────────────────────────────────────────── */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.project-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-img-wrap { aspect-ratio: 16/9; overflow: hidden; }
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}
.card-body h2 { font-size: 1.1rem; font-weight: 600; }
.card-body h2 a { color: var(--text); text-decoration: none; }
.card-body h2 a:hover { color: var(--accent); }
.card-desc { color: var(--muted); font-size: 0.92rem; line-height: 1.55; }

/* ── Tags ──────────────────────────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.4rem;
}
.tag {
  background: var(--tag-bg);
  color: var(--tag-color);
  border-radius: 4px;
  padding: 0.15rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 500;
}

/* ── Empty state ───────────────────────────────────────────────────── */
.empty-state { color: var(--muted); font-style: italic; }

/* ── Certifications ────────────────────────────────────────────────── */
.cert-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.cert-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.cert-group-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.cert-list { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.cert-item { display: flex; flex-direction: column; gap: 0.1rem; }
.cert-title { font-weight: 500; font-size: 0.95rem; }
.cert-issuer { color: var(--muted); font-size: 0.85rem; }

/* ── Project Detail ────────────────────────────────────────────────── */
.project-detail { max-width: 780px; }

.detail-header { margin-bottom: 2.5rem; }
.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.back-link:hover { color: var(--accent); }
.detail-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.detail-desc { color: var(--muted); font-size: 1.05rem; }

.detail-body { line-height: 1.75; }
.detail-body h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.detail-body p { color: var(--muted); margin-bottom: 1rem; }
.detail-body code {
  background: #f1f5f9;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.88em;
}

/* ── Footer ────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  main { padding: 1.5rem 1rem 3rem; }
  .hero h1 { font-size: 1.6rem; }
}
