:root {
  --bg: #0f0f0f;
  --bg-nav: rgba(15, 15, 15, 0.85);
  --text-primary: #ffffff;
  --text-secondary: #d1d1d1;
  --text-muted: #a3a3a3;
  --border: #2a2a2a;
  --card-bg: #161616;
  --card-hover: #1f1f1f;
}

body.light-mode {
  --bg: #ffffff;
  --bg-nav: rgba(255, 255, 255, 0.92);
  --text-primary: #000000;
  --text-secondary: #333333;
  --text-muted: #555555;
  --border: #e5e5e5;
  --card-bg: #f8f8f8;
  --card-hover: #f0f0f0;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-secondary);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 768px) {
  input, textarea, select, button { font-size: 16px; }
  input[type="text"], input[type="email"], input[type="password"], textarea { -webkit-appearance: none; appearance: none; }
}

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

.blog-grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.blog-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 64px;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.blog-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
}

.blog-nav-logo img {
  width: 28px;
  height: 28px;
}

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

.blog-nav-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
  font-weight: 400;
}

.blog-nav-links a:hover {
  color: var(--text-primary);
}

.blog-nav-links a.active {
  color: #8b5cf6;
}

.blog-nav-cta {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
  color: #fff !important;
  padding: 8px 20px !important;
  border-radius: 8px;
  font-weight: 600 !important;
  font-size: 13px !important;
  transition: opacity 0.15s;
}

.blog-nav-cta:hover {
  opacity: 0.9;
}

.blog-nav-login {
  color: var(--text-muted) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  transition: color 0.15s;
}

.blog-nav-login:hover {
  color: var(--text-secondary) !important;
}

.blog-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 768px) {
  .blog-nav-toggle { display: block; padding: 10px; margin: -4px -4px -4px 0; }
  .blog-nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    padding: 16px 20px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .blog-nav.open .blog-nav-links { display: flex; }
  .blog-nav-links a {
    padding: 14px 16px;
    font-size: 16px;
    min-height: 48px;
    display: flex;
    align-items: center;
    border-radius: 10px;
  }
  .blog-nav-links a:active { background: rgba(139,92,246,0.12); }
}

.blog-page {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 120px 28px 100px;
}

.blog-header {
  margin-bottom: 48px;
  text-align: center;
}

.blog-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 44px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}

.blog-header p {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

.blog-badge {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
  padding: 4px 12px;
  border-radius: 100px;
  white-space: nowrap;
}

.blog-time {
  font-size: 13px;
  color: var(--text-muted);
}

.blog-featured {
  margin-bottom: 48px;
}

.featured-card {
  display: block;
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 48px 52px;
  transition: border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
}

.featured-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #8b5cf6, #06b6d4, transparent);
  opacity: 0.6;
}

.featured-card:hover {
  border-color: rgba(139, 92, 246, 0.22);
  box-shadow: 0 8px 40px rgba(139, 92, 246, 0.06);
}

.featured-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: #06b6d4;
  margin-bottom: 24px;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.featured-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 16px;
}

.featured-excerpt {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 28px;
  max-width: 640px;
}

.featured-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #8b5cf6;
  padding: 10px 22px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 8px;
  transition: background 0.2s, gap 0.2s, border-color 0.2s;
}

.featured-link:hover {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.35);
  gap: 12px;
}

.blog-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.blog-filter {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 18px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.blog-filter:hover {
  color: var(--text-secondary);
  border-color: rgba(139, 92, 246, 0.18);
}

.blog-filter.active {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 30px 28px;
  transition: border-color 0.3s, transform 0.2s, box-shadow 0.3s;
}

.blog-card:hover {
  background: var(--card-hover);
  border-color: rgba(139, 92, 246, 0.18);
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.04);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.blog-card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 10px;
}

.blog-card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 20px;
  flex: 1;
}

.blog-card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: #8b5cf6;
  transition: gap 0.2s;
}

.blog-card-link:hover {
  gap: 9px;
}

.blog-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 15px;
  grid-column: 1 / -1;
}

