/* Электросхема — лендинг. Две темы: тёмная инженерная (по умолчанию)
   и светлая. Вся палитра — в переменных, переключение через
   data-theme="light" на <html>. */

:root {
  --bg: #0e1116;
  --bg-alt: #12161d;
  --panel: #151a23;
  --line: #242d3d;
  --line-soft: #1b2230;
  --text: #e8ecf3;
  --muted: #9ca7b8;
  --accent: #ffc61a;            /* фон кнопок, бейджей */
  --accent-text: #ffc61a;       /* цветной текст (метки, акценты) */
  --accent-soft: rgba(255, 198, 26, 0.14);
  --accent-ink: #1c1500;
  --header-bg: rgba(14, 17, 22, 0.86);
  --grid-line: rgba(255, 255, 255, 0.025);
  --glow: rgba(255, 198, 26, 0.09);
  --shot-line: #3a4560;
  --shot-bar: #10141b;
  --shot-bg: #0a0d12;
  --shadow-shot: 0 24px 60px rgba(0, 0, 0, 0.55), 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-flat: 0 14px 36px rgba(0, 0, 0, 0.45);
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
}

:root[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-alt: #eef1f5;
  --panel: #ffffff;
  --line: #d9dfe8;
  --line-soft: #e4e8ef;
  --text: #1b2330;
  --muted: #4f5a6b;
  --accent: #ffc61a;
  --accent-text: #8a6600;       /* янтарь затемнён — держит контраст на белом */
  --accent-soft: rgba(217, 138, 0, 0.10);
  --accent-ink: #1c1500;
  --header-bg: rgba(246, 247, 249, 0.86);
  --grid-line: rgba(27, 35, 48, 0.05);
  --glow: rgba(255, 198, 26, 0.16);
  --shot-line: #cfd6e2;
  --shot-bar: #e9edf3;
  --shot-bg: #f2f4f8;
  --shadow-shot: 0 24px 60px rgba(24, 32, 48, 0.18), 0 4px 14px rgba(24, 32, 48, 0.10);
  --shadow-flat: 0 14px 36px rgba(24, 32, 48, 0.14);
  --pro-border: #d9a000;
  --pro-shadow: 0 12px 32px rgba(217, 138, 0, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s, color 0.25s;
}

::selection { background: var(--accent); color: var(--accent-ink); }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- шапка ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.header__row {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.2px;
}

.logo__mark {
  width: 22px;
  height: 22px;
  color: var(--accent-text);
  flex: none;
}

.nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
  transition: color 0.15s;
}

.nav a:hover { color: var(--text); }

/* переключатель темы */
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.theme-btn:hover { border-color: var(--accent); color: var(--text); }

.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .icon-sun { display: none; }
:root[data-theme="light"] .theme-btn .icon-sun { display: block; }
:root[data-theme="light"] .theme-btn .icon-moon { display: none; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 13px 22px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn--primary:hover { background: #ffd44d; }

.btn--ghost {
  border-color: var(--line);
  color: var(--text);
  background: transparent;
}

.btn--ghost:hover { border-color: var(--accent); }

.btn--sm { padding: 9px 16px; font-size: 14px; }
.btn--lg { padding: 16px 28px; font-size: 18px; }

.btn__icon { width: 19px; height: 19px; flex: none; }

/* ---------- герой ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    radial-gradient(1100px 500px at 78% -10%, var(--glow), transparent 60%),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto, auto;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
  gap: 48px;
  align-items: center;
  padding-top: 84px;
  padding-bottom: 92px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--muted);
  font-family: var(--mono);
}

.badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero__title {
  margin: 0 0 20px;
  font-size: clamp(34px, 4.6vw, 52px);
  line-height: 1.14;
  letter-spacing: -0.5px;
  font-weight: 800;
}

.hero__title em {
  font-style: normal;
  color: var(--accent-text);
}

.hero__lead {
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 19px;
  max-width: 52ch;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 30px;
}

.norm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.norm-chips li {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  background: var(--bg-alt);
  border-radius: 7px;
  padding: 5px 10px;
  white-space: nowrap;
}

/* ---------- скриншоты в рамках-окнах ---------- */

.shot {
  border: 1px solid var(--shot-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--shot-bg);
  box-shadow: var(--shadow-shot);
}

.shot__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--shot-line);
  background: var(--shot-bar);
}

.shot__bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #2c3547;
}

