/* pro-logan — дизайн «Гараж». Mobile-first, без сборки. */

/* ---------- шрифты (локальные копии, SIL OFL; переменные начертания) ---------- */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/manrope-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/manrope-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(/fonts/unbounded-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(/fonts/unbounded-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- токены ---------- */
:root {
  --bg: #16181B;
  --bg-deep: #0E0F11;
  --surface: #212429;
  --surface-2: #2C3036;
  --line: #2C3036;
  --line-2: #3A3F46;
  --text: #ECEDEE;
  --text-2: #D5D7DA;
  --muted: #A3A8B0;
  --accent: #FFCC33;
  --accent-hi: #FFE08A;
  --accent-ink: #16181B;
  --tip-bg: #2A2614;
  --warn-bg: #2E1A17;
  --warn: #FCA5A5;
  --ok: #86EFAC;
  --info: #7DD3FC;
  --radius: 14px;
  --font: 'Manrope', system-ui, sans-serif;
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hi); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }

/* ---------- шапка ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 10px; padding-bottom: 10px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 19px; min-height: 44px; }
.logo:hover { color: var(--text); }
.logo-mark { display: inline-flex; width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); align-items: center; justify-content: center; font-size: 15px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 20px; font-weight: 500; }
.site-nav a { color: var(--muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--text); }
.header-search { flex: 1 1 220px; display: flex; justify-content: flex-end; }
.header-search form { width: 100%; max-width: 380px; }

/* ---------- формы и кнопки ---------- */
.search { display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 11px 14px; min-height: 48px;
}
.search input::placeholder { color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border: 0; border-radius: 12px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--surface-2); color: var(--text);
}
.btn:hover { color: var(--text); background: var(--line-2); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hi); color: var(--accent-ink); }
.btn-big { min-height: 60px; font-size: 18px; border-radius: 14px; width: 100%; }

/* ---------- общие блоки ---------- */
.page { padding: 24px 0 64px; }
.display { font-family: var(--display); font-weight: 700; }
.crumbs { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 14px; background: var(--surface-2); border-radius: 999px; padding: 4px 12px; color: var(--text); }
.meta { font-size: 14px; color: var(--muted); }
.card { background: var(--surface); border-radius: 16px; padding: 18px 20px; }
.card h2 { margin: 0 0 10px; font-size: 16px; }

.layout { display: flex; flex-wrap: wrap; gap: 32px; }
.layout > main { flex: 999 1 600px; min-width: 0; }
.layout > aside { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: 15px; }
.side-list a, .side-list span { display: block; padding: 7px 0; color: var(--text-2); text-decoration: none; }
.side-list a:hover { color: var(--text); }
.side-list .current { color: var(--accent); font-weight: 700; }

/* ---------- главная ---------- */
.hero { padding: 36px 0 24px; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 6vw, 48px); margin: 0 0 12px; max-width: 820px; }
.hero p { margin: 0 0 20px; max-width: 640px; color: var(--muted); font-size: 18px; }
.hero .search { max-width: 720px; }

.section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.section-tile { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border-radius: 16px; padding: 18px 20px; color: var(--text); text-decoration: none; min-height: 88px; }
.section-tile:hover { color: var(--text); background: var(--surface-2); }
.section-tile strong { font-size: 18px; }
.section-tile span { font-size: 14px; color: var(--muted); }

.h2 { font-family: var(--display); font-weight: 700; font-size: 22px; margin: 36px 0 14px; }

.article-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.article-item { display: block; background: var(--surface); border-radius: 14px; padding: 14px 18px; color: var(--text); text-decoration: none; }
.article-item:hover { color: var(--text); background: var(--surface-2); }
.article-item strong { display: block; font-size: 17px; line-height: 1.35; }
.article-item .meta { margin-top: 4px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--info); margin-right: 8px; }
.tag-steps { color: var(--accent); }

/* ---------- статья ---------- */
.article-title { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 5vw, 40px); margin: 6px 0 12px; }
.article-head .chips { margin-bottom: 8px; }
.status-banner { border: 1px dashed var(--accent); border-radius: 12px; padding: 10px 14px; font-size: 15px; color: var(--accent-hi); margin: 16px 0 20px; }
.garage-cta { margin: 16px 0 6px; }
.garage-cta + .meta { text-align: center; margin-bottom: 8px; }
@media (min-width: 720px) {
  .garage-cta .btn-big { width: auto; padding: 14px 28px; }
  .garage-cta + .meta { text-align: left; }
}

.prose { color: var(--text-2); }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 4px; }
.prose figure { margin: 12px 0 16px; background: var(--bg-deep); border-radius: 12px; padding: 12px; display: flex; justify-content: center; }
.prose figure img { border-radius: 6px; }
.table-wrap { overflow-x: auto; margin: 12px 0 18px; border-radius: 12px; border: 1px solid var(--line-2); }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: 15px; }
.table-wrap td, .table-wrap th { border: 1px solid var(--line-2); padding: 8px 10px; vertical-align: top; text-align: left; }
.table-wrap thead th { background: var(--surface-2); color: var(--text); font-weight: 700; }
.table-wrap table:has(thead) { min-width: 680px; } /* диагностические таблицы на телефоне листаются вбок, а не сжимаются в столбик */

