/* ===========================================================
   mtmd.dev — dark technical identity
   Display: Space Grotesk Bold · Body: Inter · Meta/code: DejaVu Sans Mono
   Single committed theme: every colour painted explicitly.
   =========================================================== */

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk-Bold.woff2") format("woff2"),
       url("fonts/SpaceGrotesk-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk-Regular.woff2") format("woff2"),
       url("fonts/SpaceGrotesk-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter Site";
  src: url("fonts/Inter-Regular.woff2") format("woff2"),
       url("fonts/Inter-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
/* Без реального жирного начертания браузер размазывает контур 400-го вбок —
   на тёмном фоне это читается как дефект отрисовки, особенно на «Creo App». */
@font-face {
  font-family: "Inter Site";
  src: url("fonts/Inter-Bold.woff2") format("woff2"),
       url("fonts/Inter-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Mono Site";
  src: url("fonts/DejaVuSansMono.woff2") format("woff2"),
       url("fonts/DejaVuSansMono.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  /* Без этого Safari рисует почти белую полосу при оттягивании страницы,
     а Firefox — светлые системные скроллбары и подсветку поиска. */
  color-scheme: dark;

  --ground: #090b0e;
  --panel: #0f1318;
  --panel-2: #131820;
  --line: #1e242d;
  --line-soft: #171c24;

  --fg: #e6eaf0;
  --fg-body: #c3cad4;
  --fg-muted: #939cA8;
  /* Было #626c79 = 3.50:1 на --panel: ниже нормы 4.5:1, а этим цветом
     набраны реквизиты компании, которые сверяет ревьюер. #838e9b = 5.05:1. */
  --fg-faint: #838e9b;

  --accent: #dfa14a;
  --accent-hot: #f0b45f;
  --accent-soft: rgba(223, 161, 74, 0.13);
  --wire: #3c4756;

  --display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --body: "Inter Site", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "Mono Site", ui-monospace, SFMono-Regular, Menlo, monospace;

  --maxw: 1120px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Липкая шапка иначе накрывает заголовок секции, на которую ведёт якорь. */
  scroll-padding-top: 84px;
}

@media (max-width: 780px) {
  html { scroll-padding-top: 72px; }
}

/* ---------- scrollbar ----------
   Дорожка повторяет мотив инженерной сетки с остальных панелей, ползунок
   несёт тонкую акцентную обводку и уходит в золото при захвате.
   Firefox поддерживает только два цвета — там задаём ближайший эквивалент. */

html {
  scrollbar-gutter: stable;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.022) 0 1px,
      transparent 1px 8px
    ),
    var(--ground);
  border-left: 1px solid var(--line-soft);
}

::-webkit-scrollbar-track:horizontal {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.022) 0 1px,
      transparent 1px 8px
    ),
    var(--ground);
  border-left: 0;
  border-top: 1px solid var(--line-soft);
}

::-webkit-scrollbar-thumb {
  min-height: 48px;
  border: 3px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #2f3845, #212832) padding-box,
    linear-gradient(180deg, rgba(223, 161, 74, 0.35), rgba(223, 161, 74, 0.10)) border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, #3d4756, #2b333f) padding-box,
    linear-gradient(180deg, rgba(223, 161, 74, 0.65), rgba(223, 161, 74, 0.25)) border-box;
}

::-webkit-scrollbar-thumb:active {
  background:
    linear-gradient(180deg, var(--accent-hot), var(--accent)) padding-box,
    linear-gradient(180deg, var(--accent-hot), var(--accent)) border-box;
  box-shadow: 0 0 12px rgba(223, 161, 74, 0.4);
}

::-webkit-scrollbar-corner { background: var(--ground); }

