/* ============================================================
   CORE-4 · Sistema de diseño
   Tinta forestal sobre papel hueso · tipografía editorial
   ============================================================ */

:root {
  --ink: #0d2818;
  --ink-soft: #33473c;
  --paper: #f7f6f1;
  --paper-2: #efeee6;
  --green: #1b4332;
  --accent: #40916c;
  --light: #52b788;
  --pale: #d8f3dc;
  /* Variantes de la misma paleta para texto pequeño (contraste ≥ 4,5:1) */
  --accent-text: #2d6a4f; /* sobre papel: 5,9:1 */
  --light-text: #74c69d;  /* sobre verde: 5,4:1 */
  --hairline: rgba(13, 40, 24, 0.14);
  --hairline-dark: rgba(216, 243, 220, 0.16);
  --max: 1120px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--pale); color: var(--green); }

.mono {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------------- Nav ---------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--green);
  text-decoration: none;
}
.wordmark span { color: var(--accent-text); }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--green); }
.nav-tag { color: var(--accent-text); }
.nav-progress {
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.1s linear;
}

/* ---------------- Hero ---------------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 176px 32px 96px;
}
.eyebrow { color: var(--accent-text); display: block; margin-bottom: 28px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 6.2vw, 4.9rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: var(--green);
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.lede {
  max-width: 560px;
  margin-top: 32px;
  font-size: 1.08rem;
  color: var(--ink-soft);
}
.hero-cta { display: flex; gap: 14px; margin-top: 40px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 13px 26px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 999px;
  transition: transform 0.2s, background 0.2s, color 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-solid { background: var(--green); color: var(--pale); }
.btn-solid:hover { background: var(--accent); }
.btn-ghost {
  color: var(--green);
  border: 1px solid var(--hairline);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-band {
  margin-top: 88px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hairline);
}
.stat { padding: 28px 24px 0 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--hairline); }
.stat-n {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
.stat-n small {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-text);
  margin-left: 6px;
  letter-spacing: 0;
}
.stat-l { display: block; margin-top: 12px; color: var(--ink-soft); line-height: 1.7; }

/* ---------------- Secciones ---------------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 110px 32px;
  border-top: 1px solid var(--hairline);
}
.sec-head { max-width: 640px; margin-bottom: 72px; }
.sec-n {
  display: block;
  color: var(--accent-text);
  margin-bottom: 20px;
}
.section h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--green);
}
.sec-head p { margin-top: 24px; color: var(--ink-soft); }

/* Enlaces dentro del texto */
main p a { color: var(--green); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
main p a:hover { color: var(--accent-text); }

/* Secciones oscuras: full-bleed con wrapper interior */
.section-dark {
  max-width: none;
  background: var(--green);
  color: var(--pale);
  border-top: none;
}
.section-dark > * {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}
.section-dark h2 { color: var(--pale); }
.section-dark .sec-head p { color: color-mix(in srgb, var(--pale) 75%, transparent); }
.section-dark .sec-n { color: var(--light-text); }

/* ---------------- Flujo de proceso ---------------- */
.flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 80px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.flow-node {
  flex: 1 1 0;
  min-width: 118px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 18px 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.flow-node strong { font-size: 0.95rem; color: var(--green); font-weight: 600; }
.flow-node em { font-style: normal; font-size: 0.74rem; color: var(--ink-soft); line-height: 1.5; }
.flow-k { color: var(--accent-text); }
.flow-io { background: var(--pale); border-color: transparent; }
.flow-io .mono { color: var(--green); }
.flow-arrow {
  flex: 0 0 26px;
  align-self: center;
  height: 1px;
  background: var(--accent);
  position: relative;
}
.flow-arrow::after {
  content: "";
  position: absolute;
  right: 0; top: -3.5px;
  border-left: 7px solid var(--accent);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 32px;
}
.stage-k { display: block; color: var(--accent-text); margin-bottom: 14px; }
.stage h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.35rem;
  color: var(--green);
  margin-bottom: 10px;
}
.stage p { font-size: 0.92rem; color: var(--ink-soft); }

.footnote {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: 0.03em;
}

/* ---------------- Cards de validación ---------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.card {
  border: 1px solid var(--hairline-dark);
  border-radius: 14px;
  padding: 32px 28px;
  background: rgba(216, 243, 220, 0.04);
  display: flex;
  flex-direction: column;
}
.card-k { color: var(--light-text); display: block; margin-bottom: 18px; }
.card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  margin-bottom: 14px;
  color: var(--pale);
}
.card p { font-size: 0.92rem; color: color-mix(in srgb, var(--pale) 72%, transparent); }
.card-f {
  margin-top: auto;
  padding-top: 22px;
  color: var(--light-text) !important;
}

/* ---------------- Features gemelo ---------------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
}
.feature { background: var(--paper); padding: 40px 36px; }
.feature-n {
  display: block;
  font-size: 1rem;
  color: var(--accent-text);
  margin-bottom: 18px;
}
.feature h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.3rem;
  color: var(--green);
  margin-bottom: 10px;
}
.feature p { font-size: 0.92rem; color: var(--ink-soft); }

/* ---------------- Split impacto ---------------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}
.split-t {
  color: var(--accent-text);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 8px;
}
.list { list-style: none; }
.list li {
  padding: 13px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ---------------- Equipo ---------------- */
.team { list-style: none; }
.team li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline-dark);
}
.team strong { font-weight: 500; font-size: 1.05rem; color: var(--pale); }
.team .mono { color: var(--light-text); text-align: right; }
.team strong a { color: inherit; text-decoration: underline; text-decoration-color: var(--light-text); text-underline-offset: 4px; }
.team strong a:hover { color: var(--light-text); }

