@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,200;9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

:root {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F6F7F8;
  --text-main: #15202b;
  --text-muted: #525866;
  --accent: #E25F24;
  --nav-bg: transparent;
  
  --font-family: 'DM Sans', sans-serif;
  
  --spacing-xs: 1rem;
  --spacing-sm: 2rem;
  --spacing-md: 4rem;
  --spacing-lg: 8rem;
  --spacing-xl: 12rem;
}

/* CUSTOM CURSOR */
body {
  cursor: none;
}

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  background-color: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, background-color 0.3s, border 0.3s;
}

.custom-cursor.hover {
  width: 50px;
  height: 50px;
  background-color: transparent;
  border: 1px solid var(--accent);
}

.magnetic-btn {
  display: inline-block;
  position: relative;
}

.text-reveal {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
}

.text-reveal .word {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.text-reveal.active .word {
  transform: translateY(0);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  font-weight: 300;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.4s ease;
  cursor: none;
}

ul {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  line-height: 1.1;
  color: var(--text-main);
}

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

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: transparent;
  padding: 2.5rem 5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  transition: all 0.5s ease;
}

.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  padding: 1.5rem 5rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.navbar.scrolled .nav-link,
.navbar.navbar-dark .nav-link {
  color: var(--text-main) !important;
}

.navbar.scrolled .logo img,
.navbar.navbar-dark .logo img {
  filter: invert(1);
}

.logo img {
  height: 45px;
  width: auto;
  transition: filter 0.4s ease;
}

