:root {
  --ink: #23313d;
  --muted: #6d7b88;
  --blue: #346c98;
  --blue-soft: #eaf3f9;
  --line: #e1e7eb;
  --green: #28846d;
  --green-soft: #dfefe9;
  --amber: #a06c24;
  --amber-soft: #faedda;
  --red: #a13732;
  --red-soft: #f9e6e5;
  --paper: #ffffff;
  --wash: #f5f7f8;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header-inner {
  max-width: 1160px;
  margin: 0 auto;
  height: 66px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 2.1px;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none !important;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
}
.site-nav a {
  color: var(--muted);
  font-weight: 500;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--ink);
  text-decoration: none;
}
.site-nav a.nav-pill {
  border: 1px solid #d4dfe5;
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 12.5px;
  color: var(--ink);
}
.site-nav a.nav-pill:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* Main container */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
}
.narrow {
  max-width: 820px;
  margin: 0 auto;
}

/* Typography */
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 600;
}
h1, h2 {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
}
h1 em, h2 em {
  color: var(--blue);
  font-style: normal;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #d4dfe5;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
  text-decoration: none !important;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.btn-primary:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* Home hero */
.home-hero {
  padding: 84px 0 64px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.home-hero h1 {
  font-size: clamp(38px, 5.5vw, 62px);
  max-width: 820px;
  margin: 0 auto 20px;
}
.home-hero .deck {
  font-size: 19px;
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto 30px;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Section header */
.section-block {
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}
.section-block:last-of-type { border-bottom: 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.section-head h2 { font-size: 32px; }

/* Pillar cards */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.pillar-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--wash);
}
.pillar-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 650;
}
.pillar-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Blog header & filters */
.blog-hero-header {
  padding: 58px 0 36px;
  border-bottom: 1px solid var(--line);
}
.blog-hero-header h1 {
  font-size: clamp(34px, 4.5vw, 52px);
  margin-bottom: 12px;
}
.blog-hero-header .deck {
  font-size: 17px;
  color: var(--muted);
  max-width: 680px;
  margin: 0;
}
.blog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.tag-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper);
  text-decoration: none !important;
}
.tag-chip:hover { border-color: var(--blue); color: var(--blue); }
.tag-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.search-form {
  display: flex;
  gap: 6px;
}
.search-form input {
  border: 1px solid #d4dfe5;
  border-radius: 6px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13.5px;
  width: 220px;
  color: var(--ink);
}
.search-form input:focus {
  outline: 2px solid var(--blue-soft);
  border-color: var(--blue);
}

/* Featured post card */
.featured-post {
  margin: 34px 0 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: var(--wash);
}
.featured-media {
  position: relative;
  min-height: 300px;
  background: #10262e;
  overflow: hidden;
}
.featured-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.featured-body {
  padding: 34px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--paper);
}
.featured-body h2 {
  font-size: 32px;
  margin: 10px 0 12px;
}
.featured-body h2 a { color: var(--ink); }
.featured-body h2 a:hover { color: var(--blue); text-decoration: none; }
.featured-body .summary {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 20px;
}
.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--muted);
}
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--wash);
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge-interactive { background: var(--blue-soft); color: var(--blue); border-color: #c5ddec; }
.badge-featured { background: var(--green-soft); color: var(--green); border-color: #baded2; }
.badge-draft { background: var(--amber-soft); color: var(--amber); border-color: #e6cca0; }

/* Post grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 28px 0 56px;
}
.post-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  transition: border-color 0.15s, transform 0.15s;
}
.post-card:hover {
  border-color: #b7ccd8;
  transform: translateY(-2px);
}
.post-card-cover {
  height: 185px;
  background: #10262e;
  overflow: hidden;
}
.post-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-card-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.post-card-body h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 23px;
  line-height: 1.22;
  margin: 10px 0 8px;
}
.post-card-body h3 a { color: var(--ink); }
.post-card-body h3 a:hover { color: var(--blue); text-decoration: none; }
.post-card-body .summary {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px;
  flex: 1;
}
.post-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.post-tag {
  font-size: 11px;
  color: var(--muted);
  background: var(--wash);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Article prose page */
.article-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 46px 0 72px;
}
.article-header {
  padding-bottom: 28px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--line);
}
.article-header h1 {
  font-size: clamp(32px, 4.4vw, 48px);
  margin: 12px 0 14px;
}
.article-header .subtitle {
  font-size: 19px;
  color: var(--muted);
  margin: 0 0 20px;
}
.article-cover {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 32px;
  border: 1px solid var(--line);
}
.prose h2 {
  font-size: 30px;
  margin: 40px 0 16px;
}
.prose h3 {
  font-size: 20px;
  font-weight: 650;
  margin: 28px 0 12px;
}
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 24px; }
.prose li { margin: 6px 0; }
.prose blockquote {
  margin: 22px 0;
  padding: 14px 20px;
  border-left: 3px solid var(--blue);
  background: var(--wash);
  color: var(--ink);
}
.prose pre {
  background: #1b2630;
  color: #edf2f6;
  padding: 16px 20px;
  border-radius: 7px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
  margin: 22px 0;
}
.prose :not(pre) > code {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.88em;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
.prose th, .prose td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}
.prose th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  background: var(--wash);
}
.prose img { max-width: 100%; height: auto; border-radius: 6px; }

/* API docs */
.endpoint-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 22px 0;
  overflow: hidden;
}
.endpoint-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--wash);
  border-bottom: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13.5px;
}
.method {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  color: #fff;
}
.method-post { background: var(--green); }
.method-get { background: var(--blue); }
.method-patch { background: var(--amber); }
.method-delete { background: var(--red); }
.endpoint-body { padding: 16px 18px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 56px;
  padding: 28px 0 42px;
  font-size: 13px;
  color: var(--muted);
}
.site-footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

.empty-state {
  text-align: center;
  padding: 64px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  margin: 28px 0;
}

@media (max-width: 860px) {
  .featured-post { grid-template-columns: 1fr; }
  .featured-media { min-height: 220px; }
  .featured-body { padding: 24px; }
  .pillars { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .site-header-inner, .container, .site-footer-inner { padding-inline: 18px; }
  .site-nav { gap: 14px; font-size: 13px; }
  .search-form input { width: 165px; }
}
