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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

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

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  /* Colors */
  --color-bg:                  #0D1117;
  --color-bg-secondary:        #161B22;
  --color-accent:              #C9A84C;
  --color-accent-dim:          rgba(201, 168, 76, 0.15);
  --color-accent-border:       rgba(201, 168, 76, 0.3);
  --color-accent-border-strong:rgba(201, 168, 76, 0.4);
  --color-accent-shadow:       rgba(201, 168, 76, 0.2);
  --color-text:                #FFFFFF;
  --color-text-muted:          #8B949E;
  --color-text-dim:            #484F58;
  --color-bg-alpha-95:         rgba(13, 17, 23, 0.95);

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* Spacing */
  --section-padding: 5rem 1.5rem;
  --max-width: 1200px;

  /* Transitions */
  --transition: 0.25s ease;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
}

p {
  color: var(--color-text-muted);
  font-weight: 400;
  line-height: 1.8;
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.section-container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
  width: 100%;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--color-accent);
  margin-bottom: 2.5rem;
  text-align: center;
}

.divider-gold {
  border: none;
  border-top: 1px solid var(--color-accent-border);
  margin: 0;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
#header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background-color: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

#header.scrolled {
  background-color: var(--color-bg-alpha-95);
  backdrop-filter: blur(8px);
  border-bottom-color: var(--color-accent-border);
  box-shadow: 0 1px 0 var(--color-accent-shadow);
}

.nav-container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-brand {
  font-family: 'Comfortaa', cursive;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color var(--transition);
  white-space: nowrap;
}

.nav-brand:hover {
  color: var(--color-accent);
}

.logo-principal {
  height: 48px;
  width: auto;
}

.logo-fallback {
  display: none;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-accent);
  transition: width var(--transition);
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-text);
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 73px; /* header height */
    left: 0;
    width: 100%;
    background-color: var(--color-bg-secondary);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--color-accent-border);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    font-size: 1rem;
  }
}

/* ============================================================
   HERO
   ============================================================ */
#hero {
  min-height: 100svh;
  display: flex;
  align-items: flex-start;
  padding-bottom: 6rem;
  padding-top: calc(73px + 80px); /* header + generous top padding */
  background: linear-gradient(135deg, var(--color-bg) 60%, var(--color-bg-secondary) 100%);
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Logo centrado en hero */
.hero-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0;
}

.hero-logo {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: 16px;
  display: block;
  margin: 0 auto 0;
  mix-blend-mode: lighten; /* Opción A: mezcla el fondo oscuro del logo con la página */
  /* box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.2); */ /* Opción B: sutil marco dorado */
}

.hero-logo-fallback {
  display: none;
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.1em;
  text-align: center;
}

/* ---- Carrusel ---- */
.hero-carousel {
  position: relative;
  width: 100%;
  max-width: 860px;
  margin: 32px auto 0;
  padding: 0 1.5rem;
}

.carousel-track {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid var(--color-accent-dim);
  border-radius: 8px;
  padding: 3rem 3.25rem;
  box-sizing: border-box;
}

.hero-card.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
}

.hero-card.exit {
  opacity: 0;
  transform: translateX(-40px);
}

/* Barra de progreso */
.carousel-progress {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  margin-top: 1.5rem;
  overflow: hidden;
}

.carousel-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  border-radius: 2px;
}

/* Puntos */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.625rem;
  margin-top: 1.25rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
  padding: 0;
}

.dot.active {
  background: var(--color-accent);
  transform: scale(1.3);
}