/* Firefox: двухцветный API, берём средний тон ползунка */
@supports (scrollbar-color: auto) {
  html {
    scrollbar-width: thin;
    scrollbar-color: #333c4a var(--ground);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    /* Без ограничения повторов бесконечная анимация не останавливается, а
       прокручивается тысячи раз в секунду — то есть мигает ровно там, где
       человек просил покоя. */
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  /* Эти две бесконечные анимации гасим явно, а не полагаемся на длительность. */
  .ledger .hd .dot::after,
  .sc-link .line::before { animation: none !important; }

  /* Подсветка под курсором позиционируется скриптом, а скрипт при запрете
     движения не запускается — без этого 460px пятно зависало бы в углу. */
  .hero-cursor { display: none !important; }

  /* Исключение: для этих элементов движение — не украшение, а само содержимое
     (смена иконок логотипа, демо переходов). Глушить его нечем не заменишь. */
  /* Демо-страница переходов — там движение и есть содержимое. Логотип сюда
     больше не входит: он aria-hidden и ничего не сообщает, так что при
     запрете движения замирает на первой иконке. */
  .mk svg, .mk svg *,
  .mk-real svg, .mk-real svg * {
    transition-duration: var(--t, 700ms) !important;
    animation-duration: 1.1s !important;
    animation-iteration-count: infinite !important;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--fg-body);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #10130f; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hot); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 14, 0.86);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;

  /* Шапка живёт на собственном слое: без этого снимок backdrop-filter
     пересобирается вместе со всей страницей и на мобильном отстаёт от
     прокрутки на пару кадров — край шапки визуально уползает вверх. */
  transform: translateZ(0);
  will-change: transform;

  /* Плотная полоса, дорисованная над шапкой: перекрывает и отставший
     снимок, и проскальзывание при схлопывании адресной строки браузера. */
  box-shadow: 0 -14px 0 0 var(--ground);
}

/* На мобильном размытие либо отсутствует, либо запаздывает — там фон
   должен держать сам по себе, без опоры на backdrop-filter. */
@media (max-width: 780px) {
  /* Полностью непрозрачно: остаточные 3% всё равно давали заметный
     просвет контента у нижней кромки при прокрутке. */
  .site-header {
    background: var(--ground);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: rgba(9, 11, 14, 0.97); }
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 66px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--fg);
}

.brand svg { display: block; }

/* Логотип: три иконки в стопке, перекрёстное затухание по кругу. */
.brand-mark {
  position: relative;
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--accent);
}

/* Переключение ведёт JS (класс .is-on), а не CSS-анимация: так смена иконок
   не глохнет при prefers-reduced-motion и не зависит от старта анимаций. */
/* Эффект «Quarter turn»: иконка въезжает четвертью оборота, уменьшенная вдвое. */
.brand-mark svg {
  position: absolute;
  inset: 0;
  width: 22px;
  height: 22px;
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(.2, .8, .2, 1);
}

.brand-mark svg.is-on {
  opacity: 1;
  transform: none;
}

/* Если JS не отработал — показываем первую иконку статично. */
.brand-mark:not([data-live]) svg:first-child { opacity: 1; transform: none; }

.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.01em;
}

.nav a { color: var(--fg-muted); text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--accent); }

/* на узких экранах меню — одна прокручиваемая строка, а не три ряда */
@media (max-width: 780px) {
  .site-header .wrap { min-height: 56px; gap: 12px; }
  .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 18px;
    font-size: 12.5px;
    width: 100%;
    padding-bottom: 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* Скроллбар скрыт ради вида, поэтому границу прокрутки показываем
       затуханием у правого края — иначе не видно, что «support» есть. */
    mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent);
  }
  .nav::-webkit-scrollbar { display: none; }
}

/* ---------- type ---------- */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  color: var(--fg);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  text-wrap: balance;
}

h1 { font-size: clamp(38px, 6.2vw, 66px); }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
h3 { font-size: 19px; letter-spacing: -0.02em; line-height: 1.25; }

p { margin: 0 0 18px; }

.lead {
  font-size: clamp(17px, 1.9vw, 20px);
  color: var(--fg-muted);
  max-width: 64ch;
  line-height: 1.6;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 13.5px;
  /* Разрядку слегка убираем: на большем кегле прежние 0.14em растягивали
     надпись сильнее, чем нужно, и она начинала спорить с заголовком. */
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 20px;
}

.eyebrow.dim { color: var(--fg-faint); }

section { padding: 84px 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 0;
  border-top: 0;
  overflow: hidden;
}

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-top: 0;
  padding: 0;

  /* Три слоя с blur 70-90px лежат прямо под липкой шапкой. contain: paint
     запирает их отрисовку внутри секции, чтобы они не попадали в пересчёт
     фона шапки на каждый кадр прокрутки. */
  contain: paint;
}

.hero .wrap {
  position: relative;
  z-index: 6;
  padding-top: clamp(62px, 7.5vw, 104px);
  padding-bottom: clamp(58px, 6.5vw, 90px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(28px, 4.5vw, 60px);
  align-items: center;
}

@media (max-width: 940px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 34px; }
}

