@import url("./fonts.css");

:root {
  --bg: #000;
  --bg2: #000;
  --panel: #161616;
  --panel2: #1b1b1b;
  --line: #2a2a2a;
  --line2: #1d1d1d;
  --text: #ededed;
  --muted: #8c8c8c;
  --muted2: #606060;
  --dim: #c6c6c6;
  /* монохромная палитра: «акцент» — тёмно-серый/чёрный (имена переменных
     исторические, оставлены чтобы не трогать все использования) */
  --red: #2e2e2e;
  --red2: #111111;
  --green: #20d7a0;
  --amber: #f5a623;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Archivo", system-ui, sans-serif;
  --exp: "Archivo Expanded", "Archivo", sans-serif;
  --max: 1560px;
}

* { box-sizing: border-box; }
/* скрыть системный скроллбар по всему сайту (прокрутка сохраняется) */
html { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
* { scrollbar-width: none; -ms-overflow-style: none; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #000;
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
  overflow-x: hidden;
}
::selection { background: var(--red); color: #fff; }
a { color: inherit; text-decoration: none; }
input, button, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }
/* запрет drag-«призрака» у ссылок/картинок/лого/кнопок/модели (Chrome/Safari);
   Firefox добирается глобальным dragstart-обработчиком в app.js. Выделение
   текста не трогаем. */
a, img, .btn, .logo, model-viewer, .cat-card, .cat-media { -webkit-user-drag: none; user-drag: none; }

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }
@keyframes ringpulse { 0%{transform:scale(.7);opacity:.55} 100%{transform:scale(2.1);opacity:0} }
@keyframes marquee { from{transform:translateX(0)} to{transform:translateX(-50%)} }
@keyframes spin { to { transform: rotate(360deg); } }

/* Плавные переходы между страницами (SPA-подобно) — там, где браузер
   поддерживает View Transitions; иначе обычная навигация без вреда. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .5s; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }

/* Мягкое появление контента на страницах (каталог, документы). База без
   opacity:0 — при reduced-motion (анимация off) элемент просто виден. */
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.rise-in { animation: rise-in .6s cubic-bezier(.2, .7, .2, 1) both; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px, 4vw, 56px); }
.mono { font-family: var(--mono); }
.exp { font-family: var(--exp); }

