/* ===================== TOKENS ===================== */
:root {
  --bg: #07090f;
  --bg-2: #0d111b;
  --surface: rgba(255,255,255,.04);
  --surface-2: rgba(255,255,255,.07);
  --line: rgba(255,255,255,.09);
  --text: #eef2ff;
  --muted: #8b93a7;
  --volt: #4da3ff;
  --volt-ink: #03101f;
  --cyan: #3de8ff;
  --violet: #8b7bff;
  --danger: #ff6b4a;
  --radius: 22px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --shadow: 0 30px 80px -30px rgba(0,0,0,.7);
  --font: "Inter", system-ui, sans-serif;
  --display: "Space Grotesk", "Inter", sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f7f2;
  --bg-2: #eceee6;
  --surface: rgba(10,15,30,.035);
  --surface-2: rgba(10,15,30,.06);
  --line: rgba(10,15,30,.1);
  --text: #0c1020;
  --muted: #5a6175;
  --volt: #1a62d6;
  --volt-ink: #ffffff;
  --cyan: #0089a8;
  --violet: #5b47e0;
  --shadow: 0 30px 70px -35px rgba(20,30,60,.35);
  color-scheme: light;
}

/* ===================== BASE ===================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before { /* noise + grid */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  opacity: .5;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 .5em; }
h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); font-weight: 600; text-wrap: balance; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--volt); color: var(--volt-ink); }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 3px; border-radius: 6px; }
.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grad {
  background: linear-gradient(100deg, var(--volt), var(--cyan) 60%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--volt); color: var(--volt-ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--radius);
}

/* progress bar (scroll-driven, fallback via JS) */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 60;
  background: linear-gradient(90deg, var(--volt), var(--cyan));
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
}
@supports (animation-timeline: scroll()) {
  .progress { animation: grow linear both; animation-timeline: scroll(root); }
  @keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

.cursor-glow {
  position: fixed; width: 520px; height: 520px; left: 0; top: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, color-mix(in oklab, var(--volt) 14%, transparent), transparent 65%);
  transform: translate(calc(var(--mx, -999px) - 50%), calc(var(--my, -999px) - 50%));
  transition: opacity .3s;
}

