/* GRM Electric, mascot + fun features (Lights Out, 404, hero, thank-you, helper) */

/* ---------- Lights Out ---------- */
.brand { position: relative; display: inline-block; }
.brand__on, .brand__off { transition: opacity .12s; }
.brand__off { position: absolute; inset: 0; width: 100%; height: auto; opacity: 0; pointer-events: none; }
html.power-off .brand__on { opacity: 0; }
html.power-off .brand__off { opacity: 1; }

.bulb-hotspot {
  position: absolute; left: 88.3%; top: 32.3%; width: 44px; height: 44px;
  transform: translate(-50%, -50%); border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; padding: 0;
}
.bulb-hotspot::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 60, .75) 0, rgba(255, 198, 26, 0) 70%);
  opacity: 0; transition: opacity .2s;
}
.bulb-hotspot:hover::after, .bulb-hotspot:focus-visible::after { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .bulb-hotspot::after { animation: bulb-hint 20s 6s infinite; }
  .bulb-hotspot:hover::after, .bulb-hotspot:focus-visible::after { animation: none; }
}
@keyframes bulb-hint {
  0%, 94%, 100% { opacity: 0; }
  95% { opacity: .9; } 95.6% { opacity: .1; } 96.3% { opacity: .8; } 97% { opacity: 0; }
}

/* The darkness: one oversized element with a soft hole in the middle, moved with transform. */
.blackout {
  --beam: 150px;
  position: fixed; left: 0; top: 0; z-index: 900;
  width: 400vmax; height: 400vmax; margin: -200vmax 0 0 -200vmax;
  background: radial-gradient(circle at center,
    rgba(5, 8, 20, 0) 0,
    rgba(5, 8, 20, 0) var(--beam),
    rgba(5, 8, 20, .45) calc(var(--beam) * 1.35),
    rgba(5, 8, 20, .965) calc(var(--beam) * 1.9));
  transform: translate3d(50vw, 40vh, 0);
  pointer-events: none; opacity: 0; visibility: hidden;
  will-change: transform, opacity;
}
@media (pointer: coarse) { .blackout { --beam: 190px; } }
html.power-off .blackout { opacity: 1; visibility: visible; }
html.power-cutting .blackout { visibility: visible; animation: power-cut .6s steps(1, end) forwards; }
@keyframes power-cut {
  0% { opacity: .92; } 16% { opacity: .15; } 33% { opacity: 1; } 50% { opacity: .35; } 66% { opacity: .95; } 83% { opacity: .5; } 100% { opacity: 1; }
}

/* Banner */
.outage { position: fixed; left: 50%; top: 16px; z-index: 920; transform: translate(-50%, -140%); transition: transform .35s cubic-bezier(.2, 1.3, .4, 1); width: min(560px, calc(100vw - 24px)); }
html.power-off .outage { transform: translate(-50%, 0); }
.outage__card { background: var(--navy-900); color: var(--white); border: 3px solid var(--yellow-400); border-radius: 16px; padding: 18px 22px; box-shadow: 0 0 40px rgba(255, 198, 26, .35); text-align: center; }
.outage__script { font-size: 28px; }
.outage__title { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1.05; text-transform: uppercase; }
.outage__sub { color: var(--on-navy); font-size: 16px; margin: 6px 0 14px; }
.outage__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; align-items: center; }

