:root {
  --navy: #0D1240;
  --blue: #0057FF;
  --blue-mid: #3D7BFF;
  --teal: #00C4B8;
  --mint: #23FBC5;
  --text: #353C6B;
  --text-strong: #1B2150;
  --muted: #6B7099;
  --bg-soft: #F4F5F7;
  --bg-blue: #E8EEFF;
  --border: #E2E5EC;
  --brand-gradient: linear-gradient(135deg, #0D1240 0%, #0057FF 58%, #00C4B8 100%);
  --container: 640px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: var(--navy);
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  overflow-x: hidden;
  line-height: 1.5;
}

body.has-sticky {
  padding-bottom: 72px;
}

::selection {
  background: var(--blue);
  color: #fff;
}

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

a {
  color: inherit;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: 24px;
  width: 100%;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  background: var(--brand-gradient);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: url("assets/hero-bg.jpg") center / cover no-repeat;
  opacity: 0.18;
  mix-blend-mode: overlay;
}

.hero__inner {
  position: relative;
  padding-block: 24px 36px;
}

.hero__logo {
  height: 68px;
  width: auto;
  margin: 10px 0 32px;
}

.hero__title {
  color: #fff;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-wrap: balance;
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 2.6rem);
}

.hero__lead {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 500;
  line-height: 1.5;
  margin: 0;
  max-width: 52ch;
}

/* ---------- SECTIONS ---------- */
.section {
  padding: 44px 0 8px;
}

.eyebrow {
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.h2 {
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0 0 20px;
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 24px;
}

/* ---------- FEATURE LIST ---------- */
.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 16px 18px;
}

.feature__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--bg-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature__label {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
}

/* ---------- FLOW (diagrama ramificado) ---------- */
.flow {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flow-icon {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: var(--bg-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.flow-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--navy);
  margin: 12px 0 0;
}

.flow-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  margin: 4px 0 0;
  text-align: left;
}

.flow-desc--center {
  text-align: center;
}

.flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 220px;
  margin-bottom: 20px;
}

/* Bloque con dos nodos (inversor/batería, red/inmueble) */
.flow-branch {
  position: relative;
}

.flow-line-main {
  position: absolute;
  left: calc(50% - 1px);
  top: -3px;
  height: 159px;
  width: 0;
  border-left: 2px dotted var(--blue);
  z-index: 0;
}

.flow-pair {
  position: relative;
  width: 216px;
  height: 76px;
  margin: 1px auto 0;
}

.flow-line-h {
  position: absolute;
  left: 76px;
  right: 76px;
  top: 37px;
  height: 0;
  border-top: 2px dotted var(--blue);
}

.flow-icon--left {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
}

.flow-icon--right {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 1;
}

