/*
 * Hidrocarburos del Norte — Base
 * Reset + tipografía + componentes globales.
 * Depende de tokens.css (cargar primero).
 * Regla de oro: ningún valor literal de color/tamaño/espacio. Siempre var(--token).
 */

/* ═══════════════════════════════════════════ RESET ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;              /* compensa el header fijo al saltar a un ancla */
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

img, video, svg { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

a { color: var(--accent-text); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent); }

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

/* ═══════════════════════════════════════════ CONTENEDOR ═══ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--section-padding-x);
}
.container--wide { max-width: 1240px; }

/* ═══════════════════════════════════════════ TIPOGRAFÍA ═══ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: .005em;
  text-wrap: balance;
  color: var(--text-primary);
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p { max-width: 68ch; }
p + p { margin-top: var(--space-4); }

.lead {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-loose);
  max-width: 60ch;
}

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: var(--space-3);
}

/* Encabezado de sección centrado reutilizable */
.section-head { max-width: 62ch; margin-inline: auto; text-align: center; margin-bottom: var(--space-12); }
.section-head h2 {
  font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1; text-transform: uppercase;
  letter-spacing: .01em;
}
.section-head .eyebrow { font-size: var(--text-sm); }
.section-head h2::after {
  content: ""; display: block; width: 64px; height: 4px; margin: var(--space-4) auto 0;
  background: var(--accent); border-radius: var(--radius-pill);
}
.section-head .lead { margin-inline: auto; margin-top: var(--space-5); }

/* ═══════════════════════════════════════════ SECCIONES ═══ */
.section { padding-block: var(--section-padding-y); }
.section--alt  { background-color: var(--bg-alt); }

.section--dark, .section--mid { color: var(--text-inverse); }
.section--dark { background-color: var(--surface-dark); }
.section--mid  { background-color: var(--surface-mid); }
.section--dark :is(h1,h2,h3,h4), .section--mid :is(h1,h2,h3,h4) { color: var(--text-inverse); }
.section--dark :is(.lead,p),     .section--mid :is(.lead,p)     { color: var(--text-inverse-muted); }
.section--dark .eyebrow,         .section--mid .eyebrow         { color: var(--accent); }

/* ═══════════════════════════════════════════ BOTONES ═══ */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm); font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  border-radius: var(--radius-md); border: 2px solid transparent;
  white-space: nowrap;
  transition: background-color var(--transition-fast), color var(--transition-fast),
              border-color var(--transition-fast), transform var(--transition-fast);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 1em; height: 1em; }

.btn--primary { background-color: var(--accent); color: var(--color-petroleum-800); border-color: var(--accent); }
.btn--primary:hover { background-color: var(--accent-hover); border-color: var(--accent-hover); color: var(--color-petroleum-800); }

.btn--outline { background-color: transparent; color: var(--accent-text); border-color: var(--accent); }
.btn--outline:hover { background-color: var(--accent); color: var(--color-petroleum-800); }

.btn--ghost { background-color: transparent; color: var(--text-inverse); border-color: rgba(255,255,255,.3); }
.btn--ghost:hover { background-color: rgba(255,255,255,.1); color: var(--text-inverse); }

.btn--lg { padding: var(--space-4) var(--space-8); font-size: var(--text-base); }

/* ═══════════════════════════════════════════ TARJETAS ═══ */
.card {
  background-color: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  transition: box-shadow var(--transition-base), transform var(--transition-base), border-color var(--transition-base);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--border-accent); }

/* ═══════════════════════════════════════════ STAT TILE ═══ */
.stat-tile { display: flex; flex-direction: column; gap: var(--space-1); }
.stat-tile__number {
  font-family: var(--font-display); font-size: var(--text-4xl); font-weight: var(--weight-bold);
  color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1;
}
.stat-tile__label {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider); text-transform: uppercase; color: var(--text-inverse-muted);
}

/* ═══════════════════════════════════════════ ICONOS ═══ */
.icon { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon--accent { color: var(--accent); }

/* ═══════════════════════════════════════════ REVEAL ═══ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal--delay-1 { transition-delay: .08s; }
.reveal--delay-2 { transition-delay: .16s; }
.reveal--delay-3 { transition-delay: .24s; }

/* ═══════════════════════════════════════════ UTILIDADES ═══ */
.text-center  { text-align: center; }
.text-balance { text-wrap: balance; }
.skip-link {
  position: fixed; left: var(--space-4); top: -80px; z-index: var(--z-modal);
  background: var(--accent); color: var(--color-petroleum-800);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-md); font-weight: var(--weight-bold);
  transition: top var(--transition-base);
}
.skip-link:focus { top: var(--space-4); }

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

/* ═══════════════════════════════════════════ REDUCE MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
