/* =========================================================
   Aquarural360 — estilos de la landing
   Paleta tomada de la propuesta comercial
   ========================================================= */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Color */
  --abismo: #0A3344;      /* azul profundo de marca */
  --abismo-2: #0E4054;
  --abismo-3: #072431;
  --cauce: #13798A;       /* teal de marca */
  --agua: #63C4CC;        /* aqua claro */
  --ambar: #E9A23B;       /* acento cálido de marca */
  --ambar-2: #F2B85E;
  --neblina: #E7F2F3;
  --papel: #F5F9F9;
  --blanco: #FFFFFF;
  --tinta: #10262F;
  --gris: #4D646D;
  --linea: rgba(10, 51, 68, 0.14);
  --linea-clara: rgba(231, 242, 243, 0.16);

  /* Tipografía */
  --f-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-text: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;

  --t-sm: 0.875rem;
  --t-base: 1.0625rem;
  --t-md: 1.25rem;
  --t-lg: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  --t-xl: clamp(2rem, 1.35rem + 2.4vw, 3.25rem);
  --t-hero: clamp(2.5rem, 1.5rem + 3.9vw, 4.5rem);

  /* Espacio y forma */
  --wrap: 1200px;
  --gutter: clamp(1.25rem, 0.8rem + 2vw, 2.5rem);
  --section: clamp(4.5rem, 3rem + 6vw, 8rem);
  --r-sm: 6px;
  --r-md: 14px;
  --r-lg: 28px;
  --header-h: 72px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--f-text);
  font-size: var(--t-base);
  line-height: 1.6;
  color: var(--tinta);
  background: var(--blanco);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  font-optical-sizing: auto;
  text-wrap: balance;
}
h3 { font-size: var(--t-md); line-height: 1.25; letter-spacing: -0.005em; }

p { margin: 0; text-wrap: pretty; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--ambar);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -100px;
  z-index: 100;
  background: var(--ambar);
  color: var(--abismo);
  padding: 0.6rem 1rem;
  border-radius: var(--r-sm);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + 0.75rem); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font: 650 1rem/1.2 var(--f-text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-sm { min-height: 40px; padding: 0.55rem 1.1rem; font-size: 0.9375rem; }
.btn-amber { background: var(--ambar); color: var(--abismo); }
.btn-amber:hover { background: var(--ambar-2); }
.btn-ghost { border-color: rgba(231, 242, 243, 0.45); color: var(--neblina); }
.btn-ghost:hover { border-color: var(--agua); color: var(--blanco); }
.btn-deep { background: var(--abismo); color: var(--blanco); }
.btn-deep:hover { background: var(--cauce); }

/* ---------- Encabezado ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  color: var(--neblina);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.is-scrolled {
  background: rgba(10, 51, 68, 0.88);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  box-shadow: 0 1px 0 var(--linea-clara);
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}
.brand-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--f-text);
  font-size: 1.4rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand-name span {
  font-size: 0.58em;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--abismo);
  background: var(--agua);
  border-radius: 999px;
  padding: 0.28em 0.6em;
}

.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  opacity: 0.85;
  padding-block: 0.4rem;
  border-bottom: 1.5px solid transparent;
}
.main-nav a:hover { opacity: 1; border-color: var(--agua); }

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  position: relative;
}
.menu-toggle .bar {
  position: absolute;
  left: 12px; right: 12px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s ease, top 0.25s ease;
}
.menu-toggle .bar:nth-of-type(1) { top: 17px; }
.menu-toggle .bar:nth-of-type(2) { top: 25px; }
.menu-toggle[aria-expanded="true"] .bar:nth-of-type(1) { top: 21px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bar:nth-of-type(2) { top: 21px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--neblina);
  background:
    url("../img/curvas-de-nivel.svg") center / cover no-repeat,
    radial-gradient(120% 90% at 85% 40%, var(--abismo-2) 0%, var(--abismo) 55%, var(--abismo-3) 100%);
  padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + clamp(2.5rem, 1rem + 5vw, 5rem));
  padding-bottom: clamp(3.5rem, 2rem + 5vw, 6rem);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 1rem + 4vw, 5rem);
}
.hero-kicker {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--agua);
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: var(--t-hero);
  font-weight: 450;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--blanco);
  max-width: 15ch;
}
.lead {
  margin-top: 1.5rem;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.55;
  max-width: 34rem;
  color: rgba(231, 242, 243, 0.86);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.hero-facts {
  list-style: none;
  margin: 2.75rem 0 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--linea-clara);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: rgba(231, 242, 243, 0.72);
}
.hero-facts strong { display: block; color: var(--blanco); font-weight: 650; }

/* ---------- Ciclo 360 ---------- */
.cycle {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1;
  justify-self: center;
  container-type: inline-size;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.cycle-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-track {
  fill: none;
  stroke: rgba(99, 196, 204, 0.16);
  stroke-width: 2.6;
}
.ring-water {
  fill: none;
  stroke: var(--agua);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 360;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 1.2px rgba(99, 196, 204, 0.6));
}
.cycle.is-filling .ring-water {
  animation: fill-ring 2.6s cubic-bezier(0.55, 0.05, 0.25, 1) forwards;
}
@keyframes fill-ring {
  from { stroke-dashoffset: 360; }
  to { stroke-dashoffset: 0; }
}

.cycle-nodes { position: absolute; inset: 0; }

.node {
  --r: 36cqi;
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(48px, 13cqi, 68px);
  height: clamp(48px, 13cqi, 68px);
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(99, 196, 204, 0.4);
  background: var(--abismo);
  color: var(--agua);
  cursor: pointer;
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--r) * -1)) rotate(calc(var(--a) * -1));
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.node:nth-child(1) { --a: 0deg; }
.node:nth-child(2) { --a: 51.43deg; }
.node:nth-child(3) { --a: 102.86deg; }
.node:nth-child(4) { --a: 154.29deg; }
.node:nth-child(5) { --a: 205.71deg; }
.node:nth-child(6) { --a: 257.14deg; }
.node:nth-child(7) { --a: 308.57deg; }

