/* ============================================================
   Оформление сайта. Правится редко.
   Данные проектов лежат в папке data/ — их этот файл не касается.
   ============================================================ */

:root {
  /* ---- база ---- */
  --bg:             #F7F5F1;
  --surface:        #FFFFFF;
  --surface-sunken: #F0EDE7;
  --ink:            #14130F;

  /* ---- текст ---- */
  --text-1:         #14130F;
  --text-2:         #57534A;
  --text-3:         #736E64;
  --text-on-ink-2:  #C9C3B6;

  /* ---- линии ---- */
  --line:           #E4E0D7;
  --line-strong:    #CFC9BC;

  /* ---- акцент ---- */
  --accent:         #7A5C33;
  --accent-hover:   #6B5228;
  --accent-soft:    #F2ECE1;
  --accent-gold:    #B99B6B;

  /* ---- статусы ---- */
  --ok:   #1F5C43;  --ok-bg:   #E7F0EA;  --ok-line:   #C3D8CB;
  --warn: #8A5A12;  --warn-bg: #F7EEDD;  --warn-line: #E6D3AE;
  --bad:  #9E2B2B;  --bad-bg:  #F8EAE8;  --bad-line:  #E9C6C2;

  /* ---- шрифты ---- */
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --fs-hero:  clamp(34px, 4.4vw, 56px);
  --fs-h1:    clamp(30px, 3.2vw, 42px);
  --fs-h2:    clamp(23px, 2.1vw, 28px);
  --fs-lead:  clamp(17px, 1.35vw, 19px);
  --fs-stat:  clamp(26px, 2.4vw, 32px);
  --fs-body:  16px;
  --fs-table: 15px;
  --fs-small: 13px;
  --fs-label: 11px;

  /* ---- сетка ---- */
  --container: 1240px;
  --container-wide: 1560px;
  --gutter: 32px;

  --sp-1:4px; --sp-2:8px;  --sp-3:12px; --sp-4:16px;
  --sp-5:24px; --sp-6:32px; --sp-7:48px; --sp-8:64px; --sp-9:96px;

  --r-xs:2px; --r-sm:3px; --r-md:4px; --r-lg:6px;

  --shadow-media: 0 18px 40px -26px rgba(20,19,15,.38);
  --shadow-pop:   0 28px 64px -22px rgba(20,19,15,.30), 0 2px 6px rgba(20,19,15,.05);
  --ease: cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2 { font-family: var(--font-display); font-weight: 500; color: var(--text-1); margin: 0; }
h1 { font-size: var(--fs-h1); line-height: 1.14; letter-spacing: -.012em; }
h2 { font-size: var(--fs-h2); line-height: 1.22; letter-spacing: -.008em; }
h3 { font-family: var(--font-ui); font-weight: 600; font-size: 17px; line-height: 1.35;
     letter-spacing: -.005em; color: var(--text-1); margin: 0; }
h4 { font-family: var(--font-ui); font-weight: 600; font-size: 16px; margin: 0; color: var(--text-1); }
p { max-width: 72ch; }

a { color: var(--accent); text-decoration: none;
    text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122,92,51,.16);
  border-radius: var(--r-xs);
}

.label {
  font-family: var(--font-ui); font-size: var(--fs-label); line-height: 1.3;
  font-weight: 500; letter-spacing: .11em; text-transform: uppercase; color: var(--text-3);
}
.lead { font-size: var(--fs-lead); line-height: 1.65; color: var(--text-2); max-width: 64ch; }
.small { font-size: var(--fs-small); line-height: 1.5; }
.muted { color: var(--text-2); }
.nowrap { white-space: nowrap; }

