/* =========================================================================
   Base — reset acotado, tipografia y utilidades transversales
   ========================================================================= */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Evita que el nav fijo tape el titulo al saltar a una seccion */
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

img {
  height: auto;
}

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

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

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

:where(h1, h2, h3, h4) {
  font-weight: 400;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

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

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

/* Solo lo lee el lector de pantalla */
.u-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  translate: -50% -140%;
  z-index: 200;
  padding: 0.85rem 1.5rem;
  background: var(--gold);
  color: var(--ink);
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: translate var(--dur) var(--ease-out);
}

.skip-link:focus-visible {
  translate: -50% 0;
}

/* --- Tipografia de marca ------------------------------------------------ */

.t-display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-display);
  font-optical-sizing: auto;
}

.t-label {
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.4;
}

.t-lead {
  font-size: var(--t-lead);
  line-height: 1.58;
  color: var(--bone-dim);
  max-width: var(--max-text);
}

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

/* Filete dorado de 1px que separa bloques */
.rule {
  height: 1px;
  border: 0;
  background: var(--metal);
  opacity: 0.65;
}

/* --- Microanimacion de entrada ------------------------------------------
   El JS anade .is-in cuando el bloque entra en pantalla. Si el JS no llega a
   ejecutarse, .reveal nunca oculta nada: el contenido se ve igual.          */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    translate: 0 18px;
    transition:
      opacity var(--dur-slow) var(--ease-out),
      translate var(--dur-slow) var(--ease-out);
  }

  .js .reveal.is-in {
    opacity: 1;
    translate: 0 0;
  }

  /* Escalonado dentro de un mismo grupo */
  .js .reveal[data-delay="1"] { transition-delay: 90ms; }
  .js .reveal[data-delay="2"] { transition-delay: 180ms; }
  .js .reveal[data-delay="3"] { transition-delay: 270ms; }
  .js .reveal[data-delay="4"] { transition-delay: 360ms; }
}

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

/* Bloqueo del scroll de fondo mientras hay un panel o el visor abiertos.
   Lo gestiona assets/js/modules/scroll-lock.js. */
.is-locked,
.is-locked body {
  overflow: hidden;
}
