/* ==========================================================================
   main.css — global base styles, typography and utilities
   ========================================================================== */
html { -webkit-text-size-adjust: 100%; }
/* Prevent the browser's scroll-anchoring from nudging the page down as fonts, charts and
   async content finish sizing after navigation — this is what made pages look pre-scrolled. */
html, body { overflow-anchor: none; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--bg);
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-2);
  line-height: 1.55;
}
/* Hide authenticated pages until the shell has rendered (avoids flash) */
html:not([data-access="public"]):not([data-access="index"]) body:not(.ready) { visibility: hidden; }

h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
.text-muted, .text-secondary { color: var(--muted) !important; }
.text-primary { color: var(--primary) !important; }
.fw-600 { font-weight: 600; }
.fs-xs { font-size: var(--fs-xs); }
.fs-sm { font-size: var(--fs-sm); }
.cursor-pointer { cursor: pointer; }
.min-w-0 { min-width: 0; }
.nowrap { white-space: nowrap; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--primary-soft); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 8px; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 3000;
  background: var(--primary); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { left: 8px; color: #fff; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
