:root {
  --bg: #0a0b0d;
  --bg-2: #111317;
  --panel: rgba(17, 19, 23, 0.72);
  --ink: #eef0f2;
  --muted: #8d939b;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.18);
  --accent: #f2a900;
  --volt: #5cc8ff;
  --ok: #7ee787;
  --pad: clamp(16px, 4vw, 56px);
  --sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* schematický papier – jemná mriežka */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 64px 64px;
  opacity: 0.45;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 70%);
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.03em; line-height: 1.02; }
p { margin: 0; }
.mono { font: 500 11.5px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
em { font-style: normal; color: var(--accent); text-shadow: 0 0 28px rgba(242, 169, 0, 0.45); }
::selection { background: var(--accent); color: #000; }

.led { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); vertical-align: 1px; animation: blink 2.4s infinite; }
.led.rec { background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d; animation-duration: 1.2s; }
.led.run { margin: 0 4px 0 6px; }
@keyframes blink { 50% { opacity: 0.35; } }

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: 22px;
  background: var(--bg);
  transition: opacity 0.9s var(--ease) 0.15s, visibility 0s linear 1.1s;
}
#loader img { width: 120px; filter: drop-shadow(0 0 18px rgba(92, 200, 255, 0.35)); animation: pulse 1.4s ease-in-out infinite; }
.loader-line { width: 180px; height: 1px; background: var(--line); }
#loader-bar { display: block; height: 100%; background: var(--volt); box-shadow: 0 0 10px var(--volt); transform: scaleX(0); transform-origin: left; }
#loader-pct { font: 500 12px var(--mono); letter-spacing: 0.3em; color: var(--muted); }
.is-loaded #loader { opacity: 0; visibility: hidden; }
@keyframes pulse { 50% { opacity: 0.55; } 52% { opacity: 1; } 54% { opacity: 0.6; } }

/* ---------- 3D canvas ---------- */
#gl {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none;
  opacity: 0; transition: opacity 1.4s var(--ease) 0.3s;
}
.is-loaded.has-3d #gl { opacity: 1; }
.no-3d .hero::after {
  content: ''; position: absolute; z-index: 1; right: 10%; top: 45%; width: min(34vw, 380px); aspect-ratio: 480/417;
  transform: translateY(-50%); background: url(../img/logo-white.png) center/contain no-repeat; opacity: 0.9;
}

/* ---------- nav ---------- */
#nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  transition: background 0.4s, padding 0.4s;
}
#nav.is-scrolled { padding-block: 12px; background: rgba(10, 11, 13, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 44px; height: auto; }
.brand span { font-weight: 600; font-size: 19px; letter-spacing: 0.02em; line-height: 1; }
.brand small { display: block; margin-top: 4px; font: 500 9.5px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.6; }
#menu { display: flex; gap: 6px; align-items: center; }
#menu a { position: relative; padding: 9px 14px; border-radius: 99px; font-size: 14.5px; text-decoration: none; transition: background 0.25s; }
#menu a:hover { background: rgba(255, 255, 255, 0.07); }
#menu a.is-active:not(.cta)::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--volt); box-shadow: 0 0 6px var(--volt); }
#menu a.cta { margin-left: 8px; background: var(--accent); color: #000; font-weight: 500; }
#menu a.cta:hover { box-shadow: 0 0 22px rgba(242, 169, 0, 0.5); }
#burger { display: none; }

/* ---------- HUD ---------- */
.hud {
  position: fixed; z-index: 40; left: 18px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  opacity: 0; transition: opacity 0.6s 1s;
}
.is-loaded .hud { opacity: 1; }
.hud-track { width: 2px; height: 64px; background: var(--line); overflow: hidden; }
#hud-bar { width: 100%; height: 100%; background: var(--volt); box-shadow: 0 0 6px var(--volt); transform: scaleY(0); transform-origin: top; }
#hud-label { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }

