/* ==========================================================================
   BAUFELD · Base / reset / layout primitives
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* El nav es fixed: compensamos los anclajes internos. */
  scroll-padding-top: calc(var(--nav-h) + var(--nav-top) * 2);
}

body {
  min-height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body-l);
  line-height: var(--lh-body);
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body.is-locked { overflow: hidden; }

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

img,
video { height: auto; }

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

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

a { color: inherit; text-decoration: none; }

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

/* --- Tipografía ----------------------------------------------------------- */

.u-display,
.u-h1,
.u-h2,
.u-h3,
.u-h4 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text-heading);
  text-wrap: balance;
}

.u-display {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  text-transform: uppercase;
}

.u-h1 { font-size: var(--fs-h1); line-height: var(--lh-heading); }
.u-h2 { font-size: var(--fs-h2); line-height: var(--lh-heading); }
.u-h3 { font-size: var(--fs-h3); line-height: var(--lh-heading); }
.u-h4 { font-size: var(--fs-h4); line-height: 1.1; }

/* Special Gothic Expanded es muy ancha: "INFRAESTRUCTURA" mide ~11.8em, así que
   por debajo de cierto ancho es la palabra —y no la escala del diseño— la que
   fija el tope de tamaño. `.u-fit-box` marca el contenedor que acota al titular
   y `.u-display--fit` toma el menor de los dos. A 1440px gana el valor del Figma. */
.u-fit-box { container-type: inline-size; }
.u-display--fit { font-size: min(var(--fs-display), 8.4cqi); }
.u-h1--fit { font-size: min(var(--fs-h1), 8.4cqi); }

.u-body {
  font-size: var(--fs-body-l);
  line-height: var(--lh-body);
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* --- Layout --------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --- Accesibilidad -------------------------------------------------------- */

.u-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.u-skip-link {
  position: absolute;
  top: 0; left: 50%;
  translate: -50% -120%;
  z-index: 1000;
  padding: 12px 18px;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  background: var(--accent);
  color: var(--black-900);
  font-weight: 500;
  transition: translate var(--dur-fast) var(--ease-out);
}
.u-skip-link:focus-visible { translate: -50% 0; }

:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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