/* DF Development — стили. Палитра снята с ролика: чёрная студия, тёплый белый костюм.
   Единственный цвет — хроматическая аберрация, как у надписи на экране телевизора.
   Вёрстка — как номер монохромного журнала: одна 12-колоночная сетка, ровный ритм разворотов. */

/* #region fonts — сгенерировано tools/fetch-fonts.mjs, не править руками */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/CormorantGaramond-italic-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/CormorantGaramond-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/CormorantGaramond-italic-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/CormorantGaramond-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/CormorantGaramond-roman-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/CormorantGaramond-roman-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/CormorantGaramond-roman-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/CormorantGaramond-roman-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../assets/fonts/CormorantGaramond-roman-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../assets/fonts/CormorantGaramond-roman-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/JetBrainsMono-roman-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/JetBrainsMono-roman-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/JetBrainsMono-roman-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/JetBrainsMono-roman-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* #endregion fonts */

:root {
  --bg: #0b0b0b;
  --bg-2: #101010;
  --bg-3: #151515;
  --fg: #ecebe7;
  --fg-2: #bab8b3;
  --muted: #8a8883;
  --dim: #807e79;
  --line: rgba(236, 235, 231, 0.12);
  --line-2: rgba(236, 235, 231, 0.24);
  --ca-r: #ff2d55;
  --ca-c: #19d3ff;

  --serif: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  /* лестница кеглей: заголовок героя / заголовки разделов / названия работ */
  --display: clamp(66px, 10.6vw, 192px);
  --h2: clamp(46px, 6.6vw, 112px);
  --item: clamp(30px, 3.6vw, 56px);
  --fs-body: 15px;
  --fs-small: 13px;
  --fs-label: 11px;
  --r: 8px;

  --pad: clamp(16px, 4vw, 56px);
  --gap: clamp(16px, 2vw, 32px);
  --maxw: 1440px;
  --header: 72px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ease-io: cubic-bezier(0.7, 0, 0.2, 1);
}
@media (max-width: 700px) {
  :root { --fs-body: 14px; --fs-label: 12px; --header: 60px; }
}

/* ---------- основа ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--fg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header);
  overscroll-behavior-x: none; /* горизонтальный жест не превращается в «назад» браузера */
}

body {
  margin: 0;
  font: 400 var(--fs-body)/1.65 var(--mono);
  font-variant-numeric: lining-nums; /* у Cormorant по умолчанию старостильные цифры: «1» похожа на «I» */
  background: var(--bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.js body.is-loading { overflow: hidden; }

img, svg, canvas { display: block; max-width: 100%; }
/* height: auto — иначе атрибут height="…" становится CSS-высотой и ломает aspect-ratio */
img { height: auto; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.wrap { width: min(100% - 2 * var(--pad), var(--maxw)); margin-inline: auto; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
/* фото уходит за правый край экрана: расстояние от .wrap до края — max(поле, (100vw − maxw) / 2) */
.bleed-r { margin-right: calc(-1 * max(var(--pad), (100vw - var(--maxw)) / 2)); }

/* ритм разворотов: стык двух разделов равен одному паддингу, а не двум */
.section { padding-block: clamp(96px, 13vw, 200px); position: relative; }
.section + .section { padding-top: 0; }
.interlude + .section { padding-top: clamp(72px, 9vw, 140px); }
.toc + .section { padding-top: clamp(72px, 9vw, 140px); }
main .section[id] { scroll-margin-top: clamp(32px, 4vw, 64px); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; left: var(--pad); top: 12px; z-index: 200;
  padding: 10px 16px; background: var(--fg); color: var(--bg);
  transform: translateY(-160%); transition: transform 0.3s var(--ease);
}
.skip:focus { transform: none; }

/* хроматическая аберрация — как у «DF Development» на кинескопе */
@keyframes ca {
  0%   { text-shadow: -0.045em 0 var(--ca-r), 0.045em 0 var(--ca-c); }
  33%  { text-shadow: 0.03em 0.01em var(--ca-r), -0.05em 0 var(--ca-c); }
  66%  { text-shadow: -0.02em -0.01em var(--ca-r), 0.02em 0.01em var(--ca-c); }
  100% { text-shadow: 0 0 transparent, 0 0 transparent; }
}
@media (hover: hover) {
  .ca:hover, a:hover > .ca, button:hover > .ca { animation: ca 0.42s steps(3) 1; }
}

/* ---------- типографика ---------- */

.label {
  display: flex; align-items: center;
  margin: 0 0 28px;
  font: 500 var(--fs-label)/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.label span { color: var(--fg); display: inline-flex; align-items: center; }
.label span::after {
  content: ''; width: 36px; height: 1px; margin: 0 14px;
  background: var(--line-2);
}

.h2 {
  margin: 0 0 28px;
  font: 500 var(--h2)/0.94 var(--serif);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.h2 em { font-weight: 400; text-shadow: -0.018em 0 rgba(255, 45, 85, 0.45), 0.018em 0 rgba(25, 211, 255, 0.4); }
.h2--xl { font-size: clamp(52px, 6.8vw, 100px); }
.h2 .label { margin-bottom: 20px; }
.h2__text { display: block; }
/* заголовок-ярлык: раздел открывается только номером и именем */
.h2--label { margin: 0 0 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.h2--label .label { margin: 0; }

/* заголовок разворота: ярлык внутри h2, справа строка-факт, ниже лид */
.section__head, .process__head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; align-items: end;
  margin-bottom: clamp(40px, 5vw, 72px);
  padding-top: 24px; border-top: 1px solid var(--line);
}
.section__head .h2, .process__head .h2 { grid-column: 1; margin: 0; }
.section__meta {
  grid-column: 2; margin: 0 0 0.35em;
  font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
.section__head .text { grid-column: 1 / -1; margin: 28px 0 0; }

.text {
  margin: 0 0 18px;
  max-width: 54ch;
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--fg-2);
  text-wrap: pretty;
}
.text--dim { color: var(--muted); }
.nw { white-space: nowrap; }

kbd {
  font: 500 0.9em var(--mono);
  padding: 1px 7px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: var(--fg);
}

/* ---------- заставка ---------- */

.boot {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-content: center; gap: 14px;
  background: #000;
  font: 500 var(--fs-label)/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-2);
  transition: opacity 0.5s ease 0.1s, visibility 0s linear 0.6s;
}
.no-js .boot, .is-ready .boot { opacity: 0; visibility: hidden; }

.boot__row { display: flex; justify-content: space-between; width: min(340px, 78vw); }
.boot__row--dim { color: var(--dim); }
.boot__count { color: var(--fg); font-variant-numeric: tabular-nums; }
.boot__bar { height: 1px; background: var(--line); overflow: hidden; }
.boot__bar i {
  display: block; height: 100%; background: var(--fg);
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  transition: transform 0.25s linear;
}

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

.top {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header);
  display: flex; align-items: center; gap: 36px;
  padding: 0 var(--pad);
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.5s var(--ease);
}
.top.is-solid { background: rgba(11, 11, 11, 0.98); border-color: var(--line); }
.top.is-hidden { transform: translateY(-100%); }
.top:focus-within { transform: none; } /* клавиатурный фокус в шапке — шапка на месте */

.brand { display: flex; align-items: baseline; gap: 12px; }
.brand__mark { font: 600 30px/1 var(--serif); letter-spacing: -0.01em; }
.brand__word {
  font: 500 10.5px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--fg-2);
}

.nav { display: flex; gap: 30px; margin-left: auto; }
.nav a, .top__cta, .motion-btn {
  font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
}
.nav a { color: var(--fg-2); padding: 8px 0; position: relative; transition: color 0.25s; }
.nav a small, .toc a small, .menu small { font-size: inherit; color: var(--muted); margin-right: 8px; transition: color 0.25s; }
.nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: 100% 50%;
  transition: transform 0.45s var(--ease);
}
.nav a:hover, .nav a[aria-current] { color: var(--fg); }
.nav a[aria-current] small { color: var(--fg); }
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); transform-origin: 0 50%; }

