:root {
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-accent: #bae6fd;
  
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #f0f9ff;
  --primary-border: #bae6fd;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-subtle);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px;
}

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

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

.nav-brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand:hover {
  color: var(--primary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: var(--radius);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.nav-link.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
}

/* Reusable Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--primary);
}

.btn-primary {
  background: #0f172a;
  color: #ffffff;
}

.btn-primary:hover {
  background: #1e293b;
}

/* Breadcrumbs */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Hero Section */
.hero-section {
  padding: 32px 0 28px;
  margin-bottom: 24px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 820px;
  line-height: 1.6;
}

/* Interactive Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 28px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: fit-content;
}

.filter-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.filter-btn.active {
  background: var(--text);
  color: #ffffff;
}

/* KPI Stat Cards (Bento Metric Top-Strip) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 20px 0 28px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--primary);
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 4px;
}

/* Visual Architecture Flowchart */
.arch-flow {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 20px 0 28px;
  box-shadow: var(--shadow-sm);
}

.arch-flow-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.flow-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.flow-node {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.flow-node i {
  color: var(--primary);
}

.flow-arrow {
  color: var(--border-strong);
  font-size: 0.85rem;
}

/* Project Cards Grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 20px;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-hover);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 10px;
}

.project-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.project-card-title:hover {
  color: var(--primary);
}

.type-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.role-pill {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}

/* Impact Highlights List (Scannable 3-Point bullets) */
.impact-list {
  list-style: none;
  margin: 14px 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.impact-list li {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.impact-list li strong {
  color: var(--text);
}

.impact-icon {
  color: var(--primary);
  margin-top: 3px;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.card-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Detail Pages Components */
.page-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}

.page-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.info-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 12px 18px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 18px 0 20px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.info-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.info-item i {
  color: var(--text-subtle);
}

.info-strip-action {
  margin-left: auto;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 36px 0 16px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contrib-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contrib-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.contrib-heading {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contrib-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 10px;
}

.spec-bullets {
  list-style-type: disc;
  padding-left: 20px;
  margin-top: 6px;
}

.spec-bullets li {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 6px;
}

/* Code Snippet Box */
.code-preview {
  background: #0f172a;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 14px 0;
  overflow-x: auto;
}

.code-preview code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #e2e8f0;
  line-height: 1.6;
}

.code-preview .keyword { color: #f472b6; }
.code-preview .func { color: #60a5fa; }
.code-preview .string { color: #34d399; }
.code-preview .comment { color: #64748b; }

/* Tech Tags */
.tech-stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tech-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 2px 7px;
  border-radius: 4px;
}

/* Category Overview Card */
.category-overview-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.category-overview-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--text-subtle);
  font-size: 0.85rem;
  background: #ffffff;
  margin-top: 60px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

@media (max-width: 768px) {
  .nav-inner {
    flex-direction: column;
    height: auto;
    padding: 12px 0;
    gap: 10px;
  }
  .hero-title {
    font-size: 1.7rem;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .info-strip-action {
    margin-left: 0;
    width: 100%;
  }
  .flow-steps {
    flex-direction: column;
    align-items: flex-start;
  }
  .flow-arrow {
    transform: rotate(90deg);
    margin-left: 10px;
  }
}
