/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* авторский display не должен перебивать атрибут hidden */
html { scroll-behavior: smooth; scroll-padding-top: var(--s-8); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--fs-text)/1.6 var(--font-text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }
::selection { background: var(--accent); color: var(--paper-3); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--s-4); top: -4rem; z-index: 100; padding: var(--s-3) var(--s-4); background: var(--paper-3); border-radius: var(--r-sm); transition: top var(--t-fast); }
.skip:focus { top: var(--s-4); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: .98; letter-spacing: -.02em; }
body { font-variant-numeric: lining-nums; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.1; }
.eyebrow { font-size: var(--fs-micro); font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 var(--s-5); border-radius: var(--r-pill); background: var(--accent); color: var(--paper-3); font-weight: 600; font-size: var(--fs-small); text-decoration: none; border: 1px solid transparent; transition: transform var(--t-med) var(--ease-spring), background var(--t-fast); }
.btn:hover { transform: translateY(-2px); background: var(--accent-ink); }
.btn--ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn--ghost:hover { background: transparent; color: var(--accent); }
.btn--light { background: var(--paper-3); color: var(--ink); }
.btn--light:hover { background: var(--paper-2); }
.btn--sm { min-height: 2.75rem; padding: 0 var(--s-4); }
.link { text-decoration: underline; text-underline-offset: 3px; font-size: var(--fs-small); min-height: 2.75rem; padding: 0 var(--s-2); }

.chip { min-height: 2.75rem; padding: 0 var(--s-4); border: 1px solid var(--line); border-radius: var(--r-pill); font-size: var(--fs-small); font-weight: 500; white-space: nowrap; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.chip i { font-style: normal; opacity: .6; margin-left: var(--s-1); }
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--paper-3); border-color: var(--ink); }

/* reveal: скрываем только при работающем JS (класс ставит boot.js) */
.js .reveal { opacity: 0; transform: translateY(1.5rem); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- nav ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; gap: var(--s-5); padding: var(--s-3) var(--gutter); color: var(--paper); transition: background var(--t-med), color var(--t-med), box-shadow var(--t-med); }
.nav.is-solid { background: rgba(243, 238, 229, .88); backdrop-filter: blur(14px); color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.nav__brand { font: 500 1.75rem/1 var(--font-display); text-decoration: none; letter-spacing: -.01em; }
.nav__brand i { color: var(--accent); font-style: normal; }
.nav__links { display: flex; gap: var(--s-5); margin-left: auto; font-size: var(--fs-small); font-weight: 500; }
.nav__links a { text-decoration: none; padding: var(--s-3) 0; position: relative; }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: .5rem; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform var(--t-med) var(--ease); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: clamp(.75rem, 2.6svh, 3rem); padding: clamp(3.5rem, 8svh, 6rem) var(--gutter) clamp(.75rem, 2svh, 1.5rem); background: var(--ink); color: var(--paper); overflow: hidden; isolation: isolate; }
.hero__ridges, .contacts__ridges { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.ridge { fill: none; stroke: var(--paper); stroke-width: 1; vector-effect: non-scaling-stroke; transition: transform 1.2s var(--ease); }
.hero .eyebrow, .contacts .eyebrow { color: var(--muted-inv); }
.hero__inner { display: grid; gap: clamp(.5rem, 1.8svh, 1.5rem); max-width: 90rem; }
.hero__title { font-size: var(--fs-hero); line-height: .92; letter-spacing: -.035em; }
.hero__title em { color: var(--accent); font-weight: 300; }
.hero__title .line { display: block; overflow: hidden; padding-bottom: .08em; }
.hero__title .line > span { display: block; animation: rise 1.1s var(--ease) both; }
.hero__title .line:nth-child(2) > span { animation-delay: .1s; padding-left: clamp(0rem, 8vw, 9rem); }
.hero__title .line:nth-child(3) > span { animation-delay: .2s; }
@keyframes rise { from { transform: translateY(110%); } }
.hero__lead { max-width: 38rem; font-size: var(--fs-lead); color: var(--muted-inv); }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.hero__stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-inv); }
.hero__stats div { padding: clamp(.4rem, 1.4svh, 1rem) var(--s-4) 0 0; display: flex; flex-direction: column-reverse; gap: var(--s-1); }
.hero__stats dt { font-size: var(--fs-micro); letter-spacing: .14em; text-transform: uppercase; color: var(--muted-inv); }
.hero__stats dd { font: 400 clamp(1.75rem, 3.4vw, 3rem)/1 var(--font-display); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }

