/* ==========================================================================
   Base — reset, document defaults, typography primitives, utilities.
   ========================================================================== */

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

* { margin: 0; }

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

body {
  min-height: 100dvh;
  background: var(--bg);
  background-image: var(--bg-tint);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

img, svg, video { display: block; max-width: 100%; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

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

a { color: var(--brand-500); text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }

ul, ol { list-style: none; padding: 0; }

:focus-visible {
  outline: 3px solid var(--brand-300);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: var(--brand-100); color: var(--brand-700); }

/* --- Utilities ----------------------------------------------------------- */
.stack   { display: flex; flex-direction: column; gap: var(--sp-3); }
.stack-4 { display: flex; flex-direction: column; gap: var(--sp-4); }
.stack-2 { display: flex; flex-direction: column; gap: var(--sp-2); }
.row     { display: flex; align-items: center; gap: var(--sp-3); }
.row-tight { display: flex; align-items: center; gap: var(--sp-2); }
.wrap    { flex-wrap: wrap; }
.grow    { flex: 1 1 auto; min-width: 0; }
.between { justify-content: space-between; }
.center  { justify-content: center; }
.text-center { text-align: center; }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.tiny  { font-size: var(--fs-xs); }
.small { font-size: var(--fs-sm); }
.bold  { font-weight: var(--fw-bold); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

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

.hidden { display: none !important; }

/* --- Motion -------------------------------------------------------------- */
@keyframes pop-in   { from { opacity: 0; transform: scale(.94) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slide-up { from { transform: translateY(100%); }                       to { transform: none; } }
@keyframes fade-in  { from { opacity: 0; }                                        to { opacity: 1; } }
@keyframes wiggle   { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
@keyframes rise     { from { opacity: 0; transform: translateY(10px); }           to { opacity: 1; transform: none; } }

.animate-rise { animation: rise var(--dur) var(--ease) both; }

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