.node svg {
  width: 46%;
  height: 46%;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.node span {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.4rem);
  transform: translateX(-50%);
  white-space: nowrap;
  font: 600 clamp(0.75rem, 2.6cqi, 0.875rem)/1 var(--f-text);
  color: rgba(231, 242, 243, 0.82);
  background: var(--abismo);
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  pointer-events: none;
}
/* Etiquetas del lado superior: por encima del nodo para no tocar el anillo */
.node:nth-child(1) span { top: auto; bottom: calc(100% + 0.45rem); }
/* Con espacio suficiente, las etiquetas laterales van hacia afuera del anillo */
@container (min-width: 440px) {
  .node:nth-child(2) span,
  .node:nth-child(3) span {
    top: 50%; left: calc(100% + 0.6rem); transform: translateY(-50%);
  }
  .node:nth-child(6) span,
  .node:nth-child(7) span {
    top: 50%; left: auto; right: calc(100% + 0.6rem); transform: translateY(-50%);
  }
}

.node:hover { border-color: var(--agua); }
.node[aria-selected="true"] {
  background: var(--ambar);
  border-color: var(--ambar);
  color: var(--abismo);
}
.node[aria-selected="true"] span { color: var(--blanco); }

/* Estado durante la animación de carga */
.cycle.is-filling .node { border-color: rgba(99, 196, 204, 0.18); color: rgba(99, 196, 204, 0.35); }
.cycle.is-filling .node.is-reached { border-color: var(--agua); color: var(--agua); }
.cycle.is-filling .node[aria-selected="true"] { background: var(--abismo); }

.cycle-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48cqi;
  transform: translate(-50%, -50%);
  text-align: center;
  transition: opacity 0.35s ease;
}
.cycle.is-filling .cycle-panel { opacity: 0; }
.cycle-count {
  font-size: clamp(0.75rem, 2.7cqi, 0.9375rem);
  font-weight: 600;
  color: var(--agua);
}
.cycle-title {
  margin-top: 0.35rem;
  font-size: clamp(1.5rem, 7.4cqi, 2.6rem);
  font-weight: 500;
  color: var(--blanco);
}
.cycle-text {
  margin-top: 0.6rem;
  font-size: clamp(0.8125rem, 3cqi, 1rem);
  line-height: 1.5;
  color: rgba(231, 242, 243, 0.82);
}

