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

:root {
  /* Colors from Design System */
  --color-primary: #236b45;
  --color-primary-container: #5fa57a;
  --color-secondary: #33694d;
  --color-tertiary: #595d73;
  --color-background: #f9f9ff;
  --color-surface: #f9f9ff;
  --color-surface-low: #f0f3ff;
  --color-surface-lowest: #ffffff;
  --color-surface-high: #e3e8f5;
  --color-on-surface: #161c25;
  --color-on-surface-variant: #404942;
  --color-outline-variant: rgba(191, 201, 191, 0.15); /* Ghost Border */
  
  --color-text-main: #161c25;
  --color-text-muted: #595d73;
  --color-slate-blue: #4A4E63;

  /* Typography */
  --font-display: 'Manrope', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Spacing */
  --space-unit: 8px;
  --space-sm: calc(var(--space-unit) * 2);
  --space-md: calc(var(--space-unit) * 4);
  --space-lg: calc(var(--space-unit) * 8);
  --space-xl: calc(var(--space-unit) * 12);
  --space-hero: calc(var(--space-unit) * 20);
  
  /* Transitions */
  --transition: all 0.5s cubic-bezier(0.2, 0, 0.2, 1);
}

/* Material Symbols Support */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'liga';
  vertical-align: middle;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--color-background);
  color: var(--color-on-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

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

ul {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  transition: var(--transition);
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.grid {
  display: grid;
  gap: var(--space-xl);
}

.section {
  padding: var(--space-hero) 0;
}

.bg-surface-low { background-color: var(--color-surface-low); }
.bg-surface-lowest { background-color: var(--color-surface-lowest); }
.bg-surface-high { background-color: var(--color-surface-high); }

/* Navigation (Fixed Block) */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 90px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-outline-variant);
  transition: var(--transition);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-family: var(--font-display);
  font-weight: 900 !important;
  font-size: 1.5rem !important;
  line-height: 1 !important;
  letter-spacing: -0.05em;
  color: var(--color-on-surface);
}

.nav-links {
  display: flex;
  gap: var(--space-xl);
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: -0.01em;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-primary);
}

.nav-link.active {
  border-bottom: 2px solid var(--color-primary);
}


/* Hero Section */
.hero {
  position: relative;
  height: 100vh;
  min-height: 800px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) opacity(0.2);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--color-background) 30%, rgba(249, 249, 255, 0.4) 100%);
  z-index: -1;
}

.hero-content {
  max-width: 900px;
  /* Intentional Asymmetry: start from col 3 on 12-col grid */
  margin-left: 8.33%; 
}

.hero-title {
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  margin-bottom: var(--space-md);
  color: #111111; /* Aumentado contraste: casi negro */
  font-weight: 800; /* Bold real */
}

.hero-subtitle {
  font-size: 1.25rem;
  max-width: 600px;
  margin-bottom: var(--space-lg);
  color: #6B7280; /* Gris medio para reducir protagonismo */
  font-weight: 400; /* Peso menor que el título */
  opacity: 0.9;
}

.hero-meta {
  font-size: 0.7rem; /* Tamaño más pequeño */
  text-transform: uppercase;
  letter-spacing: 0.3em;
  margin-bottom: var(--space-xl);
  color: #8A8F9B; /* Gris medio para menor jerarquía */
  font-weight: 600;
  display: block;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  background: #5FA57A; /* Fondo sólido color acento */
  color: #FFFFFF; /* Texto blanco */
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem; /* Aumentado ligeramente */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 2px;
  box-shadow: 0 10px 30px rgba(95, 165, 122, 0.2);
  transition: var(--transition);
}

.btn-primary:hover {
  background-color: #4a8a65; /* Hover suave (oscurecimiento) */
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(95, 165, 122, 0.3);
}

/* Services Section */
.services-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  align-items: stretch;
}

.service-card {
  padding: 64px;
  aspect-ratio: auto;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 32px;
  transition: var(--transition);
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.service-card:nth-child(odd) { background-color: var(--color-surface-low); }
.service-card:nth-child(even) { background-color: var(--color-surface-lowest); }

.service-card:hover {
  background-color: var(--color-surface-high);
}

.service-icon {
  color: var(--color-primary);
  font-size: 2.5rem;
}

.service-title {
  font-size: 1.6rem;
  margin-bottom: var(--space-sm);
  line-height: 1.15;
}

.service-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-tertiary);
}

/* Numbers Section */
.numbers-grid {
  grid-template-columns: repeat(4, 1fr);
  padding: var(--space-xl) 0;
}

.number-item h3 {
  font-size: 5rem;
  margin-bottom: 0.25rem;
  letter-spacing: -0.06em;
}

.number-item p {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-primary);
  font-weight: 700;
}

/* Project Cards */
.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-xl);
}

.projects-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

/* Offset second project to create asymmetry */
.projects-grid .project-card:nth-child(even) {
  margin-top: var(--space-xl);
}

.project-card {
  position: relative;
}