/* ===================== BUTTONS ===================== */
.btn {
  --tx: 0px; --ty: 0px;
  display: inline-flex; align-items: center; gap: .5em;
  padding: .7em 1.25em; border-radius: 999px; border: 1px solid transparent;
  font: 600 .95rem var(--font); cursor: pointer; white-space: nowrap;
  transform: translate(var(--tx), var(--ty));
  transition: transform .25s var(--ease), background .25s, box-shadow .25s, border-color .25s;
}
.btn-lg { padding: .95em 1.6em; font-size: 1rem; }
.btn-volt { background: var(--volt); color: var(--volt-ink); box-shadow: 0 10px 30px -10px var(--volt); }
.btn-volt:hover { box-shadow: 0 14px 40px -8px var(--volt); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.kbd-btn { width: auto; padding: 0 12px; font: 600 .78rem var(--font); color: var(--muted); }
:root[data-theme="dark"] .i-moon, :root[data-theme="light"] .i-sun { display: none; }

/* ===================== NAV ===================== */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50;
  width: min(1200px, 100% - 24px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 10px 10px 18px; border-radius: 20px;
  border: 1px solid transparent; transition: background .3s, border-color .3s, box-shadow .3s;
}
.nav.scrolled {
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-color: var(--line); box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; font: 700 1.2rem var(--display); }
.brand small { display: block; font: 500 .68rem var(--font); color: var(--muted); letter-spacing: .14em; text-transform: uppercase; margin-top: -3px; }
.brand-mark { width: 34px; height: 34px; }
.links { display: flex; gap: 4px; }
.links a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-size: .92rem; font-weight: 500; transition: color .2s, background .2s; }
.links a:hover, .links a.active { color: var(--text); background: var(--surface-2); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.burger { display: none; flex-direction: column; gap: 5px; }
.burger span { width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ===================== HERO ===================== */
.hero {
  position: relative; min-height: 100svh; display: grid; align-items: center;
  grid-template-columns: 1fr auto; gap: 40px;
  padding: 140px max(16px, calc((100% - 1200px)/2)) 80px; overflow: hidden;
}
#circuit { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 30%; z-index: -1;
  background: linear-gradient(transparent, var(--bg));
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: .85rem; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--volt); box-shadow: 0 0 0 0 var(--volt); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px transparent; } }
.hero h1 { font-size: clamp(2.8rem, 8vw, 6.4rem); font-weight: 700; margin: 24px 0; max-width: 11ch; }
.hero h1 em { font-style: normal; display: block; }
.hero h1 em .w { background: linear-gradient(100deg, var(--volt), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.split .w { display: inline-block; opacity: 0; transform: translateY(.6em) rotate(4deg); filter: blur(8px);
  animation: wordIn .9s var(--ease) forwards; animation-delay: calc(var(--i) * 80ms + 150ms); }
@keyframes wordIn { to { opacity: 1; transform: none; filter: none; } }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 52ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 28px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.hero-tags li { font-size: .8rem; color: var(--muted); padding: 4px 12px; border-left: 2px solid var(--volt); }
.hero-card { width: 300px; padding: 20px; box-shadow: var(--shadow); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-12px); } }
.hc-head { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2bff88; box-shadow: 0 0 12px #2bff88; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.hc-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.hc-row span { color: var(--muted); }
.hc-row b { font-family: var(--display); font-weight: 600; }
.wave { width: 100%; height: 60px; margin-top: 12px; }
.wave path { fill: none; stroke-width: 2; }
.wave .ph1 { stroke: var(--volt); filter: drop-shadow(0 0 5px var(--volt)); }
.wave .ph2 { stroke: var(--cyan); opacity: .85; }
.wave .ph3 { stroke: var(--violet); opacity: .85; }
.phases { display: flex; gap: 14px; font: 600 .75rem var(--font); margin-top: 6px; }
.phases span::before { content: ""; display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: currentColor; }
.phases .l1 { color: var(--volt); } .phases .l2 { color: var(--cyan); } .phases .l3 { color: var(--violet); }
.scroll-hint { position: absolute; bottom: 28px; left: 50%; width: 24px; height: 38px; border: 2px solid var(--line); border-radius: 14px; transform: translateX(-50%); }
.scroll-hint span { position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; background: var(--volt); border-radius: 2px; animation: scrollDot 1.8s infinite; }
@keyframes scrollDot { 80% { transform: translateY(14px); opacity: 0; } }

/* ===================== MARQUEE ===================== */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 18px 0; background: var(--bg-2);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.track { display: flex; gap: 28px; width: max-content; animation: marquee 38s linear infinite; font: 600 clamp(1.2rem, 2.5vw, 1.9rem) var(--display); }
.track i { color: var(--volt); font-style: normal; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===================== SECTIONS ===================== */
.section { padding: clamp(80px, 12vw, 150px) 0; position: relative; }
.kicker { font: 600 .8rem var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--volt); margin-bottom: 16px; }
.section-head { margin-bottom: 48px; max-width: 760px; }

.reveal { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* ABOUT */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 60px; align-items: start; }
.about-text { font-size: 1.08rem; color: var(--muted); }
.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px; }
.stat { padding: 28px 24px; }
.stat b { display: block; font: 700 clamp(2.2rem, 4vw, 3.4rem) var(--display); line-height: 1; margin-bottom: 8px; }
.stat span { color: var(--muted); font-size: .9rem; }