/* ---------- фоновые слои первого экрана ---------- */

.hero-lyr { position: absolute; inset: 0; pointer-events: none; }

.hero-lyr.vig {
  z-index: 4;
  box-shadow: inset 0 0 210px 44px rgba(0, 0, 0, 0.58), inset 0 -70px 100px -70px rgba(0, 0, 0, 0.92);
}

.hero-lyr.grain {
  z-index: 5;
  inset: -40%;
  opacity: 0.2;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.5'/></svg>");
}

.hero-lyr.rays {
  z-index: 1;
  background: repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.016) 0 1px, transparent 1px 34px);
  mask-image: linear-gradient(90deg, #000 8%, transparent 66%);
}

/* приборные засечки по углам */
.hero-lyr.marks { z-index: 5; }
.hero-lyr.marks i { position: absolute; width: 12px; height: 12px; border: 0 solid rgba(223, 161, 74, 0.42); opacity: 0; animation: hero-mark 0.5s ease forwards; }
.hero-lyr.marks i:nth-child(1) { left: 14px;  top: 14px;    border-left-width: 1px; border-top-width: 1px; animation-delay: 0.70s; }
.hero-lyr.marks i:nth-child(2) { right: 14px; top: 14px;    border-right-width: 1px; border-top-width: 1px; animation-delay: 0.78s; }
.hero-lyr.marks i:nth-child(3) { left: 14px;  bottom: 14px; border-left-width: 1px; border-bottom-width: 1px; animation-delay: 0.86s; }
.hero-lyr.marks i:nth-child(4) { right: 14px; bottom: 14px; border-right-width: 1px; border-bottom-width: 1px; animation-delay: 0.94s; }
@keyframes hero-mark { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .hero-lyr.marks { display: none; } }

/* два дрейфующих источника: тёплый слева, холодный справа */
.hero-glow { position: absolute; z-index: 1; border-radius: 50%; pointer-events: none; will-change: transform; }
.hero-glow.a {
  width: 640px; height: 520px; left: -8%; top: -26%; filter: blur(84px);
  background: radial-gradient(circle, rgba(223, 161, 74, 0.34), transparent 66%);
  animation: hero-drift-a 26s ease-in-out infinite;
}
.hero-glow.b {
  width: 560px; height: 460px; right: -6%; bottom: -30%; filter: blur(90px);
  background: radial-gradient(circle, rgba(74, 111, 223, 0.26), transparent 66%);
  animation: hero-drift-b 33s ease-in-out infinite;
}
@keyframes hero-drift-a { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(70px, 46px) scale(1.12); } }
@keyframes hero-drift-b { 0%, 100% { transform: translate(0, 0) scale(1.04); } 50% { transform: translate(-54px, -38px) scale(0.94); } }

/* мягкое пятно света под курсором */
.hero-cursor {
  position: absolute; z-index: 2; width: 460px; height: 460px; border-radius: 50%;
  filter: blur(70px); background: radial-gradient(circle, rgba(223, 161, 74, 0.13), transparent 66%);
  transform: translate(-50%, -50%); opacity: 0; transition: opacity 0.5s ease; pointer-events: none;
}
/* Только для мыши: на тач-устройствах :hover залипает до следующего касания,
   а позиционирует пятно скрипт, который на тач не запускается — без этого
   условия пятно повисает в углу героя и не двигается. */
@media (hover: hover) and (pointer: fine) {
  .hero:hover .hero-cursor { opacity: 1; }
}

/* ---------- текст первого экрана ---------- */

.eyebrow-dash { display: inline-flex; align-items: center; gap: 12px; color: var(--fg-muted); letter-spacing: 0.26em; }
.eyebrow-dash i { width: 0; height: 1px; background: var(--accent); flex: none; box-shadow: 0 0 10px rgba(223, 161, 74, 0.8); animation: hero-dash 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s forwards; }
@keyframes hero-dash { to { width: 26px; } }