/* ---------- Secciones ---------- */
.section { padding-block: var(--section); }
.section-paper { background: var(--papel); }
.section-mist { background: var(--neblina); }
.section-deep { background: var(--abismo); color: var(--neblina); }
.section-deep h2, .section-deep h3 { color: var(--blanco); }

.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 1.5rem + 3vw, 4rem); }
.section-head h2 { font-size: var(--t-xl); }
.section-head p {
  margin-top: 1.1rem;
  font-size: var(--t-md);
  line-height: 1.5;
  color: var(--gris);
  max-width: 40rem;
}
.section-deep .section-head p { color: rgba(231, 242, 243, 0.78); }

/* ---------- Hoy vs Aquarural360 ---------- */
.contrast {
  border-top: 2px solid var(--abismo);
}
.contrast-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--linea);
}
.contrast-row > span {
  padding: 1.1rem 1.5rem 1.1rem 0;
  line-height: 1.5;
}
.contrast-row > span:first-child { color: var(--gris); }
.contrast-row > span:last-child {
  padding-left: 1.5rem;
  border-left: 3px solid var(--agua);
  font-weight: 550;
  color: var(--abismo);
  background: linear-gradient(90deg, rgba(99, 196, 204, 0.12), rgba(99, 196, 204, 0));
}
.contrast-head > span {
  font: 600 var(--t-md)/1.2 var(--f-display);
  padding-block: 1rem;
}
.contrast-head > span:first-child { color: var(--gris); }
.contrast-head > span:last-child { color: var(--cauce); background: none; }

/* ---------- Niveles ---------- */
.levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  position: relative;
}
.level {
  position: relative;
  padding: 2.25rem 2rem 2.25rem;
}
.level + .level { border-left: 1px solid var(--linea); }
.level:first-child { padding-left: 0; }
.level:last-child { padding-right: 0; }
.level::before {
  content: "";
  display: block;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  margin-bottom: 1.75rem;
}
.level-1::before { background: var(--abismo); }
.level-2::before { background: var(--cauce); }
.level-3::before { background: var(--agua); }
.level h3 { font-size: var(--t-lg); }
.level > p { margin-top: 0.5rem; color: var(--gris); }
.level ul {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}
.level li {
  padding: 0.65rem 0;
  border-top: 1px solid var(--linea);
  font-size: 0.975rem;
}

/* ---------- Modalidades de adquisición ---------- */
.modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}
.mode {
  border-radius: var(--r-lg);
  padding: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
}
.mode-territorial { background: var(--abismo); color: var(--neblina); }
.mode-territorial h3 { color: var(--blanco); }
.mode-operador { background: var(--blanco); border: 1.5px solid rgba(10, 51, 68, 0.16); }
.mode-tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  margin-bottom: 1.25rem;
}
.mode-territorial .mode-tag { background: var(--agua); color: var(--abismo); }
.mode-operador .mode-tag { background: var(--ambar); color: var(--abismo); }
.mode h3 { font-size: var(--t-lg); }
.mode-who { margin-top: 0.75rem; line-height: 1.5; }
.mode-territorial .mode-who { color: rgba(231, 242, 243, 0.8); }
.mode-operador .mode-who { color: var(--gris); }
.mode .checks { margin-top: 1.5rem; }
.mode-territorial .checks li { border-bottom-color: var(--linea-clara); }
.mode-territorial .checks li::before { border-color: var(--agua); }
.modes-note { margin-top: 1.5rem; color: var(--gris); max-width: 46rem; }

