/* ── RESET ─────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
 
/* ── VARIABLES ──────────────────────────────────────────── */
:root {
  --clay:         #b85c38;
  --clay-light:   #d4785a;
  --clay-pale:    #f2e5dc;
  --forest:       #1e3d30;
  --forest-mid:   #2d5c44;
  --forest-light: #e4ede8;
  --forest-cream: #F7EFE1;   /* fondo crema cálido para hero-left */
  --forest-muted: #d8c8af;   /* hover suave para logo cards       */
  --sand:         #f5efe6;
  --sand-dark:    #ebe0d0;
  --obsidian:     #1a1814;
  --obsidian-mid: #33312c;
  --stone:        #5a5550;
  --parchment:    #faf7f2;
  --fondo:        radial-gradient(circle at top right, rgba(210,235,233,1) 0%, rgba(245,243,240,1) 50%, rgba(219,134,111,0.3) 100%);
  --gold:         #c4973a;
  --arrow:        #5b9391;
}
 
/* ── BASE ───────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--parchment);
  color: var(--obsidian);
  overflow-x: hidden;
}
 
/* ── NOISE TEXTURE OVERLAY ──────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}
 
/* ── NAV ────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 250;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 3rem;
  background: rgba(250,247,242,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(90,85,80,0.12);
  transition: padding 0.4s ease;
}
nav.scrolled { padding: 0.8rem 3rem; }
.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--obsidian);
  text-decoration: none;
  text-transform: uppercase;
}
.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-links a {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.3s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1.5px;
  background: var(--clay);
  transition: width 0.35s cubic-bezier(0.4,0,0.2,1);
}
.nav-links a:hover,
.nav-links a.active { color: var(--clay); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* ── NAV TOGGLE (hamburguesa) ───────────────────────────── */
.nav-toggle {
  display: none;               /* oculto en desktop */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 210;
  position: relative;
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--obsidian);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animación a icono "X" cuando el menú está abierto */
.nav-toggle.open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── OVERLAY detrás del menú lateral ────────────────────── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 20, 0.55);
  z-index: 190;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.nav-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── RESPONSIVE: menú lateral deslizante ────────────────── */
@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--parchment);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 6rem 2rem 2rem;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 200;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid rgba(90, 85, 80, 0.12);
  }

  .nav-links a {
    display: block;
    padding: 1.1rem 0;
    font-size: 0.85rem;
  }

  /* La rayita animada de subrayado (::after) no aplica bien en
     layout vertical; se desactiva en el menú móvil */
  .nav-links a::after {
    display: none;
  }
}

/* ── SCROLL REVEAL ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.85s cubic-bezier(0.16,1,0.3,1),
              transform  0.85s cubic-bezier(0.16,1,0.3,1);
}
.reveal.up          { opacity: 1; transform: none; }
.reveal-delay-1     { transition-delay: 0.10s; }
.reveal-delay-2     { transition-delay: 0.22s; }
.reveal-delay-3     { transition-delay: 0.34s; }
.reveal-delay-4     { transition-delay: 0.46s; }
.reveal-delay-5     { transition-delay: 0.58s; }
.reveal-delay-6     { transition-delay: 0.70s; }
 
/* ── HERO ───────────────────────────────────────────────── */
#hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
  position: relative;
  overflow: hidden;
}
.hero-left {
  background: var(--forest-cream);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 5rem 5rem;
  position: relative;
  order: 1;
}
.hero-left::after {
  content: '';
  position: absolute;
  right: -1px; top: 0; bottom: 0;
  width: 80px;
  background: var(--parchment);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  z-index: 1;
}
.hero-kicker {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.5rem;
  color: var(--clay);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}
.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 700;
  line-height: 1.06;
  color: #331A0F;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}
.hero-title em {
  font-style: italic;
  font-weight: 300;
  color: rgba(26,24,20,0.60);
}
.hero-desc {
  font-size: 0.9rem;
  line-height: 1.8;
  color: rgba(0,0,0,0.85);
  margin-bottom: 2.5rem;
  font-weight: 300;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--clay);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.3s, transform 0.3s;
  width: fit-content;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background: var(--clay-light); transform: translateY(-2px); }
.btn-primary svg   { width: 14px; height: 14px; }
 