.num, .price, .stat__val, td.num, th.num {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.price, .stat__val { font-family: var(--font-display); font-weight: 500; letter-spacing: -.01em; }

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--wide { max-width: var(--container-wide); }
.page { padding: var(--sp-7) 0 var(--sp-9); }

/* ---------------- шапка ---------------- */

.top {
  position: sticky; top: 0; z-index: 60;
  background: rgba(247,245,241,.86);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
          backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top__in { display: flex; align-items: center; gap: var(--sp-6); min-height: 68px; }

.brand { font-family: var(--font-display); font-size: 19px; font-weight: 500;
         color: var(--text-1); letter-spacing: -.01em; line-height: 1.15; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand__sub { display: block; font-family: var(--font-ui); font-size: var(--fs-label);
              letter-spacing: .11em; text-transform: uppercase; color: var(--text-3); font-weight: 500; }

/* кнопка-гамбургер: видна только на узких экранах */
.navtoggle { display: none; width: 42px; height: 42px; margin-left: auto;
             flex-direction: column; align-items: center; justify-content: center; gap: 5px;
             background: none; border: 1px solid var(--line-strong); border-radius: var(--r-xs);
             cursor: pointer; padding: 0; }
.navtoggle__bar { display: block; width: 18px; height: 1.5px; background: var(--text-1);
                  transition: transform .18s var(--ease), opacity .18s var(--ease); }
.is-open .navtoggle__bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.is-open .navtoggle__bar:nth-child(2) { opacity: 0; }
.is-open .navtoggle__bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav { display: flex; gap: var(--sp-1); margin-left: auto; }
.nav a { position: relative; padding: 10px 12px; font-size: 14.5px; font-weight: 450;
         color: var(--text-2); border-radius: var(--r-xs); }
.nav a:hover { color: var(--text-1); text-decoration: none; background: var(--surface-sunken); }
.nav a.on { color: var(--text-1); font-weight: 500; background: none; }
.nav a.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px;
                   height: 1.5px; background: var(--accent); }

.top__contacts { display: flex; align-items: center; gap: var(--sp-2); padding-left: var(--sp-4);
                 border-left: 1px solid var(--line); }

/* переключатель языка */
.langsw { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-xs);
          overflow: hidden; }
.langsw button { height: 34px; padding: 0 11px; font: inherit; font-size: 12.5px; font-weight: 500;
                 letter-spacing: .04em; color: var(--text-3); background: var(--surface);
                 border: 0; cursor: pointer; transition: color .15s var(--ease), background .15s var(--ease); }
.langsw button + button { border-left: 1px solid var(--line); }
.langsw button:hover { color: var(--text-1); background: var(--surface-sunken); }
.langsw button.on { color: var(--text-1); background: var(--accent-soft); cursor: default; }
.cbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
        font-size: 13.5px; font-weight: 500; color: var(--text-1);
        border: 1px solid var(--line-strong); border-radius: var(--r-xs); background: var(--surface);
        transition: border-color .15s var(--ease), background .15s var(--ease); }
.cbtn:hover { border-color: var(--accent); color: var(--accent);
              background: var(--accent-soft); text-decoration: none; }

/* ---------------- форма заявки ---------------- */

.cbtn--lead { border-color: var(--accent); color: var(--accent); background: var(--accent-soft);
              font-family: inherit; cursor: pointer; }
.cbtn--lead:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.lead-back { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center;
             justify-content: center; padding: var(--sp-4);
             background: rgba(20,19,15,.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.lead-box { position: relative; width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto;
            padding: var(--sp-6); background: var(--surface);
            border: 1px solid var(--line-strong); border-radius: var(--r-md); }
.lead-box h2 { margin: 0 0 6px; }
.lead-x { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; padding: 0;
          font-size: 24px; line-height: 1; color: var(--text-3);
          background: none; border: 0; cursor: pointer; }
.lead-x:hover { color: var(--text-1); }

.lead-form { display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-5); }
.lead-form label { display: flex; flex-direction: column; gap: 6px;
                   font-size: var(--fs-label); letter-spacing: .09em; text-transform: uppercase;
                   color: var(--text-3); }
.lead-form input[type=text], .lead-form input[type=tel], .lead-form textarea {
  font: inherit; font-size: 15px; letter-spacing: normal; text-transform: none; color: var(--text-1);
  padding: 11px 13px; background: var(--surface-sunken);
  border: 1px solid var(--line-strong); border-radius: var(--r-xs); }
.lead-form input:focus, .lead-form textarea:focus {
  outline: 0; border-color: var(--accent); background: var(--surface); }
.lead-form input[readonly] { color: var(--text-3); }
.lead-form textarea { resize: vertical; }

.lead-agree { flex-direction: row !important; align-items: flex-start; gap: 10px !important;
              font-size: var(--fs-small) !important; letter-spacing: normal !important;
              text-transform: none !important; color: var(--text-2) !important; line-height: 1.5; }
.lead-agree input { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 1px; accent-color: var(--accent); }

.lead-err { padding: 10px 12px; font-size: var(--fs-small); border-radius: var(--r-xs);
            background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad); }
.lead-err--ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }

.lead-ready { width: 100%; margin: var(--sp-4) 0; padding: 12px 13px; resize: vertical;
              font: inherit; font-size: 14px; line-height: 1.5; color: var(--text-1);
              background: var(--surface-sunken); border: 1px solid var(--line-strong);
              border-radius: var(--r-xs); }