/* Flechas */
.carousel-arrows {
  position: absolute;
  top: 50%;
  width: 100%;
  left: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.arrow {
  pointer-events: auto;
  background: var(--color-accent-dim);
  border: 1px solid var(--color-accent-border);
  color: var(--color-accent);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.3s ease;
}

.arrow-prev {
  transform: translateX(-52px);
}

.arrow-next {
  transform: translateX(52px);
}

.arrow-prev:hover {
  background: rgba(201, 168, 76, 0.25);
  transform: translateX(-52px) scale(1.1);
}

.arrow-next:hover {
  background: rgba(201, 168, 76, 0.25);
  transform: translateX(52px) scale(1.1);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.02em;
  margin-bottom: 1.75rem;
  line-height: 1.3;
}

.hero-title.gold {
  color: var(--color-accent);
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: 0;
}

.hero-line {
  display: block;
  margin-bottom: 0.5rem;
}

.hero-line:last-child {
  margin-bottom: 0;
}

.hero-email {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease;
  padding-bottom: 2px;
}

.hero-email:hover {
  border-bottom-color: var(--color-accent);
}

/* ---- Hero responsive 768px ---- */
@media (max-width: 768px) {
  #hero {
    padding-top: calc(73px + 48px);
    padding-bottom: 4rem;
    padding-inline: 1.5rem;
  }

  .hero-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 0;
  }

  .hero-logo-fallback {
    font-size: 1.8rem;
  }

  .hero-logo-wrap {
    margin-bottom: 0;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-email {
    font-size: 1.05rem;
  }

  .hero-carousel {
    padding: 0;
    margin-top: 20px;
  }

  .hero-card {
    padding: 2rem 1.75rem;
  }

  .carousel-track {
    min-height: 520px;
  }

  .carousel-arrows {
    display: none;
  }
}

/* ---- Hero responsive 480px ---- */
@media (max-width: 480px) {
  #hero {
    padding-top: calc(73px + 32px);
  }

  .hero-title {
    font-size: 1.55rem;
  }

  .hero-card {
    padding: 1.5rem 1.25rem;
  }

  .carousel-track {
    min-height: 620px;
  }
}

/* ============================================================
   CLIENTES / SOCIOS
   ============================================================ */
#clientes {
  background-color: var(--color-bg-secondary);
  padding: 6.25rem 0; /* 100px */
}

.logos-block {
  max-width: 1000px;
  margin-inline: auto;
  text-align: center;
  padding-inline: 1.5rem;
}

/* Divider entre los dos bloques de logos */
.logos-block + .divider-gold {
  max-width: 1000px;
  margin: 3.75rem auto; /* 60px */
}

.section-subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  margin-bottom: 3rem; /* 48px */
}

.logos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem; /* 32px */
  align-items: center;
  justify-items: center;
}

.logos-grid img {
  max-width: 160px;
  max-height: 80px;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0.85;
}

.logos-grid img:hover {
  transform: scale(1.08);
  opacity: 1;
}

/* Logo placeholder (generado por JS cuando la imagen falla) */
.logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 80px;
  padding: 0.75rem 1rem;
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-accent-border-strong);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text);
  text-align: center;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

/* ============================================================
   FOOTER / CONTACTO
   ============================================================ */
#contacto {
  background-color: var(--color-bg);
  padding-top: 0;
  padding-bottom: 0;
}

.footer-divider {
  margin: 0;
  width: 100%;
  opacity: 0.4;
}

.footer-container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem; /* 48px */
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 4rem 1.5rem 3rem; /* 64px 24px 48px */
}

.footer-logo {
  max-width: 140px;
  max-height: 60px;
  object-fit: contain;
  margin-bottom: 1rem;
  filter: brightness(0.9);
}

.footer-tagline {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-top: 0.75rem;
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem; /* 10px */
}

.footer-link {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid var(--color-accent-dim);
  padding: 1.25rem 1.5rem; /* 20px 24px */
  text-align: center;
}

.footer-copy {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--color-text-dim);
}

/* ============================================================
   ANIMACIONES DE ENTRADA
   La clase .fade-in-up se aplica via JS. .visible se agrega
   por el IntersectionObserver cuando el elemento entra al viewport.
   ============================================================ */
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE — 768px
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --section-padding: 3.5rem 1.25rem;
  }

  #clientes {
    padding: 4rem 0;
  }

  .logos-block + .divider-gold {
    margin: 2.5rem auto;
  }

  .logos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .logo-placeholder {
    width: 130px;
    height: 64px;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 2.25rem; /* 36px */
    padding: 2.5rem 1.5rem 2rem; /* 40px 24px 32px */
  }

  .footer-col {
    text-align: center;
  }

  .footer-logo {
    margin-inline: auto;
  }

  .footer-list {
    align-items: center;
  }
}

/* ============================================================
   RESPONSIVE — 480px
   ============================================================ */
@media (max-width: 480px) {
  :root {
    --section-padding: 2.5rem 1rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .logos-grid {
    gap: 1rem;
  }

  .logos-grid img {
    max-width: 120px;
    max-height: 60px;
  }

  .logo-placeholder {
    width: 120px;
    height: 60px;
    font-size: 0.72rem;
  }
}