/* Первый экран целиком: заголовок, кнопки, счётчики и бегущая строка помещаются
   в высоту вьюпорта на любом устройстве — ничего не уезжает под сгиб. */
.screen { min-height: 100svh; display: flex; flex-direction: column; }
.screen > .hero { flex: 1 1 auto; min-height: 0; }
.screen > .marquee { flex: 0 0 auto; }

/* ---------- marquee ---------- */
.marquee { background: var(--ink-2); color: var(--paper); overflow: hidden; border-top: 1px solid var(--line-inv); }
.marquee__track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee__track span { padding: clamp(.35rem, 1.3svh, 1rem) var(--s-6); font: italic 300 clamp(1.5rem, 2.6vw, 2.25rem)/1 var(--font-display); white-space: nowrap; }
.marquee__track span::after { content: "✦"; font-style: normal; font-size: .5em; color: var(--accent); margin-left: var(--s-7); vertical-align: middle; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.catalog, .deal { padding: var(--s-10) var(--gutter); }
.section-head { display: grid; gap: var(--s-4); max-width: 60rem; margin-bottom: var(--s-8); }
.section-head__lead { max-width: 36rem; color: var(--muted); font-size: var(--fs-lead); }

.catalog__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); margin-bottom: var(--s-10); /* запас под листы, выезжающие из папок первого ряда */ }
.chips, .tabs { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.search { margin-left: auto; }
.search input { min-height: 2.75rem; width: min(16rem, 100%); padding: 0 var(--s-4); background: transparent; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; font-size: var(--fs-small); }
.search input::placeholder { color: var(--muted); }

/* ---------- папки ---------- */
.folders { --step: 1.95rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: var(--s-9) var(--s-6); }
.folder-cell { position: relative; }
.folder-cell[hidden] { display: none; }
.folder-cell:hover, .folder-cell:focus-within { z-index: 5; }
.folder { --tone: var(--tone-1); --tone-hi: var(--tone-1-hi); position: relative; display: block; width: 100%; height: 17rem; text-align: left; perspective: 60rem; -webkit-tap-highlight-color: transparent; }
.tone-2 { --tone: var(--tone-2); --tone-hi: var(--tone-2-hi); }
.tone-3 { --tone: var(--tone-3); --tone-hi: var(--tone-3-hi); }
.tone-4 { --tone: var(--tone-4); --tone-hi: var(--tone-4-hi); }

.folder__back { position: absolute; inset: 1.5rem 0 0 0; background: var(--tone); border-radius: 0 var(--r-md) var(--r-md) var(--r-md); box-shadow: var(--shadow-folder); }
.folder__back::before { content: ""; position: absolute; left: 0; bottom: 100%; width: 44%; height: 1.5rem; background: var(--tone); border-radius: var(--r-md) 0 0 0; clip-path: polygon(0 0, 78% 0, 100% 100%, 0 100%); margin-bottom: -1px; }

.folder__sheets { --n: 1; position: absolute; inset: 2.25rem 5% 1rem 5%; }
.sheets-2 { --n: 2; } .sheets-3 { --n: 3; } .sheets-4 { --n: 4; } .sheets-5 { --n: 5; }
.sheet:nth-child(5) { --k: 5; }.sheet { --k: 1; position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); padding: .5rem var(--s-3); background: var(--paper-3); border-radius: var(--r-sm); box-shadow: var(--shadow-sheet); font-size: .8125rem; line-height: 1.2; transform: translateY(calc((var(--n) - var(--k)) * -.3rem)); transition: transform var(--t-med) var(--ease-spring); transition-delay: calc(var(--k) * 25ms); }
.sheet:nth-child(2) { --k: 2; background: #f6f1e8; } .sheet:nth-child(3) { --k: 3; } .sheet:nth-child(4) { --k: 4; background: #f6f1e8; }
.sheet__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0; transition: opacity var(--t-fast); }
.sheet__meta { color: var(--accent-ink); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity var(--t-fast); }

