/* ============================================================
   BoltSync Blog — Stylesheet
   Matched to main site (tryboltsync.com) design system
   Fonts: Raleway (headings/logo) + DM Sans (body)
   Dark/light theme via body.light-mode
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

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

:root {
  --bg:          #080d18;
  --bg-2:        #0d1424;
  --bg-3:        #111827;
  --bg-4:        #1e2a3a;
  --border:      rgba(255,255,255,0.07);
  --border-2:    rgba(255,255,255,0.12);
  --accent:      #3b82f6;
  --accent-2:    #60a5fa;
  --accent-glow: rgba(59,130,246,0.25);
  --green:       #10b981;
  --green-2:     #34d399;
  --orange:      #f59e0b;
  --purple:      #8b5cf6;
  --red:         #ef4444;
  --text-1:      #f1f5f9;
  --text-2:      #94a3b8;
  --text-3:      #64748b;
  --text-4:      #334155;
  --r:       12px;
  --r-lg:    18px;
  --r-xl:    24px;
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:  0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.6);
  --nav-height: 68px;
}

body.light-mode {
  --bg:       #f8fafc;
  --bg-2:     #ffffff;
  --bg-3:     #f1f5f9;
  --bg-4:     #e2e8f0;
  --border:   rgba(0,0,0,0.08);
  --border-2: rgba(0,0,0,0.14);
  --text-1:   #0f172a;
  --text-2:   #475569;
  --text-3:   #94a3b8;
  --text-4:   #cbd5e1;
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:  0 8px 32px rgba(0,0,0,0.1);
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.12);
}

html { scroll-behavior: smooth; overflow-x: hidden; width: 100%; font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  transition: background 0.3s, color 0.3s;
}
a { text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ══ NAVBAR ══ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(8,13,24,0.88);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
  width: 100%; max-width: 100vw; overflow: hidden;
}
body.light-mode .navbar { background: rgba(248,250,252,0.92); }
.navbar.scrolled { background: rgba(8,13,24,0.98); border-bottom-color: var(--border-2); }
body.light-mode .navbar.scrolled { background: rgba(255,255,255,0.99); }

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-height); padding: 0 32px;
  max-width: 1240px; margin: 0 auto; gap: 24px;
}

.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.logo-icon {
  width: 34px; height: 34px; border-radius: 9px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo-icon.small { width: 26px; height: 26px; border-radius: 7px; }
.logo-icon img { width: 100%; height: 100%; object-fit: cover; }
.logo-text {
  font-family: 'Raleway', sans-serif; font-weight: 800; font-size: 1.1rem;
  color: var(--text-1); letter-spacing: -0.01em;
}

.nav-links {
  display: flex; align-items: center; gap: 2px;
  background: transparent; border: none; border-radius: 12px; padding: 5px 6px;
}
body.light-mode .nav-links { background: rgba(0,0,0,0.04); }
.nav-links a {
  color: var(--text-2); font-size: 0.84rem; font-weight: 500;
  padding: 6px 13px; border-radius: 8px;
  transition: color 0.18s, background 0.18s; white-space: nowrap; letter-spacing: 0.01em;
}
.nav-links a:hover { color: var(--text-1); background: rgba(255,255,255,0.08); }
.nav-links a.active { color: var(--text-1); background: rgba(255,255,255,0.08); }
body.light-mode .nav-links a:hover { background: rgba(0,0,0,0.06); }

.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.theme-toggle {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-2);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  color: var(--text-2); cursor: pointer; transition: background 0.2s, color 0.2s; flex-shrink: 0;
}
.theme-toggle:hover { background: rgba(255,255,255,0.1); color: var(--text-1); }
body.light-mode .theme-toggle { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.12); }
body.light-mode .theme-toggle:hover { background: rgba(0,0,0,0.09); }
.icon-moon { display: block; }
.icon-sun  { display: none; }
body.light-mode .icon-moon { display: none; }
body.light-mode .icon-sun  { display: block; }

.btn-ghost {
  color: var(--text-2); font-size: 0.83rem; font-weight: 500;
  padding: 7px 14px; border-radius: 9px; border: 1px solid var(--border-2);
  transition: color 0.2s, border-color 0.2s, background 0.2s; white-space: nowrap;
  text-decoration: none; display: inline-block;
}
.btn-ghost:hover { color: var(--text-1); border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.05); }
body.light-mode .btn-ghost { color: var(--text-2); border-color: rgba(0,0,0,0.15); }
body.light-mode .btn-ghost:hover { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.22); color: var(--text-1); }

.btn-primary-sm {
  background: var(--accent); color: #fff; font-size: 0.83rem; font-weight: 700;
  padding: 8px 18px; border-radius: 9px; border: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap; letter-spacing: 0.01em; text-decoration: none; display: inline-block;
}
.btn-primary-sm:hover { background: var(--accent-2); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(59,130,246,0.4); }

.hamburger {
  display: none; flex-direction: column; justify-content: center;
  align-items: center; gap: 5px; width: 40px; height: 40px;
  background: transparent; border: none; padding: 0; cursor: pointer; flex-shrink: 0;
  transition: opacity 0.2s;
}
.hamburger:hover { opacity: 0.7; }
.hamburger span {
  display: block; width: 18px; height: 2px; background: var(--text-2); border-radius: 2px;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), opacity 0.2s, width 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══ MOBILE MENU ══ */
