:root {
  --blog-container: 1180px;
  --blog-surface: rgba(15, 23, 42, 0.72);
  --blog-surface-strong: rgba(15, 23, 42, 0.92);
  --blog-surface-soft: rgba(15, 23, 42, 0.58);
  --blog-border: rgba(148, 163, 184, 0.18);
  --blog-border-strong: rgba(96, 165, 250, 0.28);
  --blog-shadow: 0 24px 60px rgba(2, 6, 23, 0.32);
  --blog-shadow-soft: 0 18px 40px rgba(2, 6, 23, 0.2);
  --blog-text: var(--text-strong, #f8fafc);
  --blog-muted: var(--text-muted, #cbd5e1);
  --blog-soft: var(--text-soft, #94a3b8);
  --blog-accent: #60a5fa;
  --blog-accent-strong: #8b5cf6;
  --blog-accent-soft: rgba(59, 130, 246, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.blog-page {
  color: var(--blog-muted);
}

body.post-page {
  color: #d5ddeb;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.blog-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(59, 130, 246, 0.12), transparent 28%),
    radial-gradient(circle at 86% 10%, rgba(139, 92, 246, 0.14), transparent 24%);
}

.blog-shell main {
  position: relative;
  z-index: 1;
}

.blog-shell > .site-legal {
  margin-top: 32px;
}

.post-page .blog-shell {
  background:
    radial-gradient(circle at 50% -12%, rgba(96, 165, 250, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.98), rgba(7, 12, 24, 0.98));
}

.blog-container {
  width: min(var(--blog-container), calc(100% - 40px));
  margin: 0 auto;
}

.hero-grid {
  display: grid;
  gap: 24px;
}

.blog-hero {
  padding: 56px 0 32px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.92fr);
  align-items: stretch;
}

.hero-kicker,
.section-kicker,
.panel-label {
  margin: 0 0 14px;
  color: var(--blog-accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-copy h1,
.section-heading h2,
.article-header h1,
.post-card h3,
.hero-post h2 {
  margin: 0;
  color: var(--blog-text);
  font-family: var(--font-display, "Sora", sans-serif);
  letter-spacing: -0.04em;
}

.hero-copy h1 {
  max-width: 11ch;
  font-size: clamp(3rem, 7vw, 5.4rem);
  line-height: 0.94;
}

.hero-summary,
.hero-empty,
.section-summary,
.post-card p,
.article-deck,
.article-meta,
.footer-copy {
  color: var(--blog-muted);
}

.hero-summary {
  max-width: 62ch;
  margin: 22px 0 0;
  font-size: 1.06rem;
  line-height: 1.8;
}

.hero-rail,
.hero-post,
.post-card,
.article-card {
  border: 1px solid var(--blog-border);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.78)),
    linear-gradient(135deg, rgba(59, 130, 246, 0.08), transparent 34%);
  box-shadow: var(--blog-shadow);
  backdrop-filter: blur(18px);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.hero-stat {
  min-width: 180px;
  padding: 24px;
  border: 1px solid var(--blog-border);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.56);
}

.hero-stat strong {
  display: block;
  color: var(--blog-text);
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 1.2rem;
  line-height: 1.15;
}

.hero-stat span {
  display: block;
  margin-top: 6px;
  color: var(--blog-soft);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

.hero-rail {
  padding: 24px;
  border-radius: 28px;
}

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

.hero-post {
  border-radius: 22px;
  box-shadow: none;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.hero-post-link,
.archive-card-link,
.card-link,
.article-eyebrow a {
  color: inherit;
  text-decoration: none;
}

.hero-post-link {
  display: block;
  padding: 20px;
}

.hero-post-link p {
  margin: 0;
}

.hero-post-meta,
.post-card-meta,
.article-eyebrow,
.article-meta {
  color: var(--blog-soft);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

.hero-post h2 {
  margin: 10px 0 10px;
  font-size: 1.2rem;
  line-height: 1.2;
}

.hero-empty {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.7;
}

.post-section,
.related-section {
  padding: 18px 0 44px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 0.98;
}

.section-summary {
  max-width: 62ch;
  margin: 16px 0 0;
  font-size: 1rem;
  line-height: 1.75;
}

.archive-list {
  display: grid;
  gap: 20px;
}

.archive-card-link {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  min-height: 100%;
}

.archive-card-link.no-art {
  grid-template-columns: 1fr;
}

.post-card {
  border-radius: 26px;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.post-card:hover,
.post-card:focus-within,
.hero-post:hover,
.hero-post:focus-within {
  transform: translateY(-2px);
  border-color: var(--blog-border-strong);
  box-shadow: 0 28px 64px rgba(2, 6, 23, 0.38);
}

.post-card-art {
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.24), transparent 38%),
    linear-gradient(180deg, rgba(59, 130, 246, 0.18), rgba(15, 23, 42, 0.12));
}

.post-card-art img,
.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
}

.post-card-body h3 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.1;
}

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.post-card-excerpt {
  margin: 0;
}

.post-card-tags,
.tag-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.post-card-tags {
  margin-top: auto;
}

.post-card-tags span,
.tag-strip span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(96, 165, 250, 0.14);
  border-radius: 999px;
  background: var(--blog-accent-soft);
  color: #dbeafe;
  font-size: 0.84rem;
  font-weight: 600;
}

.post-card-featured .archive-card-link {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.post-card-featured .post-card-body {
  padding: 32px;
}

.post-card-featured .post-card-body h3 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card-link {
  display: block;
  height: 100%;
  padding: 24px;
}

.card-link h3 {
  margin: 12px 0 14px;
  font-size: 1.32rem;
  line-height: 1.2;
}

.post-page .article-shell {
  width: min(1100px, calc(100% - 40px));
  padding: 42px 0 72px;
}

.article-progress {
  position: sticky;
  top: 0;
  z-index: 6;
  height: 4px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.article-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #93c5fd, #c4b5fd);
  transform: scaleX(0);
  transform-origin: left center;
}

.article-card {
  border-radius: 34px;
  padding: clamp(22px, 4vw, 44px);
  background:
    linear-gradient(180deg, rgba(7, 12, 24, 0.98), rgba(9, 14, 27, 0.94)),
    radial-gradient(circle at top, rgba(96, 165, 250, 0.05), transparent 38%);
  border-color: rgba(148, 163, 184, 0.12);
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.28);
}

.article-header {
  display: grid;
  gap: 24px;
}

.article-header-copy {
  max-width: none;
}

.article-eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--blog-soft);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.article-header h1 {
  max-width: none;
  font-size: clamp(2.7rem, 5.2vw, 4.7rem);
  line-height: 0.98;
}

.article-deck {
  max-width: none;
  margin: 16px 0 0;
  color: #e7edf8;
  font-size: clamp(1.02rem, 1.7vw, 1.18rem);
  line-height: 1.74;
}

.article-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: none;
  margin: 22px 0 0;
}

.article-facts div {
  padding: 10px 12px 11px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 15px;
  background: rgba(15, 23, 42, 0.44);
}

.article-facts dt {
  margin: 0 0 4px;
  color: var(--blog-soft);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.article-facts dd {
  margin: 0;
  color: var(--blog-text);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.35;
}

.article-intro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.article-start-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(147, 197, 253, 0.28);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.22), rgba(37, 99, 235, 0.14));
  color: var(--blog-text);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.24);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.article-start-link:hover,
