/* Производственная база, Калуга — стили лендинга */
:root {
  --graphite: #23272b;
  --graphite-2: #353b40;
  --steel: #6b7378;
  --concrete: #e7e9e7;
  --line: #c9cdcb;
  --white: #ffffff;
  --signal: #f2b705;      /* единственный акцент: жёлтая разметка, как на складских полах */
  --signal-dark: #c99600;
  --ok: #2f7d4f;
  --err: #b3261e;

  --font: "Onest", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 64px;
  --r-s: 4px;
  --r-m: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--graphite);
  background: var(--white);
  font-feature-settings: "tnum" 1;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.12; margin: 0; font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: clamp(28px, 3.6vw, 42px); }
h3 { font-size: 20px; letter-spacing: -0.005em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--concrete { background: var(--concrete); }
.section--dark { background: var(--graphite); color: var(--white); }
.section__head { display: grid; gap: 12px; margin-bottom: clamp(28px, 4vw, 48px); max-width: 720px; }
.section__lead { color: var(--steel); font-size: 18px; margin: 0; }
.section--dark .section__lead { color: #b9c0c4; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  font: 600 16px/1 var(--font);
  border-radius: var(--r-s); border: 2px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn--signal { background: var(--signal); color: var(--graphite); }
.btn--signal:hover { background: #ffc81f; }
.btn--ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn--ghost:hover { background: rgba(255,255,255,.08); }
.btn--dark { background: var(--graphite); color: var(--white); }
.btn--dark:hover { background: var(--graphite-2); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* Шапка */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--graphite); color: var(--white);
  height: var(--header-h);
}
.header__in { height: 100%; display: flex; align-items: center; gap: 28px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 17px; line-height: 1.1; white-space: nowrap; }
.logo__mark { width: 30px; height: 30px; flex: none; }
.logo small { display: block; font-weight: 400; font-size: 12px; color: #b9c0c4; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { text-decoration: none; font-size: 15px; color: #d6dadc; }
.nav a:hover { color: var(--white); }
.header__phone { text-decoration: none; font-weight: 600; font-size: 16px; white-space: nowrap; }
.header__cta { min-height: 40px; padding: 0 16px; font-size: 15px; }
@media (max-width: 1080px) { .nav { display: none; } .header__phone { margin-left: auto; } }
@media (max-width: 640px) {
  .header__cta { display: none; }
  .logo small { display: none; }
  .header__phone { font-size: 15px; }
  .logo { font-size: 15px; gap: 8px; }
  .header__in { gap: 12px; }
}

/* Первый экран */
.hero { position: relative; background: var(--graphite); color: var(--white); overflow: hidden; }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(35,39,43,.92) 0%, rgba(35,39,43,.78) 38%, rgba(35,39,43,.15) 75%);
}
.hero__in { position: relative; min-height: min(calc(100vh - var(--header-h)), 760px); display: flex; flex-direction: column; justify-content: center; padding-top: 56px; padding-bottom: 0; }
.hero__status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #d6dadc; margin-bottom: 18px; }
.hero__status i { width: 8px; height: 8px; border-radius: 50%; background: #5ccf86; display: block; }
.hero h1 { font-size: clamp(36px, 5.6vw, 68px); max-width: 12.5em; letter-spacing: -0.025em; }
.hero__addr { margin: 16px 0 0; font-size: 18px; color: #d6dadc; }
.hero__price { margin: 28px 0 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 18px; }
.hero__price b { font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -0.02em; }
.hero__price span { color: #d6dadc; font-size: 16px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }

/* Табличка с цифрами — как шильдик на воротах */
.plate {
  position: relative; margin-top: 56px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--signal); color: var(--graphite);
}
.plate div { padding: 20px 24px 22px; border-left: 2px solid rgba(35,39,43,.22); }
.plate div:first-child { border-left: 0; }
.plate b { display: block; font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -0.02em; line-height: 1.1; }
.plate span { font-size: 14px; line-height: 1.3; display: block; margin-top: 4px; }

@media (max-width: 760px) {
  .hero__media { position: relative; height: 56vw; min-height: 220px; }
  .hero__media::after { background: linear-gradient(180deg, rgba(35,39,43,0) 55%, rgba(35,39,43,1) 100%); }
  .hero__in { min-height: 0; padding-top: 8px; }
  .hero__status { margin-bottom: 12px; }
  .hero__actions .btn { flex: 1 1 100%; }
  .plate { grid-template-columns: 1fr 1fr; margin-top: 36px; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); }
  .plate div:nth-child(3) { border-left: 0; }
  .plate div:nth-child(n+3) { border-top: 2px solid rgba(35,39,43,.22); }
  .plate div { padding: 16px var(--gutter) 18px; }
}

/* Характеристики */
.specs { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.dl { margin: 0; display: grid; grid-template-columns: minmax(150px, 38%) 1fr; }
.dl dt, .dl dd { padding: 14px 0; border-top: 1px solid var(--line); margin: 0; }
.dl dt { color: var(--steel); padding-right: 16px; }
.dl dd { font-weight: 500; }
.buildings { width: 100%; border-collapse: collapse; }
.buildings caption { text-align: left; font-weight: 700; font-size: 20px; padding-bottom: 12px; }
.buildings th, .buildings td { text-align: left; padding: 14px 8px 14px 0; border-top: 1px solid var(--line); }
.buildings thead th { font-weight: 400; color: var(--steel); font-size: 15px; border-top: 0; }
.buildings td.n, .buildings th.n { text-align: right; padding-right: 0; padding-left: 12px; white-space: nowrap; }
.buildings tfoot td { font-weight: 700; border-top: 2px solid var(--graphite); }
.bar { display: block; height: 6px; margin-top: 8px; background: var(--graphite); border-radius: 1px; }
@media (max-width: 900px) { .specs { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .dl { grid-template-columns: 1fr; } .dl dd { border-top: 0; padding-top: 0; } }

/* Галерея */
.gallery { position: relative; }
.gallery__track {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 14px; scrollbar-width: thin; scrollbar-color: var(--steel) transparent;
}
.gallery__item {
  flex: 0 0 auto; width: clamp(260px, 38vw, 480px); aspect-ratio: 4 / 3;
  scroll-snap-align: start; padding: 0; border: 0; background: var(--concrete); cursor: zoom-in;
  border-radius: var(--r-s); overflow: hidden; position: relative;
}
.gallery__item--tall { width: clamp(195px, 28.5vw, 360px); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; }
.gallery__item figcaption {
  position: absolute; left: 0; bottom: 0; padding: 6px 10px; font-size: 13px;
  background: rgba(35,39,43,.82); color: var(--white); border-top-right-radius: var(--r-s);
}
.gallery__ctrl { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.gallery__count { color: var(--steel); font-size: 15px; margin-right: auto; }
.icon-btn {
  width: 48px; height: 48px; display: inline-grid; place-items: center;
  border: 2px solid var(--graphite); background: var(--white); color: var(--graphite);
  border-radius: var(--r-s); cursor: pointer;
}
.icon-btn:hover { background: var(--concrete); }
.icon-btn svg { width: 20px; height: 20px; }
.gallery__note { color: var(--steel); font-size: 15px; margin: 18px 0 0; }

/* Полноэкранный просмотр */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(20,23,26,.96); color: var(--white);
  display: none; flex-direction: column;
}
.lightbox.is-open { display: flex; }
.lightbox__bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 20px; }
.lightbox__cap { margin-right: auto; font-size: 15px; color: #d6dadc; }
.lightbox__stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 12px 16px; touch-action: pan-y; }
.lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; background: var(--white); }
.lightbox .icon-btn { background: transparent; color: var(--white); border-color: rgba(255,255,255,.4); }
.lightbox .icon-btn:hover { background: rgba(255,255,255,.1); }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
@media (max-width: 640px) { .lightbox__nav { display: none; } }

/* Схема участка — главный элемент страницы */
.siteplan { display: grid; grid-template-columns: 1.55fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: start; }
.siteplan__svg { width: 100%; height: auto; display: block; background: var(--white); border: 2px solid var(--graphite); border-radius: var(--r-s); }
.siteplan__svg .plot { fill: #f5f6f5; stroke: var(--graphite); stroke-width: 6; stroke-linejoin: miter; }
.siteplan__svg .road { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 10 8; }
.siteplan__svg .bld rect, .siteplan__svg .bld path { fill: var(--white); stroke: var(--graphite); stroke-width: 4; transition: fill .15s; }
.siteplan__svg .bld { cursor: pointer; outline: none; }
.siteplan__svg .bld:hover rect, .siteplan__svg .bld:hover path { fill: #fdf0c4; }
.siteplan__svg .bld.is-active rect, .siteplan__svg .bld.is-active path { fill: var(--signal); }
.siteplan__svg .bld:focus-visible rect, .siteplan__svg .bld:focus-visible path { stroke: var(--signal-dark); stroke-width: 8; }
.siteplan__svg .bld text { font: 700 26px var(--font); fill: var(--graphite); pointer-events: none; }
.siteplan__svg .bld text.sub { font-weight: 400; font-size: 22px; }
.siteplan__svg .aux rect { fill: var(--concrete); stroke: var(--steel); stroke-width: 2; }
.siteplan__svg .aux text, .siteplan__svg .gate-label { font: 400 20px var(--font); fill: var(--steel); }
.siteplan__svg .gate { stroke: var(--signal-dark); stroke-width: 6; stroke-linecap: round; fill: none; }
.siteplan__hint { color: var(--steel); font-size: 15px; margin: 12px 0 0; }

.bcard { background: var(--graphite); color: var(--white); border-radius: var(--r-s); padding: 28px; }
.bcard h3 { font-size: 26px; }
.bcard__nums { display: flex; gap: 28px; margin: 18px 0 16px; flex-wrap: wrap; }
.bcard__nums b { display: block; font-size: 30px; letter-spacing: -0.02em; line-height: 1.1; color: var(--signal); }
.bcard__nums span { font-size: 14px; color: #b9c0c4; }
.bcard p { color: #d6dadc; }
.bcard__plan { display: block; width: 100%; padding: 0; border: 0; background: var(--white); cursor: zoom-in; border-radius: var(--r-s); overflow: hidden; margin-top: 8px; }
.bcard__plan img { width: 100%; height: 200px; object-fit: contain; padding: 10px; }
.bcard__planlabel { font-size: 14px; color: #b9c0c4; margin-top: 8px; display: block; }
.bcard__tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.bcard__tabs button {
  font: 500 14px var(--font); min-height: 40px; padding: 0 12px; cursor: pointer;
  background: transparent; color: #d6dadc; border: 1px solid #5b6368; border-radius: var(--r-s);
}
.bcard__tabs button[aria-pressed="true"] { background: var(--signal); color: var(--graphite); border-color: var(--signal); }
@media (max-width: 900px) { .siteplan { grid-template-columns: 1fr; } }

/* Варианты использования */
.uses { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 2px solid var(--graphite); }
.uses li { padding: 22px 20px 6px 0; }
.uses li + li { padding-left: 20px; border-left: 1px solid var(--line); }
.uses h3 { margin-bottom: 8px; }
.uses p { color: var(--steel); font-size: 15px; }
@media (max-width: 980px) {
  .uses { grid-template-columns: 1fr 1fr; }
  .uses li, .uses li + li { padding: 20px 16px 4px 0; border-left: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 520px) { .uses { grid-template-columns: 1fr; } }

/* Расположение */
.location { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(24px, 4vw, 48px); align-items: stretch; }
.location__map { min-height: 420px; background: var(--concrete); border-radius: var(--r-s); overflow: hidden; position: relative; }
.location__map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.location__addr { font-size: 22px; font-weight: 600; line-height: 1.3; margin: 0 0 18px; }
.location__coords { color: var(--steel); font-size: 15px; }
.location .btn { margin-top: 8px; }
@media (max-width: 900px) { .location { grid-template-columns: 1fr; } .location__map { min-height: 320px; } }

/* Документы и условия */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); }
.two h2 { margin-bottom: 24px; }
.cad { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cad code { font: 600 18px var(--font); letter-spacing: .01em; }
.link-btn { font: 500 15px var(--font); background: none; border: 0; padding: 4px 0; color: var(--graphite); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.note { font-size: 15px; color: var(--steel); margin-top: 18px; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }

/* Заявка */
.lead { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(32px, 5vw, 80px); }
.contact-person { margin: 28px 0 0; }
.contact-person b { font-size: 20px; display: block; }
.contact-person span { color: #b9c0c4; font-size: 15px; }
.contact-phone { display: inline-block; font-size: clamp(28px, 3.2vw, 38px); font-weight: 700; text-decoration: none; letter-spacing: -0.02em; margin: 14px 0 18px; }
.contact-phone:hover { color: var(--signal); }
.contact-links { display: flex; gap: 12px; flex-wrap: wrap; }

.form { background: var(--white); color: var(--graphite); border-radius: var(--r-s); padding: clamp(22px, 3vw, 36px); }
.form h3 { font-size: 24px; margin-bottom: 18px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .field legend { font-size: 15px; font-weight: 500; }
.field input[type=text], .field input[type=tel], .field textarea {
  font: 400 17px var(--font); color: var(--graphite);
  padding: 12px 14px; min-height: 48px; border: 2px solid var(--line); border-radius: var(--r-s); background: var(--white); width: 100%;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--graphite); outline: none; }
.field.is-invalid input { border-color: var(--err); }
.field__err { color: var(--err); font-size: 14px; display: none; }
.field.is-invalid .field__err { display: block; }
fieldset.field { border: 0; padding: 0; margin: 0 0 16px; }
.goals { display: flex; flex-wrap: wrap; gap: 8px; }
.goals label { position: relative; }
.goals input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.goals span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 2px solid var(--line); border-radius: var(--r-s); font-size: 15px; }
.goals input:checked + span { border-color: var(--graphite); background: var(--graphite); color: var(--white); }
.goals input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: 2px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--steel); margin: 4px 0 18px; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--graphite); }
.consent.is-invalid { color: var(--err); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .btn { width: 100%; }
.form__result { display: none; }
.form__result.is-shown { display: block; }
.form__result h3 { margin-bottom: 10px; }
.form__result .btn { margin-top: 10px; }
.form__result pre { white-space: pre-wrap; font: 400 15px/1.5 var(--font); background: var(--concrete); padding: 12px 14px; border-radius: var(--r-s); margin: 14px 0 0; }
@media (max-width: 900px) { .lead { grid-template-columns: 1fr; } }

/* Подвал */
.footer { background: #1b1f22; color: #b9c0c4; padding: 40px 0 120px; font-size: 14px; }
.footer__in { display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between; }
.footer a { color: #d6dadc; }
.footer p { margin: 0 0 6px; max-width: 640px; }
@media (min-width: 761px) { .footer { padding-bottom: 40px; } }

/* Плавающая панель на телефоне */
.mbar { display: none; }
@media (max-width: 760px) {
  .mbar {
    display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: var(--graphite); box-shadow: 0 -1px 0 rgba(255,255,255,.08);
  }
  .mbar .btn { padding: 0 10px; font-size: 15px; min-height: 48px; }
  .mbar .btn--ghost { color: var(--white); border-color: #5b6368; }
}

/* Служебные страницы */
.page { padding: clamp(40px, 6vw, 80px) 0; }
.page h1 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 24px; }
.page h2 { font-size: 22px; margin: 32px 0 10px; }
.page .wrap { max-width: 820px; }

/* Печать: презентация в PDF */
@media print {
  .header, .mbar, .gallery__ctrl, .lightbox, .form, .location__map, .hero__actions, .bcard__tabs, .no-print { display: none !important; }
  body { font-size: 12pt; }
  .hero { background: none; color: var(--graphite); }
  .hero__media { position: relative; height: 9cm; }
  .hero__media::after { display: none; }
  .hero__in { min-height: 0; padding: 12px 0 0; }
  .hero__addr, .hero__price span, .hero__status { color: var(--steel); }
  .section { padding: 18px 0; break-inside: avoid; }
  .section--dark { background: none; color: var(--graphite); }
  .gallery__track { flex-wrap: wrap; overflow: visible; }
  .gallery__item { width: 31%; }
  .gallery__item:nth-child(n+10) { display: none; }
  .plate { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .footer { padding: 12px 0; background: none; color: var(--graphite); }
}