.blog-container {
  position: relative;
  z-index: 1;
  max-width: 740px;
  margin: 0 auto;
  padding: 120px 28px 100px;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 48px;
  transition: color 0.2s;
  font-weight: 500;
}

.article-back:hover {
  color: #8b5cf6;
}

.article-back svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.article-category {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
  padding: 4px 14px;
  border-radius: 100px;
}

.article-time {
  font-size: 13px;
  color: var(--text-muted);
}

.article-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 40px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.18;
  margin-bottom: 36px;
}

.article-divider {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, #8b5cf6, #06b6d4);
  border: none;
  border-radius: 2px;
  margin-bottom: 44px;
}

.article-body {
  font-size: 17px;
  line-height: 1.9;
  color: var(--text-secondary);
}

.article-body p {
  margin-bottom: 28px;
}

.article-body p:last-child {
  margin-bottom: 0;
}

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

.article-body .article-lead {
  font-size: 19.5px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 32px;
}

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

.article-footer-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
  font-weight: 500;
}

.article-footer-back:hover {
  color: #8b5cf6;
}

.article-footer-back svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.article-footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #8b5cf6;
  padding: 10px 22px;
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 8px;
  transition: background 0.2s, border-color 0.2s;
}

.article-footer-cta:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.4);
}

.article-section-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-top: 44px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.article-callout {
  border-radius: 12px;
  padding: 24px 28px;
  margin: 24px 0 28px;
  font-size: 16px;
  line-height: 1.7;
}

.article-callout p {
  margin-bottom: 0;
}

.article-callout-input {
  background: rgba(139, 92, 246, 0.06);
  border-left: 3px solid #8b5cf6;
  color: var(--text-secondary);
  font-style: italic;
}

.article-callout-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #8b5cf6;
  margin-bottom: 10px;
}

.article-callout-output {
  background: rgba(6, 182, 212, 0.06);
  border-left: 3px solid #06b6d4;
  color: var(--text-secondary);
}

.article-steps {
  margin: 28px 0 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.article-step-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: #8b5cf6;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.article-step-content {
  flex: 1;
  min-width: 0;
}

.article-step-content h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.article-step-content p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 12px;
}

.article-step-content p:last-child {
  margin-bottom: 0;
}

.article-step-content .article-callout {
  margin-top: 12px;
  margin-bottom: 0;
}

.article-cta-block {
  margin-top: 64px;
  padding: 40px 36px;
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: 16px;
  text-align: center;
}