.article-start-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(147, 197, 253, 0.42);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.28), rgba(37, 99, 235, 0.18));
}

.article-section-count {
  margin: 0;
  color: var(--blog-soft);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.article-cover {
  max-width: 52rem;
  margin: 0 auto;
  border: 1px solid var(--blog-border);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--blog-shadow-soft);
}

.article-reading-lane {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 44px);
  align-items: start;
  margin: 34px 0 0;
  scroll-margin-top: 84px;
}

.article-outline {
  position: sticky;
  top: 72px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.48)),
    linear-gradient(135deg, rgba(59, 130, 246, 0.08), transparent 42%);
}

.article-outline-label {
  margin: 0 0 14px;
  color: var(--blog-accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.article-outline-link {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--blog-muted);
  font-size: 0.95rem;
  line-height: 1.45;
  text-decoration: none;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.article-outline-link:hover,
.article-outline-link:focus-visible {
  background: rgba(148, 163, 184, 0.08);
  color: var(--blog-text);
  transform: translateX(2px);
}

.article-outline-link.is-active {
  background: rgba(96, 165, 250, 0.14);
  color: var(--blog-text);
}

.article-prose {
  max-width: 44rem;
  color: #d7dfec;
  font-family: var(--font-body, "Inter", sans-serif);
  font-size: 1.08rem;
  line-height: 1.86;
}

.article-prose > :where(h2, h3, h4, p, ul, ol, blockquote, pre) {
  max-width: none;
}

.article-prose > p:first-child {
  color: #eff4ff;
  font-size: 1.16rem;
  line-height: 1.8;
}

.article-prose h2,
.article-prose h3 {
  color: var(--blog-text);
  font-family: var(--font-display, "Sora", sans-serif);
  line-height: 1.12;
  scroll-margin-top: 28px;
}

.article-prose h2 {
  margin: 56px 0 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  font-size: clamp(2rem, 4vw, 2.5rem);
}

.article-prose h3 {
  margin: 34px 0 14px;
  font-size: 1.52rem;
}

.article-prose p,
.article-prose ul,
.article-prose ol,
.article-prose blockquote,
.article-prose figure,
.article-prose pre {
  margin: 0 0 24px;
}

.article-prose ul,
.article-prose ol {
  padding-left: 1.35rem;
}

.article-prose li + li {
  margin-top: 12px;
}

.article-prose a {
  color: #dbe9ff;
  text-decoration-color: rgba(219, 233, 255, 0.36);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.article-prose strong {
  color: var(--blog-text);
}

.article-prose code {
  padding: 0.14em 0.4em;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(7, 12, 24, 0.92);
  color: #dce9ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.article-prose pre {
  padding: 18px 20px;
  border: 1px solid var(--blog-border);
  border-radius: 18px;
  background: rgba(7, 12, 24, 0.96);
  overflow-x: auto;
  box-shadow: var(--blog-shadow-soft);
}

.article-prose pre code {
  padding: 0;
  border: 0;
  background: transparent;
}

.article-prose img {
  border: 1px solid var(--blog-border);
  border-radius: 22px;
  box-shadow: var(--blog-shadow-soft);
}

.article-prose blockquote {
  padding: 22px 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-left: 4px solid #93c5fd;
  border-radius: 0 22px 22px 0;
  background: rgba(148, 163, 184, 0.08);
  color: #e8eefb;
}

.embed-card {
  margin: 32px 0;
}

.embed-shell {
  position: relative;
  padding-top: 56.25%;
  border: 1px solid var(--blog-border);
  border-radius: 22px;
  overflow: hidden;
  background: var(--blog-surface-strong);
  box-shadow: var(--blog-shadow-soft);
}

.embed-shell iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.tag-strip {
  max-width: 44rem;
  margin: 40px 0 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

@media (max-width: 980px) {
  .hero-grid,
  .archive-card-link,
  .post-card-featured .archive-card-link {
    grid-template-columns: 1fr;
  }

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

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

  .article-reading-lane {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .article-outline {
    position: static;
  }

  .article-prose,
  .tag-strip {
    max-width: none;
    margin-left: 0;
  }
}

@media (max-width: 700px) {
  .blog-container {
    width: min(var(--blog-container), calc(100% - 28px));
  }

  .blog-hero {
    padding-top: 36px;
  }

  .hero-stats {
    gap: 12px;
  }

  .hero-stat {
    min-width: 0;
    width: 100%;
  }

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

  .post-page .article-shell {
    width: min(1100px, calc(100% - 28px));
    padding-top: 32px;
  }

  .hero-rail,
  .hero-post-link,
  .article-card,
  .card-link,
  .post-card-body {
    padding: 20px;
  }

  .article-prose {
    font-size: 1rem;
    line-height: 1.8;
  }

  .article-progress {
    margin-bottom: 18px;
  }

  .article-facts {
    grid-template-columns: 1fr;
  }

  .article-header h1 {
    max-width: none;
  }

  .article-intro-actions {
    display: none;
  }

  .article-outline {
    display: none;
  }

  .article-reading-lane,
  .tag-strip {
    margin-top: 32px;
  }
}
