/* ECIS component refinements */

/* Brand logo switching */
.ecis-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.ecis-brand__logo {
  display: block;
  width: clamp(150px, 16vw, 220px);
  height: auto;
  transition: width .35s cubic-bezier(.2,.8,.2,1), opacity .25s ease;
}

.ecis-brand__logo--light { display: block; }
.ecis-brand__logo--dark { display: none; }

:root[data-theme="light"] .ecis-brand__logo--light { display: none; }
:root[data-theme="light"] .ecis-brand__logo--dark { display: block; }
:root[data-theme="dark"] .ecis-brand__logo--light { display: block; }
:root[data-theme="dark"] .ecis-brand__logo--dark { display: none; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .ecis-brand__logo--light { display: none; }
  :root:not([data-theme]) .ecis-brand__logo--dark { display: block; }
}

.ecis-construction-logo {
  margin-bottom: clamp(30px, 5vw, 56px);
}

.ecis-construction-logo .ecis-brand__logo {
  width: clamp(210px, 34vw, 420px);
}

/* =========================================================
   STICKY / SCROLLING HEADER
========================================================= */

.ecis-site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  isolation: isolate;
  will-change: background-color, box-shadow;
  transition:
    background-color .35s ease,
    border-color .35s ease,
    box-shadow .35s ease;
}

.ecis-site-header::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: 5%;
  right: 5%;
  bottom: -1px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(12,111,246,.85),
    rgba(37,166,200,.8),
    rgba(74,202,116,.85),
    transparent
  );
  opacity: 0;
  transform: scaleX(.12);
  transform-origin: center;
  transition: opacity .35s ease, transform .55s cubic-bezier(.2,.8,.2,1);
}

.ecis-site-header__inner {
  transition: min-height .35s cubic-bezier(.2,.8,.2,1), padding .35s ease;
}

.ecis-site-header.is-scrolled {
  background: color-mix(in srgb, var(--ecis-bg) 82%, transparent);
  border-bottom-color: transparent;
  box-shadow:
    0 10px 34px rgba(0,0,0,.12),
    inset 0 -1px 0 rgba(255,255,255,.035);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
}

.ecis-site-header.is-scrolled::after {
  opacity: .75;
  transform: scaleX(1.5);
}

.ecis-site-header.is-scrolled .ecis-site-header__inner {
  min-height: 62px;
}

.ecis-site-header.is-scrolled .ecis-brand__logo {
  width: clamp(135px, 13vw, 185px);
}

:root[data-theme="light"] .ecis-site-header.is-scrolled {
  box-shadow:
    0 10px 30px rgba(3,22,52,.09),
    inset 0 -1px 0 rgba(3,22,52,.04);
}

/* =========================================================
   EQUAL-HEIGHT CARDS
========================================================= */

.ecis-value-grid {
  align-items: stretch;
}

.ecis-value-grid > .wp-block-column {
  display: flex;
}

.ecis-value-card {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.ecis-process__grid {
  align-items: stretch;
}

.ecis-process__grid > .process-card {
  align-self: stretch;
  height: var(--process-card-height, auto) !important;
  box-sizing: border-box;
}

.process-card .process-tags {
  margin-top: auto;
}

/* =========================================================
   POINTER-REACTIVE CARDS + PANELS
========================================================= */

.ecis-value-card,
.process-card,
.ecis-contact__panel {
  --pointer-x: 50%;
  --pointer-y: 50%;
}

.ecis-value-card,
.ecis-contact__panel {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.ecis-value-card::before,
.ecis-contact__panel::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    360px circle at var(--pointer-x) var(--pointer-y),
    rgba(12,111,246,.10),
    rgba(74,202,116,.045) 34%,
    transparent 68%
  );
  opacity: 0;
  transition: opacity .28s ease;
}

.ecis-value-card > *,
.ecis-contact__panel > * {
  position: relative;
  z-index: 1;
}

.ecis-value-card.is-pointer-active::before,
.ecis-contact__panel.is-pointer-active::before {
  opacity: 1;
}

.process-card::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    300px circle at var(--pointer-x) var(--pointer-y),
    rgba(74,202,116,.09),
    rgba(12,111,246,.05) 36%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity .28s ease;
}

.process-card::before {
  z-index: 2;
}

.process-card > * {
  position: relative;
  z-index: 1;
}

.process-card.is-pointer-active::after {
  opacity: 1;
}

.process-card__icon {
  transition:
    transform .32s cubic-bezier(.2,.8,.2,1),
    background-color .28s ease,
    border-color .28s ease,
    box-shadow .32s ease;
}

.process-card.is-pointer-active .process-card__icon {
  transform: translate3d(var(--icon-x, 0px), var(--icon-y, 0px), 0);
  border-color: rgba(74,202,116,.58);
  box-shadow: 0 0 24px rgba(74,202,116,.10);
}

