/* ============================================================
   BOOST LSAT — Base Styles
   "Warm Scholar" Design System

   Reset, defaults, focus rings, reduced motion, scrollbars,
   and utility classes shared across all surfaces.
   ============================================================ */

@import url('./boost-tokens.css');

/* ── Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Document ── */
html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--text-1);
  background-color: var(--surface-0);
  /* Slightly higher line-height for dark mode readability */
  transition: background-color var(--transition-normal),
              color var(--transition-normal);
}

/* Increase line-height slightly in dark mode per typography reference */
[data-theme="dark"] body {
  line-height: var(--leading-relaxed);
}

/* ── Headings ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-1);
}

h1 { font-size: var(--text-3xl); font-weight: var(--weight-extrabold); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
h5 { font-size: var(--text-base); font-weight: var(--weight-semibold); }
h6 { font-size: var(--text-sm); font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: var(--tracking-wider); }

/* ── Links ── */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--color-primary-hover);
}

/* ── Images ── */
img, svg {
  display: block;
  max-width: 100%;
}

/* ── Lists ── */
ul, ol {
  list-style: none;
}

/* ── Tables ── */
table {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

/* ── Form defaults ── */
input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

button,
a[class*="btn"] {
  cursor: pointer;
  border: none;
  background: none;
  flex-shrink: 0;
}

/* Global form field borders — uses --border-input for light-mode contrast */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
textarea,
select {
  border: 1px solid var(--border-input, var(--border-1));
}

/* ── Focus Rings ── */
/* Hide focus for mouse/touch, show for keyboard */
:focus {
  outline: none;
}

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

/* ── Scrollbar Styling ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-3);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}

/* ── Selection ── */
::selection {
  background: var(--color-primary-muted);
  color: var(--text-1);
}

/* ============================================================
   Reduced Motion
   Not optional — affects ~35% of adults over 40.
   ============================================================ */

@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;
  }
}

/* ============================================================
   Utility Classes
   ============================================================ */

/* Visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Tabular nums for data displays */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Mono font for IDs, codes, technical content */
.font-mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Truncate text with ellipsis */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
