/* ==========================================================================
   PETROGESA - Base Styles
   Reset + Tipografía + Elementos HTML base
   ========================================================================== */

/* ========================================
   FONTS - Tipografías locales
   ======================================== */

@font-face {
  font-family: 'Geometos';
  src: url('../fonts/Geometos.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Grift';
  src: url('../fonts/Grift-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ========================================
   RESET - Normalize básico
   ======================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

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

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

/* ========================================
   TIPOGRAFÍA
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-regular);
  line-height: var(--leading-tight);
  color: var(--color-text-dark);
  text-wrap: balance;
}

h1 { font-size: var(--text-4xl); margin-bottom: var(--space-lg); }
h2 { font-size: var(--text-3xl); margin-bottom: var(--space-md); }
h3 { font-size: var(--text-2xl); margin-bottom: var(--space-md); }
h4 { font-size: var(--text-xl);  margin-bottom: var(--space-sm); }
h5 { font-size: var(--text-lg);  margin-bottom: var(--space-sm); }
h6 { font-size: var(--text-base); }

@media (min-width: 768px) {
  h1 { font-size: var(--text-5xl); }
  h2 { font-size: var(--text-4xl); }
  h3 { font-size: var(--text-3xl); }
}

@media (min-width: 1024px) {
  h1 { font-size: var(--text-6xl); }
}

p {
  margin-bottom: var(--space-md);
  max-width: 70ch;
}

p:last-child {
  margin-bottom: 0;
}

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

a:hover {
  color: var(--color-primary-dark);
}

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

/* ========================================
   UTILIDADES
   ======================================== */

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

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

.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }

/* ==========================================================================
   GSAP – Estados iniciales pre-animación (anti-parpadeo)
   La clase .js se inyecta en <html> con un inline script síncrono en <head>,
   antes de cualquier paint. Esto garantiza que los elementos animados
   arrancan invisibles desde el primer frame, sin ningún destello.
   ========================================================================== */

html.js .eyebrow-badge,
html.js .section-header,
html.js .filosofia__text,
html.js .filosofia__img-col,
html.js .filosofia__row-2 > *,
html.js .nosotros__card,
html.js .nosotros__stat,
html.js .actividades__item,
html.js .social-card,
html.js .noticias__cta,
html.js .clientes__logo-link,
html.js .contacto__map-wrap,
html.js .contacto__form,
html.js .contacto__info,
html.js .footer__col {
  opacity: 0;
}

/* Accesibilidad: usuarios que prefieren sin movimiento ven todo visible */
@media (prefers-reduced-motion: reduce) {
  html.js .eyebrow-badge,
  html.js .section-header,
  html.js .filosofia__text,
  html.js .filosofia__img-col,
  html.js .filosofia__row-2 > *,
  html.js .nosotros__card,
  html.js .nosotros__stat,
  html.js .actividades__item,
  html.js .social-card,
  html.js .noticias__cta,
  html.js .clientes__logo-link,
  html.js .contacto__map-wrap,
  html.js .contacto__form,
  html.js .contacto__info,
  html.js .footer__col {
    opacity: 1 !important;
  }
}
