/* =========================================================
   ECIS HOMEPAGE - ENERGY MOTION + NEW SECTIONS
========================================================= */

/* Animated energy line below sticky navigation */
.ecis-site-header::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--ecis-energy-blue) 16%,
    var(--ecis-system-blue) 40%,
    var(--ecis-energy-green) 64%,
    var(--ecis-energy-blue) 82%,
    transparent 100%
  ) !important;
  background-size: 240% 100% !important;
  animation: ecis-nav-energy-flow 4.8s linear infinite;
  box-shadow:
    0 0 8px rgba(12,111,246,.24),
    0 0 12px rgba(74,202,116,.12);
}

.ecis-site-header.is-scrolled::after {
  opacity: .9 !important;
}

@keyframes ecis-nav-energy-flow {
  from { background-position: 200% 50%; }
  to { background-position: -40% 50%; }
}

/* Shared homepage section language */
.ecis-home-section {
  position: relative;
  overflow: hidden;
  padding: clamp(84px, 9vw, 144px) 0;
}

.ecis-home-section__header {
  max-width: 820px;
  margin-bottom: clamp(42px, 5vw, 72px);
}

.ecis-home-section__header h2 {
  margin: 14px 0 20px;
  font-size: clamp(40px, 5.3vw, 72px);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.ecis-home-section__header p {
  max-width: 680px;
  margin: 0;
  color: var(--ecis-muted);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.75;
}

/* =========================================================
   INTELLIGENT ENERGY FLOW
========================================================= */

.ecis-system-section {
  background:
    radial-gradient(circle at 25% 30%, rgba(12,111,246,.09), transparent 28%),
    radial-gradient(circle at 80% 75%, rgba(74,202,116,.07), transparent 32%),
    var(--ecis-bg);
}

.ecis-system-map {
  position: relative;
  min-height: 560px;
  border: 1px solid var(--ecis-border-soft);
  border-radius: 28px;
  background:
    linear-gradient(var(--ecis-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--ecis-grid-line) 1px, transparent 1px),
    linear-gradient(145deg, rgba(12,111,246,.035), rgba(74,202,116,.018)),
    var(--ecis-surface);
  background-size: 52px 52px, 52px 52px, auto, auto;
  overflow: hidden;
  isolation: isolate;
}

.ecis-system-map::before {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(12,111,246,.10), rgba(74,202,116,.05) 38%, transparent 68%);
  filter: blur(18px);
  animation: ecis-system-breathe 5s ease-in-out infinite;
}

.ecis-system-map__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ecis-system-flow {
  fill: none;
  stroke: url(#ecisSystemGradient);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 3 11 24 10;
  vector-effect: non-scaling-stroke;
  opacity: .62;
  animation: ecis-system-flow 5.5s linear infinite;
}

.ecis-system-flow--reverse {
  animation-direction: reverse;
  animation-duration: 7s;
  opacity: .42;
}

.ecis-system-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 146px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 28px;
  color: var(--ecis-text);
  background:
    linear-gradient(145deg, rgba(12,111,246,.13), rgba(74,202,116,.08)),
    var(--ecis-surface);
  border: 1px solid rgba(74,202,116,.36);
  box-shadow:
    0 0 0 12px rgba(12,111,246,.025),
    0 0 72px rgba(12,111,246,.10),
    inset 0 0 30px rgba(74,202,116,.05);
  z-index: 2;
}

.ecis-system-hub::before,
.ecis-system-hub::after {
  content: "";
  position: absolute;
  inset: -20px;
  border: 1px solid rgba(12,111,246,.16);
  border-radius: 36px;
  animation: ecis-hub-pulse 3.6s ease-out infinite;
}

.ecis-system-hub::after {
  animation-delay: -1.8s;
}

.ecis-system-hub strong {
  display: block;
  font-size: 25px;
  line-height: 1;
  letter-spacing: .08em;
}