.nav-links {
  display: flex;
  gap: 3.5rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  position: relative;
  color: var(--bg-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: currentColor;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Footer */
.footer {
  background-color: #000000;
  color: #a0aab2;
  padding: 8rem 5rem 3rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 6rem;
  margin-bottom: 6rem;
}

.footer-logo img {
  height: 55px;
  margin-bottom: 2rem;
  filter: brightness(0) invert(1);
}

.footer-text {
  max-width: 350px;
  font-size: 1.05rem;
  line-height: 1.8;
}

.footer-heading {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 2.5rem;
  color: var(--bg-primary);
  font-weight: 500;
}

.footer-links li {
  margin-bottom: 1.2rem;
}

.footer-links a:hover {
  color: var(--bg-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 3rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1.2rem 3rem;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  background-color: var(--text-main);
  color: var(--bg-primary);
  cursor: none;
  transition: all 0.4s ease;
  border: none;
}

.btn-dark:hover {
  background-color: var(--accent);
}

/* Helpers */
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 5rem;
}

/* Page Transitions */
.page-transition {
  animation: fadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-in, .active {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ======================================================= */
/* NUEVOS ESTILOS */
/* ======================================================= */

/* Filosofía Constructiva */
.filosofia-section {
  padding: 8rem 5rem;
  background-color: var(--bg-secondary);
  width: 94%;
  max-width: 1800px;
  margin: 0 auto;
}

.filosofia-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8rem;
  align-items: start;
}

.filosofia-title {
  font-size: 3.5rem;
  font-weight: 300;
  line-height: 1.1;
  color: var(--text-main);
}

.filosofia-content {
  column-count: 2;
  column-gap: 4rem;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.filosofia-content p {
  margin-bottom: 1.5rem;
  break-inside: avoid;
}

/* Especialidades Interactivas */
.especialidades-section {
  padding: 6rem 0;
  position: relative;
  background-color: var(--bg-primary);
  border-top: 1px solid rgba(0,0,0,0.05);
}

.section-badge {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 4rem;
  display: block;
}

.specs-list {
  display: flex;
  flex-direction: column;
}

.spec-item {
  display: flex;
  align-items: center;
  padding: 3rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  position: relative;
  z-index: 2;
  color: var(--text-main);
  transition: color 0.3s;
}

.spec-item:hover {
  color: var(--accent);
}

.spec-num {
  font-size: 1.5rem;
  font-weight: 300;
  width: 100px;
}

.spec-title {
  font-size: 2.5vw;
  font-weight: 300;
  margin: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s;
}

.spec-text {
  display: flex;
  flex-direction: column;
}

.spec-desc {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 600px;
  margin-top: 0;
}

.spec-item:hover .spec-title {
  transform: translateX(15px);
  color: var(--accent);
}

.spec-item:hover .spec-desc {
  max-height: 100px;
  opacity: 1;
  margin-top: 1rem;
  transform: translateX(15px);
}

/* Hover Image Preview */
.spec-img-preview {
  position: absolute;
  top: 50%;
  right: 15%;
  width: 400px;
  height: 500px;
  background-size: cover;
  background-position: center;
  transform: translateY(-50%) scale(0.9);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), background-image 0.5s ease;
}

.spec-img-preview.show {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* Metodología G-3 */
.metodologia-section {
  padding: 8rem 5rem;
  background-color: var(--text-main);
  color: var(--bg-primary);
  width: 94%;
  max-width: 1800px;
  margin: 0 auto;
}

.metodologia-section .section-header h2 {
  color: var(--bg-primary);
}

.metodologia-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem;
  margin-top: 5rem;
}

.metodologia-step {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 2rem;
}

.step-num {
  font-size: 3rem;
  font-weight: 200;
  color: var(--accent);
  margin-bottom: 1rem;
}

.metodologia-step h4 {
  color: var(--bg-primary);
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.metodologia-step p {
  color: rgba(255,255,255,0.82);
  font-size: 1rem;
  line-height: 1.65;
}

.parallax-img {
  will-change: transform;
}

/* Datos Ficticios (Iconos) */
.stats-icons-section {
  padding: 2rem 0 4rem;
  background: var(--bg-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  text-align: center;
}

.stat-box {
  padding: 2rem;
  transition: transform 0.4s ease;
  border: 1px solid rgba(0,0,0,0.03);
  border-radius: 8px;
}

.stat-box:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.04);
}

.stat-icon {
  width: 45px;
  height: 45px;
  margin: 0 auto 1.5rem;
  /* Stroke color is handled in SVG directly with var(--accent) */
}

.stat-value {
  font-size: 3rem;
  font-weight: 200;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.stat-value::first-letter {
  color: var(--accent); /* Resaltando sutilmente un elemento con naranja */
}

.stat-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

/* ======================================================= */
/* SPLIT REVEAL SECTION (INTERACTIVE) */
/* ======================================================= */
.split-reveal-section {
  position: relative;
  width: 98%;
  max-width: 1800px;
  height: 85vh;
  min-height: 600px;
  overflow: hidden;
  --clip-pos: 50%;
  --gray-left: 50%;
  --gray-right: 50%;
  --op-left: 0;
  --op-right: 0;
  background: #000;
  margin: 5rem auto 10rem;
  box-shadow: 0 30px 60px rgba(0,0,0,0.1);
}

.split-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}

.split-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.split-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 550px;
  padding: 3rem;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: opacity 0.1s linear;
  pointer-events: none; /* so it doesn't block the slider interaction if hovered */
}

/* Re-enable pointer events for the buttons inside */
.split-content a.btn {
  pointer-events: auto;
}

.split-content.left {
  margin-right: auto;
  margin-left: 5%;
}

.split-content.right {
  margin-left: auto;
  margin-right: 5%;
  text-align: right;
}

.split-industrial .split-bg {
  filter: grayscale(var(--gray-left)) brightness(0.65);
}

.split-industrial .split-content {
  opacity: var(--op-left);
}

.split-residencial {
  clip-path: polygon(var(--clip-pos) 0, 100% 0, 100% 100%, calc(var(--clip-pos) - 15%) 100%);
  z-index: 2;
}

.split-residencial .split-bg {
  filter: grayscale(var(--gray-right)) brightness(0.85);
}

.split-residencial .split-content {
  opacity: var(--op-right);
}

/* Separator Line */
.split-separator-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--accent);
  clip-path: polygon(calc(var(--clip-pos) - 1px) 0, calc(var(--clip-pos) + 1px) 0, calc(var(--clip-pos) - 15% + 1px) 100%, calc(var(--clip-pos) - 15% - 1px) 100%);
  z-index: 3;
  pointer-events: none;
}