.project-image-wrap {
  aspect-ratio: 4/5;
  overflow: hidden;
  margin-bottom: var(--space-md);
  background: var(--color-surface-low);
}

.project-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: var(--transition);
}

.project-card:hover img {
  filter: grayscale(0);
  transform: scale(1.05);
}

.project-info {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-outline-variant);
  padding-bottom: var(--space-md);
}

.project-title {
  font-size: 1.25rem;
}

.project-location {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--color-tertiary);
  letter-spacing: 0.1em;
}

/* About Section Inline */
.about-inline-grid {
  grid-template-columns: repeat(12, 1fr);
}

.about-text {
  grid-column: 3 / 11;
}

/* Clients */
.clients-section {
  overflow: hidden;
}

.clients-marquee {
  width: 100%;
  overflow: hidden;
}

.clients-track {
  display: flex;
  align-items: center;
  gap: 72px;
  width: max-content;
  animation: clients-scroll 35s linear infinite;
}

.client-logo-img {
  max-width: 150px;
  max-height: 60px;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0.65;
  filter: grayscale(100%);
  flex-shrink: 0;
}

.client-logo-img:hover {
  opacity: 1;
  filter: grayscale(0%);
}

@keyframes clients-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Footer */
footer {
  padding: var(--space-xl) 0;
  background-color: #F8F9FA;
}

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

.footer-copy {
  font-size: 0.75rem;
  color: var(--color-tertiary);
}

/* Responsive */
@media (max-width: 1400px) {
  .container {
    max-width: 100%;
    padding-left: 32px;
    padding-right: 32px;
    box-sizing: border-box;
  }

.services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .service-card {
    aspect-ratio: auto;
    min-height: 420px;
  }

  .numbers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .numbers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xl); }
  .hero-content { margin-left: 0; }
}

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .numbers-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid .project-card:nth-child(even) {
    margin-top: 0;
  }
}

@media (max-width: 768px) {
  .navbar { height: 70px; }
  .nav-links { display: none; }
  .hero-title { font-size: 3rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .projects-grid .project-card:nth-child(even) { margin-top: 0; }
  .services-grid { grid-template-columns: 1fr; }
  .numbers-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   LIGHTBOX VISOR (GALERÍA FLOTANTE)
   ========================================================================== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.4); /* Fondo más transparente */
  backdrop-filter: blur(20px); /* Desenfoque fuerte para elegancia */
  -webkit-backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  width: 90vw;
  max-width: 1200px;
  height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  transform: scale(0.98);
  transition: transform 0.5s cubic-bezier(0.2, 0, 0.2, 1);
}

.lightbox.active .lightbox-image {
  transform: scale(1);
}

/* UI Elements Minimalistas cerca de la foto */
.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: var(--color-on-surface);
  font-size: 24px !important;
  cursor: pointer;
  z-index: 10001;
  opacity: 0.6;
  transition: var(--transition);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-on-surface);
  font-size: 40px !important;
  cursor: pointer;
  z-index: 10001;
  opacity: 0.3;
  padding: 10px;
  transition: var(--transition);
  user-select: none;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  opacity: 1;
}

.lightbox-prev { left: -60px; }
.lightbox-next { right: -60px; }

.lightbox-counter {
  position: absolute;
  bottom: -40px;
  color: white;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  font-weight: 600;
  opacity: 0.5;
}

@media (max-width: 768px) {
  .lightbox-nav {
    font-size: 32px !important;
    padding: 15px;
  }
  .lightbox-prev { left: 5px; }
  .lightbox-next { right: 5px; }
  .lightbox-close { top: 20px; right: 20px; }
}

/* ==========================================================================
   SISTEMA DE COOKIES
   ========================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-on-surface);
  color: white;
  padding: 24px 0;
  z-index: 10000;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
  transition: all 0.5s ease;
}

.cookie-banner-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.cookie-text p {
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0.9;
}

.cookie-text a {
  color: var(--color-primary-container);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.btn-cookie-primary {
  background: var(--color-primary-container);
  color: white;
  padding: 10px 24px;
  border-radius: 2px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.btn-cookie-link {
  color: white;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
  font-weight: 600;
}

.btn-cookie-link:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .cookie-banner-content {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
}



/* Inicio: proyectos inmediatamente despues de cabecera */
@media (max-width: 768px) {
  .hero { height: auto; min-height: 0; padding: 110px 0 44px; }
  .hero-content { max-width: 100%; }
  .hero-title { font-size: clamp(2rem, 9vw, 3rem); line-height: 1.1; overflow-wrap: break-word; }
  .hero-meta { margin-bottom: 18px; }
  .hero-subtitle { font-size: 1rem; margin-bottom: 0; }
  .featured-home { padding-top: 32px; }
  .featured-home .section-title { font-size: clamp(1.7rem, 7vw, 2.4rem) !important; }
  .featured-home .projects-header { gap: 12px; flex-wrap: wrap; }
}