/* переключатель движения: зерно, марка, мерцание, параллакс и печать останавливаются */
.motion-btn {
  padding: 8px 0; background: none; border: 0; cursor: pointer; color: var(--fg-2);
  transition: color 0.25s;
}
.motion-btn:hover { color: var(--fg); }
.motion-btn::after { content: ': вкл'; color: var(--muted); }
html[data-motion='off'] .motion-btn::after { content: ': выкл'; }

.top__cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.top__cta:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.menu-btn {
  display: none; margin: 0 -12px 0 0;
  min-height: 44px; padding: 14px 12px; background: none; border: 0; cursor: pointer;
  font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
}

.menu {
  position: fixed; inset: 0; z-index: 45;
  display: flex; flex-direction: column;
  padding: calc(var(--header) + 24px) var(--pad) 40px;
  background: var(--bg);
  overflow-y: auto;
  opacity: 0; transition: opacity 0.35s ease;
}
.menu.is-open { opacity: 1; }
.menu[hidden] { display: none; }
.menu__place { margin: 0; color: var(--muted); }
.menu__place [data-clock] { color: var(--fg-2); font-variant-numeric: tabular-nums; }
/* пункты прижаты к низу, но на низком экране список начинается сверху и прокручивается */
.menu nav { display: grid; gap: 4px; width: 100%; margin-top: auto; padding-top: 24px; }
.menu nav a {
  display: flex; align-items: baseline; gap: 18px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
  font: 500 clamp(32px, 9vw, 56px)/1.05 var(--serif);
  font-size: min(clamp(32px, 9vw, 56px), 7svh);
}
.menu nav small { font: 500 var(--fs-label) var(--mono); letter-spacing: 0.14em; }
.menu__contacts {
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.menu__contacts p { width: 100%; margin: 0; font-size: var(--fs-small); color: var(--fg-2); user-select: text; -webkit-user-select: text; }
.menu__contacts .motion-btn { margin-left: auto; }

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

.hero {
  position: relative;
  height: 100vh; height: 100svh; min-height: 620px;
  overflow: hidden;
  isolation: isolate;
  background: #000;
}

/* pan-y: палец по герою листает страницу вертикально, а горизонтальный жест крутит голову */
.hero__stage { position: absolute; inset: 0; z-index: 0; touch-action: pan-y pinch-zoom; }
.hero__media {
  position: absolute; inset: -2.5%;
  transform: translate3d(calc(var(--mx, 0) * -1.2%), calc(var(--my, 0) * -0.9%), 0);
  will-change: transform;
}
.hero__poster, .hero__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.hero__poster { object-fit: cover; object-position: 50% 0; transition: opacity 0.6s ease; }
.hero__canvas { opacity: 0; }
.hero.has-canvas .hero__canvas { opacity: 1; }
.hero.has-canvas .hero__poster { opacity: 0; }

.hero__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px),
    linear-gradient(to bottom, rgba(11, 11, 11, 0.78) 0, rgba(11, 11, 11, 0.4) 70px, rgba(11, 11, 11, 0) 170px),
    linear-gradient(to top, var(--bg) 0%, rgba(11, 11, 11, 0.92) 12%, rgba(11, 11, 11, 0.55) 30%, rgba(11, 11, 11, 0) 56%),
    radial-gradient(130% 95% at 50% 28%, transparent 52%, rgba(0, 0, 0, 0.6) 100%);
}
.hero__shield { position: absolute; inset: 0; z-index: 1; }

/* включение кинескопа */
.js .hero__stage { opacity: 0; }
.is-ready .hero__stage { animation: crt-on 1.15s var(--ease) forwards; }
@keyframes crt-on {
  0%   { opacity: 1; transform: scale(0.18, 0.004); filter: brightness(5); }
  30%  { opacity: 1; transform: scale(1, 0.004); filter: brightness(4); }
  62%  { opacity: 1; transform: scale(1, 1); filter: brightness(1.7) contrast(1.2); }
  100% { opacity: 1; transform: none; filter: none; }
}

.hero__copy {
  position: absolute; z-index: 2;
  left: var(--pad); bottom: clamp(28px, 7vh, 72px);
  max-width: 62vw;
}
.eyebrow {
  margin: 0 0 20px;
  font: 500 12.5px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-2);
}
.hero__title {
  margin: 0;
  font: 500 var(--display)/0.86 var(--serif);
  letter-spacing: -0.025em;
}
.hero__title em {
  font-weight: 400;
  text-shadow: -0.018em 0 rgba(255, 45, 85, 0.55), 0.018em 0 rgba(25, 211, 255, 0.5);
}
/* строка режется clip-path с запасом снизу: у Cormorant хвосты «р», «у», «д» длиннее, чем line-height 0.86 */
.hero__title .line { display: block; padding: 0 0.08em 0.07em 0; clip-path: inset(0 -0.1em -0.3em 0); }
.hero__title .line > span { display: inline-block; }
.js .hero__title .line > span { transform: translateY(140%); transition: transform 1.2s var(--ease); }
.is-ready .hero__title .line > span { transform: none; }
.is-ready .hero__title .line:nth-child(1) > span { transition-delay: 0.55s; }
.is-ready .hero__title .line:nth-child(2) > span { transition-delay: 0.68s; }

.js .eyebrow, .js .hero__side, .js .hero__hud, .js .hero__scroll {
  opacity: 0; transition: opacity 1s ease 0.95s;
}
.js .hero__side { transition: opacity 0.7s ease 0.35s; } /* текст появляется вместе с заголовком */
.is-ready .eyebrow, .is-ready .hero__side, .is-ready .hero__hud, .is-ready .hero__scroll { opacity: 1; }

