:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #172033;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --code-bg: #f1f5f9;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, #eff6ff 0, transparent 32rem), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

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

a:hover {
  text-decoration: underline;
}

.site-header,
.site-footer,
.page-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
}

.brand {
  color: var(--text);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.site-nav a {
  color: var(--muted);
  font-size: 14px;
}

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

.page-shell {
  min-height: calc(100vh - 176px);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.page-shell--post {
  width: min(1180px, calc(100% - 32px));
}

.post-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.post-toc {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.78);
}

.post-toc[hidden] {
  display: none;
}

.post-toc-title {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.post-toc-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-toc-item a {
  display: block;
  padding: 5px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.post-toc-item a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-toc-item--h3 {
  padding-left: 14px;
}

.hero-card {
  margin: 28px 0 36px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.hero-card h2 {
  margin: 4px 0 8px;
  font-size: clamp(26px, 5vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.hero-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.03em;
}

h1 {
  margin-top: 0;
  font-size: clamp(32px, 6vw, 56px);
}

h2 {
  margin-top: 36px;
  font-size: 26px;
}

.article h2,
.article h3 {
  scroll-margin-top: 24px;
}

p,
li {
  color: #334155;
}

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

.article-header {
  margin-bottom: 34px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.article-header h1 {
  margin: 8px 0 10px;
}

time,
.description {
  color: var(--muted);
}

.list-item {
  display: grid;
  gap: 4px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.list-item a {
  color: var(--text);
  font-size: 19px;
  font-weight: 720;
}

.list-item p {
  margin: 0;
  color: var(--muted);
}

code {
  padding: 0.15em 0.35em;
  border-radius: 6px;
  background: var(--code-bg);
  color: #0f172a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

pre {
  overflow-x: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--code-bg);
}

pre code {
  padding: 0;
  background: transparent;
}

blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 18px;
  border-left: 4px solid var(--accent-soft);
  color: var(--muted);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}

.article img {
  display: block;
  width: auto;
  max-width: min(100%, 720px);
  max-height: 520px;
  margin: 24px auto;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 34px;
  color: var(--muted);
  font-size: 14px;
}

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

  .page-shell {
    width: min(100% - 20px, 920px);
    padding: 24px 18px;
    border-radius: 20px;
  }

  .post-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .post-toc {
    position: static;
    max-height: none;
  }
}
