/* ARTEM ERZH WEB — основные стили */

/* ---------- Шрифты (локально, вариативные, облегчённые: tools/build_fonts.py) ---------- */
/* по одному файлу на семейство: базовая латиница, кириллица, ₽ и знаки из текстов сайта */
@font-face { font-family: 'Unbounded'; font-weight: 200 900; font-display: swap; src: url(../fonts/unbounded.woff2?v=7adbd9b963) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 100 900; font-display: swap; src: url(../fonts/inter.woff2?v=1948ea352b) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 100 800; font-display: swap; src: url(../fonts/jetbrains-mono.woff2?v=805092e2ed) format('woff2'); }

/* ---------- Токены ---------- */
:root {
  --bg: #060507;
  --bg-2: #0d0b0f;
  --line: rgba(255, 255, 255, .08);
  --text: #f2efe9;
  --muted: #a7a1a8;
  --orange: #ff7a1a;
  --orange-glow: rgba(255, 122, 26, .55);
  --tiffany: #0ABAB5;
  --tiffany-glow: rgba(10, 186, 181, .5);
  --red: #ff3b3b;
  --font-head: 'Unbounded', 'Inter', system-ui, sans-serif;
  --font-text: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-code: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --hdr-h: 64px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/1.55 var(--font-text);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html.is-loading, html.is-loading body { overflow: hidden; }
img, svg, canvas { display: block; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }

.container { width: min(1200px, 100%); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow {
  font: 600 12px/1 var(--font-code);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--tiffany);
  text-shadow: 0 0 18px var(--tiffany-glow);
}
.h2 {
  font: 700 clamp(28px, 4.2vw, 56px)/1.08 var(--font-head);
  letter-spacing: -.01em;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 0 22px;
  border-radius: 999px;
  font: 600 14px/1 var(--font-text);
  text-decoration: none;
  white-space: nowrap;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .3s;
}
.btn--cta {
  background: var(--orange);
  color: #160a02;
  box-shadow: 0 0 0 1px rgba(255, 160, 90, .6) inset, 0 0 24px var(--orange-glow);
}
.btn--cta:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255, 200, 150, .8) inset, 0 0 36px var(--orange-glow); }
.btn:focus-visible { outline: 2px solid var(--tiffany); outline-offset: 3px; }
.btn--line {
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px rgba(10, 186, 181, .7), 0 0 20px rgba(10, 186, 181, .2);
  white-space: normal; text-align: left;
}
.btn--line:hover { box-shadow: inset 0 0 0 1.5px var(--tiffany), 0 0 28px rgba(10, 186, 181, .4); transform: translateY(-1px); }
.btn--line span { color: var(--tiffany); }

