/* ==========================================================================
 * 02-base.css — @font-face, reset, element defaults
 * --------------------------------------------------------------------------
 * LOADED BY  : src/templates/base.html, every page (2nd of six core files).
 * DEPENDS ON : 01-tokens.css (--ax-* custom properties).
 * OWNS       : @font-face, box-sizing reset, html/body/typography element
 *              defaults, focus ring, selection, scrollbar, motion guard.
 * RULE       : element/type selectors only — no .class selectors here.
 * ========================================================================== */


@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/InterVariable.woff2') format('woff2');
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--ax-bg);
  background-image: var(--ax-bg-wash);
  background-attachment: fixed;
  color: var(--ax-text);
  font-family: var(--ax-font-sans);
  font-size: var(--ax-text-base);
  line-height: var(--ax-leading);
  -webkit-font-smoothing: antialiased;
}

/* base.html's navbar is `position: fixed`, so it's removed from normal flow
   and would otherwise overlap whatever renders first inside <main>. This is
   the single source of truth for clearing it — every page gets it by
   default, with no per-page spacer div or hardcoded margin-top to keep in
   sync. `body > main` (not a bare `main` selector) deliberately targets only
   base.html's own <main> — some page content nests a second, invalid <main>
   inside it, and this must not double up on that one. */
body > main {
  padding-top: var(--ax-navbar-h);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ax-font-sans);
  font-weight: var(--ax-weight-bold);
  line-height: var(--ax-leading-tight);
  color: var(--ax-text);
  margin: 0 0 var(--ax-space-3);
}

p {
  margin: 0 0 var(--ax-space-4);
}

small {
  font-size: var(--ax-text-sm);
}

a {
  color: var(--ax-primary-text);
  text-decoration: none;
}

a:hover {
  color: var(--ax-primary-hover);
}

.text-muted {
  color: var(--ax-text-muted) !important;
}

img, svg {
  max-inline-size: 100%;
}

hr {
  border: none;
  border-top: 1px solid var(--ax-border);
  margin: var(--ax-space-4) 0;
}

::selection {
  background: var(--ax-primary-subtle);
  color: var(--ax-text);
}

:focus-visible {
  outline: 2px solid var(--ax-primary);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--ax-surface-1);
}
::-webkit-scrollbar-thumb {
  background: var(--ax-border-strong);
  border-radius: var(--ax-radius-pill);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