.mobile-menu {
  position: fixed; top: 0; right: 0;
  width: min(320px, 88vw); height: 100dvh;
  background: var(--bg-2); border-left: 1px solid var(--border-2);
  z-index: 1050; display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto; overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 24px);
  box-shadow: -16px 0 48px rgba(0,0,0,0.6);
  will-change: transform;
}
.mobile-menu.open { transform: translateX(0); }
body.light-mode .mobile-menu { background: #ffffff; border-left-color: rgba(0,0,0,0.08); box-shadow: -16px 0 48px rgba(0,0,0,0.14); }

.mobile-menu .mobile-nav-links a,
.mobile-menu .mobile-theme-row,
.mobile-menu .mobile-cta-group,
.mobile-menu .mobile-contact-strip {
  opacity: 0; transform: translateX(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.mobile-menu.open .mobile-nav-links a,
.mobile-menu.open .mobile-theme-row,
.mobile-menu.open .mobile-cta-group,
.mobile-menu.open .mobile-contact-strip { opacity: 1; transform: translateX(0); }
.mobile-menu.open .mobile-nav-links a:nth-child(1) { transition-delay:0.04s; }
.mobile-menu.open .mobile-nav-links a:nth-child(2) { transition-delay:0.08s; }
.mobile-menu.open .mobile-nav-links a:nth-child(3) { transition-delay:0.12s; }
.mobile-menu.open .mobile-nav-links a:nth-child(4) { transition-delay:0.16s; }
.mobile-menu.open .mobile-nav-links a:nth-child(5) { transition-delay:0.20s; }
.mobile-menu.open .mobile-nav-links a:nth-child(6) { transition-delay:0.24s; }
.mobile-menu.open .mobile-nav-links a:nth-child(7) { transition-delay:0.28s; }
.mobile-menu.open .mobile-theme-row    { transition-delay:0.32s; }
.mobile-menu.open .mobile-cta-group   { transition-delay:0.36s; }
.mobile-menu.open .mobile-contact-strip { transition-delay:0.40s; }

.mobile-menu-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.mobile-menu-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Raleway', sans-serif; font-weight: 800; font-size: 1rem;
  color: var(--text-1); text-decoration: none;
}
.mobile-close-btn {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border-2);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: var(--text-2); cursor: pointer; transition: background 0.2s;
}
.mobile-close-btn:hover { background: rgba(255,255,255,0.1); }
body.light-mode .mobile-close-btn { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); }

