/* Гараж 47 — концепт для портфолио
   Чёрный лист, белые линии чертежа, красный суппорт как единственный акцент */
:root {
  --black: #000000;
  --panel: #0C0F13;
  --panel-2: #12171D;
  --field: #0E1217;
  --text: #ECEFF2;
  --muted: #9AA5B1;
  --line: #2B333C;
  --line-2: #46515D;
  --caliper: #D0142F;
  --caliper-dark: #A50F25;
  --caliper-text: #FF5C70;   /* красный для текста на чёрном: контраст выше 4.5:1 */
  --ok: #5BD08F;

  --font-display: "Unbounded", "Arial Black", Arial, sans-serif;
  --font-body: "Golos Text", "Segoe UI", Arial, sans-serif;

  --wrap: 76rem;
  --r-s: 6px;
  --r-m: 12px;
  --cut: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--black); }

body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  position: relative;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0 0 .5em; color: #fff; }
h1 { font-weight: 800; font-size: clamp(2.1rem, 5vw, 3.9rem); letter-spacing: -.02em; }
h2 { font-weight: 800; font-size: clamp(1.6rem, 3.2vw, 2.4rem); letter-spacing: -.01em; }
h3 { font-weight: 600; font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: inherit; text-underline-offset: .2em; }

:focus-visible { outline: 3px solid var(--caliper-text); outline-offset: 3px; border-radius: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.wrap-narrow { max-width: 48rem; }
.muted { color: var(--muted); font-size: .95rem; }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--caliper); color: #fff; padding: .6rem 1rem; font-weight: 700; }
.skip-link:focus { top: 1rem; }

/* Всё содержимое над слоем шестерён */
.concept-bar, .site-header, main, .site-footer { position: relative; z-index: 1; }

