/* ============================================================
   CLIAR — Sistema de diseño
   Centro Latinoamericano de Investigación en Aguas Residuales
   ============================================================ */

:root {
  /* Paleta institucional CLIAR */
  --navy: #1D3880;          /* Logo navy — color primario */
  --navy-deep: #132847;     /* Navy profundo (CICPOL) — header oscuro */
  --navy-darker: #0A1834;   /* Aún más oscuro — footer */
  --teal: #00A996;          /* Teal/verde-agua — acento principal */
  --teal-dark: #088A7A;     /* Teal profundo — hover, énfasis */
  --teal-soft: #E5F6F4;     /* Teal muy claro — fondos sutiles */
  --cyan: #27ABE7;          /* Cyan del logo — solo detalles puntuales */

  /* Neutros */
  --ink: #14182A;
  --gray-700: #3D4459;
  --gray-500: #6B7388;
  --gray-300: #C7CCD7;
  --gray-200: #E2E5EC;
  --gray-100: #EEF1F5;
  --gray-50: #F8F9FB;
  --white: #FFFFFF;

  /* Sistema */
  --max-w: 1240px;
  --pad-x: 40px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px -2px rgba(15,31,74,0.08);
  --shadow: 0 12px 36px -16px rgba(15,31,74,0.18);
  --transition: all 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.6;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.mono { font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad-x); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* =========================
   Header (compartido)
   ========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--gray-100);
}
.site-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  gap: 32px;
}
.site-logo img { height: 48px; display: block; }
.site-nav ul {
  display: flex;
  gap: 36px;
  list-style: none;
  align-items: center;
}
.site-nav a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--gray-700);
  transition: var(--transition);
  position: relative;
}
.site-nav a:hover { color: var(--navy); }
.site-nav a.active { color: var(--navy); }
.site-nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px;
  background: var(--teal);
}

/* Hamburger toggle (mobile only) */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  transition: var(--transition);
}
.nav-toggle:hover { border-color: var(--navy); }
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: var(--transition);
  transform-origin: center;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================
   Botones
   ========================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--navy-deep);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(19,40,71,0.4);
}
.btn-teal {
  background: var(--teal);
  color: var(--white);
}
.btn-teal:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(0,169,150,0.45);
}
.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
}
.btn-ghost {
  background: transparent;
  color: var(--navy);
  padding: 13px 0;
}
.btn-ghost::after {
  content: '→';
  transition: transform 0.2s;
  margin-left: 4px;
}
.btn-ghost:hover { color: var(--teal); }
.btn-ghost:hover::after { transform: translateX(4px); }

/* =========================
   Tipografía y elementos comunes
   ========================= */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--teal);
  flex-shrink: 0;
}

.section-title {
  font-size: 52px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 18px;
  max-width: 880px;
}
.section-title .accent { color: var(--teal); }
.section-title .accent-navy { color: var(--navy); }
.section-sub {
  font-size: 18px;
  color: var(--gray-500);
  line-height: 1.6;
  max-width: 680px;
}

.section { padding: 110px 0; }
.section-head { margin-bottom: 64px; }
.section-head .eyebrow { margin-bottom: 16px; }

/* =========================
   Hero (variantes)
   ========================= */
.hero {
  position: relative;
  padding: 110px 0 90px;
  overflow: hidden;
  background: var(--white);
}
.hero::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -180px;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,169,150,0.10) 0%, rgba(39,171,231,0.04) 50%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 1px solid var(--teal);
  opacity: 0.18;
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 70px;
  align-items: center;
}
.hero h1 {
  font-size: 70px;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 28px;
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--navy) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 19px;
  color: var(--gray-500);
  line-height: 1.6;
  max-width: 540px;
  margin-bottom: 36px;
}
.hero-cta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 28px;
}
.hero-tag::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--teal);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* Hero visual: network */
.hero-visual {
  position: relative;
  aspect-ratio: 1;
  max-width: 500px;
  justify-self: end;
  width: 100%;
}
.hero-visual svg { width: 100%; height: 100%; }

/* Page hero (interior pages) */
.page-hero {
  background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
  padding: 90px 0 60px;
  border-bottom: 1px solid var(--gray-100);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,169,150,0.08) 0%, transparent 65%);
}
.page-hero h1 {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 18px;
  position: relative;
}
.page-hero h1 .accent { color: var(--teal); }
.page-hero p {
  font-size: 18px;
  color: var(--gray-500);
  max-width: 680px;
  line-height: 1.6;
  position: relative;
}
.page-hero .eyebrow { margin-bottom: 18px; position: relative; }

/* =========================
   Cards / componentes reutilizables
   ========================= */