.hero__side {
  position: absolute; z-index: 2;
  right: var(--pad); bottom: clamp(28px, 7vh, 72px);
  width: min(360px, 28vw);
}
.hero__lead { margin: 0; font-size: var(--fs-small); line-height: 1.75; color: var(--fg-2); text-wrap: pretty; }
.hero__links {
  display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 18px 0 0;
  font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-2);
}
.hero__links a {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid transparent; transition: color 0.25s, border-color 0.25s;
}
.hero__links a:hover { color: var(--fg); border-color: var(--line-2); }
.arr--down { transform: rotate(90deg); }
.arr--left { transform: scaleX(-1); }
.hero__hint .arr { display: inline-block; width: 1em; height: 0.75em; vertical-align: -0.1em; }
.hero__hint {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 18px 0 0;
  font: 500 var(--fs-label)/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}
/* точка держится первой строки и когда подсказка переносится */
.hero__hint::before {
  content: ''; width: 6px; height: 6px; margin-top: calc(0.65em - 3px); border-radius: 50%; flex: none;
  background: var(--fg); animation: pulse 2.4s steps(8) infinite;
}
@keyframes pulse { 50% { opacity: 0.2; } }
.hint--touch, .hint--kbd { display: none; }
@media (hover: none) { .hint--mouse { display: none; } .hint--touch { display: inline; } }
@media (hover: hover) { html.kbd .hint--mouse { display: none; } html.kbd .hint--kbd { display: inline; } }

.hero__hud {
  position: absolute; z-index: 2;
  right: var(--pad); top: 50%; transform: translateY(-50%);
  width: 190px;
  --ruler-w: 190px;
  font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-2);
}
.hud__row { display: flex; justify-content: space-between; }
.hud__row b { font-weight: 500; color: var(--fg); font-variant-numeric: tabular-nums; }
.hud__row--dim, .hud__row--dim b { color: var(--muted); }
.hud__ruler {
  position: relative; height: 20px; margin: 12px 0;
  background:
    linear-gradient(var(--line-2), var(--line-2)) 50% 0 / 1px 100% no-repeat,
    repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px 10%) 0 100% / 100% 7px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) 0 100% / 100% 1px no-repeat;
}
/* бегунок двигается transform-ом: left заставлял бы пересчитывать раскладку на каждом кадре */
.hud__ruler i {
  position: absolute; bottom: 0; left: 0;
  width: 1px; height: 20px; background: var(--fg);
  transform: translateX(calc(var(--look, 0.5) * var(--ruler-w, 190px)));
}
.hud__ruler i::after {
  content: ''; position: absolute; left: -3px; top: -5px;
  border: 3.5px solid transparent; border-top-color: var(--fg);
}

.hero__scroll {
  position: absolute; z-index: 2; left: 50%; bottom: 22px;
  display: grid; justify-items: center; gap: 10px;
  transform: translateX(-50%);
  font: 500 10px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}
.hero__scroll i {
  width: 1px; height: 42px; overflow: hidden; position: relative;
  background: var(--line);
}
.hero__scroll i::after {
  content: ''; position: absolute; left: 0; top: 0; width: 1px; height: 100%;
  background: var(--fg); animation: drip 2.2s steps(14) 4;
}
@keyframes drip { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }
/* герой ушёл за экран — его мелкие анимации замирают; пошёл вверх — HUD гаснет, чтобы не проходить сквозь шапку */
.hero.is-asleep .hero__hint::before, .hero.is-asleep .hero__scroll i::after { animation-play-state: paused; }
.is-ready .hero.is-scrolled .hero__hud { opacity: 0; transition-delay: 0s; }

/* на ноутбуках до 1180 px шкала взгляда уходит в правый верхний угол, где её не задевает ни текст, ни телевизор */
@media (max-width: 1180px) and (min-aspect-ratio: 11/10) {
  .hero__hud { top: calc(var(--header) + 20px); transform: none; width: 170px; --ruler-w: 170px; }
}

/* системный курсор прячется только пока виден прицел */
.hero.has-reticle { cursor: none; }

/* узкие и вертикальные экраны: квадратный кадр сверху, текст под ним */
@media (max-aspect-ratio: 11/10), (max-width: 700px) {
  .hero {
    height: auto; min-height: 0;
    display: flex; flex-direction: column;
    padding-top: var(--header);
    background: var(--bg);
  }
  .hero__stage { position: relative; inset: auto; width: 100%; aspect-ratio: 1; flex: none; max-height: 72svh; }
  .hero__media { inset: 0; transform: none; }
  /* затемнение к низу — первым слоем, чтобы строки развёртки не проступали полосой на стыке с фоном */
  .hero__shade {
    background:
      linear-gradient(to top, var(--bg) 0%, rgba(11, 11, 11, 0.6) 16%, rgba(11, 11, 11, 0) 42%),
      repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px),
      linear-gradient(to bottom, rgba(11, 11, 11, 0.7) 0%, rgba(11, 11, 11, 0) 18%);
  }
  .hero__copy, .hero__side { position: relative; left: auto; right: auto; bottom: auto; max-width: none; width: auto; padding: 0 var(--pad); }
  .hero__copy { margin-top: -0.9em; font-size: clamp(66px, 16vw, 150px); }
  .hero__title { font-size: 1em; }
  .eyebrow { margin-bottom: 14px; font-size: 11.5px; }
  .hero__side { margin: 22px 0 28px; max-width: 520px; }
  .hero__hud {
    top: calc(var(--header) + min(100vw, 72svh) - 64px); right: var(--pad); bottom: auto; transform: none;
    width: 150px; --ruler-w: 150px;
  }
  .hero__scroll { display: none; }
}
@media (max-width: 700px) {
  .hero__hud { display: none; }
}
/* телефон лёжа: сцена не квадрат на всю ширину, а кадр 4:3, чтобы заголовок остался на первом экране */
@media (max-width: 700px) and (orientation: landscape) {
  .hero__stage { aspect-ratio: 4 / 3; max-height: none; }
}
@media (max-height: 520px) and (min-aspect-ratio: 11/10) and (min-width: 701px) {
  .hero { min-height: 0; }
  .hero__copy, .hero__side { bottom: 16px; }
}

