/* Base: reset, tipografía y layout. Se carga después de tokens.css. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--c-night);
  color: var(--c-text);
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: var(--w-regular);
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.02;
  font-weight: var(--w-extra);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: var(--w-bold);
}

a {
  color: inherit;
}

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

::selection {
  background: var(--c-magenta);
  color: var(--c-text);
}

:focus-visible {
  outline: 3px solid var(--c-yellow);
  outline-offset: 3px;
}

/* Layout */
.page {
  position: relative;
  overflow: clip;
}

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

.section {
  position: relative;
  padding-block: var(--space-5);
}

/* Texto "lead" de las portadas: liviano con frases en negrita */
.lead {
  font-size: var(--fs-md);
  font-weight: var(--w-light);
  line-height: 1.5;
  max-width: 34ch;
}

.lead strong {
  font-weight: var(--w-bold);
}

.tracked {
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  font-weight: var(--w-bold);
}

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 0.75rem 1.25rem;
  background: var(--c-text);
  color: var(--c-night);
  font-weight: var(--w-bold);
  border-radius: var(--r-pill);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* Aparición al hacer scroll (la clase .js la pone el script; sin JS todo se ve) */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    transition-delay: calc(var(--i, 0) * 90ms);
  }

  .js .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
