:root {
  --sb-primary: #4da2ff;
  --sb-primary-dim: rgba(77, 162, 255, 0.12);
  --sb-primary-glow: rgba(77, 162, 255, 0.06);
  --sb-cyan: #36d6e7;
  --sb-purple: #a855f7;
  --sb-magenta: #d946ef;
  --bg: #060709;
  --surface: #0c0d12;
  --elevated: #13141c;
  --card: #181924;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(77, 162, 255, 0.2);
  --text-primary: #e4e5ea;
  --text-secondary: #8b90a8;
  --text-dim: #565b72;
  --status-green: #00d4aa;
  --amber: #e8a838;
  --purple: #9b7ed8;
  --gray-muted: #6b7094;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-primary);
  font-family: "DM Sans", sans-serif;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.blog-shell {
  min-height: 100vh;
  position: relative;
}

.ambient-glow-primary,
.ambient-glow-purple,
.noise-overlay {
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

.ambient-glow-primary {
  height: 800px;
  inset: -300px -200px auto auto;
  width: 800px;
  background: radial-gradient(
    ellipse,
    rgba(77, 162, 255, 0.05) 0%,
    transparent 60%
  );
}

.ambient-glow-purple {
  height: 600px;
  inset: auto auto -400px -200px;
  width: 600px;
  background: radial-gradient(
    ellipse,
    rgba(168, 85, 247, 0.03) 0%,
    transparent 60%
  );
}

.noise-overlay {
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.blog-header {
  position: sticky;
  top: 0;
  z-index: 50;
  transition:
    background 0.3s ease,
    border-color 0.3s ease;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: transparent;
  border-bottom: 1px solid transparent;
}

.blog-header.is-scrolled {
  background: rgba(6, 7, 9, 0.85);
  border-bottom-color: var(--border);
}

.blog-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.blog-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.blog-brand-symbol {
  width: auto;
  height: 28px;
  display: block;
}

.blog-brand-wordmark {
  width: auto;
  height: 17px;
  display: block;
}

.blog-badge {
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  letter-spacing: 0.04em;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--sb-primary-dim);
  color: var(--sb-primary);
}

.blog-header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.blog-header-nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.blog-header-nav a:hover {
  opacity: 0.8;
}

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

.blog-home {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 40px 100px;
}

.blog-home-hero {
  margin-bottom: 64px;
}

.blog-home-title {
  margin: 0 0 16px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.5rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.blog-home-copy {
  margin: 0;
  max-width: 540px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
}

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

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.blog-card-tags,
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--sb-primary-dim);
  color: var(--sb-primary);
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.blog-card-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.blog-card-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.blog-card-meta {
  color: var(--text-dim);
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
}

.article-shell {
  padding-bottom: 100px;
}

.article-hero,
.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

.article-hero {
  padding-top: 64px;
}

.article-title {
  margin: 0 0 20px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.5rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--sb-primary), var(--sb-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.article-description {
  margin: 0 0 32px;
  max-width: 600px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.article-author-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.article-author-avatar {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(77, 162, 255, 0.3),
    rgba(168, 85, 247, 0.3)
  );
  color: var(--sb-primary);
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.article-author-name {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.article-author-meta {
  color: var(--text-dim);
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
}

.article-body {
  padding-top: 48px;
  position: relative;
}

.article-body-inner {
  position: relative;
}

.toc-aside {
  display: none;
}

.toc-nav {
  position: sticky;
  top: 100px;
  width: 200px;
  padding-right: 20px;
  border-right: 1px solid var(--border);
  text-align: right;
}

.toc-title {
  margin-bottom: 16px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.toc-link {
  display: block;
  padding: 5px 12px 5px 0;
  margin-right: -21px;
  color: var(--text-dim);
  text-decoration: none;
  border-right: 2px solid transparent;
  font-size: 13px;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.toc-link.toc-link-level-3 {
  padding-right: 14px;
}

.toc-link.is-active,
.toc-link:hover {
  color: var(--sb-primary);
  border-right-color: var(--sb-primary);
}

.article-prose {
  min-width: 0;
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: -0.005em;
  color: var(--text-secondary);
}

.article-prose h2 {
  margin: 48px 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.article-prose h3 {
  margin: 32px 0 10px;
  color: var(--text-primary);
  font-family: "Space Grotesk", sans-serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.article-prose p {
  margin: 0 0 20px;
}

.article-prose strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article-prose a {
  color: var(--sb-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-prose blockquote {
  margin: 40px 0;
  padding: 24px 28px;
  border-left: 3px solid;
  border-image: linear-gradient(180deg, var(--sb-primary), var(--sb-purple)) 1;
  border-radius: 0 12px 12px 0;
  background: linear-gradient(
    135deg,
    rgba(77, 162, 255, 0.024),
    transparent
  );
  color: var(--text-secondary);
  font-style: italic;
}

.article-prose blockquote p {
  margin: 0;
}

.article-prose pre {
  margin: 24px 0;
  padding: 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.article-prose :not(pre) > code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--elevated);
  color: var(--sb-cyan);
  font-size: 0.9em;
}

.article-prose table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.article-prose th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--elevated);
  color: var(--text-dim);
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.article-prose td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
}

.article-prose tr:nth-child(even) td {
  background: var(--surface);
}

.article-prose ul,
.article-prose ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.article-prose li {
  margin-bottom: 8px;
}

.article-prose li::marker {
  color: var(--sb-primary);
}

.article-prose hr {
  margin: 48px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.article-prose img {
  max-width: 100%;
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.breakout-wide {
  margin-left: -60px;
  margin-right: -60px;
}

.interactive-embed {
  margin: 0 0 56px;
}

.interactive-embed-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
}

.interactive-embed-accent {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  z-index: 3;
  opacity: 0.5;
  background: linear-gradient(
    90deg,
    transparent,
    var(--sb-primary),
    var(--sb-purple),
    transparent
  );
}

.interactive-embed-loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.interactive-embed.is-loaded .interactive-embed-loader {
  display: none;
}

.interactive-embed-loader-content {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.interactive-embed-loader-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--sb-primary);
  animation: blog-pulse 1s infinite;
}

.interactive-embed-loader-text {
  color: var(--text-dim);
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
}

.interactive-embed iframe {
  display: block;
  width: 100%;
  border: 0;
  background: var(--bg);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.interactive-embed.is-loaded iframe {
  opacity: 1;
}

.interactive-embed-caption {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 11px;
  text-align: center;
}

.article-footer {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.article-footer-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-footer-buttons {
  display: flex;
  gap: 8px;
}

.blog-button {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}

.blog-button:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.blog-button[data-state="success"] {
  color: var(--sb-primary);
  border-color: var(--border-hover);
}

.blog-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px;
}

.blog-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.blog-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.blog-footer-brand img {
  width: auto;
  height: 20px;
}

.blog-footer-copy {
  font-size: 13px;
  color: var(--text-dim);
}

.blog-footer-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.blog-footer-nav a {
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
}

.blog-footer-nav a:hover {
  opacity: 0.8;
}

.blog-empty-state {
  color: var(--text-dim);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.status-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.stat-card {
  min-width: 140px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 28px;
  border-radius: 14px;
}

.stat-card-value {
  line-height: 1;
  font-family: "Space Grotesk", sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stat-card-label {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tier-table-wrap {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
}

@keyframes blog-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

@media (min-width: 1380px) {
  .toc-aside {
    display: block;
    position: absolute;
    left: -260px;
    top: 48px;
    width: 200px;
  }
}

@media (max-width: 1100px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .breakout-wide {
    margin-left: -20px;
    margin-right: -20px;
  }
}

@media (max-width: 768px) {
  .blog-header-inner,
  .blog-home,
  .article-hero,
  .article-body,
  .blog-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .blog-header-inner {
    min-height: 72px;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .blog-header-nav,
  .blog-footer-inner,
  .article-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .blog-brand-wordmark {
    display: none;
  }

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

  .article-footer-buttons {
    width: 100%;
  }

  .blog-button {
    flex: 1;
  }
}