/* Light switch button */
.light-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px 0 8px; border: 2px solid var(--white); border-radius: var(--radius-sm); background: transparent; color: var(--white); font: 700 16px var(--font-body); cursor: pointer; }
.light-switch:hover { background: rgba(255, 255, 255, .1); }
.light-switch__plate { width: 26px; height: 38px; border-radius: 5px; background: #F4F1E8; display: flex; align-items: center; justify-content: center; }
.light-switch__toggle { width: 10px; height: 16px; border-radius: 3px; background: #C9CEDB; box-shadow: inset 0 -3px 0 #9AA3B8; transform: translateY(5px); transition: transform .15s; }
.light-switch:hover .light-switch__toggle, .light-switch:focus-visible .light-switch__toggle { transform: translateY(-5px); }

/* Elevate the mascot's bolt above the darkness (homepage only).
   STACKING GOTCHA: .hero, .hero__inner, .hero__art and .mascot must not create a stacking
   context at rest (no z-index, transform, filter, opacity < 1, isolation, will-change, contain). */
html.power-off .mascot__glow, html.power-off .mascot__bolt { z-index: 905; }
html.power-off .mascot__glow { opacity: 1; animation: glow-breathe 2.4s ease-in-out infinite; }
html.power-off .mascot { transform: none !important; }
@keyframes glow-breathe { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .outage { transition: none; }
  html.power-cutting .blackout { animation: none; opacity: 1; }
  html.power-off .mascot__glow { animation: none; }
}
@media (max-width: 767px) {
  .outage__title { font-size: 24px; }
  .outage__actions .btn, .light-switch { width: 100%; justify-content: center; }
}

/* ---------- Spark burst (404, thank-you) ---------- */
.spark-burst { position: absolute; width: 0; height: 0; pointer-events: none; }
.spark-burst--trip { left: 70%; top: 51.9%; }
.spark-burst i {
  position: absolute; left: -2px; top: -14px; width: 4px; height: 14px; border-radius: 2px;
  background: var(--yellow-400); opacity: 0; transform-origin: 2px 14px;
}
.spark-burst i:nth-child(even) { background: #FFF3B0; height: 10px; top: -10px; transform-origin: 2px 10px; }
.spark-burst i:nth-child(1)  { --r: 0deg; }   .spark-burst i:nth-child(2)  { --r: 36deg; }
.spark-burst i:nth-child(3)  { --r: 72deg; }  .spark-burst i:nth-child(4)  { --r: 108deg; }
.spark-burst i:nth-child(5)  { --r: 144deg; } .spark-burst i:nth-child(6)  { --r: 180deg; }
.spark-burst i:nth-child(7)  { --r: 216deg; } .spark-burst i:nth-child(8)  { --r: 252deg; }
.spark-burst i:nth-child(9)  { --r: 288deg; } .spark-burst i:nth-child(10) { --r: 324deg; }
.is-bursting .spark-burst i { animation: spark-ray .55s ease-out forwards; }
@keyframes spark-ray {
  0%   { opacity: 1; transform: rotate(var(--r)) translateY(-6px) scaleY(.3); }
  60%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--r)) translateY(-46px) scaleY(1); }
}
@media (prefers-reduced-motion: reduce) { .is-bursting .spark-burst i { animation: none; } }

/* ---------- 404: tripped breaker ---------- */
.trip__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.trip__art { display: flex; align-items: flex-end; gap: 0; justify-content: center; }
.trip__panel { position: relative; width: min(300px, 60vw); flex-shrink: 0; }
.trip__panel svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 24px rgba(10, 29, 92, .18)); }
.trip__mascot { width: min(260px, 42vw); margin-left: -30px; position: relative; }
.trip__links { margin-top: 22px; color: var(--muted); }