/* ---------- Pestañas de módulos ---------- */
.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}
.tab-list [role="tab"] {
  min-height: 44px;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  border: 1.5px solid rgba(10, 51, 68, 0.25);
  background: transparent;
  color: var(--abismo);
  font: 600 0.9375rem/1.2 var(--f-text);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.tab-list [role="tab"]:hover { border-color: var(--abismo); }
.tab-list [role="tab"][aria-selected="true"] {
  background: var(--abismo);
  border-color: var(--abismo);
  color: var(--blanco);
}

.module-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 1rem + 3vw, 4.5rem);
}
.module-list > div {
  padding: 1.35rem 0;
  border-top: 1px solid rgba(10, 51, 68, 0.18);
}
.module-list dt {
  font: 550 1.3rem/1.25 var(--f-display);
  color: var(--abismo);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
}
.module-list dd {
  margin: 0.4rem 0 0;
  color: var(--gris);
  max-width: 34rem;
}
.soon {
  font: 600 0.75rem/1 var(--f-text);
  color: var(--cauce);
  background: rgba(19, 121, 138, 0.1);
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Portal ---------- */
.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  align-items: center;
  gap: clamp(2.5rem, 1rem + 5vw, 6rem);
}
.portal-copy h2 { font-size: var(--t-xl); max-width: 16ch; }
.portal-copy > p { margin-top: 1.1rem; font-size: var(--t-md); color: var(--gris); max-width: 32rem; }
.portal-points { margin: 2.25rem 0 0; }
.portal-points > div {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--linea);
}
.portal-points dt { font-weight: 700; color: var(--abismo); }
.portal-points dd { margin: 0; color: var(--gris); }

.phone {
  margin: 0;
  justify-self: center;
  width: min(100%, 340px);
}
.phone-screen {
  background: var(--papel);
  border: 10px solid var(--abismo);
  border-radius: 44px;
  padding: 1.5rem 1.15rem 1.35rem;
  box-shadow:
    0 2px 0 var(--abismo-2) inset,
    0 40px 60px -30px rgba(10, 51, 68, 0.45);
}
.phone-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--abismo);
}
.balance {
  margin-top: 1.1rem;
  background: var(--abismo);
  color: var(--neblina);
  border-radius: 20px;
  padding: 1.1rem 1.2rem;
  display: grid;
}
.balance span { font-size: 0.8125rem; opacity: 0.8; }
.balance strong {
  font: 500 2.1rem/1.1 var(--f-display);
  color: var(--blanco);
  margin-top: 0.2rem;
}
.balance small { margin-top: 0.4rem; color: var(--ambar-2); font-weight: 600; font-size: 0.8125rem; }
.bills { list-style: none; margin: 1rem 0 0; padding: 0; }
.bills li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.15rem;
  border-bottom: 1px solid var(--linea);
  font-size: 0.875rem;
}
.bills em {
  font-style: normal;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
}
.bills .due { background: rgba(233, 162, 59, 0.2); color: #8A5A12; }
.bills .paid { background: rgba(19, 121, 138, 0.12); color: var(--cauce); }
.phone-btn {
  display: block;
  margin-top: 1.1rem;
  text-align: center;
  background: var(--ambar);
  color: var(--abismo);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.75rem;
  border-radius: 999px;
}
.phone figcaption {
  margin-top: 0.85rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--gris);
}

/* Aviso de desplazamiento horizontal en tablas (solo pantallas pequeñas) */
.scroll-hint { display: none; font-size: 0.8125rem; margin-bottom: 0.75rem; opacity: 0.75; }
@media (max-width: 760px) { .scroll-hint { display: block; } }

