:root {
  color-scheme: dark;
  --bg: #0c0d0f;
  --panel: #17181b;
  --tile: #222327;
  --text: #f2f3f4;
  --soft: #c5c7cb;
  --muted: #8b8e94;
  --faint: #5d6066;
  --line: rgb(255 255 255 / 12%);
  --line-strong: rgb(255 255 255 / 26%);
  --accent: #fea621;
  --page-pad: clamp(24px, 4vw, 64px);
  --sans: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-family: var(--sans);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: auto; }
body { margin: 0; background: var(--bg); color: var(--text); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
::selection { color: #0c0d0f; background: var(--accent); }

.skip-link {
  position: fixed; z-index: 100; left: 20px; top: 12px; padding: 12px 18px;
  color: #0c0d0f; background: var(--accent); font: 500 12px var(--mono); transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Сцена ---------- */
.scroll-track { height: 1000vh; position: relative; }
.scroll-marker { position: absolute; left: 0; width: 1px; height: 1px; pointer-events: none; }
.webgl-stage, .scenes { position: fixed; inset: 0; width: 100%; height: 100%; }
.webgl-stage { z-index: 0; background: var(--bg); }
#webgl { display: block; width: 100%; height: 100%; }
.stage-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgb(0 0 0 / 42%) 100%);
}
.cta-shade { position: absolute; inset: 0; background: rgb(12 13 15 / 90%); opacity: 0; pointer-events: none; }

.scroll-progress { position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: 2px; }
.scroll-progress span { display: block; width: 100%; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }

/* ---------- Шапка ---------- */
.site-header {
  position: fixed; z-index: 20; left: var(--page-pad); right: var(--page-pad); top: 26px;
  display: flex; align-items: center; justify-content: space-between; pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo { width: 176px; height: auto; filter: brightness(0) invert(1); opacity: .95; }
.header-actions { display: flex; align-items: stretch; gap: 8px; }
.contact-button, .motion-toggle {
  border: 1px solid var(--line-strong); color: var(--text); background: rgb(12 13 15 / 55%);
  backdrop-filter: blur(10px); cursor: pointer; transition: border-color .2s, background-color .2s, color .2s;
}
.contact-button {
  display: inline-flex; align-items: center; height: 40px; padding: 0 20px;
  font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
}
.contact-button:hover { color: #0c0d0f; border-color: var(--accent); background: var(--accent); }
.motion-toggle { width: 40px; height: 40px; padding: 13px; }
.motion-toggle:hover { border-color: var(--text); }
.motion-toggle:disabled { cursor: default; opacity: .4; }
.motion-toggle svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.motion-toggle .play-icon { display: none; }
.motion-toggle.is-paused .pause-icon { display: none; }
.motion-toggle.is-paused .play-icon { display: block; }

/* ---------- Навигация по сценам ---------- */
.scene-nav {
  position: fixed; z-index: 20; right: var(--page-pad); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: flex-end;
}
.scene-nav a {
  display: flex; align-items: center; gap: 12px; padding: 7px 0; color: var(--muted);
  font: 400 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
}
.scene-nav a i { display: block; width: 14px; height: 1px; background: var(--faint); transition: width .25s, background-color .25s; }
.scene-nav a span { opacity: 0; transform: translateX(6px); transition: opacity .2s, transform .2s; }
.scene-nav a:hover span, .scene-nav a:focus-visible span, .scene-nav a.is-active span { opacity: 1; transform: translateX(0); }
.scene-nav a:hover i { background: var(--text); }
.scene-nav a.is-active { color: var(--text); }
.scene-nav a.is-active i { width: 30px; background: var(--accent); }

.scene-index {
  position: fixed; z-index: 10; left: var(--page-pad); bottom: 26px; display: flex; align-items: center; gap: 10px;
  color: var(--faint); font: 400 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.scene-index b { color: var(--text); font-weight: 500; }
.scene-index i { display: block; width: 28px; height: 1px; background: var(--line-strong); }
.scene-index em { margin-left: 12px; color: var(--muted); font-style: normal; }

/* ---------- Тексты сцен ---------- */
.scenes { z-index: 3; pointer-events: none; }
.scene-copy { position: absolute; inset: 0; opacity: 0; visibility: hidden; }
.copy-block { position: absolute; top: 50%; width: min(430px, 34vw); transform: translateY(-50%); }
.scene-copy.left .copy-block { left: var(--page-pad); }
.scene-copy.left::before {
  content: ''; position: absolute; inset: 0 48% 0 0; pointer-events: none;
  background: linear-gradient(90deg, rgb(12 13 15 / 82%), rgb(12 13 15 / 60%) 55%, transparent);
}
.scene-copy.map-copy::before { display: none; }
.scene-copy.right .copy-block { right: calc(var(--page-pad) + 110px); }
.eyebrow {
  margin: 0 0 22px; color: var(--accent);
  font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase;
}
.scene-copy h1, .scene-copy h2 { margin: 0; font-weight: 600; text-wrap: balance; }
.scene-copy h2 { font-size: clamp(34px, 3.5vw, 56px); line-height: 1.04; letter-spacing: -.03em; }
.body-copy, .lead { margin: 22px 0 0; color: var(--soft); font-size: clamp(15px, 1.1vw, 17px); line-height: 1.6; text-wrap: pretty; }

.spec { margin-top: 34px; }
.spec h3 { margin: 0 0 10px; color: var(--muted); font: 400 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.spec dl { margin: 0; border-top: 1px solid var(--line-strong); }
.spec dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.spec dt { font-size: 14px; }
.spec dd { margin: 0; color: var(--muted); font: 400 10px var(--mono); letter-spacing: .04em; text-align: right; white-space: nowrap; }

/* Герой */
.hero-block { position: absolute; left: var(--page-pad); top: 50%; width: min(520px, 40vw); transform: translateY(-50%); }
.hero-copy h1 { font-size: clamp(88px, 11.5vw, 196px); line-height: .86; letter-spacing: -.055em; margin-left: -.045em; }
.hero-copy .lead { max-width: 440px; margin-top: 30px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 0; margin: 36px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line-strong); }
.hero-facts li { padding: 12px 18px 0 0; margin-right: 18px; color: var(--muted); font: 400 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.hero-facts li + li { padding-left: 18px; border-left: 1px solid var(--line); margin-left: -18px; }
.scroll-hint {
  position: absolute; left: 50%; bottom: 26px; display: flex; align-items: center; gap: 12px; transform: translateX(-50%);
  color: var(--muted); font: 400 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
.scroll-hint i { display: block; width: 1px; height: 22px; background: var(--accent); transform-origin: top; }
@media (prefers-reduced-motion: no-preference) {
  .scroll-hint i { animation: hint 1.8s ease-in-out infinite; }
  @keyframes hint { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
}

/* ---------- Выноски ---------- */
.technical-ui { position: fixed; z-index: 4; inset: 0; pointer-events: none; }
.leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.leader-line { fill: none; stroke: rgb(255 255 255 / 55%); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0; }
.annotation { position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap; will-change: transform, opacity; }
.annotation-text {
  position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 9px; padding: 0 0 0 8px; transform: translateY(-50%);
  color: var(--text); font: 400 10px var(--mono); letter-spacing: .08em; text-transform: uppercase;
  text-shadow: 0 0 10px var(--bg), 0 0 4px var(--bg);
}
.annotation.to-left .annotation-text { padding: 0 8px 0 0; transform: translate(-100%, -50%); }
.annotation-text i { color: var(--accent); font-style: normal; }
.annotation.layer .annotation-text { color: var(--soft); }
.annotation.link .annotation-text { color: var(--accent); font-size: 11px; font-weight: 500; }
.annotation.km .annotation-text {
  gap: 7px; padding: 5px 8px; transform: translate(-50%, -100%); border: 1px solid var(--line-strong);
  background: rgb(12 13 15 / 82%); text-shadow: none; font-variant-numeric: tabular-nums;
}
.annotation.km i { display: none; width: 7px; height: 7px; background: var(--state, var(--faint)); }
.annotation.km b { font-weight: 500; }
.annotation.km em { display: none; color: var(--muted); font-style: normal; }
.annotations.is-map .annotation.km i { display: block; }
.annotations.is-map .annotation.km em { display: inline; }

/* ---------- Карточка телеметрии ---------- */
.telemetry, .map-panel { position: fixed; z-index: 5; opacity: 0; visibility: hidden; pointer-events: none; }
.telemetry {
  right: calc(var(--page-pad) + 110px); top: 50%; width: 292px; margin-top: -40px; padding: 12px;
  border: 1px solid var(--line); background: rgb(23 24 27 / 88%); backdrop-filter: blur(14px);
}
.telemetry header, .telemetry footer, .map-day header, .map-day footer {
  display: flex; justify-content: space-between; color: var(--muted); font: 400 10px var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.telemetry header { padding: 2px 2px 12px; }
.telemetry header span:first-child { color: var(--text); }
.telemetry footer { padding: 12px 2px 2px; color: var(--faint); }
.telemetry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-height: 76px; padding: 11px 12px; background: var(--tile); }
.tile.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 0; }
.tile > span { color: var(--muted); font-size: 12px; }
.tile strong { display: flex; align-items: baseline; gap: 5px; font-weight: 600; font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile strong b { font-weight: inherit; }
.tile strong small { color: var(--muted); font: 400 11px var(--mono); }
.badge {
  align-self: flex-start; padding: 4px 11px; border-radius: 100px; color: #0c0d0f; background: var(--state, #00e096);
  font-size: 12px; font-weight: 600; transition: background-color .35s;
}
.tile.wide .badge { align-self: center; }
.badge.reagent { color: var(--soft); background: #3a3b40; }
.badge.reagent.is-on { color: #0c0d0f; background: var(--accent); }

/* ---------- Карта ---------- */
.map-copy .copy-block { top: 104px; transform: none; width: min(400px, 34vw); }
.map-copy h2 { font-size: clamp(30px, 2.8vw, 44px); }
.map-panel { left: var(--page-pad); right: calc(var(--page-pad) + 110px); bottom: 64px; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.map-day { width: 292px; padding: 12px 14px; border: 1px solid var(--line); background: rgb(23 24 27 / 88%); backdrop-filter: blur(14px); }
.map-day header span:first-child { color: var(--text); }
.map-day-bars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 44px; margin: 12px 0 8px; }
.map-day-bars i { display: block; background: var(--state); }
.map-day footer { color: var(--faint); }
.map-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 22px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--soft); }
.map-legend li { display: flex; align-items: center; gap: 8px; }
.map-legend i { display: block; width: 18px; height: 6px; background: var(--state); }

/* ---------- Контакты ---------- */
.cta-copy { pointer-events: none; }
.cta-copy.is-active { pointer-events: auto; }
.cta-layout {
  position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); align-items: end; gap: 6vw;
  padding: 120px calc(var(--page-pad) + 110px) 110px var(--page-pad);
}
.cta-main h2 { max-width: 760px; font-size: clamp(40px, 5.2vw, 84px); line-height: 1; letter-spacing: -.035em; }
.cta-main .body-copy { max-width: 470px; }
.cta-link {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 48px; min-width: 240px; height: 54px; margin-top: 36px; padding: 0 22px;
  border: 1px solid var(--accent); color: #0c0d0f; background: var(--accent);
  font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; transition: color .2s, background-color .2s;
}
.cta-link:hover { color: var(--accent); background: transparent; }
.cta-contacts { margin: 0; border-top: 1px solid var(--line-strong); }
.cta-contacts div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.cta-contacts dt { color: var(--muted); font: 400 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; line-height: 20px; }
.cta-contacts dd { margin: 0; font-size: 15px; line-height: 20px; }
.cta-contacts address { font-style: normal; }
.cta-contacts a { text-decoration: none; border-bottom: 1px solid var(--line-strong); transition: color .2s, border-color .2s; }
.cta-contacts a:hover { color: var(--accent); border-color: var(--accent); }
.cta-footer {
  position: absolute; left: var(--page-pad); right: calc(var(--page-pad) + 110px); bottom: 26px; display: flex; align-items: center; justify-content: flex-end; gap: 20px;
  color: var(--faint); font: 400 10px var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.cta-footer img { width: 104px; height: auto; filter: brightness(0) invert(1); opacity: .5; }

/* ---------- Служебное ---------- */
.loading-screen { position: fixed; z-index: 50; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg); }
.loading-mark { font-size: 30px; font-weight: 600; letter-spacing: -.04em; }
.loading-line { width: 120px; height: 1px; margin: 20px 0 14px; overflow: hidden; background: var(--line); }
.loading-line span { display: block; width: 100%; height: 100%; background: var(--accent); transform-origin: left; animation: loading 1.2s ease-in-out infinite; }
@keyframes loading { 0% { transform: scaleX(0); } 60% { transform: scaleX(1); transform-origin: left; } 61% { transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; } }
.loading-screen p { margin: 0; color: var(--muted); font: 400 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.webgl-error, .noscript { position: fixed; z-index: 40; left: 20px; right: 20px; bottom: 20px; padding: 18px; border: 1px solid var(--accent); background: var(--panel); text-align: center; font-size: 13px; }

/* ---------- Планшет и телефон ---------- */
@media (max-width: 900px) {
  :root { --page-pad: 20px; }
  .site-header { top: 16px; }
  .brand-logo { width: 132px; }
  .scene-nav { display: none; }
  .scenes::after { content: ''; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgb(12 13 15 / 88%) 55%); z-index: -1; }
  .copy-block, .hero-block { top: auto; bottom: 64px; width: min(520px, calc(100vw - 40px)); transform: none; }
  .scene-copy.right .copy-block { right: auto; left: var(--page-pad); }
  .scene-copy h2 { font-size: clamp(30px, 7vw, 44px); }
  .body-copy, .lead { margin-top: 14px; font-size: 15px; line-height: 1.5; }
  .eyebrow { margin-bottom: 14px; font-size: 10px; }
  .hero-copy h1 { font-size: clamp(84px, 27vw, 150px); }
  .hero-copy .lead { margin-top: 18px; }
  .hero-facts { margin-top: 20px; }
  .scroll-hint { display: none; }
  .spec { margin-top: 18px; }
  .spec dl div { padding: 6px 0; }
  .spec dt { font-size: 13px; }
  .spec dd { display: none; }
  .scene-index { bottom: 18px; }
  .telemetry { right: var(--page-pad); top: 72px; width: 232px; margin-top: 0; padding: 8px; }
  .telemetry footer { display: none; }
  .tile { min-height: 58px; gap: 6px; padding: 8px 9px; }
  .tile > span { font-size: 11px; }
  .tile strong { font-size: 19px; }
  .map-copy .copy-block { top: auto; bottom: 150px; width: min(520px, calc(100vw - 40px)); }
  .map-copy .body-copy { display: none; }
  .map-panel { right: var(--page-pad); bottom: 50px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .map-day { display: none; }
  .map-legend { justify-content: flex-start; gap: 6px 16px; font-size: 12px; }
  .cta-layout { grid-template-columns: 1fr; align-content: end; gap: 26px; padding: 90px var(--page-pad) 70px; }
  .cta-main h2 { font-size: clamp(34px, 9vw, 56px); }
  .cta-link { margin-top: 22px; }
  .cta-contacts div { padding: 9px 0; }
  .cta-footer { right: var(--page-pad); }
  .cta-footer img { display: none; }
  .annotation-text { font-size: 9px; }
}

@media (max-width: 600px) {
  .contact-button { height: 36px; padding: 0 14px; font-size: 10px; }
  .motion-toggle { width: 36px; height: 36px; padding: 11px; }
  .hero-facts li:nth-child(3) { display: none; }
  .annotation.callout .annotation-text { font-size: 8px; letter-spacing: .04em; }
  .annotation.callout-cable { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint i, .loading-line span { animation: none; }
  .scene-nav a i, .scene-nav a span { transition: none; }
}