.mobile-nav-links { display: flex; flex-direction: column; padding: 10px 12px 4px; flex-shrink: 0; }
.mobile-nav-links a {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-2); font-size: 0.9rem; font-weight: 500;
  padding: 11px 12px; border-radius: 9px;
  transition: color 0.18s, background 0.18s; text-decoration: none;
}
.mobile-nav-links a:hover { color: var(--text-1); background: rgba(255,255,255,0.05); }
body.light-mode .mobile-nav-links a:hover { background: rgba(0,0,0,0.04); }

.mobile-theme-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; margin: 8px 12px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; flex-shrink: 0;
}
body.light-mode .mobile-theme-row { background: rgba(0,0,0,0.03); }
.mobile-theme-label { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 0.85rem; font-weight: 500; }
.mobile-theme-toggle {
  background: rgba(255,255,255,0.08); border: 1px solid var(--border-2); border-radius: 8px;
  padding: 5px 12px; font-size: 0.8rem; color: var(--text-1); cursor: pointer; transition: background 0.2s;
}
.mobile-theme-toggle:hover { background: rgba(255,255,255,0.13); }
body.light-mode .mobile-theme-toggle { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.12); }
.mtt-dark { display: block; }
.mtt-light { display: none; }
body.light-mode .mtt-dark { display: none; }
body.light-mode .mtt-light { display: block; }

.mobile-cta-group { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px; flex-shrink: 0; }
.mobile-cta {
  display: flex; align-items: center; justify-content: center; padding: 11px;
  border-radius: 10px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-2);
  color: var(--text-1); font-size: 0.88rem; font-weight: 600; text-decoration: none; transition: background 0.2s;
}
.mobile-cta:hover { background: rgba(255,255,255,0.09); }
.mobile-cta-primary {
  display: flex; align-items: center; justify-content: center; padding: 12px;
  border-radius: 10px; background: var(--accent); color: #fff;
  font-size: 0.88rem; font-weight: 700; text-decoration: none; transition: background 0.2s;
}
.mobile-cta-primary:hover { background: var(--accent-2); }

.mobile-contact-strip {
  margin-top: auto; display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px 4px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.mobile-contact-strip a { color: var(--text-3); font-size: 0.8rem; text-decoration: none; transition: color 0.2s; }
.mobile-contact-strip a:hover { color: var(--text-2); }

.mobile-overlay {
  position: fixed; inset: 0; z-index: 1040;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
.mobile-overlay.active { opacity: 1; pointer-events: all; }
body.menu-open { overflow: hidden !important; }

/* ══ PAGE BODY — top padding for fixed navbar ══ */
.page-body { padding-top: var(--nav-height); }

/* ══ BLOG INDEX HERO ══ */
.blog-index-hero {
  background: linear-gradient(135deg, #080d18 0%, #0f1f3d 50%, #080d18 100%);
  border-bottom: 1px solid var(--border);
  padding: 60px 20px 48px; text-align: center; position: relative; overflow: hidden;
}
body.light-mode .blog-index-hero { background: linear-gradient(135deg,#f8fafc 0%,#eff6ff 50%,#f8fafc 100%); }
.blog-index-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(59,130,246,0.14) 0%, transparent 70%);
  pointer-events: none;
}
.blog-index-hero h1 {
  font-family: 'Raleway', sans-serif; font-size: clamp(2rem,6vw,3.2rem);
  font-weight: 800; color: var(--text-1); margin-bottom: 16px;
  position: relative; letter-spacing: -0.02em;
}
.blog-index-hero p {
  color: var(--text-2); font-size: clamp(0.95rem,2.5vw,1.05rem);
  max-width: 520px; margin: 0 auto; position: relative; line-height: 1.7;
}

.blog-index-grid {
  max-width: 1000px; margin: 0 auto; padding: 40px 24px 72px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px,100%),1fr)); gap: 16px;
}

