@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;700;800;900&display=swap");

/* --- DESIGN SYSTEM & TOKENS --- */
:root {
  --color-bg-primary: #0a0f0d; /* Lienzo general */
  --color-bg-secondary: #0a0f0d; /* Contraste entre secciones */
  --color-bg-tertiary: #16191a; /* Fondo de tarjetas / bento */
  --color-accent: #247c5c; /* Acento / Bordes / CTA Principal */
  --color-accent-hover: #1b5e46; /* Hover acento sutilmente más oscuro */

  --color-text-main: #f5f7f8; /* Legibilidad absoluta */
  --color-text-muted: #8e9c95; /* Texto secundario */

  --font-title: "Outfit", sans-serif;
  --font-body: "Inter", sans-serif;

  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;

  --container-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--color-bg-primary);
  color: var(--color-text-main);
  font-family: var(--font-body);
}

body {
  overflow-x: hidden;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

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

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

input,
select,
textarea,
button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* --- REUSABLE COMPONENTS (VARIANTES Y BOTONES) --- */
.container {
  width: 90%;
  max-width: var(--container-width);
  margin: 0 auto;
}

/* Botones con transiciones fluidas */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-family: var(--font-title);
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-text-main);
  border: 1px solid var(--color-accent);
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--color-accent);
  border: 1px solid #ffffff;
}

.btn-secondary:hover {
  background-color: #e5e5e5;
  border-color: #e5e5e5;
  transform: translateY(-2px);
}

/* --- FOOTER MAXIMIZADO --- */
.footer {
  background-color: var(--color-bg-secondary);
  border-top: 1px solid rgba(36, 124, 92, 0.2);
  padding: 80px 0 30px 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr;
  gap: 48px;
  margin-bottom: 60px;
}

.footer-info p {
  color: var(--color-text-muted);
  margin-bottom: 24px;
  max-width: 320px;
  font-size: 0.95rem;
}

.footer-socials {
  display: flex;
  gap: 12px;
}

.social-icon {
  width: 40px;
  height: 40px;
  background-color: var(--color-bg-tertiary);
  border: 1px solid rgba(36, 124, 92, 0.2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.social-icon:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  transform: translateY(-3px);
}

.footer-title {
  font-size: 1.1rem;
  margin-bottom: 24px;
  position: relative;
  padding-bottom: 8px;
}

.footer-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: var(--color-accent);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--color-text-main);
  padding-left: 6px;
}

.footer-bottom {
  border-top: 1px solid rgba(142, 156, 149, 0.1);
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.footer-legal-links {
  display: flex;
  gap: 24px;
}

/* Scroll reveal classes */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Título con efecto ola: cada palabra se anima por separado */
.wave-title .wave-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(35px) rotate(3deg);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 200ms);
  will-change: transform, opacity;
}

.wave-title.in-view .wave-word {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}

/* Evita que reglas heredadas (ej: .hero-title span) le apliquen
   contorno/transparencia a las palabras generadas por el efecto ola */
.wave-title .wave-word {
  color: inherit;
  -webkit-text-stroke: 0;
}

/* Botón flotante de WhatsApp: anillos de sombra en bucle tipo zoom in/out */
.whatsapp-float::before,
.whatsapp-float::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background-color: #25d366;
  z-index: -1;
  animation: whatsappPulse 2.4s ease-out infinite;
}

.whatsapp-float::after {
  animation-delay: 1.2s;
}

@keyframes whatsappPulse {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  100% {
    transform: scale(2.1);
    opacity: 0;
  }
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* --- LLUVIA DE PINES DE UBICACIÓN --- */
@keyframes fallPin {
  0% {
    transform: translateY(-10%) rotate(-6deg);
    opacity: 0;
  }
  10% {
    opacity: var(--pin-opacity, 0.5);
  }
  85% {
    opacity: var(--pin-opacity, 0.5);
  }
  100% {
    transform: translateY(115vh) rotate(6deg);
    opacity: 0;
  }
}

.pin-fall {
  position: absolute;
  top: 0;
  animation-name: fallPin;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
  pointer-events: none;
}

/* --- MARQUEE INFINITO DE LOGOS --- */
.logo-marquee-wrap {
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 12%,
    #000 88%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 12%,
    #000 88%,
    transparent 100%
  );
}

.logo-marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  gap: 90px;
  animation: marquee 30s linear infinite;
}

.logo-marquee-item {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-marquee-item::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -45px;
  width: 5px;
  height: 5px;
  transform: translateY(-50%) rotate(45deg);
  background: rgba(37, 124, 92, 0.5);
}

.logo-marquee-text {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.1rem;
  color: #d1d5db;
  white-space: nowrap;
  letter-spacing: 0.01em;
  opacity: 0.7;
  transition: opacity 0.35s ease, color 0.35s ease;
}

.logo-marquee-text:hover {
  color: #ffffff;
  opacity: 1;
}

.logo-marquee-item img {
  height: 56px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  filter: grayscale(55%) brightness(1.5);
  opacity: 0.75;
  transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease;
}

.logo-marquee-item img:hover {
  filter: grayscale(0%) brightness(1) drop-shadow(0 0 14px rgba(37, 124, 92, 0.55));
  opacity: 1;
  transform: scale(1.08);
}

/* --- FILTROS DE PORTAFOLIO --- */
.filter-btn {
  background-color: var(--color-bg-tertiary);
  border: 1px solid rgba(36, 124, 92, 0.15);
  color: var(--color-text-muted);
  padding: 10px 24px;
  border-radius: 4px;
  font-family: var(--font-title);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text-main);
}

.portfolio-card {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.portfolio-card-title {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.portfolio-card-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* --- FLIP CARD GALLERY (PORTAFOLIO) --- */
.flip-card {
  perspective: 1500px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* --- ACORDEÓN DE IMÁGENES CON HOVER --- */
@media (min-width: 768px) {
  .accordion-panel {
    flex: 1 1 0%;
    transition: flex 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .accordion-panel:hover {
    flex: 2.4 1 0%;
  }
}

/* --- HERO (INDEX.HTML) --- */
.hero {
  height: 100vh;
  min-height: 700px;
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--color-bg-primary);
  overflow: hidden;
}

.hero .container {
  position: relative;
  z-index: 3;
}

.hero-content {
  max-width: 800px;
}

.hero-title {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.hero-title span {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--color-accent);
  position: relative;
}

.hero-desc {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  margin-bottom: 40px;
  max-width: 600px;
}

.hero-btns {
  display: flex;
  gap: 20px;
}

/* Bento Grid de Soluciones */
@keyframes bentoPopIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Clase inicial oculta que luego será animada por JS */
.bento-item {
  opacity: 0;
}

/* Clase que se activa con IntersectionObserver */
.bento-animate {
  animation: bentoPopIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- RESPONSIVIDAD (MOBILE & TABLET ADJUSTMENTS) --- */
@media (max-width: 1024px) {
  .hero-title {
    font-size: 3.5rem;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.8rem;
  }

  .hero-btns {
    flex-direction: column;
    gap: 15px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}
