/*
Theme Name: ECIS
Theme URI: https://ecis-group.eu/
Author: ECIS
Description: Lightweight custom block theme for the ECIS energy systems website.
Version: 0.2.0
Requires at least: 6.6
Requires PHP: 8.0
Text Domain: ecis
*/

/* =========================================================
   ECIS BRAND + SEMANTIC COLOR TOKENS
   Brand colors never change. Semantic tokens do.
========================================================= */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --ecis-navy: #031634;
  --ecis-system-blue: #084F84;
  --ecis-energy-blue: #0C6FF6;
  --ecis-energy-green: #4ACA74;
  --ecis-black: #000000;
  --ecis-white: #FFFFFF;

  --ecis-bg: #000000;
  --ecis-surface: #031634;
  --ecis-surface-elevated: #031634;
  --ecis-text: #FFFFFF;
  --ecis-muted: rgba(255,255,255,.68);
  --ecis-subtle: rgba(255,255,255,.48);
  --ecis-border-soft: rgba(255,255,255,.09);
  --ecis-border: rgba(74,202,116,.34);
  --ecis-header-bg: rgba(0,0,0,.76);
  --ecis-grid-line: rgba(255,255,255,.025);
  --ecis-icon-bg: #000000;
  --ecis-tag-text: #031634;
  --ecis-input-bg: #031634;
  --ecis-shadow: rgba(0,0,0,.38);
  --ecis-contact-bg: #031634;
  --ecis-contact-panel: #000000;

  --ecis-radius: 20px;
  --ecis-shell: 1500px;
}

:root[data-theme="light"] {
  color-scheme: light;

  --ecis-bg: #FFFFFF;
  --ecis-surface: #FFFFFF;
  --ecis-surface-elevated: #FFFFFF;
  --ecis-text: #031634;
  --ecis-muted: rgba(3,22,52,.70);
  --ecis-subtle: rgba(3,22,52,.48);
  --ecis-border-soft: rgba(3,22,52,.13);
  --ecis-border: rgba(8,79,132,.24);
  --ecis-header-bg: rgba(255,255,255,.86);
  --ecis-grid-line: rgba(3,22,52,.045);
  --ecis-icon-bg: #FFFFFF;
  --ecis-tag-text: #031634;
  --ecis-input-bg: #FFFFFF;
  --ecis-shadow: rgba(3,22,52,.14);
  --ecis-contact-bg: #FFFFFF;
  --ecis-contact-panel: #FFFFFF;
}

/* CSS-only fallback when JavaScript is unavailable. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --ecis-bg: #FFFFFF;
    --ecis-surface: #FFFFFF;
    --ecis-surface-elevated: #FFFFFF;
    --ecis-text: #031634;
    --ecis-muted: rgba(3,22,52,.70);
    --ecis-subtle: rgba(3,22,52,.48);
    --ecis-border-soft: rgba(3,22,52,.13);
    --ecis-border: rgba(8,79,132,.24);
    --ecis-header-bg: rgba(255,255,255,.86);
    --ecis-grid-line: rgba(3,22,52,.045);
    --ecis-icon-bg: #FFFFFF;
    --ecis-tag-text: #031634;
    --ecis-input-bg: #FFFFFF;
    --ecis-shadow: rgba(3,22,52,.14);
    --ecis-contact-bg: #FFFFFF;
    --ecis-contact-panel: #FFFFFF;
  }
}

html {
  scroll-behavior: smooth;
  background: var(--ecis-bg);
}

body {
  margin: 0;
  background: var(--ecis-bg) !important;
  color: var(--ecis-text) !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .28s ease, color .28s ease;
}

body, button, input, textarea, select {
  font-family: Prompt, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1, h2, h3, h4, h5, h6,
.wp-block-heading {
  color: var(--ecis-text) !important;
}

a { color: inherit; }
img, video { max-width: 100%; height: auto; }

.ecis-shell {
  width: min(var(--ecis-shell), calc(100vw - 64px));
  margin-inline: auto;
}

.ecis-section {
  position: relative;
  padding: clamp(72px, 8vw, 120px) 0;
  background-color: var(--ecis-bg);
}

.ecis-eyebrow {
  color: var(--ecis-energy-green);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.ecis-muted { color: var(--ecis-muted) !important; }

/* =========================================================
   HEADER
========================================================= */

.ecis-site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  background: var(--ecis-header-bg);
  border-bottom: 1px solid var(--ecis-border-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: background-color .28s ease, border-color .28s ease;
}

.ecis-site-header__inner {
  min-height: 76px;
}

.ecis-site-header__actions {
  gap: 14px;
}

.ecis-site-header .wp-block-site-title {
  color: var(--ecis-text);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .12em;
}

