:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: #f0f4f9;
  --text: #172033;
  --muted: #667085;
  --border: #dfe5ee;
  --accent: #1769e0;
  --accent-strong: #0d4fb3;
  --code-bg: #111827;
  --code-text: #e5edf8;
  --shadow: 0 12px 34px rgba(23, 32, 51, 0.07);
  --radius: 14px;
  --content: 760px;
  --wide: 1180px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  z-index: 9999;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
}

.site-header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  min-width: 0;
}

.site-title {
  margin: 0;
  font-size: 1.24rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.site-title a {
  color: var(--text);
  text-decoration: none;
}

.site-tagline {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.site-nav a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: #344054;
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--surface-soft);
  color: var(--accent-strong);
}

.home-intro {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 68px 24px 36px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-intro h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.3rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.home-intro p:last-child {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 42px;
  align-items: start;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.page-shell.single-layout {
  grid-template-columns: minmax(0, var(--content)) 300px;
  justify-content: center;
}

.main-content {
  min-width: 0;
}

.section-heading {
  margin: 0 0 18px;
  font-size: 1.45rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.section-intro {
  margin: -9px 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.post-list {
  display: grid;
  gap: 18px;
}

.post-card,
.article,
.archive-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.post-card {
  position: relative;
  padding: 28px;
}

.post-card .eyebrow {
  margin-bottom: 5px;
}

.post-card h2,
.post-card h3 {
  margin: 9px 0 10px;
  font-size: 1.52rem;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.post-card h2 a,
.post-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.post-card h2 a:hover,
.post-card h3 a:hover {
  color: var(--accent);
}

.post-card p:last-child {
  margin-bottom: 0;
  color: #475467;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.meta a {
  text-decoration: none;
}

.meta-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.sidebar {
  display: grid;
  gap: 18px;
}

.sidebar-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.sidebar-card h2 {
  margin: 0 0 12px;
  font-size: 0.96rem;
  letter-spacing: -0.01em;
}

.sidebar-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-card li {
  color: var(--muted);
  font-size: 0.91rem;
}

.sidebar-card li a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #344054;
  text-decoration: none;
}

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

.count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tag-cloud,
.taxonomy-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.tag-cloud a,
.taxonomy-links a {
  display: inline-block;
  padding: 4px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--accent-strong);
  font-size: 0.78rem;
  line-height: 1.3;
  text-decoration: none;
}

.tag-cloud a:hover,
.taxonomy-links a:hover {
  border-color: #93b4e8;
  background: #eef5ff;
  color: var(--accent);
}

.article {
  padding: clamp(28px, 5vw, 56px);
}

.article-header {
  margin-bottom: 34px;
}

.article-title {
  margin: 8px 0 14px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.article-description {
  margin: 16px 0 0;
  color: #475467;
  font-size: 1.03rem;
}

.featured-image {
  margin: 0 0 34px;
}

.featured-image img {
  display: block;
  width: 100%;
  border-radius: 10px;
}

.featured-image figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.taxonomy-links {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.article-body {
  font-size: 1.03rem;
}

.article-body > :first-child {
  margin-top: 0;
}

.article-body > :last-child {
  margin-bottom: 0;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  line-height: 1.25;
  letter-spacing: -0.025em;
  scroll-margin-top: 24px;
}

.article-body h2 {
  margin-top: 2.1em;
  font-size: 1.65rem;
}

.article-body h3 {
  margin-top: 1.8em;
  font-size: 1.3rem;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote {
  margin: 1.1em 0;
}

.article-body blockquote {
  margin-left: 0;
  padding: 14px 20px;
  border-left: 4px solid #b6cdf4;
  background: #f7faff;
  color: #344054;
}

.article-body code {
  padding: 0.1em 0.35em;
  border: 1px solid #dde3eb;
  border-radius: 5px;
  background: #eef2f7;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.article-body pre {
  overflow-x: auto;
  padding: 20px;
  border: 1px solid #263244;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-text);
  line-height: 1.55;
}

.article-body pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
}

.article-body th,
.article-body td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.article-body th {
  background: var(--surface-soft);
}

.archive-panel {
  padding: 28px;
}

.archive-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-list li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.archive-list li:last-child {
  border-bottom: 0;
}

.archive-list time {
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.archive-entry {
  min-width: 0;
}

.archive-list .archive-title {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.archive-list .archive-title:hover {
  color: var(--accent);
}

.archive-updated {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.archive-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 9px;
  margin-top: 4px;
}

.archive-tags a {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 650;
  text-decoration: none;
}

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

.term-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.term-grid a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: #344054;
  font-weight: 700;
  text-decoration: none;
}

.empty-state {
  padding: 32px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 28px 24px;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  color: #475467;
  text-decoration: none;
}

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

@media (max-width: 900px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .page-shell {
    grid-template-columns: 1fr;
  }

  .page-shell.single-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .header-inner,
  .home-intro,
  .page-shell {
    padding-left: 18px;
    padding-right: 18px;
  }

  .home-intro {
    padding-top: 44px;
  }

  .post-card,
  .archive-panel {
    padding: 22px;
  }

  .article {
    border-radius: 10px;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .archive-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
