/* Klickify blog — tokens, navbar, buttons and footer mirror klickify_restore.html (homepage).
   Loaded as /blog/blog.css?v=N — bump N in klickify_auto_blog.py (CSS_V) after any change. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #0a0a0a;
  color: #fff;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

:root {
  --bg: #0a0a0a;
  --bg-alt: #050510;
  --cyan: #00E5FF;
  --purple: #9932CC;
  --muted: #a0a0a0;
  --border: rgba(255,255,255,0.08);
  --glass: rgba(255,255,255,0.04);
  --grad: linear-gradient(135deg, #00E5FF 0%, #9932CC 100%);
  --red: #ff4d4d;
}

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- NAVBAR (same as homepage) ---------- */
.navbar {
  position: relative;
  z-index: 100;
  padding: 16px 0;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.navbar.scrolled { border-bottom-color: var(--border); }
.nav-logo { display: flex; align-items: center; flex-shrink: 0; }
.nav-logo img { width: min(420px, 32vw); height: auto; border-radius: 8px; object-fit: contain; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a {
  font-size: 15px;
  font-weight: 600;
  color: #d6d6d6;
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover { color: var(--cyan); }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0;
  width: 0; height: 1px;
  background: var(--grad);
  transition: width 0.3s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--cyan); }
.nav-links a.active::after { width: 100%; }
.nav-links .btn { font-size: 14px; padding: 11px 22px; }
.nav-links .btn::after { display: none; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.3s ease;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary {
  background: var(--grad);
  color: #050510;
  box-shadow: 0 6px 24px -8px rgba(0, 229, 255, 0.5);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 36px -8px rgba(0, 229, 255, 0.65); }
.btn-secondary { background: transparent; border: 1px solid rgba(255,255,255,0.18); color: #fff; }
.btn-secondary:hover { border-color: var(--cyan); background: rgba(0,229,255,0.05); }

.mobile-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.mobile-toggle span { position: relative; width: 18px; height: 2px; background: #fff; transition: transform 0.25s ease, opacity 0.2s ease; }
.mobile-toggle span::before,
.mobile-toggle span::after { content: ''; position: absolute; left: 0; width: 18px; height: 2px; background: #fff; transition: transform 0.25s ease; }
.mobile-toggle span::before { top: -6px; }
.mobile-toggle span::after  { top: 6px; }
.mobile-toggle.open span { background: transparent; }
.mobile-toggle.open span::before { transform: translateY(6px) rotate(45deg); }
.mobile-toggle.open span::after  { transform: translateY(-6px) rotate(-45deg); }

/* ---------- BLOG INDEX ---------- */
.blog-hero { position: relative; padding: 56px 0 48px; text-align: center; }
.eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
}
.blog-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  text-wrap: balance;
}
.blog-hero p { font-size: 1.05rem; color: var(--muted); max-width: 640px; margin: 0 auto; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 24px;
  padding-bottom: 96px;
}
.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: transform 0.35s ease, border-color 0.3s ease;
}
.post-card:hover { transform: translateY(-4px); border-color: rgba(0,229,255,0.4); }
.post-card .tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
}
.post-card h2 { font-size: 1.25rem; line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.post-card h2 a { color: #fff; }
.post-card h2 a::after { content: ''; position: absolute; inset: 0; border-radius: 20px; }
.post-card p { color: var(--muted); font-size: 0.95rem; flex: 1; }
.post-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); }
.post-card .more { color: var(--cyan); font-weight: 600; }
.empty-state { text-align: center; color: var(--muted); padding: 40px 0 96px; }

/* ---------- ARTICLE ---------- */
.post-wrap { padding: 32px 0 96px; }
article.post { max-width: 760px; margin: 0 auto; padding: 0 24px; overflow-wrap: anywhere; }
.crumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 18px; }
.crumb a:hover { color: var(--cyan); }
.post-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 12px;
}
article.post h1 {
  font-size: clamp(1.9rem, 4.6vw, 2.9rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  text-wrap: balance;
}
.post-meta { color: var(--muted); font-size: 0.9rem; padding-bottom: 22px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.takeaway {
  padding: 18px 22px;
  border-left: 3px solid var(--cyan);
  background: rgba(0,229,255,0.06);
  border-radius: 0 12px 12px 0;
  margin-bottom: 28px;
  color: #ececec;
}
.takeaway strong { color: var(--cyan); }
article.post p.lede { font-size: 1.12rem; color: #e8e8e8; margin-bottom: 24px; }
article.post h2 { font-size: 1.55rem; font-weight: 800; line-height: 1.2; margin: 44px 0 14px; }
article.post h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 8px; }
article.post p { color: #d0d0d0; margin-bottom: 18px; font-size: 1.02rem; line-height: 1.75; }
article.post ul { margin: 0 0 20px 22px; color: #d0d0d0; }
article.post li { margin-bottom: 8px; line-height: 1.7; }
article.post code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 6px;
}
figure.codeblock { margin: 0 0 24px; }
figure.codeblock pre {
  background: #050510;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  max-width: 100%;
}
figure.codeblock pre code { background: none; padding: 0; font-size: 0.86rem; line-height: 1.6; white-space: pre; display: block; }
figure.codeblock figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 8px; }

.findings { margin: 8px 0 0; }
.finding {
  padding: 18px 22px;
  border-left: 3px solid var(--purple);
  background: var(--glass);
  border-radius: 0 12px 12px 0;
  margin-bottom: 14px;
}
.finding p { margin: 0 0 10px; font-size: 0.98rem; }
.finding p.finding-src { margin: 0; font-size: 0.85rem; color: var(--muted); }
.finding p.finding-src a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }

.faq { margin: 44px 0 0; }
.faq-item { padding: 18px 22px; border: 1px solid var(--border); border-radius: 14px; background: var(--glass); margin-bottom: 12px; }
.faq-item p { margin: 0; font-size: 0.98rem; }

.sources { margin-top: 40px; padding: 22px 24px; border: 1px solid var(--border); border-radius: 14px; }
.sources h2 { font-size: 1.1rem; margin: 0 0 12px; }
.sources ul { margin: 0 0 0 18px; }
.sources li { margin-bottom: 8px; font-size: 0.92rem; color: #c8c8c8; }
.sources a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }

.cta-box {
  margin-top: 44px;
  padding: 32px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(0,229,255,0.08), rgba(153,50,204,0.10));
  border: 1px solid rgba(0,229,255,0.25);
  text-align: center;
}
.cta-box h2 { margin: 0 0 10px; font-size: 1.4rem; }
.cta-box p { max-width: 520px; margin: 0 auto 20px; }

