@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --primary-color: #0A1930;    /* Deep Navy */
  --primary-light: #162B4C;
  --accent-color: #FF5E00;     /* Vibrant Orange */
  --accent-hover: #E05200;
  --text-dark: #333333;
  --text-light: #F4F6F8;
  --bg-light: #F8F9FA;
  --bg-white: #FFFFFF;
  
  --font-main: 'Montserrat', sans-serif;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(10, 25, 48, 0.15);
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-main);
}

body {
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ==================================
   TYPOGRAPHY
   ================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 3.5vw, 3.5rem); margin-bottom: 1.5rem; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 2rem; color: var(--primary-color); }
h3 { font-size: 1.5rem; margin-bottom: 1rem; }

p { font-size: 1.1rem; margin-bottom: 1.5rem; font-weight: 400; color: #555; }

/* ==================================
   UTILITIES
   ================================== */
.container {
  width: 90%;
  max-width: 1300px;
  margin: 0 auto;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-weight: 600;
  text-decoration: none;
  font-family: var(--font-main);
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.95rem;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #FFF;
  box-shadow: 0 4px 15px rgba(255, 94, 0, 0.3);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.7s ease;
  z-index: -1;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 94, 0, 0.5);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: #FFF;
}

.section-padding { padding: 6rem 0; }
.bg-dark { background-color: var(--primary-color); color: var(--text-light); }
.bg-dark p { color: #A0B0C0; }
.bg-dark h2 { color: var(--text-light); }

/* ==================================
   NAVIGATION
   ================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 0;
  z-index: 1000;
  transition: all var(--transition-fast);
  background: transparent;
}

header.scrolled {
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
  padding: 1rem 0;
}

.scroll-progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 1002;
}

header.scrolled .scroll-progress-container {
  background: rgba(0,0,0,0.03); 
}

.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-color);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  text-decoration: none;
  z-index: 1001; /* Asegurar por encima del menu movil */
}

.site-logo {
  height: 75px;
  width: auto;
  transition: all var(--transition-fast);
}

header.scrolled .site-logo {
  height: 55px;
}

/* En header transparente (Hero oscuro) el logo debe destacar, aplicamos un brillo alto si es azul marino */
header:not(.scrolled) .site-logo {
  filter: brightness(0) invert(1);
}

header.scrolled .site-logo {
  filter: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--bg-white);
  font-weight: 500;
  font-size: 1rem;
  transition: color var(--transition-fast);
  position: relative;
}

header.scrolled .nav-links a {
  color: var(--primary-color);
}

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

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

.nav-links .btn-quote {
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  padding: 0.5rem 1.5rem;
  border-radius: 4px;
}
.nav-links .btn-quote::after { display: none; }
.nav-links .btn-quote:hover {
  background: var(--accent-color);
  color: #FFF;
}

.hamburger {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--bg-white);
}
header.scrolled .hamburger { color: var(--primary-color); }

/* ==================================
   HERO SECTION
   ================================== */
.hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  padding-top: 130px;
  padding-bottom: 60px;
  background-color: var(--primary-color);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: url('https://images.unsplash.com/photo-1541888086425-d81bb19240f5?q=80&w=2070&auto=format&fit=crop') no-repeat center center / cover;
  opacity: 0.2;
  mix-blend-mode: overlay;
}

.hero-gradient {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(90deg, var(--primary-color) 0%, rgba(10, 25, 48, 0.7) 100%);
}

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

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