.lead-btns { display: flex; flex-direction: column; gap: var(--sp-2); }
.lead-btns .btn { text-decoration: none; }
.lead-btns a.btn:hover { text-decoration: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px;
       font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
       border: 1px solid var(--line-strong); border-radius: var(--r-xs);
       background: var(--surface); color: var(--text-1);
       transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); }
.btn--wa { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--wa:hover { filter: brightness(1.06); }
.btn--tg:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.lead-note { margin: 0; }

/* ---------------- секции ---------------- */

.section { margin: 0 0 var(--sp-8); }
.section__head {
  display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap;
  padding-bottom: var(--sp-3); margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--line-strong);
}
.section__head small { font: inherit; font-size: var(--fs-small); color: var(--text-3); }

/* страницы без section__head: заголовок сам работает как шапка раздела */
.section > h2 {
  display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap;
  padding-bottom: var(--sp-3); margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--line-strong);
}
.section > h2 small { font-family: var(--font-ui); font-weight: 400;
                      font-size: var(--fs-small); color: var(--text-3); }
.section h3 { margin-top: var(--sp-6); margin-bottom: var(--sp-3); }
.section ul { color: var(--text-2); }

[id] { scroll-margin-top: 132px; }

/* ---------------- чипы ---------------- */

.chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  border-radius: var(--r-xs); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text-2); white-space: nowrap;
}
.chip--ok   { background: var(--ok-bg);   border-color: var(--ok-line);   color: var(--ok); }
.chip--warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.chip--bad  { background: var(--bad-bg);  border-color: var(--bad-line);  color: var(--bad); }
.chip--solid { background: rgba(20,19,15,.62); border-color: transparent; color: #fff;
               -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* ---------------- фильтры ---------------- */

.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3) var(--sp-4);
  padding-bottom: var(--sp-5); margin-bottom: var(--sp-7);
  border-bottom: 1px solid var(--line-strong);
}
.fld { display: block; min-width: 180px; }
.fld--grow { flex: 1 1 260px; }
.fld .label { display: block; margin-bottom: 6px; }

input[type=text], input[type=number], select {
  font: inherit; font-size: 15px; width: 100%; height: 42px; padding: 0 12px;
  color: var(--text-1); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-xs);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:hover, select:hover { border-color: #B9B2A3; }

.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-xs);
             background: var(--surface); overflow: hidden; height: 42px; }
.seg { font: inherit; font-size: 14px; font-weight: 450; padding: 0 16px; height: 100%;
       background: none; border: 0; border-right: 1px solid var(--line);
       color: var(--text-2); cursor: pointer; }
.seg:last-child { border-right: 0; }
.seg:hover { background: var(--surface-sunken); color: var(--text-1); }
.seg.on { background: var(--ink); color: #fff; font-weight: 500; }

.filters__meta { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3);
                 font-size: var(--fs-small); color: var(--text-3); }
.linkbtn { font: inherit; font-size: 13px; background: none; border: 0; padding: 0;
           color: var(--accent); cursor: pointer; text-decoration: underline;
           text-underline-offset: .18em; }

.btn { display: inline-block; font: inherit; padding: 10px 18px; border-radius: var(--r-xs);
       border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-1);
       cursor: pointer; }
.btn:hover { background: var(--surface-sunken); text-decoration: none; }
.btn--pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--pri:hover { background: var(--accent-hover); }

/* ---------------- список проектов ---------------- */

.grid { display: grid; gap: var(--sp-7) var(--sp-6); grid-template-columns: repeat(3, 1fr); }

.pcard { display: flex; flex-direction: column; }
.pcard__media {
  position: relative; display: block; aspect-ratio: 3/2; overflow: hidden;
  border-radius: var(--r-md); background: var(--surface-sunken); box-shadow: var(--shadow-media);
}
.pcard__media img { width: 100%; height: 100%; object-fit: cover; display: block;
                    transition: transform .7s var(--ease); }
.pcard__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(20,19,15,.22), rgba(20,19,15,0) 42%);
}
.pcard:hover .pcard__media img { transform: scale(1.035); }
.pcard__noimg { position: absolute; inset: 0; display: flex; align-items: center;
                justify-content: center; color: var(--text-3); font-size: var(--fs-small); }
.pcard__flags { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; gap: 6px; }

.pcard__body { display: flex; flex-direction: column; flex: 1; padding-top: var(--sp-4); }

