/* ==========================================================================
   NIVRAIT — base: tokens, reset, tipografía, accesibilidad
   ========================================================================== */

:root {
  /* Paleta de marca (sin cambios) */
  --black: #111111;
  --yellow: #FFD84D;
  --cream: #F2EFEA;
  --gray: #7A7A7A;
  --white: #FFFFFF;

  /* Alias semánticos — misma paleta, uso disciplinado */
  --ink: var(--black);
  --ink-soft: #2C2C2C;
  /* Tono del gris de marca ajustado a 5.5:1 sobre crema — AA para texto pequeño */
  --muted: #5F5F5F;
  --bg: var(--cream);
  --surface: var(--white);
  --accent: var(--yellow);
  --line: rgba(17, 17, 17, 0.12);
  --line-strong: rgba(17, 17, 17, 0.26);
  /* Bordes de controles interactivos. WCAG 1.4.11 pide 3:1 para que el límite
     del control sea perceptible; los tonos decorativos de arriba no llegan. */
  --line-field: rgba(17, 17, 17, 0.5);
  --line-control-dark: rgba(242, 239, 234, 0.42);

  /* Superficie oscura */
  --bg-dark: #111111;
  --ink-dark: #F2EFEA;
  --muted-dark: #9A9A9A;
  --line-dark: rgba(242, 239, 234, 0.14);

  --font-serif: "DM Serif Display", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Roboto Mono", Menlo, Consolas, monospace;

  /* Escala de espaciado */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  --max-width: 1200px;
  --radius: 3px;
  --header-h: 68px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 140ms;
  --t-base: 220ms;
  --t-slow: 520ms;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  /* En % y no en px: fijar el tamaño en píxeles ignora la preferencia de
     tamaño de letra que el usuario tenga puesta en su navegador. */
  font-size: 100%;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.25rem, 5.6vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3.8vw, 2.75rem); }
h3 { font-size: 1.2rem; }

strong { font-weight: 600; }

.lead {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: var(--ink-soft);
  max-width: 62ch;
}

/* Etiqueta monoespaciada — ADN visual de la marca */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: var(--s-3);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Accesibilidad */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--white);
  padding: 12px 20px;
  z-index: 400;
}
.skip-link:focus { left: 16px; top: 16px; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.on-dark :focus-visible,
.section-dark :focus-visible { outline-color: var(--accent); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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