/* ---------------- Cierre ---------------- */
.closing { text-align: center; padding-top: 130px; padding-bottom: 130px; }
.closing h2 { margin-bottom: 40px; }
.closing .eyebrow { margin-bottom: 20px; }

/* ---------------- Footer ---------------- */
.footer {
  background: var(--ink);
  color: color-mix(in srgb, var(--pale) 70%, transparent);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 32px;
  display: flex;
  justify-content: space-between;
  gap: 48px;
  font-size: 0.84rem;
  line-height: 1.8;
}
.wordmark-f {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--pale);
  margin-bottom: 12px;
}
.footer-r { text-align: right; }
.footer .mono { text-transform: none; letter-spacing: 0.04em; }
.muted { opacity: 0.8; margin-top: 14px; }
.footer a { color: var(--pale); text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { color: var(--light-text); }

/* ---------------- Fotografía ---------------- */
figure { margin: 0; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  filter: saturate(0.82) contrast(1.03);
}
figcaption {
  margin-top: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  line-height: 1.7;
}

/* Portada full-bleed bajo el hero */
.cover {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px 96px;
}
.cover img {
  aspect-ratio: 21 / 9;
  object-fit: cover;
  border-radius: 18px;
}
.cover figcaption { text-align: center; }

/* Fotos de etapas del proceso */
.stage-ph { margin-bottom: 18px; }
.stage-ph img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--hairline);
}

/* Foto de la línea completa (sección oscura) — sin recorte: se ven los 4 equipos */
.linea {
  margin: 56px auto 0;
  max-width: 820px;
}
.linea img {
  border: 1px solid var(--hairline-dark);
  filter: saturate(0.85) contrast(1.02) brightness(0.96);
}
.linea figcaption {
  color: color-mix(in srgb, var(--pale) 60%, transparent);
  text-align: center;
}

/* Figura única grande (gemelo digital) */
.solo { margin-top: 56px; }
.solo img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--hairline);
}
.solo figcaption { text-align: center; }

/* Par de fotos lado a lado */
.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 56px;
}
.duo img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 1px solid var(--hairline);
}

/* Grilla de impacto: texto + foto alta */
.impacto-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 72px;
}
.impacto-ph img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* ---------------- Botón WhatsApp ---------------- */
.wa-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.wa-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
}

/* ---------------- Reveal ----------------
   El contenido es visible desde el primer render: lo que está sobre el pliegue (el hero completo) se pinta de
   inmediato y sin animación, y sin JavaScript se ve todo. main.js marca con .pending solo lo que queda bajo el
   primer viewport y le quita la clase al entrar en pantalla, con la transición de entrada. */
.reveal {
  transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.reveal.pending { opacity: 0; transform: translateY(22px); transition: none; }
.hero .reveal { opacity: 1; transform: none; transition: none; }
.d1 { transition-delay: 0.08s; }
.d2 { transition-delay: 0.16s; }
.d3 { transition-delay: 0.24s; }
.d4 { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.pending { opacity: 1; transform: none; transition: none; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .stages { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr; }
  .hero-band { grid-template-columns: 1fr 1fr; }
  .stat { padding-top: 24px; }
  .stat:nth-child(odd) { padding-left: 0; border-left: none; }
  .flow { flex-wrap: nowrap; }
}
@media (max-width: 900px) and (min-width: 641px) {
  .impacto-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding-top: 140px; }
  .stages, .grid-2, .split, .hero-band, .duo, .impacto-grid { grid-template-columns: 1fr; }
  .impacto-grid { gap: 40px; margin-bottom: 48px; }
  .cover { padding: 0 24px 64px; }
  .cover img { aspect-ratio: 4 / 3; }
  .wa-btn { width: 52px; height: 52px; right: 16px; bottom: 16px; }
  .stat + .stat { padding-left: 0; border-left: none; }
  .section { padding: 72px 24px; }
  .hero { padding-left: 24px; padding-right: 24px; }
  .footer-inner { flex-direction: column; }
  .footer-r { text-align: left; }
  .team li { flex-direction: column; gap: 4px; }
  .team .mono { text-align: left; }
}
