/* ==========================================================================
   base.css  -  Reset, fuente, tipografia, foco, utilidades
   ========================================================================== */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  font: 400 1rem/1.6 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, figure, dl, dd, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { padding: 0; border: 0; min-width: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 0; }
h1[tabindex="-1"]:focus { outline: none; }

/* tipografia */
h1 {
  font-size: clamp(2.25rem, 5.2vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -.035em;
  font-weight: 700;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  letter-spacing: -.025em;
  font-weight: 650;
  text-wrap: balance;
}
h3, .h3 {
  font-size: 1.0625rem;
  line-height: 1.35;
  letter-spacing: -.01em;
  font-weight: 600;
}
.lead {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  color: var(--muted);
  max-width: 54ch;
  text-wrap: pretty;
}
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }

/* utilidades */
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 12px; top: -56px; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 8px 14px; border-radius: var(--r-md); font-weight: 550;
}
.skip:focus { top: 12px; }

/* transicion de tema: solo mientras dura el cambio (clase puesta por theme.js) */
.theme-anim, .theme-anim * {
  transition: background-color .18s, border-color .18s, color .18s, fill .18s, stroke .18s !important;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