/* SERVICES / BENTO */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chip { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 500 .9rem var(--font); cursor: pointer; transition: all .25s; }
.chip.active, .chip:hover { color: var(--volt-ink); background: var(--volt); border-color: var(--volt); }
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(190px, auto); gap: 16px; }
.card {
  --x: 50%; --y: 50%;
  position: relative; overflow: hidden; padding: 26px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .4s var(--ease), opacity .4s, border-color .3s, filter .4s;
}
.card::before { /* spotlight */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(400px circle at var(--x) var(--y), color-mix(in oklab, var(--volt) 16%, transparent), transparent 45%);
}
.card::after { /* border glow */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(300px circle at var(--x) var(--y), var(--volt), transparent 50%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.card:hover::before, .card:hover::after { opacity: 1; }
.card:hover { transform: translateY(-4px); }
.card.dim { opacity: .18; filter: grayscale(1); transform: scale(.97); }
.card-ico { font-size: 1.7rem; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 18px; }
.card p { color: var(--muted); font-size: .94rem; margin: 0; }
.span-2 { grid-column: span 2; }
.tall { grid-row: span 2; }
.card-art { position: absolute; right: 0; bottom: 0; width: 100%; height: 45%; opacity: .7; }
.card-art .draw { fill: none; stroke: var(--volt); stroke-width: 2; stroke-dasharray: 600; stroke-dashoffset: 600; filter: drop-shadow(0 0 4px var(--volt)); }
.card.in .draw, .card:hover .draw { animation: draw 2.4s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.sun-meter { display: flex; align-items: flex-end; gap: 8px; height: 70px; margin-top: 20px; }
.sun-meter span { flex: 1; height: var(--h); border-radius: 6px 6px 2px 2px; background: linear-gradient(to top, color-mix(in oklab, var(--volt) 30%, transparent), var(--volt)); transform-origin: bottom; animation: bar 2.4s var(--ease) infinite alternate; }
.sun-meter span:nth-child(2n) { animation-delay: .3s; }
@keyframes bar { from { transform: scaleY(.6); } }

/* BIM 3D */
.bim-section { background: linear-gradient(180deg, transparent, var(--bg-2) 30%, var(--bg-2) 70%, transparent); }
.bim { display: grid; grid-template-columns: 1fr 1.1fr; gap: 60px; align-items: center; }
.checks { list-style: none; padding: 0; margin: 24px 0; }
.checks li { padding: 8px 0 8px 32px; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 8px; width: 22px; height: 22px; display: grid; place-items: center; font-size: .75rem; border-radius: 50%; background: var(--volt); color: var(--volt-ink); }
.layer-toggles { display: flex; flex-wrap: wrap; gap: 18px; }
.layer-toggles label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .92rem; }
.layer-toggles input { position: absolute; opacity: 0; }
.sw { width: 38px; height: 22px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); position: relative; transition: background .25s; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .25s var(--ease), background .25s; }
.layer-toggles input:checked + .sw { background: color-mix(in oklab, var(--volt) 25%, transparent); }
.layer-toggles input:checked + .sw::after { transform: translateX(16px); background: var(--volt); }
.layer-toggles input:focus-visible + .sw { outline: 2px solid var(--volt); outline-offset: 2px; }

.viewer { padding: 12px; position: relative; user-select: none; -webkit-user-select: none; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.seg-mini { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.seg-mini button { border: 0; background: transparent; color: var(--muted); font: 500 .82rem var(--font); padding: 6px 11px; border-radius: 8px; cursor: pointer; transition: all .2s; }
.seg-mini button.on { background: var(--volt); color: var(--volt-ink); }
#bim3d { display: block; width: 100%; height: 440px; cursor: grab; touch-action: pan-y; border-radius: 14px;
  background: radial-gradient(ellipse at 50% 60%, color-mix(in oklab, var(--cyan) 8%, transparent), transparent 70%); }
#bim3d:active { cursor: grabbing; }
.viewer-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 8px 6px 2px; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.lg-power { background: var(--volt); box-shadow: 0 0 6px var(--volt); }
.lg-low { background: var(--violet); box-shadow: 0 0 6px var(--violet); }
.lg-fire { background: #ff6b4a; }
.stage-hint { margin-left: auto; }

/* DESIGN ANIMATION (scroll-driven blueprint) */
.design { position: relative; height: 520vh; }
.design-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; padding-top: 70px; overflow: hidden; }
.design-grid { display: grid; grid-template-columns: 330px 1fr; gap: 32px; align-items: center; }
.design-side h2 { font-size: clamp(1.8rem, 3.2vw, 2.7rem); }
.dsteps { list-style: none; padding: 0; margin: 18px 0 22px; counter-reset: s; }
.dsteps li { position: relative; padding: 8px 0 8px 46px; color: var(--muted); transition: color .3s; }
.dsteps li::before {
  content: attr(data-n);
  position: absolute; left: 0; top: 7px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font: 600 .75rem var(--display); border: 1px solid var(--line); background: var(--surface); transition: all .3s;
}
.dsteps li::after { content: ""; position: absolute; left: 14px; top: 41px; bottom: -6px; width: 2px; background: var(--line); transition: background .3s; }
.dsteps li:last-child::after { display: none; }
.dsteps b { display: block; font: 600 1rem var(--display); }
.dsteps li span { display: block; font-size: .86rem; color: var(--muted); max-height: 0; opacity: 0; overflow: hidden; transition: max-height .45s var(--ease), opacity .45s, margin .45s; }
.dsteps li.active { color: var(--text); }
.dsteps li.active span { max-height: 80px; opacity: 1; margin-top: 4px; }
.dsteps li.active::before { background: var(--volt); color: var(--volt-ink); border-color: var(--volt); box-shadow: 0 0 22px -4px var(--volt); }
.dsteps li.done::before { content: "✓"; color: var(--volt); border-color: color-mix(in oklab, var(--volt) 60%, transparent); }
.dsteps li.done::after { background: var(--volt); }
.design-ctrl { display: flex; align-items: center; gap: 14px; }
.dhint { font-size: .85rem; color: var(--muted); }
.blueprint { padding: 10px; }
.bp-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 500 .76rem ui-monospace, Consolas, monospace; color: var(--muted); padding: 4px 8px 10px; }
.bp-dots i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; background: var(--surface-2); border: 1px solid var(--line); }
#dPct { color: var(--volt); min-width: 4ch; text-align: right; }
#bp { display: block; width: 100%; height: auto; max-height: calc(100svh - 170px); border-radius: 14px; background: color-mix(in oklab, var(--cyan) 4%, var(--bg)); }
#bp .bp-gridline { fill: none; stroke: color-mix(in oklab, var(--cyan) 9%, transparent); stroke-width: .6; }
#bp .bp-gridline.major { stroke: color-mix(in oklab, var(--cyan) 16%, transparent); stroke-width: 1.2; }
#bp .fade, #bp .pop { opacity: var(--t, 0); }
#bp .pop { transform-box: fill-box; transform-origin: center; scale: calc(.4 + .6 * var(--t, 0)); }
#bp .road { fill: var(--surface-2); }
#bp .roadline { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 14 12; }
#bp .plot { fill: none; stroke: var(--muted); stroke-width: 1.4; }
#bp .bld { fill: none; stroke: var(--text); stroke-width: 2.4; stroke-linejoin: round; }
#bp .bfill { fill: var(--surface); transition: fill 1s; }
#bp.live .bfill { fill: color-mix(in oklab, var(--volt) 9%, transparent); }
#bp .win { fill: var(--line); transition: fill .4s; transition-delay: var(--wd, 0s); }
#bp.live .win { fill: #ffd76a; }
#bp .pvrow { fill: none; stroke: color-mix(in oklab, var(--cyan) 55%, transparent); stroke-width: 9; }
#bp .blabel { fill: var(--text); font: 600 17px var(--display); text-anchor: middle; }
#bp .bsub { fill: var(--muted); font: 500 13px var(--font); text-anchor: middle; }
#bp .src { fill: var(--bg-2); stroke: #ff5d7a; stroke-width: 2.5; }
#bp .src-line { fill: none; stroke: #ff5d7a; stroke-width: 2; }
#bp .cable { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
#bp .cable.mv { stroke: #ff5d7a; }
#bp .cable.lv { stroke: var(--volt); }
#bp .cable.pv { stroke: #ffc53d; }
#bp .clabel { fill: var(--text); font: 600 13px var(--font); text-anchor: middle; }
#bp .clabel.mvl { fill: #ff5d7a; }
#bp .trafo { fill: var(--bg-2); stroke: var(--text); stroke-width: 2.4; }
#bp .tcoil { fill: none; stroke: var(--cyan); stroke-width: 2.2; }
#bp .ring { fill: none; stroke: var(--volt); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ringPulse 2.2s ease-out infinite; }
@keyframes ringPulse { from { scale: .6; opacity: .9; } to { scale: 1.6; opacity: 0; } }
#bp .board { fill: var(--volt); stroke: var(--bg); stroke-width: 2; }
#bp .tag circle { fill: var(--bg-2); stroke: var(--cyan); stroke-width: 1.6; }
#bp .tag text { fill: var(--cyan); font: 700 11px var(--font); text-anchor: middle; dominant-baseline: central; }
#bp .schedule text { fill: var(--muted); font: 500 12.5px ui-monospace, Consolas, monospace; }
#bp .schedule .k { fill: var(--cyan); font-weight: 700; }
#bp .badge rect { fill: color-mix(in oklab, #2bff88 16%, var(--bg-2)); stroke: #2bff88; stroke-width: 1.5; }
#bp .badge text { fill: #2bff88; font: 600 13px var(--font); text-anchor: middle; dominant-baseline: central; }
:root[data-theme="light"] #bp .badge rect { stroke: #109a50; } :root[data-theme="light"] #bp .badge text { fill: #0b7a3e; }
#bp .tblock rect, #bp .tblock path { fill: none; stroke: var(--muted); stroke-width: 1.2; }
#bp .tb1 { fill: var(--text); font: 700 13px var(--display); letter-spacing: .12em; }
#bp .tb2 { fill: var(--muted); font: 500 11px ui-monospace, Consolas, monospace; }
#bp .tb3 { fill: #ffc53d; font: 700 11px var(--font); letter-spacing: .06em; }
#bp.live .tb3 { fill: #2bff88; }
#scan { stroke: var(--cyan); stroke-width: 2; opacity: 0; filter: drop-shadow(0 0 6px var(--cyan)); }
#pen { fill: #fff; stroke: var(--volt); stroke-width: 3; filter: drop-shadow(0 0 8px var(--volt)); opacity: 0; transition: opacity .2s; }
#pen.on { opacity: 1; }
#pulses circle { fill: #fff; }
#pulses .mv { filter: drop-shadow(0 0 5px #ff5d7a); }
#pulses .lv { filter: drop-shadow(0 0 5px var(--volt)); }
#pulses .pv { filter: drop-shadow(0 0 5px #ffc53d); }