/* Handle */
.split-handle {
  position: absolute;
  top: 50%;
  left: calc(var(--clip-pos) - 7.5%);
  width: 50px;
  height: 50px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.split-subtitle {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  display: block;
  margin-bottom: 1rem;
}

.split-title {
  font-size: 3.5rem;
  font-weight: 300;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.split-desc {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.88);
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

/* ======================================================= */
/* ENLACES LEGALES PIE DE PÁGINA & BANNER DE COOKIES       */
/* ======================================================= */
.footer {
  color: #b8c2cc;
}

.footer-bottom {
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.footer-legal-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-legal-links a {
  color: #b8c2cc;
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-legal-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  max-width: 560px;
  background: #15202b;
  color: #f3f4f6;
  padding: 1.5rem 1.75rem;
  z-index: 9998;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  border-left: 3px solid var(--accent);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.88rem;
  line-height: 1.55;
  animation: fadeIn 0.4s ease forwards;
}

.cookie-banner p {
  margin: 0;
  color: #e5e7eb;
}

.cookie-banner a {
  color: #ffffff;
  text-decoration: underline;
  font-weight: 500;
}

.cookie-banner-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 0.65rem 1.35rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.25s ease;
}

.cookie-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.cookie-btn.primary:hover {
  background: #c94e18;
  border-color: #c94e18;
}

.cookie-btn:hover {
  border-color: #ffffff;
}

/* ======================================================= */
/* MENÚ MÓVIL Y DISEÑO RESPONSIVE INTEGRAL                 */
/* ======================================================= */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  width: 34px;
  height: 26px;
  position: relative;
  z-index: 1002;
  cursor: pointer;
  padding: 0;
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #ffffff;
  margin: 6px 0;
  transition: transform 0.35s ease, opacity 0.35s ease, background-color 0.35s ease;
}

.navbar.scrolled .mobile-menu-toggle span,
.navbar.navbar-dark .mobile-menu-toggle span,
.navbar.menu-open .mobile-menu-toggle span {
  background-color: var(--text-main);
}

.navbar.menu-open .mobile-menu-toggle span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.navbar.menu-open .mobile-menu-toggle span:nth-child(2) {
  opacity: 0;
}

.navbar.menu-open .mobile-menu-toggle span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Desactivar cursor personalizado en pantallas táctiles */
@media (hover: none), (pointer: coarse) {
  body, a, .btn, button {
    cursor: auto !important;
  }
  .custom-cursor {
    display: none !important;
  }
}

@media (max-width: 1200px) {
  .navbar, .navbar.scrolled {
    padding: 1.5rem 2.5rem;
  }
  .container {
    padding: 0 2.5rem;
  }
  .filosofia-section, .metodologia-section {
    padding: 6rem 2.5rem;
  }
  .filosofia-grid {
    gap: 4rem;
  }
  .metodologia-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer {
    padding: 6rem 2.5rem 2.5rem;
  }
  .footer-content {
    gap: 3rem;
  }
}

@media (max-width: 900px) {
  .mobile-menu-toggle {
    display: block;
  }
  .navbar, .navbar.scrolled {
    padding: 1.25rem 1.5rem;
  }
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(82vw, 340px);
    height: 100vh;
    background-color: #ffffff;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 4rem 2.5rem;
    gap: 2rem;
    box-shadow: -15px 0 40px rgba(0, 0, 0, 0.15);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1001;
  }
  .navbar.menu-open .nav-links {
    right: 0;
  }
  .nav-links .nav-link {
    color: var(--text-main) !important;
    font-size: 1.25rem;
  }
  .hero-title {
    font-size: clamp(2.1rem, 7vw, 3.2rem) !important;
    padding: 0 1rem;
  }
  .page-title, .contact-title, .detail-title {
    font-size: clamp(2.1rem, 7.5vw, 3.4rem) !important;
  }
  .contact-header {
    height: 55vh !important;
    min-height: 380px !important;
  }
  .contact-grid, .detail-info-grid {
    grid-template-columns: 1fr !important;
    gap: 3.5rem !important;
    padding: 4.5rem 0 !important;
  }
  .contact-info-block h3 {
    font-size: 2.3rem !important;
    margin-bottom: 2rem !important;
  }
  .contact-item p, .contact-item a {
    font-size: 1.35rem !important;
  }
  .recent-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem !important;
  }
  .section-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.5rem !important;
  }
  .filosofia-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .filosofia-content {
    column-count: 1;
  }
  .filosofia-title {
    font-size: 2.4rem;
  }
  .spec-title {
    font-size: 1.5rem;
  }
  .spec-num {
    width: 55px;
    font-size: 1.2rem;
  }
  .spec-img-preview {
    display: none !important;
  }
  .spec-desc {
    max-height: none;
    opacity: 1;
    margin-top: 0.5rem;
    transform: none !important;
  }
  .split-reveal-section {
    height: 70vh;
    min-height: 480px;
    margin: 3rem auto 5rem;
  }
  .split-content {
    max-width: 88%;
    padding: 1.75rem;
  }
  .split-title {
    font-size: 2rem;
  }
  .split-desc {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 3.5rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 1.25rem;
  }
  .filosofia-section, .metodologia-section {
    padding: 4rem 1.5rem;
    width: 100%;
  }
  .metodologia-grid, .stats-grid, .recent-grid {
    grid-template-columns: 1fr !important;
  }
  .cta-title {
    font-size: clamp(1.9rem, 7vw, 2.6rem) !important;
  }
  .btn {
    padding: 1rem 1.8rem;
    font-size: 0.78rem;
  }
  .footer {
    padding: 4.5rem 1.25rem 2rem;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .cookie-banner {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    padding: 1.25rem;
  }
}