/* ---------- Tablero municipal ---------- */
.board { display: grid; gap: 2.5rem; }
.board-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--linea-clara);
  border-radius: var(--r-md);
  background: rgba(7, 36, 49, 0.45);
}
.board-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.9375rem;
}
.board-table caption {
  caption-side: bottom;
  text-align: left;
  padding: 0.9rem 1.25rem;
  font-size: 0.8125rem;
  color: rgba(231, 242, 243, 0.6);
  border-top: 1px solid var(--linea-clara);
}
.board-table th,
.board-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--linea-clara);
  white-space: nowrap;
}
.board-table thead th {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(231, 242, 243, 0.7);
}
.board-table tbody th { font-weight: 600; color: var(--blanco); }
.board-table .num { text-align: right; }
.board-table tfoot th,
.board-table tfoot td {
  border-bottom: 0;
  font-weight: 700;
  color: var(--blanco);
  background: rgba(99, 196, 204, 0.08);
}
.meter {
  display: inline-block;
  vertical-align: middle;
  width: 96px;
  height: 8px;
  border-radius: 999px;
  background: rgba(231, 242, 243, 0.12);
  overflow: hidden;
  margin-right: 0.65rem;
}
.meter > span {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: inherit;
  background: var(--agua);
}
.meter.is-low > span { background: var(--ambar); }
.meter-label { vertical-align: middle; }

.formulas {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}
.formula {
  padding-top: 1.5rem;
  border-top: 2px solid var(--agua);
}
.formula-list { border-top-color: var(--linea-clara); }
.formula h3 { font-size: 1.15rem; }
.formula-eq {
  margin-top: 0.75rem;
  font: 500 clamp(1.35rem, 1.1rem + 0.9vw, 1.75rem)/1.2 var(--f-display);
  color: var(--ambar);
}
.formula p:last-child { margin-top: 0.6rem; color: rgba(231, 242, 243, 0.75); font-size: 0.975rem; }

/* ---------- Seguridad ---------- */
.security-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 1.5rem + 3vw, 4rem);
}
.security-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 2rem;
  align-items: start;
}
.roles-wrap { overflow-x: auto; }
.roles {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.roles thead th {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gris);
  text-align: center;
  vertical-align: bottom;
  padding: 0 0.5rem 0.85rem;
  line-height: 1.3;
}
.roles thead th:first-child { text-align: left; padding-left: 0; }
.roles tbody th {
  text-align: left;
  font-weight: 600;
  color: var(--abismo);
  padding: 0.85rem 0.75rem 0.85rem 0;
}
.roles td { text-align: center; padding: 0.85rem 0.5rem; }
.roles tbody tr { border-top: 1px solid var(--linea); }
.roles i, .roles-legend i {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  vertical-align: middle;
}
.p-full { background: var(--cauce); }
.p-half { background: linear-gradient(90deg, var(--cauce) 50%, transparent 50%); box-shadow: inset 0 0 0 2px var(--cauce); }
.p-none { box-shadow: inset 0 0 0 1.5px rgba(10, 51, 68, 0.25); }
.roles-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--gris);
}
.roles-legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.roles-note { margin-top: 0.75rem; font-size: 0.875rem; color: var(--gris); }

.security-points > div { padding: 1.4rem 0; border-top: 2px solid var(--abismo); }
.security-points p { margin-top: 0.4rem; color: var(--gris); }
.log {
  margin-top: 1rem;
  background: var(--abismo);
  color: var(--neblina);
  border-radius: var(--r-md);
  padding: 1rem 1.15rem;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.log p { margin: 0; color: inherit; display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.75rem; padding: 0.3rem 0; }
.log p > span:first-child { color: rgba(231, 242, 243, 0.6); }
.log del { color: rgba(231, 242, 243, 0.55); }
.log ins { text-decoration: none; color: var(--ambar-2); font-weight: 700; }

/* ---------- Fases ---------- */
.phases {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: fase;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2.75rem 1.75rem;
}
.phases li {
  counter-increment: fase;
  position: relative;
  padding-top: 3.6rem;
}
.phases li::before {
  content: counter(fase);
  position: absolute;
  top: 0;
  left: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--abismo);
  color: var(--blanco);
  font: 600 1.15rem/1 var(--f-display);
  z-index: 1;
}
.phases li::after {
  content: "";
  position: absolute;
  top: 1.25rem;
  left: 2.5rem;
  right: -1.75rem;
  height: 2px;
  background: linear-gradient(90deg, var(--cauce), var(--agua));
  opacity: 0.45;
}
.phases li:nth-child(4n)::after,
.phases li:last-child::after { display: none; }
.phases li:last-child::before { background: var(--ambar); color: var(--abismo); }
.phases h3 { font-size: 1.2rem; }
.phases p { margin-top: 0.45rem; color: var(--gris); font-size: 0.975rem; }