/* VAERCOM v06: adaptacion responsive integral, sin alterar escritorio */
.mobile-menu-toggle { display: none; }
img, video, iframe { max-width: 100%; }
.grid > *, .project-info > *, .footer-content > * { min-width: 0; }
@media (max-width: 768px) {
  :root { --space-hero: 64px; --space-xl: 48px; --space-lg: 32px; --space-md: 24px; }
  .container { padding-left: 20px; padding-right: 20px; }
  .navbar { height: 68px; }
  .navbar .container { position: relative; }
  .mobile-menu-toggle { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; align-items: center; z-index: 2; }
  .mobile-menu-toggle span { display: block; width: 24px; height: 2px; background: var(--color-on-surface); transition: transform .2s ease, opacity .2s ease; }
  .mobile-menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(7px) rotate(45deg); }
  .mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .mobile-menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-7px) rotate(-45deg); }
  .navbar .nav-links { display: none; position: absolute; top: calc(100% + 12px); left: 0; right: 0; background: #fff; padding: 16px 20px 22px; flex-direction: column; gap: 0; box-shadow: 0 20px 40px rgba(0,0,0,.12); border: 1px solid var(--color-outline-variant); max-height: calc(100dvh - 85px); overflow-y: auto; }
  .navbar .nav-links.is-open { display: flex; }
  .navbar .nav-links .nav-link { display: block; padding: 13px 6px; font-size: 1rem; }
  .navbar .nav-links .nav-link.active { border-bottom: none; }
  .section { padding: 64px 0; }
  .grid { gap: 24px; }
  .grid[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .grid > [style*="grid-column"] { grid-column: 1 / -1 !important; }
  .hero { height: auto; min-height: 0; padding: 105px 0 45px; }
  .hero-content { margin-left: 0; max-width: 100%; }
  .hero-title { font-size: clamp(2rem, 8.5vw, 3.2rem); line-height: 1.12; overflow-wrap: break-word; }
  .hero-subtitle { font-size: 1rem; margin-bottom: 0; }
  .hero-meta { font-size: .65rem; letter-spacing: .16em; margin-bottom: 18px; }
  .featured-home { padding-top: 34px; }
  .projects-header { margin-bottom: 24px; flex-wrap: wrap; gap: 10px; }
  .projects-header .section-title { font-size: clamp(1.8rem, 7vw, 2.5rem) !important; }
  .projects-grid, .services-grid, .numbers-grid { grid-template-columns: minmax(0, 1fr); }
  .projects-grid .project-card:nth-child(even) { margin-top: 0; }
  .project-image-wrap { aspect-ratio: 4 / 3; margin-bottom: 18px; }
  .project-info { gap: 12px; flex-wrap: wrap; }
  .project-info > div:last-child { text-align: left !important; }
  .service-card { min-height: 0; padding: 28px 24px; gap: 16px !important; }
  .service-title { font-size: 1.3rem; }
  .numbers-grid { padding: 0; gap: 30px; }
  .number-item h3 { font-size: clamp(2.7rem, 12vw, 4rem); }
  .about-inline-grid { grid-template-columns: 1fr; }
  .about-text { grid-column: 1; }
  .about-text h2 { font-size: clamp(1.8rem, 7vw, 2.5rem) !important; }
  .about-text p { font-size: 1.1rem !important; }
  .footer-content { flex-direction: column; align-items: flex-start; gap: 24px; }
  footer .nav-links { display: flex; flex-wrap: wrap; gap: 12px 20px !important; }
  .contact-info-card { padding: 28px 24px; }
  .contact-info-value { font-size: clamp(1rem, 4.5vw, 1.4rem); overflow-wrap: anywhere; }
  .form-input { min-width: 0; }
  #filters { flex-wrap: wrap; gap: 8px !important; margin-bottom: 32px !important; }
  #filters .filter-btn { padding: 10px 12px; font-size: .68rem; }
  main[style*="padding-top: 140px"] { padding-top: 80px !important; }
  main[style*="padding-top: 140px"] > .section { padding-top: 40px; }
  h1, h2, h3, p { overflow-wrap: break-word; }
  h2[style*="font-size: 3rem"] { font-size: clamp(1.8rem, 7vw, 2.5rem) !important; }
  .btn-primary { max-width: 100%; text-align: center; padding: 18px 22px; font-size: .85rem; }
  .lightbox-content { width: 100vw; height: 80dvh; padding: 48px 12px; }
  .lightbox-image { max-height: 100%; }
  .lightbox-prev { left: 0; } .lightbox-next { right: 0; }
  .cookie-banner { padding: 14px 0; max-height: 75dvh; overflow-y: auto; }
  .cookie-banner-content { gap: 12px; }
  .cookie-actions { flex-wrap: wrap; justify-content: center; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .nav-links { gap: 22px; }
  .section { padding: 90px 0; }
  .grid[style*="minmax(400px"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .service-card { padding: 36px; min-height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .clients-track { animation: none; }
}