.hero-title {
  font-size: clamp(38px, 5.6vw, 74px);
  line-height: 1;
  /* Оптический трекинг обратно пропорционален кеглю; значение в em росло вместе
     с ним, то есть ровно наоборот. Переводим в абсолютную величину. */
  letter-spacing: clamp(-2.7px, -0.36vw, -1.1px);
  margin: 0 0 22px;
  max-width: 14ch;
  text-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.hero-title .ln {
  display: block;
  overflow: hidden;
  /* У Space Grotesk descent 292/1000, при line-height 1 хвост «p» уходит за
     строчный бокс и обрезается маской. Возвращаем ему место. */
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}
.hero-title .ln > span { display: block; transform: translateY(110%); animation: hero-line 0.82s cubic-bezier(0.16, 0.84, 0.28, 1) forwards; }
.hero-title .ln:nth-child(1) > span { animation-delay: 0.10s; }
.hero-title .ln:nth-child(2) > span { animation-delay: 0.19s; }
.hero-title .ln:nth-child(3) > span { animation-delay: 0.28s; }
@keyframes hero-line { to { transform: translateY(0); } }

.hero-lead { max-width: 46ch; font-size: clamp(15px, 1.3vw, 16.5px); line-height: 1.62; margin: 0; }
.hero-lead strong { color: var(--fg); }
.hero-lead .w { display: inline-block; opacity: 0; transform: translateY(8px); animation: hero-word 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@keyframes hero-word { to { opacity: 1; transform: none; } }

/* подпись-марка на линейке */
.hero-sig {
  position: relative; display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
  margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line);
}
.hero-sig::before {
  content: ""; position: absolute; left: 0; top: -1px; width: 0; height: 1px;
  background: var(--accent); box-shadow: 0 0 12px rgba(223, 161, 74, 0.7);
  animation: hero-rule 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.66s forwards;
}
@keyframes hero-rule { to { width: 132px; } }
.hero-sig .wm {
  font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.6vw, 34px);
  /* Контурный знак требует не отрицательного, а слегка положительного трекинга:
     обводка съедает просветы между буквами. */
  letter-spacing: 0.005em; color: transparent; -webkit-text-stroke: 1px rgba(223, 161, 74, 0.62);
  white-space: nowrap; filter: drop-shadow(0 0 20px rgba(223, 161, 74, 0.18));
  transition: -webkit-text-stroke-color 0.35s ease, filter 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hero-sig .wm i { font-style: normal; -webkit-text-stroke-color: rgba(230, 234, 240, 0.2); }
.hero-sig:hover .wm { -webkit-text-stroke-color: rgba(240, 180, 95, 0.95); filter: drop-shadow(0 0 26px rgba(223, 161, 74, 0.45)); transform: translateY(-1px); }
.hero-sig small { font-family: var(--mono); font-size: 11px; letter-spacing: 0.07em; color: var(--fg-faint); }

/* ---------- панель-леджер ---------- */

.hero-art { position: relative; z-index: 6; perspective: 1200px; }

@property --tilt-x { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@property --tilt-y { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

.ledger {
  position: relative;
  /* Граница прозрачна: сквозь неё видно нижний слой фона — бегущее по периметру
     коническое кольцо. Как ::before с inset:-1px оно целиком попадало в
     border-область и вырезалось overflow: hidden, то есть не рисовалось никогда. */
  border: 1px solid transparent;
  border-radius: 6px;
  overflow: hidden;

  /* Порядок важен: первый слой лежит СВЕРХУ. Непрозрачная заливка по padding-box
     закрывает кольцо внутри панели, оставляя видимой только кромку. */
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.035), transparent 40%) padding-box,
    linear-gradient(180deg, #11161e, #0a0e13) padding-box,
    conic-gradient(from var(--hero-ang), rgba(30, 36, 45, 1) 0deg, rgba(223, 161, 74, 0.75) 40deg, rgba(30, 36, 45, 1) 110deg, rgba(30, 36, 45, 1) 360deg) border-box;

  /* Направление света задаём внутренними тенями, а не цветом граней —
     цветные грани перекрыли бы кольцо. Плюс контактный ярус тени под панелью. */
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 10px 24px -12px rgba(0, 0, 0, 0.85),
    0 46px 92px -46px rgba(0, 0, 0, 1),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55);

  transform: rotateY(var(--tilt-x)) rotateX(var(--tilt-y));
  transition: --tilt-x 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), --tilt-y 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  opacity: 0;
  animation: hero-panel 0.9s cubic-bezier(0.16, 0.84, 0.28, 1) 0.3s forwards;
}
/* Появление больше НЕ трогает transform: заполняющая анимация (fill: forwards)
   живёт в origin анимаций и перебивает инлайн-стиль, из-за чего наклон от курсора
   не применялся вообще. Движение переехало на независимые translate/rotate. */