/* Gentle magnetic movement for hero CTAs. */
.ecis-hero .wp-block-button__link {
  --magnet-x: 0px;
  --magnet-y: 0px;
  --magnet-lift: 0px;
  transform: translate3d(
    var(--magnet-x),
    calc(var(--magnet-y) + var(--magnet-lift)),
    0
  );
  transition:
    transform .18s ease-out,
    box-shadow .25s ease,
    background .25s ease;
}

.ecis-hero .wp-block-button__link:hover {
  --magnet-lift: -2px;
}

/* =========================================================
   HERO ENERGY SYSTEM
   Charging + storage + distribution, without a literal illustration.
========================================================= */

.ecis-energy-orb {
  --energy-x: 0px;
  --energy-y: 0px;
  isolation: isolate;
  overflow: visible;
  border: 0;
  box-shadow: none;
  transform: translate3d(
    var(--energy-x),
    calc(-50% + var(--energy-y)),
    0
  );
  transition: transform .18s ease-out;
}

.ecis-energy-orb::before,
.ecis-energy-orb::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 0;
  border-radius: 50%;
}

.ecis-energy-orb::before {
  inset: -8%;
  z-index: -3;
  background: radial-gradient(
    circle,
    rgba(74,202,116,.16) 0,
    rgba(12,111,246,.10) 31%,
    rgba(12,111,246,.035) 52%,
    transparent 72%
  );
  filter: blur(20px);
  animation: ecis-energy-breathe 5.6s ease-in-out infinite;
}

.ecis-energy-orb::after {
  inset: 18%;
  z-index: -2;
  background: radial-gradient(
    circle,
    rgba(255,255,255,.035),
    rgba(12,111,246,.08) 38%,
    rgba(74,202,116,.04) 56%,
    transparent 72%
  );
  box-shadow: 0 0 80px rgba(12,111,246,.10);
  animation: ecis-core-breathe 4.2s ease-in-out infinite;
}

.ecis-energy-orb__halo {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 56%, rgba(12,111,246,.035) 57%, transparent 66%),
    conic-gradient(
      from 210deg,
      transparent 0 12%,
      rgba(12,111,246,.18) 18%,
      transparent 24% 50%,
      rgba(74,202,116,.15) 58%,
      transparent 66% 100%
    );
  filter: blur(.2px);
  animation: ecis-halo-spin 26s linear infinite;
}

.ecis-energy-orb__ring {
  position: absolute;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0 12%,
    rgba(12,111,246,.92) 14% 18%,
    transparent 20% 43%,
    rgba(74,202,116,.86) 45% 49%,
    transparent 51% 75%,
    rgba(37,166,200,.72) 77% 79%,
    transparent 81% 100%
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 2px),
    #000 calc(100% - 1px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 2px),
    #000 calc(100% - 1px)
  );
  filter: drop-shadow(0 0 8px rgba(12,111,246,.18));
}

.ecis-energy-orb__ring--outer {
  inset: 5%;
  animation: ecis-ring-spin 18s linear infinite;
}

.ecis-energy-orb__ring--middle {
  inset: 16%;
  opacity: .78;
  animation: ecis-ring-spin-reverse 13s linear infinite;
}

.ecis-energy-orb__ring--inner {
  inset: 29%;
  opacity: .65;
  animation: ecis-ring-spin 9s linear infinite;
}

