/* ---------- Tokens de marca ---------- */
:root {
  --orange: #e8973a;
  --orange-600: #cf7c24;
  --orange-700: #a8611b;
  --ink: #23262d;
  --ink-2: #2d3038;
  --text: #3b3f47;
  --muted: #6b6f78;
  --bg: #faf7f2;
  --surface: #ffffff;
  --line: #e9e1d5;
  --heading: var(--ink);
  --win-off: #ffffff;
  --track: #e4d8c6;
  --day-pill: #fdf3e6;
  --night-pill: #e6eaf2;
  --night-text: #44526b;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(35, 38, 45, .04), 0 10px 30px rgba(35, 38, 45, .06);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 76px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-snap-type: y proximity; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
h4 { font-size: 1.05rem; font-weight: 700; letter-spacing: 0; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); font-size: 1.12rem; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 4px; }


/* Barra de progreso de lectura */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: var(--orange); transform-origin: left; transform: scaleX(var(--sp, 0));
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 26px; border-radius: 999px; border: 1.5px solid transparent;
  font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--orange); color: var(--ink); }
.btn-primary:hover { background: #f2a64e; }
.btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.btn-sm { padding: 10px 18px; font-size: .92rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }

.link-arrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; margin-top: 8px; }
.link-arrow::after { content: "→"; color: var(--orange-600); transition: transform .25s var(--ease); }
.link-arrow:hover::after { transform: translateX(5px); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  transition: background .3s, box-shadow .3s;
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: block; position: relative; height: 44px; width: 139px; }
.logo { position: absolute; inset: 0; height: 44px; width: auto; transition: opacity .3s; }
.logo-dark { opacity: 0; }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a:not(.btn) { color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem; opacity: .9; transition: color .2s; }
.nav a:not(.btn):hover { opacity: 1; color: var(--orange); }

.site-header.scrolled { background: rgba(250,247,242,.92); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(12px); }
.site-header.scrolled .logo-light { opacity: 0; }
.site-header.scrolled .logo-dark { opacity: 1; }
.site-header.scrolled .nav a:not(.btn) { color: var(--ink); }
.site-header.scrolled .nav a:not(.btn):hover { color: var(--orange-600); }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; margin: 5px 0; background: #fff; border-radius: 2px; transition: transform .25s, opacity .25s; }
.site-header.scrolled .nav-toggle span, .site-header.menu-open .nav-toggle span { background: var(--ink); }
.site-header.menu-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero: la foto queda fija detrás y el texto sube con el scroll ---------- */
.hero {
  position: relative; z-index: 0; scroll-snap-align: start;
  min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end;
  color: #fff; isolation: isolate;
}
/* Fondo fijo de la portada, Contexto y Cómo funciona; las hojas opacas lo tapan después */
.hero-media { position: fixed; inset: 0; z-index: -2; background: var(--ink); }
.hero-bg {
  width: 100%; height: 100%; object-fit: cover; object-position: 60% center;
  transform: scale(1.04); transform-origin: 60% 40%;
}
.hero-media::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, rgba(20,22,27,.88) 0%, rgba(20,22,27,.62) 45%, rgba(20,22,27,.15) 100%),
    linear-gradient(0deg, rgba(20,22,27,.75) 0%, rgba(20,22,27,0) 45%);
}
.hero-media::after { /* oscurece la foto de a poco para que se lea el contenido que pasa encima */
  content: ""; position: absolute; inset: 0; z-index: 1; background: #101217; opacity: calc(var(--hp, 0) * .62);
}
.hero-inner { padding-top: calc(var(--header-h) + 60px); padding-bottom: 96px; }
.hero h1 { color: #fff; max-width: 24ch; }
.lead { font-size: clamp(1.08rem, 1.6vw, 1.3rem); max-width: 40ch; color: rgba(255,255,255,.86); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 32px 0 56px; }
.hero-facts {
  list-style: none; margin: 0; padding: 26px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 24px;
  border-top: 1px solid rgba(255,255,255,.2);
}
.hero-facts strong { display: block; font-size: 1.7rem; font-weight: 800; color: var(--orange); letter-spacing: -0.02em; }
.hero-facts span { font-size: .92rem; color: rgba(255,255,255,.78); }

.hero-anim { animation: heroIn 1s var(--ease) both; }
.hero-anim:nth-child(2) { animation-delay: .12s; }
.hero-anim:nth-child(3) { animation-delay: .24s; }
.hero-anim:nth-child(4) { animation-delay: .36s; }
.hero-anim:nth-child(5) { animation-delay: .5s; }
@keyframes heroIn { from { opacity: 0; transform: translateY(24px); } }

.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; width: 26px; height: 42px; margin-left: -13px;
  border: 2px solid rgba(255,255,255,.55); border-radius: 14px; opacity: calc(1 - var(--hp, 0) * 4);
}
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: #fff; animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 80% { opacity: 0; transform: translateY(12px); } 100% { opacity: 0; } }