@keyframes hero-panel {
  from { opacity: 0; translate: 0 26px; rotate: x 6deg; }
  to   { opacity: 1; translate: 0 0;    rotate: x 0deg; }
}

/* Кромка обходит периметр за счёт анимации самого угла градиента. */
@property --hero-ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.ledger { animation-composition: replace; }
.ledger > * { position: relative; z-index: 1; }

/* панель едва дышит, пока её не трогают */
.ledger { animation: hero-panel 0.9s cubic-bezier(0.16, 0.84, 0.28, 1) 0.3s forwards, hero-edge 9s linear infinite; }
.ledger.idle { animation: hero-panel 0.9s cubic-bezier(0.16, 0.84, 0.28, 1) 0.3s forwards, hero-edge 9s linear infinite, hero-float 7s ease-in-out 1.4s infinite; }
@keyframes hero-edge { to { --hero-ang: 360deg; } }
@keyframes hero-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

.ledger .hd {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 13px 16px;
  border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent);
}
/* Была зелёная пульсирующая точка — конвенция «сервис жив», хотя ничего
   не измеряется. Осталась акцентная метка: маркер списка, а не индикатор. */
.ledger .hd .dot { position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; opacity: 0.85; }
@keyframes hero-ping { 0% { transform: scale(0.7); opacity: 0.9; } 70%, 100% { transform: scale(2.4); opacity: 0; } }
.ledger .hd .cap { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-faint); }
.ledger .hd .tick { margin-left: auto; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; color: var(--fg-muted); white-space: nowrap; transition: opacity 0.26s ease; }

/* Ниже ~600px «CURRENTLY…» и бегущая подпись вместе не помещаются, а панель
   с overflow: hidden просто срезала вторую без всякого признака. */
@media (max-width: 600px) {
  .ledger .hd .cap { display: none; }
  .ledger .hd .tick { margin-left: 0; white-space: normal; }
}
.ledger .hd .tick em { font-style: normal; color: var(--accent); }

/* сканирующий луч */
.ledger .scan {
  position: absolute; left: 0; right: 0; top: 0; height: 120px; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(223, 161, 74, 0.035) 55%, rgba(223, 161, 74, 0.085) 78%, transparent);
  /* plus-lighter складывает свет с поверхностью, а не подменяет её цвет —
     иначе это оранжевый прямоугольник, ползущий по карточке. */
  mix-blend-mode: plus-lighter;
  animation: hero-scan 6.5s cubic-bezier(0.5, 0, 0.5, 1) 1.4s infinite;
}
@keyframes hero-scan { 0% { transform: translateY(-130px); opacity: 0; } 12% { opacity: 1; } 78% { opacity: 1; } 100% { transform: translateY(520px); opacity: 0; } }
.ledger:hover .scan { animation-play-state: paused; }

.ledger .bd { position: relative; padding: 8px 16px 14px; margin: 0; }
.ledger .bd dt, .ledger .bd dd { margin: 0; }

.ledger .row {
  position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 12px 0 12px 18px; border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateX(16px);
  animation: hero-row 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  transition: padding-left 0.28s ease, background 0.28s ease;
}
.ledger .row:last-child { border-bottom: 0; }
@keyframes hero-row { to { opacity: 1; transform: none; } }
.ledger .row:nth-child(1) { animation-delay: 0.58s; }
.ledger .row:nth-child(2) { animation-delay: 0.66s; }
.ledger .row:nth-child(3) { animation-delay: 0.74s; }
.ledger .row:nth-child(4) { animation-delay: 0.82s; }
.ledger .row:nth-child(5) { animation-delay: 0.90s; }
.ledger .row:nth-child(6) { animation-delay: 0.98s; }

.ledger .row::before {
  content: ""; position: absolute; left: 0; top: 18px; width: 0; height: 1px; background: var(--accent);
  animation: hero-tick 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; animation-delay: inherit;
  transition: width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.28s ease;
}
@keyframes hero-tick { to { width: 7px; } }
.ledger .row:hover { padding-left: 26px; background: linear-gradient(90deg, rgba(223, 161, 74, 0.07), transparent 62%); }
.ledger .row:hover::before { width: 16px; box-shadow: 0 0 10px rgba(223, 161, 74, 0.8); }
.ledger .row .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-faint); transition: color 0.28s ease; }
.ledger .row:hover .k { color: var(--fg-muted); }
.ledger .row .v { font-size: 14px; color: var(--fg); text-align: right; transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.28s ease; }
.ledger .row:hover .v { transform: translateX(-3px); }
.ledger .row .v.on { color: var(--accent); }

