:root {
  --bg: #090c0f;
  --panel: #10151a;
  --panel-2: #161d23;
  --panel-3: #1d252c;
  --line: rgba(255,255,255,.09);
  --text: #f2f5f7;
  --muted: #93a0aa;
  --yellow: #ffd21f;
  --yellow-soft: #ffe569;
  --cyan: #53e7ff;
  --red: #ff5b57;
  --green: #67ff9b;
  --shadow: 0 35px 90px rgba(0,0,0,.48);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 20%, rgba(255,210,31,.09), transparent 30%),
    radial-gradient(circle at 15% 85%, rgba(83,231,255,.06), transparent 26%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.78), transparent 90%);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
}

.topline {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--yellow), var(--cyan), transparent);
  box-shadow: 0 0 22px rgba(255,210,31,.65);
  z-index: 30;
}

.site-shell {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 26px;
  position: relative;
  z-index: 2;
}

.site-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: var(--yellow);
  background: #151a1f;
  border: 1px solid rgba(255,210,31,.35);
  clip-path: polygon(17% 0,100% 0,100% 82%,82% 100%,0 100%,0 17%);
  box-shadow: inset 0 0 24px rgba(255,210,31,.08), 0 0 25px rgba(255,210,31,.08);
}
.brand-mark svg { width: 25px; height: 25px; }
.brand-copy { display: flex; align-items: baseline; gap: 4px; letter-spacing: .09em; }
.brand-copy strong { font-size: 1.03rem; }
.brand-copy small { color: var(--yellow); font-weight: 800; }

.header-tools {
  display: flex;
  align-items: center;
  gap: 18px;
}

