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

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

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  font-weight: var(--fw-regular);
  color: var(--text-1);
  background: var(--bg-0);
  min-height: 100dvh;
  line-height: 1.45;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  /* prevent the rubber-band overscroll from revealing white */
  overscroll-behavior-y: none;
}

img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; background: none; border: none; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* numeric — tabular figures for money */
.num, .tnum {
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-variant-numeric: tabular-nums lining-nums;
}

/* Headings */
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.025em; font-weight: var(--fw-bold); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

.title-mix { display: inline-flex; gap: 0.35em; align-items: baseline; }
.title-mix .strong { font-weight: var(--fw-black); }
.title-mix .light { font-weight: var(--fw-light); color: var(--text-2); }

/* Text helpers */
.t-2 { color: var(--text-2); }
.t-3 { color: var(--text-3); }
.t-brand { color: var(--brand-300); }
.t-success { color: var(--success); }
.t-danger { color: var(--danger); }
.t-warning { color: var(--warning); }
.t-center { text-align: center; }
.t-right { text-align: right; }
.fw-medium { font-weight: var(--fw-medium); }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold { font-weight: var(--fw-bold); }
.fs-sm { font-size: 0.825rem; }
.fs-xs { font-size: 0.72rem; }
.fs-lg { font-size: 1.15rem; }
.uppercase { text-transform: uppercase; letter-spacing: 0.06em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Layout helpers */
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.gap-1 { gap: var(--s-1); } .gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); } .gap-5 { gap: var(--s-5); } .gap-6 { gap: var(--s-6); }
.grid { display: grid; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4); }
.flex-1 { flex: 1; }
.center { display: flex; align-items: center; justify-content: center; }
.wrap { flex-wrap: wrap; }
.mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); } .mt-5 { margin-top: var(--s-5); } .mt-6 { margin-top: var(--s-6); }
.mb-2 { margin-bottom: var(--s-2); } .mb-4 { margin-bottom: var(--s-4); }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Focus visibility for accessibility */
:focus-visible {
  outline: 2px solid var(--brand-300);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Custom scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--glass-border) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }

/* Selection */
::selection { background: var(--brand-500); color: #fff; }