/* Движение здесь декоративное — при запрете показываем финальные состояния. */
@media (prefers-reduced-motion: reduce) {
  .hero-title .ln > span,
  .hero-lead .w,
  .hero-lyr.marks i,
  .ledger,
  .ledger .row {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .eyebrow-dash i { width: 26px; animation: none; }
  .hero-sig::before { width: 132px; animation: none; }
  .ledger .scan { display: none; }
  .ledger .row::before { width: 7px; animation: none; }
  .hero-glow, .ledger.idle { animation: none !important; }
  .ledger { translate: none !important; rotate: none !important; }
}

/* ---------- stack list ---------- */

.stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin-top: 44px;
  background: var(--line);
  border: 1px solid var(--line);
}

.stack-item {
  background: var(--panel);
  padding: 28px 26px 30px;
}

.stack-item .idx {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 14px;
}

.stack-item h3 { margin-bottom: 10px; }

.stack-item p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 15.5px;
  line-height: 1.6;
}

/* Четыре карточки — ровная сетка 2×2, без осиротевшей ячейки. */
@media (min-width: 720px) {
  .stack { grid-template-columns: 1fr 1fr; }
}

/* Вариант с призрачными номерами: карточки разделены зазором, а не хайрлайном,
   номер уходит в фон и даёт масштаб, не добавляя контента. */
.stack-ghost {
  gap: 18px;
  background: none;
  border: 0;
}

.stack-ghost .stack-item {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 34px 30px;
}

.stack-ghost .ghost-num {
  position: absolute;
  top: -22px;
  right: 6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 128px;
  line-height: 1;
  color: #ffffff;
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
}

.stack-ghost .idx { margin-bottom: 16px; }
.stack-ghost h3 { position: relative; font-size: 23px; }
.stack-ghost p { position: relative; line-height: 1.62; }

/* ---------- principles ---------- */

.principles { margin-top: 44px; border-top: 1px solid var(--line); }

.principle {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.principle h3 { margin: 0; }

.principle p { margin: 0; color: var(--fg-muted); max-width: 62ch; }

@media (max-width: 760px) {
  .principle { grid-template-columns: 1fr; gap: 10px; }
}

/* ---------- timeline ---------- */

.timeline { margin-top: 44px; border-left: 1px solid var(--line); padding-left: 28px; }

.tl-item { position: relative; padding-bottom: 30px; }

.tl-item::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 9px;
  width: 9px;
  height: 9px;
  background: var(--accent);
}

.tl-item time {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent);
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 6px;
}

.tl-item p { margin: 0; color: var(--fg-muted); max-width: 62ch; }

/* ---------- details table ---------- */

.details {
  margin-top: 40px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.details dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(190px, 280px) 1fr;
}

.details dt,
.details dd {
  margin: 0;
  padding: 15px 22px;
  border-top: 1px solid var(--line-soft);
  font-size: 15.5px;
}

.details dt {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-faint);
  padding-top: 18px;
}

.details dd { color: var(--fg); }

.details dl > dt:first-child,
.details dl > dt:first-child + dd { border-top: 0; }

@media (max-width: 640px) {
  .details dl { grid-template-columns: 1fr; }
  .details dt { border-top: 1px solid var(--line-soft); padding-bottom: 2px; }
  .details dd { border-top: 0; padding-top: 4px; }
}


/* ---------- input → output ---------- */

.io {
  display: grid;
  grid-template-columns: minmax(210px, 250px) auto minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  margin-top: 48px;
}

.io-in { margin: 0; }

.io-in img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 18px 18px 4px 4px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.io-in figcaption,
.io-cap {
  padding: 14px 2px 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-muted);
  border: 0;
  font-family: var(--body);
  letter-spacing: 0;
}

.io-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 10px;
}

.io-arrow {
  margin-top: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--fg-faint);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.io-arrow svg { width: 60px; height: 24px; }

.slides {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.slides::-webkit-scrollbar { height: 6px; }
.slides::-webkit-scrollbar-track { background: transparent; }
.slides::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; border: none; }

.slides img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* grid-элементы по умолчанию имеют min-width:auto — прокручиваемая лента
   слайдов раздвигала колонку и тянула горизонтальный скролл всей страницы */
