/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Fraunces:ital,wght@0,300;0,600;1,300&family=DM+Sans:wght@300;400;500&display=swap');

/* ── Variables ── */
:root {
  --sf-accent:       #16a34a;
  --sf-accent-lt:    #dcfce7;
  --sf-accent-bd:    #bbf7d0;
  --sf-purple:       #6d28d9;
  --sf-purple-lt:    #ede9fe;
  --sf-purple-bd:    #ddd6fe;
  --sf-warn:         #d97706;
  --sf-warn-lt:      #fef3c7;
  --sf-danger:       #dc2626;
  --sf-danger-lt:    #fee2e2;
  --sf-border:       #e2e8f0;
  --sf-border2:      #cbd5e1;
  --sf-surface:      #f8fafc;
  --sf-surface2:     #f1f5f9;
  --sf-text:         #0f172a;
  --sf-muted:        #64748b;
  --sf-code-bg:      #f8fafc;
}

/* ── Hide MkDocs article padding on homepage ── */
.md-content__inner { padding-top: 0 !important; }
.md-typeset h1:first-child { display: none; }

/* ── Hero ── */
.sf-hero {
  text-align: center;
  padding: 5rem 2rem 3rem;
  max-width: 760px;
  margin: 0 auto;
  animation: sfFadeUp 0.5s ease both;
}

.sf-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  background: var(--sf-accent-lt);
  color: var(--sf-accent);
  border: 1px solid var(--sf-accent-bd);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  margin-bottom: 1.75rem;
  letter-spacing: 0.05em;
}

.sf-h1 {
  font-family: 'Fraunces', serif !important;
  font-weight: 600 !important;
  font-size: clamp(2.2rem, 5vw, 3.2rem) !important;
  line-height: 1.15 !important;
  color: var(--sf-text) !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 1.2rem !important;
  border: none !important;
}
.sf-h1 em { font-style: italic; font-weight: 300; color: var(--sf-accent); }

.sf-sub {
  font-size: 1rem;
  color: var(--sf-muted);
  max-width: 540px;
  margin: 0 auto 2.25rem;
  font-weight: 300;
  line-height: 1.7;
}