.pcard__place { display: flex; align-items: center; gap: 6px; margin: 0;
                font-size: var(--fs-small); color: var(--text-3); }
.pcard__place .pin { flex: 0 0 auto; color: var(--accent); }

.pcard__title { font-family: var(--font-display); font-weight: 500; font-size: 22px;
                line-height: 1.2; margin: 7px 0 10px; }
.pcard__title a { color: var(--text-1); }
.pcard:hover .pcard__title a { text-decoration: underline; text-decoration-color: var(--line-strong); }

.pcard__price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
                padding-bottom: var(--sp-4); border-bottom: 1px solid var(--line); }
.pcard__price .price { font-size: 25px; color: var(--text-1); }
.pcard__to { font-size: var(--fs-small); color: var(--text-3); }

/* строки «Комнаты · Оплата · Срок» — то, что покупатель сравнивает глазами */
.pcard__rows { display: flex; flex-direction: column; gap: 9px; padding: var(--sp-4) 0 0; }
.pcard__row { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: baseline; }
.pcard__rl { font-size: var(--fs-label); letter-spacing: .09em; text-transform: uppercase;
             color: var(--text-3); }
.pcard__val { font-size: var(--fs-small); color: var(--text-2); line-height: 1.45; }

.pcard__types { display: flex; flex-wrap: wrap; gap: 5px; }
.rt { display: inline-flex; align-items: center; height: 23px; padding: 0 9px;
      font-size: 12.5px; font-weight: 500; color: var(--text-1);
      background: var(--surface-sunken); border: 1px solid var(--line);
      border-radius: var(--r-xs); }

.pcard__foot { margin-top: auto; padding-top: var(--sp-4);
               display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
               color: var(--text-3); font-size: var(--fs-small); }

/* ---------------- герой ---------------- */

.hero {
  position: relative; margin-bottom: var(--sp-7);
  min-height: clamp(380px, 56vh, 640px); display: flex; align-items: flex-end;
  overflow: hidden; background: var(--ink);
}
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(20,19,15,.86) 0%, rgba(20,19,15,.45) 38%, rgba(20,19,15,.10) 70%),
    linear-gradient(to right, rgba(20,19,15,.42), rgba(20,19,15,0) 55%);
}
.hero__in { position: relative; width: 100%; padding-top: var(--sp-8);
            padding-bottom: var(--sp-6); color: #fff; }

.crumbs { font-size: var(--fs-small); color: var(--text-on-ink-2);
          margin-bottom: var(--sp-4); display: flex; gap: 8px; }
.crumbs a { color: var(--text-on-ink-2); }
.crumbs a:hover { color: #fff; }

.hero__title { font-family: var(--font-display); font-weight: 400;
               font-size: var(--fs-hero); line-height: 1.06; letter-spacing: -.018em;
               color: #fff; margin: 0 0 var(--sp-3); max-width: 16ch; }
.hero__title em { display: block; font-style: normal; font-family: var(--font-ui);
                  font-size: var(--fs-label); letter-spacing: .14em; text-transform: uppercase;
                  color: var(--accent-gold); margin-top: 12px; }
.hero__sub { font-size: 17px; color: rgba(255,255,255,.88); margin: 0 0 var(--sp-4); max-width: 56ch; }
.hero__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hero__gal { position: absolute; right: var(--gutter); bottom: var(--sp-6);
             font: inherit; font-size: 13px; font-weight: 500; letter-spacing: .04em;
             height: 40px; padding: 0 18px; cursor: pointer; color: #fff;
             background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.34);
             border-radius: var(--r-xs);
             -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hero__gal:hover { background: rgba(255,255,255,.20); }

/* ---------------- ключевые цифры ---------------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
         background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
         margin: 0 0 var(--sp-8); overflow: hidden; }
.stat { padding: var(--sp-5); border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .label { display: block; margin-bottom: 10px; }
.stat__val { display: block; font-size: var(--fs-stat); line-height: 1.1; color: var(--text-1); }
.stat__val--sm { font-family: var(--font-ui); font-size: 17px; font-weight: 500; color: var(--text-2); }

/* ---------------- вкладки ---------------- */

.tabs {
  position: sticky; top: 68px; z-index: 40;
  display: flex; margin: 0 0 var(--sp-7);
  background: rgba(247,245,241,.9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-strong);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: 0 0 auto; padding: 14px 16px; font-size: 14.5px; font-weight: 450;
          color: var(--text-3); border-bottom: 2px solid transparent;
          margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text-1); text-decoration: none; }
.tabs a.on { color: var(--text-1); font-weight: 500; border-bottom-color: var(--accent); }

/* ---------------- таблицы ---------------- */

.tw { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch;
      background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.tw::after { content: ""; position: absolute; top: 0; right: 0; width: 36px; height: 100%;
             pointer-events: none; opacity: 0; transition: opacity .2s var(--ease);
             background: linear-gradient(to left, rgba(20,19,15,.10), transparent); }
.tw.is-scrollable::after { opacity: 1; }

table { width: 100%; border-collapse: collapse; font-size: var(--fs-table); line-height: 1.45; }
thead th { background: var(--surface-sunken);
           font-size: var(--fs-label); font-weight: 500; letter-spacing: .09em; text-transform: uppercase;
           color: var(--text-3); text-align: left; white-space: nowrap;
           padding: 13px 16px; border-bottom: 1px solid var(--line-strong); }
tbody td { padding: 15px 16px; border-bottom: 1px solid var(--line);
           color: var(--text-2); vertical-align: top; }
tbody td b, tbody td strong { color: var(--text-1); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-sunken); }
td.num, th.num { text-align: right; white-space: nowrap; }
td.num--key { font-family: var(--font-display); font-size: 18px; font-weight: 500; color: var(--text-1); }
tfoot th { background: var(--surface-sunken); padding: 13px 16px; text-align: left;
           font-size: var(--fs-small); font-weight: 600; color: var(--text-1);
           border-top: 1px solid var(--line-strong); text-transform: none; letter-spacing: 0; }
caption { caption-side: bottom; text-align: left; padding: 14px 16px;
          font-size: var(--fs-small); color: var(--text-3); border-top: 1px solid var(--line); }
.tsplit td { border-top: 1px solid var(--line-strong); }

.tw--wide table { min-width: 860px; }
.tw--wide tbody td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface);
                                 border-right: 1px solid var(--line-strong); }
