/* GridBridge Energy Monitor Dashboard */

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

:root {
  --bg:           #F7F4EE;
  --bg-alt:       #EDE9DF;
  --bg-dark:      #0E1F14;
  --fg:           #1A1A1A;
  --fg-light:     #F7F4EE;
  --accent:       #C9A84C;
  --accent-dark:  #A8872E;
  --green-deep:   #11281F;
  --green-mid:    #1E3A28;
  --teal:         #14b8a6;
  --text-muted:   #6B6860;
  --border:       rgba(201,168,76,0.2);
  --shadow:       0 4px 24px rgba(14,31,20,.12);
  --radius:       12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ─────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14,31,20,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201,168,76,0.12);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.nav-tagline {
  font-size: 11px;
  color: rgba(247,244,238,0.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.nav-live {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(247,244,238,0.55);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ── Hero band ──────────────────────────────────────────────── */
.hero-band {
  background: var(--bg-dark);
  color: var(--fg-light);
  padding: 80px 32px 64px;
  position: relative;
  overflow: hidden;
}

.hero-band-inner { position: relative; z-index: 1; max-width: 480px; }

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 16px;
}

.hero-headline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 700;
  line-height: 1.1;
  color: #F7F4EE;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 1rem;
  color: rgba(247,244,238,0.65);
  line-height: 1.65;
}

.hero-grid-art {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 55%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.hero-grid-art svg {
  width: 100%;
  height: 100%;
  max-height: 220px;
}

/* ── Container ─────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 32px; }

/* ── Section helpers ───────────────────────────────────────── */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }

.section-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 8px;
}

.section-heading {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  color: var(--green-deep);
  line-height: 1.15;
  margin-bottom: 12px;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
}

/* ── KPI strip ──────────────────────────────────────────────── */
.kpi-strip { padding: 40px 0; background: var(--bg); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.kpi-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: box-shadow .2s, transform .2s;
}

.kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.kpi-primary {
  background: var(--green-deep);
  color: #F7F4EE;
}

.kpi-primary .kpi-label { color: rgba(247,244,238,0.65); }

.kpi-highlight {
  background: var(--bg-dark);
  color: #F7F4EE;
}

.kpi-highlight .kpi-label { color: rgba(247,244,238,0.65); }

.kpi-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--green-deep);
  line-height: 1.1;
  margin-bottom: 8px;
}

.kpi-primary .kpi-value,
.kpi-highlight .kpi-value { color: var(--accent); }

.kpi-accent { color: var(--accent); }
.kpi-green { color: var(--teal); }

.kpi-label { font-size: .875rem; font-weight: 700; color: var(--green-deep); }
.kpi-sub { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }

/* ── Category breakdown ─────────────────────────────────────── */
.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.breakdown-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.breakdown-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.breakdown-icon svg { width: 22px; height: 22px; }
.breakdown-icon-hvac { background: var(--accent); }
.breakdown-icon-light { background: var(--teal); }
.breakdown-icon-equip { background: #7c3aed; }

.breakdown-cat {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-deep);
  margin-bottom: 12px;
}

.breakdown-bar-wrap {
  background: rgba(14,31,20,0.08);
  border-radius: 6px;
  height: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}

.breakdown-bar {
  height: 100%;
  border-radius: 6px;
  background: var(--accent);
  transition: width 1.2s ease;
}

.breakdown-bar-light { background: var(--teal); }
.breakdown-bar-equip { background: #7c3aed; }

.breakdown-values {
  display: flex;
  justify-content: space-between;
}

.breakdown-pct {
  font-size: .875rem;
  font-weight: 700;
  color: var(--green-deep);
}

.breakdown-kwh {
  font-size: .875rem;
  color: var(--text-muted);
}

/* ── Chart ──────────────────────────────────────────────────── */
.chart-wrap {
  margin-top: 32px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.chart-legend {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-item::before {
  content: '';
  display: block;
  width: 20px;
  height: 3px;
  border-radius: 2px;
}

.legend-hvac::before { background: #C9A84C; }
.legend-light::before { background: #14b8a6; }
.legend-equip::before { background: #7c3aed; }

/* ── Opportunities ─────────────────────────────────────────── */
.opportunities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 40px;
  margin-bottom: 40px;
}

.opp-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.opp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.opp-cat {
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.opp-difficulty {
  font-size: .75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.opp-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--green-deep);
  margin-bottom: 20px;
}

.opp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.opp-stat { display: flex; flex-direction: column; gap: 4px; }

.opp-stat-val {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--green-deep);
}

.opp-stat-label {
  font-size: .6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}

.opp-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .75rem;
  color: var(--text-muted);
}

.opp-bar {
  height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 4px;
  min-width: 6px;
}

/* ── Solar pool banner ─────────────────────────────────────── */
.solar-pool-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--green-deep);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: var(--radius);
  padding: 28px 32px;
  color: #F7F4EE;
}

.solar-pool-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  background: rgba(201,168,76,0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.solar-pool-icon svg { width: 26px; height: 26px; }

.solar-pool-text { flex: 1; }

.solar-pool-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.solar-pool-desc { font-size: .875rem; color: rgba(247,244,238,0.6); }

.solar-pool-badge {
  background: rgba(20,184,166,0.2);
  color: var(--teal);
  font-size: .75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 100px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ── Impact section ─────────────────────────────────────────── */
.impact-section {
  background: var(--green-deep);
  padding: 72px 0;
}

.impact-section .section-heading { color: #F7F4EE; }

.impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.impact-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
}

.impact-number {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.impact-unit {
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(247,244,238,0.6);
  margin-bottom: 8px;
}

.impact-desc {
  font-size: .8125rem;
  color: rgba(247,244,238,0.4);
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  background: #071a45;
  padding: 24px 0;
  text-align: center;
}

.footer p {
  font-size: .8125rem;
  color: rgba(255,255,255,.35);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .impact-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .impact-grid { grid-template-columns: 1fr; }
  .hero-grid-art { display: none; }
  .solar-pool-banner { flex-direction: column; text-align: center; }
  .opp-stats { grid-template-columns: 1fr 1fr; }
}