.ecis-energy-orb__network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ecis-energy-path,
.ecis-energy-link {
  fill: none;
  stroke: url(#ecisEnergyFlow);
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.ecis-energy-path {
  stroke-width: 1.2;
  stroke-dasharray: 2 7 14 8;
  opacity: .42;
  animation: ecis-path-flow 10s linear infinite;
}

.ecis-energy-path--inner {
  opacity: .27;
  animation-duration: 7s;
  animation-direction: reverse;
}

.ecis-energy-link {
  stroke-width: 1.7;
  stroke-dasharray: 1 11 24 9;
  opacity: .72;
  filter: drop-shadow(0 0 4px rgba(74,202,116,.16));
  animation: ecis-link-flow 3.8s linear infinite;
}

.ecis-energy-link--b,
.ecis-energy-link--d {
  animation-direction: reverse;
}

.ecis-energy-node {
  fill: url(#ecisEnergyNode);
  transform-box: fill-box;
  transform-origin: center;
  animation: ecis-node-pulse 2.8s ease-in-out infinite;
}

.ecis-energy-node--2 { animation-delay: -.7s; }
.ecis-energy-node--3 { animation-delay: -1.4s; }
.ecis-energy-node--4 { animation-delay: -2.1s; }

.ecis-energy-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 27%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(74,202,116,.12),
    rgba(12,111,246,.08) 45%,
    transparent 72%
  );
  box-shadow:
    0 0 60px rgba(12,111,246,.08),
    0 0 90px rgba(74,202,116,.06);
}

.ecis-energy-core__shell {
  position: relative;
  width: 72%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.ecis-energy-core__shell::before {
  content: "";
  position: absolute;
  clip-path: inherit;
  border: 1px solid rgba(255,255,255,.08);
}

.ecis-energy-core__cell {
  position: relative;
  z-index: 1;
  width: 32%;
  height: 58%;
  padding: 10% 7%;
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  border: 1px solid rgba(255,255,255,.30);
  border-radius: 7px;
  box-shadow:
    0 0 20px rgba(12,111,246,.18),
    inset 0 0 16px rgba(3,22,52,.34);
}

.ecis-energy-core__cell::before {
  content: "";
  position: absolute;
  top: -9%;
  left: 34%;
  width: 32%;
  height: 8%;
  border-radius: 3px 3px 0 0;
  background: currentColor;
  color: rgba(255,255,255,.38);
}

.ecis-energy-core__cell span {
  display: block;
  width: 100%;
  height: 17%;
  border-radius: 999px;
  transform-origin: left center;
  background: linear-gradient(90deg, #0C6FF6, #25A6C8 52%, #4ACA74);
  box-shadow: 0 0 8px rgba(74,202,116,.25);
  animation: ecis-cell-charge 3.2s ease-in-out infinite;
}

.ecis-energy-core__cell span:nth-child(2) { animation-delay: -.4s; }
.ecis-energy-core__cell span:nth-child(3) { animation-delay: -.8s; }
.ecis-energy-core__cell span:nth-child(4) { animation-delay: -1.2s; }

:root[data-theme="light"] .ecis-energy-orb::before {
  opacity: .72;
}

:root[data-theme="light"] .ecis-energy-orb__ring {
  opacity: .62;
}

:root[data-theme="light"] .ecis-energy-core__shell {
  background: linear-gradient(145deg, rgba(12,111,246,.08), rgba(74,202,116,.04));
  border-color: rgba(8,79,132,.18);
}

:root[data-theme="light"] .ecis-energy-core__cell {
  border-color: rgba(3,22,52,.22);
  box-shadow:
    0 0 20px rgba(12,111,246,.10),
    inset 0 0 12px rgba(3,22,52,.06);
}

:root[data-theme="light"] .ecis-energy-core__cell::before {
  color: rgba(3,22,52,.30);
}

@keyframes ecis-energy-breathe {
  0%, 100% { transform: scale(.96); opacity: .55; }
  50% { transform: scale(1.05); opacity: 1; }
}

@keyframes ecis-core-breathe {
  0%, 100% { transform: scale(.94); opacity: .55; }
  50% { transform: scale(1.08); opacity: .92; }
}

@keyframes ecis-halo-spin {
  to { transform: rotate(360deg); }
}

@keyframes ecis-ring-spin {
  to { transform: rotate(360deg); }
}

@keyframes ecis-ring-spin-reverse {
  to { transform: rotate(-360deg); }
}

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

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

@keyframes ecis-node-pulse {
  0%, 100% { transform: scale(.65); opacity: .35; }
  50% { transform: scale(1.45); opacity: 1; }
}

@keyframes ecis-core-float {
  0%, 100% { transform: translateY(-3px) rotate(-1deg); }
  50% { transform: translateY(4px) rotate(1deg); }
}

@keyframes ecis-cell-charge {
  0%, 100% { transform: scaleX(.42); opacity: .38; }
  50% { transform: scaleX(1); opacity: 1; }
}

@media (max-width: 900px) {
  .ecis-energy-orb {
    right: -24vw;
    width: min(76vw, 590px);
    opacity: .68;
  }
}

@media (max-width: 782px) {
  .ecis-process__grid > .process-card {
    height: auto !important;
  }
}

@media (max-width: 640px) {
  .ecis-energy-orb {
    right: -46vw;
    width: 100vw;
    opacity: .42;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ecis-site-header,
  .ecis-site-header::after,
  .ecis-site-header__inner,
  .ecis-brand__logo,
  .ecis-energy-orb,
  .ecis-energy-orb::before,
  .ecis-energy-orb::after,
  .ecis-energy-orb__halo,
  .ecis-energy-orb__ring,
  .ecis-energy-path,
  .ecis-energy-link,
  .ecis-energy-node,
  .ecis-energy-core__shell,
  .ecis-energy-core__cell span,
  .process-card__icon,
  .ecis-hero .wp-block-button__link {
    animation: none !important;
    transition: none !important;
  }

  .ecis-value-card::before,
  .process-card::after,
  .ecis-contact__panel::before {
    display: none;
  }
}
