/* ================================================================
   EcoActify · Scroll-Driven Video — v3
   Architecture per best-practices guide:
   - Video: position fixed, z-index 0
   - Text panels: position fixed, z-index 1
   - Content sections: normal flow, z-index 2 (cover the video)
   Font: Inter (clean, matches the cards the user preferred)
================================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  background: #080e08;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Loader ── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #080e08;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}

.loader__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 260px;
}

.loader__logo {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
}

.loader__logo span { color: #5cb85c; }

.loader__bar-wrap {
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loader__bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #3d7a3d, #7dd97d);
  border-radius: 2px;
  transition: width 0.15s ease;
}

.loader__text {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.loader__text span {
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}

/* ── Nav (fixed, transparent, always on top) ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 28px 6vw;
}

.nav__logo {
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  margin-right: auto;
}

.nav__logo span { color: #5cb85c; }

.nav__links {
  display: flex;
  list-style: none;
  gap: 0.2rem;
}

.nav__links a {
  display: block;
  padding: 0.35rem 0.9rem;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(255,255,255,0.75);
  border-radius: 999px;
  transition: color 0.25s, background 0.25s;
}

.nav__links a:hover { color: #fff; background: rgba(255,255,255,0.1); }

.nav__cta {
  margin-left: 1rem;
  display: inline-block;
  padding: 0.45rem 1.2rem;
  background: #3d7a3d;
  color: #fff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 999px;
  transition: background 0.25s;
}

.nav__cta:hover { background: #4a9a4a; }

/* ── Fixed video — fullscreen background ── */
#scrollVideo {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
  /* slight vignette via outline trick won't work; handled with pseudo on body */
}

/* Vignette overlay sitting just above the video */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.55) 100%),
    linear-gradient(to bottom,
      rgba(0,0,0,0.35) 0%,
      transparent 30%,
      transparent 65%,
      rgba(0,0,0,0.6) 100%
    );
}

/* ── Fixed text panels ── */
/* All panels: fixed, opacity 0 by default, JS drives opacity + transform */
.panel {
  position: fixed;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
  padding: 0 8vw;
  max-width: 680px;
}

/* Center panel (Panel 1) */
.panel--center {
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 100%;
  padding: 0 10vw;
}

/* Left panel (Panel 2) */
.panel--left {
  left: 0;
  bottom: 14vh;
  text-align: left;
}

/* Right panel (Panel 3) */
.panel--right {
  right: 0;
  bottom: 14vh;
  left: auto;
  text-align: right;
  max-width: 520px;
}

/* Panel typography */
.panel__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #7dd97d;
  margin-bottom: 0.9rem;
}

.panel__h1 {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 1rem;
}

.panel__h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  font-weight: 300;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 1rem;
}

.panel__sub {
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  font-weight: 300;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0.01em;
  margin-bottom: 0;
}

.panel__body-text {
  font-size: clamp(0.8rem, 1.1vw, 0.92rem);
  font-weight: 300;
  line-height: 1.75;
  color: rgba(255,255,255,0.78);
}

.panel__cta {
  display: inline-block;
  margin-top: 1.4rem;
  padding: 0.7rem 1.8rem;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  backdrop-filter: blur(6px);
  background: rgba(255,255,255,0.08);
  transition: background 0.25s;
  pointer-events: all;
}

.panel__cta:hover { background: rgba(255,255,255,0.18); }

/* Scroll hint (inside Panel 1) */
.scroll-hint {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.scroll-hint__bar {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.6), transparent);
  animation: barDrop 2.2s ease-in-out infinite;
  transform-origin: top;
}

@keyframes barDrop {
  0%   { transform: scaleY(0); opacity: 1; }
  55%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* Progress bar — thin line at very bottom of screen */
#progress-bar {
  position: fixed;
  bottom: 0; left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(to right, #3d7a3d, #7dd97d);
  z-index: 2;
  transition: width 0.05s linear;
}

/* ── Video scroll space ── */
/* Height set by JS = 4 × 100vh */
#video-space {
  position: relative;
  z-index: -1; /* below everything, just a spacer */
}

/* ── CONTENT SECTIONS ── */
/* Must have background + z-index > 0 to cover the fixed video */
#content {
  position: relative;
  z-index: 2;
  background: #080e08;
}

.section {
  padding: 8rem 8vw;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.section--mid { background: #0d160d; }

.section--cta { text-align: center; }

.section__inner {
  max-width: 1060px;
  margin: 0 auto;
}

.section__inner--center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Section typography */
.s-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #7dd97d;
  margin-bottom: 1.2rem;
}

.s-heading {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 3.5rem;
}

.s-lead {
  font-size: 1rem;
  font-weight: 300;
  color: rgba(255,255,255,0.72);
  line-height: 1.65;
  max-width: 480px;
  margin-bottom: 2.5rem;
}

/* Pillars */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.pillar {
  padding: 2.5rem 2rem 2.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.pillar + .pillar { padding-left: 2rem; border-left: 1px solid rgba(255,255,255,0.1); }

.pillar__num {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: #7dd97d;
  margin-bottom: 1.2rem;
}

.pillar h3 {
  font-size: 1.05rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 0.6rem;
}

.pillar p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.6);
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 1rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat__num {
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fff;
}

.stat__label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

/* CTA buttons */
.btn-group { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 999px;
  transition: background 0.25s, transform 0.25s;
}

.btn--primary { background: #3d7a3d; color: #fff; }
.btn--primary:hover { background: #4a9a4a; transform: translateY(-1px); }

.btn--ghost { border: 1px solid rgba(255,255,255,0.3); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,0.08); transform: translateY(-1px); }

/* Reveal (initial state for GSAP) */
.reveal { opacity: 0; transform: translateY(22px); will-change: opacity, transform; }

/* ── Footer ── */
.footer {
  background: #04080a;
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 4.5rem 8vw 2rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  max-width: 1060px;
  margin: 0 auto 3rem;
}

.footer__logo {
  display: block;
  font-size: 1.2rem;
  font-weight: 500;
  color: #7dd97d;
  margin-bottom: 0.75rem;
}

.footer__brand p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.65;
  max-width: 280px;
}

.footer__col h4 {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 0.9rem;
}

.footer__col p,
.footer__col a {
  display: block;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  margin-bottom: 0.35rem;
  transition: color 0.2s;
}

.footer__col a:hover { color: #7dd97d; }

.footer__bottom {
  max-width: 1060px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.28);
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .pillars { grid-template-columns: 1fr; }
  .pillar + .pillar { border-left: none; padding-left: 0; }
  .stats { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  .panel--left, .panel--right { bottom: 10vh; }
}

@media (max-width: 580px) {
  nav { padding: 20px 5vw; }
  .nav__links { display: none; }
  .panel--right { right: 0; left: 0; text-align: left; max-width: 100%; }
  .footer__grid { grid-template-columns: 1fr; }
  .section { padding: 5rem 6vw; }
}