.tw--wide thead th:first-child { position: sticky; left: 0; z-index: 3; background: var(--surface-sunken); }
.tw--wide tbody tr:hover td:first-child { background: var(--surface-sunken); }

/* ---------------- пары ключ-значение ---------------- */

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 var(--sp-6); }
.kv > div { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-5);
            align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv b { color: var(--text-3); font-weight: 400; font-size: 14px; }
.kv span { text-align: right; font-weight: 500; font-size: 14.5px; color: var(--text-1); }

/* ---------------- нюансы ---------------- */

.notes { display: grid; gap: var(--sp-4); }
.note { position: relative; padding: 2px 0 2px var(--sp-5);
        border-left: 2px solid var(--line-strong); background: none; }
.note__lvl { display: inline-block; margin-bottom: 8px;
             font-size: 10.5px; font-weight: 600; letter-spacing: .13em;
             text-transform: uppercase; color: var(--text-3); }
.note h4 { margin: 0 0 6px; line-height: 1.35; }
.note p { margin: 0; font-size: 15px; color: var(--text-2); max-width: 78ch; }
.note--warn { border-left-color: var(--warn); }
.note--warn .note__lvl { color: var(--warn); }
.note--bad { border-left-color: var(--bad); }
.note--bad .note__lvl { color: var(--bad); }
.note--ok { border-left-color: var(--ok); }
.note--ok .note__lvl { color: var(--ok); }

/* ---------------- галереи ---------------- */

.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
       gap: var(--sp-5) var(--sp-4); }
.gal figure { margin: 0; }
.gal__tile { display: block; position: relative; width: 100%; padding: 0; cursor: pointer;
             aspect-ratio: 4/3; overflow: hidden;
             background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
             transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.gal__tile img { width: 100%; height: 100%; object-fit: cover; display: block;
                 transition: transform .6s var(--ease); }
.gal__tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow-media); }
.gal__tile:hover img { transform: scale(1.03); }
.gal figcaption { margin-top: 10px; text-align: left;
                  font-size: var(--fs-label); letter-spacing: .09em;
                  text-transform: uppercase; color: var(--text-3); }