/* ---------- Secciones: un solo fondo continuo ---------- */
/* Cada sección es una hoja de pantalla completa que se queda fija y es tapada por la siguiente.
   main.js ajusta `top` en las hojas más altas que la pantalla para que se lean completas antes de fijarse. */
.section {
  position: sticky; top: 0; z-index: 1; background: var(--bg);
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-start;
  padding: calc(var(--header-h) + clamp(28px, 5vh, 52px)) 0 clamp(40px, 7vh, 72px);
  border-radius: 32px 32px 0 0; box-shadow: 0 -16px 40px rgba(20, 22, 27, .10);
  transform: scale(calc(1 - var(--cover, 0) * .04)); transform-origin: 50% 100%;
}
.section > .container { width: 100%; }
.section:not(.on-photo):not(.section-contact) { margin-bottom: 32vh; }
.section::after { /* se oscurece a medida que la siguiente hoja la cubre */
  content: ""; position: absolute; inset: 0; z-index: 4; border-radius: inherit; pointer-events: none;
  background: #14161b; opacity: calc(var(--cover, 0) * .5);
}
/* Contexto y Cómo funciona van sobre la foto fija de la portada; la primera hoja opaca es Servicio */
.section.on-photo {
  position: relative; background: transparent; box-shadow: none; border-radius: 0; transform: none;
  min-height: 0; padding: calc(var(--header-h) + 24px) 0 72px; /* mismo aire que entre la portada y Contexto */
  --heading: #f7f4ee; --text: rgba(255, 255, 255, .84); --muted: rgba(255, 255, 255, .68);
  --line: rgba(255, 255, 255, .16); --track: rgba(255, 255, 255, .28); --marker-fill: rgba(16, 18, 23, .55);
  --day-pill: rgba(232, 151, 58, .18); --night-pill: rgba(111, 134, 173, .26); --night-text: #c9d5ea;
  color: var(--text);
}
.section.on-photo::after { display: none; }
.on-photo .reasons strong { color: #fff; }
/* En escritorio, Contexto ocupa justo una pantalla: no asoma lo siguiente (main.js avanza de a una pantalla) */
@media (min-width: 901px) {
  .section.on-photo.section-intro { min-height: 100vh; min-height: 100svh; justify-content: center; padding-bottom: 24px; }
}
.anchor { position: relative; height: 0; scroll-snap-align: start; }
.section-head { max-width: 760px; margin-bottom: clamp(32px, 4.5vw, 52px); }
.section-head > h2 { margin: 0; }
.section-head > .muted { margin: 16px 0 0; font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.5; color: var(--text); max-width: 56ch; }

/* Contexto: tres razones en columnas y aviso de urgencia */
.reasons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 56px); }
.reasons li { border-top: 1px solid var(--line); padding-top: 24px; }
.reason-num { display: block; font-size: 2.2rem; font-weight: 800; color: var(--orange); line-height: 1; letter-spacing: -0.02em; margin-bottom: 14px; }
.reasons h3 { margin: 0 0 8px; }
.reasons p { margin: 0; color: var(--muted); font-size: .98rem; }
.reasons strong { color: var(--ink); }