/* прицел: над героем курсор становится точкой, на которую он смотрит */
.reticle {
  position: fixed; left: 0; top: 0; z-index: 80;
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(var(--x, -100px), var(--y, -100px), 0);
  transition: opacity 0.3s ease;
}
.reticle.is-on { opacity: 1; transition-duration: 0s; }
.reticle::before {
  content: ''; position: absolute; inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.85); border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  transition: transform 0.35s var(--ease);
}
.reticle.is-link::before { transform: scale(1.5); }
.reticle i { position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px; border-radius: 50%; background: #fff; }
.reticle i::before, .reticle i::after { content: ''; position: absolute; background: #fff; }
.reticle i::before { left: 1px; top: -15px; width: 1px; height: 8px; box-shadow: 0 25px 0 #fff; }
.reticle i::after { top: 1px; left: -15px; height: 1px; width: 8px; box-shadow: 25px 0 0 #fff; }
@media (hover: none), (pointer: coarse) { .reticle { display: none; } }

/* плёночное зерно поверх всего сайта: плитка 180 px, дрожит в пределах ±60 px — слой чуть больше экрана */
.grain {
  position: fixed; inset: -64px; z-index: 90;
  pointer-events: none;
  background: url(../assets/img/grain.png) 0 0 / 180px 180px;
  opacity: 0.075;
  animation: grain 0.9s steps(5) infinite;
}
@keyframes grain {
  0% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-50px, 30px, 0); }
  40% { transform: translate3d(36px, -44px, 0); }
  60% { transform: translate3d(-22px, 58px, 0); }
  80% { transform: translate3d(58px, 14px, 0); }
  100% { transform: translate3d(-36px, -22px, 0); }
}

/* ---------- полоса разделов под героем ---------- */

.toc { border-block: 1px solid var(--line); background: var(--bg); }
.toc__row {
  display: flex; gap: 28px; align-items: center; height: 48px;
  font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}
.toc a { position: relative; display: inline-flex; align-items: center; height: 48px; color: var(--fg-2); transition: color 0.25s; }
.toc a:hover, .toc a[aria-current] { color: var(--fg); }
.toc a[aria-current] small { color: var(--fg); }
.toc a[aria-current]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: currentColor; }
.toc__place { margin-left: auto; color: var(--muted); white-space: nowrap; }
.toc__place [data-clock] { color: var(--fg-2); font-variant-numeric: tabular-nums; }

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

.js .reveal { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal-clip { clip-path: inset(100% 0 0 0); transition: clip-path 1.3s var(--ease-io); }
.js .reveal-clip img { transform: scale(1.14); transition: transform 1.8s var(--ease); }
.js .reveal-clip.is-in { clip-path: inset(0 0 0 0); }
.js .reveal-clip.is-in img { transform: none; }

/* ---------- 01 · принцип ---------- */

.manifesto__grid { align-items: end; }
.manifesto__text {
  grid-column: 1 / 9;
  margin: 0;
  font: 400 clamp(30px, 3.9vw, 60px)/1.1 var(--serif);
  letter-spacing: -0.012em;
  text-wrap: pretty;
}
.manifesto__text .w { opacity: 0.42; transition: opacity 0.45s ease; }
.manifesto__text .w.on { opacity: 1; }
/* буквица: первое слово-«Я» в две строки (бокс чуть ниже двух строк, иначе третья тоже обтекает) */
.manifesto__text .w--cap { float: left; font: 500 2.6em/0.78 var(--serif); padding-right: 0.08em; margin-top: 0.03em; }
.manifesto__img { grid-column: 9 / -1; margin-block: 0; margin-left: 0; overflow: hidden; }
.manifesto__img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

.facts {
  list-style: none; margin: clamp(64px, 8vw, 120px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.facts li { padding: 30px 32px 0 0; }
.facts li + li { padding-left: 32px; border-left: 1px solid var(--line); }
.facts b { display: block; font: 500 clamp(52px, 5.4vw, 92px)/0.9 var(--serif); letter-spacing: -0.02em; }
.facts span { display: block; margin-top: 16px; max-width: 34ch; font-size: var(--fs-small); line-height: 1.7; color: var(--fg-2); }

/* ---------- пауза: полосы-фото ---------- */

.interlude { position: relative; margin: 0; height: clamp(440px, 92vh, 960px); overflow: hidden; }
.interlude__img { position: absolute; inset: -14% 0; transform: translate3d(0, var(--py, 0px), 0); }
.interlude__img.is-near { will-change: transform; }
.interlude__img img { width: 100%; height: 100%; object-fit: cover; object-position: 32% 50%; }
.interlude--shoulder .interlude__img img { object-position: 60% 50%; }
.interlude::before, .interlude::after { content: ''; position: absolute; left: 0; right: 0; z-index: 1; height: 22%; pointer-events: none; }
.interlude::before { top: 0; background: linear-gradient(var(--bg), transparent); }
.interlude::after { bottom: 0; background: linear-gradient(transparent, var(--bg)); }
.interlude__cap {
  position: absolute; z-index: 2; left: var(--pad); right: var(--pad); bottom: 34px;
  display: flex; justify-content: space-between; gap: 16px;
  font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-2);
}
.clock { color: var(--fg); font-variant-numeric: tabular-nums; }

/* ---------- 02 · живой код ---------- */

.code__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(36px, 5vw, 88px);
  align-items: start;
}
.code__copy { position: sticky; top: calc(var(--header) + 32px); }
.code__note { margin-top: 24px; }

.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 36px 0 0; border-top: 1px solid var(--line);
}
.stats div { padding: 18px 12px 0 0; display: flex; flex-direction: column; justify-content: flex-end; } /* цифры на одной линии при подписях в две строки */
.stats dt { font: 500 var(--fs-label)/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 8px 0 0; font: 500 clamp(34px, 3.2vw, 48px)/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }

.editor {
  background: #0d0d0d;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  font: 400 12.5px/1.7 var(--mono);
}
.editor__bar { position: relative; z-index: 1; display: flex; align-items: stretch; height: 56px; border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
/* верхняя строка кода уходит под бар мягко, а не срезается пополам */
.editor__bar::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 16px; background: linear-gradient(#0d0d0d, transparent); pointer-events: none; }
.editor__tab { display: flex; align-items: center; padding: 0 18px; border-right: 1px solid var(--line); }
.editor__tab.is-active { color: var(--fg); background: var(--bg-3); box-shadow: inset 0 -1px 0 var(--fg); }
.editor__lang { display: flex; align-items: center; padding: 0 18px; }
/* миниатюра головы: тот же кадр, что наверху, со шкалой взгляда */
.editor__mirror { margin-left: auto; display: flex; align-items: center; gap: 12px; padding: 0 14px; --ruler-w: 120px; }
.editor__mini { width: 96px; height: 54px; border: 1px solid var(--line-2); border-radius: 3px; background: #000; }
.editor__mirror .hud__ruler { width: 120px; margin: 0; }
.editor__body {
  position: relative; /* от него считается offsetTop строк при автопрокрутке */
  height: clamp(380px, 62vh, 600px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dim) transparent;
}
.editor__body:focus-visible { outline-offset: -4px; }
/* font: inherit — у <pre> свой системный моноширинный шрифт, а ширина «ch» должна быть от JetBrains Mono */
.editor__code { margin: 0; padding: 18px 0 28px; font: inherit; color: #c9c7c2; counter-reset: ln; min-width: max-content; }
.editor__code code { font: inherit; display: block; }

.ln { display: block; position: relative; padding: 0 28px 0 64px; white-space: pre; min-height: 1.7em; }
.ln::before {
  content: counter(ln); counter-increment: ln;
  position: absolute; left: 0; width: 42px; text-align: right;
  color: var(--dim); font-variant-numeric: tabular-nums;
}
.ln.is-cur { background: rgba(255, 255, 255, 0.035); }
.ln.is-cur::before { color: var(--fg-2); }
.ln.is-wait { clip-path: inset(0 100% 0 0); } /* ещё не напечатано: скрыто для глаз, но не для скринридера */
.ln.is-typing { clip-path: inset(0 calc(100% - 64px - var(--n, 0) * 1ch - 3px) 0 0); }
.ln.is-typing::after, .editor__code.is-done .ln:last-child::after {
  content: ''; position: absolute; top: 0.25em; left: calc(64px + var(--n, 0) * 1ch);
  width: 2px; height: 1.2em; background: var(--fg);
  animation: blink 1.05s steps(1) infinite;
}
.editor__code.is-done .ln:last-child::after { left: calc(64px + var(--len, 0) * 1ch); }
@keyframes blink { 50% { opacity: 0; } }

.t-com { color: var(--muted); }
.t-kw { color: #fff; font-weight: 500; }
.t-str { color: #ff9fb2; }
.t-num { color: #8fe6ff; }
.t-fn { color: #f2f1ed; text-decoration: underline; text-decoration-color: rgba(236, 235, 231, 0.22); text-underline-offset: 3px; }
.t-pun { color: #7c7a75; }

.editor__status {
  display: flex; gap: 22px; align-items: center;
  padding: 11px 18px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
}
.editor__status b { color: var(--fg); font-weight: 500; font-variant-numeric: tabular-nums; }
.editor__skip { color: var(--dim); }
.editor.is-done .editor__skip { display: none; }
.editor__pos { margin-left: auto; }

/* ---------- 03 · работы ---------- */

.works__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 4vw, 64px);
  align-items: start;
}
.work-list { list-style: none; margin: 0; padding: 0; overflow-anchor: none; }
.work { border-top: 1px solid var(--line); padding: clamp(28px, 3vw, 44px) 0 clamp(36px, 4vw, 56px); transition: opacity 0.35s ease; }
.work:last-child { border-bottom: 1px solid var(--line); }
.work__h { display: flex; align-items: baseline; gap: 20px; margin: 0; font: inherit; }
.work__n { font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.14em; color: var(--muted); font-variant-numeric: tabular-nums; }
.work__name {
  font: 500 var(--item)/1 var(--serif);
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
/* контурный глиф рисуется, когда строка входит в окно */
.work__glyph {
  width: 60px; height: 40px; margin-left: auto; flex: none; align-self: center;
  fill: none; stroke: var(--fg-2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1 1; stroke-dashoffset: 1;
}
.work.is-in .work__glyph { animation: draw 1.4s var(--ease) 0.2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.work__kind { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0 0; font-size: var(--fs-small); color: var(--fg-2); }
.work__tag {
  padding: 5px 8px; border-radius: 3px; background: var(--bg-3);
  font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
/* кадр внутри строки: на широком экране его показывает экран справа */
.work__shot { margin: 24px 0 0; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line-2); border-radius: var(--r); background: #0e0e0e; position: relative; }
.work__shot img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.06); }
.work__shot::after, .sheet__frame::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px);
}
.work__lead { margin: 24px 0 14px; max-width: 58ch; font-size: var(--fs-body); line-height: 1.75; color: var(--fg); text-wrap: pretty; }
.work__feats { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px 24px; font-size: var(--fs-small); line-height: 1.6; color: var(--fg-2); }
.work__feats li::before, .deliver li::before { content: '— '; color: var(--muted); }
.work__tail { margin: 0 0 18px; max-width: 58ch; font-size: var(--fs-small); line-height: 1.7; color: var(--muted); text-wrap: pretty; }
.chips { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 7px 10px; border-radius: 3px; background: var(--bg-3); font-size: var(--fs-label); line-height: 1; letter-spacing: 0.04em; color: var(--fg-2); }
.work__actions { margin: 0; }
.work__actions .btn { padding: 14px 20px; font-size: var(--fs-label); }

@media (hover: hover) and (pointer: fine) {
  .work-list:hover .work { opacity: 0.6; }
  .work-list:hover .work:hover { opacity: 1; }
}

/* экран справа: показывает проект, о котором читаете — открытый, под курсором или настроенный скроллом */
.sheet { position: sticky; top: calc(var(--header) + 32px); }
.sheet__frame {
  position: relative; aspect-ratio: 16 / 10;
  border: 1px solid var(--line-2); border-radius: var(--r); background: #0e0e0e; overflow: hidden;
  box-shadow: inset 0 0 48px rgba(0, 0, 0, 0.55);
}
.sheet__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.06);
  opacity: 0; transform: scale(1.03);
  transition: opacity 0.35s ease, transform 1.2s var(--ease);
}
.sheet__img.is-front { opacity: 1; transform: none; }
.sheet__cap {
  display: flex; gap: 12px; margin: 14px 0 0;
  font: 500 var(--fs-label)/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.sheet__name { color: var(--fg); }
.sheet__kind { margin-left: auto; text-align: right; }

@media (min-width: 1101px) {
  .js .work__shot { display: none; } /* без JS экрана справа нет — кадр остаётся в строке */
  .work__feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 04 · подход ---------- */

.process__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: start;
}
.process__head { grid-column: 6 / -1; grid-row: 1; margin-bottom: clamp(24px, 3vw, 40px); }
.process__img {
  grid-column: 1 / span 4; grid-row: 1 / span 3;
  position: sticky; top: calc(var(--header) + 24px);
  margin: 0; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--r);
}
.process__img img { width: 100%; height: 100%; object-fit: cover; }
/* бумага становится экраном: строки развёртки и виньетка проступают по мере чтения шагов */
.crt-veil {
  position: absolute; inset: 0; pointer-events: none;
  opacity: calc(var(--p, 0) * 0.85);
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.6) 100%);
}
.process__cap {
  position: absolute; left: 16px; right: 16px; bottom: 14px;
  display: flex; justify-content: space-between; gap: 8px;
  font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); text-shadow: 0 1px 2px #000, 0 0 6px #000;
}
.process__cap span { transition: color 0.4s ease; }
.process__cap span.is-on { color: var(--fg); }

.steps { grid-column: 6 / -1; grid-row: 2; list-style: none; margin: 0; padding: 0; }
.step {
  display: grid; grid-template-columns: 80px minmax(0, 1fr);
  border-top: 1px solid var(--line); padding: 24px 0 40px;
  transition: opacity 0.5s ease;
}
.steps.has-focus .step { opacity: 0.7; }
.steps.has-focus .step.is-focus { opacity: 1; }
.step__n { font: 500 clamp(30px, 3vw, 44px)/1 var(--serif); color: var(--muted); letter-spacing: 0; }
.step h3 { margin: 0 0 12px; font: 500 clamp(34px, 3.2vw, 50px)/1 var(--serif); letter-spacing: -0.01em; }
.step p { margin: 0; max-width: 44ch; font-size: var(--fs-body); line-height: 1.75; color: var(--fg-2); text-wrap: pretty; }

.deliver { grid-column: 6 / -1; grid-row: 3; border-top: 1px solid var(--line); padding-top: 24px; }
.deliver .label { margin-bottom: 18px; }
.deliver ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; font-size: var(--fs-small); line-height: 1.6; color: var(--fg-2); }

/* ---------- 05 · стек ---------- */

.stack .h2--label { margin-bottom: clamp(20px, 3vw, 40px); }
.marquee {
  overflow: hidden;
  padding: clamp(20px, 3vw, 40px) 0;
  margin-bottom: clamp(48px, 6vw, 96px);
  border-block: 1px solid var(--line);
}
.marquee__track {
  display: flex; width: max-content;
  font: 400 clamp(60px, 9vw, 156px)/1 var(--serif);
  letter-spacing: -0.02em; white-space: nowrap;
  animation: marquee 56s linear infinite;
}
.marquee__track span { padding-right: 0.42em; }
.marquee__track span.o { font-style: italic; color: transparent; -webkit-text-stroke: 1px var(--fg-2); }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }

.stack__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stack__col { padding: 28px 28px 0 0; }
.stack__col + .stack__col { padding-left: 28px; border-left: 1px solid var(--line); }
.stack__col:last-child { padding-right: 0; }
.stack__col h3 { margin: 0 0 18px; font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.stack__col ul { list-style: none; margin: 0; padding: 0; }
.stack__col li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
  font-size: var(--fs-body);
}
.stack__col li span { font-size: var(--fs-small); color: var(--muted); text-align: right; white-space: nowrap; }
.stack__note { margin: 28px 0 0; max-width: 70ch; }

/* ---------- 06 · связь ---------- */

.contact { overflow: hidden; }
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
  gap: clamp(24px, 4vw, 72px);
  align-items: center;
}
.tv { position: relative; container-type: inline-size; }
/* края кадра растворяются в фоне: пересечение двух градиентов, по горизонтали и по вертикали */
.tv__img {
  width: 100%; height: auto;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 18%, #000 82%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 16%, #000 76%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 18%, #000 82%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 16%, #000 76%, transparent 100%);
  mask-composite: intersect;
}
.tv__screen {
  position: absolute;
  left: 31.7%; top: 18.9%; width: 36.6%; height: 40.4%;
  display: flex; flex-direction: column;
  padding: 4% 5% 3.5%;
  border-radius: 9% / 11%;
  overflow: hidden;
  background: radial-gradient(ellipse 90% 80% at 50% 42%, rgba(24, 27, 27, 0.9), rgba(4, 5, 5, 0.97) 78%);
  box-shadow: inset 0 0 3cqw rgba(0, 0, 0, 0.95), inset 0 0 0.6cqw rgba(255, 255, 255, 0.07);
  /* кегль от ширины телевизора, но не мельче 11 px — на ноутбуке текст должен читаться */
  font: 400 13px/1.42 var(--mono);
  font-size: max(11px, 1.72cqw);
  color: #e6efec;
  text-shadow: 0 0 0.5cqw rgba(214, 255, 244, 0.38);
  cursor: text;
}
.tv__screen::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.32) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  animation: flicker 3.2s steps(1) infinite;
}
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: 0.86; } 48% { opacity: 1; } 91% { opacity: 0.92; } }
/* кольцо фокуса — только с клавиатуры: у текстового поля :focus-visible совпадает при любом фокусе,
   поэтому мышь и палец помечают телевизор классом is-pointer (ставит pointerdown, снимает Tab) */
