/* ==========================================================================
   Servitruck D&M SpA — base.css
   Tokens, reset, tipografía y utilidades.
   Dirección: "señalética de carretera nocturna".
   ========================================================================== */

:root {
  /* Paleta (derivada del logo) */
  --asfalto: #08121f;      /* secciones más profundas, hero, footer */
  --noche: #0d1b2e;        /* base dominante */
  --noche-2: #13253d;      /* superficies elevadas sobre fondo oscuro */
  --rojo: #d21f2c;         /* acento escaso: ruta, CTA principal, estado activo */
  --rojo-oscuro: #b01824;
  --acero: #8794a5;        /* texto secundario sobre oscuro */
  --acero-claro: #5a6778;  /* texto secundario sobre claro */
  --plata: #c8d0d9;        /* detalles, bordes, hitos */
  --blanco: #f3f5f8;       /* texto principal y secciones claras */
  --linea: rgba(200, 208, 217, 0.16);
  --linea-clara: rgba(13, 27, 46, 0.14);

  /* Tipografía */
  --f-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-texto: "Overpass", "Segoe UI", system-ui, sans-serif;

  /* Escala tipográfica (razón ~1.25, display fluido) */
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-base: 1.0625rem;
  --t-lg: 1.25rem;
  --t-xl: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  --t-h3: clamp(1.875rem, 1.4rem + 1.8vw, 2.75rem);
  --t-h2: clamp(2.75rem, 1.6rem + 4.6vw, 5.5rem);
  --t-h1: clamp(4.1rem, 1.2rem + 10.5vw, 11.5rem);

  /* Espaciado y layout */
  --track-x: clamp(20px, 2.8vw, 44px);          /* posición de la línea de ruta */
  --gutter: clamp(16px, 5vw, 80px);
  --max: 1280px;
  --sec-y: clamp(5rem, 3rem + 8vw, 10rem);
  --header-h: 84px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 900px) {
  :root {
    /* El contenido nunca pisa la línea de ruta ni sus hitos */
    --gutter: max(clamp(16px, 5vw, 80px), calc(var(--track-x) + 64px));
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--noche);
  color: var(--blanco);
  font-family: var(--f-texto);
  font-size: var(--t-base);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

/* ---------- Tipografía ---------- */
.display,
h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

h1 { font-size: var(--t-h1); font-weight: 900; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); line-height: 1; }

p { max-width: 62ch; text-wrap: pretty; }

.lead {
  font-size: var(--t-lg);
  line-height: 1.55;
  color: var(--plata);
  max-width: 52ch;
}

.muted { color: var(--acero); }

strong { font-weight: 700; }

/* ---------- Accesibilidad ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--blanco);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--rojo);
}
.seccion--clara :focus-visible { outline-color: var(--noche); }

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

.saltar {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--blanco);
  color: var(--noche);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s;
}
.saltar:focus-visible { transform: none; }

::selection { background: var(--rojo); color: #fff; }