.post-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 24px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.post-card:hover { border-color: rgba(59,130,246,0.4); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.post-card:active { transform: translateY(0); }
.post-card-tag {
  display: inline-flex; align-items: center;
  background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.2); color: var(--accent-2);
  border-radius: 100px; padding: 4px 13px; font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; width: fit-content;
}
.post-card h2 {
  font-family: 'Raleway', sans-serif; font-size: clamp(1rem,2.5vw,1.15rem);
  font-weight: 700; color: var(--text-1); line-height: 1.35;
}
.post-card p { color: var(--text-2); font-size: 0.9rem; line-height: 1.65; flex: 1; }
.post-card-meta { color: var(--text-3); font-size: 0.8rem; }
.post-card-arrow { color: var(--accent-2); font-size: 0.85rem; font-weight: 600; margin-top: 4px; }

/* ══ ARTICLE HERO BAND ══ */
.blog-hero {
  background: linear-gradient(135deg, #080d18 0%, #0f1f3d 50%, #080d18 100%);
  border-bottom: 1px solid var(--border); padding: 52px 24px 44px;
  text-align: center; position: relative; overflow: hidden;
}
body.light-mode .blog-hero { background: linear-gradient(135deg,#f8fafc 0%,#eff6ff 50%,#f8fafc 100%); }
.blog-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(59,130,246,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.blog-category-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.3); color: var(--accent-2);
  border-radius: 100px; padding: 5px 16px; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 20px; position: relative;
}
.blog-hero h1 {
  font-family: 'Raleway', sans-serif; font-size: clamp(1.5rem,4vw,2.4rem);
  font-weight: 800; line-height: 1.2; color: var(--text-1); margin-bottom: 16px;
  max-width: 680px; margin-left: auto; margin-right: auto;
  position: relative; letter-spacing: -0.02em;
}
.blog-hero h1 .hl { color: var(--accent-2); }
.blog-hero-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; flex-wrap: wrap; color: var(--text-3); font-size: 0.85rem; margin-top: 18px; position: relative;
}
.blog-hero-meta span { display: flex; align-items: center; gap: 6px; }

.blog-layout {
  max-width: 900px; margin: 0 auto; padding: 44px 24px 80px;
  display: grid; grid-template-columns: 1fr 240px; gap: 40px; align-items: start;
}

/* ══ ARTICLE BODY ══ */
.blog-article h2 {
  font-family: 'Raleway', sans-serif; font-size: clamp(1.15rem,2.5vw,1.4rem);
  font-weight: 700; color: var(--text-1); margin: 44px 0 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.blog-article h3 {
  font-family: 'Raleway', sans-serif; font-size: clamp(0.98rem,2vw,1.08rem);
  font-weight: 600; color: var(--text-1); margin: 28px 0 10px;
}
.blog-article p { color: var(--text-2); margin-bottom: 16px; line-height: 1.78; font-size: 0.97rem; }
.blog-article strong { color: var(--text-1); }
.blog-article a { color: var(--accent-2); text-decoration: underline; }
.blog-article ul, .blog-article ol { color: var(--text-2); padding-left: 24px; margin-bottom: 16px; font-size: 0.97rem; }
.blog-article li { margin-bottom: 7px; line-height: 1.65; }

.callout {
  background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.25);
  border-left: 3px solid var(--accent); border-radius: var(--r); padding: 16px 20px; margin: 28px 0;
}
.callout p { margin: 0; color: var(--text-1); font-size: 0.95rem; }
.callout-green { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.25); border-left: 3px solid var(--green); }
.callout-green p { color: var(--text-1); }