.section { padding: clamp(72px, 9vw, 140px) 0; }
/* полноэкранные секции (главная): контент по центру экрана */
.vh { min-height: 118vh; display: flex; flex-direction: column; justify-content: center; }
/* без width:100% флекс-колонка + margin:0 auto у .wrap сжимают контент в узкую колонку */
.vh > .wrap { width: 100%; }
@media (max-height: 700px) { .vh { min-height: auto; } }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--red); display: inline-block; }
.h-section {
  font-family: var(--exp);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.04;
  letter-spacing: -.01em;
  margin: 0 0 16px;
}
.lead { color: var(--muted); font-size: clamp(15px, 1.4vw, 17px); line-height: 1.6; max-width: 60ch; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border: 1px solid var(--line); background: var(--panel);
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: var(--dim);
}
.dotlive { position: relative; display: inline-flex; width: 8px; height: 8px; }
.dotlive::before { content:""; position:absolute; inset:0; border-radius:50%; background: #8a8a8a; }
.dotlive::after { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; padding: 13px 22px; cursor: pointer; border: 1px solid transparent;
  transition: background .35s ease, color .35s ease, border-color .35s ease,
              transform .3s ease, box-shadow .35s ease; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: #141414; color: #fff; }
.btn-primary:hover { background: #333; color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--red); color: var(--red2); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-alarm { background: #141414; color: #fff; }
.btn-alarm:hover { background: #333; color: #fff; }

.card { background: var(--panel); border: 1px solid var(--line); transition: border-color .25s, transform .2s; }
.card:hover { border-color: var(--red); }

.field { display: block; margin-bottom: 16px; }
.field > label { display:block; font-family: var(--mono); font-size: 10.5px; letter-spacing:.16em; text-transform:uppercase; color: var(--muted); margin-bottom: 8px; }
.input, .textarea, .select {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  padding: 12px 14px; font-size: 15px; outline: none; transition: border-color .2s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--red); }
.textarea { resize: vertical; min-height: 96px; }
.err { color: var(--amber); font-family: var(--mono); font-size: 11px; margin-top: 6px; }
.notice { padding: 12px 14px; border: 1px solid; font-family: var(--mono); font-size: 12px; margin-bottom: 16px; }
.notice-err { border-color: var(--amber); color: var(--amber); background: rgba(245,166,35,.07); }
.notice-ok { border-color: var(--green); color: var(--green); background: rgba(32,215,160,.07); }

.chip {
  display:inline-flex; align-items:center; gap:7px; padding:7px 12px; cursor:pointer;
  font-family: var(--mono); font-size: 11px; letter-spacing:.08em;
  border:1px solid var(--line); background: var(--bg2); color: var(--muted);
  transition: all .18s;
}
.chip:hover { border-color: var(--muted); color: var(--dim); }
.chip[data-on="true"] { border-color: var(--red); color: var(--red); background: rgba(0,0,0,.08); }

.badge { display:inline-flex; align-items:center; gap:7px; font-family:var(--mono); font-size:11px; letter-spacing:.1em; text-transform:uppercase; padding:5px 10px; border:1px solid var(--line); }
.badge::before { content:""; width:7px; height:7px; border-radius:50%; background: currentColor; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align:left; font-family:var(--mono); font-size:10.5px; letter-spacing:.14em; text-transform:uppercase; color:var(--muted2); padding:12px 14px; border-bottom:1px solid var(--line); }
.table td { padding: 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.table tr:hover td { background: var(--panel2); }

.grid { display: grid; gap: 18px; }
.muted { color: var(--muted); }
.spin { animation: spin .8s linear infinite; }
hr.div { border:none; border-top:1px solid var(--line); margin: 0; }

.ulink { color: var(--muted); transition: color .2s; }
.ulink:hover { color: var(--text); }

/* header */
.site-header { position: sticky; top: 0; z-index: 80; background: rgba(10,10,10,0.86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line2); }
.site-header .bar { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo .mark { position: relative; width: 26px; height: 26px; }
.logo .mark i { position: absolute; }
.logo .mark .o { inset: 0; border: 1.5px solid var(--text); }
.logo .mark .r { inset: 6px; border: 1.5px solid var(--red); }
.logo .mark .c { left: 50%; top: 50%; width: 3px; height: 3px; background: var(--red); transform: translate(-50%,-50%); }
.desk-nav { display: flex; align-items: center; gap: clamp(16px,2.2vw,30px); }
.desk-nav a { font-family: var(--mono); font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase; padding: 5px 0; transition: color .3s ease; }
.h-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.cart-link, .acct-link, .login-link { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; transition: background .35s ease, border-color .35s ease, color .35s ease, transform .3s ease, box-shadow .35s ease; }
.cart-link { background: var(--panel); color: var(--dim); position: relative; }
.cart-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: var(--bg); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.alarm-btn { background: #141414; border-color: #141414; color: #fff; }
.alarm-btn:hover { background: #333; border-color: #333; color: #fff; }
/* Узкие экраны: та же шапка без бургера — .bar переносится на две строки
   (лого + кнопки сверху, меню строкой ниже на всю ширину). */
@media (max-width: 920px) {
  /* !important: паддинги бара перебивают правила .is-showroom/.light-page,
     а размер подписи логотипа — её инлайновый стиль из app.js */
  .site-header .bar { flex-wrap: wrap; height: auto; padding-top: 12px !important; padding-bottom: 12px !important; gap: 8px 10px; }
  .site-header .logo .mono { font-size: 7.5px !important; letter-spacing: .16em !important; }
  /* строка 1 — только лого; строка 2 — меню и «Войти»/«Заявка» ОДНОЙ линией:
     контейнеры распущены (display: contents), все шесть ссылок — соседи в
     общем флексе бара и делят одну строку с равными промежутками */
  .site-header .logo { width: 100%; }
  .site-header .bar { justify-content: space-between; }
  .desk-nav, .h-actions { display: contents; }
  .desk-nav a { font-size: 10.5px; letter-spacing: .1em; padding: 3px 0; }
  /* «Войти» и «Заявка» на узких экранах — не кнопки, а обычные ссылки, как
     пункты меню (минимализм: рамки и заливка загромождали шапку).
     !important перебивает залитые/рамочные варианты .is-showroom/.light-page */
  .acct-link, .login-link, .site-header a.alarm-btn {
    padding: 3px 0 !important;
    background: none !important;
    border: none !important;
    font-size: 10.5px;
    letter-spacing: .1em;
  }
  .is-showroom .acct-link, .is-showroom .site-header a.alarm-btn,
  .dark-page .acct-link, .dark-page .site-header a.alarm-btn { color: #8f8f8f !important; }
  .is-showroom .acct-link:hover, .is-showroom .site-header a.alarm-btn:hover,
  .dark-page .acct-link:hover, .dark-page .site-header a.alarm-btn:hover { color: #d8d8d8 !important; }
  .light-page .acct-link, .light-page .site-header a.alarm-btn { color: #555 !important; }
  .light-page .acct-link:hover, .light-page .site-header a.alarm-btn:hover { color: #a6a6a6 !important; }
}
/* совсем узкие экраны: шесть ссылок в одну строку — мельче и плотнее */
@media (max-width: 430px) {
  .desk-nav a, .acct-link, .site-header a.alarm-btn { font-size: 9.5px !important; letter-spacing: .05em !important; }
}

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg2); }
.site-footer .cols { display: grid; gap: 40px; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); }
.site-footer .ft-title { font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; color: var(--muted2); margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

/* cart qty */
.qtybox { display: inline-flex; align-items: center; border: 1px solid var(--line); }
.qtybtn { width: 34px; height: 34px; background: var(--bg2); border: none; color: var(--text); font-size: 18px; cursor: pointer; }
.qtybtn:hover { background: var(--panel2); color: var(--red); }
.qtynum { min-width: 30px; text-align: center; font-size: 14px; font-family: var(--mono); }
.rmbtn { background: none; border: none; color: var(--muted2); font-size: 14px; cursor: pointer; padding: 6px; }
.rmbtn:hover { color: var(--red); }

/* admin */
.admin { min-height: 100vh; display: grid; grid-template-columns: auto 1fr; }
.admin-aside { width: 234px; border-right: 1px solid var(--line); background: var(--bg2); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 0; }
.admin-link { padding: 11px 12px; font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em; color: var(--dim); border-left: 2px solid transparent; cursor: pointer; background: none; text-align: left; }
.admin-link:hover, .admin-link.active { background: var(--panel); color: var(--text); border-left-color: var(--red); }
.admin-main { min-width: 0; padding: clamp(24px,3vw,44px); }
@media (max-width: 760px) {
  .admin { grid-template-columns: 1fr; }
  .admin-aside { position: static; width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .admin-aside nav { flex-direction: row !important; flex-wrap: wrap; }
}

.hidden { display: none !important; }

/* modal (демо-режим и т.п.) */
.modal-ov { position: fixed; inset: 0; z-index: 9998; background: rgba(20, 20, 20, .55); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: mfade .25s ease; }
@keyframes mfade { from { opacity: 0; } to { opacity: 1; } }
.modal { position: relative; width: 100%; max-width: 500px; background: #fff; border: 1px solid rgba(0, 0, 0, .1); padding: clamp(26px, 3vw, 40px); animation: mrise .3s cubic-bezier(.2,.7,.2,1); }
@keyframes mrise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal .m-tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: .24em; color: var(--red); display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.modal h3 { font-family: var(--exp); font-weight: 800; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.1; margin: 0 0 14px; color: #141414; }
.modal p { color: #555; font-size: 14.5px; line-height: 1.65; margin: 0 0 24px; }
/* кнопка в поп-апе всегда чёрная с белым текстом (поп-ап светлый на любой
   странице; тройной селектор перебивает светлую кнопку тёмной витрины) */
.modal .btn-primary, .is-showroom .modal .btn-primary { background: #141414; border-color: #141414; color: #fff; }
.modal .btn-primary:hover, .is-showroom .modal .btn-primary:hover { background: #333; border-color: #333; color: #fff; }

/* article markdown body */
.article-body p { margin: 0 0 22px; white-space: pre-wrap; }
.article-body h2, .article-body h3, .article-body h4 { font-family: var(--exp); font-weight: 700; margin: 30px 0 14px; line-height: 1.2; }
.article-body ul { margin: 0 0 22px; padding-left: 4px; list-style: none; }
.article-body li { display: flex; gap: 11px; margin-bottom: 10px; }
.article-body li::before { content: ""; width: 6px; height: 6px; background: var(--red); flex-shrink: 0; margin-top: 9px; }
.article-body strong { color: var(--text); }
.article-body a { color: var(--text); }

/* ticker */
.ticker { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg2); overflow: hidden; padding: 12px 0; }
.ticker .row { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.ticker span.it { display: inline-flex; align-items: center; gap: 9px; padding: 0 26px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; color: var(--dim); white-space: nowrap; }
.ticker .d { width: 6px; height: 6px; border-radius: 50%; }

/* ===== Preloader: «Дилер-центр Mercedes Москва», плавное появление на белом ===== */
.preloader { position: fixed; inset: 0; z-index: 9999; background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; transition: opacity .8s ease, visibility .8s; }
.preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.pl-center { text-align: center; padding: 0 24px; }
.pl-title { font-family: var(--exp); font-weight: 800; font-size: clamp(22px, 3.6vw, 46px); letter-spacing: .16em; line-height: 1.15; color: #f2f2f2; padding-left: .16em; opacity: 0; transform: translateY(16px); animation: pl-in 1.2s cubic-bezier(.2, .65, .2, 1) .15s forwards; }
.pl-sub { font-family: var(--mono); font-size: clamp(10px, 1.2vw, 13px); letter-spacing: .52em; color: #8a8a8a; margin-top: 18px; padding-left: .52em; opacity: 0; transform: translateY(10px); animation: pl-in 1.2s cubic-bezier(.2, .65, .2, 1) .55s forwards; }
@keyframes pl-in { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pl-title, .pl-sub { animation: none; opacity: 1; transform: none; } }

/* articles bento (home) — крупная статья слева + сетка справа */
.art-bento { display: grid; gap: 18px; grid-template-columns: 1.15fr 1fr 1fr; grid-template-rows: 1fr 1fr; min-height: clamp(560px, 58vh, 760px); }
.art-bento > :nth-child(1) { grid-column: 1; grid-row: 1 / 3; }
.art-bento > :nth-child(2) { grid-column: 2; grid-row: 1; }
.art-bento > :nth-child(3) { grid-column: 3; grid-row: 1; }
.art-bento > :nth-child(4) { grid-column: 2 / 4; grid-row: 2; }
.art-lead { display: flex; flex-direction: column; overflow: hidden; padding: 0; min-height: 100%; }
.art-lead-media { position: relative; flex: 1; min-height: 180px; border-bottom: 1px solid var(--line2); overflow: hidden; background: var(--panel2); }
.art-lead-media img { width: 100%; height: 100%; object-fit: cover; }
.art-lead-body { padding: clamp(22px, 2.4vw, 30px); }
.art-cell { display: flex; flex-direction: column; padding: clamp(24px, 2.8vw, 36px); min-height: 100%; }
.art-cell .a-date { margin-top: auto; }
@media (max-width: 900px) {
  .art-bento { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .art-bento > :nth-child(1) { grid-column: 1 / 3; grid-row: auto; min-height: 320px; }
  .art-bento > :nth-child(2),
  .art-bento > :nth-child(3) { grid-column: auto; grid-row: auto; }
  .art-bento > :nth-child(4) { grid-column: 1 / 3; grid-row: auto; }
}
@media (max-width: 560px) { .art-bento { grid-template-columns: 1fr; } .art-bento > * { grid-column: 1 !important; } }

/* ===== Hero (минимальный, по центру, в стиле кинематографичного экрана) ===== */
.hero-c { position: relative; z-index: 3; text-align: center; padding: 0 22px; max-width: 1100px; }
.hero-c .pill { display: inline-flex; }
.hero-title { font-family: var(--exp); font-weight: 800; font-size: clamp(58px, 13vw, 168px); letter-spacing: .16em; line-height: .92; margin: 0; padding-left: .16em; color: var(--text); }
.hero-sub { font-family: var(--mono); font-size: clamp(10px, 1.3vw, 14px); letter-spacing: .46em; color: var(--dim); margin-top: 22px; padding-left: .46em; }
.hero-tag { font-family: var(--mono); font-size: clamp(11px, 1.2vw, 13px); letter-spacing: .12em; color: var(--muted); margin: 26px auto 0; max-width: 90%; }
.hero-cta { margin-top: 38px; padding: 16px 36px; }

.hero-scroll { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 3; font-size: 10px; letter-spacing: .28em; color: var(--muted2); transition: color .2s; }
.hero-scroll:hover { color: var(--text); }
@media (max-width: 620px) { .hero-scroll { display: none; } }

/* stats console (главная) — панель характеристик автомобиля */
.stats-console { position: relative; padding: clamp(34px, 4.5vw, 68px); min-height: clamp(620px, 64vh, 840px); display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.stats-console .sc-grid { display: none; }
.sc-section { position: relative; overflow: hidden; }
.sc-section .sc-scan { position: absolute; left: 0; right: 0; top: 0; height: 2px; pointer-events: none; z-index: 1; background: linear-gradient(90deg, transparent, var(--red) 18%, var(--red) 82%, transparent); box-shadow: 0 0 14px 2px rgba(0, 0, 0, .35); animation: sc-scan 4.6s cubic-bezier(.5, 0, .5, 1) infinite; }
@keyframes sc-scan { 0% { top: 0; opacity: 0; } 7% { opacity: .9; } 93% { opacity: .9; } 100% { top: 100%; opacity: 0; } }
.stats-console > :not(.sc-grid):not(.sc-scan) { position: relative; }
.sc-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: clamp(26px, 3.5vw, 44px); }
.sc-live { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--dim); }
.sc-upd { font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; color: var(--muted2); }
.sc-stats { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; align-items: center; }
.sc-stat { padding: 4px clamp(16px, 2vw, 30px); border-left: 1px solid var(--line); }
.sc-stat:first-child { border-left: none; padding-left: 0; }
.sc-label { font-family: var(--mono); font-size: 11px; letter-spacing: .24em; color: var(--muted2); margin-bottom: 20px; }
.sc-value { font-family: var(--exp); font-weight: 800; font-size: clamp(46px, 6.2vw, 96px); line-height: 1; color: var(--text); }
.sc-unit { color: var(--red); font-size: .46em; font-weight: 800; margin-left: 1px; }
.sc-desc { font-size: 13px; line-height: 1.5; color: var(--muted); margin-top: 16px; }
@media (max-width: 820px) {
  .sc-stats { grid-template-columns: 1fr 1fr; }
  .sc-stat { padding: 20px clamp(14px, 3vw, 22px); border-top: 1px solid var(--line); }
  .sc-stat:nth-child(odd) { border-left: none; padding-left: 0; }
  .sc-stat:nth-child(-n+2) { border-top: none; }
}
@media (max-width: 480px) {
  .sc-stats { grid-template-columns: 1fr; }
  .sc-stat { border-left: none !important; border-top: 1px solid var(--line) !important; padding: 18px 0 !important; }
  .sc-stat:first-child { border-top: none !important; }
}

/* directions (главная): список направлений слева + деталь справа */
.dirs { display: grid; gap: 24px; grid-template-columns: minmax(280px, 360px) 1fr; align-items: stretch; min-height: clamp(560px, 58vh, 760px); }
.dirs-list { display: flex; flex-direction: column; border: 1px solid var(--line); align-self: stretch; min-height: clamp(620px, 64vh, 840px); }
.dir-item { display: flex; align-items: center; gap: 14px; flex: 1; min-height: 74px; padding: 20px 20px; border-bottom: 1px solid var(--line2); border-left: 2px solid transparent; cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.dir-item:last-child { border-bottom: none; }
.dir-item:hover { background: var(--panel2); }
.dir-item.active { background: var(--panel2); border-left-color: var(--red); }
.dir-item .n { font-family: var(--mono); font-size: 13px; color: var(--muted2); }
.dir-item.active .n { color: var(--red); }
.dir-item .t { font-size: 14.5px; font-weight: 600; color: var(--muted); line-height: 1.25; }
.dir-item:hover .t, .dir-item.active .t { color: var(--text); }
.dir-detail { border: 1px solid var(--line); background: var(--panel); padding: clamp(44px, 5vw, 72px); min-height: clamp(620px, 64vh, 840px); display: flex; flex-direction: column; justify-content: center; }
.dir-feats { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.dir-feats li { display: flex; align-items: center; gap: 11px; font-size: 14.5px; color: var(--dim); }
.dir-feats li::before { content: ""; width: 6px; height: 6px; background: var(--red); flex-shrink: 0; }
@media (max-width: 860px) { .dirs { grid-template-columns: 1fr; } }

.contact-block { min-height: clamp(560px, 58vh, 760px); align-items: center !important; }
.contact-block #contact-form .card { min-height: clamp(520px, 54vh, 700px); display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 860px) {
  .contact-block { min-height: auto; }
  .contact-block #contact-form .card { min-height: auto; }
}

/* hero grid bg */
.grid-bg { display: none; }

/* ===== 3D-шоурум (scroll-driven, главная) ===== */
.is-showroom, .is-showroom body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.is-showroom #site-footer { display: none; }
/* тёмная «студия»: чёрный фон, светлый текст поверх сцены */
.is-showroom body { background: #000; color: #ededed; }
.is-showroom .ch-eyebrow { color: #b5b5b5; }
.is-showroom .ch-eyebrow::before { background: #b5b5b5; }
.is-showroom .ch-title { color: #f5f5f5; }
.is-showroom .ch-sub { color: #bcbcbc; }
.is-showroom .ch-text { color: #d2d2d2; }
.is-showroom .ch-feats li { color: #d6d6d6; }
.is-showroom .ch-feats li::before { background: #9a9a9a; }
.is-showroom .ch-stat .t { color: #9a9a9a; }
.is-showroom .ch-stat .v { color: #f5f5f5; }
.is-showroom .ch-stat .u { color: #e8e8e8; }
.is-showroom .st-note { color: #a6a6a6; }
.is-showroom .ch-phone { color: #f5f5f5; }
.is-showroom .ch-legal a { color: #8a8a8a; }
.is-showroom .ch-legal a:hover { color: #eee; }
.is-showroom .btn-ghost { color: #f0f0f0; border-color: rgba(255,255,255,.4); }
/* залитые кнопки на чёрной сцене — инверсия: светлая заливка, тёмный текст */
.is-showroom .btn-primary { background: #e8e8e8; border-color: #e8e8e8; color: #000; }
/* ховер кнопок на тёмной витрине: ярко-белая заливка, чёрный текст */
.is-showroom .btn-ghost:hover,
.is-showroom .btn-primary:hover,
.is-showroom .site-header a.alarm-btn:hover,
.is-showroom .acct-link:hover { background: #fff; border-color: #fff; color: #000; }
.is-showroom .sh-count { color: #8a8a8a; }
.is-showroom .sh-count b { color: #f0f0f0; }
.is-showroom .sh-hint { color: #9a9a9a; }
/* хедер на главной: без фона — сливается со сценой (светлый текст поверх) */
.is-showroom .site-header { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: none; }
.is-showroom .site-header .bar { max-width: none; padding: 0 clamp(22px, 7vw, 110px); }
.is-showroom .site-header a.alarm-btn { background: #e8e8e8; border-color: #e8e8e8; color: #000; }
.is-showroom .site-header .exp { color: #f0f0f0; }
.is-showroom .site-header .mono { color: #8a8a8a; }
.is-showroom .desk-nav a { color: #8f8f8f; }
.is-showroom .desk-nav a:hover { color: #d8d8d8; }
/* активный раздел — пункт меню белый + короткое подчёркивание-акцент */
.is-showroom .desk-nav a.is-current { color: #fff; }
.desk-nav a { position: relative; }
/* активный пункт выделяется только цветом — без подчёркивания */
.is-showroom .acct-link { color: #ededed; border-color: rgba(255,255,255,.28); }

/* ── Светлые страницы (Политика / Условия) — та же тема, что витрина ────────
   Обычная прокрутка (без scroll-jacking), светлый фон, тёмный текст, шапка
   в стиле витрины. Класс light-page ставится на <body> этих страниц. */
body.light-page { background: #f0f0f0; color: #141414; }
/* шапка и контейнер — по ширине/отступам как на главной (полная ширина,
   боковой отступ clamp(22px,7vw,110px), контент слева, без центрирования) */
.light-page .site-header .bar { max-width: none; padding: 0 clamp(22px, 7vw, 110px); }
.light-page .section > .doc-wrap { max-width: none; margin: 0; padding: 0 clamp(22px, 7vw, 110px); }
.light-page .doc-wrap > * { max-width: 860px; } /* читаемая колонка текста, выровнена по левому краю */
/* каталог: тот же полноширинный фрейм, но сетка карточек — на всю ширину */
.light-page .cat-wrap { max-width: none; margin: 0; padding: 0 clamp(22px, 7vw, 110px); }
.light-page .cat-wrap > .eyebrow, .light-page .cat-wrap > .h-section, .light-page .cat-wrap > .lead { max-width: 860px; }
/* шапка: светлая с лёгким блюром, тёмный текст (как на витрине) */
.light-page .site-header { background: rgba(240, 240, 240, .85); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(0, 0, 0, .06); }
.light-page .site-header .exp { color: #121212; }
.light-page .site-header .mono { color: #7a7a7a; }
.light-page .desk-nav a { color: #555; }
.light-page .desk-nav a:hover { color: #a6a6a6; }
.light-page .acct-link { color: #141414; border-color: #c9c9c9; }
.light-page .acct-link:hover { background: #141414; border-color: #141414; color: #fff; }
.light-page .site-header a.alarm-btn { color: #fff; }
.light-page .site-header a.alarm-btn:hover { background: #141414; border-color: #141414; color: #fff; }
/* контент документа */
.light-page .h-section { color: #141414; }
.light-page .lead { color: #4a4a4a; }
.light-page .article-body { color: #3c3c3c !important; } /* !important — перебивает инлайновый color:var(--dim) в разметке */
.light-page .article-body h2, .light-page .article-body h3, .light-page .article-body h4 { color: #141414; }
.light-page .article-body strong { color: #141414; }
.light-page .article-body a, .light-page .ulink { color: #141414; }
.light-page .article-body a:hover, .light-page .ulink:hover { color: #555; }
.light-page .muted { color: #7a7a7a; }
.light-page hr.div { border-top-color: rgba(0, 0, 0, .12); }
/* подвал */
.light-page .site-footer { background: #eaeaea; border-top-color: rgba(0, 0, 0, .1); }
.light-page .site-footer .exp { color: #141414; }
.light-page .site-footer .ft-title { color: #6a6a6a; }
.light-page .site-footer .muted { color: #6a6a6a; }
.light-page .site-footer .ulink { color: #4a4a4a; }
.light-page .site-footer .ulink:hover { color: #141414; }

/* ── Тёмная страница (каталог) — в стиле витрины ───────────────────────────
   Чёрный фон, светлый текст, тёмная шапка/подвал. Раскладка (ширина/отступы)
   как у light-page. Карточки — тёмные, фото машины «растворяется» снизу в
   корпус (см. .cat-media ниже). */
body.dark-page { background: #0a0a0a; color: #ededed; }
.dark-page .site-header .bar { max-width: none; padding: 0 clamp(22px, 7vw, 110px); }
.dark-page .cat-wrap { max-width: none; margin: 0; padding: 0 clamp(22px, 7vw, 110px); }
.dark-page .cat-wrap > .eyebrow, .dark-page .cat-wrap > .h-section, .dark-page .cat-wrap > .lead { max-width: 860px; }
/* шапка: тёмная с лёгким блюром, светлый текст */
.dark-page .site-header { background: rgba(10, 10, 10, .82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255, 255, 255, .07); }
.dark-page .site-header .exp { color: #f0f0f0; }
.dark-page .site-header .mono { color: #8a8a8a; }
.dark-page .desk-nav a { color: #8f8f8f; }
.dark-page .desk-nav a:hover { color: #d8d8d8; }
.dark-page .desk-nav a.is-current { color: #fff; }
.dark-page .acct-link { color: #ededed; border-color: rgba(255, 255, 255, .28); }
.dark-page .acct-link:hover { background: #fff; border-color: #fff; color: #000; }
.dark-page .site-header a.alarm-btn { background: #e8e8e8; border-color: #e8e8e8; color: #000; }
.dark-page .site-header a.alarm-btn:hover { background: #fff; border-color: #fff; color: #000; }
/* заголовок каталога */
.dark-page .eyebrow { color: #b5b5b5; }
.dark-page .eyebrow::before { background: #b5b5b5; }
.dark-page .h-section { color: #f5f5f5; }
.dark-page .lead { color: #bcbcbc; }
.dark-page .muted { color: #8a8a8a; }
.dark-page hr.div { border-top-color: rgba(255, 255, 255, .12); }
/* подвал */
.dark-page .site-footer { background: #050505; border-top-color: rgba(255, 255, 255, .08); }
.dark-page .site-footer .exp { color: #f0f0f0; }
.dark-page .site-footer .ft-title { color: #8a8a8a; }
.dark-page .site-footer .muted { color: #8a8a8a; }
.dark-page .site-footer .ulink { color: #a6a6a6; }
.dark-page .site-footer .ulink:hover { color: #f0f0f0; }

/* ── Карточки каталога (catalog.html) ─────────────────────────────────────── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: clamp(18px, 2vw, 28px); margin-top: clamp(30px, 4vw, 52px); }
.cat-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid rgba(0, 0, 0, .08); overflow: hidden; transition: border-color .3s ease, background .3s ease, transform .35s cubic-bezier(.2, .7, .2, 1); }
.cat-card:hover { border-color: rgba(0, 0, 0, .3); background: #fbfbfb; transform: scale(1.02); z-index: 2; }
.cat-media { position: relative; aspect-ratio: 16 / 10; background-size: cover; background-position: center; display: flex; align-items: flex-start; justify-content: space-between; padding: 14px; }
.cat-media-empty { background: linear-gradient(135deg, #ececec 0%, #f6f6f6 55%, #e4e4e4 100%); }
.cat-media-empty::after { content: "MERCEDES-BENZ"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; letter-spacing: .34em; color: rgba(0, 0, 0, .13); pointer-events: none; }
.cat-badge, .cat-status { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; color: #fff; padding: 5px 9px; position: relative; z-index: 1; }
.cat-badge { background: rgba(20, 20, 20, .74); }
.cat-status { background: var(--red); }
.cat-body { display: flex; flex-direction: column; flex: 1; padding: clamp(18px, 1.6vw, 24px); }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cat-name { font-family: var(--exp); font-weight: 800; font-size: clamp(19px, 1.5vw, 23px); line-height: 1.1; margin: 0; color: #141414; }
.cat-year { font-family: var(--mono); font-size: 11px; color: #9a9a9a; flex-shrink: 0; }
.cat-tag { color: #565656; font-size: 13.5px; line-height: 1.5; margin: 10px 0 0; }
.cat-specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(0, 0, 0, .08); }
.cat-spec-t { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: #9a9a9a; text-transform: uppercase; }
.cat-spec-v { font-family: var(--exp); font-weight: 700; font-size: 15px; color: #1a1a1a; margin-top: 4px; }
.cat-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 20px; }
.cat-price { font-family: var(--exp); font-weight: 800; font-size: 16px; color: #141414; }
.cat-cta { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--red); white-space: nowrap; transition: transform .25s ease; }
.cat-card:hover .cat-cta { transform: translateX(3px); }

/* тёмные карточки каталога (.dark-page): корпус чёрный, светлый текст, а
   светлый студийный фон фото сверху и снизу «растворяется» в корпус карточки —
   машина остаётся, резкого светлого прямоугольника нет */
.dark-page .cat-card { background: #141414; border-color: rgba(255, 255, 255, .09); }
.dark-page .cat-card:hover { background: #181818; border-color: rgba(255, 255, 255, .3); }
.dark-page .cat-media-empty { background: linear-gradient(135deg, #1c1c1c 0%, #242424 55%, #171717 100%); }
.dark-page .cat-media-empty::after { color: rgba(255, 255, 255, .14); }
.dark-page .cat-name { color: #f5f5f5; }
.dark-page .cat-year { color: #7a7a7a; }
.dark-page .cat-tag { color: #b0b0b0; }
.dark-page .cat-specs { border-top-color: rgba(255, 255, 255, .1); }
.dark-page .cat-spec-t { color: #7a7a7a; }
.dark-page .cat-spec-v { color: #ededed; }
.dark-page .cat-price { color: #f5f5f5; }
.dark-page .cat-cta { color: #cfcfcf; }

/* ── Страницы ошибок (404/403/500/…) — светлая тема, по центру экрана ─────── */
[data-error] .section { min-height: calc(100vh - 71px); display: flex; align-items: center; }
.err-code { font-family: var(--exp); font-weight: 800; font-size: clamp(96px, 20vw, 220px); line-height: .86; letter-spacing: -.03em; color: #141414; margin: 4px 0 6px; }
.err-text { max-width: 46ch; }
.err-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
@media (max-width: 760px) { [data-error] .section { min-height: auto; padding: 96px 0 80px; } }

.stage-mv { position: fixed; inset: 0; z-index: 1; opacity: 0; transition: opacity 1.4s ease .15s; }
.stage-mv.ready { opacity: 1; }
.stage-mv model-viewer { width: 100%; height: 100%; --poster-color: transparent; background: transparent; }
/* оверлеи поверх сцены убраны — чистый студийный фон */

.chapters { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
/* ⚠ Прозрачность/will-change на .chapter НЕЛЬЗЯ: такой родитель становится
   backdrop root, и backdrop-filter стекла перестаёт размывать модель за ним.
   Поэтому fade in/out анимируется на самих .ch-box / .ch-legal (ниже). */
.chapter { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 110px clamp(22px, 7vw, 110px) 90px; }
.chapter[data-layout="left"] { justify-content: flex-start; }
.chapter[data-layout="right"] { justify-content: flex-end; }
/* ширина бокса ограничена стеклом: 50vw − боковой отступ − 28px (запас до
   растушёванной кромки) — текст не может выйти за пределы панели */
.ch-box { max-width: 640px; pointer-events: auto; opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.chapter.is-active .ch-box { opacity: 1; transform: none; } /* проявление + лёгкий подъём */
.chapter[data-layout="center"] .ch-box { text-align: center; max-width: 900px; }
.ch-eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .3em; color: var(--red); margin-bottom: 18px; }
.ch-title { font-family: var(--exp); font-weight: 800; font-size: clamp(30px, 4.6vw, 62px); line-height: 1.02; letter-spacing: -.01em; margin: 0 0 16px; }
.chapter[data-layout="center"] .ch-title.big { font-size: clamp(46px, 8.5vw, 118px); letter-spacing: .06em; }
.ch-sub { font-family: var(--mono); font-size: clamp(11px, 1.2vw, 14px); letter-spacing: .4em; color: var(--dim); margin-bottom: 18px; }
.ch-text { color: var(--dim); font-size: clamp(14.5px, 1.3vw, 17px); line-height: 1.65; max-width: 56ch; margin: 0; }
.chapter[data-layout="center"] .ch-text { margin: 0 auto; }
.ch-feats { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 13px; max-width: 520px; }
.ch-feats li { display: flex; align-items: center; gap: 11px; font-size: 14.5px; color: var(--dim); }
.ch-feats li::before { content: ""; width: 20px; height: 2px; background: var(--red); flex-shrink: 0; }
.ch-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.chapter[data-layout="center"] .ch-cta { justify-content: center; }
.ch-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(18px, 3vw, 44px); margin-top: 40px; }
/* в боковой раскладке: заголовок героя компактнее, статистика 2×2 */
.chapter:not([data-layout="center"]) .ch-title.big { font-size: clamp(38px, 5.2vw, 78px); letter-spacing: .04em; }
.chapter:not([data-layout="center"]) .ch-stats { grid-template-columns: 1fr 1fr; gap: clamp(18px, 2.4vw, 34px); max-width: 520px; }
.chapter:not([data-layout="center"]) .ch-stat .v { font-size: clamp(32px, 3.6vw, 58px); }
.ch-stat .t { font-family: var(--mono); font-size: 10.5px; letter-spacing: .22em; color: var(--muted); margin-bottom: 12px; }
.ch-stat .v { font-family: var(--exp); font-weight: 800; font-size: clamp(34px, 4.4vw, 72px); line-height: 1; color: var(--text); }
.ch-stat .u { color: var(--red); font-size: .42em; font-weight: 800; margin-left: 2px; }
/* stats с описанием (note): сетка 2×2, число + пояснение снизу, единица крупнее */
.ch-stats:has(.st-note) { grid-template-columns: 1fr !important; gap: clamp(22px, 3vw, 34px) !important; max-width: 380px !important; }
.ch-stats:has(.st-note) .ch-stat .v { font-size: clamp(30px, 3.6vw, 50px) !important; }
.ch-stats:has(.st-note) .ch-stat .u { font-size: .46em; color: #e8e8e8; font-weight: 700; margin-left: 5px; }
.st-note { margin-top: 9px; font-size: 12.5px; line-height: 1.4; color: #6a6a6a; max-width: 26ch; }
/* средние экраны: числа с описанием — в одну строку (2 колонки), чтобы «2 года»
   встало рядом с «1 день» и не наезжало на машину */
@media (min-width: 761px) and (max-width: 1200px) {
  .is-showroom .ch-stats:has(.st-note) { grid-template-columns: 1fr 1fr !important; gap: 20px 26px !important; max-width: none !important; }
  .is-showroom .ch-stats:has(.st-note) .st-note { max-width: none; }
}
.ch-phone { display: inline-block; font-family: var(--exp); font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; margin-top: 26px; }
/* юридические ссылки — правый нижний угол экрана (симметрично счётчику 01/05 слева) */
.ch-legal { position: absolute; right: clamp(22px, 7vw, 110px); bottom: 26px; display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; opacity: 0; transition: opacity .7s ease; }
.chapter.is-active .ch-legal { opacity: 1; }
.ch-legal a { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--muted2); }
.ch-legal a:hover { color: var(--dim); }

/* Угловые компоновки: текст в свободном от машины углу кадра.
   data-layout: top-left | top-right | bottom-left | bottom-right (в content.js).
   Коробка компактнее, статистика — в один ряд, чтобы меньше по высоте. */
.chapter[data-layout="top-left"], .chapter[data-layout="bottom-left"] { justify-content: flex-start; }
.chapter[data-layout="top-right"], .chapter[data-layout="bottom-right"] { justify-content: flex-end; }
.chapter[data-layout^="top-"] { align-items: flex-start; }
.chapter[data-layout^="bottom-"] { align-items: flex-end; }
.chapter[data-layout^="top-"] .ch-box, .chapter[data-layout^="bottom-"] .ch-box { max-width: 520px; }
.chapter[data-layout^="top-"] .ch-title, .chapter[data-layout^="bottom-"] .ch-title { font-size: clamp(26px, 3.4vw, 46px); }
/* большой (геро) заголовок в верхней раскладке — компактнее, чтобы блок с
   кнопками не доставал до нижней кромки на невысоких экранах */
.chapter[data-layout^="top-"] .ch-title.big, .chapter[data-layout^="bottom-"] .ch-title.big { font-size: clamp(32px, 4.1vw, 58px); }
.chapter[data-layout^="top-"] .ch-stats, .chapter[data-layout^="bottom-"] .ch-stats { grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 1.8vw, 26px); max-width: none; margin-top: 28px; }
.chapter[data-layout^="top-"] .ch-stat .v, .chapter[data-layout^="bottom-"] .ch-stat .v { font-size: clamp(24px, 2.4vw, 40px); }

/* ── Мобильная витрина: единая схема для всех глав ─────────────────────────
   Текст — компактной колонкой сверху, машина — в нижней половине экрана
   (home.js на узких экранах приподнимает прицел камеры). Значения на границе
   760px СТЫКУЮТСЯ с угловой раскладкой (сторона, ширина 520px, кегль,
   боковой отступ ~7vw), к маленьким экранам плавно сжимаются через
   vw-клампы — переход без скачка. */
@media (max-width: 760px) {
  /* сторона текста следует раскладке (top-right остаётся справа) — на узких
     телефонах колонка всё равно на всю ширину и сторона не видна */
  .chapter, .chapter[data-layout] { align-items: flex-start; padding: 116px clamp(20px, 7vw, 53px) 72px; } /* верхний отступ — под двухрядную шапку */
  .ch-box, .chapter[data-layout] .ch-box { max-width: min(520px, 100%); }
  .ch-eyebrow { font-size: 10px; letter-spacing: .22em; margin-bottom: 12px; }
  /* обратные рампы: на 760px кегль равен угловой раскладке (26/32px), к
     узким экранам плавно растёт (telефону — крупнее), без скачка на границе */
  .chapter[data-layout] .ch-title { font-size: clamp(26px, calc(33.9px - 1.04vw), 30px); margin-bottom: 10px; }
  .chapter[data-layout] .ch-title.big { font-size: clamp(32px, calc(47.8px - 2.08vw), 40px); letter-spacing: .02em; }
  .ch-sub { font-size: 10.5px; letter-spacing: .26em; margin-bottom: 12px; }
  .ch-text { font-size: 13.5px; line-height: 1.55; }
  .ch-feats, .chapter[data-layout] .ch-feats { margin-top: 16px; grid-template-columns: 1fr 1fr; gap: 8px 14px; max-width: none; }
  .ch-feats li { font-size: 12px; gap: 8px; }
  .ch-feats li::before { width: 14px; }
  .chapter[data-layout] .ch-stats { grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-top: 20px; max-width: none; }
  /* на телефоне stats с описанием — снова в ряд (2 колонки), чтобы «2 года»
     встало рядом с «1 день» и не наезжало на машину */
  .ch-stats:has(.st-note) { grid-template-columns: 1fr 1fr !important; gap: 16px 14px !important; max-width: none !important; }
  .ch-stats:has(.st-note) .st-note { max-width: none; }
  .ch-stat .t { font-size: 9.5px; margin-bottom: 6px; }
  .chapter[data-layout] .ch-stat .v { font-size: 30px; }
  .ch-cta { margin-top: 18px; gap: 10px; }
  .ch-cta .btn { padding: 12px 16px; font-size: 11px; }
  .ch-phone { font-size: 22px; margin-top: 14px; }
  .ch-legal { right: 20px; bottom: 16px; gap: 12px; justify-content: flex-end; }
  .sh-count { bottom: 18px; }
  .sh-hint { bottom: 18px; }
}

/* ── Очень узкие телефоны (≤440px) ─────────────────────────────────────────
   Ширину не блокируем (реальные телефоны 320–414px — min-width дал бы
   горизонтальный скролл). Вместо этого поджимаем плотность: заголовок и
   разрядка надписей меньше, отступы уже — на 320–440px выглядит намеренно. */
@media (max-width: 440px) {
  .chapter, .chapter[data-layout] { padding: 104px 16px 64px; }
  .chapter[data-layout] .ch-title { font-size: clamp(22px, 6.4vw, 26px); }
  .chapter[data-layout] .ch-title.big { font-size: clamp(27px, 8vw, 33px); }
  .ch-eyebrow { font-size: 9px; letter-spacing: .14em; margin-bottom: 10px; }
  .ch-sub { letter-spacing: .12em; }
  .ch-text { font-size: 13px; line-height: 1.5; }
  .chapter[data-layout] .ch-stat .v { font-size: 26px; }
  .ch-stats:has(.st-note) { gap: 14px 12px !important; }
  .st-note { font-size: 11.5px; }
  /* шапка: разрядку и промежутки поджимаем, чтобы 6 ссылок легли ровнее */
  .desk-nav a, .acct-link, .site-header a.alarm-btn { letter-spacing: .04em !important; }
  .site-header .bar { gap: 7px 8px; }
}

/* счётчик глав (боковые точки убраны — ориентир по активному пункту меню) */
.sh-count { position: fixed; left: clamp(20px, 3vw, 44px); bottom: 26px; z-index: 6; font-family: var(--mono); font-size: 11.5px; letter-spacing: .3em; color: var(--muted); }
.sh-count b { color: var(--text); font-weight: 600; }
.sh-hint { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 6; font-family: var(--mono); font-size: 10px; letter-spacing: .3em; color: var(--muted2); transition: opacity .6s; animation: floathint 2.2s ease-in-out infinite; }
@keyframes floathint { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(6px); } }
.sh-hint.off { opacity: 0; }
@media (max-width: 620px) { .sh-count, .sh-hint { display: none; } }

/* ===== Reveal on scroll (появление секций при прокрутке) ===== */
.rev { opacity: 0; transform: translateY(28px); transition: opacity .75s cubic-bezier(.2, .65, .2, 1), transform .75s cubic-bezier(.2, .65, .2, 1); transition-delay: var(--rd, 0ms); will-change: opacity, transform; }
.rev.rev-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rev { opacity: 1 !important; transform: none !important; transition: none !important; } }

/* ===== Показатели: красный тик над подписью ===== */
.sc-tick { display: block; width: 28px; height: 2px; background: var(--red); margin: 0 auto 20px; transform: scaleX(0); transform-origin: center; transition: transform .9s cubic-bezier(.2, .7, .2, 1) .25s; }
.rev-in .sc-tick { transform: scaleX(1); }

/* ===== Направления: стрелка и плавная смена детали ===== */
.dir-item::after { content: "→"; font-family: var(--mono); font-size: 14px; margin-left: auto; color: var(--red); opacity: 0; transform: translateX(-8px); transition: opacity .25s, transform .25s; }
.dir-item:hover::after, .dir-item.active::after { opacity: 1; transform: none; }
.dir-item .n { transition: color .25s; }
.dir-item .t { transition: color .25s; }
.dir-detail.dir-in > * { animation: dirIn .5s cubic-bezier(.2, .7, .2, 1) both; }
.dir-detail.dir-in > *:nth-child(2) { animation-delay: .07s; }
.dir-detail.dir-in > *:nth-child(3) { animation-delay: .14s; }
.dir-detail.dir-in > *:nth-child(4) { animation-delay: .21s; }
.dir-detail.dir-in > *:nth-child(5) { animation-delay: .28s; }
@keyframes dirIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .dir-detail.dir-in > * { animation: none; } }

/* ===== Карточки статей: подъём и зум обложки ===== */
a.card { transition: border-color .3s, transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s; }
a.card:hover { transform: translateY(-6px); box-shadow: 0 22px 44px -20px rgba(0, 0, 0, .8); }
.art-lead-media { overflow: hidden; }
.art-lead-media img { transition: transform .9s cubic-bezier(.2, .6, .2, 1); }
.art-lead:hover .art-lead-media img { transform: scale(1.06); }
.a-date { transition: color .3s; }
a.card:hover .a-date { color: var(--red) !important; }
