/* ==========================================================================
   APEDT — Estilos de la página de Inicio
   ========================================================================== */

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  color: var(--white);
  overflow: hidden;
  padding: 0;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: linear-gradient(120deg, var(--navy-dark) 0%, var(--navy) 55%, var(--navy-light) 100%);
}

.hero-map-wrap {
  position: absolute;
  top: 50%;
  right: 2%;
  transform: translateY(-50%);
  height: min(92%, 820px);
  width: auto;
  aspect-ratio: 630 / 912;
}
.hero-map-wrap::before {
  content: "";
  position: absolute;
  inset: -12%;
  background: radial-gradient(circle at 62% 46%, rgba(79, 174, 79, 0.4), transparent 62%);
  filter: blur(50px);
  animation: map-glow-shift 6s ease-in-out infinite;
  z-index: -1;
}
@keyframes map-glow-shift {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.hero-map { width: 100%; height: 100%; overflow: visible; }

.peru-region {
  fill: rgba(79, 174, 79, 0.14);
  stroke: rgba(126, 209, 126, 0.85);
  stroke-width: 1.6;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  fill-opacity: 0;
  vector-effect: non-scaling-stroke;
  animation: draw-region 1.1s ease-out forwards, region-pulse 5s ease-in-out infinite 2.6s;
}
@keyframes draw-region {
  0% { stroke-dashoffset: 1; fill-opacity: 0; }
  60% { stroke-dashoffset: 0; fill-opacity: 0; }
  100% { stroke-dashoffset: 0; fill-opacity: 1; }
}
@keyframes region-pulse {
  0%, 100% { fill-opacity: 1; stroke-opacity: 0.85; }
  50% { fill-opacity: 0.55; stroke-opacity: 1; }
}

.map-node { opacity: 0; animation: node-fadein 0.6s ease forwards; }
@keyframes node-fadein { to { opacity: 1; } }
.node-dot { fill: var(--green-light); }
.node-ring {
  fill: none;
  stroke: var(--green-light);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: node-pulse 2.4s ease-out infinite;
}
@keyframes node-pulse {
  0% { r: 2px; stroke-opacity: 0.9; }
  100% { r: 15px; stroke-opacity: 0; }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(8, 27, 48, 0.9) 0%,
    rgba(8, 27, 48, 0.78) 26%,
    rgba(14, 42, 71, 0.42) 50%,
    rgba(14, 42, 71, 0.12) 72%,
    rgba(14, 42, 71, 0) 100%
  );
}
.hero .container { max-width: 1340px; }
.hero-content { max-width: 760px; }
.hero-content .eyebrow { color: var(--green-light); }
.hero-content .eyebrow::before { background: var(--green-light); }
.hero-content h1 {
  color: var(--white);
  font-size: clamp(2.3rem, 4.4vw, 3.25rem);
  font-weight: 900;
  margin-bottom: 34px;
}
.hero-content h1 span {
  color: var(--green-light);
  text-shadow: 0 0 22px rgba(126, 209, 126, 0.55);
  animation: hero-text-glow 3.2s ease-in-out infinite 1.4s;
}
.hero-break { display: none; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-fx { opacity: 0; animation: hero-fade-up 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.hero-fx-1 { animation-delay: 0.15s; }
.hero-fx-2 { animation-delay: 0.35s; }
.hero-fx-3 { animation-delay: 0.6s; }
@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes hero-text-glow {
  0%, 100% { text-shadow: 0 0 14px rgba(126, 209, 126, 0.4); }
  50% { text-shadow: 0 0 30px rgba(126, 209, 126, 0.85); }
}

@media (min-width: 700px) {
  .hero-break { display: inline; }
}

.hero-scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.7);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  font-weight: 800;
  animation: bounce 2.2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ---------- Sobre Nosotros ---------- */
.about { background: var(--white); padding: 0; overflow: hidden; }
.about-split {
  display: grid;
  grid-template-columns: minmax(280px, 40%) 1fr;
  min-height: 660px;
}
.about-media { padding: 0; height: 100%; }
.about-img { position: relative; width: 100%; height: 100%; }
.about-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.about-img-badge {
  position: absolute;
  bottom: 28px;
  right: 28px;
  background: var(--green);
  color: var(--white);
  border-radius: var(--radius);
  padding: 20px 26px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.about-img-badge strong { display: block; font-size: 1.8rem; font-weight: 900; }
.about-img-badge span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

.about-panel {
  background: var(--navy);
  color: rgba(255,255,255,0.92);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px max(24px, calc((100vw - var(--container-width)) / 2 + 24px)) 80px 64px;
}
.about-panel .eyebrow { color: var(--green-light); }
.about-panel .eyebrow::before { background: var(--green-light); }
.about-panel h2 { color: var(--white); font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 22px; }
.about-panel p { color: rgba(255,255,255,0.72); margin-bottom: 16px; font-weight: 600; }

.about-pills { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; }
.about-pill {
  background: var(--cream-warm);
  color: var(--navy);
  font-weight: 800;
  font-size: 0.92rem;
  padding: 15px 30px;
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  transition: all var(--transition);
}
.about-pill:hover { transform: translateX(8px); background: var(--white); }

/* ---------- Metodología ---------- */
.methodology { background: #F5F5F3; padding: 150px 0 140px; }
.methodology .section-heading { margin-bottom: 96px; }

.method-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  height: 340px;
}

.method-line {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.method-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: var(--gray-300);
  transform: translateY(-50%);
  z-index: 0;
}
.method-line::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -80px;
  width: 80px;
  height: 3px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, var(--green-light) 55%, #ffffff 90%, transparent);
  box-shadow: 0 0 12px 2px rgba(79, 174, 79, 0.85), 0 0 24px 4px rgba(79, 174, 79, 0.4);
  z-index: 1;
  animation: line-shine 3.6s linear infinite;
  animation-delay: 2.8s;
  pointer-events: none;
}
@keyframes line-shine {
  0% { left: -80px; }
  100% { left: 100%; }
}

.method-brand {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 22px 24px;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--navy);
  text-align: center;
}