.bp-brand { font: 800 15px var(--font-display); letter-spacing: 2px; fill: #FFFFFF; }
.bp-label { font: 600 11px var(--font-body); fill: #0A1D5C; }
.bp-tag { font: 800 14px var(--font-display); fill: #B01217; }
.bp-led { fill: #D7191F; transition: fill .2s; }
.bp-trip { cursor: pointer; }
.bp-trip__body { fill: #FDE3E3; stroke: #D7191F; transition: fill .2s, stroke .2s; }
.bp-trip__handle { fill: #D7191F; transform-box: fill-box; transform-origin: center; transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), fill .2s; }
@media (prefers-reduced-motion: no-preference) {
  .trip__panel:not(.is-on) .bp-trip__handle { animation: rattle 4s 1.5s infinite; }
}
@keyframes rattle {
  0%, 90%, 100% { transform: translateX(0); }
  92% { transform: translateX(-3px); } 94% { transform: translateX(3px); } 96% { transform: translateX(-2px); } 98% { transform: translateX(1px); }
}
.trip__panel.is-on .bp-trip__handle { transform: translateX(-28px); fill: #0A1D5C; }
.trip__panel.is-on .bp-trip__body { fill: #FFFFFF; stroke: #0A1D5C; }
.trip__panel.is-on .bp-tag { fill: #0E2A84; }
.trip__panel.is-on .bp-led { fill: #1F9D55; }

/* Big breaker switch CTA */
.breaker-switch { display: inline-flex; align-items: center; gap: 18px; margin-top: 28px; padding: 14px 28px 14px 14px; min-height: 76px; background: var(--navy-900); color: var(--white); border-radius: 14px; text-decoration: none; box-shadow: 0 6px 0 #050F33; transition: transform .1s, box-shadow .1s; }
.breaker-switch:hover { color: var(--white); }
.breaker-switch:active { transform: translateY(4px); box-shadow: 0 2px 0 #050F33; }
.breaker-switch__track { position: relative; width: 84px; height: 48px; border-radius: 10px; background: #FDE3E3; border: 3px solid var(--red-600); transition: background .2s, border-color .2s; }
.breaker-switch__handle { position: absolute; top: 5px; left: 22px; width: 34px; height: 32px; border-radius: 6px; background: var(--red-600); transition: left .18s cubic-bezier(.3, 1.6, .5, 1), background .2s; }
.breaker-switch:hover .breaker-switch__handle { left: 16px; }
.breaker-switch.is-on .breaker-switch__track { background: #E3F4EA; border-color: #1F9D55; }
.breaker-switch.is-on .breaker-switch__handle { left: 5px; background: #1F9D55; }
.breaker-switch__label { font: 800 26px var(--font-display); text-transform: uppercase; letter-spacing: .04em; }

@media (max-width: 1023px) {
  .trip__grid { grid-template-columns: 1fr; gap: 32px; }
  .trip__copy { text-align: center; }
}
@media (max-width: 767px) {
  .breaker-switch { width: 100%; justify-content: center; }
}

/* ---------- Hero mascot layers ---------- */
.mascot { position: relative; width: 460px; margin-bottom: -40px; transform-origin: 50% 100%; transition: transform .32s cubic-bezier(.3, 1.45, .5, 1); }
.mascot img { display: block; width: 100%; height: auto; }
.mascot__layer { position: absolute; inset: 0; pointer-events: none; }
.mascot__layer img { width: 100%; height: 100%; }
.mascot__glow { opacity: .65; }
.mascot__base { position: relative; display: block; }
.mascot__spark { position: absolute; left: var(--tip-x, 49%); top: var(--tip-y, 2%); width: 64px; height: 64px; transform: translate(-50%, -50%); opacity: 0; pointer-events: none; }

/* Bolt tip positions (measured from the bolt layers: full ~49%/1%, bust ~54%/1%) */
.mascot { --tip-x: 49%; --tip-y: 2%; }
@media (max-width: 1023px) { .mascot { width: 360px; margin-bottom: 0; } }
@media (max-width: 767px)  { .mascot { width: 320px; --tip-x: 55%; --tip-y: 2%; } }

@media (prefers-reduced-motion: no-preference) {
  .mascot__glow  { animation: glow-idle 7s ease-in-out infinite; }
  .mascot__bolt  { animation: bolt-flicker 7s linear infinite; }
  .mascot__spark { animation: tip-spark 7s linear infinite; }
  .hero.is-paused .mascot__glow, .hero.is-paused .mascot__bolt, .hero.is-paused .mascot__spark { animation-play-state: paused; }

  @media (hover: hover) {
    .hero:has(.js-lean:hover) .mascot,
    .hero:has(.js-lean:focus-visible) .mascot { transform: rotate(-3deg) translate(-14px, 4px); }
  }
}
@keyframes glow-idle {
  0%, 100% { opacity: .55; } 40% { opacity: .8; }
  86% { opacity: .6; } 87% { opacity: 1; } 88% { opacity: .3; } 89.5% { opacity: 1; } 92% { opacity: .6; }
}
@keyframes bolt-flicker {
  0%, 86%, 92%, 100% { filter: none; }
  87% { filter: brightness(1.55) saturate(1.2); }
  88% { filter: brightness(.9); }
  89.5% { filter: brightness(1.75) saturate(1.25); }
}
@keyframes tip-spark {
  0%, 86.5% { opacity: 0; transform: translate(-50%, -50%) scale(.5) rotate(0deg); }
  87.5% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(8deg); }
  90.5% { opacity: 0; transform: translate(-50%, -50%) scale(1.25) rotate(14deg); }
  100% { opacity: 0; }
}

/* ---------- Thank-you ---------- */
.thanks__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 56px; align-items: center; }
.thanks__art { display: flex; justify-content: center; }
.thanks__mascot { position: relative; border: 0; padding: 0; background: none; cursor: pointer; width: min(420px, 80vw); border-radius: 20px; }
.thanks__mascot img { width: 100%; height: auto; display: block; }
.thanks__script { color: var(--red-600); margin-bottom: 8px; }
.thanks__urgent { margin: 24px 0; padding: 20px 24px; }
.spark-burst--thumb { left: 86%; top: 80%; }
.spark-burst--thumb i { top: -18px; height: 18px; transform-origin: 2px 18px; }
@media (prefers-reduced-motion: no-preference) {
  .thanks__mascot.is-popping img { animation: thumb-pop .6s cubic-bezier(.3, 1.5, .5, 1) both; }
  .thanks__mascot.is-bursting .spark-burst i { animation-delay: .38s; }
}
@keyframes thumb-pop {
  0%   { opacity: 0; transform: scale(.6) rotate(-8deg); }
  60%  { opacity: 1; transform: scale(1.06) rotate(3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@media (max-width: 1023px) { .thanks__grid { grid-template-columns: 1fr; text-align: center; } .thanks__grid .hero__actions { justify-content: center; } }

/* ---------- "Should I call right now?" helper ---------- */

.helper { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
.helper__guide { position: sticky; top: 130px; text-align: center; }
.helper__guide img { width: 220px; margin: 0 auto; }
.helper__bubble { position: relative; margin-top: 12px; background: var(--white); border: 2px solid var(--navy-700); border-radius: 16px; padding: 14px 16px; font-weight: 600; color: var(--navy-900); font-size: 16px; }
.helper__bubble::before { content: ""; position: absolute; top: -12px; left: 50%; margin-left: -10px; border: 10px solid transparent; border-top: 0; border-bottom-color: var(--navy-700); }
.helper__bubble.is-talking { animation: bubble-pop .3s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes bubble-pop { 0% { transform: scale(.92); } 100% { transform: scale(1); } }

.helper__main { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 36px); }
.helper__step { border: 0; margin: 0; padding: 0; min-width: 0; }
.helper__q { font: 800 30px var(--font-display); text-transform: uppercase; color: var(--navy-900); margin-bottom: 18px; padding: 0; }
.helper__q:focus { outline: none; }
.helper__options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.helper__options--answers { grid-template-columns: 1fr; max-width: 560px; }
.helper__option { position: relative; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 12px; background: #FBFBF9; cursor: pointer; font-weight: 600; color: var(--navy-900); transition: border-color .15s, background .15s; }
.helper__option:hover { border-color: var(--navy-700); }
.helper__option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.helper__option:has(input:checked) { border-color: var(--red-600); background: #FFF6F6; }
.helper__option:has(input:focus-visible) { outline: 3px solid var(--yellow-400); outline-offset: 2px; }
.helper__option-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--navy-700); color: var(--yellow-400); display: flex; align-items: center; justify-content: center; }
.helper__next { margin-top: 18px; }
.helper__restart { display: inline-block; margin-top: 18px; background: none; border: 0; padding: 8px 0; min-height: 44px; font: 700 16px var(--font-body); color: var(--navy-700); text-decoration: underline; cursor: pointer; }

.helper-result { border-radius: var(--radius); padding: 24px 26px; }
@media (prefers-reduced-motion: no-preference) { .helper-result { animation: result-in .35s cubic-bezier(.2, 1.2, .4, 1); } }
@keyframes result-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.helper-result__badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font: 800 15px var(--font-display); text-transform: uppercase; letter-spacing: .06em; }
.helper-result__title { font-size: clamp(28px, 3vw, 38px); margin: 12px 0 14px; }
.helper-result__title:focus { outline: none; }
.helper-result__steps { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 8px; font-size: 17px; }
.helper-result__note { font-weight: 700; margin-bottom: 16px; }
.helper-result__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.helper-result__disclaimer { font-size: 14px; }

.helper-result--danger { background: var(--red-600); color: var(--white); }
.helper-result--danger .helper-result__title { color: var(--white); }
.helper-result--danger .helper-result__badge { background: var(--yellow-400); color: var(--navy-900); }
.helper-result--danger .btn--red { background: var(--white); color: var(--red-700); }
.helper-result--danger .btn--red:hover { background: var(--yellow-400); color: var(--navy-900); }
.helper-result--danger .btn--outline, .helper-result--danger .btn--navy { background: transparent; border-color: var(--white); color: var(--white); }
.helper-result--danger .btn--outline:hover, .helper-result--danger .btn--navy:hover { background: var(--white); color: var(--red-700); }
.helper-result--danger .helper-result__disclaimer { color: var(--white); }

.helper-result--urgent { background: var(--white); border: 4px solid var(--red-600); }
.helper-result--urgent .helper-result__badge { background: var(--red-600); color: var(--white); }

.helper-result--check { background: var(--white); border: 3px solid var(--navy-700); }
.helper-result--check .helper-result__badge { background: var(--yellow-400); color: var(--navy-900); }

.helper-result--soon { background: var(--navy-900); color: var(--white); }
.helper-result--soon .helper-result__title { color: var(--white); }
.helper-result--soon .helper-result__badge { background: var(--white); color: var(--navy-900); }
.helper-result--soon .btn--outline { border-color: var(--white); color: var(--white); }
.helper-result--soon .btn--outline:hover { background: var(--white); color: var(--navy-900); }
.helper-result--soon .helper-result__disclaimer { color: var(--on-navy); }

.helper-result--plan { background: var(--yellow-400); color: var(--navy-900); }
.helper-result--plan .helper-result__badge { background: var(--navy-900); color: var(--yellow-400); }
.helper-result--plan .btn--outline:hover { background: var(--navy-900); color: var(--white); }

.helper-result--urgent .helper-result__disclaimer, .helper-result--check .helper-result__disclaimer { color: var(--muted); }
.helper-result--plan .helper-result__disclaimer { color: #3A3000; }

/* Standalone page: warning signs list */
.signs { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 0; }
.signs li { display: flex; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.signs__icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--navy-700); color: var(--yellow-400); display: flex; align-items: center; justify-content: center; }
.signs strong { display: block; color: var(--navy-900); }
.signs span { color: var(--muted); font-size: 16px; }
.signs__disclaimer { margin-top: 20px; font-size: 14px; color: var(--muted); }

@media (max-width: 1023px) {
  .helper { grid-template-columns: 1fr; gap: 16px; }
  .helper__guide { position: static; display: flex; align-items: center; gap: 12px; text-align: left; }
  .helper__guide img { width: 96px; margin: 0; }
  .helper__bubble { margin-top: 0; flex: 1; }
  .helper__bubble::before { top: 50%; left: -12px; margin: -10px 0 0; border: 10px solid transparent; border-left: 0; border-right-color: var(--navy-700); }
}
@media (max-width: 767px) { .helper__options { grid-template-columns: 1fr; } .helper__q { font-size: 26px; } }
