/* ── LK Forge family base — tokens + header + nav + footer ───────────
   Cool-light brand palette shared across every lkforge tool. The
   Earthquakes suite brand accent is seismic red; the tracker/reference
   pages can re-tint via body[data-tool] in earthquakes.css. Orbitron
   (display) + Outfit (body) + JetBrains Mono (numerics). */
:root {
  --bg:        #f5f7ff;
  --surface:   #ffffff;
  --surface2:  #eceeff;
  --border:    #cdd1f0;
  --border-control: #7a7fb5; /* 3:1+ on all surfaces - WCAG 1.4.11 for controls */
  --text:      #0f0f2e;
  --muted:     #515180;
  /* Suite brand accent (seismic red) — used on the hub + favicon/og.
     Tool pages may override these via body[data-tool] in earthquakes.css. */
  --accent:    #dc2626;
  --accent-h:  #b91c1c;
  --accent-bg: #fee2e2;
  --accent-fg: #991b1b;
  --ring:      220,38,38;
  --radius:    9px;
  --radius-lg: 14px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 20px rgba(0,0,0,.14);
  --mono:      'JetBrains Mono', 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Outfit', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Consistent keyboard focus indicator (WCAG 2.4.7) — accent has ≥3:1 vs every surface */
a:focus-visible, button:focus-visible, summary:focus-visible,
select:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px;
}

/* ── Header / nav ───────────────────────────────────────────────── */
.site-header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px; position: sticky; top: 0; z-index: 100;
}
.site-logo { font-size: 1.15rem; font-weight: 700; color: var(--text); letter-spacing: -.5px; text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  display: none; align-items: center; justify-content: center; min-width: 92px;
  font-size: .875rem; font-weight: 600; padding: 8px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  color: var(--text); background: transparent; text-decoration: none;
  transition: background .18s, border-color .18s, color .18s, transform .1s;
}
.nav-link:hover { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; transform: translateY(-1px); }
.nav-link:active { transform: scale(.97); }
.nav-link.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.nav-hamburger { display: flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--border); cursor: pointer; padding: 6px 12px; border-radius: var(--radius); font-size: .85rem; font-weight: 600; letter-spacing: .06em; color: var(--text); transition: background .2s; min-height: 44px; }
.nav-hamburger:hover { background: rgba(0,0,0,.07); }
.nav-mobile-menu { display: none; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px 14px; gap: 8px; }
.nav-mobile-menu.open { display: flex; }
.nav-mobile-link { display: block; text-align: center; text-decoration: none; font-size: 1rem; font-weight: 600; color: var(--text); background: var(--surface2); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 13px 16px; transition: background .18s, border-color .18s, color .18s; }
.nav-mobile-link:hover { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }
.nav-mobile-link.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Nav fits the tracker + reference + sections — hamburger up to 720px. */
@media (min-width: 720px) {
  .site-nav .nav-link { display: inline-flex; }
  .nav-hamburger { display: none; }
  .nav-mobile-menu { display: none !important; }
}

/* ── Footer ─────────────────────────────────────────────────────── */
footer.page-footer { border-top: 1px solid var(--border); padding: 24px 20px; text-align: center; font-size: .82rem; color: var(--muted); margin-top: 24px; }
footer.page-footer nav { margin-bottom: 6px; }
footer.page-footer nav a { color: var(--muted); }
footer.page-footer nav a:hover { color: var(--text); }

/* ── LK Forge brand: Orbitron display headings ──────────────────── */
.site-logo, .tool-hero h1, .hub-card h2, .section > h2 { font-family: 'Orbitron', sans-serif; }
.site-logo { font-weight: 900; }
.tool-hero h1 { font-weight: 900; font-size: clamp(1.4rem, 4.2vw, 2.05rem); letter-spacing: -.4px; line-height: 1.2; }
.hub-card h2, .section > h2 { font-weight: 700; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* print-friendly-standardized v1 */
@media print {
  .site-header, .site-nav, .nav-mobile-menu, .nav-hamburger,
  .calc-rail, .related-tool, .related-cluster, .related-tools,
  .page-footer, .site-footer, .action-row, .tool-actions,
  .seg-tabs, .st-modes, .mode-toggle, .mode-row, .chart-tip { display: none !important; }
  .calc-layout { display: block !important; }
  .calc-content { margin: 0 !important; padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; }
  .card { box-shadow: none !important; background: #fff !important; border-color: #999 !important; }
  a[href]:after { content: "" !important; }
  @page { margin: 1.5cm; }
}
/* ── Theme toggle button ─────────────────────────────────────────── */
.theme-toggle {
  flex-shrink: 0; margin-left: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  border: 1.5px solid var(--border-control); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  cursor: pointer; transition: background .2s, border-color .2s;
}
.theme-toggle:hover { background: var(--surface2); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Dark theme — opt-in via <html data-theme="dark"> (toggle in nav.js,
   persisted to localStorage; also settable with ?theme=dark). No
   prefers-color-scheme auto, so pages stay light unless the visitor opts in. ── */
[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #0b0e1a;
  --surface:   #151829;
  --surface2:  #1e2338;
  --border:    #2c3355;
  --border-control: #565f8c;
  --text:      #e9ebf8;
  --muted:     #9aa1cc;
  --shadow:    0 1px 3px rgba(0,0,0,.5), 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 6px 24px rgba(0,0,0,.6);
}
[data-theme="dark"] body[data-tool] {
  --accent-bg: color-mix(in srgb, var(--accent) 20%, #10131f);
  --accent-fg: color-mix(in srgb, var(--accent) 58%, #ffffff);
}
[data-theme="dark"] .nav-hamburger:hover { background: rgba(255,255,255,.08); }
/* Shared SVG world map (worldmap.js → .eq-map) + amber safety note. */
[data-theme="dark"] .eq-map .eq-land { fill: #262d4d; stroke: #343c66; }
[data-theme="dark"] .eq-map .eq-grid { stroke: #2b3358; }
[data-theme="dark"] .safety-note { background: #2a1a0c; border-color: #7c4a1e; }
[data-theme="dark"] .safety-note svg { stroke: #fdba74; }
[data-theme="dark"] .safety-note p { color: #fcd3ac; }
[data-theme="dark"] .safety-note a { color: #fdba74; }