/* ---------- reveal ---------- */
.rv { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.steps .rv:nth-child(2), .cards .rv:nth-child(2), .why .rv:nth-child(2) { transition-delay: 0.08s; }
.steps .rv:nth-child(3), .cards .rv:nth-child(3), .why .rv:nth-child(3) { transition-delay: 0.16s; }
.steps .rv:nth-child(4), .cards .rv:nth-child(4), .why .rv:nth-child(4) { transition-delay: 0.24s; }

/* ---------- vodič medzi sekciami ---------- */
.wire { position: relative; z-index: 2; height: 1px; margin: 0 var(--pad); background: var(--line); overflow: hidden; }
.wire::after {
  content: ''; position: absolute; top: 0; left: 0; width: 160px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--volt), #fff);
  box-shadow: 0 0 8px var(--volt);
  animation: current 3.2s linear infinite;
}
@keyframes current { from { transform: translateX(-160px); } to { transform: translateX(100vw); } }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px var(--pad) 40px;
  overflow: hidden;
}
.hero-top { position: absolute; z-index: 2; top: 96px; left: var(--pad); right: var(--pad); display: flex; justify-content: space-between; }
.hero-copy { position: relative; z-index: 2; max-width: 760px; }
.hero h1 { margin: 18px 0 26px; font-size: clamp(46px, 7.4vw, 112px); }
.lead { max-width: 520px; font-size: clamp(17px, 1.4vw, 20px); color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px; border: 1px solid var(--accent); border-radius: 99px;
  background: var(--accent); color: #000; font: 500 15px var(--sans); text-decoration: none; cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background 0.3s, color 0.3s, border-color 0.3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--accent), 0 0 32px rgba(242, 169, 0, 0.45); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--volt); box-shadow: 0 0 24px rgba(92, 200, 255, 0.3); }

.scope { position: relative; z-index: 2; margin-top: 56px; border-top: 1px solid var(--line); padding-top: 14px; }
#scope { display: block; width: 100%; height: 92px; }
.scope-read { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 10px; }
.scope-read b { color: var(--ink); font-weight: 500; }
.scope-read .l1 { color: #f2a900; } .scope-read .l2 { color: var(--volt); } .scope-read .l3 { color: #ff5ca8; }

/* ---------- panely ---------- */
.panel { position: relative; min-height: 100vh; padding: clamp(110px, 16vh, 170px) var(--pad); }
.panel > * { position: relative; z-index: 2; max-width: min(660px, 52vw); }
.panel.right > * { margin-left: auto; }
.sec-head { margin-bottom: 48px; }
.num { display: block; margin-bottom: 22px; color: var(--volt); }
.num::before { content: ''; display: inline-block; width: 28px; height: 1px; margin-right: 12px; vertical-align: middle; background: currentColor; box-shadow: 0 0 6px currentColor; }
.sec-head h2 { font-size: clamp(38px, 5vw, 76px); margin-bottom: 24px; text-wrap: balance; }
.sec-head p { max-width: 560px; font-size: 18.5px; color: var(--muted); }

/* revízie – oprávnenia */
.creds { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.cred { position: relative; padding: 20px 22px 18px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); overflow: hidden; }
.cred::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--volt); box-shadow: 0 0 12px var(--volt); }
.cred.cal::after { background: var(--ok); box-shadow: 0 0 12px var(--ok); }
.cred.gas { grid-column: 1 / -1; }
.cred.gas::after { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.cred b { display: block; margin: 10px 0 6px; font: 500 clamp(24px, 2.4vw, 34px)/1.1 var(--mono); letter-spacing: -0.02em; color: var(--ink); }
.cred.cal b { color: var(--ok); text-shadow: 0 0 14px rgba(126, 231, 135, 0.4); }
.cred.gas b { color: var(--accent); text-shadow: 0 0 14px rgba(242, 169, 0, 0.35); }
.cred p { font-size: 14px; color: var(--muted); }

/* revízie – protokol */
.protocol { border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); overflow: hidden; }
.proto-head { display: flex; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px dashed var(--line-2); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 16px; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  transition: background 0.4s;
}
.rows li:hover { background: linear-gradient(90deg, rgba(92, 200, 255, 0.07), transparent 70%); }
.rows .idx { padding-top: 5px; }
.rows h3 { font-size: 20px; margin-bottom: 6px; }
.rows p { font-size: 14.5px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tags b, .chips li {
  font: 500 10.5px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
  padding: 4px 9px; border: 1px solid var(--line-2); border-radius: 99px; color: var(--ink);
}
.tags b.dim { color: var(--muted); border-style: dashed; }
.meas { display: grid; grid-template-columns: auto auto; column-gap: 6px; align-items: baseline; justify-items: end; min-width: 108px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, 0.35); }
.meas > .mono:first-child { grid-column: 1 / -1; justify-self: start; font-size: 10px; }
.meas b { font: 500 24px/1.1 var(--mono); color: var(--ok); text-shadow: 0 0 12px rgba(126, 231, 135, 0.45); letter-spacing: -0.02em; }
.meas sub { font-size: 0.8em; text-transform: none; }
.proto-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 18px 20px; }
.proto-foot p { flex: 1 1 260px; font-size: 14.5px; color: var(--muted); }
.proto-foot p b { color: var(--ink); font-weight: 500; }
.stamp { padding: 7px 12px; border: 1.5px solid var(--ok); border-radius: 6px; color: var(--ok); transform: rotate(-4deg); box-shadow: 0 0 14px rgba(126, 231, 135, 0.2) inset; }
.proto-foot .dim { font-size: 10px; }
.aside-link { margin-top: 26px; font-size: 15px; color: var(--muted); }
.aside-link a { color: var(--ink); text-decoration-color: var(--volt); text-underline-offset: 4px; }