.folder__front { position: absolute; inset: auto 0 0 0; height: 72%; display: grid; grid-template-columns: 1fr auto; grid-template-rows: 1fr auto auto; gap: var(--s-1) var(--s-3); padding: var(--s-4) var(--s-4) var(--s-4); color: var(--paper-3); background: linear-gradient(180deg, var(--tone-hi), var(--tone)); border-radius: var(--r-md); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16); transform-origin: 50% 100%; transition: transform var(--t-med) var(--ease-spring); backface-visibility: hidden; }
.folder__index { grid-column: 2; grid-row: 1; font: 300 var(--fs-small)/1 var(--font-text); opacity: .7; font-variant-numeric: tabular-nums; }
.folder__title { grid-column: 1; grid-row: 1; font: 400 clamp(1.625rem, 2.2vw, 2rem)/1.02 var(--font-display); letter-spacing: -.01em; }
.folder__addr { grid-column: 1 / -1; grid-row: 2; font-size: var(--fs-micro); opacity: .8; }
.folder__stat { grid-column: 1 / -1; grid-row: 3; padding-top: var(--s-3); margin-top: var(--s-2); border-top: 1px solid rgba(255, 255, 255, .22); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.folder__stat b { font-weight: 700; }

/* открытое состояние: hover, клавиатура; на тач-устройствах — всегда */
.folder:hover .folder__front, .folder:focus-visible .folder__front { transform: rotateX(-34deg); }
.folder:hover .sheet, .folder:focus-visible .sheet { transform: translateY(calc((var(--n) - var(--k) + 1) * var(--step) * -1)) rotate(calc((var(--k) - 2.5) * .7deg)); }
.folder:hover .sheet > span, .folder:focus-visible .sheet > span { opacity: 1; transition-delay: .12s; }
.folder:active .folder__front { transform: rotateX(-44deg); }
@media (hover: none) {
  .folders { row-gap: var(--s-10); }
  .folder .folder__front { transform: rotateX(-24deg); }
  .folder .sheet { transform: translateY(calc((var(--n) - var(--k) + 1) * var(--step) * -1)); }
  .folder .sheet > span { opacity: 1; }
}

.pick { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 2.75rem; margin-top: var(--s-3); padding: 0 var(--s-1); border-bottom: 1px solid var(--line); font-size: var(--fs-small); font-weight: 600; transition: color var(--t-fast), border-color var(--t-fast), padding var(--t-med) var(--ease); }
.pick:hover { color: var(--accent-ink); border-color: var(--accent-ink); padding-inline: var(--s-2); }

.empty { display: grid; justify-items: start; gap: var(--s-4); padding: var(--s-8) 0; font: 400 var(--fs-h3)/1.2 var(--font-display); }
.empty[hidden] { display: none; }

/* ---------- сделка ---------- */
.deal { background: var(--paper-2); }
.deal__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: var(--s-6); }
.deal__grid li { display: grid; align-content: start; gap: var(--s-3); padding-top: var(--s-4); border-top: 1px solid var(--ink); }
.deal__grid span { font: italic 300 2.5rem/1 var(--font-display); color: var(--accent-ink); }
.deal__grid p { color: var(--muted); font-size: var(--fs-small); }

/* ---------- контакты ---------- */
.contacts { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: var(--s-5); padding: var(--s-10) var(--gutter); background: var(--ink); color: var(--paper); }
.contacts h2 { max-width: 14ch; }
.contacts__links { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-4); }
.contacts__lead { max-width: 36rem; color: var(--muted-inv); font-size: var(--fs-lead); }

