:root {
  --frame: #ffffff;
  --ink: #1d2a31;
  --ink-2: #2b3c45;
  --steel: #56656d;
  --glass: #d6e7ed;
  --glass-2: #b9d4de;
  --sill: #eef2f3;
  --line: #c8d2d6;
  --tape: #f5b700;
  --tape-ink: #2a2100;
  --ok: #1f7a4d;
  --err: #b3261e;
  --font: "Golos Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1160px;
  --gap: clamp(1rem, 3vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--frame);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--tape); text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--tape); outline-offset: 3px; }
h1, h2, h3 { line-height: 1.12; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }
.wrap--text { max-width: 46rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--tape); padding: 0.5rem 1rem; z-index: 50; }
.skip:focus { left: 0.5rem; }

/* ---------- кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.7rem 1.4rem;
  font: inherit; font-weight: 650; text-decoration: none; text-align: center;
  border: 2px solid transparent; border-radius: 4px; cursor: pointer;
}
.btn--tape { background: var(--tape); color: var(--tape-ink); border-color: var(--tape); }
.btn--tape:hover { background: #ffc61a; text-decoration: none; }
.btn--line { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--line:hover { background: var(--ink); color: var(--frame); text-decoration: none; }

/* ---------- шапка */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--frame); border-bottom: 1px solid var(--line); }
.topbar__inner { display: flex; align-items: center; gap: 2rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; text-decoration: none; line-height: 1.1; }
.brand__mark { width: 30px; height: 30px; fill: var(--glass); stroke: var(--ink); stroke-width: 3; }
.brand__city { display: block; font-weight: 500; font-size: 0.82rem; color: var(--steel); }
.topnav { display: flex; gap: 1.5rem; margin-left: auto; }
.topnav a { text-decoration: none; font-weight: 550; }
.topnav a:hover { text-decoration: underline; text-decoration-color: var(--tape); text-decoration-thickness: 3px; }
.topbar__phone { font-weight: 750; text-decoration: none; white-space: nowrap; }

/* ---------- первый экран: окно */
.hero { background: var(--sill); padding: clamp(1.5rem, 4vw, 3.5rem) 0 clamp(2.5rem, 6vw, 5rem); }
.tape {
  position: relative;
  height: 30px;
  margin: 0 18px 14px;
  background:
    repeating-linear-gradient(90deg, var(--tape-ink) 0 2px, transparent 2px 100px) 0 0 / 100% 68% no-repeat,
    repeating-linear-gradient(90deg, var(--tape-ink) 0 1px, transparent 1px 10px) 0 0 / 100% 32% no-repeat,
    var(--tape);
  border-radius: 2px;
}
.tape__end { position: absolute; right: -10px; top: -4px; width: 12px; height: 38px; background: var(--ink); border-radius: 2px; }
.window {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  background: var(--frame);
  border: 1px solid var(--line);
  padding: 18px;
  gap: 18px;
  box-shadow: inset 0 0 0 1px var(--frame), 0 1px 0 var(--line);
}
.sash { position: relative; border: 1px solid var(--line); padding: clamp(1.5rem, 4vw, 3rem); }
.sash--text { background: var(--frame); }
.hero__where { color: var(--steel); font-weight: 550; }
.hero__lead { font-size: 1.15rem; max-width: 34rem; color: var(--ink-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }
.sash--glass {
  background:
    linear-gradient(120deg, transparent 0 38%, rgba(255,255,255,0.55) 38% 44%, transparent 44% 52%, rgba(255,255,255,0.35) 52% 54%, transparent 54%),
    linear-gradient(180deg, var(--glass), var(--glass-2));
  display: flex; align-items: flex-end;
}
.handle {
  position: absolute; left: -12px; top: 50%;
  width: 10px; height: 64px; margin-top: -32px;
  background: var(--frame); border: 1px solid var(--line); border-radius: 5px;
  box-shadow: 0 2px 3px rgba(29, 42, 49, 0.18);
}
.handle::after { content: ""; position: absolute; left: 1px; top: 4px; width: 6px; height: 14px; border-radius: 3px; background: var(--sill); }
.facts { margin: 0; width: 100%; }
.facts__row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; border-top: 1px solid rgba(29, 42, 49, 0.25); }
.facts__row:first-child { border-top: 0; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 750; text-align: right; }

