/* SFORD — автосервис Ford в Самаре. Сборка: src/build.py */
:root {
  --ink: #08142b;
  --ink-2: #0d1d3b;
  --ink-3: #142a52;
  --ink-line: rgba(255, 255, 255, .1);
  --ink-text: #eef3fb;
  --ink-muted: #a3b4cf;
  --paper: #f3f6fa;
  --card: #ffffff;
  --text: #0f1a2b;
  --muted: #56657a;
  --line: #e1e7ef;
  --line-2: #cdd7e4;
  --accent: #1f6bff;
  --accent-hi: #4a88ff;
  --accent-ink: #1550c4;       /* ссылки на белом: 6,4:1 */
  --accent-soft: #eaf1ff;
  --accent-bg: #1a5ee6;        /* фон кнопок с белым текстом: 5,1:1 */
  --accent-bg-hi: #144fc4;
  --warm: #ffb547;
  --ok: #17a05d;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 26, 43, .06), 0 8px 24px rgba(15, 26, 43, .06);
  --shadow-lg: 0 24px 60px rgba(4, 10, 24, .35);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-head: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Roboto", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Roboto Mono", monospace;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; letter-spacing: -.02em; margin: 0; color: inherit; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent-bg); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 12px; color: #fff; }
.wrap { width: 100%; max-width: 1220px; margin: 0 auto; padding: 0 24px; }
.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- Шапка ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(8, 20, 43, .9); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--ink-line); color: var(--ink-text); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; flex: none; }
.brand:hover { color: #fff; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font: 800 19px/1 var(--font-head); letter-spacing: .03em; }
.brand-name b { color: var(--accent-hi); font-weight: 800; }
.brand-sub { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a { color: #cfd9e8; text-decoration: none; font-size: 15px; font-weight: 500; padding: 8px 11px; border-radius: 8px; transition: color .15s, background .15s; white-space: nowrap; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav a[aria-current="page"] { color: #fff; background: rgba(31, 107, 255, .22); box-shadow: inset 0 0 0 1px rgba(74, 136, 255, .45); }
.header-phone { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; padding: 9px 14px; border-radius: 10px; background: var(--accent-bg); white-space: nowrap; }
.header-phone:hover { background: var(--accent-bg-hi); color: #fff; }
.menu-btn { display: none; background: transparent; border: 0; color: #fff; padding: 8px; border-radius: 8px; cursor: pointer; }
.menu-btn .ico { width: 26px; height: 26px; }
.menu-btn .ico-close { display: none; }
.menu-btn[aria-expanded="true"] .ico-menu { display: none; }
.menu-btn[aria-expanded="true"] .ico-close { display: block; }
.drawer { display: none; }

/* ---------- Кнопки, чипы ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 13px 20px; border-radius: 12px; font-weight: 650; font-size: 16px; text-decoration: none; border: 0; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s, transform .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-bg); color: #fff; box-shadow: 0 8px 22px rgba(26, 94, 230, .32); }
.btn-primary:hover { background: var(--accent-bg-hi); color: #fff; }
.btn-ghost { background: rgba(255, 255, 255, .08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.btn-ghost:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: #e9f0ff; color: var(--ink); }
.btn-line { background: transparent; color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn-line:hover { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.btn-sm { padding: 9px 14px; font-size: 15px; border-radius: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--card); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 550; box-shadow: inset 0 0 0 1px var(--line-2); border: 0; cursor: pointer; }
.chip small { color: var(--muted); font-weight: 500; }
.chip:hover { color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent-bg); color: #fff; box-shadow: none; }
.chip[aria-pressed="true"] small { color: #dbe6ff; }
.chip .ico { width: 1em; height: 1em; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 10px; }

/* ---------- Герой ---------- */
.hero { position: relative; overflow: hidden; background: var(--ink); color: var(--ink-text); }
.hero picture { position: absolute; inset: 0; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 20, 43, .96) 0%, rgba(8, 20, 43, .82) 45%, rgba(8, 20, 43, .45) 100%), linear-gradient(0deg, rgba(8, 20, 43, .7), transparent 40%); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); gap: 48px; align-items: center; padding: 84px 24px 88px; }
.hero .eyebrow, .dark .eyebrow, .hero-sm .eyebrow { color: #8fb4ff; }
.hero h1 { font-size: clamp(38px, 5.6vw, 66px); font-weight: 800; letter-spacing: -.035em; }
.lead { font-size: 19px; line-height: 1.6; color: inherit; opacity: .9; max-width: 720px; margin: 20px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 26px; color: var(--ink-muted); font-size: 15px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-card { background: rgba(255, 255, 255, .97); color: var(--text); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-lg); }
.hero-card .eyebrow { color: var(--accent-ink); margin-bottom: 4px; }
.hc-head h2 { font-size: 24px; }
.hc-select select { width: 100%; margin: 14px 0 6px; padding: 11px 40px 11px 14px; border-radius: 10px; border: 1.5px solid var(--line-2); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2356657a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px; appearance: none; font-weight: 600; color: var(--text); cursor: pointer; }
.hn-list { list-style: none; }
.hn-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 15px; }
.hn-list li:last-child { border-bottom: 0; }
.hn-list b { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.hc-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 12px; }
.hc-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; text-decoration: none; padding: 6px 0; }
.hc-other { color: var(--muted); }

.hero-sm { background: radial-gradient(1200px 400px at 85% -10%, rgba(31, 107, 255, .35), transparent 60%), var(--ink); color: var(--ink-text); padding: 34px 0 44px; }
.hero-sm h1 { font-size: clamp(30px, 4.2vw, 48px); font-weight: 800; margin-top: 14px; }
.hero-sm .lead { font-size: 18px; color: #d3dceb; opacity: 1; }
.hero-sm .chips.jump { margin-top: 22px; }
.hero-sm .chip { background: rgba(255, 255, 255, .08); color: #e6edf8; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.hero-sm .chip:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--ink-muted); }
.crumbs a { color: #c4d3ea; text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.svc-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 40px; align-items: center; }
.svc-img { border-radius: 18px; box-shadow: var(--shadow-lg); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* ---------- Открыто/закрыто ---------- */
.open-state { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.open-state i { width: 9px; height: 9px; border-radius: 50%; background: #9aa6b6; box-shadow: 0 0 0 4px rgba(154, 166, 182, .18); }
.open-state.is-open { color: #12804a; }
.open-state.is-open i { background: var(--ok); box-shadow: 0 0 0 4px rgba(23, 160, 93, .18); }
.open-state.on-dark { color: #cdd8ea; }
.open-state.on-dark.is-open, .open-state.on-light.is-open { color: #4cd38f; }
.open-state.on-light { color: #cdd8ea; margin-top: 18px; }

/* ---------- Секции ---------- */
.section { padding: 72px 0; }
.section.white { background: #fff; }
.section.dark { background: var(--ink); color: var(--ink-text); }
.section.dark p { color: #c3cfe2; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 800; }
.section-head p { margin: 12px 0 0; color: var(--muted); max-width: 720px; }
.section.dark .section-head p { color: #b9c6db; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 26px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.twocol { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.twocol h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; margin-bottom: 18px; }
.block-title { display: flex; align-items: center; gap: 10px; font-size: 20px; margin-bottom: 16px; }
.block-title .ico { color: var(--accent); }
.checklist, .symptoms, .side-list { list-style: none; }
.checklist li, .symptoms li { display: flex; gap: 10px; padding: 7px 0; }
.checklist .ico { color: var(--ok); margin-top: 3px; }
.symptoms .ico { color: var(--accent); margin-top: 3px; }
.side-list li a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 15px; }
.side-list li a:hover { background: var(--accent-soft); color: var(--accent-ink); }
.side-list li a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.foot-h { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.note { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); color: #23324a; border-radius: 12px; padding: 14px 18px; font-size: 15px; margin: 0 0 26px; }
.note .ico { color: var(--accent); margin-top: 3px; }

/* ---------- Факты ---------- */
.facts-band { background: #fff; border-bottom: 1px solid var(--line); }
.facts-band.light { background: #fff; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.fact { display: flex; gap: 14px; padding: 26px 20px; align-items: flex-start; }
.fact + .fact { border-left: 1px solid var(--line); }
.fact .ico { width: 30px; height: 30px; color: var(--accent); flex: none; }
.fact b { display: block; font-size: 17px; line-height: 1.25; }
.fact span { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

/* ---------- Услуги ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.svc-card { display: flex; flex-direction: column; gap: 8px; padding: 22px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: transform .18s, box-shadow .18s; }
.svc-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(15, 26, 43, .06), 0 16px 34px rgba(15, 26, 43, .1); color: var(--text); }
.svc-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
.svc-ico .ico { width: 24px; height: 24px; }
.svc-title { font: 700 18px/1.25 var(--font-head); }
.svc-text { font-size: 15px; color: var(--muted); line-height: 1.45; flex: 1; }
.svc-more { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-ink); font-weight: 650; font-size: 15px; margin-top: 6px; }
.svc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.svc-aside { position: sticky; top: calc(var(--header-h) + 16px); }
.extra-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; padding: 14px 18px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); font-weight: 650; text-decoration: none; }

/* ---------- Нормы ---------- */
.norms-promo { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: center; }
.np-text h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; margin-bottom: 14px; }
.np-text .btn { margin-top: 10px; }
.np-fams { display: grid; gap: 18px; }
.fam h3 { font-size: 15px; font-weight: 700; color: #8fb4ff; margin-bottom: 10px; letter-spacing: .02em; }
.dark .chip { background: rgba(255, 255, 255, .06); color: #e6edf8; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.dark .chip small { color: #9fb0c9; }
.dark .chip:hover { background: rgba(31, 107, 255, .25); color: #fff; }
.model-switch { background: var(--paper); border-radius: 18px; padding: 8px; }
.ms-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; scrollbar-width: thin; }
.ms-btn { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 10px 14px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font-weight: 650; font-size: 15px; cursor: pointer; text-align: left; line-height: 1.2; }
.ms-btn small { font-weight: 500; color: var(--muted); font-size: 13px; }
.ms-btn:hover { background: #fff; }
.ms-btn.is-active { background: var(--accent-bg); color: #fff; box-shadow: 0 6px 16px rgba(26, 94, 230, .28); }
.ms-btn.is-active small { color: #dbe6ff; }
.ms-panel { background: #fff; border-radius: 14px; margin-top: 8px; padding: 6px 20px 18px; }
.ms-more { margin: 14px 0 0; }
.ms-more a { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; text-decoration: none; }
.norm-h { font-size: 18px; margin: 22px 0 6px; }
.norm-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.norm-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.norm-table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 10px; border-bottom: 1.5px solid var(--line-2); }
.norm-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.norm-table tr:last-child td { border-bottom: 0; }
.norm-table tbody tr:hover td { background: #f8faff; }
.op-name { font-weight: 550; }
.op-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; font-size: 13px; color: var(--muted); }
.op-cond { color: #8a5a00; }
.op-code { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; width: 1%; }
th.op-h, td.op-h { text-align: right; width: 1%; white-space: nowrap; }
.op-h .h { font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink); }
.nv-btn { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; background: none; border: 0; padding: 2px 0; cursor: pointer; color: inherit; font: inherit; }
.nv-btn .h { border-bottom: 1.5px dashed var(--accent); }
.nv-hint { font-size: 12px; color: var(--accent-ink); font-weight: 600; }
.nv-btn[aria-expanded="true"] .h { color: var(--accent-ink); }
.js .nv-row:not(.is-open) { display: none; }
.norm-table tr.nv-row td { padding-top: 0; }
.norm-table tbody tr.nv-row:hover td { background: transparent; }
.nv-list { list-style: none; margin: 0 0 4px; text-align: left; white-space: normal; background: var(--paper); border-radius: 10px; padding: 8px 12px; }
.nv-list li { display: grid; grid-template-columns: 48px 1fr; gap: 8px; padding: 5px 0; font-size: 13px; line-height: 1.4; border-bottom: 1px solid var(--line); }
.nv-list li:last-child { border-bottom: 0; }
.nv-list b { font-variant-numeric: tabular-nums; }
.norm-page .norm-group { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 22px 16px; margin-bottom: 20px; }
.norm-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0 4px; }
.norm-group-head h2 { font-size: 22px; }
.norm-svc { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 14px; text-decoration: none; white-space: nowrap; }
.fam-other { margin-top: 34px; }
.fam-other h2 { font-size: 20px; margin-bottom: 14px; }
.lead-box { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .7fr); gap: 32px; background: #fff; border-radius: 20px; padding: 30px; box-shadow: var(--shadow); align-items: center; }
.lead-box h2 { font-size: 24px; margin-bottom: 10px; }
.lead-box-cta { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; background: var(--accent-soft); border-radius: 16px; padding: 24px; }
.lead-box-cta b { font: 700 20px/1.2 var(--font-head); }
.fam-block { margin-bottom: 36px; }
.fam-block h2 { font-size: 24px; margin-bottom: 16px; }
.model-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.model-card { display: flex; flex-direction: column; gap: 3px; padding: 18px 20px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: transform .15s, box-shadow .15s; }
.model-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15, 26, 43, .06), 0 14px 30px rgba(15, 26, 43, .1); color: var(--text); }
.model-card b { font: 700 18px/1.2 var(--font-head); }
.model-card span { font-size: 14px; color: var(--muted); }
.model-card small { font-size: 13px; color: var(--accent-ink); font-weight: 650; margin-top: 6px; }
.summary-table { border-collapse: separate; border-spacing: 0; font-size: 14px; min-width: 900px; width: 100%; }
.summary-table th, .summary-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: center; font-variant-numeric: tabular-nums; }
.summary-table thead th { font-size: 12.5px; font-weight: 650; color: var(--muted); vertical-align: bottom; line-height: 1.3; border-bottom: 1.5px solid var(--line-2); max-width: 130px; }
.summary-table th[scope="row"], .summary-table thead th:first-child { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; }
.summary-table th[scope="row"] a { font-weight: 700; text-decoration: none; display: block; }
.summary-table th[scope="row"] small { color: var(--muted); font-weight: 500; }
.summary-table tbody tr:hover td, .summary-table tbody tr:hover th { background: #f8faff; }

/* ---------- Работы ---------- */
.works-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.work-card { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-decoration: none; color: var(--text); transition: transform .18s, box-shadow .18s; }
.work-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(15, 26, 43, .06), 0 16px 34px rgba(15, 26, 43, .12); color: var(--text); }
.work-card[hidden] { display: none; }
/* до работы скрипта показываем первые 24 карточки, чтобы подвал не «прыгал» */
.js .works-grid[data-works-grid]:not(.is-ready) .work-card:nth-child(n+25) { display: none; }
.wc-img { position: relative; aspect-ratio: 4 / 3; background: #dfe5ee; overflow: hidden; }
.wc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.work-card:hover .wc-img img { transform: scale(1.04); }
.wc-count { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; background: rgba(8, 20, 43, .72); color: #fff; font-size: 13px; font-weight: 650; padding: 4px 9px; border-radius: 999px; }
.wc-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.wc-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.wc-meta b { color: var(--accent-ink); font-weight: 700; }
.wc-title { font: 700 17px/1.3 var(--font-head); }
.wc-text { font-size: 14.5px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.works-filter { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, .9fr); gap: 12px; background: #fff; padding: 16px; border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.wf-search { position: relative; display: block; }
.wf-search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.wf-search input, .wf-select select { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--text); }
.wf-search input { padding-left: 42px; }
.wf-select select { appearance: none; padding-right: 38px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2356657a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px; cursor: pointer; }
.wf-search input:focus, .wf-select select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 107, 255, .18); }
.wf-kinds { grid-column: 1 / -1; }
.works-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; min-height: 38px; }
.works-count { color: var(--muted); font-size: 15px; margin: 0; }
.only-phone { display: none; }
.works-more { display: flex; justify-content: center; margin-top: 26px; }
.works-empty { text-align: center; color: var(--muted); padding: 40px 0; }
.hero-work h1 { font-size: clamp(26px, 3.6vw, 42px); }
.work-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; color: var(--ink-muted); font-size: 15px; }
.work-meta span { display: inline-flex; align-items: center; gap: 7px; }
.work-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.work-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.work-photos .ph { display: block; border-radius: 12px; overflow: hidden; background: #dfe5ee; aspect-ratio: 4 / 3; cursor: zoom-in; }
.work-photos .ph:first-child { grid-column: 1 / -1; aspect-ratio: auto; max-height: 640px; }
.work-photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.work-photos .ph:first-child img { object-fit: contain; background: #0b1426; max-height: 640px; }
.work-text { position: sticky; top: calc(var(--header-h) + 16px); font-size: 17px; }
.work-text .chips { margin-top: 16px; }
.svc-chips .chip { background: var(--accent-soft); box-shadow: none; color: var(--accent-ink); }
.work-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-weight: 650; }

/* ---------- Лайтбокс ---------- */
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(4, 9, 20, .94); display: flex; align-items: center; justify-content: center; }
.lb[hidden] { display: none; }
.lb img { max-width: calc(100vw - 120px); max-height: calc(100vh - 80px); width: auto; height: auto; border-radius: 6px; }
.lb button { position: absolute; background: rgba(255, 255, 255, .1); border: 0; color: #fff; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.lb button:hover { background: rgba(255, 255, 255, .2); }
.lb button .ico { width: 24px; height: 24px; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%) scaleX(-1); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #cbd5e6; font-size: 14px; }

/* ---------- Шаги, вопросы ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; counter-reset: s; }
.step { position: relative; padding: 24px; border-radius: var(--radius); background: var(--paper); }
.step-n { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-bg); color: #fff; font: 800 18px/1 var(--font-head); margin-bottom: 14px; }
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.faq { display: grid; gap: 10px; }
.faq-item { background: var(--paper); border-radius: 12px; padding: 0 18px; }
.faq-item summary { cursor: pointer; list-style: none; padding: 16px 28px 16px 0; font-weight: 650; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 2px; top: 12px; font-size: 22px; color: var(--accent); font-weight: 500; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 0 0 16px; color: #334257; }

/* ---------- Контакты ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 24px; align-items: stretch; }
.contact-card { padding: 26px; display: grid; gap: 22px; align-content: start; }
.contact-group h3 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.contact-group .tel { display: block; font: 750 21px/1.3 var(--font-head); color: var(--text); text-decoration: none; padding: 5px 0; }
.contact-group .tel small { display: block; font: 500 13px/1.3 var(--font); color: var(--muted); }
.contact-group .tel:hover { color: var(--accent); }
.contact-line { display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; text-decoration: none; }
.contact-line .ico { margin-top: 4px; color: var(--accent); }
.hours { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0 0 10px; }
.hours dt { font-weight: 650; }
.hours dd { margin: 0; }
.map-card { position: relative; overflow: hidden; min-height: 420px; }
.map-card iframe { display: block; width: 100%; height: 100%; min-height: 420px; border: 0; }
.map-activation { position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding: 18px; }
.map-activation span { display: flex; flex-direction: column; align-items: center; background: rgba(8, 20, 43, .82); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; transition: opacity .2s; }
.map-activation small { color: #b8c5da; }
.map-card:hover .map-activation span, .map-activation:focus-visible span { opacity: 1; }
.is-map-active .map-activation { display: none; }
.map-deactivation { position: absolute; top: 12px; right: 12px; background: var(--ink); color: #fff; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.gallery img { border-radius: 12px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.gallery .ph { display: block; cursor: zoom-in; }
.prose h2 { font-size: 24px; margin: 26px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p { font-size: 17px; color: #26354b; }

/* ---------- Камеры ---------- */
.cams { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cam { position: relative; display: block; border-radius: 14px; overflow: hidden; background: #0d1a33; aspect-ratio: 16 / 9; text-decoration: none; }
.cam img { width: 100%; height: 100%; object-fit: cover; color: transparent; }
.cam span { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 7px; background: rgba(8, 20, 43, .76); color: #fff; font-size: 13px; font-weight: 650; padding: 5px 10px; border-radius: 999px; }
.cam span i { width: 8px; height: 8px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 0 3px rgba(255, 77, 77, .25); }
.cam.cam-off img { opacity: .15; }
.cam.cam-off span i { background: #8693a8; box-shadow: none; }
.cams-note { margin: 18px 0 0; font-size: 14px; }

/* ---------- Призыв ---------- */
.cta-band { background: linear-gradient(120deg, #1450c8, #1f6bff 55%, #3a86ff); color: #fff; padding: 44px 0; }
.cta-band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.cta-band h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; }
.cta-band p { margin: 8px 0 0; color: #dfe8ff; max-width: 640px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; flex: none; }
.cta-band .btn-ghost { background: rgba(4, 12, 32, .28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }

/* ---------- Подвал ---------- */
.site-footer { background: var(--ink); color: #c7d2e3; padding: 56px 0 26px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; }
.footer-about p { margin-top: 16px; color: #a9b8cf; }
.site-footer ul { list-style: none; display: grid; gap: 7px; }
.site-footer a { color: #d7e1f0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .foot-h { color: #8fa2c0; }
.site-footer .tel { font-weight: 700; color: #fff; font-size: 17px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--ink-line); font-size: 13px; color: #8493ab; }

/* ---------- 404 ---------- */
.notfound { min-height: 60vh; display: flex; align-items: center; padding: 60px 24px; }
.notfound .code { font: 800 96px/1 var(--font-head); color: var(--accent); letter-spacing: -.04em; }
.notfound h1 { font-size: 36px; margin: 10px 0 12px; }

/* ---------- Адаптив ---------- */
@media (max-width: 1180px) {
  .nav { display: none; }
  .header-phone { margin-left: auto; }
  .menu-btn { display: block; }
  .drawer { display: block; position: fixed; inset: var(--header-h) 0 0 0; z-index: 49; background: var(--ink); padding: 18px 24px 30px; transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s; overflow-y: auto; }
  .drawer.is-open { opacity: 1; visibility: visible; transform: none; }
  .drawer nav { display: grid; gap: 4px; }
  .drawer nav a { color: #fff; text-decoration: none; font-size: 20px; font-weight: 650; padding: 12px 6px; border-bottom: 1px solid var(--ink-line); }
  .drawer nav a[aria-current="page"] { color: var(--accent-hi); }
  .drawer-contacts { display: grid; gap: 8px; margin-top: 24px; color: var(--ink-muted); }
  .drawer-contacts a { color: #fff; font-size: 20px; font-weight: 700; text-decoration: none; }
  body.menu-open { overflow: hidden; }
  .svc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .model-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; padding: 56px 24px 60px; gap: 32px; }
  .hero-card { max-width: 560px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(3) { border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
  .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .norms-promo, .twocol, .svc-hero, .contact-grid, .lead-box, .work-layout { grid-template-columns: 1fr; }
  .svc-hero .svc-img { max-width: 520px; }
  .svc-layout { grid-template-columns: 1fr; }
  .svc-aside { display: none; }
  .work-text { order: -1; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cams { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .work-text { position: static; }
  .works-filter { grid-template-columns: 1fr 1fr; }
  .wf-search { grid-column: 1 / -1; }
  .cta-band .wrap { flex-direction: column; align-items: flex-start; }
  .model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .header-phone span { display: none; }
  .header-phone { padding: 10px; border-radius: 50%; }
  .header-phone .ico { width: 20px; height: 20px; }
  .only-phone { display: inline; }
  .svc-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .svc-card { padding: 14px; gap: 4px; }
  .svc-card .svc-text, .svc-card .svc-more { display: none; }
  .svc-ico { width: 38px; height: 38px; margin-bottom: 2px; }
  .svc-title { font-size: 15px; }
  .home-works .work-card:nth-child(n+4) { display: none; }
  .footer-grid > div:nth-child(2), .footer-grid > div:nth-child(3) { display: none; }
  .chips .chip { min-height: 40px; }
  .cam span { font-size: 11px; padding: 3px 8px; left: 6px; bottom: 6px; }
  .wrap { padding: 0 16px; }
  .hero-grid { padding: 40px 16px 44px; }
  .brand-sub { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .lead { font-size: 17px; }
  .section { padding: 48px 0; }
  .section-head { flex-direction: column; align-items: flex-start; margin-bottom: 22px; }
  .facts { grid-template-columns: 1fr; }
  .fact { padding: 16px 4px; }
  .fact + .fact { border-left: 0; border-top: 1px solid var(--line); }
  .works-grid, .grid-2, .steps, .model-grid { grid-template-columns: 1fr; }
  .card.pad { padding: 20px; }
  .cams, .gallery { grid-template-columns: 1fr 1fr; gap: 8px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-actions .btn { width: 100%; }
  .works-filter { grid-template-columns: 1fr; padding: 12px; }
  .ms-panel { padding: 4px 12px 14px; }
  .norm-table { font-size: 14px; }
  .norm-table .op-code { display: none; }
  .norm-page .norm-group { padding: 6px 14px 12px; }
  .norm-group-head { flex-direction: column; gap: 4px; }
  .nv-list { min-width: 200px; }
  .work-photos { grid-template-columns: 1fr 1fr; }
  .lb img { max-width: 100vw; max-height: calc(100vh - 120px); border-radius: 0; }
  .lb-prev, .lb-next { top: auto; bottom: 12px; }
  .cta-actions, .cta-actions .btn { width: 100%; }
  .contact-group .tel { font-size: 19px; }
  .lead-box { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (hover: none) {
  .map-activation span { opacity: 1; }
}