:root[data-theme="light"] .shot__bar span { background: #c3ccd9; }

.shot__bar i {
  margin-left: 10px;
  font-style: normal;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.shot img { width: 100%; }

.hero__shot { margin: 0; }
.hero__caption {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

/* ---------- схема-разделитель: трасса упирается в норму ---------- */

.scheme {
  padding: 26px 0 10px;
  border-bottom: 1px solid var(--line-soft);
}

.scheme__svg { width: 100%; height: auto; display: block; }

.scheme__glyph {
  font: 700 15px var(--sans);
  fill: var(--text);
}

.scheme__route {
  fill: none;
  stroke: var(--text);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.scheme__flow {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-dasharray: 5 17;
  animation: current-flow 2.6s linear infinite;
}

@keyframes current-flow {
  to { stroke-dashoffset: -66; }
}

.scheme__stop {
  stroke: var(--accent-text);
  stroke-width: 3;
  stroke-dasharray: 11 6;
}

.scheme__hatch line {
  stroke: var(--line);
  stroke-width: 2;
}

.scheme__chip rect {
  fill: var(--panel);
  stroke: var(--shot-line);
}

.scheme__chip text {
  font: 500 13px var(--mono);
  fill: var(--muted);
}

.scheme__label {
  font: 500 13px var(--mono);
  fill: var(--muted);
}

.scheme__label--accent { fill: var(--accent-text); }

/* ---------- появление секций при скролле ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .scheme__flow { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- секции ---------- */

.section { padding: 96px 0; border-bottom: 1px solid var(--line-soft); }
.section--alt { background: var(--bg-alt); }

.section__tag {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent-text);
}

.section__title {
  margin: 0 0 18px;
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.4px;
  font-weight: 800;
}

.section__lead {
  margin: 0 0 44px;
  color: var(--muted);
  font-size: 18px;
  max-width: 62ch;
}

/* ---------- карточки отличий ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 26px 28px;
  transition: border-color 0.15s;
}

.card:hover { border-color: rgba(255, 198, 26, 0.6); }

.card__icon {
  width: 30px;
  height: 30px;
  color: var(--accent-text);
  margin-bottom: 14px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 19px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

/* ---------- галерея ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}

.gallery__item { margin: 0; }

.gallery__item figcaption {
  margin-top: 12px;
  font-size: 14.5px;
  color: var(--muted);
  min-height: 3em;
}

.zoomable {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  transition: transform 0.15s;
}

.zoomable:hover { transform: translateY(-2px); }

.shot--flat { box-shadow: var(--shadow-flat); }

/* ---------- лайтбокс ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 10, 14, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  cursor: zoom-out;
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: 94vw;
  max-height: 90vh;
  border: 1px solid #3a4560;
  border-radius: var(--radius);
}

.lightbox__close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #3a4560;
  background: rgba(21, 26, 35, 0.9);
  color: #e8ecf3;
  font-size: 17px;
  cursor: pointer;
}

.lightbox__close:hover { border-color: var(--accent); }

/* ---------- шаги ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: step;
}

.step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 26px 28px;
  position: relative;
}

.step__num {
  display: block;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent-text);
  margin-bottom: 14px;
}

.step h3 { margin: 0 0 10px; font-size: 18.5px; }
.step p { margin: 0; color: var(--muted); font-size: 15.5px; }

.note {
  margin: 34px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 72ch;
}

/* ---------- бета ---------- */

.beta__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.beta__side { text-align: center; }

.beta__side .btn { margin-bottom: 16px; }

.beta__hint {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

/* ---------- футер ---------- */

.footer {
  border-top: 1px solid var(--line-soft);
  padding: 34px 0;
  background: var(--bg-alt);
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
  align-items: center;
  justify-content: space-between;
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

.footer__brand a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.footer__brand a:hover { border-color: var(--accent); }

.footer__copy { margin: 0; font-size: 14px; color: var(--muted); font-family: var(--mono); }

/* ---------- адаптив ---------- */

@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; padding-top: 56px; padding-bottom: 64px; }
  .hero__lead { max-width: none; }
  .beta__grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav { display: none; }
  .hide-sm { display: none; }
  .cards, .gallery, .steps { grid-template-columns: 1fr; }
  .section { padding: 68px 0; }
  .hero__cta { flex-direction: column; }
  .hero__cta .btn { width: 100%; justify-content: center; }
  .header .btn--sm { padding: 8px 12px; font-size: 13px; }
  .header__row { gap: 12px; }
  .norm-chips { gap: 6px; }
  .norm-chips li { font-size: 11px; padding: 4px 8px; }
  .gallery__item figcaption { min-height: 0; }
  .lightbox { padding: 14px; }
}