.hero-content h1 {
  color: var(--bg-white);
  animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.hero-content p {
  color: #B0C4DE;
  font-size: 1.2rem;
  margin-bottom: 2.5rem;
  max-width: 600px;
  opacity: 0;
  animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  opacity: 0;
  animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

.hero-btns .btn-outline {
  color: #FFF;
  border-color: #FFF;
}
.hero-btns .btn-outline:hover {
  background: #FFF;
  color: var(--primary-color);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 4rem;
  position: relative;
  z-index: 2;
}

.hero-image-wrapper {
  perspective: 1000px;
}

.hero-image-wrapper img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: rotateY(-5deg) translateY(0);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: floatImage 6s ease-in-out infinite;
}

.hero-image-wrapper img:hover {
  transform: rotateY(0deg) scale(1.02);
  box-shadow: 0 35px 60px -15px rgba(0, 150, 255, 0.3);
  animation-play-state: paused;
}

/* ==================================
   SERVICES SECTION
   ================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  margin-top: 3rem;
}

.service-card {
  background: var(--bg-white);
  padding: 3rem;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  border-bottom: 4px solid var(--primary-color);
  opacity: 0;
  transform: translateY(30px);
}

.service-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  box-shadow: inset 0 0 0 2px transparent;
  transition: box-shadow 0.4s ease;
  pointer-events: none;
  border-radius: 8px;
}

.service-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 0 20px rgba(255, 94, 0, 0.15);
  border-bottom-color: var(--accent-color);
  z-index: 2;
}

.service-card:hover::after {
  box-shadow: inset 0 0 0 2px rgba(255, 94, 0, 0.1);
}

.service-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 94, 0, 0.1);
  color: var(--accent-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.service-card:hover .service-icon {
  transform: translateY(-5px) rotate(5deg) scale(1.1);
  background: var(--accent-color);
  color: #FFF;
  box-shadow: 0 10px 20px rgba(255, 94, 0, 0.3);
}

.service-card h3 {
  color: var(--primary-color);
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.service-features {
  list-style: none;
  margin-top: 1.5rem;
}

.service-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: #444;
}

.service-features li::before {
  content: '✓';
  color: var(--accent-color);
  font-weight: bold;
}

/* ==================================
   ABOUT / TRUST SECTION
   ================================== */
.about-section {
  background: var(--bg-white);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-img {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.about-img::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: var(--primary-color);
  opacity: 0.2;
  mix-blend-mode: multiply;
}

.about-img img {
  width: 100%;
  display: block;
  filter: grayscale(80%) sepia(20%) hue-rotate(180deg) contrast(1.1);
  transition: filter var(--transition-slow);
}

.about-img:hover img {
  filter: grayscale(0%);
}

.stats-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

.stat-item h4 {
  font-size: 3rem;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.stat-item p {
  color: #777;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==================================
   CLIENTS SECTION (Estilo ingenieriajycspa.cl)
   ================================== */
.clients-section {
  background-color: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  border-bottom: 1px solid #E2E8F0;
  padding: 5rem 0;
}

.clients-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 1.25rem !important;
  margin-top: 2.5rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.client-card {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 10px !important;
  height: 105px !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 0.75rem 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.client-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 10px 20px rgba(10, 25, 48, 0.08) !important;
  border-color: #CBD5E1 !important;
}

.client-card img {
  max-width: 80% !important;
  max-height: 60px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto !important;
  filter: grayscale(100%) opacity(0.85);
  transition: all 0.3s ease !important;
}

.client-card:hover img {
  filter: grayscale(0%) opacity(1);
  transform: scale(1.05) !important;
}

@media (max-width: 1200px) {
  .clients-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

@media (max-width: 992px) {
  .clients-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 640px) {
  .clients-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
  
  .client-card {
    height: 90px !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 8px !important;
  }
  
  .client-card img {
    max-height: 48px !important;
    max-width: 85% !important;
  }
}

/* ==================================
   NETWORK / PARTNERS SECTION
   ================================== */
.network-section {
  background-color: var(--bg-light);
  border-top: 1px solid #E5E7EB;
}

.network-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.network-card {
  background: var(--bg-white);
  padding: 2.5rem 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid #E5E7EB;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.network-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 35px rgba(10, 25, 48, 0.15), 0 0 20px rgba(10, 25, 48, 0.1);
  border-color: var(--primary-color);
  z-index: 2;
}

.network-logo {
  width: 70px;
  height: 70px;
  background: rgba(10, 25, 48, 0.05);
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.network-card:hover .network-logo {
  animation: iconPulse 1s infinite alternate;
  background: var(--primary-color);
  color: var(--bg-white);
  box-shadow: 0 10px 20px rgba(10, 25, 48, 0.2);
}

.network-card h3 {
  color: var(--primary-color);
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
}

.network-card p {
  font-size: 1rem;
  margin-bottom: 2rem;
  flex-grow: 1;
}

.network-btn {
  width: 100%;
  font-size: 0.9rem;
  padding: 0.8rem;
}

/* ==================================
   CONTACT / FOOTER
   ================================== */
.contact-section {
  position: relative;
  background-color: var(--primary-light);
  overflow: hidden;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
}

.contact-info {
  color: var(--bg-white);
}

.contact-info h2 {
  color: #FFF;
}

.contact-info p {
  color: #A0B0C0;
}

.info-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.info-item .icon {
  color: var(--accent-color);
  font-size: 1.5rem;
}

.contact-form {
  background: var(--bg-white);
  padding: 3rem;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-control {
  width: 100%;
  padding: 1rem;
  border: 1px solid #DDD;
  border-radius: 4px;
  font-family: var(--font-main);
  font-size: 1rem;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.footer-bottom {
  text-align: center;
  padding: 1.5rem 0;
  background: var(--primary-color);
  color: #667686;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ==================================
   ANIMATIONS
   ================================== */
@keyframes slideUp {
  0% { transform: translateY(50px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes floatImage {
  0% { transform: rotateY(-5deg) translateY(0px); }
  50% { transform: rotateY(-5deg) translateY(-15px); }
  100% { transform: rotateY(-5deg) translateY(0px); }
}

@keyframes iconPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

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

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

/* ==================================
   RESPONSIVE DESIGN
   ================================== */
@media (max-width: 992px) {
  .services-grid, .about-grid, .contact-grid, .hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: var(--primary-color);
    flex-direction: column;
    justify-content: center;
    transition: left var(--transition-normal);
  }
  
  .nav-links.active { left: 0; }
  .hamburger { display: block; }
  header { background: var(--primary-color); padding: 1rem 0; }
  .hero-btns { flex-direction: column; }
  .contact-form { padding: 2rem; }
  .hero-image-wrapper { display: none; } /* Ocultar imagen en móvil para dar prioridad al texto */
}
