/*
 * style.css — основные стили публичной части smalyugin.ru.
 * Структура: глобальные переменные → каркас (shell, bar) → компоненты
 * (кнопки, карточки, KPI, формы, омни) → респонсив → темы light/warm.
 *
 * Темы переключаются через атрибут html[data-theme=light|warm] (см. theme.js).
 * Дефолт = dark (определён в :root). Все компонентные цвета берутся
 * из CSS-переменных, чтобы темы переопределяли только палитру.
 *
 * Cache-bust: подключается как /style.css?v=mtime — см. asset_v() в inc/config.php.
 */

/* === Локальные шрифты (вместо Google Fonts CDN) ===
 * Скачаны и отдаются со своего домена — нет трансграничной передачи IP
 * пользователя в США (требование ФЗ-152 после регистрации в РКН).
 * Inter — variable (один файл закрывает 300–700). JetBrains Mono —
 * три статичных веса (Regular/Medium/SemiBold).
 * Источники: github.com/rsms/inter, github.com/JetBrains/JetBrainsMono.
 */
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter.var.woff2?v=1') format('woff2-variations'),
       url('/assets/fonts/Inter.var.woff2?v=1') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono-Regular.woff2?v=1') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono-Medium.woff2?v=1') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono-SemiBold.woff2?v=1') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* === Переменные палитры (dark, по умолчанию) === */
/* Console — dark SaaS multi-page */
:root {
  --bg: #0a0d12;
  --bg-2: #10141b;
  --panel: #141925;
  --panel-2: #1a2030;
  --panel-3: #232a3d;
  --line: #232a3d;
  --line-2: #2e3650;
  --ink: #e4e8f4;
  --ink-2: #9ba3bf;
  --ink-3: #6c7596;
  --ink-4: #4a516b;
  --acc: #5b8def;
  --acc-d: #4670d8;
  --acc-soft: #1d2842;
  --cyan: #4dd0e1;
  --green: #57c785;
  --amber: #e8b75a;
  --pink: #e98c8c;
}
/* === Base reset + типографика === */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font-family: 'Inter', system-ui, sans-serif; font-size: 14.5px; line-height: 1.5; }
html { -webkit-text-size-adjust: 100%; }
body { width: 100%; min-height: 100%; overflow-x: hidden; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--acc); color: var(--bg); }
img { max-width: 100%; display: block; }

/* Layout shell — fluid container, max 1280px desktop */
.shell { max-width: 1280px; margin: 0 auto; padding: 0 40px; box-sizing: border-box; }
.shell-x { max-width: 1280px; margin: 0 auto; padding: 0 56px; box-sizing: border-box; }
/* Hamburger button — only visible on mobile */
.bar-burger { display: none; width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.bar-burger svg { width: 18px; height: 18px; }
.nav-tabs-wrap { display: contents; }
/* === Мобильный drawer (главное меню) === */
/* Инжектится из nav.js, появляется ниже бургер-кнопки. inset:56px 0 0 0 —
 * 56px = высота шапки .bar, чтобы шторка перекрывала всё кроме шапки. */
.mobile-drawer { display: none; position: fixed; inset: 56px 0 0 0; background: var(--bg); z-index: 49; padding: 24px 24px 48px; flex-direction: column; gap: 6px; overflow-y: auto; }
.mobile-drawer.on { display: flex; }
.mobile-drawer a { padding: 14px 16px; font-size: 16px; color: var(--ink); border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-family: 'JetBrains Mono', monospace; }
.mobile-drawer a.on { background: var(--acc-soft); color: var(--acc); border-color: var(--acc); }
.mobile-drawer .group { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.14em; padding: 16px 4px 6px; }

/* === Верхняя панель (sticky header) === */
/* z-index 50; backdrop-filter: blur(8px) — стекло поверх контента.
 * Цвет фона rgba — чтобы при скролле прозрачность работала с blur. */
.bar { display: flex; align-items: center; padding: 14px 40px; border-bottom: 1px solid var(--line-2); background: rgba(10,13,18,0.9); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 50; gap: 24px; }
/* Брендовый градиент-акцент по нижней границе шапки — чтобы .bar не
 * сливался с фоном. Лежит поверх border-bottom (bottom: -1px), inset
 * слева/справа повторяет padding .bar (40/24/20/16px). */
.bar::after {
  content: '';
  position: absolute;
  left: 40px; right: 40px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--acc) 16%,
    var(--cyan) 32%,
    var(--green) 50%,
    var(--amber) 68%,
    var(--pink) 84%,
    transparent 100%
  );
  opacity: 0.75;
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; letter-spacing: -0.005em; }
/* .brand-mark — обёртка под лого. Раньше был градиентный квадрат с буквой,
 * теперь <picture> с logo.webp/png. overflow:hidden + border-radius даёт
 * скруглённые углы даже если лого прямоугольное; img внутри тянется на 100%. */
.brand-mark { width: 28px; height: 28px; border-radius: 6px; overflow: hidden; display: inline-flex; flex-shrink: 0; background: var(--panel); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand .v { color: var(--ink-3); margin: 0 4px; font-weight: 400; }
.nav-tabs { display: flex; gap: 4px; margin-left: 16px; }
.nav-tabs a { padding: 7px 14px; font-size: 13.5px; color: var(--ink-2); border-radius: 6px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.nav-tabs a:hover { background: var(--panel); color: var(--ink); }
.nav-tabs a.on { background: var(--panel-2); color: var(--ink); }
.nav-tabs a .ic { opacity: 0.6; }
.spacer { flex: 1; }
.bar-search { width: 280px; padding: 7px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; color: var(--ink-2); font-size: 13px; display: flex; align-items: center; gap: 8px; font-family: 'JetBrains Mono', monospace; flex-shrink: 0; white-space: nowrap; overflow: hidden; }
.bar-search .kbd { margin-left: auto; padding: 1px 6px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 4px; font-size: 11px; color: var(--ink-3); }
.bar-actions { display: flex; gap: 8px; align-items: center; }

/* === Кнопки (btn / btn-acc / btn-ghost / btn-lg) === */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); transition: all .15s; font-family: inherit; }
.btn:hover { border-color: var(--ink-3); background: var(--panel-2); }
.btn-acc { background: var(--acc); color: var(--bg); border-color: var(--acc); font-weight: 600; }
.btn-acc:hover { background: var(--acc-d); border-color: var(--acc-d); }
.btn-ghost { background: transparent; }
.btn-lg { padding: 12px 22px; font-size: 14px; border-radius: 8px; }

/* === Общие декоративные элементы ===
 * .eyebrow — мелкая шапка над заголовком («// что я делаю»).
 * .tag-pill — пилюля-тег с цветной точкой. Цвет варьируется модификаторами .g/.a/.p. */
.eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--acc); letter-spacing: 0.14em; text-transform: uppercase; }
.tag-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--acc-soft); color: var(--acc); border-radius: 99px; font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.tag-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); }
.tag-pill.g { background: rgba(87,199,133,0.14); color: var(--green); } .tag-pill.g::before { background: var(--green); }
.tag-pill.a { background: rgba(232,183,90,0.14); color: var(--amber); } .tag-pill.a::before { background: var(--amber); }
.tag-pill.p { background: rgba(233,140,140,0.14); color: var(--pink); } .tag-pill.p::before { background: var(--pink); }

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; color: var(--ink); line-height: 1.15; }
h1 { font-size: 64px; letter-spacing: -0.035em; }
h2 { font-size: 36px; }
h3 { font-size: 22px; }
h4 { font-size: 16px; }
p { color: var(--ink-2); }
p.lead { font-size: 18px; color: var(--ink); line-height: 1.55; }