/* ---------- секции */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--sill { background: var(--sill); }
.section--ink { background: var(--ink); color: var(--frame); }
.section__lead { max-width: 40rem; color: var(--steel); font-size: 1.1rem; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.section__head h2 { margin: 0; }

/* ---------- прайс */
.pricelist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem 3rem; margin-top: 2rem; }
.pricelist__group h3 { padding-bottom: 0.6rem; border-bottom: 3px solid var(--ink); margin-bottom: 0; }
.pricelist table { width: 100%; border-collapse: collapse; }
.pricelist th, .pricelist td { padding: 0.75rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.pricelist th { text-align: left; font-weight: 400; padding-right: 1rem; }
.pricelist td { text-align: right; font-weight: 650; white-space: nowrap; }
.pricelist__more { display: inline-block; margin-top: 0.9rem; color: var(--steel); font-size: 0.95rem; }

/* ---------- этапы (это последовательность — номера уместны) */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem; }
.steps li { counter-increment: step; position: relative; padding-top: 3.4rem; }
.steps li::before {
  content: counter(step);
  position: absolute; top: 0; left: 0;
  width: 2.4rem; height: 2.4rem; display: grid; place-items: center;
  background: var(--ink); color: var(--frame); font-weight: 800; border-radius: 2px;
}
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 1.2rem; left: 3rem; right: -1rem; height: 2px; background: var(--line); }
.steps h3 { margin-bottom: 0.4rem; }
.steps p { color: var(--ink-2); font-size: 0.98rem; margin: 0; }

/* ---------- работы «до/после»: пара фото в раме, как две створки окна */
.works-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 2.2rem 1.6rem; }
.work__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; background: var(--frame); border: 1px solid var(--line); }
.work__pair--single { grid-template-columns: 1fr; }
.shot { position: relative; display: block; overflow: hidden; }
.shot[hidden] { display: none; }
.shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.work__pair--single .shot img { aspect-ratio: 8 / 3; } /* та же высота, что у пары 4:3 + 4:3 */
.shot__tag { position: absolute; left: 8px; top: 8px; padding: 0.1rem 0.65rem; border-radius: 2px; font-weight: 700; font-size: 0.85rem; background: var(--frame); color: var(--ink); }
.shot--after .shot__tag { background: var(--tape); color: var(--tape-ink); }
.shot__more { position: absolute; right: 8px; bottom: 8px; padding: 0.05rem 0.5rem; border-radius: 2px; font-size: 0.8rem; background: rgba(29, 42, 49, 0.82); color: var(--frame); }
.shot:hover img { filter: brightness(1.04); }
.work__meta { margin: 0.6rem 0 0; color: var(--ink-2); font-size: 0.97rem; }
.work__meta span { color: var(--steel); }

/* ---------- о мастере */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: start; }
.about p { max-width: 38rem; }
.about__legal { list-style: none; padding: 1.5rem; margin: 0; background: var(--frame); border: 1px solid var(--line); }
.about__legal li { position: relative; padding: 0.6rem 0 0.6rem 2rem; border-bottom: 1px solid var(--line); }
.about__legal li:last-child { border-bottom: 0; }
.about__legal li::before { content: ""; position: absolute; left: 0.2rem; top: 0.95rem; width: 0.9rem; height: 0.5rem; border-left: 3px solid var(--ok); border-bottom: 3px solid var(--ok); transform: rotate(-45deg); }

/* ---------- вопросы */
.faq details { max-width: 50rem; border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 1rem 2rem 1rem 0; font-weight: 650; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.2rem; top: 0.8rem; font-size: 1.4rem; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-2); max-width: 42rem; }

