/* ============================================================
   CILAN — sitio institucional one-page
   Estética: azul marino #0b2a41 + verde lima #a0ce4e, tipografías
   Lato (titulares) / Poppins (texto). Basado en insumos/WebCILAN.
   Transiciones: barra de progreso, nav que se solidifica, reveals
   escalonados por IntersectionObserver (inspirado en opcion-b).
   ============================================================ */

:root {
  --navy: #0b2a41;
  --navy-2: #002e5b;
  --green: #a0ce4e;
  --green-dark: #87b53a;
  --paper: #ffffff;
  --paper-2: #f2f2f2;
  --ink: #0b2a41;
  --ink-soft: #51606e;
  --muted: #7c8792;
  --line: rgba(11, 42, 65, 0.12);
  --overlay: rgba(0, 46, 91, 0.9);
  --display: "Lato", system-ui, sans-serif;
  --body: "Poppins", system-ui, sans-serif;
  --pad: clamp(20px, 6vw, 96px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 26px 60px -34px rgba(11, 42, 65, 0.5);
  --topbar-h: 38px;
  --nav-h: 74px;
}

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

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- BARRA DE PROGRESO ---------- */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px; width: 0;
  background: var(--green);
  z-index: 400;
  transition: width 0.15s linear;
}

/* ---------- TOP BAR ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: center;
  gap: clamp(14px, 4vw, 52px);
  background: var(--navy);
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  z-index: 300;
}
.topbar b { color: var(--green); font-weight: 600; }
.topbar span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.topbar .ico { color: var(--green); font-size: 14px; }
@media (max-width: 780px) { .topbar span:nth-child(2) { display: none; } }
@media (max-width: 560px) { .topbar { font-size: 11.5px; gap: 14px; } }

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: var(--topbar-h); left: 0; right: 0;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad);
  z-index: 290;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s;
}
.nav.solid {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
  box-shadow: 0 12px 30px -26px rgba(11, 42, 65, 0.6);
}
.nav__brand { display: flex; align-items: center; gap: 12px; }
.nav__brand img { height: 50px; width: auto; transition: filter 0.45s var(--ease); }
/* Sobre el hero el logo (negro) se invierte a blanco. */
.nav:not(.solid) .nav__brand img { filter: brightness(0) invert(1); }
.nav__links { display: flex; align-items: center; gap: clamp(10px, 1.6vw, 26px); list-style: none; }
.nav__links a {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.92);
  padding: 6px 2px;
  position: relative;
  transition: color 0.3s;
}
.nav:not(.solid) .nav__links a:hover { color: var(--green); }
.nav.solid .nav__links a { color: var(--ink-soft); }
.nav.solid .nav__links a:hover,
.nav__links a.active { color: var(--green); }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px;
  height: 2px; background: var(--green); transition: right 0.35s var(--ease);
}
.nav__links a:hover::after, .nav__links a.active::after { right: 0; }
.nav__links .nav__blog {
  border: 1.5px solid currentColor;
  border-radius: 30px;
  padding: 6px 16px;
}
.nav__links .nav__blog::after { display: none; }
.nav__toggle {
  display: none;
  background: none; border: 0; cursor: pointer;
  width: 42px; height: 42px; color: currentColor; font-size: 22px;
}
.nav:not(.solid) .nav__toggle { color: #fff; }
.nav.solid .nav__toggle { color: var(--ink); }
@media (max-width: 900px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: fixed; top: calc(var(--topbar-h) + var(--nav-h)); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    max-height: 0; overflow: hidden;
    transition: max-height 0.4s var(--ease);
  }
  .nav__links.open { max-height: 70vh; }
  .nav__links a, .nav.solid .nav__links a { color: var(--ink); padding: 16px var(--pad); }
  .nav__links a::after { display: none; }
  .nav__links .nav__blog { border: 0; border-radius: 0; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  padding: calc(var(--topbar-h) + var(--nav-h) + 40px) var(--pad) 90px;
  overflow: hidden;
  color: #fff;
}
.hero__bg, .hero__bg::after { position: absolute; inset: 0; }
.hero__bg {
  background-size: cover; background-position: center;
  transform: scale(1.06);
  animation: kenburns 22s ease-in-out infinite alternate;
}
.hero__bg--a { background-image: url("../img/hero/slider-1.jpg"); animation: heroA 16s ease-in-out infinite, kenburns 22s ease-in-out infinite alternate; }
.hero__bg--b { background-image: url("../img/hero/slider-2.jpg"); animation: heroB 16s ease-in-out infinite, kenburns 22s ease-in-out infinite alternate; }
.hero__overlay {
  position: absolute; inset: 0; z-index: 1;
}
.hero__inner { position: relative; z-index: 2; width: min(1180px, 100%); margin-inline: auto; }
.hero .kicker { color: var(--green); }
.hero h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(42px, 7.5vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.hero h1 em { font-style: normal; color: var(--green); }
.hero__lead {
  margin-top: 22px;
  font-size: clamp(17px, 2vw, 24px);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.88);
  max-width: 62ch;
}
.hero__cta { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 16px; }
.hero__scroll {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 2; color: rgba(255, 255, 255, 0.7); font-size: 12px;
  letter-spacing: 0.22em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.hero__scroll::after {
  content: ""; width: 1px; height: 34px; background: linear-gradient(var(--green), transparent);
  animation: drop 1.8s ease-in-out infinite;
}
@keyframes kenburns { from { transform: scale(1.04); } to { transform: scale(1.12); } }
@keyframes heroA { 0%, 45% { opacity: 1; } 55%, 95% { opacity: 0; } 100% { opacity: 1; } }
@keyframes heroB { 0%, 45% { opacity: 0; } 55%, 95% { opacity: 1; } 100% { opacity: 0; } }
@keyframes drop { 0% { transform: scaleY(0); transform-origin: top; } 45% { transform: scaleY(1); transform-origin: top; } 55% { transform: scaleY(1); transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- BOTONES ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700;
  font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 16px 30px; border-radius: 4px; border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s, transform 0.3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--green); color: var(--navy); }
.btn--primary:hover { background: var(--green-dark); }
.btn--ghost { border-color: rgba(255, 255, 255, 0.65); color: #fff; }
.btn--ghost:hover { border-color: var(--green); color: var(--green); }
.btn--dark { background: var(--navy); color: #fff; }
.btn--dark:hover { background: var(--navy-2); }

/* ---------- SECCIONES ---------- */
.section { padding: clamp(64px, 10vh, 128px) var(--pad); position: relative; }
.section--alt { background: var(--paper-2); }
.container { width: min(1180px, 100%); margin-inline: auto; }
.section > .container > h2, .section__head { margin-bottom: 8px; }
h2 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
}
h2 .thin { font-weight: 300; color: var(--ink-soft); }
h3 { font-family: var(--display); font-weight: 700; font-size: clamp(20px, 2.2vw, 30px); line-height: 1.15; }
.kicker {
  font-family: var(--display); font-weight: 700;
  font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--green-dark); margin-bottom: 12px;
}
.rule { width: 78px; height: 4px; border-radius: 3px; background: var(--green); margin: 18px 0 30px; }
.lead { font-size: clamp(16px, 1.7vw, 21px); font-weight: 300; color: var(--ink-soft); max-width: 66ch; }
.section__intro { margin-bottom: clamp(28px, 5vh, 56px); }
.center { text-align: center; }
.center .rule { margin-inline: auto; }

/* ---------- VALORES ---------- */
.values { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 2vw, 30px); }
@media (max-width: 900px) { .values { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .values { grid-template-columns: 1fr; } }
.value {
  padding: 30px 24px; border: 1px solid var(--line); border-radius: 14px;
  background: #fff; box-shadow: var(--shadow);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s;
}
.value:hover { transform: translateY(-6px); border-color: rgba(160, 206, 78, 0.7); }
.value__ico {
  width: 58px; height: 58px; border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(160, 206, 78, 0.16); color: var(--green-dark);
  font-size: 26px; margin-bottom: 18px;
}
.value h3 { font-size: 19px; margin-bottom: 8px; }
.value p { font-size: 14.5px; color: var(--ink-soft); font-weight: 300; }

/* ---------- SERVICIOS (grilla) ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.2vw, 30px); }
@media (max-width: 980px) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .services { grid-template-columns: 1fr; } }
.svc {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.svc:hover { transform: translateY(-8px); box-shadow: 0 34px 70px -36px rgba(11, 42, 65, 0.6); }
.svc__img { aspect-ratio: 540 / 390; overflow: hidden; background: var(--navy); }
.svc__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.svc:hover .svc__img img { transform: scale(1.06); }
.svc__body { padding: 24px 24px 28px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.svc__body h3 { font-size: 20px; }
.svc__body p { font-size: 14.5px; color: var(--ink-soft); font-weight: 300; flex: 1; }
.svc__more {
  font-family: var(--display); font-weight: 700; font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--green-dark);
  display: inline-flex; align-items: center; gap: 8px;
}
.svc__more::after { content: "\2192"; transition: transform 0.3s var(--ease); }
.svc:hover .svc__more::after { transform: translateX(5px); }

/* ---------- DETALLE DE SERVICIOS ---------- */
.svc-detail { scroll-margin-top: calc(var(--topbar-h) + var(--nav-h) + 10px); }
.svc-detail + .svc-detail { border-top: 1px solid var(--line); }
.svc-detail__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
/* Alterna el lado de la imagen sin depender de la posición en el DOM. */
.svc-detail--flip .svc-detail__media { order: 2; }
@media (max-width: 820px) {
  .svc-detail__grid { grid-template-columns: 1fr; }
  .svc-detail--flip .svc-detail__media { order: 0; }
}
.svc-detail__media img { border-radius: 16px; box-shadow: var(--shadow); aspect-ratio: 16 / 11; object-fit: cover; }
.svc-detail__body h2 { font-size: clamp(24px, 3vw, 40px); }
.svc-detail__body h4 { font-family: var(--display); font-weight: 700; font-size: 18px; margin: 22px 0 6px; color: var(--ink); }
.svc-detail__body p { color: var(--ink-soft); font-weight: 300; margin-bottom: 12px; }
.clean { list-style: none; display: flex; flex-direction: column; gap: 9px; margin: 6px 0 12px; }
.clean li { position: relative; padding-left: 24px; color: var(--ink-soft); font-weight: 300; }
.clean li strong { color: var(--ink); font-weight: 600; }
.clean li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
}
details.deep { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin: 16px 0; padding: 0 20px; }
details.deep summary { cursor: pointer; font-family: var(--display); font-weight: 700; padding: 16px 0; list-style: none; }
details.deep summary::-webkit-details-marker { display: none; }
details.deep summary::before { content: "+"; color: var(--green-dark); margin-right: 10px; font-weight: 900; }
details.deep[open] summary::before { content: "\2013"; }
details.deep p { padding-bottom: 14px; }

/* ---------- EMPRESA ---------- */
.empresa-hero {
  position: relative; color: #fff; overflow: hidden;
  background: url("../img/empresa/about.jpg") center / cover no-repeat;
}
.empresa-hero::before { content: ""; position: absolute; inset: 0; background: var(--overlay); }
.empresa-hero .container { position: relative; z-index: 1; }
.quote { max-width: 860px; }
.quote blockquote {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(21px, 2.6vw, 34px); line-height: 1.35; letter-spacing: -0.01em;
}
.quote blockquote::before { content: "\201C"; color: var(--green); font-size: 1.4em; line-height: 0; vertical-align: -0.25em; margin-right: 4px; }
.quote__sig { margin-top: 26px; display: flex; align-items: center; gap: 14px; }
.quote__sig .who { font-weight: 600; }
.quote__sig .role { color: rgba(255, 255, 255, 0.72); font-size: 14px; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 30px); margin: 40px 0; }
@media (max-width: 820px) { .pillars { grid-template-columns: 1fr; } }
.pillar {
  display: flex; align-items: center; gap: 16px;
  padding: 22px 24px; background: #fff; border: 1px solid var(--line); border-radius: 14px;
}
.pillar__ico {
  flex: 0 0 54px; height: 54px; border-radius: 12px;
  display: grid; place-items: center; background: rgba(160, 206, 78, 0.16);
  color: var(--green-dark); font-size: 24px;
}
.pillar h3 { font-size: 17px; }
.empresa-cols { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(24px, 4vw, 60px); align-items: center; }
@media (max-width: 820px) { .empresa-cols { grid-template-columns: 1fr; } }
.empresa-cols img { border-radius: 16px; box-shadow: var(--shadow); }
.empresa-cols p { color: var(--ink-soft); font-weight: 300; margin-bottom: 14px; }