/* === Карточки === */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.card-flat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }

/* === Вертикальные интервалы === */
section.block { padding: 56px 0; }
.section-head { margin-bottom: 32px; }

/* === Цветной разделитель между блоками главной ===
 * Градиентная полоска из брендовых цветов (синий → cyan → зелёный →
 * амбер → розовый), которая делит главную на секции «услуги / события /
 * статус / CTA». Реализована как ::before на КАЖДОМ section.block,
 * включая первый (после hero, у которого .block нет). Inset слева/справа
 * повторяет padding .shell (40/24/16px), чтобы линия совпадала с
 * шириной контента. Высота 4px — заметная, но не «полоса». */
section.shell.block { position: relative; }
section.shell.block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 40px;
  right: 40px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--acc) 16%,
    var(--cyan) 32%,
    var(--green) 50%,
    var(--amber) 68%,
    var(--pink) 84%,
    transparent 100%
  );
  opacity: 0.7;
  pointer-events: none;
}

/* === Service-карточки (3 на главной/services) === */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.svc-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px; transition: all .15s; display: flex; flex-direction: column; gap: 14px; min-height: 280px; }
.svc-card:hover { border-color: var(--acc); background: var(--panel-2); }
.svc-card .head { display: flex; justify-content: space-between; align-items: center; }
.svc-card .icon { width: 36px; height: 36px; border-radius: 8px; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 16px; }
.svc-card .icon.g { background: rgba(87,199,133,0.14); color: var(--green); }
.svc-card .icon.a { background: rgba(232,183,90,0.14); color: var(--amber); }
.svc-card h3 { font-size: 19px; }
.svc-card p { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); flex: 1; }
.svc-card .meta { display: flex; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }

/* === KPI-плашки (главная) === */
.kpi { padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.kpi .lbl { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 8px; }
.kpi .val { font-family: 'JetBrains Mono', monospace; font-size: 30px; color: var(--ink); font-weight: 500; line-height: 1; }
.kpi .delta { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--green); margin-top: 6px; }

/* === Подвал === */
.foot { border-top: 1px solid var(--line); margin-top: 80px; padding: 36px 40px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; font-size: 13px; color: var(--ink-2); }
.foot h5 { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 500; margin-bottom: 12px; }
.foot ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.foot a:hover { color: var(--acc); }
.foot .copy { font-size: 14px; color: var(--ink); margin-bottom: 8px; }
.foot .end { grid-column: 1/-1; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; row-gap: 8px; justify-content: space-between; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-3); }
/* Регистрация оператора в Реестре РКН — отдельная строка во всю ширину подвала,
   чтобы не сжимать соседний span с legal-ссылками. */
.foot .end .foot-rkn { flex-basis: 100%; text-align: center; opacity: 0.75; }

/* === Формы (.field — обёртка с label сверху) === */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.12em; }
.field input, .field textarea, .field select { padding: 10px 14px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 7px; font: inherit; font-size: 14px; color: var(--ink); outline: none; transition: border-color .15s; font-family: inherit; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--acc); }
.field textarea { min-height: 110px; resize: vertical; }

/* === Хлебные крошки === */
.crumb { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-3); padding: 20px 40px; border-bottom: 1px solid var(--line); }
.crumb a { color: var(--ink-3); }
.crumb a:hover { color: var(--acc); }
.crumb .sep { margin: 0 8px; color: var(--ink-4); }
.crumb .cur { color: var(--ink); }

/* === Страница логина (cabinet и admin) === */
/* ::before — крупный «глоу» сверху по центру, создаёт ощущение спот-света. */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 80px 24px; background: var(--bg); position: relative; overflow: hidden; }
.login-wrap::before { content: ""; position: absolute; top: -200px; left: 50%; transform: translateX(-50%); width: 1400px; height: 700px; background: radial-gradient(ellipse at center, rgba(91,141,239,0.18) 0%, transparent 60%); pointer-events: none; }
.login-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 36px; position: relative; box-shadow: 0 40px 100px -40px rgba(0,0,0,0.6); }
.login-card .crest { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--acc) 0%, var(--cyan) 100%); margin: 0 auto 18px; display: grid; place-items: center; color: var(--bg); font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 22px; }
.login-card h2 { font-size: 26px; text-align: center; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: var(--ink-3); font-size: 13px; margin-bottom: 24px; font-family: 'JetBrains Mono', monospace; }
.login-card .hint { margin-top: 18px; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }
.login-card .err { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--pink); margin-bottom: 10px; min-height: 14px; }

/* === Старый дашборд (demo, не cabinet) === */
/* Layout: левый sidebar 220px + контент + чат (через .dash-main). */
.dash-shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 56px); }
.dash-side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 20px 12px; height: calc(100vh - 56px); position: sticky; top: 56px; overflow-y: auto; }
.dash-side .user { padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.dash-side .user .av { width: 28px; height: 28px; border-radius: 6px; background: var(--acc); color: var(--bg); display: grid; place-items: center; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 13px; }
.dash-side .user .info { flex: 1; min-width: 0; }
.dash-side .user .nm { font-size: 13.5px; font-weight: 500; }
.dash-side .user .rl { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.1em; }
.dash-side h5 { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.14em; padding: 4px 12px 8px; }
.dash-side ul { list-style: none; display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.dash-side li { padding: 8px 12px; border-radius: 6px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; display: flex; align-items: center; gap: 10px; }
.dash-side li:hover { background: var(--panel); color: var(--ink); }
.dash-side li.on { background: var(--acc-soft); color: var(--acc); }
.dash-side li .badge { font-family: 'JetBrains Mono', monospace; font-size: 10px; background: var(--panel-3); padding: 1px 6px; border-radius: 99px; color: var(--ink-3); margin-left: auto; }
.dash-side li.on .badge { background: var(--acc); color: var(--bg); }

.dash-main { display: grid; grid-template-columns: 1.5fr 1fr; min-width: 0; }
.dash-content { padding: 28px 32px; border-right: 1px solid var(--line); min-width: 0; overflow: hidden; }
.dash-content h2 { font-size: 26px; margin-bottom: 4px; }
.dash-content .meta { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--ink-3); margin-bottom: 22px; }
.proj-row { display: grid; grid-template-columns: 28px 1fr 130px 80px 60px; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; font-size: 13.5px; }
.proj-row .ic { width: 28px; height: 28px; border-radius: 6px; background: var(--panel-2); color: var(--acc); display: grid; place-items: center; font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 13px; }
.proj-row .nm { font-weight: 500; color: var(--ink); }
.proj-row .nm small { display: block; color: var(--ink-3); font-weight: 400; font-size: 11.5px; margin-top: 2px; font-family: 'JetBrains Mono', monospace; }
.proj-row .st { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--ink-2); }
.proj-row .sz { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--ink-3); }
.proj-row .ac { color: var(--acc); font-size: 12px; cursor: pointer; font-family: 'JetBrains Mono', monospace; }