.hero-right {
  position: relative;
  overflow: hidden;
  order: 2;
  min-height: 420px;
  align-self: stretch;
}
.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.hero-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(30,61,48,0.35) 0%, rgba(184,92,56,0.18) 100%);
}
.hero-stat {
  position: absolute;
  bottom: 2rem; right: 2rem;
  background: var(--clay);
  color: #fff;
  padding: 1.2rem 1.5rem;
  border-radius: 2px;
  text-align: center;
  backdrop-filter: blur(4px);
}
.hero-stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  display: block;
}
.hero-stat-label {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-top: 0.3rem;
  display: block;
}
.hero-badge {
  position: absolute;
  top: 2rem; left: 2rem;
  background: rgba(250,247,242,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(90,85,80,0.15);
  border-radius: 2px;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hero-badge-dot {
  width: 7px; height: 7px;
  background: var(--clay);
  border-radius: 50%;
  animation: blink 1.6s ease-in-out infinite;
}
.hero-badge-text {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone);
  font-weight: 500;
}

/* ── KEYFRAMES ──────────────────────────────────────────── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}
@keyframes wave {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(0.3); }
}
.wave-bar {
  transform-box: fill-box;
  transform-origin: center;
  animation: wave 1.4s ease-in-out infinite;
}

/* ── DECORATIVE DIVIDER ─────────────────────────────────── */
.divider {
  text-align: center;
  padding: 4rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--stone);
  letter-spacing: 0.05em;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  max-width: 200px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(90,85,80,0.3), transparent);
}

/* ── QUÉ HACEMOS ────────────────────────────────────────── */
#que-hacemos {
  padding: 6rem 0 8rem;
  min-height: 100vh;
  background: var(--fondo);
}
.section-header {
  padding: 0 5rem;
  margin-bottom: 5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: end;
}
.section-label {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.section-label::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--clay);
  display: inline-block;
}
.section-label--center { justify-content: center; }
.section-label--light  { color: rgba(26,24,20,0.50); }

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--obsidian);
  letter-spacing: -0.02em;
}
.section-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--stone);
}
.section-title--center { text-align: center; }

.section-desc {
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--stone);
  font-weight: 300;
}

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(90,85,80,0.1);
  margin: 0 5rem;
}
.card {
  background: var(--parchment);
  padding: 3rem 2.5rem;
  position: relative;
  transition: background 0.35s;
  cursor: pointer;
}
.card:hover { background: var(--sand); }
.card:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 4px;
}

.card-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 4rem;
  font-weight: 700;
  color: rgba(90,85,80,0.08);
  line-height: 1;
  margin-bottom: 1rem;
  letter-spacing: -0.04em;
  user-select: none;
}
.card-icon {
  width: 40px; height: 40px;
  margin-bottom: 1.2rem;
  color: var(--clay);
}
.card-title {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--obsidian);
  margin-bottom: 0.8rem;
}
.card-text {
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--stone);
  font-weight: 300;
}
.card-accent {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--clay);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
}
.card:hover .card-accent { transform: scaleX(1); }

.card.featured { background: var(--obsidian); }
.card.featured:hover { background: var(--obsidian-mid); }
.card.featured .card-num    { color: rgba(255,255,255,0.06); }
.card.featured .card-icon   { color: var(--gold); }
.card.featured .card-title  { color: rgba(255,255,255,0.5); }
.card.featured .card-text   { color: rgba(255,255,255,0.75); }
.card.featured .card-accent { background: var(--gold); }

/* ── Modal de detalle ─────────────────────────────── */
.card-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.card-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.card-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.card-modal-box {
  position: relative;
  background: #fff;
  max-width: 520px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  transform: translateY(0) scale(1);
  transition: transform 0.25s ease;
}

.card-modal.hidden .card-modal-box {
  transform: translateY(20px) scale(0.97);
}

.card-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #888;
}

.card-modal-close:hover {
  color: #b85c38;
}

#card-modal-title {
  margin: 0 0 16px 0;
  padding-right: 24px;
  color: #b85c38;
  font-size: 1.5rem;
}

#card-modal-desc {
  margin: 0;
  color: #333;
  line-height: 1.6;
  font-size: 1rem;
}

/* ── PDF MODAL ─────────────────────────────────────────── */
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.pdf-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.pdf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.pdf-modal-box {
  position: relative;
  background: var(--parchment);
  width: 100%;
  max-width: 900px;
  height: 90vh;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  transform: scale(0.97) translateY(12px);
  transition: transform 0.25s ease;
}

