/* Revor — Base */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* El header es sticky: sin esto los anclajes quedan tapados. */
  scroll-padding-top: calc(var(--header-height) + var(--space-6));
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-variation-settings: var(--font-variation);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

:where(ul[class], ol[class]) {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

button {
  cursor: pointer;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* Tipografía */
h1, h2, h3, h4 {
  color: var(--color-heading);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: var(--text-h2);
  letter-spacing: var(--tracking-tight);
}

h3 {
  font-size: var(--text-h3);
}

h4 {
  font-size: var(--text-h4);
  font-weight: var(--weight-bold);
}

p {
  text-wrap: pretty;
}

a {
  color: var(--color-link);
  text-underline-offset: 0.2em;
  transition: color var(--duration-fast) var(--ease);
}

a:hover {
  color: var(--color-link-hover);
}

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

small {
  font-size: var(--text-sm);
}

.eyebrow {
  display: block;
  margin-block-end: var(--space-3);
  color: var(--color-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
}

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

:focus:not(:focus-visible) {
  outline: none;
}

/* Primitivas de maquetación */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: calc(var(--container-narrow) + var(--gutter) * 2);
}

.section {
  position: relative;
  padding-block: var(--section-y);
  isolation: isolate;
}

.section--flush {
  padding-block: 0;
}

.section--brand {
  background-color: var(--color-bg-brand);
  color: var(--color-text-invert);
}

.section--deep {
  background-color: var(--color-bg-deep);
  color: var(--color-text-invert);
}

.section--subtle {
  background-color: var(--color-bg-subtle);
}

.on-dark,
.section--brand,
.section--deep {
  color: var(--color-text-invert);
}

.on-dark :is(h1, h2, h3, h4),
.section--brand :is(h1, h2, h3, h4),
.section--deep :is(h1, h2, h3, h4) {
  color: var(--color-text-invert);
}

.on-dark .eyebrow,
.section--brand .eyebrow,
.section--deep .eyebrow {
  color: var(--primary-200);
}

.on-dark .lead,
.section--brand .lead,
.section--deep .lead {
  color: var(--primary-50);
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-6);
  margin-block-end: var(--space-10);
}

.section__title {
  max-width: 22ch;
}

.section__intro {
  max-width: 62ch;
  margin-block-start: var(--space-4);
}

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }

.grid--4 { grid-template-columns: 1fr; }

@media (min-width: 40rem) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 64rem) {
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* Dos columnas asimétricas (texto + media), como en "Más de 50 años…". */
.split {
  display: grid;
  gap: clamp(var(--space-8), 4vw, var(--space-16));
  align-items: center;
}

@media (min-width: 56rem) {
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .split--media-first > :first-child { order: -1; }
}

.stack > * + * {
  margin-block-start: var(--flow, var(--space-4));
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* Accesibilidad */
.screen-reader-text,
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: var(--z-overlay);
  padding: var(--space-3) var(--space-5);
  background-color: var(--color-bg);
  color: var(--color-link);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(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;
  }
}