.callout { border-radius: 14px; padding: 14px 16px; margin: 12px 0 16px; background: var(--surface); color: var(--text); }
.callout > strong:first-child { display: block; margin-bottom: 4px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.callout p { margin: 0 0 8px; }
.callout p:last-child { margin-bottom: 0; }
.callout-tip { background: var(--tip-bg); }
.callout-tip > strong:first-child { color: var(--accent); }
.callout-note > strong:first-child { color: var(--info); }
.callout-warning { background: var(--warn-bg); }
.callout-warning > strong:first-child { color: var(--warn); }
.callout figure { margin: 10px 0 0; }

.tools { margin: 0 0 20px; }
.tools ul { margin: 0; padding-left: 20px; color: var(--text-2); }

.steps { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 28px; }
.step { border-top: 1px solid var(--line); padding-top: 20px; }
.step-head { display: flex; gap: 14px; align-items: baseline; }
.step-num { font-family: var(--display); font-weight: 700; font-size: 30px; color: var(--accent); line-height: 1; min-width: 1.4em; }
.step-body { flex: 1; min-width: 0; font-size: 18px; color: var(--text); }
.step-body p { margin: 0 0 10px; }
.step-photos { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; }
.step-photos figure { margin: 0; background: var(--bg-deep); border-radius: 12px; padding: 10px; display: flex; justify-content: center; flex: 1 1 260px; }
.step-photos img { border-radius: 6px; }

/* ---------- футер ---------- */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-top: 22px; padding-bottom: 28px; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; color: var(--muted); }
.site-footer a { color: var(--muted); }

/* ---------- режим «В гараже» ---------- */
.garage { background: var(--bg-deep); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.g-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; }
.g-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border: 0; cursor: pointer; flex: 0 0 auto; }
.g-icon:hover { color: var(--text); background: var(--surface-2); }
.g-title { flex: 1; min-width: 0; }
.g-title small { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-title b { font-family: var(--display); font-size: 18px; }
.g-tools-btn { height: 48px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.g-progress { display: flex; gap: 4px; padding: 0 12px 12px; }
.g-progress i { flex: 1; height: 6px; border-radius: 3px; background: var(--line-2); }
.g-progress i.on { background: var(--accent); }

.g-steps { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.g-step { display: none; flex: 1; flex-direction: column; min-height: 0; }
.g-step.is-active { display: flex; }
.no-js .g-step { display: flex; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.no-js .g-nav, .no-js .g-progress { display: none; }
.g-photo { margin: 0 12px; border-radius: 18px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; padding: 10px; min-height: 200px; }
.g-photo img { max-height: 46vh; width: auto; border-radius: 8px; }
.g-photo-more { display: flex; gap: 8px; margin: 8px 12px 0; overflow-x: auto; }
.g-photo-more img { height: 64px; width: auto; border-radius: 6px; }
.g-text { padding: 16px 18px 8px; font-size: 22px; line-height: 1.45; font-weight: 500; overflow-y: auto; }
.g-text p { margin: 0 0 10px; }
.g-text .callout { font-size: 17px; font-weight: 400; }
.g-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); }
.g-nav button, .g-nav a { min-height: 68px; border: 0; border-radius: 16px; font: inherit; font-weight: 700; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.g-prev { background: var(--surface-2); color: var(--text); }
.g-prev:disabled { color: #6B7079; cursor: default; }
.g-next { background: var(--accent); color: var(--accent-ink); }
.g-done { background: var(--ok); color: #052E16; }
.g-done:hover { color: #052E16; }

.g-sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 22px 22px 0 0; padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); box-shadow: 0 -12px 40px rgba(0,0,0,.5); font-size: 19px; }
.g-sheet[hidden] { display: none; }
.g-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-family: var(--display); font-weight: 700; }
.g-sheet ul { margin: 0; padding-left: 20px; line-height: 1.7; }

@media (min-width: 900px) and (orientation: landscape) {
  .garage { height: 100vh; height: 100dvh; overflow: hidden; }
  .g-step.is-active { display: grid; grid-template-columns: minmax(0, 55%) minmax(0, 1fr); grid-template-rows: 1fr; gap: 20px; padding: 0 20px; }
  .g-photo { margin: 0; min-height: 0; height: 100%; }
  .g-photo img { max-height: 100%; }
  .g-photo-wrap { display: flex; flex-direction: column; min-height: 0; }
  .g-photo-more { margin: 8px 0 0; }
  .g-text { font-size: 27px; padding: 4px 0; }
  .g-nav { padding: 14px 20px 20px; }
  .g-nav button, .g-nav a { min-height: 80px; font-size: 24px; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .section-tile, .article-item { transition: background-color .15s; }
}