.tv:not(.is-pointer) .tv__screen:has(.term__in:focus) { outline: 1px solid var(--fg); outline-offset: 3px; }
/* второй кинескоп включается, когда раздел входит в окно */
.js .tv__screen { opacity: 0; }
.tv.is-on .tv__screen { animation: crt-on 1.15s var(--ease) forwards; }
.tv.is-off .tv__screen > * { opacity: 0; }
.tv.is-off .tv__screen { animation: crt-off 0.5s var(--ease-io) forwards; }
@keyframes crt-off {
  0% { opacity: 1; filter: brightness(1); transform: none; }
  60% { opacity: 1; filter: brightness(3); transform: scale(1, 0.01); }
  100% { opacity: 1; filter: brightness(0); transform: scale(0, 0.01); }
}

/* верхняя строка уходит под стекло плавно, а не обрезается пополам */
.term {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 1.6em);
  mask-image: linear-gradient(to bottom, transparent 0, #000 1.6em);
  user-select: text; -webkit-user-select: text;
}
.term p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.term .dim { opacity: 0.65; }
.term .cmd::before { content: '> '; opacity: 0.55; }
.term a { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-color: rgba(230, 239, 236, 0.5); }
.term__form { display: flex; gap: 0.6em; flex: none; margin-top: 0.3em; }
.term__ps { opacity: 0.55; }
.term__in {
  flex: 1; min-width: 0; padding: 0; border: 0; outline: 0;
  background: none; color: inherit; font: inherit; text-shadow: inherit;
  caret-color: #e6efec;
}
.term__in::placeholder { color: rgba(230, 239, 236, 0.55); }
.term__in:disabled { opacity: 0; }