.io > *, .io-out { min-width: 0; }
.slides { max-width: 100%; }

@media (max-width: 900px) {
  .io { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .io-in { max-width: 240px; }
  .io-arrow { flex-direction: row; margin-top: 0; }
  .io-arrow svg { transform: rotate(90deg); width: 40px; }
  .slides { grid-auto-columns: minmax(128px, 1fr); }
}

/* ---------- app screenshots ---------- */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px;
  margin-top: 44px;
}

.shot { margin: 0; border: 0; background: none; }

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.shot figcaption {
  border: 0;
  padding: 16px 2px 0;
  font-family: var(--body);
  font-size: 14.5px;
  letter-spacing: 0;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* ---------- notes list ---------- */

.note-list { margin-top: 44px; border-top: 1px solid var(--line); }

.note-item {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 28px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.note-item time {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  padding-top: 4px;
}

.note-item h3 { margin: 0 0 7px; }
.note-item h3 a { color: var(--fg); text-decoration: none; }
.note-item h3 a:hover { color: var(--accent); }
.note-item p { margin: 0; color: var(--fg-muted); font-size: 15.5px; max-width: 62ch; }

@media (max-width: 640px) {
  .note-item { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- prose ---------- */

.prose { padding: 64px 0 88px; max-width: 68ch; }
.prose h2 { margin-top: 52px; font-size: clamp(23px, 2.6vw, 28px); }
.prose h3 { margin-top: 32px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 18px; }
.prose li { margin-bottom: 9px; }
.prose strong { color: var(--fg); font-weight: 600; }

.note-head { margin-bottom: 40px; }

.note-head .meta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 20px;
}

.tag { color: var(--accent); }

.prose pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--fg);
}

.prose code { font-family: var(--mono); font-size: 0.9em; }

.prose p > code,
.prose li > code {
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 1px 5px;
  color: var(--fg);
}

.prose blockquote {
  margin: 30px 0;
  padding: 2px 0 2px 22px;
  border-left: 2px solid var(--accent);
  color: var(--fg);
  font-size: 18px;
}

/* figures / diagrams */

figure {
  margin: 40px 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

figure svg { display: block; width: 100%; height: auto; }

figcaption {
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
}

.diag-label { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; }

.back-link {
  display: inline-block;
  margin-top: 52px;
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 46px 0;
  font-size: 14px;
  color: var(--fg-faint);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.site-footer a { color: var(--fg-muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

.footer-legal { max-width: 46ch; line-height: 1.7; }

.footer-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12.5px;
}

/* ---------- product showcase (вариант V5: настоящий экран + веер вывода) ---------- */

.showcase {
  position: relative;
  overflow: hidden;
  margin-top: 44px;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 90% at 16% 0%, rgba(223, 161, 74, 0.16), transparent 62%),
    radial-gradient(ellipse 90% 70% at 100% 100%, rgba(96, 132, 190, 0.10), transparent 64%),
    linear-gradient(180deg, #10151b 0%, #0b0e13 100%);
  padding: 36px 36px 40px;
}

/* инженерная сетка на фоне, погашенная к краям */
.showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 30%, #000 30%, transparent 78%);
}

.showcase > * { position: relative; }

.showcase .live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.02);
}

.showcase .live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64b478;
  box-shadow: 0 0 0 3px rgba(100, 180, 120, 0.16);
}

.showcase-row {
  display: grid;
  grid-template-columns: 250px 104px minmax(0, 1fr);
  gap: 0 26px;
  align-items: center;
  margin-top: 26px;
}

/* корпус телефона */
.device {
  position: relative;
  width: 250px;
  border-radius: 30px;
  padding: 8px;
  background: linear-gradient(160deg, #333c48, #171c23 42%, #0d1116);
  box-shadow: 0 34px 70px -28px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.device .screen {
  position: relative;
  border-radius: 23px;
  overflow: hidden;
  background: #eef2fa;
}

.device .screen img { display: block; width: 100%; height: auto; }

/* Стрелка между вводом и выводом: это ключевое утверждение блока —
   «одна фраза превращается в готовый пост за шесть секунд», поэтому она
   набрана акцентом и подписана, а не нарисована волоском. */
.sc-link { display: grid; justify-items: center; gap: 12px; }

.sc-link .line {
  position: relative;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(223, 161, 74, 0.15), var(--accent));
  box-shadow: 0 0 14px rgba(223, 161, 74, 0.45);
}

.sc-link .line::after {
  content: "";
  position: absolute;
  right: -3px;
  top: -5px;
  border-left: 12px solid var(--accent);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  filter: drop-shadow(0 0 6px rgba(223, 161, 74, 0.6));
}

/* бегущий блик — показывает направление даже на статичном скриншоте */
.sc-link .line::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 34%;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #ffd694, transparent);
  animation: sc-pulse 2.6s ease-in-out infinite;
}

