/* ──────────────────────────────────────────────────────────────────────────
   Metrixview shared theme — base reset, tokens, typography, layout primitives,
   buttons, badges, nav baseline, footer baseline, notice bar.
   Page-specific component CSS stays inline in each page's <style> block.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #0a0f1e;
  color: #e2e8f0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ── Tokens ── */
:root {
  --blue:    #3b82f6;
  --indigo:  #6366f1;
  --teal:    #14b8a6;
  --amber:   #f59e0b;
  --rose:    #f43f5e;
  --green:   #22c55e;
  --surface: #111827;
  --surface2:#1f2937;
  --border:  #1e293b;
  --muted:   #64748b;
  --text:    #e2e8f0;
  --heading: #f8fafc;
}

/* ── Typography ── */
h1, h2, h3, h4 { color: var(--heading); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p  { color: #94a3b8; }

/* ── Layout ── */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: 8px;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  border: none; transition: all .2s;
  text-align: center; white-space: nowrap;
}
.btn-primary {
  background: var(--blue); color: #fff;
  box-shadow: 0 0 24px rgba(59,130,246,.35);
}
.btn-primary:hover { background: #2563eb; box-shadow: 0 0 32px rgba(59,130,246,.5); }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-disabled {
  background: var(--surface2); color: var(--muted);
  border: 1px solid var(--border);
  cursor: not-allowed; pointer-events: none;
}
.btn-white { background: #fff; color: #1d4ed8; }
.btn-white:hover { background: #f0f9ff; }
.btn-outline-white { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.4); }
.btn-outline-white:hover { border-color: #fff; }

/* ── Badge ── */
.badge {
  display: inline-block; padding: 4px 14px; border-radius: 99px;
  font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.badge-blue   { background: rgba(59,130,246,.15);  color: var(--blue); }
.badge-teal   { background: rgba(20,184,166,.15);  color: var(--teal); }
.badge-indigo { background: rgba(99,102,241,.15);  color: var(--indigo); }
.badge-amber  { background: rgba(245,158,11,.15);  color: var(--amber); }
.badge-rose   { background: rgba(244,63,94,.15);   color: var(--rose); }
.badge-green  { background: rgba(34,197,94,.15);   color: var(--green); }
.badge-muted  { background: rgba(100,116,139,.15); color: var(--muted); }

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

/* ── NAV baseline ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,15,30,.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 700; color: var(--heading); }
.nav-logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a { font-size: .9rem; color: #94a3b8; transition: color .15s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-actions .btn { padding: 9px 20px; font-size: .9rem; }

/* ── FOOTER baseline ── */
footer { background: var(--surface); border-top: 1px solid var(--border); padding: 64px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand p { font-size: .88rem; color: var(--muted); margin-top: 12px; max-width: 260px; line-height: 1.65; }
.footer-col h4 { font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: .88rem; color: #64748b; transition: color .15s; }
.footer-links a:hover { color: var(--text); }
.footer-links li { font-size: .88rem; color: #64748b; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 28px; border-top: 1px solid var(--border); }
.footer-bottom p { font-size: .82rem; color: var(--muted); }
.footer-legal { display: flex; gap: 24px; }
.footer-legal a { font-size: .82rem; color: var(--muted); }
.footer-legal a:hover { color: var(--text); }
.footer-legal span { font-size: .82rem; color: var(--muted); }

/* ── Quick-definition passage (AI-citable explainer block) ── */
.passage {
  padding: 56px 0 48px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.passage .container { max-width: 880px; }
.passage .badge { margin-bottom: 16px; }
.passage h2 {
  margin-bottom: 16px;
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
}
.passage p {
  font-size: 1.02rem;
  line-height: 1.75;
}

/* ── Notice bar ── */
.notice-bar {
  background: rgba(59,130,246,.1); border-bottom: 1px solid rgba(59,130,246,.2);
  padding: 10px; text-align: center; font-size: .82rem; color: #93c5fd;
}
.notice-bar strong { color: var(--blue); }

/* ── Responsive baseline (mobile) ── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}

@media (max-width: 640px) {
  /* Nav: drop sticky on mobile so it can't overlap scrolled content */
  nav { position: static; }
  .nav-inner { gap: 10px; }
  .nav-logo { font-size: 1rem; }
  .nav-logo-icon { width: 28px; height: 28px; font-size: 14px; }
  .nav-actions { gap: 8px; }
  .nav-actions .btn {
    padding: 8px 12px;
    font-size: 0.78rem;
    white-space: nowrap;
  }
  .footer-legal {
    flex-wrap: wrap;
    gap: 12px 16px;
  }
  .footer-legal a,
  .footer-legal span { white-space: nowrap; }
}