/* ---------- заявка */
.lead { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; }
.lead__info p { color: #c9d6db; max-width: 30rem; }
.contacts { margin: 2rem 0 0; }
.contacts div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 0.7rem 0; border-top: 1px solid var(--ink-2); }
.contacts dt { color: #9fb2ba; }
.contacts dd { margin: 0; font-weight: 600; }
.contacts a { color: var(--frame); }
.leadform { background: var(--frame); color: var(--ink); padding: clamp(1.25rem, 3vw, 2rem); border-radius: 4px; display: grid; gap: 1rem; }
.leadform__status:empty { display: none; }
.leadform__status { margin: 0; padding: 0.8rem 1rem; border-radius: 4px; font-weight: 600; }
.leadform__status.is-ok { background: #e3f3ea; color: var(--ok); }
.leadform__status.is-error { background: #fbe9e7; color: var(--err); }
.field { display: grid; gap: 0.35rem; }
.field span { font-weight: 600; font-size: 0.95rem; }
.field small { font-weight: 400; color: var(--steel); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); background: var(--frame);
  border: 1px solid #9fb0b7; border-radius: 4px; padding: 0.7rem 0.8rem; min-height: 3rem; width: 100%;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--tape); outline-offset: 0; border-color: var(--ink); }
.field [aria-invalid="true"] { border-color: var(--err); }
.check { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.93rem; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: 0.2rem; flex: none; accent-color: var(--ink); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.leadform .btn { width: 100%; }
.leadform .btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- галерея */
.gallery-page h1 { margin-bottom: 0.3em; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0 2rem; }
.filters a { padding: 0.5rem 1rem; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; font-weight: 550; }
.filters a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--frame); }
.filters__n { margin-left: 0.45rem; color: var(--steel); font-weight: 400; }
.filters a[aria-current="page"] .filters__n { color: #b8c7cd; }
.empty { padding: 2rem; background: var(--sill); }

.lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0f161a; color: var(--frame); }
.lightbox::backdrop { background: #0f161a; }
.lightbox[open] { display: grid; grid-template-columns: 4rem 1fr 4rem; align-items: center; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 0.8rem; padding: 3.5rem 0 1.5rem; height: 100%; grid-template-rows: 1fr auto; min-height: 0; }
.lightbox img { max-height: 100%; max-width: 100%; object-fit: contain; min-height: 0; }
.lightbox figcaption { text-align: center; max-width: 40rem; padding: 0 1rem; }
.lightbox button { background: transparent; border: 0; color: var(--frame); font: inherit; font-size: 2.6rem; cursor: pointer; line-height: 1; padding: 0.5rem; }
.lightbox__close { position: absolute; top: 0.5rem; right: 0.8rem; }
.lightbox__nav[hidden] { visibility: hidden; display: block; }

/* ---------- юридические страницы */
.legal h2 { font-size: 1.25rem; margin-top: 2rem; }

/* ---------- подвал */
.footer { background: var(--sill); padding: 2.5rem 0 3rem; font-size: 0.93rem; color: var(--ink-2); }
.footer__inner { display: grid; grid-template-columns: 1fr 1.4fr; gap: 2rem; }
.footer p { margin: 0 0 0.4rem; }
.footer__name { font-weight: 700; color: var(--ink); }
.footer__links { display: grid; gap: 0.4rem; align-content: start; }

/* ---------- быстрая связь на телефоне */
.callbar { display: none; }

@media (max-width: 960px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li::after { display: none; }
  .pricelist, .about, .lead { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px)); }
  .topnav { display: none; }
  .topbar__inner { justify-content: space-between; gap: 1rem; }
  .window { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .tape { margin-inline: 12px; height: 24px; }
  .handle { left: 50%; top: -11px; width: 56px; height: 9px; margin: 0 0 0 -28px; }
  .handle::after { width: 12px; height: 5px; left: 4px; top: 1px; }
  .steps { grid-template-columns: 1fr; }
  .contacts div { grid-template-columns: 1fr; gap: 0.1rem; }
  .callbar {
    display: grid; grid-template-columns: 1fr 1.4fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    gap: 0.5rem; background: var(--frame); border-top: 1px solid var(--line);
  }
  .callbar a { display: grid; place-items: center; min-height: 3rem; border-radius: 4px; font-weight: 700; text-decoration: none; }
  .callbar__call { border: 2px solid var(--ink); }
  .callbar__lead { background: var(--tape); color: var(--tape-ink); }
  .lightbox[open] { grid-template-columns: 2.5rem 1fr 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
