/* carscode.kz — главная и страницы моделей (собирает cars_code_site/tools/build_site.py).
   Редакционная вёрстка: узкие заглавные заголовки, монохромные фото, линии вместо карточек.
   Цвета бренда — как у программы Cars Code Soft: почти чёрный фон и зелёный акцент.
   Страница инструкции S05 по-прежнему на styles.css + instructions.css. */
:root {
  --ink: #0b0b0b;
  --ink-2: #111111;
  --ink-3: #161616;
  --line: #262626;
  --line-2: #333333;
  --paper: #f2f2f0;
  --muted: #9a9a96;
  --muted-2: #6f6f6c;
  --green: #1db954;
  --green-2: #23d160;
  --display: "Fira Sans Extra Condensed", "Arial Narrow", sans-serif;
  --body: "Golos Text", "Segoe UI", system-ui, sans-serif;
  --wrap: 1240px;
  --pad: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--ink); color: var(--paper); font: 400 17px/1.6 var(--body); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 800; text-transform: uppercase; line-height: .92; letter-spacing: -.01em; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.accent { color: var(--green); }

/* ---------- Шапка ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(11, 11, 11, .96); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 28px; height: 68px; }
.wordmark { display: flex; align-items: center; gap: 10px; font: 800 22px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.wordmark i { width: 10px; height: 10px; background: var(--green); display: block; }
.site-nav { display: flex; gap: 26px; margin-left: auto; font-size: 15px; color: var(--muted); }
.site-nav a:hover { color: var(--paper); }
.header-cta { padding: 9px 18px; border: 1px solid var(--green); color: var(--green); font-weight: 600; font-size: 15px; white-space: nowrap; }
.header-cta:hover { background: var(--green); color: var(--ink); }
.burger { display: none; margin-left: auto; width: 40px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 6px; }
.burger span { display: block; width: 24px; height: 2px; background: var(--paper); transition: transform .2s, opacity .2s; }
.burger.is-active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger.is-active span:nth-child(2) { opacity: 0; }
.burger.is-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 16px 26px; background: var(--green); color: var(--ink);
  font-weight: 600; font-size: 16px; transition: background .2s; }
.btn:hover { background: var(--green-2); }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow, .text-cta:hover .arrow { transform: translateX(4px); }
.text-cta { display: inline-flex; align-items: center; gap: 10px; padding: 16px 4px; font-weight: 600; border-bottom: 1px solid var(--line-2); }
.text-cta:hover { border-color: var(--paper); }
.arrow { display: inline-block; }

/* ---------- Первый экран ---------- */
.hero { position: relative; min-height: min(92vh, 900px); display: flex; align-items: flex-end; overflow: hidden; border-bottom: 1px solid var(--line); }
/* Фото уже обработаны (static/img/cars): кадр 2.2:1, машина справа, левый край уходит в фон.
   Блок с фото — во всю ширину сверху, в своих пропорциях. Затемнение одно на все слайды (::after):
   плотное слева под заголовком и снизу под фактами, справа машина видна полностью. */
.hero-slides { position: absolute; top: 0; left: 0; right: 0; height: min(100%, 45.5vw); background: var(--ink); }
.hero-slides::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, rgba(11, 11, 11, .92) 0%, rgba(11, 11, 11, .78) 28%, rgba(11, 11, 11, .35) 50%, rgba(11, 11, 11, 0) 64%),
              linear-gradient(180deg, rgba(11, 11, 11, .45) 0%, rgba(11, 11, 11, 0) 20%, rgba(11, 11, 11, 0) 58%, var(--ink) 100%); }
.hero-media { position: absolute; inset: 0; background-size: cover; background-position: right top; }
/* Слайдер главной: каждый слайд виден свою долю круга (6 с из 36) и плавно сменяется следующим.
   Задержки отрицательные (build_site.slides), поэтому первый слайд виден сразу. */