.footer { display: grid; gap: var(--s-2); padding: var(--s-6) var(--gutter); background: var(--ink); color: var(--muted-inv); font-size: var(--fs-micro); border-top: 1px solid var(--line-inv); }
.footer p { max-width: 60rem; }

/* ---------- drawer ---------- */
.drawer { width: min(62rem, 100%); max-width: none; height: 100dvh; max-height: none; margin: 0 0 0 auto; padding: 0; border: 0; background: var(--paper-3); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; }
.drawer[open] { animation: drawer-in var(--t-med) var(--ease); }
.drawer::backdrop { background: rgba(18, 33, 27, .6); backdrop-filter: blur(6px); animation: fade-in var(--t-med); }
@keyframes drawer-in { from { transform: translateX(4rem); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
.drawer__head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); padding: var(--s-5) var(--s-6) var(--s-4); background: var(--paper-3); border-bottom: 1px solid var(--line); }
.drawer__head h3 { font-size: clamp(2rem, 4vw, 3.25rem); margin: var(--s-1) 0; }
.drawer__stat { color: var(--muted); font-size: var(--fs-small); }
.drawer__actions { display: flex; align-items: center; gap: var(--s-3); flex: none; }
.drawer__close { flex: none; width: 3rem; height: 3rem; border: 1px solid var(--line); border-radius: 50%; font-size: 1.5rem; line-height: 1; transition: transform var(--t-med) var(--ease-spring), background var(--t-fast); }
.drawer__close:hover { transform: rotate(90deg); background: var(--paper-2); }
.drawer__tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-4) var(--s-6); }
.sort { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; font-size: var(--fs-small); color: var(--muted); }
.sort select { min-height: 2.75rem; padding: 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--paper-3); color: var(--ink); }

.lots { padding: 0 var(--s-6) var(--s-8); }
.lot { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem 10.5rem auto; align-items: center; gap: var(--s-4); padding: var(--s-4) 0; border-top: 1px solid var(--line); }
.lot[hidden] { display: none; }
.lot__name { font: 600 var(--fs-text)/1.3 var(--font-text); }
.lot__chips { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s-2); }
.lot__chips li { padding: .125rem var(--s-2); border-radius: var(--r-pill); background: var(--paper-2); font-size: var(--fs-micro); color: var(--ink-3); }
.lot__chips li:first-child { background: var(--ink); color: var(--paper-3); }
.lot__warn { margin-top: var(--s-2); font-size: var(--fs-micro); font-weight: 600; color: var(--warn); }
.lot__area { font-variant-numeric: tabular-nums; color: var(--muted); font-size: var(--fs-small); text-align: right; white-space: nowrap; }
.lot__price { display: grid; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lot__price b { font-weight: 700; }
.lot__price span { font-size: var(--fs-micro); color: var(--muted); }
.lot__ask { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 var(--s-4); border: 1px solid var(--ink); border-radius: var(--r-pill); font-size: var(--fs-small); font-weight: 600; white-space: nowrap; transition: background var(--t-fast), color var(--t-fast); }
.lot__ask:hover { background: var(--ink); color: var(--paper-3); }

/* ---------- внутренние страницы: объект, категория, статья ---------- */
.page { max-width: 72rem; margin-inline: auto; padding: var(--s-9) var(--gutter) var(--s-9); display: grid; gap: var(--s-7); }
.page > * { min-width: 0; }
.crumbs { font-size: var(--fs-small); color: var(--muted); overflow-wrap: anywhere; }
.crumbs a { text-underline-offset: 3px; }
.page__head { display: grid; gap: var(--s-4); }
.page__head h1 { font-size: var(--fs-h2); overflow-wrap: anywhere; }
.page__intro { max-width: 46rem; display: grid; gap: var(--s-3); color: var(--ink-3); font-size: var(--fs-lead); }
.page__section h2, .page__object > h2, .faq h2, .page__more h2 { font-size: var(--fs-h3); margin-bottom: var(--s-3); }
.page__section h2 small { font: 500 var(--fs-small)/1.4 var(--font-text); color: var(--muted); letter-spacing: 0; margin-left: var(--s-2); }
.page__photo { margin: 0; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); box-shadow: var(--shadow-sheet); }
.page__photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.page__object { display: grid; gap: var(--s-4); padding-top: var(--s-5); border-top: 1px solid var(--ink); }
.page .lots { padding: 0; }
.faq { display: grid; gap: var(--s-2); max-width: 52rem; }
.faq__item { border-top: 1px solid var(--line); }
.faq__item summary { min-height: 3rem; padding: var(--s-3) var(--s-6) var(--s-3) 0; font-weight: 600; cursor: pointer; list-style: none; position: relative; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; position: absolute; right: var(--s-2); top: 50%; translate: 0 -50%; font-size: 1.5rem; font-weight: 300; transition: rotate var(--t-med) var(--ease); }
.faq__item[open] summary::after { rotate: 45deg; }
.faq__item p { padding-bottom: var(--s-4); color: var(--ink-3); max-width: 46rem; }
.links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); }
.links a { display: inline-flex; align-items: center; min-height: 2.75rem; text-underline-offset: 3px; }
.seo-text { padding: var(--s-10) var(--gutter); display: grid; gap: var(--s-6); }
.seo-text .section-head { margin-bottom: 0; }
.folder-cell__page { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: var(--fs-micro); color: var(--muted); text-underline-offset: 3px; }
.footer__nav { padding-bottom: var(--s-3); border-bottom: 1px solid var(--line-inv); margin-bottom: var(--s-2); }