.ecis-system-hub span {
  display: block;
  margin-top: 9px;
  color: var(--ecis-muted);
  font-size: 10px;
  text-align: center;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.ecis-system-node {
  position: absolute;
  z-index: 2;
  width: min(235px, 22%);
  padding: 22px;
  border: 1px solid var(--ecis-border-soft);
  border-radius: 18px;
  background: color-mix(in srgb, var(--ecis-surface) 91%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.ecis-system-node:hover {
  transform: translateY(-5px);
  border-color: rgba(74,202,116,.42);
  box-shadow: 0 18px 48px var(--ecis-shadow);
}

.ecis-system-node::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--ecis-energy-green);
  box-shadow: 0 0 16px rgba(74,202,116,.44);
}

.ecis-system-node h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.ecis-system-node p {
  margin: 0;
  color: var(--ecis-muted);
  font-size: 13px;
  line-height: 1.55;
}

.ecis-system-node--source { left: 5%; top: 14%; }
.ecis-system-node--grid { right: 5%; top: 14%; }
.ecis-system-node--load { left: 5%; bottom: 14%; }
.ecis-system-node--market { right: 5%; bottom: 14%; }

@keyframes ecis-system-flow {
  to { stroke-dashoffset: -100; }
}

@keyframes ecis-system-breathe {
  0%, 100% { opacity: .58; transform: translate(-50%, -50%) scale(.94); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes ecis-hub-pulse {
  0% { opacity: .55; transform: scale(.92); }
  80%, 100% { opacity: 0; transform: scale(1.28); }
}

/* =========================================================
   INVESTMENT / FINANCING
========================================================= */

.ecis-investment-section {
  background: var(--ecis-surface);
}

.ecis-investment-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: center;
}

.ecis-investment-copy h2 {
  margin: 14px 0 22px;
  font-size: clamp(40px, 5vw, 70px);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.ecis-investment-copy > p:not(.ecis-eyebrow) {
  max-width: 650px;
  color: var(--ecis-muted);
  font-size: 17px;
  line-height: 1.75;
}

.ecis-investment-stack {
  position: relative;
  min-height: 470px;
  perspective: 1000px;
}

.ecis-investment-card {
  width: min(560px, 88%);
  padding: 28px 30px;
  border: 1px solid var(--ecis-border-soft);
  border-radius: 22px;
  background: var(--ecis-bg);
  box-shadow: 0 24px 70px var(--ecis-shadow);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .3s ease;
}

.ecis-investment-card:hover {
  z-index: 4;
  border-color: rgba(74,202,116,.48);
}

.ecis-investment-card__index {
  color: var(--ecis-energy-green);
  font-size: 11px;
  letter-spacing: .15em;
}

.ecis-investment-card h3 {
  margin: 10px 0 8px;
  font-size: 21px;
}

.ecis-investment-card p {
  margin: 0;
  color: var(--ecis-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* =========================================================
   LIFECYCLE / CAPABILITIES
========================================================= */

.ecis-lifecycle-section {
  background: var(--ecis-bg);
}

.ecis-lifecycle-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.ecis-lifecycle-track::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 29px;
  height: 1px;
  background: linear-gradient(90deg, var(--ecis-energy-blue), var(--ecis-system-blue), var(--ecis-energy-green));
  opacity: .48;
}

.ecis-lifecycle-item {
  position: relative;
  z-index: 1;
  padding: 0 20px 28px;
}

.ecis-lifecycle-item__dot {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 24px;
  border-radius: 50%;
  color: var(--ecis-energy-green);
  background: var(--ecis-bg);
  border: 1px solid rgba(74,202,116,.36);
  box-shadow: 0 0 0 8px var(--ecis-bg), 0 0 26px rgba(74,202,116,.08);
}

.ecis-lifecycle-item__dot svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ecis-lifecycle-item h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.ecis-lifecycle-item p {
  margin: 0;
  color: var(--ecis-muted);
  font-size: 13px;
  line-height: 1.6;
}

/* Ambient divider between major homepage sections */
.ecis-energy-divider {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(900px, 70vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--ecis-energy-blue), var(--ecis-energy-green), transparent);
  opacity: .26;
}

@media (max-width: 960px) {
  .ecis-system-map { min-height: 650px; }
  .ecis-system-node { width: 39%; }
  .ecis-system-node--source { left: 4%; top: 8%; }
  .ecis-system-node--grid { right: 4%; top: 8%; }
  .ecis-system-node--load { left: 4%; bottom: 8%; }
  .ecis-system-node--market { right: 4%; bottom: 8%; }
  .ecis-system-hub { width: 126px; }

  .ecis-investment-grid { grid-template-columns: 1fr; }
  .ecis-investment-stack { min-height: 450px; }

  .ecis-lifecycle-track { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 34px; }
  .ecis-lifecycle-track::before { display: none; }
}

@media (max-width: 620px) {
  .ecis-system-map {
    min-height: 0;
    padding: 22px;
    display: grid;
    gap: 12px;
  }

  .ecis-system-map__svg,
  .ecis-system-map::before { display: none; }

  .ecis-system-hub {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    aspect-ratio: auto;
    min-height: 112px;
    transform: none;
    border-radius: 18px;
  }

  .ecis-system-hub::before,
  .ecis-system-hub::after { display: none; }

  .ecis-system-node {
    position: relative;
    inset: auto;
    width: 100%;
  }

  .ecis-investment-stack { min-height: 560px; }
  .ecis-investment-card { width: 96%; }
  .ecis-investment-card:nth-child(1) { top: 0; }
  .ecis-investment-card:nth-child(2) { top: 32%; }
  .ecis-investment-card:nth-child(3) { top: 64%; }

  .ecis-lifecycle-track { grid-template-columns: 1fr; }
  .ecis-lifecycle-item { padding-inline: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ecis-site-header::after,
  .ecis-system-flow,
  .ecis-system-map::before,
  .ecis-system-hub::before,
  .ecis-system-hub::after {
    animation: none !important;
  }
}