.pdf-modal.hidden .pdf-modal-box {
  transform: scale(0.95) translateY(20px);
}

.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(90, 85, 80, 0.15);
  background: var(--parchment);
  flex-shrink: 0;
}

.pdf-modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--obsidian);
}

.pdf-modal-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pdf-modal-link {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clay);
  text-decoration: none;
  white-space: nowrap;
}
.pdf-modal-link:hover { text-decoration: underline; }

.pdf-modal-close {
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--stone);
  padding: 0 0.2rem;
}
.pdf-modal-close:hover { color: var(--clay); }

.pdf-modal-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: var(--obsidian-mid);
}

/* Responsive: en móvil el modal ocupa casi toda la pantalla */
@media (max-width: 700px) {
  .pdf-modal { padding: 0.75rem; }
  .pdf-modal-box { height: 94vh; }
  .pdf-modal-title { font-size: 0.95rem; }
  .pdf-modal-link { display: none; } /* poco útil en móvil, iframe ya ocupa todo */
}

/* ── INTERLUDE BANNER ───────────────────────────────────── */
.interlude {
  background: var(--forest-cream);
  color: var(--obsidian);
  padding: 5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}
.interlude-quote {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.35;
  color: var(--obsidian-mid)
}
.interlude-quote strong {
  font-weight: 700;
  font-style: normal;
  color: var(--obsidian)
}
.interlude-right { display: flex; flex-direction: column; gap: 2rem; }
.interlude-stat {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--forest-muted);
}
.interlude-stat:last-child { border-bottom: none; }
.interlude-stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--obsidian-mid)
}
.interlude-stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--obsidian);
  margin-top: 0.3rem;
}

/* ── CÓMO LO HACEMOS ────────────────────────────────────── */