.ecis-site-header .wp-block-site-title a,
.ecis-site-header .wp-block-navigation a {
  color: var(--ecis-text);
  text-decoration: none;
}

.ecis-site-header .wp-block-navigation-item__content {
  opacity: .76;
  transition: opacity .2s ease;
}

.ecis-site-header .wp-block-navigation-item__content:hover {
  opacity: 1;
}

.wp-block-navigation__responsive-container.is-menu-open {
  background: var(--ecis-bg) !important;
  color: var(--ecis-text) !important;
}

/* Theme switch */
.ecis-theme-toggle {
  appearance: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  color: var(--ecis-text);
  background: transparent;
  border: 1px solid var(--ecis-border-soft);
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform .2s ease,
    background-color .2s ease,
    border-color .2s ease,
    color .2s ease;
}

.ecis-theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(74,202,116,.08);
  border-color: rgba(74,202,116,.38);
}

.ecis-theme-toggle:focus-visible {
  outline: 2px solid var(--ecis-energy-blue);
  outline-offset: 3px;
}

.ecis-theme-toggle__icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

/* =========================================================
   HERO
========================================================= */

.ecis-hero {
  position: relative;
  overflow: hidden;
  min-height: min(860px, calc(100svh - 76px));
  display: grid;
  align-items: center;
  background:
    radial-gradient(circle at 76% 28%, rgba(12,111,246,.16), transparent 31%),
    radial-gradient(circle at 16% 82%, rgba(74,202,116,.10), transparent 30%),
    var(--ecis-bg);
  transition: background-color .28s ease;
}

:root[data-theme="light"] .ecis-hero {
  background:
    radial-gradient(circle at 76% 28%, rgba(12,111,246,.10), transparent 31%),
    radial-gradient(circle at 16% 82%, rgba(74,202,116,.09), transparent 30%),
    var(--ecis-bg);
}

.ecis-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .8;
  pointer-events: none;
  background-image:
    linear-gradient(var(--ecis-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--ecis-grid-line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000, transparent 92%);
}

.ecis-hero__content {
  position: relative;
  z-index: 2;
  max-width: 920px;
}

.ecis-hero h1 {
  margin: 18px 0 24px;
  max-width: 1100px;
  font-size: clamp(52px, 8vw, 116px);
  font-weight: 500;
  line-height: .93;
  letter-spacing: -.055em;
}

.ecis-hero__lead {
  max-width: 730px;
  margin: 0 0 34px;
  color: var(--ecis-muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.7;
}

.ecis-hero__visual {
  position: absolute;
  z-index: 1;
  right: clamp(-160px, -7vw, -50px);
  top: 50%;
  width: min(47vw, 660px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  border: 1px solid var(--ecis-border-soft);
  border-radius: 50%;
  box-shadow:
    inset 0 0 80px rgba(12,111,246,.09),
    0 0 90px rgba(12,111,246,.06);
}

.ecis-hero__visual::before,
.ecis-hero__visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  inset: 13%;
  border: 1px solid rgba(74,202,116,.20);
}

.ecis-hero__visual::after {
  inset: 30%;
  background: radial-gradient(
    circle,
    rgba(74,202,116,.16),
    rgba(12,111,246,.05) 45%,
    transparent 70%
  );
  box-shadow: 0 0 45px rgba(74,202,116,.08);
}

.ecis-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .36;
  mix-blend-mode: screen;
}

/* =========================================================
   BUTTONS
========================================================= */

.wp-block-button__link {
  border-radius: 999px !important;
  padding: 14px 22px !important;
  font-weight: 500;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.wp-block-button__link:hover {
  transform: translateY(-2px);
}

.wp-block-button.is-style-fill .wp-block-button__link,
.wp-block-button:not(.is-style-outline) .wp-block-button__link {
  background: var(--ecis-energy-green);
  color: var(--ecis-black);
  box-shadow: 0 10px 30px rgba(74,202,116,.12);
}

.wp-block-button.is-style-outline .wp-block-button__link {
  border-color: var(--ecis-border-soft);
  color: var(--ecis-text);
  background: transparent;
}

/* =========================================================
   VALUE CARDS
========================================================= */

.ecis-value-grid {
  gap: 18px;
}

.ecis-value-card {
  height: 100%;
  padding: 30px;
  background:
    linear-gradient(145deg, rgba(12,111,246,.035), transparent 50%),
    var(--ecis-surface);
  border: 1px solid var(--ecis-border-soft);
  border-radius: var(--ecis-radius);
  box-shadow: 0 16px 42px rgba(3,22,52,.04);
  transition:
    background-color .28s ease,
    border-color .28s ease,
    transform .28s ease;
}

.ecis-value-card:hover {
  transform: translateY(-4px);
  border-color: rgba(74,202,116,.34);
}

.ecis-value-card h3 {
  margin-top: 0;
}

.ecis-value-card p {
  color: var(--ecis-muted);
}

/* =========================================================
   PROCESS
========================================================= */

.ecis-process {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 15%, rgba(12,111,246,.09), transparent 32%),
    radial-gradient(circle at 10% 85%, rgba(74,202,116,.07), transparent 30%),
    var(--ecis-bg);
}