.slide, .slide-name { opacity: 0; animation-name: hero-slide; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
@keyframes hero-slide { 0% { opacity: 1; } 14% { opacity: 1; } 17% { opacity: 0; } 97% { opacity: 0; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .slide, .slide-name { animation: none; }
  .slide:first-child, .slide-name:first-child { opacity: 1; }
}
.slide-names { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.slide-name { position: absolute; right: var(--pad); top: 92px; padding: 8px 12px; background: rgba(11, 11, 11, .78);
  color: var(--paper); font: 600 13px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; }
.slide-name::before { content: ""; display: inline-block; width: 18px; height: 2px; margin-right: 10px; background: var(--green); vertical-align: 4px; }
.hero-body { position: relative; z-index: 4; width: 100%; padding-top: 120px; padding-bottom: 0; text-shadow: 0 1px 22px rgba(0, 0, 0, .55); }
.hero-body .btn { text-shadow: none; }
/* Строка над заголовком лежит на фото: тёмная подложка, чтобы читалась на любой машине. */
.place { display: flex; flex-wrap: wrap; gap: 8px; color: var(--paper); font-size: 15px; margin-bottom: 26px; text-shadow: none; }
.place span { padding: 7px 12px; background: rgba(11, 11, 11, .78); }
.place span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 9px; background: var(--green); vertical-align: 2px; }
.hero h1 { font-size: clamp(54px, 8.4vw, 128px); max-width: 12ch; }
.hero-lead { max-width: 620px; margin-top: 28px; color: #cfcfcb; font-size: clamp(17px, 1.6vw, 19px); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 34px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 70px; border-top: 1px solid var(--line); }
.facts div { padding: 22px 22px 26px 0; border-right: 1px solid var(--line); }
.facts div + div { padding-left: 22px; }
.facts div:last-child { border-right: 0; }
.facts b { display: block; font: 800 clamp(30px, 3.4vw, 44px)/1 var(--display); text-transform: uppercase; }
.facts span { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; }

/* ---------- Секции ---------- */
.section { padding: clamp(72px, 10vw, 130px) 0; border-bottom: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 60px; align-items: end; margin-bottom: clamp(36px, 5vw, 60px); }
.section-head h2 { font-size: clamp(48px, 7vw, 96px); }
.section-head p { color: var(--muted); max-width: 520px; }
.section-head .count { font: 800 clamp(48px, 7vw, 96px)/.92 var(--display); color: var(--line-2); }

/* ---------- Индекс моделей ---------- */
.index { border-top: 1px solid var(--line); }
.row { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1.5fr) minmax(0, 1.2fr) 110px 110px 28px;
  align-items: center; gap: 20px; padding: 26px 0; border-bottom: 1px solid var(--line); transition: padding .25s; }
.row::before { content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--green);
  transform: scaleX(0); transform-origin: left; transition: transform .35s; }
.row:hover::before, .row:focus-visible::before { transform: scaleX(1); }
.row:hover { padding-left: 14px; }
.row-num { color: var(--muted-2); font: 600 15px/1 var(--display); letter-spacing: .06em; }
.row-name small { display: block; color: var(--muted); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 6px; }
.row-name strong { display: block; font: 800 clamp(30px, 3.6vw, 48px)/.95 var(--display); text-transform: uppercase; }
.row-feat { color: var(--muted); font-size: 15px; }
.row-time { color: var(--muted); font-size: 15px; }
.row-price { font: 800 26px/1 var(--display); color: var(--green); text-align: right; white-space: nowrap; }
.row-price small { font: 500 13px var(--body); color: var(--muted); margin-right: 4px; }
.row-arrow { font-size: 22px; color: var(--muted); transition: transform .25s, color .25s; }
.row:hover .row-arrow { transform: translate(3px, -3px); color: var(--green); }
.index.compact .row { padding: 18px 0; }
.index.compact .row-name strong { font-size: clamp(24px, 2.6vw, 32px); }

/* ---------- Шаги ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); counter-reset: s; list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: s; padding: 30px 26px 10px 0; border-right: 1px solid var(--line); }
.steps li + li { padding-left: 26px; }
.steps li:last-child { border-right: 0; }
.steps li::before { content: "0" counter(s); display: block; margin-bottom: 26px; font: 800 72px/.9 var(--display);
  color: transparent; -webkit-text-stroke: 1px var(--green); }
.steps h3 { font-size: 30px; margin-bottom: 12px; }
.steps p { color: var(--muted); font-size: 16px; }
.steps a { color: var(--green); }

/* ---------- Мастерская ---------- */
.workshop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.workshop-media { min-height: 560px; background-size: cover; background-position: center; filter: grayscale(1) contrast(1.1) brightness(.6); }
.workshop-body { padding: clamp(48px, 7vw, 100px) var(--pad); max-width: 640px; }
.workshop-body h2 { font-size: clamp(44px, 6vw, 84px); margin-bottom: 26px; }
.workshop-body > p { color: var(--muted); margin-bottom: 30px; }
.ruled { list-style: none; margin: 0 0 36px; padding: 0; border-top: 1px solid var(--line); }
.ruled li { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.ruled li span { color: var(--muted); font-size: 15px; text-align: right; }

/* ---------- Условия ---------- */
.terms { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.terms div { padding: 30px 28px 34px 0; border-bottom: 1px solid var(--line); }
.terms div:not(:nth-child(3n)) { border-right: 1px solid var(--line); }
.terms div:not(:nth-child(3n + 1)) { padding-left: 28px; }
.terms h3 { font-size: 30px; margin-bottom: 12px; }
.terms p { color: var(--muted); font-size: 16px; }

/* ---------- Вопросы ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 26px 0;
  cursor: pointer; font: 800 clamp(24px, 2.6vw, 34px)/1 var(--display); text-transform: uppercase; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 34px/1 var(--body); color: var(--green); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { max-width: 760px; padding-bottom: 28px; color: var(--muted); }

/* ---------- Боты ---------- */
.bots { border-top: 1px solid var(--line); }
.bots a { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 20px; align-items: center; padding: 24px 0; border-bottom: 1px solid var(--line); }
.bots strong { font: 800 clamp(24px, 2.6vw, 32px)/1 var(--display); text-transform: uppercase; }
.bots span { color: var(--muted); }
.bots em { font-style: normal; color: var(--green); }
.bots a:hover strong { color: var(--green); }

/* ---------- Контакты ---------- */
.contacts { padding: clamp(72px, 10vw, 130px) 0 clamp(40px, 6vw, 70px); }
.contacts h2 { font-size: clamp(56px, 10vw, 150px); margin-bottom: 40px; }
.contact-list { border-top: 1px solid var(--line); }
.contact-list a { display: grid; grid-template-columns: 220px minmax(0, 1fr) 28px; gap: 20px; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--line); }
.contact-list span { color: var(--muted); font-size: 15px; }
.contact-list strong { font: 800 clamp(28px, 3.4vw, 46px)/1 var(--display); overflow-wrap: anywhere; }
.contact-list a:hover strong, .contact-list a:hover .row-arrow { color: var(--green); }

/* ---------- Подвал ---------- */
.site-footer { padding: 40px 0 28px; border-top: 1px solid var(--line); overflow: hidden; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 28px; color: var(--muted-2); font-size: 14px; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-row a:hover { color: var(--paper); }
.giant { margin-top: 30px; font: 800 clamp(70px, 19.5vw, 280px)/.8 var(--display); text-transform: uppercase; letter-spacing: -.02em;
  color: var(--ink-3); white-space: nowrap; user-select: none; }

/* ---------- Плавающие кнопки ---------- */
.floating-actions { position: fixed; right: 18px; bottom: 18px; z-index: 35; display: flex; gap: 8px; }
.floating-action { padding: 11px 16px; font-weight: 600; font-size: 14px; background: var(--ink-3); border: 1px solid var(--line-2); }
.floating-action:hover { border-color: var(--green); color: var(--green); }

/* ---------- Страница модели ---------- */
.hero.model { min-height: min(78vh, 760px); }
.crumbs { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.crumbs a { color: #cfcfcb; }
.crumbs a:hover { color: var(--paper); }
.hero h1 .kicker { display: block; font: 600 clamp(18px, 2vw, 24px)/1.2 var(--body); text-transform: none; letter-spacing: 0;
  color: var(--green); margin-bottom: 14px; }
.hero.model h1 { font-size: clamp(50px, 7.4vw, 112px); max-width: 11ch; }
.feat-line { margin-top: 18px; color: var(--muted); font-size: 15px; }
.prices { border-top: 1px solid var(--line); }
.price-row { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 2fr) 120px; gap: 24px; align-items: baseline; padding: 26px 0; border-bottom: 1px solid var(--line); }
.price-row strong { font: 800 clamp(26px, 2.8vw, 36px)/1 var(--display); text-transform: uppercase; }
.price-row span { color: var(--muted); }
.price-row b { font: 800 clamp(30px, 3.2vw, 44px)/1 var(--display); color: var(--green); text-align: right; }
/* Над строками каждой машины, когда на странице их несколько (Q07 и Q07 Laser Ultra). */
.prices .price-group { font-size: clamp(20px, 2vw, 26px); color: var(--muted); padding: 34px 0 10px; border-bottom: 1px solid var(--line); }
.price-note { margin-top: 22px; color: var(--muted); max-width: 720px; font-size: 15px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 90px); }
.split h2 { font-size: clamp(40px, 5vw, 64px); margin-bottom: 28px; }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li { padding: 18px 0 18px 26px; border-bottom: 1px solid var(--line); color: #cfcfcb; position: relative; }
.list li::before { content: ""; position: absolute; left: 0; top: 28px; width: 10px; height: 2px; background: var(--green); }
ol.list { counter-reset: n; }
ol.list li { counter-increment: n; padding-left: 46px; }
ol.list li::before { content: "0" counter(n); width: auto; height: auto; background: none; top: 19px; color: var(--green);
  font: 800 18px/1 var(--display); }
.list a { color: var(--green); }
.note { margin-top: 26px; padding-left: 0; color: var(--muted); font-size: 15px; }
.note b { color: var(--paper); font-weight: 600; }
.text-link { color: var(--green); border-bottom: 1px solid currentColor; }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .row { grid-template-columns: 44px minmax(0, 1fr) 100px 24px; }
  .row-feat, .row-time { display: none; }
  .steps, .terms { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(2) { border-right: 0; }
  .steps li:nth-child(3) { padding-left: 0; }
  .steps li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .terms div { padding-left: 0 !important; border-right: 0 !important; }
  .terms div:nth-child(odd) { border-right: 1px solid var(--line) !important; padding-right: 28px; }
  .terms div:nth-child(even) { padding-left: 28px !important; }
  .workshop { grid-template-columns: 1fr; }
  .workshop-media { min-height: 360px; }
}
@media (max-width: 860px) {
  .site-nav { position: absolute; top: 68px; left: 0; right: 0; display: none; flex-direction: column; gap: 0; margin: 0;
    padding: 8px var(--pad) 20px; background: var(--ink); border-bottom: 1px solid var(--line); font-size: 18px; }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--paper); }
  .burger { display: flex; }
  .header-cta { display: none; }
  .section-head, .split { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(2) { border-right: 0; }
  .facts div:nth-child(3) { padding-left: 0; }
  .facts div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .bots a { grid-template-columns: 1fr; gap: 6px; }
  .contact-list a { grid-template-columns: 1fr 24px; }
  .contact-list span { grid-column: 1 / -1; }
  .price-row { grid-template-columns: minmax(0, 1fr) auto; }
  .price-row span { grid-column: 1 / -1; grid-row: 2; }
  .price-row b { grid-column: 2; grid-row: 1; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero { min-height: 0; }
  /* На телефоне фото — полосой сверху, текст под ним. */
  .hero-slides { height: 300px; }
  .hero-slides::after { background: linear-gradient(180deg, rgba(11, 11, 11, .2) 0%, rgba(11, 11, 11, 0) 30%, rgba(11, 11, 11, .55) 70%, var(--ink) 100%); }
  .hero-media { background-position: 78% center; }
  .hero-body { padding-top: 250px; }
  .slide-name { top: 16px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .text-cta { justify-content: center; }
  .facts { margin-top: 48px; }
  .facts div { padding: 18px 14px 20px 0; }
  .facts div + div { padding-left: 14px; }
  .facts div:nth-child(3) { padding-left: 0; }
  .row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 20px 0; }
  .row-num, .row-arrow { display: none; }
  .row:hover { padding-left: 0; }
  .steps, .terms { grid-template-columns: 1fr; }
  .steps li, .steps li + li, .terms div, .terms div:nth-child(even) { padding: 26px 0 !important; border-right: 0 !important; border-top: 0; }
  .steps li { border-bottom: 1px solid var(--line); }
  .steps li::before { font-size: 56px; margin-bottom: 16px; }
  .ruled li { flex-direction: column; gap: 4px; }
  .ruled li span { text-align: left; }
  .floating-actions { left: 0; right: 0; bottom: 0; padding: 10px 12px; background: var(--ink); border-top: 1px solid var(--line); }
  .floating-action { flex: 1; text-align: center; }
  .site-footer { padding-bottom: 80px; }
}