.section__head--bare { margin-bottom: 28px; }
.contact__links { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 18px; }
/* контакты текстом — их можно выделить и скопировать даже при включённой защите */
.contact__raw {
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  margin: 0 0 12px;
  font-size: var(--fs-small); letter-spacing: 0.02em; color: var(--fg);
  user-select: text; -webkit-user-select: text;
}
.contact__raw > span { display: inline-flex; align-items: center; }
.copy {
  margin-left: 10px; padding: 8px 10px;
  border: 1px solid var(--line-2); border-radius: 3px; background: none; cursor: pointer;
  color: var(--muted);
  font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  transition: color 0.25s, border-color 0.25s;
}
.copy:hover, .copy.is-done { color: var(--fg); border-color: var(--fg); }
.contact__note { margin: 0 0 12px; font-size: var(--fs-small); color: var(--muted); }
.contact__note:empty { display: none; }
.how__title { margin: 28px 0 0; padding-top: 22px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header) + 24px); }
.how { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line); }
.how li {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  font-size: var(--fs-small); line-height: 1.7; color: var(--fg-2); text-wrap: pretty;
}
.how__n { font: 500 var(--fs-label)/1.9 var(--mono); letter-spacing: 0.14em; color: var(--muted); }
.contact__hint { margin: 20px 0 0; }

