/* ===========================================================================
   base.css  ·  Reset suave, tipografía y estilos globales
   =========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--t-base), color var(--t-base);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.02;
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tighter);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); letter-spacing: var(--tracking-tight); }

p { line-height: 1.6; }

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color var(--t-fast), opacity var(--t-fast);
}

a:hover {
  text-decoration: underline;
}

img, svg, canvas {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-xs);
}

/* Scrollbar sobria y coherente con el tema */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--shadow-dark) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--shadow-dark);
  border: 2px solid var(--bg);
  border-radius: var(--r-pill);
}

/* Accesibilidad */
.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;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