/* ---------- Шапка ---------- */
.hdr {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--hdr-h);
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(to bottom, rgba(6, 5, 7, .78), rgba(6, 5, 7, 0));
  pointer-events: none;
}
.hdr > * { pointer-events: auto; }
/* Лого в шапке — капсула. Скрыта, пока пиксельное лого не прилетит из экрана ноутбука */
.hdr__logo {
  display: inline-flex; align-items: center;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(6, 5, 7, .72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 24px rgba(0, 0, 0, .35);
  opacity: 0; visibility: hidden;
}
.hdr__logo img { height: 14px; width: auto; filter: drop-shadow(0 0 6px rgba(255, 122, 26, .35)); }
.logo-flyer {
  position: fixed; left: 0; top: 0; z-index: 55;
  transform-origin: 0 0; pointer-events: none;
  overflow: visible; visibility: hidden;
  filter: drop-shadow(0 0 8px rgba(255, 122, 26, .55));
}
.logo-flyer .px-mark { fill: var(--orange); }
.logo-flyer .px-name { fill: #f2efe9; }
.logo-flyer .px-web { fill: var(--tiffany); }

/* ---------- Прелоадер ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .7s var(--ease), visibility .7s;
}
.preloader.is-done { opacity: 0; visibility: hidden; }
.preloader__inner { display: grid; justify-items: center; gap: clamp(22px, 3.2vw, 44px); width: clamp(300px, 46vw, 1100px); }
.preloader__logo { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 0 14px var(--orange-glow)); }
.preloader__logo rect { opacity: 0; transition: opacity .15s; }
.preloader__logo rect.on { opacity: 1; }
.preloader__logo .px-mark { fill: var(--orange); }
.preloader__logo .px-name { fill: #f2efe9; }
.preloader__logo .px-web { fill: var(--tiffany); }
.preloader__bar { width: 46%; height: clamp(2px, .3vw, 4px); background: var(--line); overflow: hidden; border-radius: 4px; }
.preloader__bar i {
  display: block; height: 100%; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--orange), var(--tiffany));
  box-shadow: 0 0 12px var(--orange-glow);
  transition: transform .2s linear;
}
.preloader__pct { font: 500 clamp(13px, 1.25vw, 22px)/1 var(--font-code); letter-spacing: .2em; color: var(--muted); }
@media (max-width: 640px) { .preloader__inner { width: 80vw; } }

/* ---------- Фильм (sticky-сцена) ---------- */
.film { position: relative; /* высота задаётся из JS: (TOTAL + 1) × 100svh */ }
.film__stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  background: var(--bg);
}
.film__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.film__screens { position: absolute; inset: 0; pointer-events: none; }
.screen {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0;
  visibility: hidden;
  overflow: hidden;
  will-change: transform;
  backface-visibility: hidden;
}
.film__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 50%, rgba(6, 5, 7, .55), rgba(6, 5, 7, 0) 70%),
    linear-gradient(to bottom, rgba(6, 5, 7, .5), rgba(6, 5, 7, 0) 30%, rgba(6, 5, 7, 0) 70%, rgba(6, 5, 7, .6));
}
.film__texts { position: absolute; inset: 0; pointer-events: none; }
.film__texts > * { pointer-events: auto; }

/* Главный экран */
.hero {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px;
  padding: calc(var(--hdr-h) + 24px) var(--gutter) 48px;
  text-align: center;
}
.hero__title {
  max-width: 15ch;
  font: 800 clamp(34px, 6.2vw, 92px)/1.02 var(--font-head);
  letter-spacing: -.02em;
  text-shadow: 0 0 40px rgba(255, 122, 26, .25);
}
.hero__sub { max-width: 44ch; font-size: clamp(15px, 1.5vw, 19px); color: #d9d4dc; }
.hero__hint {
  margin-top: 18px;
  font: 500 12px/1 var(--font-code); letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted);
}
.hero__hint span { display: inline-block; color: var(--orange); animation: nudge 1.8s var(--ease) infinite paused; }
.film:not([data-seg]) .hero__hint span, .film[data-seg="aIn"] .hero__hint span { animation-play-state: running; }
@keyframes nudge { 50% { transform: translateY(5px); } }

/* Разбивка заголовков на слова (js/split) */
.w { display: inline-block; white-space: nowrap; }

/* ---------- Обычные секции ---------- */
.footer { padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer__row { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ---------- Мобильные ---------- */
@media (max-width: 640px) {
  :root { --hdr-h: 56px; }
  .hdr__logo { padding: 8px 12px; }
  .hdr__logo img { height: 10px; }
  .btn--cta { min-height: 38px; padding: 0 16px; font-size: 13px; }
}
@media (max-width: 360px) {
  .hdr__logo { padding: 7px 10px; }
  .hdr__logo img { height: 8px; }
}

/* ---------- Отладка (?debug) ---------- */
.debug .screen { outline: 2px solid #39ff6a; background: rgba(57, 255, 106, .08); }
.debug .screen::after {
  content: attr(data-screen);
  position: absolute; left: 12px; top: 10px;
  font: 600 28px/1 var(--font-code); color: #39ff6a;
}
.debug-hud {
  position: fixed; left: 12px; bottom: 12px; z-index: 60;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(0, 0, 0, .7); color: #39ff6a;
  font: 12px/1.4 var(--font-code); white-space: pre;
  pointer-events: none;
}

/* ---------- prefers-reduced-motion: без анимаций ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.reduced *, .reduced *::before, .reduced *::after { animation: none !important; transition: none !important; }