/* Cómo funciona: los pasos avanzan con el scroll y el diagrama fijo muestra el paso activo (data-step) */
.how { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.how-steps { list-style: none; margin: 0; padding: 0; }
.how-steps li {
  display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start;
  min-height: 21vh; padding: 0 0 0 4px; opacity: .38; transition: opacity .5s var(--ease);
}
.how-steps li:last-child { min-height: 0; padding-bottom: 22vh; } /* deja que el último paso llegue a activarse */
.how-steps li.is-active { opacity: 1; }
.how-steps li > span {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--orange); color: var(--orange-600); font-weight: 800;
  transition: background-color .4s, color .4s;
}
.how-steps li.is-active > span { background: var(--orange); color: var(--ink); }
.how-steps h3 { margin: 8px 0 6px; font-size: clamp(1.3rem, 2vw, 1.6rem); }
.how-steps p { margin: 0; color: var(--muted); font-size: 1.02rem; max-width: 34ch; }

/* Diagrama sin fondo propio, fijo mientras se recorren los pasos */
.energy { position: sticky; top: calc(var(--header-h) + 4vh); margin: 0; }
.energy-phase { position: relative; height: 30px; }
.energy-phase span {
  position: absolute; left: 0; top: 0; font-size: .8rem; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  white-space: nowrap; transition: opacity .5s;
}
.phase-day { background: var(--day-pill); color: var(--orange-700); }
.phase-night { background: var(--night-pill); color: var(--night-text); opacity: 0; }
.energy-svg { display: block; width: 100%; height: auto; color: var(--heading); }
.energy-svg .sun, .energy-svg .panel path:not(.panel-glow), .energy-svg .factory path, .energy-svg .pole {
  fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}