.btn {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 19px 28px;
  border: 1px solid var(--fg); border-radius: 999px;
  background: var(--fg); color: var(--bg);
  font: 500 12px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.btn .arr { transition: transform 0.4s var(--ease); }
.btn:hover { background: transparent; color: var(--fg); }
.btn:hover .arr { transform: translateX(4px); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--fg); }
.btn:focus-visible { outline-offset: 4px; }

/* ---------- подвал ---------- */

.foot { position: relative; }
.foot__img { position: relative; height: clamp(340px, 74vh, 800px); overflow: hidden; }
.foot__img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; }
.foot__img::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 30%; z-index: 1;
  background: linear-gradient(var(--bg), transparent);
}
/* надпись — на тёмной левой стене, чтобы не пересекать световой проём по центру */
.foot__bye {
  position: absolute; z-index: 2; left: var(--pad); top: 13%;
  margin: 0; max-width: 42vw;
  font: 500 clamp(44px, 5.4vw, 92px)/0.95 var(--serif); letter-spacing: -0.02em;
  color: var(--fg);
}
.foot__bye em { font-weight: 400; text-shadow: -0.018em 0 rgba(255, 45, 85, 0.45), 0.018em 0 rgba(25, 211, 255, 0.4); }
.foot__weight { margin: 0; padding: 28px 0 0; font: 400 var(--fs-body)/1.6 var(--mono); color: var(--fg-2); }
.foot__row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 32px;
  margin-top: 24px; padding: 22px 0 40px; border-top: 1px solid var(--line);
  font: 500 var(--fs-label)/1.5 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}
.foot__row a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; margin: -14px 0; color: var(--fg); border-bottom: 1px solid var(--line-2); }
.foot__row .motion-btn { min-height: 44px; padding: 0; margin: -14px 0; color: var(--muted); }
.foot__row .motion-btn:hover { color: var(--fg); }

/* ---------- 404 ---------- */

.lost { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; padding: var(--pad); }
/* min-width: 0 — иначе лента разделов с nowrap растягивает колонку шире телефона */
.lost__box { width: min(100%, 1200px); min-width: 0; margin-inline: auto; }
.lost__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.lost__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 0; }
/* кинескоп без сигнала: тест-таблица под шевелящимися помехами */
.noscreen {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: 9% / 11%; background: #050505;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--line);
}
.noscreen__tp { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; }
.noscreen__snow {
  position: absolute; inset: -64px;
  background: url(../assets/img/grain.png) 0 0 / 180px 180px; opacity: 0.6;
  mix-blend-mode: screen; animation: grain 0.9s steps(5) infinite;
}
.noscreen::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.32) 0 1px, transparent 1px 3px);
}
.noscreen__cap {
  position: absolute; left: 50%; bottom: 10%; transform: translateX(-50%);
  font: 500 var(--fs-label)/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg);
  text-shadow: -0.045em 0 var(--ca-r), 0.045em 0 var(--ca-c);
}
.lost .toc { margin-top: 48px; }

/* ---------- мелочи ---------- */

/* шорткат font сбрасывает font-variant-numeric, а у Cormorant цифры по умолчанию старостильные:
   «1» читается как «I», «0» как «o». Возвращаем прописные цифры после всех font: … выше. */
.hero__title, .h2, .manifesto__text, .facts b, .stats dd, .work__name, .step h3, .step__n,
.marquee__track, .foot__bye, .menu a, .brand__mark { font-variant-numeric: lining-nums; }