.concept-bar { background: #15191E; color: #C9D0D7; text-align: center; font-size: .9rem; padding: .5rem 1rem; }

/* ===== Фоновые шестерни ===== */
.gears-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.gears { width: 100%; height: 100%; }
.gears * { fill: none; stroke: #fff; vector-effect: non-scaling-stroke; }
.gears .gm { stroke-width: 1.1; opacity: .16; }
.gears .gd { stroke-width: .7; opacity: .11; }
.gears .gf { stroke-width: .6; opacity: .09; stroke-dasharray: 2 6; }
.gears .gc { stroke-width: .6; opacity: .10; stroke-dasharray: 22 5 3 5; }
.gears .gt { fill: #fff; stroke: none; opacity: .22; font: 500 16px var(--font-body); }
@media (max-width: 700px) {
  .gears .g3 { display: none; }
  .gears .gm { opacity: .11; }
  .gears .gd { opacity: .07; }
}

/* ===== Чертежи (общие стили линий) ===== */
.bp * { fill: none; stroke: #fff; vector-effect: non-scaling-stroke; }
.bp .bp-m { stroke-width: 1.3; }
.bp .bp-d { stroke-width: .8; opacity: .85; }
.bp .bp-f { stroke-width: .6; opacity: .28; }
.bp .bp-c { stroke-width: .7; opacity: .45; stroke-dasharray: 14 4 2 4; }
.bp .bp-thick { stroke-width: 2.2; }
.bp .bp-a { stroke: var(--caliper-text); stroke-width: 1.5; }
.bp .bp-dot { fill: #fff; }
.bp .bp-a-fill { fill: var(--caliper-text); stroke: var(--caliper-text); }
.bp .bp-arrow { fill: #fff; stroke: none; }
.bp .bp-hatch { stroke-width: .6; opacity: .5; }
.bp .bp-hatchfill { stroke: none; }
.bp text { fill: #fff; stroke: none; font-family: var(--font-body); }
.bp .bp-t { font-size: 15px; font-weight: 500; }
.bp .bp-ts { font-size: 11px; opacity: .75; }
.bp .bp-ts2 { font-size: 7px; opacity: .6; }

/* Header */
.site-header { background: rgba(0,0,0,.82); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .85rem; padding-bottom: .85rem; }
.logo { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: #fff; }
.logo-mark { width: 2rem; height: 2rem; color: var(--caliper-text); }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.3rem; align-items: center; }
.nav-list a { text-decoration: none; font-weight: 500; color: #D7DCE1; }
.nav-list a:hover { color: #fff; text-decoration: underline; }
.nav-cta { background: var(--caliper); color: #fff !important; padding: .5rem 1rem; border-radius: var(--r-s); font-weight: 700 !important; }
.nav-cta:hover { background: var(--caliper-dark); text-decoration: none !important; }
@media (max-width: 900px) { .nav-list li:not(:last-child) { display: none; } }

/* Buttons */
.btn { display: inline-block; font: 700 1rem/1 var(--font-body); padding: 1rem 1.4rem; border-radius: var(--r-s); text-decoration: none; border: 2px solid transparent; cursor: pointer; text-align: center; transition: background-color .15s, color .15s, border-color .15s; }
.btn-accent { background: var(--caliper); color: #fff; }
.btn-accent:hover { background: var(--caliper-dark); }
.btn-accent[disabled] { background: #1B2027; color: #6E7882; cursor: not-allowed; }
.btn-line { border-color: #fff; color: #fff; background: transparent; }
.btn-line:hover { background: #fff; color: #000; }
.btn-block { width: 100%; }

/* Intro */
.intro { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem); }
.intro-grid { display: grid; gap: 1.5rem 3rem; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 900px) { .intro-grid { grid-template-columns: 1.3fr 1fr; } }
.intro h1 { margin: 0; max-width: 13ch; }
.lead { font-size: 1.15rem; color: #C3CBD3; max-width: 34rem; }
.intro-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ===== Окна-услуги ===== */
.bays-section { padding-bottom: clamp(3rem, 7vw, 5rem); }
.bays-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 2rem; margin-bottom: 1rem; }
.bays-head h2 { margin: 0; }
.bays-hint { margin: 0; color: var(--muted); font-size: .95rem; }
.hint-mobile { display: none; }

.bays { list-style: none; margin: 0 auto; padding: 0; max-width: var(--wrap); }
.bay { position: relative; isolation: isolate; }
.bay-bp { position: absolute; inset: 0; z-index: -2; transition: opacity .45s; }
.bay-bp .bp { width: 100%; height: 100%; display: block; }
.bay:not(.is-open) .bay-bp .bp-a { stroke: #fff; }
.bay:not(.is-open) .bay-bp .bp-a-fill { fill: #fff; stroke: #fff; }

.bay-toggle { appearance: none; border: 0; margin: 0; width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; background: transparent; }
.bay-art { color: #9AA5B1; transition: color .3s; }
.bay-title { font-family: var(--font-display); font-weight: 600; color: #fff; }
.bay-body { color: #DCE2E8; }
.bay-body p { margin-bottom: .6rem; }
.bay-body ul { margin: 0 0 1.1rem; padding-left: 1.1rem; }
.bay-body li { margin-bottom: .25rem; }
.bay-body li::marker { color: var(--caliper-text); }
.bay-cta { display: inline-block; background: var(--caliper); color: #fff; text-decoration: none; font-weight: 700; padding: .75rem 1.1rem; border-radius: var(--r-s); }
.bay-cta:hover { background: var(--caliper-dark); }

/* Компьютер: косые окна, которые раздвигаются */
@media (min-width: 1100px) {
  .bays { display: flex; height: clamp(500px, 72vh, 640px); padding: 0 1.25rem; }
  .bay {
    flex: 1 1 0;
    min-width: 0;
    margin-left: calc(var(--cut) * -1 + 8px);
    background: var(--panel);
    clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%);
    transition: flex-grow .5s cubic-bezier(.2,.7,.2,1), background-color .3s;
    display: flex; flex-direction: column;
    overflow: hidden;
  }
  .bay:first-child { margin-left: 0; clip-path: polygon(0 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%); }
  .bay:last-child { clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%); }

  .bay-bp { opacity: .34; }
  .bay:hover .bay-bp { opacity: .5; }
  /* затемнение снизу, чтобы текст читался поверх чертежа */
  .bay::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(0,0,0,.96) 0%, rgba(0,0,0,.82) 30%, rgba(0,0,0,0) 60%); pointer-events: none; }

  .bay-toggle { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.5rem calc(var(--cut) + .5rem) 1.25rem 1.1rem; min-height: 0; }
  .bay:last-child .bay-toggle { padding-right: 1.25rem; }
  .bay-toggle:focus-visible { outline-offset: -6px; }
  .bay-art { display: none; }
  .bay-icon { display: none; }
  .bay-title { font-family: var(--font-body); font-weight: 700; font-size: 1.02rem; line-height: 1.25; }

  .bay-body {
    display: grid; grid-template-rows: 0fr;
    padding: 0 calc(var(--cut) + 1.5rem) 0 1.6rem;
    visibility: hidden; opacity: 0;
    transition: grid-template-rows .5s cubic-bezier(.2,.7,.2,1), opacity .25s, visibility 0s .5s;
  }
  .bay:last-child .bay-body { padding-right: 1.5rem; }
  .bay-body > * { min-height: 0; }
  .bay-body-inner { overflow: hidden; min-width: 20rem; max-width: 34rem; }

  .bay.is-open { flex-grow: 2.6; background: var(--panel-2); }
  .bay.is-open .bay-bp { opacity: .92; }
  .bay.is-open::before { background: linear-gradient(to top, rgba(0,0,0,.97) 0%, rgba(0,0,0,.9) 38%, rgba(0,0,0,.25) 62%, rgba(0,0,0,0) 75%); }
  .bay.is-open .bay-toggle { padding-left: 1.6rem; padding-bottom: .75rem; }
  .bay.is-open .bay-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.3rem, 1.9vw, 1.8rem); }
  .bay.is-open .bay-body { grid-template-rows: 1fr; visibility: visible; opacity: 1; padding-bottom: 1.6rem; transition: grid-template-rows .5s cubic-bezier(.2,.7,.2,1), opacity .35s .15s, visibility 0s; }
  .bay.is-open::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--caliper); }
}

/* Телефон и узкие экраны: простой список */
@media (max-width: 1099.98px) {
  .hint-desktop { display: none; }
  .hint-mobile { display: inline; }
  .bays { padding: 0 1.25rem; display: grid; gap: .5rem; }
  .bay { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
  .bay-bp { opacity: 0; }
  .bay.is-open .bay-bp { opacity: .2; }
  .bay-toggle { display: grid; grid-template-columns: 52px 1fr 28px; align-items: center; gap: 1rem; padding: .9rem 1rem; min-height: 4.5rem; }
  .bay-toggle:focus-visible { outline-offset: -4px; }
  .bay-art { width: 52px; height: 52px; }
  .bay-title { font-size: 1.05rem; }
  .bay-icon { position: relative; width: 28px; height: 28px; }
  .bay-icon::before, .bay-icon::after { content: ""; position: absolute; left: 6px; right: 6px; top: 13px; height: 2px; background: currentColor; transition: transform .2s; }
  .bay-icon::after { transform: rotate(90deg); }
  .bay.is-open .bay-icon::after { transform: rotate(0deg); }
  .bay.is-open .bay-art { color: #fff; }
  .bay-body { display: none; padding: 0 1rem 1.1rem calc(52px + 2rem); }
  .bay.is-open .bay-body { display: block; }
  .bay.is-open { border-color: var(--line-2); box-shadow: inset 4px 0 0 var(--caliper); }
}
@media (max-width: 480px) { .bay-body { padding-left: 1rem !important; } }

/* Sections */
.section { padding: clamp(3.5rem, 8vw, 5.5rem) 0; }
.section-intro { color: #B9C2CB; max-width: 38rem; }
.section-ink { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(12,15,19,.7); }
.section-panel { border-top: 1px solid var(--line); }

/* Карточки и поля */
.symptom-box, .booking-form { background: rgba(12,15,19,.92); border: 1px solid var(--line-2); border-radius: var(--r-m); padding: clamp(1.1rem, 3vw, 1.75rem); }

.field { margin-bottom: 1.15rem; }
.field label { display: block; font-weight: 700; margin-bottom: .35rem; color: #fff; }
.optional { font-weight: 400; color: var(--muted); }
.field input:not([type=checkbox]), .field select, .field textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--field);
  border: 1px solid var(--line-2); border-radius: var(--r-s); padding: .7rem .8rem; min-height: 3rem;
  color-scheme: dark;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #6B7783; }
.field input::placeholder, .field textarea::placeholder { color: #6E7882; }
.field textarea { resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--caliper-text); box-shadow: 0 0 0 1px var(--caliper-text); }
.check { display: flex !important; gap: .7rem; align-items: flex-start; font-weight: 400 !important; color: #C9D0D7 !important; }
.check input { width: 1.3rem; height: 1.3rem; margin-top: .2rem; accent-color: var(--caliper); flex: none; }
.hint { font-size: .9rem; color: var(--muted); margin: .35rem 0 0; }
.error { font-size: .92rem; color: var(--caliper-text); font-weight: 700; margin: .35rem 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { margin: 1rem 0 0; font-weight: 700; min-height: 1.6em; }
.form-status.is-ok { color: var(--ok); }
.form-status.is-error { color: var(--caliper-text); }
.field.flash select { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 6px rgba(255,92,112,.45); } 100% { box-shadow: 0 0 0 0 rgba(255,92,112,0); } }

/* Симптомы */
.symptoms-grid { display: grid; gap: 2rem 3rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .symptoms-grid { grid-template-columns: 1fr 1.3fr; align-items: start; } }
.chips { border: 0; margin: 0 0 1.25rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips legend { font-weight: 700; margin-bottom: .75rem; padding: 0; color: #fff; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: .55rem .9rem; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; font-weight: 500; color: #D7DCE1; transition: background-color .15s, border-color .15s, color .15s; user-select: none; }
.chip span:hover { border-color: #fff; color: #fff; }
.chip input:checked + span { background: #fff; border-color: #fff; color: #000; }
.chip input:checked + span::before { content: "✓ "; color: var(--caliper); font-weight: 700; }
.chip input:focus-visible + span { outline: 3px solid var(--caliper-text); outline-offset: 2px; }
.symptom-own { margin-bottom: 1.25rem; }

.verdict { border-top: 1px dashed var(--line-2); padding-top: 1rem; margin-bottom: 1rem; min-height: 4rem; }
.verdict-empty { color: var(--muted); margin: 0; }
.verdict-title { font-weight: 700; margin-bottom: .4rem; color: #fff; }
.verdict ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: .35rem; }
.verdict li { display: flex; gap: .6rem; align-items: baseline; }
.verdict li::before { content: ""; flex: none; width: .6rem; height: .6rem; border-radius: 2px; background: var(--caliper-text); transform: translateY(-1px); }
.verdict-for { color: var(--muted); font-size: .92rem; }

/* Консультация */
.consult-grid { display: grid; gap: 2rem 3rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .consult-grid { grid-template-columns: 1.1fr 1fr; } }
.phone-plate { margin-top: 1.75rem; display: inline-grid; gap: .3rem; padding: 1.1rem 1.4rem 1.1rem 1.6rem; border: 1px solid var(--line-2); border-radius: var(--r-m); background: rgba(12,15,19,.9); box-shadow: inset 5px 0 0 var(--caliper); }
.phone-plate-label { color: var(--muted); font-size: .92rem; }
.phone-plate-num { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.35rem, 3vw, 2rem); color: #fff; letter-spacing: .02em; }
.phone-plate-note { color: var(--muted); font-size: .88rem; }
.ph-x { color: #4E5864; }
.consult-action { background: rgba(12,15,19,.92); border: 1px solid var(--line-2); border-radius: var(--r-m); padding: clamp(1.1rem, 3vw, 1.75rem); align-self: end; }
.consult-action p { color: #C3CBD3; }

/* Переключатель режима формы */
.mode-switch { border: 0; padding: 0; margin: 0 0 1.4rem; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; background: #07090C; border-radius: var(--r-s); padding: .3rem; border: 1px solid var(--line-2); }
.mode-switch legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mode-switch label { position: relative; }
.mode-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-switch span { display: block; text-align: center; padding: .7rem .5rem; border-radius: 4px; font-weight: 700; color: #B9C2CB; cursor: pointer; line-height: 1.25; }
.mode-switch span:hover { color: #fff; }
.mode-switch input:checked + span { background: #fff; color: #000; }
.mode-switch input:focus-visible + span { outline: 3px solid var(--caliper-text); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Адрес: карточка со срезанными углами */
.address-card {
  --notch: 34px;
  background: var(--line-2);
  padding: 1px;
  clip-path: polygon(var(--notch) 0, 100% 0, 100% calc(100% - var(--notch)), calc(100% - var(--notch)) 100%, 0 100%, 0 var(--notch));
}
.address-inner {
  background: #07090C;
  clip-path: polygon(calc(var(--notch) - .4px) 0, 100% 0, 100% calc(100% - var(--notch) + .4px), calc(100% - var(--notch) + .4px) 100%, 0 100%, 0 calc(var(--notch) - .4px));
  display: grid; grid-template-columns: 1fr; gap: 2rem;
  padding: clamp(1.5rem, 4vw, 2.75rem);
}
@media (min-width: 900px) { .address-inner { grid-template-columns: 1fr 1.25fr; align-items: center; } }
.address-list { margin: 0 0 1rem; display: grid; gap: .85rem; }
.address-list div { display: grid; gap: .25rem; }
.address-list dt { color: var(--muted); font-size: .92rem; }
.address-list dd { margin: 0; }
.slot { border: 1px dashed #5A6672; border-radius: var(--r-s); padding: .6rem .8rem; color: #8B96A2; font-style: italic; }
.address-map { margin: 0; }
.address-map .bp { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: var(--r-s); background: #050608; }
.address-map figcaption { margin-top: .6rem; color: var(--muted); font-size: .9rem; }

/* Процесс: настоящая последовательность, поэтому номера */
.steps { list-style: none; margin: 2rem 0 0; padding: 0; counter-reset: step; display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { counter-increment: step; border-top: 2px solid var(--caliper); padding-top: 1rem; color: #C3CBD3; }
.steps li::before { content: counter(step); display: block; font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; line-height: 1; color: #59636E; margin-bottom: .6rem; }
.steps p { margin: 0; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line-2); }
.faq summary { cursor: pointer; list-style: none; padding: 1.1rem 2.5rem 1.1rem 0; font-weight: 700; font-size: 1.08rem; position: relative; color: #fff; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: .8rem; font-family: var(--font-display); font-size: 1.5rem; color: var(--caliper-text); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: #B9C2CB; padding-right: 2rem; }

/* Запись */
.booking-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 960px) { .booking-grid { grid-template-columns: 1fr 1.35fr; } }
.contact-card { background: rgba(12,15,19,.92); border: 1px solid var(--line); border-radius: var(--r-m); padding: 1.25rem; margin-top: 1.5rem; }
.contact-card h3 { margin-bottom: .9rem; }
.contact-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.contact-btn { display: inline-flex; align-items: center; gap: .5rem; font: 700 .98rem/1 var(--font-body); padding: .8rem 1rem; border-radius: var(--r-s); border: 1px solid #fff; background: transparent; color: #fff; cursor: pointer; }
.contact-btn:hover { background: #fff; color: #000; }
.contact-btn svg { width: 1.2rem; height: 1.2rem; }
.contact-note { font-size: .92rem; color: var(--muted); margin: .9rem 0 0; }
.field-row { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } }

/* Footer */
.site-footer { background: #07090C; border-top: 1px solid var(--line); color: #9AA5B1; padding: 2rem 0; font-size: .95rem; }
.site-footer strong { color: #fff; }
.footer-inner p { margin: 0 0 .4rem; }

/* Простые страницы (404, политика) */
.page-simple { padding: clamp(3rem, 8vw, 6rem) 1.25rem; min-height: 60vh; position: relative; z-index: 1; }
.page-simple .lead { margin-bottom: 1.5rem; }
.doc h2 { font-size: 1.3rem; margin-top: 2rem; }
.doc li { color: #C3CBD3; }
.doc-warning { background: #1E1A0C; border-left: 4px solid #D4A72C; color: #EDE3C2; padding: 1rem 1.2rem; border-radius: 0 var(--r-s) var(--r-s) 0; }

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