/* ---------- FOOTER (same as homepage) ---------- */
footer { background: #050510; border-top: 1px solid rgba(255,255,255,0.05); padding: 32px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-left img { width: auto; height: 26px; border-radius: 4px; }
.footer-copy { font-size: 13px; color: var(--muted); }
.footer-copy a { color: var(--muted); margin-left: 14px; transition: color 0.2s; }
.footer-copy a:hover { color: var(--cyan); }
.footer-nav { display: flex; gap: 24px; list-style: none; flex-wrap: wrap; }
.footer-nav a { font-size: 13px; color: var(--muted); transition: color 0.2s; }
.footer-nav a:hover { color: var(--cyan); }

/* ---------- RESPONSIVE ---------- */
/* Nav collapses at the same 1320px breakpoint as the homepage. */
@media (max-width: 1320px) {
  .nav-logo img { width: min(560px, 68vw); }
  .nav-links {
    position: fixed;
    top: 70px;
    left: 16px; right: 16px;
    flex-direction: column;
    gap: 0;
    background: rgba(10,10,15,0.96);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 14px 16px; border-radius: 10px; }
  .nav-links a:hover { background: rgba(255,255,255,0.04); }
  .nav-links a::after { display: none; }
  .nav-links .btn { margin-top: 6px; width: 100%; }
  .mobile-toggle { display: inline-flex; }
}
@media (max-width: 720px) {
  .container { padding: 0 20px; }
  .blog-hero { padding: 40px 0 32px; }
  article.post { padding: 0 20px; }
  .post-card { padding: 22px; }
  .cta-box { padding: 24px 20px; }
  .footer-inner { justify-content: center; text-align: center; }
  .footer-left { justify-content: center; }
  .footer-copy { width: 100%; text-align: center; }
  .footer-copy a { display: inline-block; margin: 0 8px; }
  .footer-nav { justify-content: center; }
}