.card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 36px 32px;
  transition: var(--transition);
  position: relative;
}
.card:hover {
  border-color: var(--gray-200);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.card-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--teal);
  font-weight: 500;
  margin-bottom: 14px;
}
.card h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 12px;
}
.card p {
  color: var(--gray-500);
  font-size: 15px;
  line-height: 1.6;
}
.card-top-border {
  border-top: 3px solid var(--navy);
}
.card-top-border-teal {
  border-top: 3px solid var(--teal);
}

/* Chip / tag */
.chip {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  padding: 5px 12px;
  background: var(--gray-100);
  border-radius: 100px;
  color: var(--gray-700);
}
.chip-teal {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

/* Stat strip */
.strip {
  background: var(--gray-50);
  padding: 36px 0;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}
.strip-grid {
  display: grid;
  grid-template-columns: auto repeat(4, 1fr);
  gap: 32px;
  align-items: center;
}
.strip-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  white-space: nowrap;
  padding-right: 24px;
  border-right: 1px solid var(--gray-200);
}
.strip-item .num {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}
.strip-item .num.teal { color: var(--teal); }
.strip-item .lbl {
  font-size: 13px;
  color: var(--gray-700);
  font-weight: 500;
  line-height: 1.4;
}

/* =========================
   CTA banner (reutilizable)
   ========================= */
.cta-banner {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 60%, var(--teal-dark) 100%);
  color: var(--white);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,169,150,0.25) 0%, transparent 70%);
  pointer-events: none;
}
.cta-banner-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
}
.cta-banner h2 {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 14px;
}
.cta-banner p {
  font-size: 17px;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
}
.cta-banner-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.cta-banner .btn-teal {
  background: var(--teal);
  color: var(--white);
}
.cta-banner .btn-teal:hover { background: var(--white); color: var(--navy-deep); }
.cta-banner .btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.4);
}
.cta-banner .btn-outline:hover {
  background: var(--white);
  color: var(--navy-deep);
  border-color: var(--white);
}

/* =========================
   Footer (compartido)
   ========================= */
.site-footer {
  background: var(--navy-darker);
  color: rgba(255,255,255,0.7);
  padding: 72px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand img {
  height: 42px;
  margin-bottom: 18px;
  filter: brightness(0) invert(1);
}
.footer-brand p {
  color: rgba(255,255,255,0.55);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 320px;
}
.footer-col h6 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  font-weight: 600;
  margin-bottom: 18px;
}
.footer-col ul { list-style: none; }
.footer-col li { padding: 5px 0; font-size: 14px; }
.footer-col a {
  color: rgba(255,255,255,0.6);
  transition: var(--transition);
}
.footer-col a:hover { color: var(--teal); }
.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  flex-wrap: wrap;
  gap: 16px;
}

/* =========================
   Forms
   ========================= */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  padding: 44px;
}
form .field { margin-bottom: 20px; }
form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}
form .row .field { margin-bottom: 0; }
form label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 500;
  margin-bottom: 8px;
}
form input,
form textarea,
form select {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  background: var(--white);
  color: var(--ink);
  transition: var(--transition);
}
form input:focus,
form textarea:focus,
form select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0,169,150,0.10);
}
form textarea { resize: vertical; min-height: 130px; }
form button[type="submit"] { width: 100%; justify-content: center; margin-top: 8px; }

/* =========================
   Utilidades
   ========================= */
.bg-soft { background: var(--gray-50); }
.bg-teal-soft { background: var(--teal-soft); }
.bg-navy { background: var(--navy-deep); color: var(--white); }
.text-center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* =========================
   Responsive
   ========================= */
@media (max-width: 920px) {
  :root { --pad-x: 24px; }
  .hero-grid,
  .cta-banner-inner,
  .footer-grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hero h1 { font-size: 42px; }
  .page-hero h1 { font-size: 36px; }
  .section-title { font-size: 32px; }
  .cta-banner h2 { font-size: 28px; }
  .section { padding: 70px 0; }
  .strip-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .strip-label {
    grid-column: 1 / -1;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
    padding-right: 0;
    padding-bottom: 14px;
  }
  .nav-toggle { display: flex; }
  .site-header-inner > .btn { display: none; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .site-nav.open { max-height: 500px; }
  .site-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px 24px 20px;
    align-items: stretch;
  }
  .site-nav li {
    padding: 14px 0;
    border-top: 1px solid var(--gray-100);
  }
  .site-nav li:first-child { border-top: 0; }
  .site-nav a { font-size: 16px; font-weight: 500; }
  .site-nav a.active::after { display: none; }
  .site-nav a.active { color: var(--teal-dark); }
  .form-card { padding: 28px; }
  .cta-banner-actions { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .hero h1 { font-size: 34px; }
  .strip-grid { grid-template-columns: 1fr; }
  form .row { grid-template-columns: 1fr; }
}