.sf-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.sf-btn {
  display: inline-flex; align-items: center;
  padding: 0.65rem 1.4rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: all 0.2s;
}
.sf-btn-primary { background: var(--sf-accent); color: #fff !important; }
.sf-btn-primary:hover { background: #15803d; }
.sf-btn-ghost {
  background: transparent;
  color: var(--sf-text) !important;
  border: 1px solid var(--sf-border2);
}
.sf-btn-ghost:hover { background: var(--sf-surface); }

.sf-install {
  display: inline-flex; align-items: center; gap: 0.75rem;
  background: var(--sf-surface);
  border: 1px solid var(--sf-border);
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  margin-top: 1.75rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.875rem;
  color: var(--sf-accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.sf-install span { color: var(--sf-muted); }

/* ── Divider ── */
.sf-divider { border: none; border-top: 1px solid var(--sf-border); margin: 0; }

/* ── Sections ── */
.sf-section { max-width: 900px; margin: 0 auto; padding: 4rem 2rem; }

.sf-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--sf-accent);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.sf-h2 {
  font-family: 'Fraunces', serif !important;
  font-weight: 600 !important;
  font-size: clamp(1.5rem, 3vw, 2rem) !important;
  color: var(--sf-text) !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 0.85rem !important;
  border: none !important;
}

.sf-body { font-size: 0.95rem; color: var(--sf-muted); max-width: 620px; }

/* ── Compare grid ── */
.sf-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; max-width: 640px; margin-left: auto; margin-right: auto; }
@media (max-width: 640px) { .sf-compare { grid-template-columns: 1fr; } }


.sf-card { border-radius: 10px; padding: 1.4rem; border: 1px solid var(--sf-border); }
.sf-bad  { background: #fff5f5; border-color: #fecaca; }
.sf-good { background: #f0fdf4; border-color: var(--sf-accent-bd); }
.sf-card p { font-size: 0.85rem; color: var(--sf-muted); margin-bottom: 1rem; }

.sf-tag {
  display: inline-flex; align-items: center;
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.2rem 0.55rem; border-radius: 4px;
  margin-bottom: 0.85rem;
}
.sf-tag-bad  { background: var(--sf-danger-lt); color: var(--sf-danger); }
.sf-tag-good { background: var(--sf-accent-lt); color: var(--sf-accent); }

/* ── Code in custom blocks ── */
.sf-card pre, .sf-tab-pane pre {
  background: #fff !important;
  border: 1px solid var(--sf-border) !important;
  border-radius: 8px !important;
  padding: 1rem !important;
  font-family: 'IBM Plex Mono', monospace !important;
  font-size: 0.77rem !important;
  line-height: 1.7 !important;
  overflow-x: auto;
  margin: 0 !important;
}
.sf-bad pre  { border-color: #fecaca !important; }
.sf-good pre { border-color: var(--sf-accent-bd) !important; }
.cm { color: #94a3b8; font-style: italic; }
.kw { color: #7c3aed; }
.st { color: #16a34a; }
.nm { color: #d97706; }

/* ── Why cards ── */
.sf-why {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 1rem; margin-top: 2rem;
}
.sf-why-card {
  background: #fff; border: 1px solid var(--sf-border);
  border-radius: 10px; padding: 1.3rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.sf-why-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: var(--sf-border2); }
.sf-icon { font-size: 1.35rem; margin-bottom: 0.65rem; }
.sf-why-card h3 { font-size: 0.92rem; font-weight: 600; color: var(--sf-text); margin-bottom: 0.35rem; }
.sf-why-card p  { font-size: 0.82rem; color: var(--sf-muted); line-height: 1.6; margin: 0; }

/* ── Concepts ── */
.sf-concepts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem; margin-top: 2rem;
}
.sf-concept-card {
  background: #fff; border: 1px solid var(--sf-border);
  border-radius: 10px; padding: 1.3rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.sf-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.73rem; color: var(--sf-purple);
  background: var(--sf-purple-lt); border: 1px solid var(--sf-purple-bd);
  border-radius: 4px; padding: 0.2rem 0.5rem;
  display: inline-block; margin-bottom: 0.65rem;
}
.sf-concept-card h3 { font-size: 0.92rem; font-weight: 600; color: var(--sf-text); margin-bottom: 0.35rem; }
.sf-concept-card p  { font-size: 0.82rem; color: var(--sf-muted); line-height: 1.6; margin: 0; }

/* ── Tabs ── */
.sf-tabs { margin-top: 1.5rem; }
.sf-tab-btns { display: flex; gap: 0; margin-bottom: -1px; }
.sf-tab-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem; padding: 0.5rem 1rem;
  border: 1px solid var(--sf-border);
  background: var(--sf-surface2); color: var(--sf-muted);
  cursor: pointer; border-bottom: none;
  border-radius: 6px 6px 0 0;
  transition: all 0.15s;
}
.sf-tab-btn.active { background: #fff; color: var(--sf-accent); font-weight: 500; border-bottom: 1px solid #fff; }
.sf-tab-pane { display: none; }
.sf-tab-pane.active { display: block; }
.sf-tab-pane pre { border-radius: 0 8px 8px 8px !important; border-top-left-radius: 0 !important; }

/* ── Legend ── */
.sf-legend {
  margin-top: 1.5rem; background: var(--sf-surface);
  border: 1px solid var(--sf-border); border-radius: 10px; padding: 1.3rem;
}
.sf-legend h3 { font-size: 0.92rem; font-weight: 600; color: var(--sf-text); margin-bottom: 0.85rem; }
.sf-colname { display: flex; align-items: center; flex-wrap: wrap; margin-bottom: 0.65rem; font-family: 'IBM Plex Mono', monospace; }
.cn { padding: 0.2rem 0.45rem; border-radius: 4px; font-size: 0.77rem; }
.cn-sep   { color: var(--sf-muted); padding: 0 0.05rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.77rem; }
.cn-table { background: var(--sf-purple-lt); color: var(--sf-purple); }
.cn-col   { background: var(--sf-accent-lt); color: var(--sf-accent); }
.cn-agg   { background: var(--sf-warn-lt);   color: var(--sf-warn); }
.cn-win   { background: var(--sf-danger-lt); color: var(--sf-danger); }
.sf-legend-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.sf-chip { display: flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; color: var(--sf-muted); }
.dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ── FAQ ── */
.sf-faq { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 1.75rem; }
.sf-faq-item {
  background: #fff; border: 1px solid var(--sf-border);
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.sf-faq-q {
  padding: 0.9rem 1.1rem; font-weight: 500;
  font-size: 0.88rem; color: var(--sf-text);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  user-select: none;
}
.sf-faq-q:hover { background: var(--sf-surface); }
.sf-arrow { color: var(--sf-muted); transition: transform 0.2s; font-style: normal; }
.sf-faq-a {
  display: none; padding: 0.85rem 1.1rem;
  font-size: 0.85rem; color: var(--sf-muted); line-height: 1.7;
  border-top: 1px solid var(--sf-border);
}
.sf-faq-item.open .sf-faq-a { display: block; }
.sf-faq-item.open .sf-arrow { transform: rotate(180deg); }

/* ── Animation ── */
@keyframes sfFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}