.dash-chat { display: flex; flex-direction: column; min-height: 0; background: var(--bg-2); }
.chat-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.chat-head .name { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.chat-head .stat { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-3); margin-left: auto; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.msg { max-width: 92%; padding: 11px 14px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.msg.bot { background: var(--panel); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 3px; }
.msg.me { background: var(--acc); color: var(--bg); align-self: flex-end; border-bottom-right-radius: 3px; font-weight: 500; }
.chat-input { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.chat-input textarea { flex: 1; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 6px; font: inherit; font-size: 13px; outline: none; resize: none; background: var(--panel); color: var(--ink); font-family: inherit; }
.chat-input textarea:focus { border-color: var(--acc); }
.chat-send { padding: 0 14px; background: var(--acc); color: var(--bg); border: 0; border-radius: 6px; font-size: 13px; cursor: pointer; font-weight: 600; }
.typing { display: inline-flex; gap: 4px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: bounce 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%,80%,100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-4px); opacity: 1; } }

/* === Аватар-чип залогиненного пользователя в шапке === */
.user-chip { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; font-family: 'JetBrains Mono', monospace; }
.user-chip .av { width: 24px; height: 24px; border-radius: 5px; background: var(--acc); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 12px; }

/* === Деталки услуг (vibe/ops/mcu, шаблон inc/service-page.php) === */
.svc-hero { padding: 56px 0 48px; border-bottom: 1px solid var(--line); }
.svc-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 36px; }
.svc-meta .cell { padding: 18px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.svc-meta .cell .lbl { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 6px; }
.svc-meta .cell .val { font-family: 'JetBrains Mono', monospace; font-size: 20px; color: var(--ink); font-weight: 500; }
.deliv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.deliv li { list-style: none; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.deliv li::before { content: "▸"; color: var(--acc); font-weight: 600; font-family: 'JetBrains Mono', monospace; }

/* === Таймлайн «путь» на /about === */
/* Row = 3 колонки: год | точка-маркер | текст. */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-row { display: grid; grid-template-columns: 80px 24px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.tl-row .y { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--acc); padding-top: 2px; }
.tl-row .pip { width: 24px; display: flex; justify-content: center; padding-top: 6px; }
.tl-row .pip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
.tl-row h4 { margin-bottom: 4px; font-size: 16px; }
.tl-row p { font-size: 13.5px; color: var(--ink-2); }

/* === Хобби-галерея (about) === */
/* 6 карточек с фиксированными градиентными плейсхолдерами под фото.
 * .cap::before — затемнение снизу для читаемости подписи поверх фона. */
.hobby-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hobby-card { aspect-ratio: 4/5; border-radius: 10px; overflow: hidden; position: relative; background: var(--panel); border: 1px solid var(--line); }
.hobby-card .ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.hobby-card .cap { position: absolute; left: 14px; bottom: 14px; right: 14px; font-size: 13.5px; color: var(--ink); z-index: 2; }
.hobby-card .cap b { display: block; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--cyan); margin-bottom: 4px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; }
.hobby-card.yacht .ph { background: linear-gradient(135deg, #1a3a5e 0%, #0d2238 100%); color: rgba(91,141,239,0.4); }
.hobby-card.plane .ph { background: linear-gradient(135deg, #4a3a1a 0%, #2d2010 100%); color: rgba(232,183,90,0.4); }
.hobby-card.mcu .ph { background: linear-gradient(135deg, #1f3a1a 0%, #102010 100%); color: rgba(87,199,133,0.4); }
.hobby-card.camp .ph { background: linear-gradient(135deg, #2a3d1f 0%, #15200f 100%); color: rgba(87,199,133,0.4); }
.hobby-card.fish .ph { background: linear-gradient(135deg, #1d3845 0%, #0e1c25 100%); color: rgba(77,208,225,0.4); }
.hobby-card.print .ph { background: linear-gradient(135deg, #3a1f1f 0%, #1d0f0f 100%); color: rgba(233,140,140,0.4); }
.hobby-card .cap::before { content: ""; position: absolute; inset: 0; top: -40px; background: linear-gradient(to top, rgba(10,13,18,0.95) 0%, transparent 100%); z-index: -1; }


/* ════════════════════════════════════════════════════════════════ */
/* RESPONSIVE — tablet, mobile + small-screen polish                */
/* ════════════════════════════════════════════════════════════════ */

/* Tablet ≤ 1024 ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .bar-search { display: none; }
  h1 { font-size: 52px; }
  h2 { font-size: 30px; }
  .bar { padding: 12px 24px; gap: 14px; }
  .bar::after { left: 24px; right: 24px; }
  .nav-tabs { margin-left: 4px; }
  .nav-tabs a { padding: 6px 10px; font-size: 12.5px; }
  .bar-search { width: 200px; }
  .foot { padding: 36px 24px; grid-template-columns: 1fr 1fr 1fr; gap: 28px; }
  .foot > div:first-child { grid-column: 1 / -1; max-width: 600px; }
  .shell, .shell-x { padding: 0 24px; }
  /* Подгоняем разделитель блоков под новый padding .shell */
  section.shell.block::before { left: 24px; right: 24px; }
  .crumb { padding: 16px 24px; }
  .svc-hero { padding: 40px 0 36px; }
}

/* Tablet ≤ 900 — narrower nav + stack some grids ────────── */
/* На этой ширине прячем верхнюю навигацию и показываем бургер.
 * Селекторы [style*="..."] перехватывают inline-grid'ы, которые поставлены
 * прямо в .php (без классов) — без них пришлось бы переписывать вёрстку. */
@media (max-width: 900px) {
  .bar { padding: 12px 20px; gap: 10px; }
  .bar::after { left: 20px; right: 20px; }
  .nav-tabs { display: none !important; }
  .bar-burger { display: inline-flex; }
  .bar-actions .btn { padding: 7px 12px; font-size: 12.5px; }
  .bar-actions .btn:first-child { display: none; }

  /* Hero blocks stack */
  section.shell[style*="grid-template-columns:1.3fr 1fr"],
  section.shell[style*="grid-template-columns:1.4fr 1fr"],
  section[style*="grid-template-columns:1.3fr 1fr"],
  section[style*="grid-template-columns:1.4fr 1fr"],
  div[style*="grid-template-columns:1.3fr 1fr"],
  div[style*="grid-template-columns:1.4fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  /* Service grid → 1 col */
  .svc-grid { grid-template-columns: 1fr; }
  /* Service detail 2-col cards → 1 col */
  .deliv { grid-template-columns: 1fr; }
  /* Process + FAQ grids stack */
  div[style*="grid-template-columns:repeat(4,1fr)"] { grid-template-columns: 1fr 1fr !important; }
  div[style*="grid-template-columns:repeat(3,1fr)"] { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
  div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
}

/* Mobile ≤ 640 ─────────────────────────────────────────── */
@media (max-width: 640px) {
  html, body { font-size: 14px; }
  h1 { font-size: 38px; letter-spacing: -0.025em; }
  h2 { font-size: 24px; }
  h3 { font-size: 19px; }
  h4 { font-size: 15px; }
  p.lead { font-size: 15.5px; }

  .shell, .shell-x { padding: 0 16px; }
  /* Разделитель блоков ужимаем под мобильный padding */
  section.shell.block::before { left: 16px; right: 16px; }
  /* H1 на главной — на мобиле сильно меньше (юзер просил «уменьшить») */
  .index-h1 { font-size: 22px !important; line-height: 1.25 !important; margin-top: 10px !important; }
  /* Защита от горизонтального скролла: mobile-nav за viewport должна
   * обрезаться, но обычный overflow:hidden ломает position:sticky на шапке.
   * Используем overflow-x: clip — режет переполнение без scroll-context. */
  html, body { overflow-x: clip !important; max-width: 100vw !important; }
  body.no-scroll { overflow: hidden !important; }
  .bar { padding: 10px 16px; gap: 8px; }
  .bar::after { left: 16px; right: 16px; }
  .brand .v + span, .brand span:last-child { font-size: 13px; }
  .brand-mark { width: 24px; height: 24px; }
  .crumb { padding: 12px 16px; font-size: 10.5px; }
  .crumb .sep { margin: 0 6px; }

  section.block { padding: 40px 0; }
  .section-head { margin-bottom: 24px; }

  /* Buttons + actions full width on mobile where it makes sense */
  .btn-lg { padding: 10px 16px; font-size: 13px; }

  /* Stack ALL 2/3/4 col grids */
  div[style*="grid-template-columns:repeat(4,1fr)"],
  div[style*="grid-template-columns:repeat(3,1fr)"],
  div[style*="grid-template-columns:repeat(2,1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Cards inside */
  .card, .card-flat { padding: 18px !important; }
  .svc-card { min-height: auto; padding: 20px; }
  .svc-hero { padding: 24px 0 28px; }
  .svc-meta { gap: 8px; }
  .svc-meta .cell { padding: 12px 14px; }
  .svc-meta .cell .val { font-size: 16px; }

  /* Section CTA blocks (with inner button) — stack */
  div.card[style*="display:flex;justify-content:space-between;align-items:center"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
  }

  /* Footer */
  .foot { padding: 28px 16px; grid-template-columns: 1fr; gap: 24px; margin-top: 60px; }
  .foot .end { flex-direction: column; gap: 6px; align-items: flex-start; }

  /* Hobby gallery */
  .hobby-grid { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .hobby-card .cap { font-size: 12.5px; left: 10px; right: 10px; bottom: 10px; }

  /* Timeline */
  .tl-row { grid-template-columns: 70px 18px 1fr; gap: 12px; padding: 14px 0; }

  /* KPIs */
  .kpi { padding: 14px 16px; }
  .kpi .val { font-size: 22px; }

  /* Form */
  .field input, .field textarea, .field select { padding: 12px 14px; font-size: 16px; /* prevent iOS zoom */ }

  /* Contact: side cards single col handled above */
  .login-card { padding: 28px 22px; max-width: 100%; }
  .login-card h2 { font-size: 22px; }

  /* Hide the search command pill on hero stats card (overflow risk) */

  /* Dashboard — sidebar to top, chat below content */
  .dash-shell { grid-template-columns: 1fr; min-height: auto; }
  .dash-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 12px; }
  .dash-side .user { margin-bottom: 12px; }
  .dash-side ul { flex-direction: row; flex-wrap: wrap; gap: 6px; margin-bottom: 0; }
  .dash-side li { flex: 0 1 auto; padding: 8px 12px; font-size: 12.5px; }
  .dash-side li .badge { margin-left: 4px; }
  .dash-side h5:not(:first-of-type), .dash-side ul:last-of-type { display: none; }
  .dash-main { grid-template-columns: 1fr; }
  .dash-content { padding: 20px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .dash-content h2 { font-size: 22px; }
  .dash-chat { min-height: 480px; }
  .proj-row { grid-template-columns: 28px 1fr 70px; gap: 10px; padding: 12px 0; font-size: 13px; }
  .proj-row .st, .proj-row .ac { display: none; }
  .proj-row .sz { font-size: 11px; }

  /* Service detail page CTA panel */
  .card[style*="background:linear-gradient"] { padding: 24px !important; }

  /* The home page activity grid (DEPLOY/ALERT/COMMIT) — already covered */

  /* Bar actions on mobile — only show primary CTA */
  .bar-actions .btn-acc { padding: 6px 10px; font-size: 12px; }

  /* User chip — compact */
  .user-chip { padding: 4px 10px 4px 4px; font-size: 11.5px; }
  .user-chip .av { width: 22px; height: 22px; font-size: 11px; }
}

/* Very small ≤ 380 ─────────────────────────────────────── */
@media (max-width: 380px) {
  h1 { font-size: 32px; }
  .brand-text-extra { display: none; }
  .bar-actions { gap: 4px; }
}

/* Polish — reduced motion ─────────────────────────────── */
/* Уважаем prefers-reduced-motion — отключаем все анимации/переходы.
 * !important нужен, потому что много inline-transition в шаблонах. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .typing span { animation: none !important; }
}

/* Polish — focus states ──────────────────────────────── */
.btn:focus-visible, .field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible, a:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
button { font-family: inherit; }

/* Polish — smooth scroll only on user trigger */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ═══════════ Mobile burger + nav overlay ═══════════ */
.bar-burger { display: none; background: transparent; border: 1px solid var(--line); color: var(--ink); width: 38px; height: 36px; border-radius: 8px; cursor: pointer; padding: 0; flex-direction: column; gap: 4px; justify-content: center; align-items: center; }
.bar-burger span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 1px; }
.bar-burger:hover { background: var(--bg-2); }

.mobile-nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 9996; }
.mobile-nav-backdrop.open { display: block; }

.mobile-nav { position: fixed; top: 0; right: -100%; width: 84%; max-width: 320px; height: 100vh; height: 100dvh; background: #141923; border-left: 1px solid var(--line); padding: 64px 18px 24px; display: flex; flex-direction: column; gap: 4px; z-index: 9997; transition: right .22s ease; overflow-y: auto; visibility: hidden; box-shadow: -10px 0 30px rgba(0,0,0,0.4); }
.mobile-nav.open { right: 0; visibility: visible; }
/* Glass-тема: matte светлый фон с blur */
html[data-theme="glass"] .mobile-nav { background: rgba(248,246,242,0.97); border-left-color: rgba(20,20,40,0.12); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
html[data-theme="glass"] .mobile-nav-backdrop { background: rgba(20,20,40,0.35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
/* Light-тема: бумажный фон */
html[data-theme="light"] .mobile-nav { background: #f8f6f2; border-left-color: rgba(80,70,40,0.12); }
.mobile-nav-title { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 10px; padding: 0 12px; }
.mobile-nav a { padding: 13px 14px; color: var(--ink-2); text-decoration: none; border-radius: 8px; font-size: 15px; font-family: 'JetBrains Mono', monospace; transition: background .12s, color .12s; }
.mobile-nav a:hover, .mobile-nav a.on { background: var(--bg-2); color: var(--ink); }
.mobile-nav a.on { color: var(--acc); }
.mobile-nav .mobile-nav-cta { margin-top: 18px; text-align: center; }
.mobile-nav-close { position: absolute; top: 14px; right: 16px; background: transparent; border: 0; color: var(--ink-2); font-size: 28px; cursor: pointer; line-height: 1; padding: 4px 10px; border-radius: 8px; }
.mobile-nav-close:hover { background: var(--bg-2); color: var(--ink); }

@media (max-width: 900px) {
  .bar-burger { display: inline-flex; }
}

/* ═══════════ Mobile inline-style overrides ═══════════ */
/* Множество публичных PHP-страниц используют inline-стили вида
 * style="padding:64px 40px 80px" — на мобиле эти отступы избыточны.
 * Перебиваем атрибут-селектором + !important. Грубо, но не требует
 * переписывания вёрстки во всех файлах. */
@media (max-width: 640px) {
  /* Index hero — kill inline padding 64px 40px 80px */
  section.shell[style*="padding:64px 40px 80px"] { padding: 36px 16px 48px !important; gap: 28px !important; }
  /* Contact, services hero — kill inline padding 48px 40px ... */
  section.shell[style*="padding:48px 40px"] { padding: 32px 16px 16px !important; }
  /* Big inline h1 60px (contact) and 56px (services) → 32-36 */
  h1[style*="font-size:60px"] { font-size: 34px !important; line-height: 1.15 !important; }
  h1[style*="font-size:56px"] { font-size: 32px !important; line-height: 1.15 !important; }
  /* Hero text size 32px (contact "Расскажите задачу") */
  h2[style*="font-size:32px"] { font-size: 22px !important; line-height: 1.2 !important; }
  h2[style*="font-size:30px"] { font-size: 22px !important; line-height: 1.2 !important; }
  /* Services list card: 80px icon | text | 240px price → stack */
  a.card[style*="grid-template-columns:80px 1fr 240px"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    padding: 20px !important;
  }
  a.card[style*="grid-template-columns:80px 1fr 240px"] > div:last-child {
    text-align: left !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
  }
  /* 3-column inline grids (KPI status card) → 2 columns */
  div[style*="grid-template-columns:1fr 1fr 1fr"] { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  /* Section padding 48px on CTA cards */
  div.card[style*="padding:48px"] { padding: 24px !important; }
  /* Contact: card with form padding 32px → 20px */
  div.card[style*="padding:32px"] { padding: 20px !important; }
  /* Avoid horizontal overflow from hero code */
  .hero-code { max-width: 100%; }
  .hero-code-body { font-size: 11.5px; padding: 14px; }
  /* Lead paragraph on hero */
  .lead { font-size: 15px !important; }
}

@media (max-width: 380px) {
  .hero-code-body { font-size: 10.5px; padding: 12px; }
  section.shell[style*="padding:64px 40px 80px"] { padding: 28px 12px 36px !important; }
  section.shell[style*="padding:48px 40px"] { padding: 24px 12px 12px !important; }
  h1[style*="font-size:60px"] { font-size: 28px !important; }
  h1[style*="font-size:56px"] { font-size: 26px !important; }
}


/* ════════════════════════════════════════════════════════════════ */
/* THEME — light mode (data-theme="light" on <html>)                */
/* ════════════════════════════════════════════════════════════════ */
html[data-theme="light"] {
  --bg: #f7f5ef;
  --bg-2: #f0ede4;
  --panel: #ffffff;
  --panel-2: #f5f3eb;
  --panel-3: #e8e4d8;
  --line: #e2ddd0;
  --line-2: #c8c1b0;
  --ink: #1a1814;
  --ink-2: #4a4538;
  --ink-3: #807a6b;
  --ink-4: #a8a294;
  --acc: #3458c4;
  --acc-d: #2444a8;
  --acc-soft: #dde6f8;
  --cyan: #1d97a6;
  --green: #2e8552;
  --amber: #9c7820;
  --pink: #b04848;
}
html[data-theme="light"] body { color: var(--ink); }

/* Component-level adjustments for light theme */
html[data-theme="light"] .bar { background: rgba(247,245,239,0.92); }
html[data-theme="light"] .bar-burger { background: var(--panel); border-color: var(--line-2); }
html[data-theme="light"] .brand-mark { background: #fff; }
html[data-theme="light"] .btn-acc { color: #fff; }
html[data-theme="light"] .login-card { box-shadow: 0 40px 100px -40px rgba(80,70,40,0.25); }
html[data-theme="light"] .login-wrap::before { background: radial-gradient(ellipse at center, rgba(52,88,196,0.10) 0%, transparent 60%); }
html[data-theme="light"] .post-card { box-shadow: 0 2px 8px -2px rgba(80,70,40,0.06); }
html[data-theme="light"] .post-card:hover { box-shadow: 0 12px 30px -8px rgba(80,70,40,0.12); }
html[data-theme="light"] .post-body code { background: var(--panel-2); color: var(--cyan); }
html[data-theme="light"] .post-callout { background: #f0e8d4; border-color: var(--amber); }
html[data-theme="light"] .post-callout-tag { color: var(--amber); }
html[data-theme="light"] .post-code { background: var(--panel-2); }
html[data-theme="light"] .post-code code { color: var(--ink); }
html[data-theme="light"] .post-body blockquote { color: var(--ink); }
html[data-theme="light"] .post-body strong { color: var(--ink); }
html[data-theme="light"] .post-body em { color: var(--ink-2); }
html[data-theme="light"] .post-body a { color: var(--acc); }
html[data-theme="light"] .slider-bar input[type=range]::-webkit-slider-runnable-track { background: var(--panel-2); }
html[data-theme="light"] .slider-bar input[type=range]::-webkit-slider-thumb { border-color: var(--bg); box-shadow: 0 2px 8px rgba(52,88,196,0.3); }
/* :has() — современный селектор «родитель toggle, у которого внутри
 * есть отмеченный input». Поддерживается во всех таргет-браузерах (Chrome 105+,
 * Safari 15.4+, Firefox 121+) — fallback не нужен. */
html[data-theme="light"] .toggle:has(input:checked) { background: var(--acc-soft); }
html[data-theme="light"] .msg.me { color: #fff; }
html[data-theme="light"] .proj-row .ic { background: var(--acc-soft); color: var(--acc); }
html[data-theme="light"] .post-hero { box-shadow: 0 30px 80px -36px rgba(80,70,40,0.22); }
html[data-theme="light"] .chat-input textarea { background: var(--bg); }
html[data-theme="light"] .calc-tabs button:hover { background: var(--bg-2); }
html[data-theme="light"] .blog-filter button:hover { background: var(--bg-2); }
/* Background hobby gradients should stay dark (they're decorative photos) */
/* TG window keeps dark (Telegram's actual UI) — already hardcoded colors */

/* ════════════════════════════════════════════════════════════════ */
/* THEME — liquid glass (data-theme="glass" on <html>) · ДЕФОЛТ      */
/* ════════════════════════════════════════════════════════════════ */
/* «Жидкое стекло» в стиле Apple iOS 26 / macOS Tahoe:               */
/*   • светлый цветной градиент-фон (фиолетово-розово-голубой)       */
/*   • полупрозрачные панели + backdrop-filter blur (frosted glass)  */
/*   • мягкие тени, увеличенные скругления                           */
/*   • вибрантный индиго-акцент                                      */
/* Применяется ко всем компонентам через переменные + override'ы для */
/* `.bar`, `.card`, `.panel` где нужен blur-эффект.                  */
html[data-theme="glass"] {
  --bg:       #f3f0fa;
  --bg-2:     #ebe6f7;
  --panel:    rgba(255, 255, 255, 0.62);
  --panel-2:  rgba(255, 255, 255, 0.48);
  --panel-3:  rgba(255, 255, 255, 0.32);
  --line:     rgba(20, 20, 40, 0.08);
  --line-2:   rgba(20, 20, 40, 0.16);
  --ink:      #0a1525;
  --ink-2:    #3a4560;
  --ink-3:    #6a7590;
  --ink-4:    #9aa0b8;
  --acc:      #5b59ff;
  --acc-d:    #4644cc;
  --acc-soft: rgba(91, 89, 255, 0.12);
  --cyan:     #06b6d4;
  --green:    #10b981;
  --amber:    #f59e0b;
  --pink:     #ec4899;
}
/* Базовый фон — мягкий цветной mesh-градиент через body::before, чтобы
 * полупрозрачные панели было сквозь что просвечивать. */
html[data-theme="glass"] body {
  color: var(--ink);
  background: linear-gradient(135deg, #eef0ff 0%, #f5edff 35%, #ffedf5 70%, #edf6ff 100%);
  background-attachment: fixed;
  min-height: 100vh;
  position: relative;
}
html[data-theme="glass"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(at 12% 18%, rgba(91, 89, 255, 0.22) 0px, transparent 45%),
    radial-gradient(at 88% 22%, rgba(236, 72, 153, 0.18) 0px, transparent 50%),
    radial-gradient(at 18% 88%, rgba(6, 182, 212, 0.18) 0px, transparent 50%),
    radial-gradient(at 82% 80%, rgba(245, 158, 11, 0.16) 0px, transparent 50%);
  pointer-events: none;
}

/* Frosted-glass для всех «карточных» поверхностей. backdrop-filter
 * требует прозрачный background — иначе размытие не видно. */
html[data-theme="glass"] .bar { background: rgba(255,255,255,0.55); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); border-bottom: 1px solid var(--line); }
html[data-theme="glass"] .bar-burger { background: rgba(255,255,255,0.6); backdrop-filter: blur(12px); border-color: var(--line-2); }
html[data-theme="glass"] .card,
html[data-theme="glass"] .panel,
html[data-theme="glass"] .kpi,
html[data-theme="glass"] .svc-card,
html[data-theme="glass"] .calc-controls,
html[data-theme="glass"] .calc-result,
html[data-theme="glass"] .calc-tabs,
html[data-theme="glass"] .blog-filter,
html[data-theme="glass"] .toggle,
html[data-theme="glass"] .post-card,
html[data-theme="glass"] .dash-side,
html[data-theme="glass"] .dash-content,
html[data-theme="glass"] .dash-chat,
html[data-theme="glass"] .login-card {
  background: rgba(255,255,255,0.55);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 8px 32px -8px rgba(20,30,60,0.10), inset 0 1px 0 rgba(255,255,255,0.6);
}
html[data-theme="glass"] .card:hover,
html[data-theme="glass"] .svc-card:hover,
html[data-theme="glass"] .post-card:hover {
  box-shadow: 0 16px 48px -12px rgba(20,30,60,0.18), inset 0 1px 0 rgba(255,255,255,0.8);
  border-color: rgba(91,89,255,0.35);
}

html[data-theme="glass"] .brand-mark { background: rgba(255,255,255,0.6); box-shadow: 0 4px 12px -2px rgba(91,89,255,0.25); }
html[data-theme="glass"] .btn { background: rgba(255,255,255,0.6); backdrop-filter: blur(12px); border: 1px solid rgba(20,20,40,0.10); color: var(--ink); }
html[data-theme="glass"] .btn:hover { background: rgba(255,255,255,0.85); border-color: var(--acc); }
html[data-theme="glass"] .btn-acc { background: linear-gradient(135deg, var(--acc) 0%, #7c7aff 100%); color: #fff; border: 0; box-shadow: 0 6px 20px -4px rgba(91,89,255,0.5); }
html[data-theme="glass"] .btn-acc:hover { background: linear-gradient(135deg, var(--acc-d) 0%, var(--acc) 100%); }
html[data-theme="glass"] .field input,
html[data-theme="glass"] .field textarea,
html[data-theme="glass"] .field select,
html[data-theme="glass"] .chat-input textarea { background: rgba(255,255,255,0.7); backdrop-filter: blur(8px); border: 1px solid rgba(20,20,40,0.10); color: var(--ink); }
html[data-theme="glass"] .field input:focus,
html[data-theme="glass"] .field textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
html[data-theme="glass"] .post-body code { background: rgba(91,89,255,0.10); color: var(--acc-d); }
html[data-theme="glass"] .post-callout { background: rgba(245,158,11,0.10); border-color: var(--amber); backdrop-filter: blur(8px); }
html[data-theme="glass"] .post-callout-tag { color: var(--amber); }
html[data-theme="glass"] .post-code { background: rgba(255,255,255,0.65); backdrop-filter: blur(12px); border: 1px solid var(--line); }
html[data-theme="glass"] .post-code code { color: var(--ink); }
html[data-theme="glass"] .post-body strong { color: var(--ink); }
html[data-theme="glass"] .post-body a { color: var(--acc); border-bottom: 1px solid var(--acc-soft); }
html[data-theme="glass"] .slider-bar input[type=range]::-webkit-slider-runnable-track { background: rgba(255,255,255,0.5); }
html[data-theme="glass"] .slider-bar input[type=range]::-webkit-slider-thumb { background: var(--acc); border-color: #fff; box-shadow: 0 4px 12px rgba(91,89,255,0.4); }
html[data-theme="glass"] .toggle:has(input:checked) { background: rgba(91,89,255,0.18); border-color: var(--acc); }
html[data-theme="glass"] .post-hero { box-shadow: 0 30px 80px -36px rgba(91,89,255,0.30); }
html[data-theme="glass"] .calc-tabs button.on { background: linear-gradient(135deg, var(--acc), #7c7aff); color: #fff; box-shadow: 0 4px 12px -2px rgba(91,89,255,0.4); }
html[data-theme="glass"] .calc-tabs button:hover { background: rgba(91,89,255,0.08); color: var(--acc); }
html[data-theme="glass"] .blog-filter button.on { background: linear-gradient(135deg, var(--acc), #7c7aff); color: #fff; }
html[data-theme="glass"] .blog-filter button:hover { background: rgba(91,89,255,0.08); color: var(--acc); }
html[data-theme="glass"] .msg.me { color: #fff; }
html[data-theme="glass"] .proj-row .ic { background: var(--acc-soft); color: var(--acc); }
html[data-theme="glass"] .login-wrap::before { background: radial-gradient(ellipse at center, rgba(91,89,255,0.18) 0%, transparent 60%); }

/* === Кнопка переключения темы === */
/* Три SVG-иконки (moon/sun/glass) лежат в кнопке всегда, видна только
 * актуальная — определяется по html[data-theme] (см. theme.js). */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); cursor: pointer; padding: 0; transition: all .15s; }
.theme-toggle:hover { border-color: var(--ink-3); }
.theme-toggle svg { width: 16px; height: 16px; }
/* По умолчанию ничего не показано — нужный значок включится ниже */
.theme-toggle .ic-sun, .theme-toggle .ic-moon, .theme-toggle .ic-glass { display: none; }
/* dark — луна */
html[data-theme="dark"] .theme-toggle .ic-moon { display: block; }
/* light — солнце */
html[data-theme="light"] .theme-toggle .ic-sun { display: block; }
/* glass (дефолт) — иконка-«капля стекла» */
html[data-theme="glass"] .theme-toggle .ic-glass { display: block; }
html[data-theme="glass"] .theme-toggle { color: var(--acc); background: rgba(255,255,255,0.65); backdrop-filter: blur(12px); border-color: rgba(91,89,255,0.25); }

/* === Плавный переход при смене темы ===
 * Транзишены только на цвета фона/текста/границ, чтобы избежать рендер-jank
 * на сложных компонентах. Не транзишеним shadow/transform. */
html { transition: background-color .25s, color .25s; }
body { transition: background-color .25s, color .25s; }
.card, .card-flat, .svc-card, .kpi, .panel, .post-card, .toggle, .login-card, .dash-side, .dash-content, .dash-chat, .calc-controls, .calc-result, .calc-tabs, .blog-filter, .field input, .field textarea, .field select, .chat-input textarea {
  transition: background-color .2s, border-color .2s, color .2s;
}


/* ════════════════════════════════════════════════════════════════ */
/* OMNI · ⌘K command palette                                        */
/* Модальное окно поиска по сайту (см. search.js). Открывается через  */
/* Cmd/Ctrl+K или клик по .bar-search. Анимации: fade backdrop +     */
/* pop-scale панели. z-index 200 поверх sticky-шапки (50).           */
/* ════════════════════════════════════════════════════════════════ */
.omni { position: fixed; inset: 0; z-index: 200; display: none; }
.omni.on { display: block; }
.omni-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); animation: omni-fade 0.15s ease both; }
html[data-theme="light"] .omni-backdrop { background: rgba(80,70,40,0.35); }
@keyframes omni-fade { from { opacity: 0; } to { opacity: 1; } }
.omni-panel { position: absolute; left: 50%; top: 12vh; transform: translateX(-50%); width: 92%; max-width: 640px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 40px 100px -20px rgba(0,0,0,0.6); overflow: hidden; animation: omni-pop 0.18s cubic-bezier(.2,.7,.3,1) both; }
html[data-theme="light"] .omni-panel { box-shadow: 0 40px 100px -30px rgba(80,70,40,0.25); }
@keyframes omni-pop { from { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(0.97); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
.omni-input-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.omni-prompt { font-size: 14px; color: var(--acc); }
.omni-input { flex: 1; background: transparent; border: 0; outline: none; color: var(--ink); font-size: 16px; font-family: 'Inter', sans-serif; }
.omni-input::placeholder { color: var(--ink-3); }
.omni-hint { font-size: 10px; color: var(--ink-3); padding: 2px 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; }
.omni-results { max-height: 50vh; overflow-y: auto; }
.omni-row { display: flex; align-items: center; gap: 16px; padding: 12px 18px; cursor: pointer; border-bottom: 1px solid var(--line); }
.omni-row.on { background: var(--acc-soft); }
.omni-row-left { flex: 1; min-width: 0; }
.omni-row-title { font-size: 14px; color: var(--ink); font-weight: 500; }
.omni-row.on .omni-row-title { color: var(--acc); }
.omni-row-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.omni-row-kind { font-size: 10.5px; color: var(--ink-3); padding: 3px 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 99px; flex: 0 0 auto; }
.omni-row mark { background: var(--amber); color: var(--bg); padding: 0 1px; border-radius: 2px; }
html[data-theme="light"] .omni-row mark { background: #ffe898; color: var(--ink); }
.omni-empty { padding: 24px 18px; font-size: 13px; color: var(--ink-3); text-align: center; }
.omni-foot { display: flex; gap: 18px; padding: 10px 18px; background: var(--bg-2); border-top: 1px solid var(--line); font-size: 10.5px; color: var(--ink-3); }
.omni-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* === Hero-код на главной === */
/* «Терминальное окошко» с псевдо-исходником на главной.
 * Цвета синтаксиса (hc-k/hc-f/hc-v/...) задаются здесь жёстко,
 * темы перебивают только пару контрастных оттенков ниже. */
.hero-code { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 16px; box-shadow: 0 20px 60px -30px rgba(0,0,0,.5); }
.hero-code-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.hero-code-bar .hc-dot { width: 11px; height: 11px; border-radius: 50%; opacity: .85; }
.hero-code-bar .hc-dot.r { background: #e0716e; }
.hero-code-bar .hc-dot.a { background: #e8b75a; }
.hero-code-bar .hc-dot.g { background: #57c785; }
.hero-code-bar .hc-title { margin-left: 10px; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.04em; }
.hero-code-body { margin: 0; padding: 22px 22px 26px; font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 14.5px; line-height: 1.75; color: var(--ink); overflow-x: auto; background: transparent; }
.hero-code-body code { font-family: inherit; background: transparent; padding: 0; border: 0; color: inherit; }
.hero-code .hc-c { color: var(--ink-3); font-style: italic; }
.hero-code .hc-k { color: #c678dd; }   /* keyword */
.hero-code .hc-f { color: var(--cyan); }
.hero-code .hc-v { color: #e06c75; }   /* variable */
.hero-code .hc-p { color: var(--amber); }
.hero-code .hc-s { color: var(--green); }
.hero-code .hc-o { color: var(--ink-3); }
html[data-theme="light"] .hero-code .hc-k { color: #a626a4; }
html[data-theme="light"] .hero-code .hc-v { color: #e45649; }
html[data-theme="light"] .hero-code .hc-f { color: #4078f2; }
@media (max-width: 720px) {
  .hero-code-body { font-size: 12.5px; padding: 16px; }
}

/* === Юр. страницы (oferta, privacy, 404) === */
/* HTML рендерится из data/legal-pages.json как «сырая» простыня —
 * стили задают типографику только для тегов h2/p/ul/a внутри .legal-body. */
.legal-body { color: var(--ink-2); font-size: 15px; line-height: 1.75; display: flex; flex-direction: column; gap: 18px; }
.legal-body h2 { font-size: 22px; color: var(--ink); margin-top: 14px; }
.legal-body p { margin: 0; }
.legal-body ul { padding-left: 22px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.legal-body a { color: var(--acc); }
.legal-body .mono { font-family: 'JetBrains Mono', monospace; font-size: 13.5px; }
.legal-demo-note { margin-top: 32px; padding: 18px; background: var(--bg-2); border: 1px dashed var(--line); border-radius: 8px; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }
/* ═══════════════════════════════════════════════════════════════
   Hero-сцена «рабочее место инженера» — профиль, печатает
   Вставить в site/style.css. Все цвета — через var(--…), темы dark/light/warm.
   Анимация играет всегда (не глушится prefers-reduced-motion).
   ═══════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────────
   Hero-сцена «рабочее место инженера»
   inline SVG · чистый CSS-анимации · темизация через var(--…)
   ─────────────────────────────────────────────────────────────── */
/* .card.hero-scene — двойной класс даёт специфичность (0,2,0), которая бьёт
   themed-правила вида html[data-theme="glass"] .card (0,1,1).
   Без этого glass-карточка с rgba(255,255,255,0.55) закрашивает сцену белым. */
/* !important тут оправдан: перебиваем themed-стили .card на всех 3 темах
   (glass — белая полупрозрачная плёнка + backdrop-filter; dark/light — фон --panel) */
.card.hero-scene{
  position:relative !important;width:100% !important;aspect-ratio:4/3 !important;
  background:rgba(255,255,255,0.50) !important;
  border:none !important;
  padding:0 !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
  box-shadow:none !important;
  border-radius:14px;overflow:hidden;
}
.hero-scene-svg{position:absolute;inset:0;width:100%;height:100%;display:block}

/* base ink line + surface fills (all theme-driven) */
.hsc .s{fill:none;stroke:var(--ink-3);stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.hsc .s2{fill:none;stroke:var(--ink-4);stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}
.hsc .p1{fill:var(--panel)}
.hsc .p2{fill:var(--panel-2)}
.hsc .p3{fill:var(--panel-3)}
.hsc .bgf{fill:var(--bg-2)}
.hsc .ln{stroke:var(--line-2);stroke-width:1.2;fill:none}
.hsc text{font-family:'JetBrains Mono',monospace;fill:var(--ink-3)}
.hsc .c-cy{fill:var(--cyan)} .hsc .st-cy{stroke:var(--cyan)}
.hsc .c-gr{fill:var(--green)} .hsc .st-gr{stroke:var(--green)}
.hsc .c-am{fill:var(--amber)} .hsc .st-am{stroke:var(--amber)}
.hsc .c-pk{fill:var(--pink)} .hsc .st-pk{stroke:var(--pink)}
.hsc .c-ac{fill:var(--acc)} .hsc .st-ac{stroke:var(--acc)}
.hsc .skin{fill:var(--amber);opacity:.85}

/* ── person: breathing + head nod ── */
.hsc-person{animation:hsc-breathe 4.5s ease-in-out infinite;transform-origin:450px 360px}
@keyframes hsc-breathe{0%,100%{transform:translateY(0) scaleY(1)}50%{transform:translateY(-2px) scaleY(1.016)}}
.hsc-head{animation:hsc-headtilt 6s ease-in-out infinite;transform-box:fill-box;transform-origin:50% 75%}
@keyframes hsc-headtilt{0%,100%{transform:rotate(0deg)}30%{transform:rotate(2.2deg)}62%{transform:rotate(-1.6deg)}}
/* hands typing — bolder taps */
.hsc-hand-l{animation:hsc-tap 1.35s ease-in-out infinite;transform-box:fill-box;transform-origin:center}
.hsc-hand-r{animation:hsc-tap 1.35s ease-in-out .32s infinite;transform-box:fill-box;transform-origin:center}
@keyframes hsc-tap{0%,100%{transform:translateY(0) rotate(0)}30%{transform:translateY(2.6px) rotate(1.5deg)}60%{transform:translateY(-1.2px)}}

/* ── steam from mug ── */
.hsc-steam{stroke:var(--ink-3);fill:none;stroke-width:1.6;stroke-linecap:round;opacity:0}
.hsc-steam.s1{animation:hsc-steam 3s ease-in-out infinite}
.hsc-steam.s2{animation:hsc-steam 3s ease-in-out 1.2s infinite}
@keyframes hsc-steam{0%{opacity:0;transform:translateY(6px) scaleY(.7)}30%{opacity:.5}70%{opacity:.25}100%{opacity:0;transform:translateY(-10px) scaleY(1.1)}}

/* ── PC tower: spinning fan + RGB + LEDs ── */
.hsc-fan{animation:hsc-spin 1.4s linear infinite;transform-box:fill-box;transform-origin:center}
.hsc-tower-glow{animation:hsc-towerglow 2.6s ease-in-out infinite}
@keyframes hsc-towerglow{0%,100%{opacity:.35}50%{opacity:.8}}
.hsc-router-led{animation:hsc-blink2 1.3s steps(1) infinite}
.hsc-alice{animation:hsc-alice 2.4s ease-in-out infinite}
@keyframes hsc-alice{0%,100%{opacity:.4}50%{opacity:1}}
@keyframes hsc-spin{to{transform:rotate(360deg)}}
.hsc-rgb{animation:hsc-rgb 6s linear infinite}
@keyframes hsc-rgb{0%{opacity:.5}25%{opacity:.85}50%{opacity:.45}75%{opacity:.8}100%{opacity:.5}}
.hsc-led-pw{animation:hsc-pulse 2.2s ease-in-out infinite}
.hsc-led-hdd{animation:hsc-blink 1.1s steps(1) infinite}
@keyframes hsc-pulse{0%,100%{opacity:.4}50%{opacity:1}}
@keyframes hsc-blink{0%,70%{opacity:1}71%,100%{opacity:.15}}

/* ── oscilloscope sine ── */
.hsc-sine{stroke:var(--cyan);fill:none;stroke-width:1.4;stroke-dasharray:120;animation:hsc-sine 3s linear infinite}
@keyframes hsc-sine{from{stroke-dashoffset:120}to{stroke-dashoffset:0}}

/* ── ESP32 + soldering tip + multimeter blink ── */
.hsc-esp-led{animation:hsc-blink2 1.7s steps(1) infinite}
@keyframes hsc-blink2{0%,55%{opacity:1}56%,100%{opacity:.12}}
.hsc-tip{animation:hsc-heat 2.3s ease-in-out infinite}
@keyframes hsc-heat{0%,100%{opacity:.55}50%{opacity:1}}
.hsc-filament{animation:hsc-heat 3.1s ease-in-out infinite}
.hsc-gear{animation:hsc-spin 9s linear infinite;transform-box:fill-box;transform-origin:center}
.hsc-yacht{animation:hsc-rock 5s ease-in-out infinite;transform-box:fill-box;transform-origin:50% 90%}
@keyframes hsc-rock{0%,100%{transform:rotate(-2.2deg)}50%{transform:rotate(2.2deg)}}
.hsc-pennant{animation:hsc-flag 1.8s ease-in-out infinite;transform-box:fill-box;transform-origin:0% 50%}
@keyframes hsc-flag{0%,100%{transform:scaleX(.7)}50%{transform:scaleX(1)}}
.hsc-prop{animation:hsc-spin .25s linear infinite;transform-box:fill-box;transform-origin:center}

/* ── monitor: scrolling code + blinking cursor ── */
.hsc-code-scroll{animation:hsc-scroll 12s linear infinite}
@keyframes hsc-scroll{from{transform:translateY(0)}to{transform:translateY(-50%)}}
.hsc-cursor{animation:hsc-cur 1.05s steps(1) infinite}
@keyframes hsc-cur{0%,55%{opacity:1}56%,100%{opacity:0}}
.hsc-screen-glow{animation:hsc-screenglow 5.5s ease-in-out infinite}
.hsc-screen-glow{opacity:.07;animation:hsc-screenglow 5.5s ease-in-out infinite}
@keyframes hsc-screenglow{0%,100%{opacity:.05}50%{opacity:.1}}

/* code typography inside foreignObject */
.hsc-codebox{font-family:'JetBrains Mono',monospace;font-size:8.2px;line-height:13px;color:var(--ink-2);white-space:pre;padding:2px 6px}
.hsc-codebox .k{color:var(--cyan)} .hsc-codebox .s{color:var(--green)}
.hsc-codebox .n{color:var(--amber)} .hsc-codebox .c{color:var(--ink-3)}
.hsc-codebox .f{color:var(--acc)} .hsc-codebox .p{color:var(--ink-2)}

/* Уважение к настройке «уменьшить движение»: не вырубаем сцену полностью,
   а лишь притормаживаем — фоновая жизнь (вентилятор, код, набор) остаётся,
   но без резких длинных циклов. Полное отключение убрано по просьбе клиента. */
@media (prefers-reduced-motion:reduce){
  .hsc-breathe,.hsc-person,.hsc-head{animation-duration:7s}
}
@media (max-width:900px){
  .hero{grid-template-columns:1fr}
  .hero-scene{aspect-ratio:16/11}
}

/* ───────────────────────────────────────────────────────────────
   Terminal scene — VS Code стиль, авто-прокрутка JS-кода
   HTML + CSS scroll-animation · токены подсвечены span'ами
   ─────────────────────────────────────────────────────────────── */
.card.terminal-scene {
  padding: 0 !important;
  overflow: hidden;
  border-radius: 12px !important;
  background: var(--bg) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  /* растягиваемся до высоты соседнего KPI-блока */
  display: flex;
  flex-direction: column;
}

/* Строка-заголовок в стиле VS Code */
.t-bar {
  display: flex;
  align-items: stretch;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  min-height: 36px;
}
/* Активная вкладка: синяя полоска сверху */
.t-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-2);
  background: var(--panel);
  border-top: 2px solid var(--acc);
  border-right: 1px solid var(--line);
  white-space: nowrap;
}
.t-tab-x { color: var(--ink-4); font-size: 10px; margin-left: 4px; }

/* Область прокрутки — flex:1 чтобы тянуться до высоты соседнего блока */
.t-body { flex: 1; min-height: 0; overflow: hidden; }

/* Двойной блок кода — translateY(-50%) = один полный цикл */
.t-track { animation: t-scroll 32s linear infinite; }
@keyframes t-scroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

/* Блок кода */
.t-pre {
  margin: 0;
  padding: 14px 20px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-2);
  white-space: pre;
  tab-size: 2;
}

/* Синтаксические токены */
.tc-k { color: var(--acc); }                         /* ключевые слова  */
.tc-f { color: var(--cyan); }                        /* функции, классы */
.tc-s { color: var(--green); }                       /* строки          */
.tc-c { color: var(--ink-4); font-style: italic; }   /* комментарии     */
.tc-n { color: var(--amber); }                       /* числа           */
.tc-p { color: var(--ink-3); }                       /* приватные поля  */