@keyframes sc-pulse {
  0%        { transform: translateX(-40%); opacity: 0; }
  30%, 70%  { opacity: 1; }
  100%      { transform: translateX(220%); opacity: 0; }
}

.sc-link .t {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--accent);
  white-space: nowrap;
  text-shadow: 0 0 18px rgba(223, 161, 74, 0.35);
}

.sc-link .t small {
  display: block;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  text-shadow: none;
  margin-top: 2px;
}

/* веер слайдов */
.fan { position: relative; height: 386px; }

.fan img {
  position: absolute;
  top: 0;
  width: 186px;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  box-shadow: 0 26px 54px -22px rgba(0, 0, 0, 0.95);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease;
}

.fan img:nth-child(1) { left: 0;   top: 30px; transform: rotate(-8deg); z-index: 1; }
.fan img:nth-child(2) { left: 24%; top: 8px;  transform: rotate(-3deg); z-index: 2; }
.fan img:nth-child(3) { left: 48%; top: 8px;  transform: rotate(3deg);  z-index: 3; }
.fan img:nth-child(4) { left: 72%; top: 30px; transform: rotate(8deg);  z-index: 4; }

/* наведение поднимает конкретный слайд, а не всю колоду */
.fan img:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.fan img:hover, .fan img:focus-visible {
  z-index: 9;
  box-shadow: 0 34px 66px -20px rgba(0, 0, 0, 1), 0 0 0 1px rgba(223, 161, 74, 0.5);
}

.fan img:nth-child(1):hover,
.fan img:nth-child(1):focus-visible { transform: rotate(-8deg) translateY(-18px) scale(1.06); }
.fan img:nth-child(2):hover,
.fan img:nth-child(2):focus-visible { transform: rotate(-3deg) translateY(-18px) scale(1.06); }
.fan img:nth-child(3):hover { transform: rotate(3deg)  translateY(-18px) scale(1.06); }
.fan img:nth-child(4):hover { transform: rotate(8deg)  translateY(-18px) scale(1.06); }

/* мягкое «дно», чтобы колода не висела в пустоте */
.fan::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 6px;
  height: 34px;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(0, 0, 0, 0.55), transparent 72%);
  filter: blur(6px);
  pointer-events: none;
}

.sc-cap { margin: 12px 0 0; font-size: 13px; color: var(--fg-faint); line-height: 1.55; }

.sc-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 22px; }
.sc-meta .metric { display: flex; align-items: baseline; gap: 8px; }
.sc-meta .n { font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--fg); }
.sc-meta .u { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-faint); }
.sc-meta .sep { width: 1px; height: 22px; background: var(--line); }

@media (max-width: 900px) {
  .showcase { padding: 26px 20px 30px; }
  .showcase-row { grid-template-columns: 1fr; gap: 28px; }
  .sc-link { display: none; }
  .device { width: 100%; max-width: 260px; margin: 0 auto; }
  .fan { height: 240px; }
  .fan img { width: 132px; }
}

/* ---------- скролл-моушн ---------- */

/* Блок ждёт своей очереди только если скрипт его пометил: без JS и при
   prefers-reduced-motion атрибут не появляется и контент виден сразу. */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.66s cubic-bezier(0.2, 0.8, 0.2, 1) calc(var(--reveal-i, 0) * 70ms),
    transform 0.66s cubic-bezier(0.2, 0.8, 0.2, 1) calc(var(--reveal-i, 0) * 70ms);
}

[data-reveal="in"] {
  opacity: 1;
  transform: none;
}

/* Полоса прогресса живёт в нижней кромке шапки: не занимает высоту,
   не сдвигает раскладку, читается как продолжение той же линии. */
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 100%;
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(223, 161, 74, 0.35), var(--accent));
  box-shadow: 0 0 10px rgba(223, 161, 74, 0.5);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .scroll-progress { display: none; }
}
