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

/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
  --bg:        #070d1b;
  --surface:   rgba(255,255,255,0.04);
  --surface-h: rgba(255,255,255,0.07);
  --border:    rgba(255,255,255,0.08);
  --border-h:  rgba(255,255,255,0.15);
  --text:      #e8edf5;
  --muted:     #7a8ba3;
  --accent:    #5b9cf6;
  --accent-bg: rgba(91,156,246,0.12);
  --green:     #4ade80;
  --green-bg:  rgba(74,222,128,0.12);
  --red:       #f87171;
  --glow:      rgba(91,156,246,0.06);
  --bg-grad1:  rgba(59,130,246,0.07);
  --bg-grad2:  rgba(139,92,246,0.05);
  --content-w: min(66vw, 1080px);
}
@media (max-width: 640px) { :root { --content-w: calc(100vw - 2.5rem); } }
@media (prefers-color-scheme: light) {
  :root {
    --bg:        #f0f4f8;
    --surface:   #ffffff;
    --surface-h: #f8fafc;
    --border:    rgba(0,0,0,0.09);
    --border-h:  rgba(0,0,0,0.16);
    --text:      #0f172a;
    --muted:     #64748b;
    --accent:    #2563eb;
    --accent-bg: rgba(37,99,235,0.09);
    --green:     #16a34a;
    --green-bg:  rgba(22,163,74,0.09);
    --red:       #dc2626;
    --glow:      rgba(37,99,235,0.04);
    --bg-grad1:  rgba(59,130,246,0.06);
    --bg-grad2:  rgba(139,92,246,0.04);
  }
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 40%, var(--bg-grad1) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 15%, var(--bg-grad2) 0%, transparent 60%);
}

/* ── Site header ──────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50; width: 100%;
  background: rgba(5,11,22,0.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 1px 16px rgba(0,0,0,0.5);
}
@media (prefers-color-scheme: light) {
  .site-header {
    background: rgba(245,248,252,0.97);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 1px 8px rgba(0,0,0,0.08);
  }
}

.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
  height: 3.25rem; display: flex; align-items: center; gap: 0.125rem;
}
.header-logo {
  display: flex; align-items: center; text-decoration: none;
  margin-right: auto; flex-shrink: 0;
}
.header-logo img {
  height: 1.5rem; width: auto; border-radius: 0.375rem;
  padding: 0.2rem 0.5rem;
  background: rgba(255,255,255,1);
  border: 1px solid rgba(255,255,255,0.12);
}
@media (prefers-color-scheme: light) {
  .header-logo img { background: transparent; border: none; padding: 0; }
}

.nav-link {
  padding: 0.35rem 0.625rem; border-radius: 0.4rem;
  font-size: 0.8125rem; font-weight: 500; color: var(--muted);
  text-decoration: none; transition: color 0.15s, background 0.15s; white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--surface-h); }
.nav-link.active { color: var(--text); }

.hdr-sep { width: 1px; height: 1.125rem; background: var(--border); margin: 0 0.375rem; flex-shrink: 0; }

.lang-btn {
  padding: 0.25rem 0.45rem; border-radius: 0.3rem;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.05em;
  cursor: pointer; border: 1px solid transparent;
  color: var(--muted); background: transparent; transition: all 0.15s;
}
.lang-btn:hover { color: var(--text); background: var(--surface-h); }
.lang-btn.active { background: var(--accent-bg); border-color: rgba(91,156,246,0.3); color: var(--accent); }
@media (prefers-color-scheme: light) { .lang-btn.active { border-color: rgba(37,99,235,0.25); } }

@media (max-width: 500px) {
  .nav-link { font-size: 0.75rem; padding: 0.3rem 0.4rem; }
  .header-inner { gap: 0; }
}

/* ── Page wrapper (inner pages) ───────────────────────────────────────────── */
.wrap {
  position: relative; z-index: 1;
  width: var(--content-w); margin: 0 auto;
  padding: 2rem 0 4rem;
}

/* ── Back link ────────────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--muted); font-size: 0.8rem; text-decoration: none;
  margin-bottom: 2rem; transition: color 0.15s;
}
.back-link:hover { color: var(--accent); }

/* ── Page heading ─────────────────────────────────────────────────────────── */
h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.4rem; line-height: 1.3; }
.subtitle, .updated { color: var(--muted); font-size: 0.875rem; margin-bottom: 2.5rem; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
}
.card h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--accent); }
.card p { color: var(--muted); margin-bottom: 0.75rem; line-height: 1.7; }
.card p:last-child { margin-bottom: 0; }
.card ul, .card ol { color: var(--muted); padding-left: 1.25rem; margin-bottom: 0.75rem; line-height: 1.7; }
.card ul:last-child, .card ol:last-child { margin-bottom: 0; }
.card li { margin-bottom: 0.4rem; }
.card a { color: var(--accent); text-decoration: none; }
.card a:hover { text-decoration: underline; }

/* ── Highlight block ──────────────────────────────────────────────────────── */
.highlight {
  background: var(--bg); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 0.875rem 1.25rem; margin: 0.75rem 0;
  font-size: 0.875rem; color: var(--muted); white-space: pre-line;
}