.ecis-process__header {
  max-width: 800px;
  margin: 0 auto 60px;
  text-align: center;
}

.ecis-process__header h2 {
  margin: 14px 0 18px;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.05;
  letter-spacing: -.04em;
}

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

.ecis-process__grid::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 58px;
  left: 4%;
  right: 4%;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--ecis-energy-blue),
    var(--ecis-system-blue),
    var(--ecis-energy-green)
  );
  opacity: .65;
}

.process-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 430px;
  padding: 28px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(74,202,116,.04), transparent 42%),
    var(--ecis-surface);
  border: 1px solid var(--ecis-border);
  border-radius: var(--ecis-radius);
  box-shadow:
    inset 0 1px 0 rgba(74,202,116,.06),
    0 14px 42px rgba(3,22,52,.04);
  transition:
    transform .35s ease,
    border-color .35s ease,
    box-shadow .35s ease,
    background-color .28s ease;
}

.process-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--ecis-energy-blue),
    var(--ecis-energy-green),
    transparent
  );
  opacity: .85;
}

.process-card:hover {
  transform: translateY(-7px);
  border-color: rgba(74,202,116,.62);
  box-shadow:
    0 22px 60px var(--ecis-shadow),
    0 0 38px rgba(74,202,116,.07);
}

.process-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 38px;
}

.process-card__number {
  color: var(--ecis-subtle);
  font-size: 12px;
  letter-spacing: .16em;
}

.process-card__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  color: var(--ecis-energy-green);
  background: var(--ecis-icon-bg);
  border: 1px solid rgba(74,202,116,.30);
  border-radius: 15px;
  transition: background-color .28s ease;
}



.process-card__icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.process-card h3 {
  margin: 0 0 16px;
  font-size: 22px;
  line-height: 1.28;
  letter-spacing: -.02em;
}

.process-card > p {
  margin: 0 0 30px;
  color: var(--ecis-muted);
  font-size: 14px;
  line-height: 1.75;
}

.process-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

.process-tag {
  margin: 0 !important;
  padding: 7px 10px;
  color: var(--ecis-tag-text);
  background: #4ACA74;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
}

/* =========================================================
   CONTACT
========================================================= */

.ecis-contact {
  background: var(--ecis-contact-bg);
  border-top: 1px solid var(--ecis-border-soft);
}

.ecis-contact__panel {
  padding: clamp(32px, 5vw, 68px);
  border: 1px solid var(--ecis-border-soft);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(12,111,246,.07), transparent 44%),
    var(--ecis-contact-panel);
  box-shadow: 0 20px 60px rgba(3,22,52,.06);
}

.ecis-contact input,
.ecis-contact textarea,
.ecis-contact select {
  width: 100%;
  padding: 14px 16px;
  color: var(--ecis-text);
  background: var(--ecis-input-bg);
  border: 1px solid var(--ecis-border-soft);
  border-radius: 10px;
}

/* =========================================================
   FOOTER
========================================================= */

.ecis-site-footer {
  padding: 42px 0;
  background: var(--ecis-bg);
  border-top: 1px solid var(--ecis-border-soft);
  color: var(--ecis-muted);
  font-size: 14px;
}

/* =========================================================
   SCROLL REVEAL
========================================================= */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity .7s ease,
    transform .7s cubic-bezier(.2,.8,.2,1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {
  .ecis-process__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ecis-process__grid::before {
    display: none;
  }

  .ecis-hero__visual {
    opacity: .55;
    right: -220px;
    width: 720px;
  }
}

@media (max-width: 782px) {
  .ecis-shell {
    width: min(100% - 36px, var(--ecis-shell));
  }

  .ecis-site-header__actions {
    gap: 8px;
  }

  .ecis-theme-toggle {
    width: 40px;
    height: 40px;
  }

  .ecis-hero {
    min-height: 720px;
  }

  .ecis-hero__visual {
    width: 560px;
    right: -330px;
    opacity: .42;
  }

  .ecis-process__grid {
    grid-template-columns: 1fr;
  }

  .process-card {
    min-height: auto;
  }

  .ecis-process__header {
    text-align: left;
  }
}

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

  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