#como-lo-hacemos {
  padding: 8rem 5rem;
  background: var(--fondo);
}
.process-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: end;
  margin-bottom: 5rem;
}
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem;
  position: relative;
}
.process-grid::before {
  content: '';
  position: absolute;
  top: 2.5rem; left: 2.5rem; right: 2.5rem;
  height: 1px;
  background: linear-gradient(to right, var(--clay), rgba(90,85,80,0.2));
}
.process-step { position: relative; }
.step-number {
  width: 5rem; height: 5rem;
  border-radius: 50%;
  background: var(--parchment);
  border: 1px solid rgba(90,85,80,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  position: relative;
  transition: background 0.3s, border-color 0.3s;
}
.process-step:hover .step-number { background: var(--clay); border-color: var(--clay); }
.step-icon {
  width: 22px; height: 22px;
  color: var(--clay);
  transition: color 0.3s;
}
.process-step:hover .step-icon { color: #fff; }
.step-num-label {
  position: absolute;
  top: -0.5rem; right: -0.5rem;
  width: 1.4rem; height: 1.4rem;
  background: var(--obsidian);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 500;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--obsidian);
  margin-bottom: 0.6rem;
}
.step-text {
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--stone);
  font-weight: 300;
}
.process-cta {
  margin-top: 5rem;
  padding-top: 4rem;
  border-top: 1px solid rgba(90,85,80,0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.cta-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  color: var(--obsidian);
  max-width: 480px;
  line-height: 1.3;
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  border: 1.5px solid var(--obsidian);
  color: var(--obsidian);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 1rem 2.2rem;
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.3s;
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
}
.btn-outline:hover { background: var(--obsidian); color: #fff; }
.btn-outline svg   { width: 14px; height: 14px; }

/* Grid del Diagrama */
.diagram-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px 40px;
  position: relative;
  margin-bottom: 50px;
  max-width: 700px;      /* ← igual que .arrows-svg */
  margin-inline: auto;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  margin-bottom: 15px;
}

.icon-wrapper {
  width: 90px;
  height: 90px;
  background-color: rgba(245, 230, 211, 0.5);
  border-radius: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.5rem;
  color: #4a6b6c;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Estilo específico para simular el icono de análisis de la imagen */
.icon-wrapper .fa-chart-bar {
    color: #d18266;
}
.icon-wrapper .fa-users {
    color: #4d7c7a;
}

/* SVG para las Flechas Conectoras */
.arrows-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 700px;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.arrow-path {
  fill: none;
  stroke: var(--clay-light);
  stroke-width: 3;
  marker-end: url(#arrowhead);
}

.arrow-path.teal {
  stroke: var(--arrow);
  marker-end: url(#arrowhead-teal);
}

.arrow-path.auto {
  stroke: var(--forest-mid);
  marker-end: url(#arrowhead-auto);
  marker-start: url(#arrowhead-auto);
}

/* Botón Inferior */
.btn-explore {
    background-color: #a3624c;
    color: #ffffff;
    border: none;
    padding: 14px 32px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(163, 98, 76, 0.3);
}

.btn-explore:hover {
    background-color: #8a4f3b;
    transform: translateY(-2px);
}

.btn-explore:active {
    transform: translateY(0);
}

/* Responsivo para pantallas pequeñas: se alinean en una columna y las flechas se ocultan */
@media (max-width: 600px) {
    .diagram-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .arrows-svg {
        display: none;
    }
    h1 {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
}

/* ── ÁREAS DE TRABAJO ───────────────────────────────────── */
#areas-trabajo {
  padding: 7rem 5rem;
  /* min-height: 100vh; */
  background: var(--fondo);
  overflow: hidden;
}
.section-inner  { /*max-width: 900px;*/ margin: 0 auto; }
.areas-header   { text-align: center; margin-bottom: 3.5rem; }
.map-wrapper    { position: relative; /*max-width: 680px;*/ margin: 0 auto; }
.map-svg        { width: 100%; filter: drop-shadow(0 8px 32px rgba(30,61,48,0.13)); }

.legend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
}
.legend-card {
  background: var(--parchment);
  border: 1px solid rgba(90,85,80,0.12);
  border-radius: 2px;
  padding: 1.2rem 1rem;
  text-align: center;
}
.legend-card--yucatan { border-top: 3px solid var(--forest); }
.legend-card--oaxaca  { border-top: 3px solid var(--clay); }
.legend-card--puebla  { border-top: 3px solid var(--gold); }

.legend-card__title {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.legend-card__title--yucatan { color: var(--forest); }
.legend-card__title--oaxaca  { color: var(--clay); }
.legend-card__title--puebla  { color: var(--gold); }
.legend-card__text {
  font-size: 0.78rem;
  color: var(--stone);
  font-weight: 300;
  line-height: 1.6;
}
/* mapa */
#map {
  position: relative;
  z-index: 1; 
  width: 100%;
  height: 600px;
  border: 1px solid var(--obsidian);
}

/* Capa de información detallada sobre el mapa */
#map-info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.25s ease;
}

#map-info-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-content {
  background: var(--parchment);
  padding: 3rem;
  border-radius: 4px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.overlay-content h2 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--forest);
  margin-bottom: 1rem;
}

.overlay-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--stone);
  margin-bottom: 1.5rem;
}

#overlay-close {
  background: var(--clay);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-weight: 500;
}
#overlay-close:hover {
  background: var(--clay-light);
}
#overlay-title {
  margin: 0 0 14px 0;
  padding-right: 20px;
  color: var(--clay);
  font-size: 1.5rem;
}

/* ── INVOLUCRADOS ───────────────────────────────────────── */
#involucrados {
  padding: 6rem 5rem;
  background: var(--forest-cream);
}
.involucrados-header { text-align: center; margin-bottom: 4rem; }
.involucrados-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--obsidian);
}
.involucrados-title em {
  font-style: italic;
  font-weight: 300;
  color: rgba(26,24,20,0.55);
}
.logos-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: rgba(90,85,80,0.15);
}
.logo-card {
  background: var(--forest-cream);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  transition: background 0.3s;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.logo-card:hover { background: var(--forest-muted); }
.logo-icon-circle {
  width: 100px; height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.65);
  border-radius: 50%;
  padding: 1rem;
  max-width: 100px;
  flex-shrink: 1;
}
.logo-img {
  width: 75px; height: 75px;
  object-fit: contain;
  opacity: 0.9;
}
.logo-img--lg { width: 85px; height: 85px; }
.logo-info { text-align: center; }
.logo-org-type {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(26,24,20,0.50);
  margin-bottom: 0.3rem;
}
.logo-org-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--obsidian);
  letter-spacing: 0.02em;
}