.method-node {
  position: relative;
  z-index: 1;
  flex: 1;
  height: 100%;
  min-width: 0;
}
.method-node .node-inner {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.method-node.top .node-inner { bottom: calc(50% + 14px); }
.method-node.bottom .node-inner { top: calc(50% + 14px); }

.method-node .method-num {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--green);
  margin-bottom: 6px;
}
.method-card {
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 16px 22px;
  min-width: 148px;
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--navy);
  transition: all var(--transition);
}
.method-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }

.method-node .dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  transform: translate(-50%, -50%);
  z-index: 2;
  box-shadow: 0 0 0 4px #F5F5F3;
}
.method-node.top::after,
.method-node.bottom::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 2px;
  height: 14px;
  background: var(--gray-300);
  transform: translateX(-50%);
}
.method-node.top::after { bottom: 50%; }
.method-node.bottom::after { top: 50%; }

.method-result {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--navy);
  color: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 24px 26px;
  text-align: center;
  max-width: 160px;
  transition: all var(--transition);
}
.method-result:hover { transform: translateY(-4px); }
.method-result i { font-size: 1.6rem; color: var(--green-light); }
.method-result span { font-weight: 800; font-size: 0.88rem; line-height: 1.3; }

/* ---------- Aliados (carrusel) ---------- */
.partners { background: var(--white); padding: 56px 0 72px; }
.partners p.partners-label {
  text-align: center;
  color: var(--gray-700);
  font-weight: 600;
  margin-bottom: 40px;
  font-size: 0.92rem;
}
.partners-viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.partners-track {
  display: flex;
  align-items: center;
  gap: 64px;
  width: max-content;
  animation: partners-scroll 40s linear infinite;
}
.partners-viewport:hover .partners-track { animation-play-state: paused; }
.partners-track img {
  height: 46px;
  flex-shrink: 0;
  filter: grayscale(1) opacity(0.6);
  transition: filter var(--transition);
}
.partners-track img:hover { filter: grayscale(0) opacity(1); }

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

/* ---------- Servicios ---------- */
.services-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
  align-items: center;
}
.services-intro h2 { font-size: clamp(1.8rem, 3vw, 2.3rem); margin: 4px 0 18px; }
.services-intro p { color: var(--gray-700); margin-bottom: 28px; }

.services-panel {
  position: relative;
  padding: 10px 4px;
}
.services-accent {
  position: absolute;
  top: -10%;
  left: 42%;
  right: -28px;
  bottom: -5%;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  border-radius: 24px;
  z-index: 0;
}
.services-panel-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.service-card {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: 16px;
  padding: 30px 26px;
  text-align: left;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition);
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.service-card-wide { grid-column: 1 / span 2; max-width: 62%; margin: 0 auto; }
.service-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  background: rgba(60,140,60,0.1);
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 18px;
  transition: all var(--transition);
}
.service-card:hover .service-icon { background: var(--green); color: var(--white); }
.service-card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.service-card p { color: var(--gray-700); font-size: 0.86rem; margin-bottom: 14px; }
.service-card:hover .service-link i { transform: translateX(4px); }


/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .services-layout { grid-template-columns: 1fr; }
  .services-panel { order: 2; }
}

@media (max-width: 900px) {
  .about-split { grid-template-columns: 1fr; min-height: auto; }
  .about-media { padding: 0; height: auto; }
  .about-img { height: auto; }
  .about-img img { aspect-ratio: 4/3; height: auto; }
  .about-panel { padding: 56px 24px; }
  .services-grid { grid-template-columns: 1fr; }
  .about-img-badge { right: 20px; bottom: -18px; padding: 14px 18px; }

  .method-track {
    flex-direction: column;
    height: auto;
    align-items: stretch;
    gap: 18px;
  }
  .method-line {
    flex-direction: column;
    height: auto;
    align-items: stretch;
    gap: 18px;
  }
  .method-line::before, .method-line::after { display: none; }
  .method-node { height: auto; }
  .method-node .node-inner { position: static; transform: none; }
  .method-node .dot { display: none; }
  .method-node.top::after, .method-node.bottom::after { display: none; }
  .method-card { min-width: 0; width: 100%; }
  .method-brand, .method-result { width: 100%; max-width: none; }
  .method-result { flex-direction: row; justify-content: center; }

  .services-panel-grid { grid-template-columns: 1fr; }
  .service-card-wide { grid-column: auto; max-width: 100%; }
  .services-accent { display: none; }
}

@media (max-width: 600px) {
  .hero { min-height: auto; padding: 80px 0 100px; }
  .hero-actions .btn { width: 100%; }
}