.table-scroll-wrapper {
  width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 24px 0; border-radius: var(--r); border: 1px solid var(--border);
}
.comp-table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: 0.88rem; margin: 24px 0; }
.table-scroll-wrapper .comp-table { margin: 0; }
.comp-table th {
  background: var(--bg-3); color: var(--text-1); padding: 11px 14px; text-align: left;
  font-family: 'Raleway', sans-serif; font-weight: 700; border-bottom: 2px solid var(--border); white-space: nowrap;
}
.comp-table td { padding: 11px 14px; color: var(--text-2); border-bottom: 1px solid var(--border); vertical-align: top; }
.comp-table tr:last-child td { border-bottom: none; }
.comp-table tr:hover td { background: rgba(255,255,255,0.02); }
.comp-table .tick { color: var(--green); font-weight: 700; }
.comp-table .cross { color: var(--red); }
.comp-table .highlight-row td { color: var(--text-1); background: rgba(59,130,246,0.06); }

.inline-cta {
  background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(59,130,246,0.05));
  border: 1px solid rgba(59,130,246,0.25); border-radius: var(--r); padding: 24px 20px; margin: 36px 0; text-align: center;
}
.inline-cta h4 { font-family: 'Raleway', sans-serif; font-size: 1.1rem; color: var(--text-1); margin-bottom: 8px; font-weight: 700; }
.inline-cta p { color: var(--text-2); margin-bottom: 20px; font-size: 0.95rem; }
.inline-cta a {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff !important; text-decoration: none !important;
  padding: 12px 26px; border-radius: 9px; font-weight: 700; font-size: 0.95rem;
  transition: background 0.2s, transform 0.15s;
}
.inline-cta a:hover { background: var(--accent-2); transform: translateY(-1px); }

.formula-box {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--r);
  padding: 18px 22px; margin: 22px 0; font-family: 'Courier New', monospace;
  overflow-x: auto; -webkit-overflow-scrolling: touch; word-break: break-word; max-width: 100%;
}
.formula-box .formula-title {
  font-family: 'Raleway', sans-serif; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent-2); margin-bottom: 10px; font-weight: 700;
}
.formula-box .formula { font-size: clamp(0.8rem,2vw,0.95rem); color: var(--text-1); line-height: 1.8; }
.formula-box .formula span { color: var(--accent-2); }

.step-list { list-style: none; padding: 0; margin: 20px 0; }
.step-list li { display: flex; gap: 14px; margin-bottom: 18px; align-items: flex-start; }
.step-num {
  flex-shrink: 0; width: 32px; height: 32px; background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Raleway', sans-serif; font-weight: 700; font-size: 0.85rem; color: #fff;
}
.step-text { color: var(--text-2); padding-top: 4px; }
.step-text strong { color: var(--text-1); display: block; margin-bottom: 4px; }

/* ══ SIDEBAR ══ */
.blog-sidebar { position: sticky; top: calc(var(--nav-height) + 16px); }
.sidebar-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; margin-bottom: 20px; }
.sidebar-card-title {
  font-family: 'Raleway', sans-serif; font-weight: 700; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); margin-bottom: 14px;
}
.sidebar-toc a { display: block; color: var(--text-2); text-decoration: none; font-size: 0.85rem; padding: 7px 0; border-bottom: 1px solid var(--border); transition: color 0.2s; }
.sidebar-toc a:last-child { border-bottom: none; }
.sidebar-toc a:hover { color: var(--accent-2); }
.sidebar-dl-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; text-decoration: none; padding: 12px; border-radius: 9px;
  font-weight: 700; font-size: 0.9rem; transition: background 0.2s; margin-top: 4px;
}
.sidebar-dl-btn:hover { background: var(--accent-2); }
.sidebar-links a { display: flex; align-items: center; gap: 8px; color: var(--text-2); text-decoration: none; font-size: 0.85rem; padding: 7px 0; border-bottom: 1px solid var(--border); transition: color 0.2s; }
.sidebar-links a:last-child { border-bottom: none; }
.sidebar-links a:hover { color: var(--accent-2); }

