/* ==========================================================================
   main.css — Variables, reset, tipografía y layout base
   Mobile-first: estilos base para pantallas pequeñas
   ========================================================================== */

/* ---------- Custom Properties (Paleta oficial ENEIDA) ---------- */
:root {
  /* Colores */
  --color-navy:       #1E3E64;
  --color-navy-deep:  #142C48;
  --color-teal:       #4BBBC9;
  --color-teal-light: rgba(75, 187, 201, 0.08);
  --color-orange:     #F88A1B;
  --color-gold:       #C9A84C;
  --color-white:      #FFFFFF;
  --color-off-white:  #F7F8FA;
  --color-cream:      #FAFBFD;
  --color-gray-light: #E8ECF0;
  --color-gray-mid:   #8A97A8;
  --color-text:       #2D3748;
  --color-text-soft:  #4A5568;

  /* Tipografía */
  --font-heading: 'Cormorant Garamond', serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'Space Mono', monospace;

  /* Espaciado modular */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 5rem;
  --space-xl: 9rem;
  --space-2xl: 12rem;

  /* Bordes y sombras */
  --radius-sm: 4px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-subtle: 0 1px 3px rgba(30, 62, 100, 0.04), 0 1px 2px rgba(30, 62, 100, 0.06);
  --shadow-card:  0 4px 6px rgba(30, 62, 100, 0.04), 0 10px 40px rgba(30, 62, 100, 0.08);
  --shadow-hover: 0 10px 25px rgba(30, 62, 100, 0.10), 0 20px 60px rgba(30, 62, 100, 0.12);
  --shadow-glow-teal: 0 0 30px rgba(75, 187, 201, 0.15);
  --shadow-glow-orange: 0 8px 30px rgba(248, 138, 27, 0.30);

  /* Transiciones */
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset moderno ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font: inherit;
}

/* ---------- Tipografía ---------- */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-navy);
}

h1 {
  font-size: clamp(2.75rem, 6vw, 5.5rem);
  font-weight: 300;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2.25rem, 4.5vw, 3.75rem);
  letter-spacing: -0.015em;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 600;
}

h4 {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-navy);
}

p {
  margin-bottom: 1em;
  color: var(--color-text-soft);
}

/* Texto mono para datos técnicos */
.text-mono {
  font-family: var(--font-mono);
}

/* ---------- Layout base ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.section {
  padding: var(--space-lg) 0;
}

.section--alt {
  background-color: var(--color-off-white);
}

.section--navy {
  background: linear-gradient(160deg, var(--color-navy-deep) 0%, var(--color-navy) 60%, rgba(75, 187, 201, 0.15) 100%);
  color: var(--color-white);
  position: relative;
  overflow: hidden;
}

.section--navy::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(75, 187, 201, 0.3), transparent);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section__title {
  margin-bottom: var(--space-sm);
}

.section__subtitle {
  font-size: 1.125rem;
  color: var(--color-gray-mid);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.8;
}

/* Separador decorativo premium */
.section__divider {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-teal), var(--color-orange));
  margin: var(--space-sm) auto var(--space-md);
  border: none;
  border-radius: 2px;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(20, 44, 72, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color var(--transition-slow), box-shadow var(--transition-slow);
}

/* En la home, navbar empieza transparente sobre el hero */
.navbar--transparent {
  background-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.navbar.scrolled,
.navbar--transparent.scrolled {
  background-color: rgba(20, 44, 72, 0.95);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.navbar__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-sm) var(--space-md);
  height: 80px;
  position: relative;
  transition: height var(--transition);
}

.navbar.scrolled .navbar__container {
  height: 64px;
}

.navbar__logo img {
  height: 44px;
  width: auto;
  /* Invertir colores del logo para que se vea sobre fondo navy */
  filter: brightness(0) invert(1);
  transition: filter var(--transition);
}

.navbar__nav {
  display: none;
}

.navbar__links {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.navbar__link {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: var(--space-xs) 0;
  position: relative;
  transition: color var(--transition);
}

.navbar__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-teal), transparent);
  transition: width var(--transition);
}

.navbar__link:hover,
.navbar__link--active {
  color: var(--color-white);
}

.navbar__link:hover::after,
.navbar__link--active::after {
  width: 100%;
}

.navbar__actions {
  display: none;
  align-items: center;
  gap: var(--space-sm);
}

/* Selector de idioma */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8125rem;
}

.lang-switcher__link {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  transition: color var(--transition);
}

.lang-switcher__link:hover,
.lang-switcher__link--active {
  color: var(--color-white);
}

.lang-switcher__separator {
  color: rgba(255, 255, 255, 0.3);
}

/* Botón hamburguesa */
.navbar__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--color-white);
  font-size: 1.25rem;
}

/* Menú móvil abierto */
.navbar__nav.is-open {
  display: flex;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: rgba(20, 44, 72, 0.98);
  flex-direction: column;
  padding: var(--space-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.navbar__nav.is-open .navbar__links {
  flex-direction: column;
  gap: 0;
}

.navbar__nav.is-open .navbar__link {
  display: block;
  padding: var(--space-sm) 0;
  font-size: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Selector de idioma en móvil (dentro del menú abierto) */
.navbar__nav.is-open .lang-switcher--mobile {
  display: flex;
  padding-top: var(--space-sm);
  margin-top: var(--space-xs);
}

.lang-switcher--mobile {
  display: none;
}

/* Espaciador para compensar la navbar fija */
.navbar-spacer {
  height: 80px;
}

@media (max-width: 767px) {
  .navbar__container {
    padding: 0.875rem 1rem;
    height: 76px;
  }

  .navbar.scrolled .navbar__container {
    height: 76px;
  }

  .navbar__logo img {
    height: 38px;
  }

  .navbar__nav.is-open {
    padding: 0 1rem 1rem;
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.22);
  }

  .navbar__nav.is-open .navbar__links {
    padding-top: 0.25rem;
  }

  .navbar-spacer {
    height: 76px;
  }

  .hero__content {
    width: 100%;
    padding: 2rem 1.35rem;
  }

  .page-hero {
    min-height: 300px;
  }

  .page-hero__content {
    width: 100%;
    padding: 6rem 1.35rem 2.25rem;
  }

  .page-hero__title,
  .page-hero__desc,
  .hero__headline,
  .hero__subheadline {
    max-width: 100%;
  }
}

/* ---------- Grids utilitarios ---------- */
.grid {
  display: grid;
  gap: var(--space-md);
}

.grid--2 {
  grid-template-columns: 1fr;
}

.grid--3 {
  grid-template-columns: 1fr;
}

.grid--4 {
  grid-template-columns: 1fr 1fr;
}

/* ---------- Animaciones de revelado (scroll) ---------- */
.reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Fade-up escalonado para hero */
.fade-up {
  opacity: 1;
  transform: none;
  animation: none;
}

.fade-up--delay-1 { animation-delay: 0s; }
.fade-up--delay-2 { animation-delay: 0s; }
.fade-up--delay-3 { animation-delay: 0s; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Selección de texto ---------- */
::selection {
  background-color: var(--color-teal);
  color: var(--color-white);
}

/* ---------- Focus visible (accesibilidad) ---------- */
:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
}