/* NETWORK SINGLE-LINE DIAGRAM */
.net { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: stretch; }
.net-diagram { padding: 18px; position: relative; }
.net-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.net-tools label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .9rem; }
.net-tools input { position: absolute; opacity: 0; }
.net-tools input:checked + .sw { background: color-mix(in oklab, var(--volt) 25%, transparent); }
.net-tools input:checked + .sw::after { transform: translateX(16px); background: var(--volt); }
.net-tools input:focus-visible + .sw { outline: 2px solid var(--volt); outline-offset: 2px; }
#sld { width: 100%; height: auto; display: block; overflow: visible; }
#sld .wire { fill: none; stroke: var(--line); stroke-width: 6; stroke-linecap: round; }
#sld .flow { fill: none; stroke: var(--volt); stroke-width: 2.5; stroke-dasharray: 6 12; stroke-linecap: round; filter: drop-shadow(0 0 4px var(--volt)); animation: flow .9s linear infinite; transition: opacity .3s; }
#sld .pv .flow { stroke: #ffc53d; filter: drop-shadow(0 0 4px #ffc53d); animation-direction: reverse; }
#sld .branch.off .flow, #sld .branch.pv.idle .flow { opacity: 0; }
#sld .branch.off .wire { stroke: color-mix(in oklab, var(--danger) 45%, transparent); }
@keyframes flow { to { stroke-dashoffset: -18; } }
#sld .bus { fill: var(--volt); filter: drop-shadow(0 0 8px var(--volt)); }
#sld .sym, #sld .box { fill: var(--bg-2); stroke: var(--cyan); stroke-width: 2; transition: stroke .2s, fill .2s; }
#sld .sym-line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#sld .dotc { fill: var(--text); }
#sld .lbl { fill: var(--text); font: 600 15px var(--display); text-anchor: middle; }
#sld .sub { fill: var(--muted); font: 500 12px var(--font); text-anchor: middle; }
#sld .m { fill: var(--text); font: 700 13px var(--display); text-anchor: middle; }
#sld .node, #sld .breaker { cursor: pointer; outline: none; }
#sld .node:hover .sym, #sld .node:hover .box, #sld .node:focus-visible .sym, #sld .node:focus-visible .box,
#sld .node.sel .sym, #sld .node.sel .box { stroke: var(--volt); fill: color-mix(in oklab, var(--volt) 12%, var(--bg-2)); }
#sld .load.dead .box { stroke: var(--danger); opacity: .55; }
#sld .breaker rect { fill: var(--bg-2); stroke: #2bff88; stroke-width: 2; transition: all .2s; }
#sld .breaker path { stroke: #2bff88; stroke-width: 2; stroke-linecap: round; opacity: 0; }
#sld .breaker:hover rect, #sld .breaker:focus-visible rect { stroke-width: 3; filter: drop-shadow(0 0 6px #2bff88); }
#sld .breaker.tripped rect { stroke: var(--danger); fill: color-mix(in oklab, var(--danger) 18%, var(--bg-2)); }
#sld .breaker.tripped path { stroke: var(--danger); opacity: 1; }
.net-info { padding: 26px; display: flex; flex-direction: column; }
.net-info h3 { font-size: 1.35rem; }
.net-info .kicker { margin-bottom: 10px; }
.net-info.flash { animation: stepIn .45s var(--ease); }
.info-tags { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.info-tags li { font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }

/* CALCULATOR */
.calc { display: grid; grid-template-columns: 1fr 1.1fr; gap: 60px; align-items: start; }
.disclaimer { font-size: .85rem; color: var(--muted); border-left: 2px solid var(--volt); padding-left: 12px; }
.calc-box { padding: 28px; box-shadow: var(--shadow); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 9px; border-radius: 10px; font-size: .9rem; font-weight: 500; color: var(--muted); transition: all .2s; }
.seg input:checked + span { background: var(--volt); color: var(--volt-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--volt); outline-offset: 2px; }
.field select { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 1rem; }
.result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 18px; }
.result div { padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.result span { display: block; font-size: .78rem; color: var(--muted); }
.result b { font: 700 1.35rem var(--display); }
.gauge { position: relative; height: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.gauge span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: #2bff88; transition: width .5s var(--ease), background .3s; }
.gauge i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bg); }
.gauge-scale { position: relative; height: 20px; font-size: .72rem; color: var(--muted); margin-top: 4px; }
.gauge-scale span { position: absolute; transform: translateX(-50%); }
.gauge-scale span:first-child { transform: none; }
.gauge-scale span:last-child { transform: translateX(-100%); }
.verdict { margin: 10px 0 0; font-weight: 500; }