.sound-toggle {
  min-height: 38px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 3px;
  font: inherit;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.sound-toggle:hover {
  color: var(--text);
  border-color: rgba(255,210,31,.35);
  background: rgba(255,210,31,.045);
}
.sound-toggle:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
.sound-icon {
  width: 19px;
  height: 19px;
  fill: currentColor;
  flex: 0 0 auto;
}
.sound-wave {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.sound-toggle[aria-pressed="false"] {
  color: #6e777e;
}
.sound-toggle[aria-pressed="false"] .sound-wave {
  opacity: 0;
}
.sound-toggle[aria-pressed="false"] .sound-icon {
  opacity: .68;
}

.header-status {
  --status-color: #65717a;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  white-space: nowrap;
}
.header-status[data-state="starting"],
.header-status[data-state="stopping"] {
  --status-color: var(--yellow);
  color: #c9b85f;
}
.header-status[data-state="on"] {
  --status-color: var(--green);
  color: #a7d9b7;
}
.pulse-dot {
  width: 9px;
  height: 9px;
  position: relative;
  border-radius: 50%;
  background: var(--status-color);
  box-shadow: 0 0 10px color-mix(in srgb, var(--status-color) 68%, transparent);
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid var(--status-color);
  border-radius: 50%;
  opacity: 0;
}
.header-status[data-state="starting"] .pulse-dot::after,
.header-status[data-state="stopping"] .pulse-dot::after,
.header-status[data-state="on"] .pulse-dot::after {
  animation: pulseRing 1.8s infinite;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(560px, 1.06fr);
  gap: clamp(52px, 7vw, 118px);
  align-items: center;
  min-height: calc(100vh - 206px);
  padding: 70px 0 62px;
}

.hero-copy { max-width: 720px; }
.eyebrow {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .18em;
}
.eyebrow span { color: var(--yellow); }

h1 {
  margin: 0;
  font-size: clamp(3.9rem, 7.3vw, 8.5rem);
  line-height: .86;
  letter-spacing: -.068em;
  text-transform: uppercase;
  font-weight: 950;
}
h1 span {
  color: transparent;
  -webkit-text-stroke: 2px var(--yellow);
  text-shadow: 0 0 40px rgba(255,210,31,.12);
}

.lead {
  max-width: 690px;
  margin: 32px 0 0;
  color: #b5c0c7;
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.switch-button,
.domain-link {
  min-height: 72px;
  border: 1px solid rgba(255,255,255,.11);
  background: linear-gradient(180deg, #1a2229, #11171c);
  color: var(--text);
  box-shadow: inset 0 1px rgba(255,255,255,.05), 0 16px 34px rgba(0,0,0,.24);
}

.switch-button {
  min-width: 275px;
  padding: 10px 18px 10px 12px;
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  text-align: left;
  clip-path: polygon(0 0,100% 0,100% 78%,94% 100%,0 100%);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.switch-button:hover { transform: translateY(-2px); border-color: rgba(255,210,31,.38); }
.switch-button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.switch-button:disabled {
  cursor: progress;
  opacity: .88;
}
.switch-button:disabled:hover {
  transform: none;
}
.switch-button.is-busy {
  border-color: rgba(255,210,31,.42);
}
.switch-button.is-busy .switch-icon {
  box-shadow: inset 0 0 14px rgba(0,0,0,.8), 0 0 18px rgba(255,210,31,.12);
}
.switch-icon {
  width: 54px;
  height: 50px;
  border-radius: 7px;
  position: relative;
  background: #07090b;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 0 14px rgba(0,0,0,.8);
}
.switch-icon::before {
  content: "";
  position: absolute;
  width: 26px;
  height: 31px;
  top: 9px;
  left: 13px;
  border-radius: 4px;
  background: linear-gradient(180deg, #4f5962, #252c32);
  box-shadow: 0 4px 8px rgba(0,0,0,.55);
  transition: transform .28s cubic-bezier(.2,.8,.2,1), background .28s ease;
}
.switch-label { display: grid; gap: 2px; }
.switch-label strong { font-size: .93rem; letter-spacing: .04em; }
.switch-label small { color: var(--muted); }
.switch-button.is-on { border-color: rgba(255,210,31,.55); box-shadow: inset 0 1px rgba(255,255,255,.06), 0 0 35px rgba(255,210,31,.10); }
.switch-button.is-on .switch-icon::before { transform: translateY(-6px); background: linear-gradient(180deg, var(--yellow-soft), #d7a900); }

.domain-link {
  min-width: 235px;
  padding: 14px 18px;
  display: grid;
  align-content: center;
  gap: 4px;
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid var(--yellow);
  transition: background .2s ease, transform .2s ease;
}
.domain-link:hover { background: #1b242b; transform: translateY(-2px); }
.domain-link span { color: var(--muted); font-size: .73rem; text-transform: uppercase; letter-spacing: .12em; }
.domain-link strong { font-size: 1.02rem; }
.alias-note { color: #7f8d97; font-size: .87rem; margin: 14px 0 0 3px; }
.alias-note span { color: var(--yellow); }
.switch-help {
  margin: 8px 0 0 3px;
  color: #59656d;
  font-size: .72rem;
  letter-spacing: .035em;
}

.panel-wrap { position: relative; }
.panel-glow {
  position: absolute;
  inset: 8% 6%;
  background: radial-gradient(circle, rgba(255,210,31,.18), transparent 62%);
  filter: blur(40px);
  opacity: .6;
  pointer-events: none;
}
.control-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background:
    linear-gradient(145deg, rgba(255,255,255,.035), transparent 24%),
    linear-gradient(180deg, #151c22 0%, #0e1317 100%);
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.06);
  clip-path: polygon(0 0, 96% 0, 100% 5%, 100% 100%, 4% 100%, 0 95%);
  transform: perspective(1400px) rotateY(-5deg) rotateX(1deg);
  transition: transform .5s cubic-bezier(.2,.8,.2,1), box-shadow .5s ease;
}
.control-panel:hover { transform: perspective(1400px) rotateY(-1.5deg) rotateX(0); }
.control-panel.is-live { box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.08), 0 0 60px rgba(255,210,31,.11); }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.025);
}
.panel-head > div:first-child { display: grid; gap: 3px; }
.panel-head span { color: var(--yellow); font-size: .7rem; font-weight: 900; letter-spacing: .14em; }
.panel-head strong { font-size: .91rem; letter-spacing: .12em; }
.voltage-display {
  min-width: 116px;
  padding: 9px 13px;
  text-align: right;
  background: #050607;
  border: 1px solid rgba(255,210,31,.18);
  box-shadow: inset 0 0 18px rgba(255,210,31,.06);
}
.voltage-display span { font: 800 1.9rem/1 "Consolas", "Courier New", monospace; letter-spacing: .07em; color: #4c5a3f; text-shadow: none; transition: color .25s ease, text-shadow .25s ease; }
.voltage-display small { margin-left: 5px; color: #66716a; font-weight: 800; }
.is-live .voltage-display span { color: var(--yellow); text-shadow: 0 0 14px rgba(255,210,31,.55); }

.busbar {
  position: relative;
  height: 38px;
  margin: 19px 24px 5px;
  border: 1px solid rgba(255,255,255,.08);
  background: #090c0f;
  overflow: hidden;
}
.bus-line { position: absolute; left: 12px; right: 12px; height: 3px; opacity: .35; }
.bus-line::after { content: ""; position: absolute; width: 30%; height: 100%; left: -35%; top: 0; background: linear-gradient(90deg, transparent, #fff, transparent); opacity: 0; }
.l1 { top: 8px; background: var(--red); }
.l2 { top: 17px; background: var(--yellow); }
.l3 { top: 26px; background: var(--cyan); }
.is-live .bus-line { opacity: .95; box-shadow: 0 0 9px currentColor; }
.is-live .bus-line::after { opacity: .9; animation: currentFlow 2.2s linear infinite; }
.is-live .l2::after { animation-delay: .45s; }
.is-live .l3::after { animation-delay: .9s; }

.breaker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 14px 24px 22px;
}
.breaker {
  min-height: 214px;
  padding: 14px;
  background: linear-gradient(180deg, #212a31, #151b20);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: inset 0 1px rgba(255,255,255,.05), inset 0 -16px 30px rgba(0,0,0,.12);
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.breaker-top { display: flex; align-items: center; justify-content: space-between; }
.phase { font-size: .72rem; font-weight: 900; letter-spacing: .12em; color: #fff !important; }
.phase-l1 { border-bottom: 2px solid var(--red); }
.phase-l2 { border-bottom: 2px solid var(--yellow); }
.phase-l3 { border-bottom: 2px solid var(--cyan); }
.breaker-led { width: 9px; height: 9px; border-radius: 50%; background: #3c454a; box-shadow: inset 0 0 3px #000; }
.breaker-toggle {
  width: 70px;
  height: 89px;
  margin: 20px auto 18px;
  padding: 8px;
  background: #090b0d;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 6px;
  box-shadow: inset 0 6px 14px rgba(0,0,0,.78);
}
.breaker-toggle span {
  display: block;
  width: 100%;
  height: 50px;
  transform: translateY(20px);
  border-radius: 3px;
  background: linear-gradient(180deg, #48535c, #242a2f);
  box-shadow: 0 6px 8px rgba(0,0,0,.5);
  transition: transform .34s cubic-bezier(.2,.8,.2,1), background .3s ease;
}
.breaker-copy { display: grid; gap: 5px; }
.breaker-copy strong { font-size: .92rem; }
.breaker-copy small { color: var(--muted); font-size: .76rem; }
.is-live .breaker { border-color: rgba(255,210,31,.22); }
.is-live .breaker-toggle span { transform: translateY(0); background: linear-gradient(180deg, #f9e77f, #b49517); }
.is-live .breaker-led { background: var(--green); box-shadow: 0 0 12px rgba(103,255,155,.8); }
.is-live .breaker:nth-child(1) { transition-delay: .05s; }
.is-live .breaker:nth-child(2) { transition-delay: .15s; }
.is-live .breaker:nth-child(3) { transition-delay: .25s; }

.circuit-map {
  position: relative;
  height: 194px;
  margin: 0 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    #0b0f12;
  background-size: 24px 24px;
}
.circuit-map svg { width: 100%; height: 100%; overflow: visible; }
.trace { fill: none; stroke: #39434a; stroke-width: 4; stroke-linecap: square; stroke-linejoin: miter; }
.circuit-map circle { fill: #0b0f12; stroke: #49545c; stroke-width: 4; }
.is-live .trace-main { stroke: var(--yellow); filter: drop-shadow(0 0 5px rgba(255,210,31,.45)); stroke-dasharray: 18 9; animation: traceMove 1.2s linear infinite; }
.is-live .trace-branch { stroke: var(--cyan); filter: drop-shadow(0 0 5px rgba(83,231,255,.35)); stroke-dasharray: 9 7; animation: traceMove 1.5s linear infinite reverse; }
.is-live .circuit-map circle { fill: var(--yellow); stroke: #fff4b8; filter: drop-shadow(0 0 6px rgba(255,210,31,.85)); }
.map-label { position: absolute; bottom: 9px; color: #69757e; font-size: .6rem; letter-spacing: .14em; font-weight: 800; }
.label-feed { left: 10px; }
.label-output { right: 10px; }

.panel-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 26px;
  align-items: center;
  padding: 20px 24px 24px;
}
.meter-row {
  display: grid;
  grid-template-columns: auto 1fr 42px;
  align-items: center;
  gap: 12px;
  font-size: .73rem;
  color: var(--muted);
}
.meter { height: 8px; background: #07090a; border: 1px solid rgba(255,255,255,.08); overflow: hidden; }
.meter span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--yellow)); box-shadow: 0 0 15px rgba(255,210,31,.45); transition: width .4s ease; }
.meter-row strong { color: var(--text); text-align: right; }
.stamp {
  min-width: 116px;
  padding: 8px 10px;
  color: rgba(255,210,31,.65);
  border: 2px solid rgba(255,210,31,.24);
  text-align: center;
  font-size: .78rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: .12em;
  transform: rotate(-3deg);
}
.stamp span { color: rgba(255,210,31,.44); font-size: .45rem; letter-spacing: .05em; }

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.status-strip article {
  min-height: 102px;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-right: 1px solid var(--line);
}
.status-strip article:last-child { border-right: 0; }
.status-strip article > span { color: var(--yellow); font: 800 1.45rem/1 "Consolas", monospace; }
.status-strip div { display: grid; gap: 5px; }
.status-strip small { color: #66737c; font-size: .62rem; letter-spacing: .15em; font-weight: 900; }
.status-strip strong { font-size: .86rem; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 0;
  color: #64717a;
  font-size: .77rem;
}
.site-footer p { margin: 0; }

.power-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: white;
  opacity: 0;
}
.power-flash.flash { animation: flash .36s ease-out; }

@keyframes pulseRing {
  0% { transform: scale(.55); opacity: .55; }
  72% { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}
@keyframes currentFlow { to { left: 110%; } }
@keyframes traceMove { to { stroke-dashoffset: -54; } }
@keyframes flash { 0% { opacity: 0; } 18% { opacity: .42; } 100% { opacity: 0; } }

@media (max-width: 1180px) {
  .hero-grid { grid-template-columns: 1fr; min-height: auto; padding-top: 56px; }
  .hero-copy { max-width: 880px; }
  .panel-wrap { max-width: 860px; }
  h1 { font-size: clamp(4.2rem, 11vw, 8rem); }
}

@media (max-width: 760px) {
  .site-shell { width: min(100% - 28px, 680px); padding-top: 18px; }
  .site-header { min-height: 64px; }
  .header-tools { gap: 9px; }
  .sound-toggle { min-width: 38px; padding: 7px 9px; }
  .sound-toggle span { display: none; }
  .header-status span:last-child { display: none; }
  .hero-grid { gap: 38px; padding: 44px 0 42px; }
  h1 { font-size: clamp(3.1rem, 15.8vw, 6rem); line-height: .91; }
  h1 span { -webkit-text-stroke-width: 1.4px; }
  .lead { margin-top: 24px; line-height: 1.6; }
  .hero-actions { align-items: stretch; }
  .switch-button, .domain-link { width: 100%; min-width: 0; }
  .control-panel { transform: none; clip-path: polygon(0 0,96% 0,100% 4%,100% 100%,4% 100%,0 96%); }
  .control-panel:hover { transform: none; }
  .panel-head, .breaker-grid, .panel-footer { padding-left: 16px; padding-right: 16px; }
  .busbar, .circuit-map { margin-left: 16px; margin-right: 16px; }
  .breaker-grid { gap: 8px; }
  .breaker { min-height: 180px; padding: 10px; }
  .breaker-toggle { width: 54px; height: 75px; margin: 18px auto 15px; }
  .breaker-toggle span { height: 42px; transform: translateY(18px); }
  .breaker-copy small { display: none; }
  .circuit-map { height: 150px; }
  .panel-footer { grid-template-columns: 1fr; }
  .stamp { justify-self: end; }
  .meter-row { grid-template-columns: 1fr 42px; }
  .meter-row > span:first-child { grid-column: 1 / -1; }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .status-strip article:nth-child(2) { border-right: 0; }
  .status-strip article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .site-footer { flex-direction: column; gap: 6px; }
}

@media (max-width: 440px) {
  .brand-copy strong { font-size: .9rem; }
  .header-tools { gap: 7px; }
  .eyebrow { font-size: .66rem; }
  .panel-head { align-items: flex-start; }
  .voltage-display { min-width: 98px; }
  .voltage-display span { font-size: 1.55rem; }
  .breaker { min-height: 164px; }
  .breaker-copy strong { font-size: .78rem; }
  .status-strip article { min-height: 88px; padding: 17px 14px; gap: 11px; }
  .status-strip article > span { font-size: 1.1rem; }
  .status-strip strong { font-size: .73rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