/* ---------- Modelo y evolución ---------- */
.model-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 3vw, 4rem);
  align-items: start;
}
.model-grid h2 { font-size: var(--t-xl); }
.model-lead { margin: 1.1rem 0 2rem; font-size: var(--t-md); line-height: 1.5; color: var(--gris); }
.included h3, .roadmap h3 {
  font-size: 1.15rem;
  padding-bottom: 0.9rem;
  border-bottom: 2px solid var(--abismo);
}
.checks { list-style: none; margin: 0; padding: 0; }
.checks li {
  position: relative;
  padding: 0.75rem 0 0.75rem 1.85rem;
  border-bottom: 1px solid rgba(10, 51, 68, 0.14);
}
.checks li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 1.05rem;
  width: 0.7rem;
  height: 0.38rem;
  border-left: 2px solid var(--cauce);
  border-bottom: 2px solid var(--cauce);
  transform: rotate(-45deg);
}
.chips {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.chips li {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--blanco);
  border: 1px solid rgba(10, 51, 68, 0.14);
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--abismo);
}

/* ---------- Preguntas ---------- */
.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  align-items: start;
}
.faq-grid h2 { font-size: var(--t-xl); }
.faq details { border-top: 1px solid var(--linea); }
.faq details:last-child { border-bottom: 1px solid var(--linea); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 1.35rem 2.5rem 1.35rem 0;
  position: relative;
  font: 550 1.2rem/1.35 var(--f-display);
  color: var(--abismo);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 0.35rem;
  top: 50%;
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2px solid var(--cauce);
  border-bottom: 2px solid var(--cauce);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.25s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 2.5rem 1.5rem 0; color: var(--gris); max-width: 42rem; }

/* ---------- Contacto ---------- */
.contact {
  background:
    url("../img/curvas-de-nivel.svg") right center / cover no-repeat,
    var(--abismo);
}
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2.5rem, 1rem + 5vw, 6rem);
  align-items: start;
}
.contact-copy h2 { font-size: var(--t-xl); }
.contact-copy p { margin-top: 1.1rem; font-size: var(--t-md); line-height: 1.5; color: rgba(231, 242, 243, 0.82); max-width: 30rem; }
.contact-copy .contact-direct { font-size: 1rem; }
.contact-direct a { color: var(--agua); text-underline-offset: 3px; }

.contact-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.1rem 1.25rem;
  background: var(--papel);
  color: var(--tinta);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}