/* PROCESS */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; position: relative; }
.timeline::before { content: ""; position: absolute; top: 28px; left: 28px; right: 28px; height: 2px; background: linear-gradient(90deg, var(--volt), var(--cyan), var(--violet)); opacity: .5; }
.step { position: relative; padding-top: 80px; }
.step .num { position: absolute; top: 0; left: 0; width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font: 700 1.1rem var(--display); background: var(--bg); border: 1px solid var(--line); color: var(--volt); box-shadow: 0 0 0 6px var(--bg); }
.step p { color: var(--muted); font-size: .95rem; }

/* REFERENCES */
.ref-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ref { padding: 20px; min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; }
.ref span { font-family: var(--display); font-weight: 600; }
.skeleton { height: 120px; border-radius: 14px; background: linear-gradient(100deg, var(--surface) 20%, var(--surface-2) 40%, var(--surface) 60%) 0 0 / 300% 100%; animation: shimmer 2.2s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* TEAM */
.team { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.member {
  --rx: 0deg; --ry: 0deg;
  padding: 32px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .2s ease-out, border-color .3s;
}
.member.reveal { transition: opacity .9s var(--ease), transform .2s ease-out; }
.member:hover { border-color: color-mix(in oklab, var(--volt) 50%, transparent); }
.avatar {
  width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; margin-bottom: 22px;
  font: 700 1.5rem var(--display); color: var(--volt-ink);
  background: conic-gradient(from 200deg, var(--volt), var(--cyan), var(--violet), var(--volt));
  box-shadow: 0 16px 40px -14px var(--cyan);
}
.member p { color: var(--muted); margin-bottom: 18px; }
.member a { font-size: .9rem; color: var(--volt); border-bottom: 1px solid transparent; transition: border-color .2s; word-break: break-all; }
.member a:hover { border-color: currentColor; }

/* CONTACT */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 60px; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 32px 0 0; }
.contact-list li { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-list span { width: 80px; color: var(--muted); font-size: .85rem; }
.contact-list a { font: 500 1.1rem var(--display); }
.contact-list a:hover { color: var(--volt); }
.copy { margin-left: auto; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; }
.copy:hover { color: var(--volt); }

.wizard { padding: 28px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.wiz-bar { height: 4px; border-radius: 4px; background: var(--surface-2); margin-bottom: 24px; overflow: hidden; }
.wiz-bar span { display: block; height: 100%; width: 33%; background: linear-gradient(90deg, var(--volt), var(--cyan)); transition: width .5s var(--ease); }
.wiz-step { border: 0; padding: 0; margin: 0; display: none; }
.wiz-step.active { display: block; animation: stepIn .5s var(--ease); }
@keyframes stepIn { from { opacity: 0; transform: translateX(30px); } }
.wiz-step legend { font: 600 1.35rem var(--display); margin-bottom: 18px; }
.pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pick label { position: relative; cursor: pointer; }
.pick input { position: absolute; opacity: 0; }
.pick span { display: block; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: all .2s; font-size: .95rem; }
.pick input:checked + span { border-color: var(--volt); background: color-mix(in oklab, var(--volt) 14%, transparent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--volt) 20%, transparent); }
.pick input:focus-visible + span { outline: 2px solid var(--volt); outline-offset: 2px; }
.pick.radio { grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.pick.radio span { text-align: center; padding: 12px 6px; font-size: .88rem; }
.field { display: block; margin-bottom: 16px; font-size: .9rem; color: var(--muted); }
.field span { display: block; margin-bottom: 6px; }
.field output { color: var(--volt); font-weight: 600; }
.field input:not([type=range]), .field textarea {
  width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-size: 1rem; resize: vertical; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--volt); box-shadow: 0 0 0 3px color-mix(in oklab, var(--volt) 22%, transparent); }
.field input:user-invalid { border-color: var(--danger); }
input[type=range] { width: 100%; accent-color: var(--volt); margin-top: 10px; }
.wiz-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; }
.wiz-count { color: var(--muted); font-size: .85rem; }
.wiz-done { text-align: center; padding: 30px 0; animation: stepIn .5s var(--ease); }
.done-ico { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; font-size: 2rem; background: var(--volt); color: var(--volt-ink); box-shadow: 0 0 40px var(--volt); }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* FOOTER */
.footer { border-top: 1px solid var(--line); padding: 40px 0; }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.foot p { margin: 0; }
.socials { display: flex; gap: 8px; }
.socials a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem; transition: all .2s; }
.socials a:hover { background: var(--volt); color: var(--volt-ink); border-color: var(--volt); }