/* ── FOOTER ─────────────────────────────────────────────── */
footer {
  color: var(--forest);
  padding: 3.5rem 0 0;
  position: relative;
}
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 0 2.5rem; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer-brand      { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.footer-brand-name { display: flex; align-items: center; gap: 0.8rem; }
.footer-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #2d5c44;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.footer-brand-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--forest);
}
.footer-desc {
  font-size: 0.82rem;
  color: #7a9e90;
  line-height: 1.8;
  font-weight: 300;
  max-width: 380px;
}
.footer-logo {
  height: auto;
  max-height: 40px;
  width: auto;
  max-width: 80%;
  object-fit: contain;
  margin-top: 0.5rem;
}
.footer-col       { display: flex; flex-direction: column; gap: 0.8rem; }
.footer-col-title {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 0.4rem;
}
.footer-link {
  font-size: 0.82rem;
  color: #7a9e90;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-link:hover { color: var(--forest-mid); }
.footer-ethics-text {
  font-size: 0.78rem;
  color: #7a9e90;
  line-height: 1.75;
  font-weight: 300;
}
.footer-social { display: flex; gap: 0.7rem; margin-top: 0.5rem; }
.footer-social-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #1a3028;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: background 0.2s;
}
.footer-social-btn:hover { background: #2d5c44; }
.footer-bottom {
  padding: 1.5rem 0;
  border-top: 1px solid #1a3028;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-copy        { font-size: 0.72rem; color: #4a7060; }
.footer-legal       { display: flex; gap: 1.2rem; align-items: center; }
.footer-legal-link  { font-size: 0.72rem; color: #4a7060; text-decoration: none; }
.footer-legal-link:hover { text-decoration: underline; }
.footer-sep         { color: #2d5c44; }
 
/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  /* Nav */
  nav           { padding: 1rem 1.5rem; }
  .nav-logo     { font-size: 0.95rem; }
  .nav-links    { gap: 1.5rem; }
 
  /* Hero */
  #hero         { grid-template-columns: 1fr; }
  .hero-left    { order: 2; padding: 3rem 2rem 4rem; }
  .hero-left::after { display: none; }
  .hero-right   { order: 1; min-height: 55vw; max-height: 420px; }
 
  /* Que hacemos */
  .section-header { padding: 0 2rem; gap: 1.5rem; margin-bottom: 3rem; }
  .cards-grid     { margin: 0 2rem; }

  /* Como lo hacemos */
  #como-lo-hacemos  { padding: 5rem 2rem; }
  .process-header   { grid-template-columns: 1fr; gap: 1.5rem; margin-bottom: 3rem; }
  .process-grid     { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .process-grid::before { display: none; }
  .process-cta      { flex-direction: column; align-items: flex-start; }
 
  /* Areas de trabajo */
  #areas-trabajo { padding: 4rem 1.5rem; }
  .legend-grid   { grid-template-columns: 1fr; }
 
  /* Involucrados */
  #involucrados  { padding: 4rem 1.5rem; }
  .logos-grid    { grid-template-columns: 1fr 1fr; }

}
@media (max-width: 768px) {
  /*como lo hacemos */
  .step:nth-of-type(1) { order: 2; } /* Grabación de Audio       -> 2do */
  .step:nth-of-type(2) { order: 3; } /* Análisis de Datos        -> 3ro */
  .step:nth-of-type(3) { order: 1; } /* Colaboración Comunitaria -> 1ro */
  .step:nth-of-type(4) { order: 4; } /* Plataforma Digital */
  
  /* Que hacemos */
  .section-header { grid-template-columns: 1fr; padding: 0 2rem; gap: 1.5rem; margin-bottom: 3rem; }
  .cards-grid     { grid-template-columns: 1fr; margin: 0 2rem; }

  /* Interlude */
  .interlude { grid-template-columns: 1fr; padding: 3rem 2rem; gap: 3rem; }

  #map {height: 400px;
  }

  /* Footer */
  footer         { padding: 3rem 0 0; }
  .footer-grid   { grid-template-columns: 1fr; gap: 2rem; }
  .footer-inner  { padding: 0 1.5rem; }

}

@media (max-width: 440px) {
  .logos-grid { grid-template-columns: 1fr; }

}

/* ── MEMORIAS DEL PROYECTO ──────────────────────────────── */
#memorias {
  padding: 7rem 0 8rem;
  background: var(--fondo);
}
.memorias-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5rem;
}
.memorias-header {
  text-align: center;
  margin-bottom: 3rem;
}
.memorias-subtitle {
  font-size: 0.9rem;
  color: var(--stone);
  font-weight: 300;
  line-height: 1.8;
  max-width: 520px;
  margin: 1rem auto 0;
}

/* Filter tabs */
.memorias-filters {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}
.mem-filter {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.55rem 1.3rem;
  border-radius: 2px;
  border: 1.5px solid rgba(90,85,80,0.2);
  background: transparent;
  color: var(--stone);
  cursor: pointer;
  transition: all 0.25s;
}
.mem-filter:hover {
  border-color: var(--clay);
  color: var(--clay);
}
.mem-filter.active {
  background: var(--clay);
  border-color: var(--clay);
  color: #fff;
}

/* Grid */
.memorias-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Item */
.mem-item {
  cursor: pointer;
  border-radius: 2px; 
  overflow: hidden;
  background: var(--sand);
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1),
              box-shadow 0.35s;
}
.mem-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(26,24,20,0.12);
}
.mem-item.hidden { display: none; }