/* стрелка рисуется SVG: символа «→» нет в подмножествах шрифтов */
.arr { width: 1.1em; height: 0.8em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* всё, что вне окна, замирает: марка, мерцание экрана, курсор редактора */
.is-asleep .marquee__track, .is-asleep .tv__screen::after, .is-asleep .ln::after { animation-play-state: paused; }

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

@media (max-width: 1100px) {
  .nav, .top .motion-btn { display: none; }
  .top__cta { margin-left: auto; }
  .menu-btn { display: block; }
  .toc__place { display: none; }
  .code__grid { grid-template-columns: minmax(0, 1fr); }
  .code__copy { position: static; }
  .works__grid { grid-template-columns: minmax(0, 1fr); }
  .sheet { display: none; }
  .work__shot { max-width: 760px; }
  .process__img { grid-column: 1 / span 5; }
  .stack__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack__col:nth-child(2) { padding-right: 0; }
  .stack__col:nth-child(3) { padding-left: 0; border-left: 0; }
  .contact__grid { grid-template-columns: minmax(0, 1fr); }
  .tv { max-width: 760px; margin-inline: auto; width: 100%; }
}

@media (max-width: 700px) {
  .top { gap: 16px; }
  .top__cta { width: 44px; height: 44px; padding: 0; justify-content: center; gap: 0; }
  .top__cta-text { display: none; }
  .top__cta .arr { width: 16px; height: 12px; }
  .menu-btn { margin-left: 0; }
  .brand__mark { font-size: 26px; }

  .section { padding-block: 64px; }
  .section + .section { padding-top: 0; }
  .interlude + .section, .toc + .section { padding-top: 48px; }
  .section__head, .process__head { grid-template-columns: minmax(0, 1fr); }
  .section__meta { grid-column: 1; margin: 12px 0 0; }
  .section__head .text { margin-top: 20px; }

  /* лента прокручивается вбок до самого края экрана; правый край тает, показывая, что пункты продолжаются */
  .toc {
    overflow-x: auto; scrollbar-width: none; scroll-padding-inline: var(--pad);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
  }
  .toc::-webkit-scrollbar { display: none; }
  .toc__row { width: max-content; min-width: 100%; margin-inline: 0; padding-inline: var(--pad) 56px; white-space: nowrap; gap: 16px; }

  .manifesto__text, .manifesto__img { grid-column: 1 / -1; }
  .manifesto__text .w--cap { font-size: 2.1em; }
  .manifesto__img { width: 62%; justify-self: end; margin-top: 24px; }
  .bleed-r { margin-right: calc(-1 * var(--pad)); }
  .facts { grid-template-columns: minmax(0, 1fr); margin-top: 56px; }
  .facts li, .facts li + li { padding: 26px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .facts li:last-child { border-bottom: 0; }

  .interlude { height: 60svh; }
  .interlude__img img { object-position: 42% 50%; }
  .interlude--shoulder .interlude__img img { object-position: 62% 50%; }
  .interlude__cap span:last-child { display: none; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div:nth-child(n + 3) { border-top: 1px solid var(--line); margin-top: 18px; }
  /* код прокручивается вбок; правый край тает, как у ленты разделов */
  .editor__body {
    height: auto; overflow-x: auto; overflow-y: hidden;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  }
  .editor { font-size: 11.5px; }
  .editor__bar { height: 52px; }
  .editor__mirror { gap: 8px; padding: 0 10px; --ruler-w: 72px; }
  .editor__mirror .hud__ruler { width: 72px; }
  .editor__mini { width: 72px; height: 40px; }
  .ln { padding-left: 48px; padding-right: 40px; }
  .ln::before { width: 32px; }
  .ln.is-typing { clip-path: inset(0 calc(100% - 48px - var(--n, 0) * 1ch - 3px) 0 0); }
  .ln.is-typing::after { left: calc(48px + var(--n, 0) * 1ch); }
  .editor__code.is-done .ln:last-child::after { left: calc(48px + var(--len, 0) * 1ch); }
  .hide-sm, .editor__skip { display: none; }

  .work__h { gap: 14px; }
  .work__glyph { width: 44px; height: 30px; }
  .work__shot { margin-top: 20px; }
  .chips li { font-size: 10px; padding: 5px 10px; }

  .process__grid { grid-template-columns: minmax(0, 1fr); }
  .process__head, .process__img, .steps, .deliver { grid-column: 1; grid-row: auto; position: static; }
  .process__img { width: 72%; margin-bottom: 28px; }
  .process__cap, .crt-veil { display: none; }
  .step { grid-template-columns: 56px minmax(0, 1fr); padding: 20px 0 28px; }
  .steps.has-focus .step { opacity: 1; }
  .deliver ul { grid-template-columns: minmax(0, 1fr); }

  .marquee { margin-bottom: 48px; }
  .stack__grid { grid-template-columns: minmax(0, 1fr); }
  .stack__col, .stack__col + .stack__col { padding: 24px 0 0; border-left: 0; }
  .stack__col ul { display: flex; flex-wrap: wrap; gap: 8px; }
  .stack__col li { display: inline-flex; gap: 6px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 3px; font-size: 12px; line-height: 1; }
  .stack__col li span { font-size: 11px; text-align: left; }
  .stack__col li span::before { content: '· '; }

  .tv { width: 172vw; max-width: none; margin-left: calc(50% - 86vw); }

  .foot__img { height: 78vw; }
  .foot__img::after {
    content: ''; position: absolute; inset: auto 0 0; height: 24%; z-index: 1; pointer-events: none;
    background: linear-gradient(transparent, var(--bg));
  }
  .foot__bye { position: static; max-width: none; padding: 8px var(--pad) 28px; font-size: clamp(42px, 12vw, 64px); }
  .foot__weight { padding-top: 0; }
  .foot__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; letter-spacing: 0.08em; }
  .foot__row a { grid-column: 2; grid-row: 1; justify-self: end; }
  .foot__row .motion-btn { justify-self: start; }

  .lost__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- движение: системная настройка и переключатель на сайте ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .grain, .marquee__track, .noscreen__snow { animation: none; }
  .js .hero__stage, .js .tv__screen { opacity: 1; }
  .interlude__img, .hero__media { transform: none !important; }
  .steps.has-focus .step { opacity: 1; }
}
html[data-motion='off'] { scroll-behavior: auto; }
html[data-motion='off'] *, html[data-motion='off'] *::before, html[data-motion='off'] *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
html[data-motion='off'] :where(.grain, .marquee__track, .noscreen__snow) { animation: none; }
html[data-motion='off'].js .hero__stage, html[data-motion='off'].js .tv__screen { opacity: 1; }
html[data-motion='off'] :where(.interlude__img, .hero__media) { transform: none !important; }
html[data-motion='off'] .steps.has-focus .step { opacity: 1; }

/* ---------- контрастный режим и печать ---------- */

@media (forced-colors: active) {
  .nav a::after, .toc a::after, .boot__bar i, .hud__ruler i, .hero__scroll i::after { background: CanvasText; forced-color-adjust: none; }
  .hud__ruler, .boot__bar { border-bottom: 1px solid CanvasText; }
  .hero__scroll i { border-left: 1px solid CanvasText; }
  .btn, .copy, .chips li, .work__tag { border: 1px solid ButtonText; }
  .reticle { display: none; }
  .hero.has-reticle { cursor: auto; }
}

@media print {
  .boot, .hero__canvas, .hero__hud, .hero__scroll, .hero__shade, .hero__hint, .reticle, .grain, .tv__screen, .sheet, .toc, .top, .menu,
  .motion-btn, .marquee, .interlude, .crt-veil, .process__cap, .copy, .editor__skip, .editor__mirror, .ln::after { display: none !important; }
  /* на бумаге палитра переворачивается: тёмные токены становятся тёмным текстом на белом */
  :root { --bg: #fff; --bg-2: #fff; --bg-3: #f1f1f1; --fg: #111; --fg-2: #333; --muted: #666; --dim: #777; --line: rgba(0, 0, 0, 0.2); --line-2: rgba(0, 0, 0, 0.4); }
  html, body { background: #fff; color: #111; }
  .hero { height: auto; min-height: 0; padding-top: 0; background: #fff; }
  .hero__stage { position: relative; inset: auto; width: 100%; aspect-ratio: 16 / 9; max-height: 60vh; opacity: 1 !important; animation: none !important; }
  .hero__media { inset: 0; transform: none !important; }
  .hero__copy, .hero__side { position: static; max-width: none; width: auto; padding: 0 var(--pad); margin: 24px 0 0; }
  .hero__poster, .work__shot, .reveal, .reveal-clip, .hero__title .line > span, .eyebrow, .hero__side { opacity: 1 !important; clip-path: none !important; transform: none !important; }
  .manifesto__text .w { opacity: 1; }
  .editor { background: #fff; }
  .editor__body { height: auto; overflow: visible; }
  .editor__code { color: #222; }
  .ln.is-wait, .ln.is-typing { clip-path: none; }
  .t-kw, .t-fn { color: #000; }
  .t-str, .t-num { color: #333; }
  .t-pun { color: #666; }
  .js .work__shot { display: block; }
  .work__shot img, .sheet__img { filter: grayscale(1); }
  .work__glyph { stroke-dashoffset: 0; }
  .btn { background: none; color: var(--fg); border-color: var(--fg); }
  .work__actions a::after { content: ' (' attr(href) ')'; }
  .steps.has-focus .step { opacity: 1; }
  .foot__img { display: none; }
  .foot__bye { position: static; max-width: none; padding: 24px var(--pad) 0; }
  .section { padding-block: 24px; }
}
