/* ===========================================================================
   2SR Energy — Shared styles & animations (CBS-style, green + blue theme)
   Used by every page alongside the Tailwind CDN config.
   =========================================================================== */

:root {
  --brand: #00704a;
  --brand-bright: #0f9d63;
  --brand-blue: #0369a1;
}

html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  font-family: 'Work Sans', sans-serif;
  background: #f9faf9; color: #16201b;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-size: 17px; line-height: 1.7;
}
h1, h2, h3, h4 { font-family: 'Playfair Display', serif; }
html, body { overflow-x: hidden; overflow-x: clip; }

/* Material Symbols baseline */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle; user-select: none;
}

/* =======================================================================
   HOME HERO — full-screen, centred, dark photo backdrop
   ======================================================================= */
.hero-v2 {
  position: relative; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 8rem 1.5rem 6rem;
  background: radial-gradient(120% 90% at 50% 0%, #15241e 0%, #0c1612 45%, #060b09 100%);
}
.hero-v2 .hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0; pointer-events: none;
  opacity: .5; filter: saturate(.7) brightness(1.05);
  animation: heroZoom 28s ease-in-out infinite alternate;
}
@keyframes heroZoom { from { transform: scale(1); } to { transform: scale(1.08); } }
.hero-v2 .hero-bg-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5,10,8,.35) 0%, rgba(5,10,8,.15) 45%, rgba(5,10,8,.55) 100%),
    radial-gradient(72% 60% at 50% 46%, rgba(0,0,0,0) 0%, rgba(0,0,0,.32) 100%);
}
.hero-v2-inner { position: relative; z-index: 2; max-width: 1000px; margin: 0 auto; text-align: center; }
.hero-v2-inner::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 125%; height: 135%;
  background: radial-gradient(ellipse at center, rgba(4,8,6,.72) 0%, rgba(4,8,6,.5) 38%, rgba(4,8,6,.2) 62%, rgba(4,8,6,0) 78%);
  filter: blur(14px);
}
.hero-eyebrow {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  font-size: 12px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase;
  color: #b9efd2; margin-bottom: 2rem;
  text-shadow: 0 0 20px rgba(15,157,99,.6), 0 1px 6px rgba(0,0,0,.7);
}
.hero-rule { display: block; width: 56px; height: 1px; background: linear-gradient(90deg, transparent, var(--brand-bright)); }
.hero-eyebrow .hero-rule:last-child { background: linear-gradient(90deg, var(--brand-bright), transparent); }
.hero-v2-title {
  font-family: 'Playfair Display', serif; font-weight: 800; color: #fff;
  font-size: clamp(2.6rem, 7vw, 5.6rem); line-height: 1.08; letter-spacing: -.015em;
  margin: 0 0 1.75rem;
  filter: drop-shadow(0 3px 16px rgba(0,0,0,.7)) drop-shadow(0 0 42px rgba(0,0,0,.45));
}
.hero-v2-title em {
  font-style: italic; font-weight: 700;
  background: linear-gradient(100deg, #5ee6a8, #10b981 45%, #38bdf8);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  padding: 0 .04em;
  filter: drop-shadow(0 0 24px rgba(16,185,129,.45));
}
.hero-v2-sub {
  max-width: 640px; margin: 0 auto 2.75rem; color: #fff;
  font-size: clamp(1.02rem, 1.4vw, 1.22rem); line-height: 1.75;
  text-shadow: 0 1px 2px rgba(0,0,0,.92), 0 2px 10px rgba(0,0,0,.8), 0 0 30px rgba(0,0,0,.55);
}
.hero-v2-cta { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.hero-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  padding: 1.05rem 2.5rem; border-radius: 9999px;
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}
.hero-btn-solid {
  background: linear-gradient(120deg, var(--brand-bright), var(--brand)); color: #fff;
  box-shadow: 0 14px 34px rgba(15,157,99,.4), 0 0 40px rgba(15,157,99,.3);
}
.hero-btn-solid:hover { transform: translateY(-2px); box-shadow: 0 20px 46px rgba(15,157,99,.55), 0 0 56px rgba(15,157,99,.4); }
.hero-btn-ghost {
  border: 1px solid rgba(255,255,255,.42); color: #fff;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 6px 22px rgba(0,0,0,.4);
}
.hero-btn-ghost:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.6); transform: translateY(-2px); }
.hero-scroll {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 10px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase;
  color: rgba(255,255,255,.5); transition: color .25s ease;
}
.hero-scroll:hover { color: #fff; }
.hero-scroll-line { width: 1px; height: 44px; background: linear-gradient(180deg, rgba(255,255,255,.55), transparent); position: relative; overflow: hidden; }
.hero-scroll-line::after {
  content: ''; position: absolute; left: 0; top: -60%; width: 100%; height: 60%;
  background: linear-gradient(180deg, transparent, var(--brand-bright));
  animation: heroScroll 2.1s cubic-bezier(.6,0,.4,1) infinite;
}
@keyframes heroScroll { 0% { top: -60%; } 100% { top: 100%; } }
.hero-rise { opacity: 0; transform: translateY(24px); animation: heroRise .9s cubic-bezier(.16,1,.3,1) forwards; }
@keyframes heroRise { to { opacity: 1; transform: translateY(0); } }

/* Transparent header while the dark hero is behind it (home page only) */
body[data-page="index.html"] .site-header:not(.scrolled) {
  background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
body[data-page="index.html"] .site-header:not(.scrolled) .nav-link,
body[data-page="index.html"] .site-header:not(.scrolled) .brand-name,
body[data-page="index.html"] .site-header:not(.scrolled) [data-menu-open] { color: rgba(255,255,255,.9); }
body[data-page="index.html"] .site-header:not(.scrolled) .brand-sub { color: rgba(255,255,255,.65); }
body[data-page="index.html"] .site-header:not(.scrolled) .nav-link:hover { color: #fff; }
body[data-page="index.html"] .site-header:not(.scrolled) [data-menu-open] { border-color: rgba(255,255,255,.32); }
body[data-page="index.html"] .site-header:not(.scrolled) .nav-pill { background: rgba(255,255,255,.14); }

@media (max-width: 640px) {
  .hero-v2 { padding: 7rem 1.25rem 5rem; }
  .hero-eyebrow { gap: 10px; font-size: 10px; letter-spacing: .2em; }
  .hero-rule { width: 26px; }
  .hero-btn { padding: .95rem 1.9rem; }
}

/* ---------- Scroll-reveal ---------- */
.fade-up, .reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1);
}
.fade-up.visible, .reveal.visible { opacity: 1; transform: none; }

/* ---------- Decorative ---------- */
.grid-pattern {
  background-image:
    linear-gradient(to right, rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 48px 48px;
}
.gradient-text {
  background: linear-gradient(90deg, var(--brand), var(--brand-blue));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.gradient-bg { background: linear-gradient(135deg, var(--brand) 0%, #0b7f6a 50%, var(--brand-blue) 100%); }
.custom-shadow { box-shadow: 0 40px 40px rgba(0,112,74,.09); }
.soft-shadow { box-shadow: 0 10px 30px rgba(22,32,27,.06); }
.light-card-shadow { box-shadow: 0 20px 40px -15px rgba(15,23,42,.08), 0 0 1px 1px rgba(15,23,42,.05); }
.grid-motif { background-image: radial-gradient(circle, var(--brand) 1.5px, transparent 1.5px); background-size: 32px 32px; }

/* ---------- Marquee ---------- */
.marquee-container { overflow: hidden; }
.marquee-track { display: flex; width: max-content; animation: marquee 30s linear infinite; }
.marquee-container:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 50;
  background: rgba(249,250,249,.85);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transition: box-shadow .3s ease, background .3s ease;
}
.site-header.scrolled { box-shadow: 0 20px 40px rgba(0,112,74,.10); background: rgba(249,250,249,.94); }

.nav-link { position: relative; }

/* Products drop-down in the top menu: opens on hover or keyboard focus */
.nav-item > .nav-dropdown {
  opacity: 0; visibility: hidden; transform: translate(-50%, 8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s; pointer-events: none;
}
.nav-item:hover > .nav-dropdown,
.nav-item:focus-within > .nav-dropdown {
  opacity: 1; visibility: visible; transform: translate(-50%, 0); pointer-events: auto;
}
.nav-link.active { color: var(--brand); }
.nav-enhanced { position: relative; }
.nav-enhanced .nav-item { z-index: 1; }
.nav-pill {
  position: absolute; top: 50%; left: 0; border-radius: 9999px;
  background: rgba(0,112,74,.09);
  transition: transform .45s cubic-bezier(.22,1,.36,1), width .45s cubic-bezier(.22,1,.36,1), opacity .3s ease;
  z-index: 0; pointer-events: none; opacity: 0;
}
.nav-pill.show { opacity: 1; }

/* Mobile slide-in menu */
.mobile-menu { transition: transform .35s cubic-bezier(.16,1,.3,1); transform: translateX(100%); }
.mobile-menu.open { transform: translateX(0); }

/* Scroll progress bar */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%; z-index: 60;
  background: linear-gradient(90deg, var(--brand), var(--brand-bright), var(--brand-blue));
  transition: width .1s linear;
}

/* Link-button arrow nudge */
.btn-arrow .material-symbols-outlined { transition: transform .2s ease; }
.btn-arrow:hover .material-symbols-outlined { transform: translateX(4px); }

/* ---------- FAQ accordion (resources page) ---------- */
.faq-item .faq-icon { transition: transform .25s ease; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-item .faq-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.faq-item.open .faq-body { grid-template-rows: 1fr; }
.faq-item .faq-body > div { overflow: hidden; }

/* Segmented state-of-charge bar (BESS) */
.soc-bar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.soc-bar span { height: 10px; border-radius: 2px; background: #e2e8f0; }
.soc-bar span.on { background: #10b981; box-shadow: 0 0 8px rgba(16,185,129,.35); }

/* ---------- Form inputs ---------- */
.field { width: 100%; padding: .7rem .95rem; border-radius: .75rem; background: #fff; border: 1px solid #c4d3cb; font-size: .95rem; color: #16201b; transition: border-color .15s, box-shadow .15s; }
.field:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,157,99,.18); }
.field::placeholder { color: #8a9a92; }
.field-label { display: block; font-size: 12px; text-transform: uppercase; font-weight: 600; color: #4a5852; margin-bottom: .3rem; letter-spacing: .05em; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-v2 .hero-bg, .hero-scroll-line::after { animation: none; }
  .hero-rise { animation: none; opacity: 1; transform: none; }
  .fade-up, .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .marquee-track { animation: none; }
  .nav-pill { transition: opacity .2s ease; }
}