/* цены: пустые слоты заполняет main.js после входа; до входа в HTML цен нет вовсе */
[data-price-folder], [data-price-section] { font-style: normal; }
[data-price-folder]:not(:empty)::before, [data-price-section]:not(:empty)::before { content: " · "; }
.lot__price b:not(.is-open) { font-weight: 500; font-size: var(--fs-micro); color: var(--muted); white-space: normal; }
.lot__actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); }
.lot__state { padding: .25rem var(--s-3); border-radius: var(--r-pill); background: var(--paper-2); font-size: var(--fs-micro); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.lot__state--sold { background: var(--ink); color: var(--paper-3); }
.lot--sold .lot__main, .lot--sold .lot__area, .lot--sold .lot__price { opacity: .45; }
.lot--sold .lot__name { text-decoration: line-through; }
.lots__empty { padding: var(--s-7) 0; color: var(--muted); }
.hero__price:not(.is-open) { font-size: clamp(1.125rem, 1.8vw, 1.5rem) !important; color: var(--muted-inv); }
.footer a { color: inherit; }

/* ---------- форма заявки ---------- */
.modal { width: min(32rem, calc(100% - 2 * var(--s-4))); max-height: calc(100dvh - 2 * var(--s-4)); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--paper-3); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; }
.modal[open] { animation: modal-in var(--t-med) var(--ease); }
.modal::backdrop { background: rgba(18, 33, 27, .7); backdrop-filter: blur(6px); animation: fade-in var(--t-med); }
@keyframes modal-in { from { transform: translateY(1.5rem) scale(.98); opacity: 0; } }
.modal__close { position: absolute; top: var(--s-4); right: var(--s-4); z-index: 1; }
/* Окно всегда целиком в экране: высота ограничена 100dvh, длинное содержимое скроллится внутри,
   а кнопка отправки прилипает к низу и видна при любой высоте экрана. */