/* Media container */
.mem-media {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}
.mem-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.mem-item:hover .mem-img { transform: scale(1.04); }

/* Hover overlay */
.mem-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,24,20,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.mem-overlay svg { width: 40px; height: 40px; }
.mem-item:hover .mem-overlay { opacity: 1; }

/* Video play icon always visible */
.mem-media--video .mem-overlay { opacity: 1; background: rgba(26,24,20,0.2); }
.mem-media--video:hover .mem-overlay { background: rgba(26,24,20,0.45); }
.mem-play-icon { width: 52px; height: 52px; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4)); }

/* Tags */
.mem-tag {
  position: absolute;
  top: 0.8rem; left: 0.8rem;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--forest);
  color: #fff;
  padding: 0.3rem 0.65rem;
  border-radius: 1px;
}
.mem-tag-video { background: var(--clay); }
.mem-tag-campo { background: var(--stone); }
.mem-tag-comun { background: var(--forest-mid); }

/* Info bar */
.mem-info {
  padding: 1rem 1.2rem 1.2rem;
}
.mem-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--obsidian);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}
.mem-meta {
  font-size: 0.72rem;
  color: var(--stone);
  font-weight: 300;
  letter-spacing: 0.04em;
}

/* ── LIGHTBOX ────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}
.lightbox.open {
  opacity: 1;
  pointer-events: all;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26,24,20,0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lightbox-container {
  position: relative;
  background: var(--parchment);
  border-radius: 3px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 340px;
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  transform: scale(0.94) translateY(16px);
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 32px 80px rgba(0,0,0,0.4);
}
.lightbox.open .lightbox-container {
  transform: scale(1) translateY(0);
}
.lightbox-close {
  position: absolute;
  top: 1rem; right: 1rem;
  z-index: 10;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(26,24,20,0.6);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-close:hover { background: var(--clay); }
.lightbox-close svg { width: 16px; height: 16px; stroke: #fff; }

/* Media side */
.lightbox-media {
  position: relative;
  background: var(--obsidian);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lightbox-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lightbox-media iframe {
  width: 100%;
  height: 100%;
  min-height: 340px;
  border: none;
  display: block;
}

/* Info panel */
.lightbox-panel {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  background: var(--parchment);
}
.lightbox-meta {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clay);
  font-weight: 600;
}
.lightbox-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--obsidian);
}
.lightbox-desc {
  font-size: 0.88rem;
  line-height: 1.85;
  color: var(--stone);
  font-weight: 300;
  flex: 1;
}
.lightbox-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(90,85,80,0.12);
  font-size: 0.78rem;
  color: var(--stone);
}
.lightbox-location svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--clay); }

/* ── RESPONSIVE memorias ────────────────────────────────── */
@media (max-width: 900px) {
  #memorias { padding: 5rem 0 6rem; }
  .memorias-inner { padding: 0 1.5rem; }
  .memorias-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .lightbox-container { grid-template-columns: 1fr; max-height: 92vh; }
  .lightbox-media { min-height: 220px; max-height: 45vw; }
  .lightbox-media iframe { min-height: 220px; }
  .lightbox-panel { padding: 1.5rem; }
}
@media (max-width: 560px) {
  .memorias-grid { grid-template-columns: 1fr; }
  .lightbox-title { font-size: 1.35rem; }
}
