/* ============================================================
   base.css — reset, typography, focus, scrollbars
   ============================================================ */

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

html{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body{ min-height: 100%; }

body{
  margin: 0;
  font-family: var(--bd-font-sans);
  font-size: var(--bd-font-md);
  line-height: var(--bd-line-normal);
  background:
    radial-gradient(120% 80% at 10% -10%, var(--bd-hero-glow, transparent), transparent 55%),
    radial-gradient(90% 60% at 100% 0%, var(--bd-hero-rose, transparent), transparent 50%),
    var(--bd-bg);
  color: var(--bd-text);
  /* A wide table anywhere must not drag the whole page sideways. */
  overflow-x: hidden;
}

/* Set while a full-screen overlay is open so the page behind cannot scroll. */
body.bd-scroll-lock{ overflow: hidden; }

img, svg, video{ max-width: 100%; height: auto; }

a{ color: var(--bd-accent-text); text-decoration: none; }
a:hover{ color: var(--bd-accent-hover); }

/* --- Headings ------------------------------------------------ */
h1, h2, h3, h4, h5, h6{
  margin: 0 0 var(--bd-space-3) 0;
  color: var(--bd-text-strong);
  font-weight: 650;
  line-height: var(--bd-line-tight);
  letter-spacing: -0.01em;
}
h1{ font-size: var(--bd-font-2xl); }
h2{ font-size: var(--bd-font-xl); }
h3{ font-size: var(--bd-font-lg); }
h4, h5, h6{ font-size: var(--bd-font-md); }

p{ margin: 0 0 var(--bd-space-3) 0; }
p:last-child{ margin-bottom: 0; }

hr{
  border: 0;
  border-top: var(--bd-border-w-1) solid var(--bd-border);
  opacity: 1;
  margin: var(--bd-space-4) 0;
}

/* --- Text helpers ------------------------------------------- */
small, .small{ font-size: var(--bd-font-sm); }
.text-muted, .text-secondary{ color: var(--bd-muted); }
.bd-faint{ color: var(--bd-faint); }
.bd-mono{ font-family: var(--bd-font-mono); }

strong, b{ font-weight: 650; }

/* --- Focus (keyboard only) ---------------------------------- */
:focus{ outline: none; }
:focus-visible{
  outline: var(--bd-border-w-2) solid var(--bd-accent);
  outline-offset: 2px;
  border-radius: var(--bd-radius-1);
}

/* --- Selection ---------------------------------------------- */
::selection{
  background: rgba(var(--bd-accent-rgb), .28);
  color: var(--bd-text-strong);
}

/* --- Scrollbars --------------------------------------------- */
*{ scrollbar-width: thin; scrollbar-color: var(--bd-border-strong) transparent; }
*::-webkit-scrollbar{ width: 10px; height: 10px; }
*::-webkit-scrollbar-track{ background: transparent; }
*::-webkit-scrollbar-thumb{
  background: var(--bd-border-strong);
  border-radius: var(--bd-radius-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover{ background-clip: padding-box; }

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