.flow-pair-labels {
  display: flex;
  width: 216px;
  margin: 12px auto 0;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.flow-pair-labels .flow-title {
  width: 76px;
  text-align: center;
  margin: 0;
}

.flow-pair-descs {
  display: flex;
  width: 100%;
  max-width: 480px;
  margin: 6px auto 0;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.flow-pair-descs .flow-desc {
  flex: 1;
  text-align: left;
  margin: 0;
}

/* Conector ramificado hacia red/inmueble */
.flow-fork {
  position: relative;
  width: 216px;
  height: 28px;
  margin: -3px auto;
}

.flow-fork__stem {
  position: absolute;
  left: calc(50% - 1px);
  top: -1px;
  width: 0;
  height: 17px;
  border-left: 2px dotted var(--blue);
}

.flow-fork__cross {
  position: absolute;
  left: 34px;
  right: 34px;
  top: 14px;
  height: 0;
  border-top: 2px dotted var(--blue);
}

.flow-fork__drop--left {
  position: absolute;
  left: 34px;
  top: 14px;
  width: 0;
  height: 8px;
  border-left: 2px dotted var(--blue);
}

.flow-fork__drop--right {
  position: absolute;
  right: 34px;
  top: 14px;
  width: 0;
  height: 8px;
  border-left: 2px dotted var(--blue);
}

/* ---------- OFFERS ---------- */
.offers {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.offer {
  border-radius: 20px;
  padding: 22px 20px;
}

.offer__tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.offer__list {
  margin: 0;
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.7;
}

.offer--blue {
  background: var(--blue);
  color: #fff;
}

.offer--blue .offer__tag {
  color: rgba(255, 255, 255, 0.75);
}

.offer--light {
  background: var(--bg-soft);
  color: var(--text-strong);
}

.offer--light .offer__tag {
  color: var(--muted);
}

.offer--navy {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.9);
}

.offer__tag--mint {
  color: var(--mint) !important;
}

/* ---------- PROJECTS ---------- */
.projects {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project__media {
  width: 100%;
  height: 180px;
  border-radius: 18px;
  object-fit: cover;
  object-position: center bottom;
}

.project__media--placeholder {
  background: var(--bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24' fill='none' stroke='%236B7099' stroke-width='1.2'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Ccircle cx='9' cy='10' r='2'/%3E%3Cpath d='M21 16l-5-5-9 9'/%3E%3C/svg%3E") center / 48px no-repeat;
  border: 1px dashed var(--border);
}

.project__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  margin: 12px 0 2px;
}

.project__desc {
  font-size: 14px;
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}

.project__stats {
  display: flex;
  gap: 20px;
  margin: 10px 0 0;
}

.project__stats dt {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project__stats dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}

/* ---------- STATS ---------- */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.stat {
  background: var(--bg-soft);
  border-radius: 18px;
  padding: 22px 18px;
}

.stat__value {
  display: block;
  font-size: 30px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat__label {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-top: 8px;
  line-height: 1.4;
}

/* ---------- BRANDS ---------- */
.brands__caption {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.04em;
  margin: 0 0 20px;
}

.brands {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  padding: 20px 4px 8px;
}

.brands img {
  width: auto;
  opacity: 0.88;
}

/* ---------- CTA ---------- */
.cta {
  position: relative;
  margin-top: 40px;
  background: var(--brand-gradient);
  overflow: hidden;
}

.cta__bg {
  position: absolute;
  inset: 0;
  background: url("assets/cta-bg.jpg") center / cover no-repeat;
  opacity: 0.14;
  mix-blend-mode: overlay;
}

.cta__inner {
  position: relative;
  padding-block: 44px 48px;
}

.cta__title {
  color: #fff;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0 0 14px;
  font-size: clamp(1.6rem, 4vw, 2rem);
}

.cta__lead {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  line-height: 1.55;
  margin: 0 0 32px;
  max-width: 48ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--blue);
  font-size: 15px;
  font-weight: 600;
  padding: 16px 28px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(13, 18, 64, 0.28);
  transition: background .2s ease;
}

.btn:hover {
  background: var(--bg-blue);
}

.cta__contact {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.cta__contact-label {
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.cta__contact a {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  margin-top: 4px;
}

/* ---------- FOOTER ---------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 32px 40px;
}

.footer span {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- STICKY BAR ---------- */
.sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 12px 0;
  box-shadow: 0 -8px 24px rgba(13, 18, 64, 0.1);
  transform: translateY(100%);
  transition: transform .25s ease;
}

.sticky-bar.is-visible {
  transform: translateY(0);
}

.sticky-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sticky-bar__text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}

.sticky-bar__btn {
  display: inline-flex;
  align-items: center;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 87, 255, 0.3);
  transition: background .2s ease;
}

.sticky-bar__btn:hover {
  background: #0044CC;
}

/* ---------- DESKTOP ---------- */
@media (min-width: 720px) {
  :root {
    --container: 960px;
  }

  .section {
    padding: 64px 0 8px;
  }

  .feature-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .offers {
    flex-direction: row;
  }

  .offer {
    flex: 1;
  }

  .projects {
    flex-direction: row;
  }

  .project {
    flex: 1;
  }

  .stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero__inner,
  .cta__inner {
    padding-block: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }

  .sticky-bar {
    transition: none;
  }
}