/* CE */
.ce-row { display: flex; align-items: center; justify-content: space-between; }
.ce-mark { width: 120px; height: auto; margin-bottom: 18px; }
.ce-mark path { fill: none; stroke: var(--ink); stroke-width: 13; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.8s var(--ease) 0.3s; }
.ce-mark path + path { transition-delay: 0.7s; }
.ce-mark.in path { stroke-dashoffset: 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.steps li { position: relative; padding: 26px 24px 28px; background: rgba(12, 13, 16, 0.86); transition: background 0.4s; }
.steps li:hover { background: rgba(22, 25, 30, 0.92); }
.steps li::after { content: ''; position: absolute; left: 24px; top: 30px; width: 7px; height: 7px; border-radius: 50%; background: var(--volt); box-shadow: 0 0 8px var(--volt); opacity: 0; transition: opacity 0.4s; }
.steps li:hover::after { opacity: 1; }
.steps li > .mono { display: block; transition: padding 0.4s var(--ease); }
.steps li:hover > .mono { padding-left: 16px; }
.steps h3 { margin: 24px 0 10px; font-size: 21px; }
.steps p { font-size: 14.5px; color: var(--muted); }
.note { margin-top: 24px; padding: 16px 20px; border-left: 2px solid var(--accent); border-radius: 0 10px 10px 0; background: rgba(242, 169, 0, 0.08); font-size: 15px; }
.note b { color: var(--accent); }

/* automatizácia – DAQ */
.daq { margin-bottom: 14px; border: 1px solid var(--line-2); border-radius: 14px; background: rgba(5, 6, 8, 0.85); overflow: hidden; }
.daq-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
#daq-chart { display: block; width: 100%; height: 150px; }
.daq-ch { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.daq-ch > div { padding: 12px 14px; border-right: 1px solid var(--line); font-size: 10px; line-height: 1.7; }
.daq-ch > div:last-child { border-right: 0; }
.daq-ch span { display: block; }
.daq-ch b { display: inline-block; min-width: 3.4em; font-size: 17px; font-weight: 500; color: var(--ink); letter-spacing: 0; }
.c1 { color: #f2a900; } .c2 { color: var(--volt); } .c3 { color: #ff5ca8; } .c4 { color: var(--ok); }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  position: relative; padding: 24px 22px 22px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform 0.5s var(--ease), border-color 0.4s, box-shadow 0.4s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(92, 200, 255, 0.45); box-shadow: 0 0 0 1px rgba(92, 200, 255, 0.15), 0 12px 40px -12px rgba(92, 200, 255, 0.35); }
.card h3 { margin: 20px 0 10px; font-size: 20px; }
.card p { font-size: 14.5px; color: var(--muted); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; padding: 0; }

/* prečo */
.why { list-style: none; margin: 0; padding: 0; counter-reset: w; }
.why li { position: relative; padding: 22px 0 22px 56px; border-top: 1px solid var(--line); counter-increment: w; }
.why li::before { content: counter(w, decimal-leading-zero); position: absolute; left: 0; top: 27px; font: 500 11.5px var(--mono); color: var(--volt); }
.why h3 { font-size: 22px; margin-bottom: 6px; }
.why p { font-size: 15.5px; color: var(--muted); }

/* kontakt */
.contact-sec { background: linear-gradient(180deg, transparent, rgba(17, 19, 23, 0.9) 30%); }
#kontakt > * { max-width: min(760px, 56vw); }
.contact { display: grid; gap: 48px; }
.direct .big { display: block; width: fit-content; font-size: clamp(26px, 3.4vw, 46px); letter-spacing: -0.03em; text-decoration: none; line-height: 1.25; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat; transition: background-size 0.5s var(--ease), color 0.3s; }
.direct .big:hover { background-size: 100% 2px; color: var(--accent); }
.direct p { margin-top: 18px; font-size: 15.5px; color: var(--muted); }
form { display: grid; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: grid; gap: 7px; font: 500 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line-2); border-radius: 10px;
  background: rgba(255, 255, 255, 0.03); color: var(--ink); font: 400 16px var(--sans); text-transform: none; letter-spacing: 0;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
select option { background: var(--bg-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--volt); background: rgba(255, 255, 255, 0.05); box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.15); }
label.check { display: flex; align-items: flex-start; gap: 10px; text-transform: none; letter-spacing: 0; font: 400 14px var(--sans); }
label.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
form .btn { width: fit-content; }
#form-note { min-height: 1em; color: var(--accent); }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 3px; }

/* footer */
.footer {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px;
  padding: 28px var(--pad) 34px; background: var(--bg-2); color: var(--muted);
  border-top: 1px solid var(--line); font-size: 14px;
}
.footer > div { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.footer img { opacity: 0.8; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- responzívne ---------- */
@media (max-width: 1180px) {
  .steps, .cards { grid-template-columns: 1fr; }
  .daq-ch { grid-template-columns: 1fr 1fr; }
  .daq-ch > div:nth-child(2) { border-right: 0; }
  .daq-ch > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 860px) {
  body { font-size: 16px; }
  #burger {
    display: grid; gap: 6px; place-content: center; width: 44px; height: 44px; z-index: 2;
    border: 1px solid var(--line-2); border-radius: 50%; background: rgba(10, 11, 13, 0.6); cursor: pointer;
  }
  #burger i { width: 16px; height: 1.5px; background: var(--ink); transition: transform 0.4s var(--ease); }
  .menu-open #burger i:first-child { transform: translateY(3.75px) rotate(45deg); }
  .menu-open #burger i:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .menu-open #nav { backdrop-filter: none; -webkit-backdrop-filter: none; }
  #menu {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 8px;
    background: var(--bg); opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0s 0.4s;
  }
  .menu-open #menu { opacity: 1; visibility: visible; transition: opacity 0.4s; }
  #menu a { font-size: 30px; letter-spacing: -0.02em; }
  #menu a.cta { margin: 12px 0 0; }

  .is-loaded.has-3d:not(.at-hero) #gl { opacity: 0.22; }
  #gl { transition: opacity 0.6s; }
  .hud { display: none; }
  .hero { padding-top: 44vh; justify-content: flex-start; }
  .hero-top { display: none; }
  .scope { margin-top: 40px; }
  .panel { min-height: auto; padding-block: 100px 80px; }
  .panel > *, #kontakt > * { max-width: none; }
  .rows li { grid-template-columns: 1fr; gap: 10px; }
  .rows .idx { padding: 0; }
  .meas { justify-self: start; }
  .grid2 { grid-template-columns: 1fr; }
  .creds { grid-template-columns: 1fr; }
  .ce-mark { width: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .ce-mark path { stroke-dashoffset: 0; transition: none; }
  #loader img, .led, .wire::after { animation: none; }
}