.to-top { position: fixed; right: 20px; bottom: 20px; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--volt); color: var(--volt-ink); font-weight: 700; box-shadow: 0 10px 30px -10px var(--volt); opacity: 0; transform: translateY(20px); pointer-events: none; transition: all .3s var(--ease); z-index: 40; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); padding: 12px 20px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 500; transition: transform .4s var(--ease); z-index: 80; }
.toast.show { transform: translate(-50%, 0); }

/* COMMAND PALETTE */
.cmd { border: 0; padding: 0; background: transparent; width: min(600px, 100% - 32px); margin-top: 14vh; color: var(--text); }
.cmd::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(6px); }
.cmd[open] { animation: cmdIn .25s var(--ease); }
@keyframes cmdIn { from { opacity: 0; transform: scale(.96) translateY(-10px); } }
.cmd-box { background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
#cmdInput { width: 100%; padding: 20px 22px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: 500 1.05rem var(--font); outline: none; }
#cmdList { list-style: none; margin: 0; padding: 8px; max-height: 340px; overflow: auto; }
#cmdList li { display: flex; justify-content: space-between; padding: 11px 14px; border-radius: 10px; cursor: pointer; }
#cmdList li small { color: var(--muted); }
#cmdList li[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--volt); }
.cmd-foot { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
kbd { font: 600 .72rem var(--font); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface); margin-right: 3px; }

/* View transition for theme switch */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1080px) {
  .links { position: fixed; top: 76px; left: 12px; right: 12px; flex-direction: column; padding: 12px; border-radius: 18px;
    background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-10px); pointer-events: none; transition: all .3s var(--ease); }
  .links.open { opacity: 1; transform: none; pointer-events: auto; }
  .links a { padding: 12px 14px; font-size: 1rem; }
  .burger { display: flex; }
  .hero { grid-template-columns: 1fr; }
  .hero-card { display: none; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tall { grid-row: span 1; }
  .bim, .contact, .about, .calc, .net { grid-template-columns: 1fr; }
  .design-grid { grid-template-columns: 1fr; gap: 14px; }
  .design-sticky { align-items: flex-start; padding-top: 84px; }
  .design-side h2 { font-size: 1.6rem; margin-bottom: 0; }
  .design-side .kicker { margin-bottom: 6px; }
  .dsteps { margin: 10px 0; }
  .dsteps li:not(.active) { display: none; }
  .dsteps li::after { display: none; }
  .dhint { display: none; }
  .design-ctrl .btn { padding: .5em 1em; font-size: .85rem; }
  .dsteps li { min-height: 76px; }
  #bp { max-height: calc(100svh - 360px); }
  .timeline { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .timeline::before { display: none; }
  .ref-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .nav-actions > .btn, .kbd-btn { display: none; }
  .bento, .team, .ref-grid, .timeline { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .pick.radio { grid-template-columns: repeat(2, 1fr); }
  .result { grid-template-columns: 1fr; }
  .net-diagram { padding: 10px; overflow-x: auto; }
  #sld { min-width: 560px; }
  #bim3d { height: 340px; }
}
/* Csökkentett mozgás: csak a díszítő hatásokat kapcsoljuk ki,
   a funkcionális animációk (tervezési animáció, 3D modell, áramlás) maradnak */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .track, .hero-card, .dot, .scroll-hint span, .sun-meter span { animation: none !important; }
  .split .w { animation: none; opacity: 1; transform: none; filter: none; }
  .reveal { transition: none; opacity: 1; transform: none; }
}
