/* ============================================================
   SettlementRadar — Global Styles (Task #1308675)
   CSS Reset + Base Typography + Selection + Scrollbar

   Loaded AFTER design-tokens.css, BEFORE components.css.
   ============================================================ */

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

/* Remove default margins */
body,
h1, h2, h3, h4, h5, h6,
p,
figure,
blockquote,
dl, dd {
  margin: 0;
}

/* Remove list styles on ul, ol with role="list" */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Smooth scrolling for whole page */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  tab-size: 4;
  font-feature-settings: normal;
  font-variation-settings: normal;
}

/* ── Body ────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--weight-extrabold);
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
}

h3 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
}

h4 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
}

h5 {
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
}

h6 {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
}

p {
  line-height: var(--leading-relaxed);
  color: var(--color-text-body);
}

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

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

/* ── Images & Media ──────────────────────────────────────── */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── Forms ────────────────────────────────────────────────── */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

/* ── Tables ──────────────────────────────────────────────── */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ── Misc ────────────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

strong, b {
  font-weight: var(--weight-semibold);
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

code {
  background: var(--color-bg-muted);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
}

pre {
  overflow-x: auto;
  padding: var(--space-6);
  background: var(--color-bg-muted);
  border-radius: var(--radius-md);
}

pre code {
  background: none;
  padding: 0;
}

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

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

::-moz-selection {
  background-color: var(--color-gold-light);
  color: var(--color-text-primary);
}

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

::-webkit-scrollbar-track {
  background: var(--color-bg-subtle);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg-subtle);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) var(--color-bg-subtle);
}

/* ── Focus Styles ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ── 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;
  }
}

/* ── Number Typography (monospace for data) ──────────────── */
.sr-mono,
.sr-number,
[data-number] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ── Text Utilities ──────────────────────────────────────── */
.sr-text-balance {
  text-wrap: balance;
}

.sr-text-pretty {
  text-wrap: pretty;
}

.sr-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-line-clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.sr-line-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
