:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --bar-bg: #f0f7ff;
  --text: #1a1a1a;
  --muted: #5f6368;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
  --radius: 12px;
  --max-width: 960px;
  --max-width-wide: 75rem;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

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

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

.container {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bar-bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

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

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

.site-nav {
  display: flex;
  gap: 1.25rem;
}

.site-nav a {
  color: var(--muted);
  font-weight: 500;
}

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

main.container {
  flex: 1;
  padding: 2.5rem 0 4rem;
}

body.layout-wide .container {
  width: min(calc(100% - 2rem), var(--max-width-wide));
}

.hero {
  padding: 1rem 0 2.5rem;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.hero h1,
.page-header h1,
.project-header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
}

.lead {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 42rem;
}

.hero-links,
.footer-links,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.section {
  margin-top: 1rem;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2,
.page-header h1 {
  margin: 0;
}

.text-link {
  font-weight: 500;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}

.card p {
  margin: 0 0 1rem;
  color: var(--muted);
}

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

.tag-list li {
  font-size: 0.8125rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
}

.card-actions a {
  font-weight: 500;
}

.project-page {
  max-width: none;
}

.project-page .lead {
  max-width: none;
}

.project-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.button-link {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff !important;
  font-weight: 600;
  text-decoration: none;
}

.button-link:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.markdown-body h2,
.markdown-body h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol {
  margin: 0 0 1rem;
}

.markdown-body pre {
  overflow-x: auto;
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.markdown-body pre.mermaid {
  background: transparent;
  border: none;
  padding: 0;
}

.markdown-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.markdown-body th {
  background: var(--bg);
  font-weight: 600;
}

.markdown-body tbody tr:nth-child(even) {
  background: rgba(240, 247, 255, 0.35);
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bar-bg);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.resource-section {
  margin-bottom: 2rem;
}

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

.resource-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.resource-item {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.resource-item:last-child {
  border-bottom: none;
}

.resource-item a {
  font-weight: 600;
}

.resource-item p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .header-inner,
  .footer-inner,
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }
}