.gal--plans { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.gal--plans .gal__tile { aspect-ratio: 1/1; background: #fff; padding: 16px; }
.gal--plans .gal__tile img { object-fit: contain; }
.gal--plans .gal__tile:hover img { transform: none; }

.gal--renders { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.gal--renders figure:first-child { grid-column: 1 / -1; }
.gal--renders figure:first-child .gal__tile { aspect-ratio: 21/9; }

/* ---------------- видео ---------------- */

.videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
          gap: var(--sp-5) var(--sp-4); }
.video { margin: 0; }
.video__frame { position: relative; aspect-ratio: 16/9; overflow: hidden;
                border-radius: var(--r-md); background: var(--ink);
                box-shadow: var(--shadow-media); }
.video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { margin-top: 10px; font-size: var(--fs-label); letter-spacing: .09em;
                    text-transform: uppercase; color: var(--text-3); }

@media (max-width: 640px) {
  .videos { grid-template-columns: 1fr; }
}

/* ---------------- карточка типа квартиры ---------------- */

/* сетка: 21 тип квартир читается глазами куда быстрее списком карточек,
   чем полосами во всю ширину, как было раньше */
.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
         gap: var(--sp-5); }

.unit { display: flex; flex-direction: column; background: var(--surface);
        border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
        transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.unit:hover { border-color: var(--line-strong); box-shadow: var(--shadow-media); }

.unit__plan { display: block; width: 100%; background: #fff; border: 0;
              border-bottom: 1px solid var(--line); padding: 14px; cursor: pointer; }
.unit__plan img { width: 100%; height: 190px; object-fit: contain; display: block; }

.unit__body { display: flex; flex-direction: column; flex: 1; padding: var(--sp-4) var(--sp-5) var(--sp-5); }

.unit__head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.unit__title { font-family: var(--font-display); font-weight: 500; font-size: 26px;
               line-height: 1; margin: 0; color: var(--text-1); }
.unit__tag { display: inline-flex; align-items: center; height: 21px; padding: 0 8px;
             font-size: 11.5px; font-weight: 500; color: var(--text-3);
             background: var(--surface-sunken); border: 1px solid var(--line);
             border-radius: var(--r-xs); }
.unit__sub { margin: 7px 0 0; font-size: var(--fs-small); color: var(--text-3); line-height: 1.45; }

.unit__price { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.unit__price .price { font-size: 23px; color: var(--text-1); }
.unit__ask { font-size: var(--fs-small); color: var(--text-3); }

/* две цены за метр рядом — суть подхода: считаем и от продажной, и от жилой */
.unit__perm { display: flex; flex-direction: column; gap: 3px; margin-top: 9px;
              font-size: var(--fs-small); color: var(--text-3); }
.unit__perm b { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }

.unit__areas { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: var(--sp-4) 0 0;
               background: var(--line); border: 1px solid var(--line); border-radius: var(--r-sm);
               overflow: hidden; }
.ua { padding: 10px 12px; background: var(--surface); }
.ua dt { font-size: var(--fs-label); letter-spacing: .08em; text-transform: uppercase;
         color: var(--text-3); margin-bottom: 3px; }
.ua dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-1);
         font-variant-numeric: tabular-nums; }
.ua--key dd { color: var(--accent); }

.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
         margin: var(--sp-4) 0 0; }
.specs > div { padding: 12px 16px 12px 0; border-right: 1px solid var(--line); }
.specs > div:last-child { border-right: 0; }
.specs dt { font-size: var(--fs-label); letter-spacing: .09em; text-transform: uppercase;
            color: var(--text-3); margin-bottom: 5px; }
.specs dd { margin: 0; font-size: 17px; font-weight: 600; color: var(--text-1);
            font-variant-numeric: tabular-nums; }
.specs__key { color: var(--accent) !important; }

.unit__rooms { list-style: none; margin: var(--sp-4) 0 0; padding: 0;
               display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
               gap: 0 var(--sp-5); }
.unit__rooms li { display: flex; justify-content: space-between; gap: 12px;
                  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.unit__rooms span { color: var(--text-3); }
.unit__rooms b { color: var(--text-1); font-weight: 500; font-variant-numeric: tabular-nums; }
.unit__note { margin-top: var(--sp-4); color: var(--text-3); }

/* ---------------- карта ---------------- */

.mapblock { display: grid; grid-template-columns: 1fr 340px;
            background: var(--surface); border: 1px solid var(--line);
            border-radius: var(--r-lg); overflow: hidden; }
.mapblock__map { height: clamp(420px, 56vh, 620px); background: var(--surface-sunken); }
.mapblock__side { border-left: 1px solid var(--line); padding: var(--sp-5);
                  overflow-y: auto; max-height: clamp(420px, 56vh, 620px); }

.leaflet-tile-pane { filter: saturate(.55) contrast(.92) brightness(1.05); }
.leaflet-container { font-family: var(--font-ui) !important; background: var(--surface-sunken); }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--text-1) !important;
                          border: 1px solid var(--line-strong) !important;
                          border-radius: var(--r-xs) !important;
                          width: 34px !important; height: 34px !important;
                          line-height: 32px !important; box-shadow: none !important;
                          font-weight: 400 !important; }
