/* ByteDiagram Blog — matches site design system */
:root {
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --purple-500: #a855f7;
  --purple-600: #9333ea;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 0.75rem;
  --shadow: 0 10px 40px -12px rgba(37, 99, 235, 0.15);
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a.btn {
  text-decoration: none;
}

a.btn-primary,
a.btn-primary:hover,
a.btn-primary:focus {
  color: #fff;
}

a.btn-outline {
  color: var(--gray-700);
}

a.btn-outline:hover {
  color: var(--gray-900);
}

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

/* Honeycomb background */
.page-bg {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(59, 130, 246, 0.08), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(168, 85, 247, 0.08), transparent 35%),
    var(--gray-50);
}

.page-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath fill='%239ca3af' fill-opacity='0.12' d='M28 66L0 50V16L28 0l28 16v34L28 66zm0-12l20-11.5V22.5L28 11 8 22.5v20L28 54z'/%3E%3C/svg%3E");
  background-size: 56px 100px;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--gray-200);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo img {
  height: 2.25rem;
  width: auto;
}

.nav-links {
  display: none;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-600);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-600), var(--purple-600));
  box-shadow: 0 10px 25px -8px rgba(37, 99, 235, 0.45);
}

.btn-outline {
  color: var(--gray-700);
  background: #fff;
  border: 1px solid var(--gray-200);
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

/* Hero */
.blog-hero {
  padding: 4rem 0 2.5rem;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.35rem 0.875rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-700);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(168, 85, 247, 0.12));
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.blog-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--gray-900);
}

.blog-hero p {
  margin: 0 auto;
  max-width: 40rem;
  font-size: 1.0625rem;
  color: var(--gray-600);
}

/* Blog grid */
.blog-grid {
  display: grid;
  gap: 1.5rem;
  padding-bottom: 4rem;
}

@media (min-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.25);
  box-shadow: 0 20px 50px -16px rgba(37, 99, 235, 0.22);
}

.card-cover {
  height: 10rem;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #9333ea 100%);
  position: relative;
  overflow: hidden;
}

.card-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath fill='%23ffffff' fill-opacity='0.12' d='M28 66L0 50V16L28 0l28 16v34L28 66zm0-12l20-11.5V22.5L28 11 8 22.5v20L28 54z'/%3E%3C/svg%3E");
  background-size: 56px 100px;
}

.card-cover.alt-blue {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
}

.card-cover.alt-purple {
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
}

.card-cover.alt-teal {
  background: linear-gradient(135deg, #0d9488 0%, #2563eb 100%);
}

.card-cover.alt-orange {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 55%, #dc2626 100%);
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.25rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.tag {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  color: var(--primary-700);
  background: rgba(59, 130, 246, 0.1);
}

.blog-card h2 {
  margin: 0 0 0.625rem;
  font-size: 1.125rem;
  line-height: 1.35;
  color: var(--gray-900);
}

.blog-card p {
  margin: 0 0 1rem;
  flex: 1;
  font-size: 0.9375rem;
  color: var(--gray-600);
}

.read-more {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-600);
}

.read-more:hover {
  color: var(--purple-600);
}

/* Article detail */
.article-wrap {
  padding: 2rem 0 4rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
}

.back-link:hover {
  color: var(--primary-600);
}

.article-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: calc(var(--radius) + 0.25rem);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.article-header {
  padding: 2.5rem 2rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.04), transparent);
  text-align: center;
}

@media (min-width: 768px) {
  .article-header {
    padding: 3rem 3rem 2rem;
  }
}

.article-header h1 {
  margin: 0.75rem auto 1rem;
  max-width: 52rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--gray-900);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.article-content {
  padding: 2rem;
  max-width: 52rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .article-content {
    padding: 2.5rem 3rem 3rem;
  }
}

.article-content h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.375rem;
  color: var(--gray-900);
  text-align: left;
}

.article-content h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.125rem;
  color: var(--gray-800);
  text-align: left;
}

.article-content a:not(.btn) {
  color: var(--primary-600);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content a:not(.btn):hover {
  color: var(--purple-600);
}

.article-content p,
.article-content li {
  font-size: 1.0625rem;
  color: var(--gray-700);
  text-align: left;
}

.article-content ul,
.article-content ol {
  margin: 0.75rem auto 1.25rem;
  padding-left: 1.25rem;
  max-width: 100%;
}

.article-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--primary-500);
  border-radius: 0 0.5rem 0.5rem 0;
  background: rgba(59, 130, 246, 0.06);
  color: var(--gray-700);
}

.article-content code {
  padding: 0.15rem 0.4rem;
  border-radius: 0.35rem;
  font-size: 0.9em;
  background: var(--gray-100);
  color: var(--gray-800);
}

.article-content pre {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  background: var(--gray-900);
  color: #e5e7eb;
  font-size: 0.875rem;
  line-height: 1.55;
}

.article-content pre code {
  padding: 0;
  background: none;
  color: inherit;
}

.cta-box {
  margin-top: 2.5rem;
  padding: 2rem 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(147, 51, 234, 0.08));
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.cta-box h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: var(--gray-900);
}

.cta-box p {
  margin: 0 auto 1.25rem;
  max-width: 36rem;
  color: var(--gray-600);
}

.cta-box .btn-primary {
  color: #fff;
  text-decoration: none;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--gray-900);
  color: #fff;
}

.site-footer-inner {
  padding: 3rem 0 2rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.footer-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--primary-600), var(--purple-600));
  font-size: 0.875rem;
}

.footer-brand span {
  font-size: 1.125rem;
  font-weight: 600;
}

.footer-text {
  margin: 0;
  max-width: 22rem;
  font-size: 0.9375rem;
  color: var(--gray-400);
}

.site-footer h4 {
  margin: 0 0 0.875rem;
  font-size: 1rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li + li {
  margin-top: 0.5rem;
}

.site-footer a {
  font-size: 0.9375rem;
  color: var(--gray-400);
  transition: color 0.2s;
}

.site-footer a:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-800);
  text-align: center;
  font-size: 0.875rem;
  color: var(--gray-400);
}