/* ---------- CLIENTES ---------- */
.clients { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(18px, 3vw, 44px); align-items: center; margin-top: 34px; }
@media (max-width: 900px) { .clients { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .clients { grid-template-columns: repeat(2, 1fr); gap: 24px; } }
.clients img {
  height: clamp(32px, 4vw, 54px); width: auto; max-width: 100%;
  object-fit: contain; margin-inline: auto;
  filter: grayscale(1); opacity: 0.7;
  transition: filter 0.4s var(--ease), opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.clients img:hover { filter: none; opacity: 1; transform: scale(1.05); }

/* ---------- CONTACTO ---------- */
.contact { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(24px, 4vw, 60px); }
@media (max-width: 820px) { .contact { grid-template-columns: 1fr; } }
.contact__info { display: flex; flex-direction: column; gap: 22px; }
.contact__item { display: flex; gap: 16px; align-items: flex-start; }
.contact__item .ico {
  flex: 0 0 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(160, 206, 78, 0.16); color: var(--green-dark); font-size: 20px;
}
.contact__item h4 { font-family: var(--display); font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 3px; }
.contact__item p, .contact__item a { color: var(--ink); font-weight: 400; }
.contact__item a:hover { color: var(--green-dark); }
.form { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(22px, 3vw, 38px); box-shadow: var(--shadow); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form__row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  font-family: var(--body); font-size: 15px; color: var(--ink);
  padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(160, 206, 78, 0.22);
}
.field textarea { resize: vertical; min-height: 120px; }
.form__note { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

/* ---------- FOOTER ---------- */
.foot { background: var(--navy); color: rgba(255, 255, 255, 0.72); padding: clamp(48px, 8vh, 90px) var(--pad) 30px; }
.foot__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(24px, 4vw, 60px); }
@media (max-width: 760px) { .foot__grid { grid-template-columns: 1fr; } }
.foot img { height: 40px; filter: brightness(0) invert(1); margin-bottom: 16px; }
.foot h5 { font-family: var(--display); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green); margin-bottom: 14px; }
.foot a { transition: color 0.3s; }
.foot a:hover { color: var(--green); }
.foot ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.foot__bottom {
  margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 13px; color: rgba(255, 255, 255, 0.55);
}

/* ---------- TRANSICIONES (reveals) ---------- */
.rv { opacity: 0; transform: translateY(34px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.rv.left { transform: translateX(-42px); }
.rv.right { transform: translateX(42px); }
.rv.zoom { transform: scale(0.94); }
.rv.in { opacity: 1; transform: none; }
.stg > * { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.stg.in > * { opacity: 1; transform: none; }
.stg.in > *:nth-child(2) { transition-delay: 0.09s; }
.stg.in > *:nth-child(3) { transition-delay: 0.18s; }
.stg.in > *:nth-child(4) { transition-delay: 0.27s; }
.stg.in > *:nth-child(5) { transition-delay: 0.36s; }
.stg.in > *:nth-child(6) { transition-delay: 0.45s; }

/* ---------- ACCESIBILIDAD ---------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 500;
  background: var(--green); color: var(--navy); padding: 10px 18px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .rv, .stg > * { opacity: 1 !important; transform: none !important; }
}
