/* ------------ HERO ------------ */
.hero {
  position: relative; isolation: isolate;
  padding: clamp(var(--s7), 8vw, var(--s9)) 0 var(--s8);
  overflow: hidden; background: linear-gradient(180deg, #f0f7f4, #d4e9df)
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(var(--s5), 4vw, var(--s7)); align-items: center }
@media (max-width:980px){ .hero-grid { grid-template-columns:1fr } }
@media (max-width:680px){
  .hero { padding-top:40px; padding-bottom:36px }
  .iso-stage { min-height:220px }
  #heroImage { height:220px; object-fit:cover }
  .cta-row{ display:flex; flex-direction:column; gap:8px }
  .cta-row .btn{ flex:1 1 auto; min-width:0 }
  .section-head{ display:block; margin-bottom:18px }
  .card{ padding:14px }
  .grid-4,.grid-3,.grid-2{ grid-template-columns:1fr }
  .iso-stage{ display:none }
  .hero-inline{ display:block }
}

/* Parallax stage */
.iso-stage{
  position:relative; background:var(--bg-elev); border:1px solid var(--line);
  border-radius:var(--radius-xl); padding:16px; box-shadow:var(--shadow-1);
  overflow:hidden; min-height:340px
}
.iso-parallax{ position:absolute; inset:0; contain:strict; pointer-events:none }
.layer{ position:absolute; inset:0; will-change:transform }
.field{ background:linear-gradient(160deg, rgba(0,163,196,.06), transparent 40%), linear-gradient(#e8edf2 1px, transparent 1px); background-size:cover, 26px 26px }
.buildings{ filter: drop-shadow(0 8px 16px rgba(0,0,0,.15)) }
.flows{ mix-blend-mode: screen }

.legend{
  position:absolute; bottom:12px; left:12px; display:flex; gap:14px;
  background:rgba(255,255,255,.75); border:1px solid var(--line); padding:8px 10px;
  border-radius:999px; backdrop-filter: blur(6px); color:#0b1220; font-size:13px; align-items:center
}
[data-theme="outage"] .legend{ background:rgba(17,22,31,.6); color:#e5eef6; border-color:#25344a }
.dot{ inline-size:10px; block-size:10px; border-radius:50% }
.dot.green{ background:var(--green); box-shadow:var(--glow-green) }
.dot.yellow{ background:var(--yellow); box-shadow:var(--glow-yellow) }
.dot.red{ background:var(--red); box-shadow:var(--glow-red) }

/* Typographic bits used inside hero */
.eyebrow{ font-size:13px; letter-spacing:.12em; text-transform:uppercase; color:var(--slate) }
h1{ font-family:var(--font-head); font-weight:800; font-size:var(--h1); line-height:1.08; margin:10px 0 12px; color:var(--charcoal) }
.lead{ font-size:var(--lead); color:var(--muted); max-width:60ch }

.toggle{ display:flex; align-items:center; gap:10px; margin-top:18px; color:var(--muted); font-weight:500 }
.switch{ inline-size:54px; block-size:30px; border-radius:999px; background:#dfe5ea; position:relative; cursor:pointer; transition:.2s background }
.switch::after{ content:""; position:absolute; inset:3px; inline-size:24px; block-size:24px; border-radius:50%; background:#fff; box-shadow:0 2px 6px rgba(0,0,0,.15); transform:translateX(0); transition:.25s transform cubic-bezier(.2,.8,.2,1) }
[data-theme="outage"] .switch{ background:#3a4553 } 
[data-theme="outage"] .switch::after{ transform:translateX(24px) }

/* === Donut Chart Hero Variant === */
.donut-stage {
  position: relative;
  background: transparent;
  border: none;
  padding: 16px;
  overflow: visible;
  min-height: 340px;
}

.donut-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
}

.donut-header {
  text-align: center;
}

.donut-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--charcoal);
}

.donut-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.donut-chart {
  width: 100%;
  height: 280px;
}

/* Advice banner below donut */
.donut-advice {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
  font-size: 12px;
}

.donut-advice-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-advice.ok .donut-advice-dot {
  background: var(--green);
  box-shadow: var(--glow-green);
}

.donut-advice.warn .donut-advice-dot {
  background: var(--yellow);
  box-shadow: var(--glow-yellow);
}

.donut-advice.neutral .donut-advice-dot {
  background: var(--slate);
}

.donut-advice-text {
  color: var(--muted);
  flex: 1;
}

.donut-advice-text strong {
  color: var(--charcoal);
  font-weight: 600;
}

/* Donut controls */
.donut-controls {
  margin-top: 8px;
}

.donut-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.donut-input-group {
  display: flex;
  gap: 8px;
}

.donut-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--charcoal);
  font-size: 14px;
}

.donut-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 180, 131, 0.1);
}

.btn-donut-submit {
  padding: 8px 16px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-donut-submit:hover {
  background: var(--slate);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 180, 131, 0.2);
}

.donut-help {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.donut-fallback {
  display: none;
}

/* Responsive */
@media (max-width: 680px) {
  .donut-stage {
    display: none;
  }
  
  .iso-stage {
    display: none;
  }
}