.leaflet-control-attribution { background: rgba(255,255,255,.82) !important;
                               font-size: 10.5px !important; color: var(--text-3) !important;
                               padding: 2px 8px !important; }
.leaflet-popup-content-wrapper { border-radius: var(--r-md) !important;
                                 box-shadow: var(--shadow-pop) !important; padding: 4px !important; }
.leaflet-popup-content { margin: 12px 14px !important; font-size: 14px !important; color: var(--text-2); }
.leaflet-popup-tip { box-shadow: none !important; }

.mk { width: 12px; height: 12px; border-radius: 50%; background: var(--text-2);
      border: 2px solid #fff; box-shadow: 0 1px 4px rgba(20,19,15,.4); }
.mk--project { width: 18px; height: 18px; background: var(--accent); }
.mk--transport { background: #3E5C76; }
.mk--edu { background: #5B6E4A; }
.mk--health { background: #9E2B2B; }
.mk--shop { background: #8A5A12; }
.mk--sight { background: #6B4E71; }

.poi-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 var(--sp-4); }
.poi-chip { font: inherit; font-size: 12.5px; height: 28px; padding: 0 11px; cursor: pointer;
            background: var(--surface); border: 1px solid var(--line-strong);
            border-radius: var(--r-xs); color: var(--text-2); }
.poi-chip:hover { border-color: var(--accent); color: var(--accent); }
.poi-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.poi-list { list-style: none; margin: 0; padding: 0; }
.poi-list li { display: flex; align-items: center; gap: 10px; padding: 11px 0;
               border-bottom: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.poi-list b { margin-left: auto; color: var(--text-1); font-weight: 500;
              font-variant-numeric: tabular-nums; white-space: nowrap; }
.poi-list__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: 0 0 auto; }
.poi-list__dot[data-cat=transport] { background: #3E5C76; }
.poi-list__dot[data-cat=edu] { background: #5B6E4A; }
.poi-list__dot[data-cat=health] { background: #9E2B2B; }
.poi-list__dot[data-cat=shop] { background: #8A5A12; }
.poi-list__dot[data-cat=sight] { background: #6B4E71; }

/* ---------------- прочее ---------------- */

.doclist { list-style: none; padding: 0; margin: 0; }
.doclist li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.doclist li:last-child { border-bottom: 0; }

.empty { padding: 40px 20px; text-align: center; color: var(--text-3);
         border: 1px dashed var(--line-strong); border-radius: var(--r-md);
         background: var(--surface-sunken); }

.site-foot { border-top: 1px solid var(--line); margin-top: var(--sp-9);
             padding: var(--sp-6) 0 var(--sp-8); color: var(--text-3); font-size: var(--fs-small); }
.site-foot p { margin: 0 0 8px; max-width: 84ch; }

/* ---------------- лайтбокс ---------------- */

.lb { position: fixed; inset: 0; background: rgba(20,19,15,.94);
      display: none; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.lb.on { display: flex; }
.lb img { max-width: 100%; max-height: 92vh; object-fit: contain; }
.lb .x { position: absolute; top: 16px; right: 20px; color: #fff; font-size: 30px;
         cursor: pointer; line-height: 1; opacity: .8; background: none; border: 0; }
.lb .nav-btn { position: absolute; top: 50%; transform: translateY(-50%);
               background: rgba(255,255,255,.12); color: #fff; border: 0;
               font-size: 26px; width: 46px; height: 60px; cursor: pointer;
               border-radius: var(--r-xs); }
.lb .prev { left: 16px; } .lb .next { right: 16px; }
.lb .cap2 { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center;
            color: var(--text-on-ink-2); font-size: 14px; }

/* ---------------- адаптив ---------------- */

/* семь разделов меню плюс две кнопки не помещаются в одну строку —
   переносим меню на вторую строку раньше, чем включится мобильная вёрстка */
@media (max-width: 1440px) {
  .top__in { flex-wrap: wrap; gap: var(--sp-4); }
  .nav { order: 3; width: 100%; margin: 0 calc(var(--gutter) * -1);
         padding: 0 var(--gutter) 8px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .top__contacts { margin-left: auto; border-left: 0; padding-left: 0; }
  .tabs { top: 106px; }
  [id] { scroll-margin-top: 168px; }
}

@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-6) var(--sp-5); }
}
@media (max-width: 1024px) {
  .mapblock { grid-template-columns: 1fr; }
  .mapblock__side { border-left: 0; border-top: 1px solid var(--line); max-height: none; }
}

@media (max-width: 720px) {
  /* мелкие подписи на телефоне поднимаем: 11px прописными читаются с трудом */
  :root { --gutter: 18px; --sp-8: 44px; --sp-9: 56px; --fs-label: 12px; --fs-small: 13.5px; }
  .note__lvl, .chip { font-size: 12px; }
  .top__in { min-height: 58px; gap: var(--sp-3); flex-wrap: nowrap; }
  .brand__sub { display: none; }

  /* разделы уходят под кнопку: в строку они не помещаются,
     а боковая прокрутка прятала половину сайта */
  .navtoggle { display: flex; order: 3; margin-left: 0; }
  .nav { order: 4; display: none; width: 100%; margin: 0 -18px; padding: 6px 18px 10px;
         flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
  .is-open .nav { display: flex; }
  .nav a { padding: 13px 4px; font-size: 16px; border-radius: 0;
           border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
  .nav a:hover { background: none; }
  .nav a.on { color: var(--accent); }
  .nav a.on::after { left: 4px; right: auto; width: 18px; bottom: 6px; }

  .top__contacts { margin-left: auto; border-left: 0; padding-left: 0; order: 2; }
  /* в узкой строке остаётся только WhatsApp, Telegram есть в подвале и контактах */
  .top__contacts .cbtn + .cbtn { display: none; }
  .cbtn { height: 36px; padding: 0 12px; font-size: 13px; }
  .tabs { top: 58px; }
  [id] { scroll-margin-top: 120px; }

  .hero { min-height: 64vh; }
  .hero__gal { position: static; display: block; width: 100%; margin-top: var(--sp-4); }
  .crumbs { display: none; }

  .grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .pcard__media { aspect-ratio: 4/3; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0; }

  .gal { grid-template-columns: repeat(2, 1fr); gap: var(--sp-4) var(--sp-3); }
  .gal--renders figure:first-child .gal__tile { aspect-ratio: 4/3; }

  .kv > div { grid-template-columns: 1fr; gap: 2px; }
  .kv span { text-align: left; }

  .tw thead th, .tw tbody td { padding: 13px; }

  .tw--cards { border: 0; background: none; overflow: visible; }
  /* карточная раскладка отменяет и минимальную ширину широкой таблицы,
     иначе .tw--wide держит 860px, а обёртка уже без прокрутки — страница едет вбок */
  .tw--cards table, .tw--cards tbody, .tw--cards tr, .tw--cards td {
    display: block; width: 100%; min-width: 0; }
  .tw--cards.tw--wide tbody td:first-child,
  .tw--cards.tw--wide thead th:first-child { position: static; }
  .tw--cards thead, .tw--cards tfoot, .tw--cards caption { display: none; }
  .tw--cards tr { background: var(--surface); border: 1px solid var(--line);
                  border-radius: var(--r-md); padding: var(--sp-4); margin-bottom: var(--sp-3); }
  .tw--cards td { display: flex; justify-content: space-between; gap: 16px; align-items: baseline;
                  padding: 9px 0; border-bottom: 1px solid var(--line); text-align: right; }
  .tw--cards td:last-child { border-bottom: 0; }
  .tw--cards td::before { content: attr(data-l); flex: 0 0 auto; text-align: left;
                          font-size: var(--fs-label); letter-spacing: .09em;
                          text-transform: uppercase; color: var(--text-3); }
  .tw--cards td:first-child { border-bottom: 1px solid var(--line-strong); padding-top: 0;
                              font-family: var(--font-display); font-size: 21px; color: var(--text-1); }
  .tw--cards td:first-child::before { display: none; }
}

@media (max-width: 480px) {
  .gal { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}

@media (hover: none) {
  .pcard:hover .pcard__media img { transform: none; }
  .gal__tile:hover img { transform: none; }
  .nav a, .cbtn, .seg, .poi-chip { min-height: 44px; }
}

@media print {
  .top, .tabs, .site-foot, .lb, .filters, .mapblock__map, .hero__gal { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .hero { min-height: auto; background: none; }
  .hero__scrim { display: none; }
  .hero__img { position: static; height: 180px; }
  .hero__title, .hero__sub { color: #000; }
  .pcard__media, .gal__tile, .stats, .tw { box-shadow: none !important; }
  .section, tr, .note, .unit { break-inside: avoid; }
}