/* ── Article meta ─────────────────────────────────────────────────────────── */
.article-tag { font-size: 0.625rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; }
h1.article-title { font-size: 1.75rem; }
.article-meta { display: flex; gap: 1rem; color: var(--muted); font-size: 0.75rem; margin-bottom: 2.5rem; }

/* ── Article nav (prev/next) ──────────────────────────────────────────────── */
.nav-articles { display: flex; gap: 0.75rem; margin-top: 2rem; flex-wrap: wrap; }
.nav-article-link {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 0.625rem; padding: 0.75rem 1rem;
  font-size: 0.8125rem; color: var(--muted); text-decoration: none;
  flex: 1; min-width: 180px; transition: border-color 0.15s, color 0.15s;
}
.nav-article-link:hover { border-color: var(--accent); color: var(--accent); }
.nav-label { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 0.25rem; }

/* ── Site footer ──────────────────────────────────────────────────────────── */
.site-footer {
  position: relative; z-index: 1;
  text-align: center; padding: 2rem 1.25rem 1.5rem;
  color: var(--muted); font-size: 0.75rem; line-height: 2;
}
.site-footer a { color: var(--muted); text-decoration: underline; margin: 0 0.35rem; }
.site-footer a:hover { color: var(--text); }

/* ── Shimmer ──────────────────────────────────────────────────────────────── */
@keyframes shimmer {
  0%, 100% { opacity: 0.35; }
  50%       { opacity: 0.75; }
}

/* ── About: feature grid ──────────────────────────────────────────────────── */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.feature-item { background: var(--bg); border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.875rem 1rem; }
.feature-icon { font-size: 1.25rem; display: block; margin-bottom: 0.4rem; }
.feature-name { font-size: 0.8125rem; font-weight: 600; color: var(--text); }
.feature-desc { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }

/* ── Contact: email block & topics ───────────────────────────────────────── */
.email-block { display: flex; align-items: center; gap: 0.875rem; background: var(--bg); border: 1px solid var(--border); border-radius: 0.625rem; padding: 1rem 1.25rem; margin-top: 0.875rem; }
.email-icon { font-size: 1.5rem; flex-shrink: 0; }
.email-address { font-size: 1rem; font-weight: 600; color: var(--accent); }
.email-address a { color: var(--accent); text-decoration: none; }
.email-address a:hover { text-decoration: underline; }
.email-note { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.topics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.5rem; margin-top: 0.75rem; }
.topic-item { display: flex; align-items: flex-start; gap: 0.5rem; background: var(--bg); border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.625rem 0.875rem; font-size: 0.8125rem; color: var(--muted); }
.topic-item::before { content: '·'; color: var(--accent); font-weight: 700; flex-shrink: 0; }

/* ── Blog: articles grid ──────────────────────────────────────────────────── */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-top: 1rem; }
.article-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0.875rem; padding: 1.5rem; text-decoration: none; color: inherit; transition: background 0.15s, border-color 0.15s; display: flex; flex-direction: column; gap: 0.5rem; }
.article-card:hover { background: var(--surface-h); border-color: var(--border-h); }
.article-title { font-size: 1rem; font-weight: 700; line-height: 1.4; color: var(--text); }
.article-desc { font-size: 0.8125rem; color: var(--muted); line-height: 1.55; flex: 1; }

/* ── Blog articles: content components ───────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.75rem; }
@media (max-width: 480px) { .two-col { grid-template-columns: 1fr; } }
.col-card { background: var(--bg); border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.875rem 1rem; }
.col-title { font-size: 0.75rem; font-weight: 700; color: var(--text); margin-bottom: 0.4rem; }
.col-body { font-size: 0.8rem; color: var(--muted); }

.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.75rem; }
@media (max-width: 480px) { .compare-grid { grid-template-columns: 1fr; } }
.compare-card { background: var(--bg); border: 1px solid var(--border); border-radius: 0.5rem; padding: 1rem; }
.compare-head { font-size: 0.875rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.compare-item { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.3rem; }

.types-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.type-card { background: var(--bg); border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.875rem 1rem; }
.type-name { font-size: 0.8125rem; font-weight: 700; color: var(--text); margin-bottom: 0.3rem; }
.type-desc { font-size: 0.775rem; color: var(--muted); }

.accuracy-table { width: 100%; border-collapse: collapse; margin-top: 0.75rem; font-size: 0.8125rem; }
.accuracy-table th { text-align: left; padding: 0.5rem 0.75rem; color: var(--accent); font-weight: 600; border-bottom: 1px solid var(--border); }
.accuracy-table td { padding: 0.5rem 0.75rem; color: var(--muted); border-bottom: 1px solid var(--border); }
.accuracy-table tr:last-child td { border-bottom: none; }

code { background: var(--bg); border: 1px solid var(--border); border-radius: 0.3rem; padding: 0.1em 0.4em; font-family: 'SF Mono', 'Fira Mono', monospace; font-size: 0.875em; color: var(--accent); }