/* ══ FOOTER — matches main site exactly ══ */
.footer { background: var(--bg-2); border-top: 1px solid var(--border); padding: 56px 0 0; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.footer-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
  padding-bottom: 40px; border-bottom: 1px solid var(--border);
}
.footer-brand p { color: var(--text-3); font-size: 0.85rem; line-height: 1.7; margin-top: 14px; max-width: 340px; }
.footer-dev { margin-top: 8px; }
.footer-dev a { color: var(--accent-2); text-decoration: none; }
.footer-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Raleway', sans-serif; font-weight: 800; font-size: 1.05rem;
  color: var(--text-1); text-decoration: none;
}
.footer-links { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 4px;
}
.footer-col a { color: var(--text-3); font-size: 0.85rem; transition: color 0.2s; text-decoration: none; }
.footer-col a:hover { color: var(--text-1); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; padding: 20px 0; font-size: 0.75rem; color: var(--text-4);
}

/* ══ SCROLL REVEAL ══ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.6s ease, transform 0.6s ease; transition-delay: var(--d,0ms); }
.reveal.visible { opacity: 1; transform: none; }
.reveal-right { opacity: 0; transform: translateX(32px); transition: opacity 0.7s ease, transform 0.7s ease; transition-delay: var(--d,0ms); }
.reveal-right.visible { opacity: 1; transform: none; }

/* ══ RESPONSIVE ══ */
@media (max-width: 960px) {
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-links { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 800px) {
  .blog-layout { grid-template-columns: 1fr; padding: 36px 20px 64px; gap: 0; }
  .blog-sidebar { display: none; }
  .nav-inner { padding: 0 20px; }
}
@media (max-width: 640px) {
  .hamburger { display: flex; }
  .nav-links { display: none; }
  /* Hide ALL nav-actions on mobile — theme toggle lives in mobile menu */
  .nav-actions { display: none; }
  .nav-inner { padding: 0 16px; }
  .blog-hero { padding: 40px 16px 32px; }
  .blog-hero h1 { font-size: clamp(1.3rem,7vw,1.9rem); }
  .blog-hero-meta { gap: 10px; font-size: 0.8rem; }
  .blog-index-hero { padding: 44px 16px 32px; }
  .blog-layout { padding: 24px 16px 52px; }
  .blog-index-grid { grid-template-columns: 1fr; padding: 28px 16px 52px; gap: 14px; }
  .post-card { padding: 18px; }
  .comp-table { min-width: 400px; font-size: 0.82rem; }
  .comp-table th, .comp-table td { padding: 9px 10px; }
  .footer-links { grid-template-columns: 1fr 1fr; gap: 20px; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 6px; }
  .footer { padding: 40px 0 0; }
  .container { padding: 0 20px; }
}
@media (max-width: 420px) {
  .blog-hero h1 { font-size: 1.3rem; }
  .logo-text { font-size: 0.95rem; }
  .blog-hero-meta { flex-direction: column; gap: 4px; }
  .footer-links { grid-template-columns: 1fr; gap: 16px; }
}
@media (pointer: coarse) {
  html { overscroll-behavior-x: none; }
  .mobile-menu { overscroll-behavior: contain; }
}

/* ══ LENIS SMOOTH SCROLL ══ */
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-scrolling iframe { pointer-events: none; }

/* ══ MOBILE — OVERFLOW HARDENING ══ */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Prevent ANY element from causing horizontal scroll */
.navbar, .nav-inner, .page-body, .blog-index-grid,
.blog-layout, .blog-article, .footer, .container,
.footer-inner, .footer-bottom {
  max-width: 100%;
  min-width: 0; /* critical for flex children */
}

/* ══ MOBILE — IMPROVED TOUCH TARGETS ══ */
@media (max-width: 640px) {
  /* Better touch targets for post cards */
  .post-card {
    padding: 18px 16px;
    /* Remove hover transform on touch — prevents layout shift */
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .post-card:hover { transform: none; }
  .post-card:active { opacity: 0.92; }

  /* Blog grid always single column on small screens */
  .blog-index-grid {
    grid-template-columns: 1fr;
    padding: 24px 16px 60px;
    gap: 12px;
  }

  /* Prevent hero text overflow */
  .blog-index-hero {
    padding: 44px 16px 32px;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .blog-index-hero h1 {
    font-size: clamp(1.6rem, 7.5vw, 2.2rem);
    line-height: 1.2;
  }
  .blog-index-hero p {
    font-size: 0.93rem;
    padding: 0 4px;
  }

  /* Article hero */
  .blog-hero {
    padding: 36px 16px 28px;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .blog-hero h1 {
    font-size: clamp(1.25rem, 6.5vw, 1.8rem);
    line-height: 1.25;
  }
  .blog-hero-meta {
    gap: 8px;
    font-size: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Article body readable on mobile */
  .blog-layout {
    padding: 24px 16px 60px;
    grid-template-columns: 1fr;
    gap: 0;
  }
  .blog-article {
    min-width: 0; /* prevent flex blowout */
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .blog-article h2 {
    font-size: clamp(1.05rem, 5vw, 1.25rem);
    margin: 36px 0 12px;
  }
  .blog-article h3 {
    font-size: clamp(0.95rem, 4vw, 1.05rem);
  }
  .blog-article p {
    font-size: 0.94rem;
    line-height: 1.75;
  }

  /* Tables — always scrollable on mobile */
  .table-scroll-wrapper {
    margin: 16px -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .comp-table {
    font-size: 0.8rem;
    min-width: 380px;
  }
  .comp-table th,
  .comp-table td { padding: 9px 10px; }

  /* Formula boxes */
  .formula-box {
    padding: 14px 16px;
    margin: 16px -4px;
  }
  .formula-box .formula { font-size: 0.82rem; }

  /* Callouts */
  .callout { padding: 14px 16px; margin: 20px 0; }

  /* Inline CTAs */
  .inline-cta { padding: 20px 16px; margin: 28px 0; }
  .inline-cta a { padding: 11px 20px; font-size: 0.9rem; }

  /* Step lists */
  .step-list li { gap: 10px; }
  .step-num { width: 28px; height: 28px; font-size: 0.8rem; flex-shrink: 0; }

  /* Footer mobile */
  .footer { padding: 36px 0 0; }
  .container { padding: 0 16px; }
  .footer-inner { gap: 28px; padding-bottom: 32px; }
  .footer-links { grid-template-columns: 1fr 1fr; gap: 16px; }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 6px;
    font-size: 0.7rem;
    padding: 16px 0 20px;
  }
  .footer-brand p { font-size: 0.83rem; max-width: 100%; }

  /* Mobile menu safe area */
  .mobile-menu {
    padding-bottom: max(env(safe-area-inset-bottom, 24px), 24px);
  }
}

@media (max-width: 420px) {
  .blog-hero h1 { font-size: 1.2rem; }
  .blog-index-hero h1 { font-size: 1.55rem; }
  .logo-text { font-size: 0.95rem; }
  .blog-hero-meta { flex-direction: column; gap: 4px; text-align: center; }
  .footer-links { grid-template-columns: 1fr; gap: 14px; }
  .blog-index-grid { padding: 20px 12px 52px; gap: 10px; }
  .post-card { padding: 16px 14px; gap: 10px; }
  .post-card h2 { font-size: 1rem; }
  .post-card p { font-size: 0.87rem; }
  .blog-category-badge { font-size: 0.7rem; padding: 4px 12px; }
  /* Tiny screen navbar — tighter padding */
  .nav-inner { padding: 0 12px; gap: 0; }
  .logo-text { font-size: 0.9rem; }
}

/* Prevent iOS rubber-band overscroll from creating gap */
@supports (-webkit-touch-callout: none) {
  body { min-height: -webkit-fill-available; }
}