.energy-svg .sun { transition: opacity .6s; }
.energy-svg .moon { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; opacity: 0; transition: opacity .6s; }
.energy-svg .panel-glow { fill: var(--orange); stroke: none; opacity: .32; transition: opacity .6s; }
.energy-svg .fwin { fill: var(--orange); stroke: currentColor; stroke-width: 1.6; transition: fill .6s; }
.energy-svg .grid path { fill: none; stroke: currentColor; stroke-width: 1.2; opacity: .75; }
.energy-svg .pole { stroke-width: 2; }
.energy-svg .tracks path { fill: none; stroke: var(--track); stroke-width: 1.6; stroke-dasharray: 1 7; stroke-linecap: round; }
.energy-svg .bldg { fill: rgba(255, 255, 255, .03); stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.energy-svg .win { fill: transparent; stroke: currentColor; stroke-width: .9; stroke-opacity: .45; transition: fill .5s, stroke .5s; }
.energy-svg .city line { stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.energy-svg .flow { opacity: 0; transition: opacity .6s; }
.energy-svg .flow circle { fill: var(--orange); }
.energy-svg .flow .halo { opacity: .22; }
.energy-svg .flow-c circle { fill: #8fa6cc; }
.energy-svg .marker { opacity: .4; transition: opacity .4s; }
.energy-svg .marker circle { fill: var(--marker-fill, var(--bg)); stroke: var(--orange); stroke-width: 1.5; }
.energy-svg .marker text { fill: var(--orange); font: 700 13px "Manrope", sans-serif; }

/* Estado del diagrama según el paso: 1 genera, 2 inyecta, 3 energiza la comunidad, 4 noche */
.how[data-step="1"] .flow-a,
.how[data-step="2"] .flow-a, .how[data-step="2"] .flow-b,
.how[data-step="3"] .flow-a, .how[data-step="3"] .flow-b,
.how[data-step="4"] .flow-c { opacity: 1; }
.how[data-step="3"] .win { fill: var(--orange); stroke: var(--orange); stroke-opacity: 1; }
.how[data-step="4"] .sun, .how[data-step="4"] .panel-glow, .how[data-step="4"] .phase-day { opacity: 0; }
.how[data-step="4"] .moon, .how[data-step="4"] .phase-night { opacity: 1; }
.how[data-step="4"] .fwin { fill: #9fb3d1; }
.how[data-step="1"] .m1, .how[data-step="2"] .m2, .how[data-step="3"] .m3, .how[data-step="4"] .m4 { opacity: 1; }

/* Servicio: columna fija + lista que se activa al bajar */
.split { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(40px, 7vw, 110px); align-items: start; }
.split-aside { align-self: stretch; } /* necesario para que el texto quede fijo */
.sticky { position: sticky; top: calc(var(--header-h) + 56px); }
.service-list { list-style: none; margin: 0; padding: 0 0 14vh; position: relative; }
.service-list::before, .service-list::after {
  content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 100%; background: var(--line);
}
.service-list::after { background: var(--orange); transform-origin: top; transform: scaleY(var(--lp, 0)); }
.service {
  display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: clamp(36px, 6vh, 64px) 0 clamp(36px, 6vh, 64px) clamp(28px, 4vw, 48px);
  opacity: .32; transition: opacity .5s var(--ease), transform .5s var(--ease); transform: translateX(0);
}
.service.is-active { opacity: 1; transform: translateX(6px); }
.service-num { font-weight: 800; color: var(--orange); font-size: .9rem; letter-spacing: .14em; padding-top: 14px; }
.service h3 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); }
.service p { color: var(--muted); margin: 0; max-width: 46ch; }
.icon { width: 46px; height: 46px; margin-bottom: 18px; fill: none; stroke: var(--orange); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Financiamiento */
.finance { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 24px; align-items: stretch; }
.fin-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 28px; transition: transform .4s var(--ease), box-shadow .4s; }
.fin-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.fin-card p:last-child { margin: 0; }
.fin-card h3 { margin-bottom: 4px; }
.fin-tag { font-size: .85rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--orange-600); margin-bottom: 16px; }
.fin-featured { background: var(--ink); border-color: var(--ink); color: rgba(255,255,255,.8); box-shadow: 0 20px 40px rgba(35,38,45,.18); }
.fin-featured h3 { color: #fff; }
.fin-featured .fin-tag { color: var(--orange); }
.badge {
  position: absolute; top: -14px; left: 26px; background: var(--orange); color: var(--ink);
  font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; padding: 6px 14px; border-radius: 999px;
}
/* Gráfico ESCO: barras que crecen y el ahorro marcado contra el gasto inicial */
.esco-chart { display: block; width: 100%; height: auto; margin: 18px 0 4px; overflow: visible; }
.esco-axis { fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 1; }
.esco-ref { fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 1; stroke-dasharray: 3 4; }
.esco-ylabel { fill: rgba(255, 255, 255, .6); font: 500 11px "Manrope", sans-serif; }
.esco-x { fill: rgba(255, 255, 255, .78); font: 500 12px "Manrope", sans-serif; }
.esco-save { fill: rgba(255, 255, 255, .6); font: 500 12px "Manrope", sans-serif; } /* gris de los ejes */
.esco-gap { fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 1; stroke-dasharray: 3 4; }
.esco-bar { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); transition: transform 1.1s var(--ease); }
.esco-bar.d2 { transition-delay: .15s; }
.esco-bar.d3 { transition-delay: .3s; }
.finance.in .esco-bar { transform: scaleY(1); }
.esco-note { opacity: 0; transition: opacity .6s ease 1.1s; }
.finance.in .esco-note { opacity: 1; }
.seg { display: block; }
.seg-energy { background: var(--orange); fill: var(--orange); }
.seg-esco { background: #c9c9cc; fill: #c9c9cc; }
.esco-legend { font-size: .82rem; color: rgba(255,255,255,.7); margin: 22px 0 0 !important; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.dot-energy { background: var(--orange); }
.dot-esco { background: #c9c9cc; margin-left: 10px; }

/* Comunidades */
/* Diagrama de comunidad: una planta reparte energía a varios puntos de consumo */
.community-top { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(32px, 5vw, 72px); align-items: center; margin-bottom: clamp(40px, 5vw, 64px); }
.community-top .section-head { margin-bottom: 0; }
.community { margin: 0; }
.community-svg { display: block; width: 100%; height: auto; color: var(--heading); }
.community-svg .cs-line path, .community-svg .cs-line circle { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.community-svg .cs-line .cs-glow { fill: var(--orange); stroke: none; opacity: .3; }
.community-svg .cs-track path { fill: none; stroke: var(--track); stroke-width: 1.6; stroke-dasharray: 1 7; stroke-linecap: round; }
.community-svg .cs-hub { fill: var(--bg); stroke: var(--orange); stroke-width: 1.6; }
.community-svg .cs-bolt { fill: var(--orange); }
.community-svg .cs-flow circle { fill: var(--orange); }
.community-svg .cs-flow .halo { opacity: .22; }
.community-svg .cwin { fill: var(--orange); animation: winPulse 2.4s ease-in-out infinite; }
.community-svg .lbl { fill: var(--heading); font: 700 14px "Manrope", sans-serif; }
.community-svg .sub { fill: var(--muted); font: 500 12px "Manrope", sans-serif; }
.community-svg .sub-pct { fill: var(--orange); font: 600 12px "Manrope", sans-serif; }
@keyframes winPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
/* Mismo tamaño y color que los textos de las modalidades */
.community-caption { margin: 18px 0 0; font-size: .98rem; line-height: 1.6; color: var(--muted); max-width: 60ch; }
.sub-title { font-size: 1.2rem; margin-bottom: 20px; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 48px); }
.mode { border-top: 1px solid var(--line); padding-top: 28px; }
.mode p { color: var(--muted); margin: 0; font-size: .98rem; }


/* FAQ */
.faq-wrap { max-width: 880px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 44px 22px 0; position: relative;
  font-weight: 700; font-size: 1.08rem; color: var(--ink); transition: color .2s;
}
.faq summary:hover { color: var(--orange-600); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border-right: 2.5px solid var(--orange); border-bottom: 2.5px solid var(--orange); transform: rotate(45deg); transition: transform .3s var(--ease), margin .3s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { color: var(--muted); padding-right: 44px; margin: -6px 0 22px; }
.faq details[open] p { animation: faqIn .4s var(--ease); }
@keyframes faqIn { from { opacity: 0; transform: translateY(-6px); } }

/* Contacto: panel dentro del flujo, no una franja */
.contact {
  display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 5vw, 72px); align-items: start;
  background: radial-gradient(120% 90% at 0% 0%, rgba(232,151,58,.18), transparent 55%), var(--ink);
  color: rgba(255,255,255,.78); border-radius: 32px; padding: clamp(28px, 3.5vw, 48px);
}
.contact h2 { color: #fff; }
.contact-copy > p { font-size: 1.1rem; }
.checklist { list-style: none; padding: 0; margin: 0 0 32px; }
.checklist li { position: relative; padding-left: 34px; margin-bottom: 10px; color: #fff; font-weight: 600; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--orange); }
.checklist li::after {
  content: ""; position: absolute; left: 7px; top: 8px; width: 5px; height: 9px;
  border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(45deg);
}
.contact-list { list-style: none; padding: 28px 0 0; margin: 0; border-top: 1px solid rgba(255,255,255,.12); display: grid; gap: 14px; }
.contact-list li { display: flex; align-items: center; gap: 14px; }
.contact-list svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--orange); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; color: var(--orange); }
.contact-list a { color: #fff; text-decoration: none; font-weight: 600; }
.contact-list a:hover { color: var(--orange); }

.form { background: #fff; color: var(--text); border-radius: var(--radius); padding: clamp(22px, 2.6vw, 32px); }
.form h3 { font-size: 1.5rem; margin-bottom: 4px; color: var(--ink); }
.form-note { color: var(--muted); font-size: .95rem; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 18px; }
.form label { display: grid; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--ink); }
.form .full { grid-column: 1 / -1; }
.form input, .form select, .form textarea {
  width: 100%; font: inherit; font-size: 1rem; font-weight: 500; color: var(--ink);
  padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
  transition: border-color .2s, background .2s;
}
.form textarea { resize: vertical; min-height: 72px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--orange); background: #fff; }
.form .invalid, .form .invalid:focus { border-color: #c2412d; background: #fdf1ee; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { margin: 14px 0 0; font-weight: 600; font-size: .95rem; min-height: 1.4em; }
.form-status.ok { color: #2f7a43; }
.form-status.error { color: #c2412d; }
.form-legal { font-size: .8rem; color: var(--muted); margin: 6px 0 0; }

/* Footer */
.site-footer { position: relative; z-index: 1; background: var(--bg); color: var(--muted); padding: 40px 0 48px; }
.footer-inner { display: grid; gap: 20px; border-top: 1px solid var(--line); padding-top: 40px; }
.footer-inner img { height: 40px; width: auto; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.footer-inner nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.footer-inner nav a:hover { color: var(--orange-600); }
.legal { font-size: .85rem; margin: 0; }
.footer-about { margin: 0; max-width: 72ch; font-size: .95rem; color: var(--text); }
.legal a { color: var(--ink); }

/* Política de privacidad */
.legal-header .logo-dark { opacity: 1; }
.legal-page { max-width: 780px; padding-top: calc(var(--header-h) + 56px); padding-bottom: 48px; }
.legal-page h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 8px; }
.legal-updated { color: var(--muted); font-size: .92rem; margin-bottom: 32px; }
.legal-page h2 { font-size: 1.3rem; margin: 36px 0 10px; }
.legal-page ul { padding-left: 20px; margin: 0 0 1em; }
.legal-page li { margin-bottom: 6px; }
.legal-page a { color: var(--orange-600); }
.form-legal a { color: inherit; }

/* WhatsApp flotante */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; background: #25d366; color: #fff; box-shadow: 0 10px 24px rgba(0,0,0,.25);
  transition: transform .2s, opacity .3s;
}
.wa-float.is-hidden { opacity: 0; transform: scale(.8); pointer-events: none; }
.wa-float:hover { transform: scale(1.06); }
.wa-float svg { width: 30px; height: 30px; fill: currentColor; }

.footer-logo-light { display: none; }

/* ---------- Versión oscura (por defecto; ?tema=claro muestra la clara): todo el sitio con el fondo de la portada ---------- */
.theme-dark {
  --bg: #16181d;
  --surface: #1f2228;
  --line: #2e3138;
  --text: #c9c6bf;
  --muted: #9b9ea6;
  --heading: #f5f2ec;
  --win-off: #16181d;
  --track: #3a3d44;
  --day-pill: rgba(232, 151, 58, .16);
  --night-pill: rgba(111, 134, 173, .22);
  --night-text: #b9c7de;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}
.theme-dark .site-header.scrolled { background: rgba(22, 24, 29, .9); box-shadow: 0 1px 0 var(--line); }
.theme-dark .site-header.scrolled .logo-light, .theme-dark .site-header.menu-open .logo-light { opacity: 1; }
.theme-dark .site-header.scrolled .logo-dark, .theme-dark .site-header.menu-open .logo-dark { opacity: 0; }
.theme-dark .site-header.scrolled .nav a:not(.btn), .theme-dark .site-header .nav a:not(.btn) { color: #fff; }
.theme-dark .site-header.scrolled .nav a:not(.btn):hover { color: var(--orange); }
.theme-dark .site-header.scrolled .nav-toggle span, .theme-dark .site-header.menu-open .nav-toggle span { background: #fff; }
.theme-dark .section:not(.on-photo) { box-shadow: 0 -1px 0 rgba(255,255,255,.07), 0 -16px 40px rgba(0,0,0,.45); }
.theme-dark .section::after { background: #000; }
.theme-dark .phase-day { color: var(--orange); }
.theme-dark .link-arrow, .theme-dark .reasons strong, .theme-dark .faq summary,
.theme-dark .footer-inner nav a, .theme-dark .legal a { color: #fff; }
.theme-dark .faq summary:hover { color: var(--orange); }
.theme-dark .fin-card {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015)); border: 1px solid rgba(255,255,255,.08); box-shadow: none;
}
.theme-dark .fin-card:hover { box-shadow: 0 18px 40px rgba(0,0,0,.35); border-color: rgba(255,255,255,.14); }
.theme-dark .fin-featured {
  background: linear-gradient(180deg, rgba(232,151,58,.12), rgba(232,151,58,.03)), #1c1f25; border-color: rgba(232, 151, 58, .5);
}
.theme-dark .contact {
  background: radial-gradient(120% 90% at 0% 0%, rgba(232,151,58,.22), transparent 55%), var(--surface);
  border: 1px solid var(--line);
}
.theme-dark .form { --bg: #faf7f2; --line: #e9e1d5; --muted: #6b6f78; } /* el formulario sigue claro */
.theme-dark .footer-logo-dark { display: none; }
.theme-dark .footer-logo-light { display: block; }

/* ---------- Aparición al hacer scroll (solo con JS activo) ---------- */
.js [data-reveal], .js [data-stagger] > * {
  opacity: 0; transform: translateY(32px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.js [data-stagger] > * { transition-delay: calc(var(--i, 0) * 110ms); }
.js [data-reveal].in, .js [data-stagger].in > * { opacity: 1; transform: none; }
/* Sobre la foto el texto no aparece con efecto: solo sube con el scroll */
.js .on-photo [data-reveal], .js .on-photo [data-stagger] > * { opacity: 1; transform: none; transition: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-anim, .scroll-cue span, .faq details[open] p { animation: none; }
  .js [data-reveal], .js [data-stagger] > * { opacity: 1; transform: none; transition: none; }
  .service { opacity: 1 !important; transform: none !important; }
  .how-steps li, .energy-svg * { transition: none !important; }
  .energy-svg .flow, .community-svg .cs-flow { display: none; }
  .community-svg .cwin { animation: none; opacity: 1; }
  .btn, .wa-float, .fin-card, .esco-bar, .esco-note { transition: none; }
  .esco-bar { transform: none; }
  .esco-note { opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav { gap: 18px; }
  .nav a:not(.btn) { font-size: .88rem; }
  .finance { grid-template-columns: 1fr 1fr; }
  .fin-featured { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .section-head { grid-template-columns: 1fr; }
  .section-head > h2 { margin-bottom: 14px; }
  .section-head > .muted { grid-column: 1; grid-row: auto; }
  .nav-toggle { display: block; position: relative; z-index: 2; }
  .site-header.scrolled, .site-header.menu-open { backdrop-filter: none; background: var(--bg); }
  .theme-dark .site-header.scrolled { background: var(--bg); } /* sin transparencia: el texto no se asoma bajo el menú */
  .nav {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 26px;
    background: var(--bg); transform: translateY(-100%); visibility: hidden; transition: transform .35s var(--ease), visibility .35s;
  }
  .nav a:not(.btn), .site-header.scrolled .nav a:not(.btn) { color: var(--ink); font-size: 1.35rem; }
  .site-header.menu-open .nav { transform: none; visibility: visible; }
  .site-header.menu-open .logo-light { opacity: 0; }
  .site-header.menu-open .logo-dark { opacity: 1; }
  .site-header.menu-open .brand { z-index: 2; }

  .how, .reasons, .modes, .community-top, .contact, .split { grid-template-columns: 1fr; }
  .how .energy { order: -1; top: var(--header-h); z-index: 2; background: var(--bg); padding: 8px 0 12px; }
  .on-photo .how .energy { background: rgba(16, 18, 23, .82); backdrop-filter: blur(10px); margin: 0 calc(var(--gutter) * -1); padding: 8px var(--gutter) 12px; }
  .how-steps li { min-height: 34vh; }
  .sticky { position: static; }
  .service { padding-top: 32px; padding-bottom: 32px; }
  .service, .service.is-active { opacity: 1; transform: none; } /* en celular, siempre legibles */

}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .br-desk { display: none; }
  .hero-inner { padding-bottom: 80px; }
  .hero-actions { margin: 26px 0 40px; }
  .hero-actions .btn { width: 100%; }
  .hero-facts { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .hero-facts strong { font-size: 1.3rem; }
  .hero-facts span { font-size: .8rem; display: block; line-height: 1.35; }
  .scroll-cue { display: none; }
  .section { border-radius: 24px 24px 0 0; }
  .section:not(.on-photo):not(.section-contact) { margin-bottom: 22vh; }
  .finance, .form-grid { grid-template-columns: 1fr; }
  .energy { padding: 14px 14px 18px; }
  .fin-card { padding: 26px 22px; }
  .esco-x, .esco-save { font-size: 16px; } /* el gráfico se achica en celular: textos más grandes para que se lean */
  .esco-ylabel { font-size: 14px; }
  /* Número e ícono en la misma fila; título y texto debajo a todo el ancho */
  .service { grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; padding-left: 24px; }
  .service > div { display: contents; }
  .service-num { grid-row: 1; padding-top: 0; }
  .service .icon { grid-column: 2; grid-row: 1; width: 40px; height: 40px; margin: 0; }
  .service h3, .service p { grid-column: 1 / -1; }
  .service h3 { margin-top: 14px; }
  .contact { border-radius: 24px; }
  .wa-float { width: 48px; height: 48px; right: 14px; bottom: 14px; }
  .wa-float svg { width: 26px; height: 26px; }
}