.lead { --pad: var(--s-5); display: grid; gap: var(--s-3); padding: var(--pad) var(--pad) 0; }
.lead[hidden] { display: none; }
.lead--done { padding-bottom: var(--pad); }
.lead h3 { font-size: clamp(1.75rem, 4vw, 2.25rem); padding-right: var(--s-8); }
.lead__ctx { padding: var(--s-2) var(--s-3); border-radius: var(--r-md); background: var(--paper-2); font-size: var(--fs-small); line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lead__foot { position: sticky; bottom: 0; display: grid; gap: var(--s-2); margin-inline: calc(var(--pad) * -1); padding: var(--s-3) var(--pad) var(--pad); background: linear-gradient(to bottom, transparent, var(--paper-3) var(--s-3)); }
.lead__foot .btn { width: 100%; }
.lead__ctx[hidden], .lead__status[hidden] { display: none; }
.field { display: grid; gap: var(--s-1); font-size: var(--fs-small); font-weight: 600; }
.field i { font-style: normal; font-weight: 400; color: var(--muted); }
.field textarea { font-family: inherit; line-height: 1.4; }
.field input, .field textarea { width: 100%; min-height: 2.75rem; padding: var(--s-2) var(--s-4); border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; font-size: 1rem; font-weight: 400; resize: vertical; transition: border-color var(--t-fast); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(200, 98, 58, .25); }
.field [aria-invalid="true"] { border-color: var(--warn); }
.field__err { min-height: 1em; font-style: normal; font-size: var(--fs-micro); font-weight: 600; color: var(--warn); }
.field__err:empty { display: none; }
.check { display: grid; grid-template-columns: auto 1fr; gap: var(--s-3); align-items: start; font-size: var(--fs-small); color: var(--muted); cursor: pointer; }
.check input { width: 1.375rem; height: 1.375rem; margin: .1rem 0 0; accent-color: var(--ink); }
.check a { color: var(--ink); }
.hp { position: absolute; left: -200vw; width: 1px; height: 1px; overflow: hidden; }
.lead__status { padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: rgba(138, 47, 29, .1); color: var(--warn); font-size: var(--fs-small); font-weight: 600; }
.lead .btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* ---------- согласие на аналитику ---------- */
/* Компактная полоса: не закрывает контент и кнопки первого экрана (на телефоне раньше занимала 35–43 % высоты). */
.consent { position: fixed; z-index: 60; left: var(--s-3); right: var(--s-3); bottom: var(--s-3); max-width: 46rem; margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-2) var(--s-4); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--ink); color: var(--paper); box-shadow: var(--shadow-folder); font-size: var(--fs-micro); line-height: 1.4; }
.consent .btn--sm { min-height: 2.75rem; padding: 0 var(--s-3); font-size: var(--fs-micro); }
.hub { display: grid; gap: var(--s-2); max-width: 52rem; }
.hub li { padding: var(--s-3) 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.hub a { font-weight: 600; text-underline-offset: 3px; }
.consent[hidden] { display: none; }
.consent__text a { color: var(--paper); }
.consent__actions { display: flex; gap: var(--s-2); }
/* десктоп: узкая карточка в правом нижнем углу — кнопки первого экрана стоят слева и остаются свободны */
@media (min-width: 44.0625rem) {
  .consent { left: auto; right: var(--s-4); bottom: var(--s-4); max-width: 24rem; margin-inline: 0; grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 44rem) {
  .consent { grid-template-columns: minmax(0, 1fr); left: var(--s-2); right: var(--s-2); bottom: var(--s-2); padding: var(--s-3); }
  .consent__actions .btn { flex: 1; }
  /* пока баннер показан, первый экран сжимается на его высоту: и кнопки, и бегущая строка остаются видны */
  body:has(.consent:not([hidden])) .screen { min-height: calc(100svh - 12rem); }
  body:has(.consent:not([hidden])) .hero .hero__lead { display: none; }
  body:has(.consent:not([hidden])) .hero .hero__stats { row-gap: var(--s-1); }
}

/* ---------- текстовые страницы (политика, статьи) ---------- */
.doc__main { max-width: 46rem; margin-inline: auto; padding: var(--s-10) var(--gutter) var(--s-9); display: grid; gap: var(--s-4); }
.doc__main h1 { font-size: var(--fs-h2); }
.doc__main h2 { font-size: var(--fs-h3); margin-top: var(--s-5); }
.doc__main p { color: var(--ink-3); overflow-wrap: anywhere; }

/* у Cormorant по умолчанию старостильные цифры («1» читается как «I»); шортхенд font сбрасывает вариант, поэтому правило стоит после компонентов */
.folder__title, .marquee__track span, .deal__grid span, .drawer__head h3, .nav__brand { font-variant-numeric: lining-nums; }

/* Пока показан баннер согласия, первый экран сжимается на его высоту: лид короче,
   отступы меньше — бегущая строка остаётся над баннером, кнопки не перекрыты. */
body:has(.consent:not([hidden])) .screen { min-height: calc(100svh - 9rem); }
body:has(.consent:not([hidden])) .hero { padding-top: clamp(2.5rem, 6svh, 4rem); }
body:has(.consent:not([hidden])) .hero__lead { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* ---------- адаптив ---------- */
/* Тесный экран: лид подрезается до трёх строк, счётчики — компактнее.
   Текст остаётся в разметке (нужен поиску), но первый экран не уезжает под сгиб. */
/* Совсем низкий экран (телефон в альбомной ориентации): лид и надзаголовок уходят,
   чтобы заголовок, кнопки, счётчики и бегущая строка остались в пределах экрана. */
@media (max-height: 34rem) {
  .hero__lead, .hero .eyebrow { display: none; }
  .hero__stats { grid-template-columns: repeat(4, 1fr); }
  .hero { padding-top: clamp(1.5rem, 5svh, 3rem); }
  .hero__title { line-height: .86; }
}

@media (max-width: 44rem), (max-height: 46rem) {
  .hero__lead { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: var(--fs-text); }
  .hero__stats dd { font-size: clamp(1.25rem, 5.2vw, 1.75rem); }
  .hero__stats dt { font-size: .6875rem; }
  .hero { padding-top: clamp(2.25rem, 6svh, 4rem); }
  .hero__stats div { padding-top: clamp(.25rem, 1svh, .5rem); }
  .marquee__track span { padding-block: clamp(.25rem, 1svh, .5rem); }
}

@media (max-width: 44rem) {
  .nav__links { display: none; }
  .nav .btn { margin-left: auto; }
  .hero { gap: clamp(.75rem, 2.2svh, 2rem); }
  .hero__stats { grid-template-columns: repeat(2, 1fr); row-gap: var(--s-3); }
  .catalog, .deal, .contacts { padding-block: var(--s-9); }
  .catalog__tools { margin-bottom: var(--s-10); }
  .search, .search input { width: 100%; margin-left: 0; }
  .chips, .tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; max-width: 100vw; }
  .drawer__head, .drawer__tools { padding-inline: var(--s-4); }
  .lead { --pad: var(--s-4); }
  .drawer__tools .tabs { margin-inline: calc(var(--s-4) * -1); padding-inline: var(--s-4); }
  .lots { padding-inline: var(--s-4); }
  .lot { grid-template-columns: 1fr auto; gap: var(--s-2) var(--s-4); }
  .lot__main { grid-column: 1 / -1; }
  .lot__area { text-align: left; grid-column: 1 / -1; }
  .lot__price { text-align: left; }
}

/* узкий или низкий экран (телефон, в т. ч. горизонтально): липкая шапка панели не должна съедать экран.
   Кнопка «Подобрать объект» при этом остаётся у каждого лота и под каждой папкой. */
@media (max-width: 44rem), (max-height: 34rem) {
  .drawer__head { align-items: center; padding-block: var(--s-3); }
  .drawer__head .eyebrow, .drawer__stat, .drawer__actions .btn { display: none; }
  .drawer__head h3 { font-size: 1.625rem; margin: 0; }
  .hero { min-height: 0; }
}

/* низкий экран: форма заявки сжимается, чтобы поместиться без прокрутки */
@media (max-height: 44rem) {
  .lead { gap: var(--s-2); }
  .lead .eyebrow { display: none; }
  .lead h3 { font-size: 1.625rem; }
  .lead__ctx { -webkit-line-clamp: 1; }
  .field textarea { min-height: 2.75rem; height: 2.75rem; }
  .check { font-size: var(--fs-micro); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .marquee__track { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
}