.article-cta-block h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.article-cta-block p {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.article-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  padding: 12px 28px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.article-cta-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.article-related {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.article-related h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.article-related-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s;
}

.article-related-card:hover {
  background: var(--card-hover);
  border-color: rgba(139, 92, 246, 0.18);
}

.article-related-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.article-related-time {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .blog-nav {
    padding: 0 16px;
  }

  .blog-page {
    padding: 80px 16px 60px;
  }

  .blog-header h1 {
    font-size: 28px;
    line-height: 1.2;
  }

  .blog-header p {
    font-size: 14px;
    line-height: 1.6;
  }

  .featured-card {
    padding: 24px 18px;
    border-radius: 14px;
  }

  .featured-title {
    font-size: 22px;
    line-height: 1.3;
  }

  .featured-excerpt {
    font-size: 14px;
    line-height: 1.6;
  }

  .blog-filters {
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .blog-filter {
    padding: 10px 16px;
    font-size: 13px;
    min-height: 40px;
    white-space: nowrap;
    flex-shrink: 0;
  }

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

  .blog-card {
    padding: 20px 18px;
  }

  .blog-card-title {
    font-size: 17px;
    line-height: 1.3;
  }

  .blog-container {
    padding: 80px 16px 60px;
  }

  .article-title {
    font-size: 26px;
    line-height: 1.25;
  }

  .article-body {
    font-size: 16px;
    line-height: 1.8;
  }

  .article-body .article-lead {
    font-size: 17px;
    line-height: 1.6;
  }

  .article-body p {
    margin-bottom: 22px;
  }

  .article-footer {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .article-section-heading {
    font-size: 19px;
    margin-top: 32px;
    line-height: 1.3;
  }

  .article-callout {
    padding: 18px 16px;
    border-radius: 12px;
  }

  .article-step {
    gap: 14px;
  }

  .article-step-number {
    width: 30px;
    height: 30px;
    font-size: 13px;
    border-radius: 8px;
  }

  .article-cta-block {
    padding: 32px 24px;
  }

  .article-related-card {
    flex-wrap: wrap;
    gap: 8px;
  }
  .article-feature-links {
    flex-direction: column;
  }
}

.article-feature-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 40px 0 32px;
  padding: 24px 28px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.article-feature-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #a78bfa;
  transition: all 0.15s;
}

.article-feature-link:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
}

.theme-toggle{background:none;border:1px solid var(--border);border-radius:8px;cursor:pointer;padding:6px;display:flex;align-items:center;justify-content:center;color:var(--text-muted);transition:all .2s;margin-left:8px}
.theme-toggle:hover{border-color:rgba(139,92,246,0.5);color:#c4b5fd}
.theme-icon-moon{display:none}
body.light-mode .theme-icon-sun{display:none}
body.light-mode .theme-icon-moon{display:block}

body.light-mode .blog-grid-bg{background-image:linear-gradient(rgba(139,92,246,0.04) 1px,transparent 1px),linear-gradient(90deg,rgba(139,92,246,0.04) 1px,transparent 1px)}

body.light-mode .blog-nav{box-shadow:0 1px 3px rgba(0,0,0,0.04)}
body.light-mode .blog-nav-links a.active{color:#8b5cf6}
body.light-mode .theme-toggle:hover{border-color:#7c3aed;color:#7c3aed}

body.light-mode .blog-filter.active{background:rgba(139,92,246,0.06);border-color:#8b5cf6;color:#7c3aed}

body.light-mode .featured-card{box-shadow:0 2px 12px rgba(0,0,0,0.04)}
body.light-mode .featured-card::before{background:linear-gradient(90deg,#8b5cf6,#06b6d4,transparent);opacity:0.4}
body.light-mode .featured-card:hover{border-color:rgba(139,92,246,0.25);box-shadow:0 4px 24px rgba(139,92,246,0.08)}
body.light-mode .featured-label{color:#0891b2}
body.light-mode .featured-read-link{color:#7c3aed;border-color:rgba(139,92,246,0.2)}
body.light-mode .featured-read-link:hover{background:rgba(139,92,246,0.06)}
body.light-mode .blog-featured{background:transparent}

body.light-mode .blog-card{box-shadow:0 1px 3px rgba(0,0,0,0.04)}
body.light-mode .blog-card:hover{border-color:rgba(139,92,246,0.25);box-shadow:0 4px 20px rgba(139,92,246,0.08)}
body.light-mode .blog-card-cat{color:#7c3aed;background:rgba(139,92,246,0.06);border-color:rgba(139,92,246,0.15)}
body.light-mode .blog-card-read{color:#7c3aed}

body.light-mode .blog-footer a:hover{color:var(--text-primary)}

body.light-mode .article-body a{color:#7c3aed}
body.light-mode .article-body blockquote{background:rgba(139,92,246,0.04);border-left-color:#8b5cf6;color:var(--text-secondary)}
body.light-mode .article-body code{background:rgba(139,92,246,0.06);color:#7c3aed}
body.light-mode .article-body pre{background:#1e1e2e}
body.light-mode .article-body pre code{color:#e2e8f0;background:transparent}

body.light-mode .article-cta{box-shadow:0 1px 3px rgba(0,0,0,0.04)}

body.light-mode .article-feature-link{background:var(--card-bg);border-color:var(--border);color:var(--text-secondary);box-shadow:0 1px 3px rgba(0,0,0,0.04)}
body.light-mode .article-feature-link:hover{border-color:rgba(139,92,246,0.25);color:#7c3aed;box-shadow:0 2px 8px rgba(139,92,246,0.08)}
body.light-mode .article-feature-link svg{color:#8b5cf6}