.field { display: grid; gap: 0.4rem; grid-column: span 3; align-content: start; }
.field-third { grid-column: span 2; }
.contact-form .field-full { grid-column: 1 / -1; }
.field label { font-size: 0.875rem; font-weight: 650; color: var(--abismo); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid rgba(10, 51, 68, 0.22);
  border-radius: 10px;
  background: var(--blanco);
  font: 400 1rem/1.4 var(--f-text);
  color: var(--tinta);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea { resize: vertical; min-height: 110px; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, #13798A 50%), linear-gradient(135deg, #13798A 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--cauce);
  box-shadow: 0 0 0 3px rgba(19, 121, 138, 0.2);
}
.field input[aria-invalid="true"],
.field select[aria-invalid="true"] { border-color: #B4442B; }
.field-check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.7rem;
}
.field-check input {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin-top: 0.15rem;
  accent-color: var(--cauce);
}
.field-check label { font-weight: 500; color: var(--gris); line-height: 1.45; }
.field-check a { color: var(--cauce); }
.form-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; margin-top: 0.5rem; }
.form-status { font-size: 0.9375rem; font-weight: 600; }
.form-status.is-error { color: #B4442B; }
.form-status.is-ok { color: var(--cauce); }

/* ---------- Pie ---------- */
.site-footer {
  background: var(--abismo-3);
  color: rgba(231, 242, 243, 0.7);
  padding-block: 2.5rem;
  font-size: 0.9375rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2.5rem;
}
.site-footer .brand { color: var(--blanco); }
.site-footer .brand-name { font-size: 1.2rem; }
.site-footer nav { display: flex; gap: 1.5rem; margin-left: auto; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { color: var(--blanco); text-decoration: underline; }
.copy { width: 100%; font-size: 0.8125rem; opacity: 0.75; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1080px) {
  .main-nav ul { gap: 1.2rem; }
  .model-grid { grid-template-columns: 1fr 1fr; }
  .model-grid > div:first-child { grid-column: 1 / -1; max-width: 44rem; }
}

@media (max-width: 960px) {
  .menu-toggle { display: block; }
  .header-cta { display: none; }
  .main-nav {
    position: fixed;
    inset: calc(var(--header-h) + env(safe-area-inset-top, 0px)) 0 auto 0;
    background: var(--abismo);
    border-top: 1px solid var(--linea-clara);
    padding: 1rem var(--gutter) 1.75rem;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }
  .main-nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav a {
    display: block;
    padding: 0.9rem 0;
    font-size: 1.125rem;
    border-bottom: 1px solid var(--linea-clara);
    opacity: 1;
  }
  .site-header.menu-open { background: var(--abismo); }

  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { max-width: 16ch; }
  .cycle { max-width: 520px; margin-top: 1rem; }

  .levels { grid-template-columns: 1fr; }
  .level { padding-inline: 0; }
  .level + .level { border-left: 0; border-top: 1px solid var(--linea); }

  .portal-grid,
  .security-grid,
  .faq-grid,
  .contact-grid { grid-template-columns: minmax(0, 1fr); }

  .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phases li:nth-child(4n)::after { display: block; }
  .phases li:nth-child(2n)::after { display: none; }

  .formulas { grid-template-columns: 1fr; }
  .security-points { grid-template-columns: 1fr; }
  .modes { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .hero-facts { grid-template-columns: 1fr; gap: 0.9rem; }
  .contrast-row { grid-template-columns: 1fr; }
  .contrast-row > span:first-child { padding: 1rem 0 0.4rem; }
  .contrast-row > span:last-child { margin-bottom: 1rem; padding-block: 0.7rem; }
  .contrast-head { display: none; }
  .contrast-row > span:first-child::before { content: "Hoy: "; font-weight: 700; }
  .module-list { grid-template-columns: 1fr; }
  .portal-points > div { grid-template-columns: 1fr; gap: 0.25rem; }
  .model-grid { grid-template-columns: 1fr; }
  .phases { grid-template-columns: 1fr; gap: 0; }
  .phases li { padding: 0 0 2rem 3.6rem; }
  .phases li::after,
  .phases li:nth-child(2n)::after,
  .phases li:nth-child(4n)::after {
    display: block;
    top: 2.5rem;
    bottom: 0;
    left: 1.2rem;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--cauce), var(--agua));
  }
  .phases li:last-child::after { display: none; }
  .phases h3 { padding-top: 0.45rem; }
  .contact-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field { grid-column: 1 / -1; }
  .field-third { grid-column: span 1; }
  .field-tel { grid-column: 1 / -1; }
  .site-footer nav { margin-left: 0; }
}

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Páginas secundarias ---------- */
.doc { padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 3rem); }
.doc-body { max-width: 46rem; }
.doc-body h1 { font-size: var(--t-xl); }
.doc-body h2 { font-size: var(--t-lg); margin-top: 2.5rem; }
.doc-body p { margin-top: 0.9rem; color: var(--gris); }
.doc-body a:not(.btn) { color: var(--cauce); }
.doc-body .btn { margin-top: 2rem; }
.doc-meta { font-weight: 600; color: var(--cauce) !important; }
.notfound { min-height: 100vh; min-height: 100dvh; display: grid; align-items: center; }
.notfound h1 { font-size: var(--t-hero); color: var(--blanco); margin-top: 1.5rem; }
.board > .scroll-hint { margin-bottom: -1.75rem; }
