/* ──────────────────────────────────────────────────────────────
   Дикий Зруб ЕКО — components
   No font properties here at all: tokens.css assigns every element
   one of seven type styles. Spacing uses the --s-* ramp.
   ────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  
  
  overflow-x: hidden;
  /* light-on-dark picks up optical weight; antialiasing takes it back off */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

/* ── surfaces ──────────────────────────────────────────────── */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gut); }
.section { padding-block: var(--sp); }
.section--light { background: var(--paper); color: var(--ink); }
.section--tight { padding-top: clamp(28px, 4vw, 48px); }
.section--white { background: #fff; }

/* contacts: four channel cards */
.cxcards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); }
@media (max-width: 1100px) { .cxcards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cxcards { grid-template-columns: minmax(0, 1fr); } }
.cxc {
  display: flex; flex-direction: column; gap: var(--s-2); min-width: 0;
  padding: var(--s-5); border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel);
}
.cxc--main { border-color: var(--amber); }
.cxc__ico { width: 26px; height: 26px; fill: var(--amber); margin-bottom: var(--s-2); }
.cxc__big { color: var(--text); overflow-wrap: anywhere; transition: color .15s; }
.cxc__big:hover { color: var(--amber); }
.cxc__p { color: var(--dim); margin-bottom: var(--s-4); }
.cxc .btn { margin-top: auto; align-self: flex-start; }
.section--white .card { background: #fff; }

/* catalogue headline: second word on an amber slab, a huge outlined count */
.cat-hdr { position: relative; isolation: isolate; }
.cat-title { position: relative; z-index: 1; }
.cat-title__hl {
  position: relative; display: inline-block; isolation: isolate;
  padding: .06em .22em .02em; margin-left: -.06em; color: var(--ink);
}
.cat-title__hl > span { position: relative; z-index: 2; }
.cat-title__hl .slab__svg { transform: rotate(-1.2deg); }
.section--light .cat-title__hl .slab__line { stroke: var(--ink); }
.cat-big {
  position: absolute; z-index: -1; right: 0; top: 50%; transform: translateY(-58%);
  color: transparent; -webkit-text-stroke: 1.5px var(--rule); pointer-events: none;
}
@media (max-width: 820px) { .cat-big { top: 0; transform: none; opacity: .7; } }

.skip {
  position: absolute; left: -9999px; z-index: 100;
  background: var(--amber); color: #11160f;
  padding: var(--s-3) var(--s-5); 
}
.skip:focus { left: var(--gut); top: var(--s-3); }

h1.display { }

.mono {
  color: var(--dim);
}
.section--light .mono { color: var(--ink-2); }
.mono--amber { color: var(--amber); }
.section--light .mono--amber { color: var(--amber-ink); }

.lede {
  color: var(--dim); max-width: 54ch;
}
.section--light .lede { color: var(--ink-2); }

/* 80s-magazine slab under a line of copy — the amber of .btn--solid,
   a hairline outline out of register and a halftone patch */
.slab {
  position: relative; isolation: isolate;
  padding: clamp(28px, 3vw, 38px) clamp(26px, 3vw, 40px);
  color: var(--void);
}
.slab > span { position: relative; z-index: 2; }
.slab__svg {
  position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; overflow: visible;
}
.slab__fill { fill: var(--amber); }
.slab__line { fill: none; stroke: var(--text); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.slab__dots {
  position: absolute; z-index: 0; right: -14px; bottom: -22px;
  fill: var(--amber); opacity: .75;
}
.prose p { max-width: 66ch; color: var(--dim); }
.section--light .prose p { color: var(--ink-2); }
.prose p + p { margin-top: 1.05em; }

.hdr {
  display: grid; grid-template-columns: auto minmax(0, 44ch); justify-content: start;
  gap: clamp(18px, 3vw, 48px); align-items: end;
  margin-bottom: clamp(32px, 4.5vw, 64px);
}
@media (max-width: 820px) { .hdr { grid-template-columns: 1fr; align-items: start; } }
.hdr .mono { display: block; margin-bottom: var(--s-3); }

/* ── controls ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: var(--s-3) var(--s-5);
  border: 1px solid transparent; border-radius: var(--r-s);
  
  cursor: pointer;
  transition: background-color .16s, border-color .16s, color .16s;
}
.btn--solid { background: var(--amber); color: #15190f; }
.btn--solid:hover { background: var(--amber-2); }
.btn--ghost { border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { border-color: var(--text); background: rgba(233, 239, 228, .06); }
.section--light .btn--ghost { border-color: var(--rule); color: var(--ink); }
.section--light .btn--ghost:hover { border-color: var(--ink); background: rgba(18, 24, 19, .05); }

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--line-2); border-radius: 999px;
  background: transparent; cursor: pointer; color: var(--dim);
  
  transition: background-color .15s, color .15s, border-color .15s;
}
.chip:hover { color: var(--text); border-color: var(--text); }
.chip[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: #15190f; }
.section--light .chip { border-color: var(--rule); color: var(--ink-2); }
.section--light .chip:hover { border-color: var(--ink); color: var(--ink); }
.section--light .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ── header ────────────────────────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: var(--void); border-bottom: 1px solid var(--line);
}
.site-head__in { display: flex; align-items: center; gap: var(--s-5); min-height: 64px; }
.brand span { color: var(--amber); }
.brand__mark { display: block; width: 60px; height: auto; }
.nav {
  display: flex; gap: var(--s-5); margin-left: auto;
  
}
.nav a { color: var(--dim); transition: color .15s; }
.nav a:hover, .nav a[aria-current] { color: var(--amber); }
.head-cta { gap: var(--s-2); white-space: nowrap; }
.head-cta__s { display: none; }
@media (max-width: 420px) { .head-cta__l { display: none; } .head-cta__s { display: inline; } }

/* language switcher — sits in the right corner, close to the CTA */
.lang { position: relative; margin-left: calc(var(--s-3) - var(--s-5)); }
@media (max-width: 760px) { .lang { margin-left: calc(var(--s-2) - var(--s-4)); } }
.lang summary {
  list-style: none; display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-4); cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line-2); border-radius: var(--r-s); color: var(--text);
  transition: border-color .15s, color .15s;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after {
  content: ""; width: 6px; height: 6px; margin-top: -3px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform .15s;
}
.lang summary:hover { border-color: var(--text); }
.lang[open] summary { border-color: var(--amber); color: var(--amber); }
.lang[open] summary::after { transform: rotate(225deg); margin-top: 3px; }
.lang__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
  min-width: 200px; padding: var(--s-1); list-style: none; margin: 0;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
.lang__menu a {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
  padding: var(--s-2) var(--s-3); border-radius: var(--r-s); color: var(--text);
}
.lang__menu a:hover { background: rgba(233, 239, 228, .06); }
.lang__menu a span { color: var(--dim); }
.lang__menu a[aria-current] { color: var(--amber); }
.lang__menu a[aria-current] span { color: var(--amber); }
.head-cta::after { content: "→"; }
@media (max-width: 380px) { .head-cta { padding-inline: var(--s-4); } .head-cta::after { display: none; } }
/* anchors land below the sticky header */
[id] { scroll-margin-top: 80px; }
@media (max-width: 760px) { [id] { scroll-margin-top: 116px; } }
@media (max-width: 760px) {
  .site-head__in { flex-wrap: wrap; gap: 0 var(--s-4); padding-block: var(--s-3); min-height: 0; }
  .nav { order: 3; width: 100%; margin: var(--s-3) 0 0; gap: 0; justify-content: space-between; }
  .head-cta { margin-left: auto; }
}


/* ── hero ──────────────────────────────────────────────────── */
.hero { padding-block: clamp(44px, 6vw, 84px) clamp(48px, 6vw, 88px); position: relative; }
/* faint survey grid — the drawing board the catalogue sits on */
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 10%, transparent 72%);
}
.hero > * { position: relative; }
.hero h1 { max-width: 22ch; }
.hero h1 em { font-style: normal; color: var(--amber); }
.hero__lead {
  margin-top: var(--s-5); max-width: 46ch; color: var(--dim);
}
.hero__acts { margin-top: var(--s-6); display: flex; flex-wrap: wrap; gap: var(--s-3); }
@media (max-width: 560px) {
  .hero__acts { display: grid; grid-template-columns: 1fr; }
  .hero__acts .btn { width: 100%; }
}

.hero h1, .hero__lead, .hero__acts, .rig {
  animation: rise .8s cubic-bezier(.2, .7, .3, 1) backwards;
}
.hero__lead { animation-delay: .07s; }
.hero__acts { animation-delay: .13s; }
.rig { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@media (prefers-reduced-motion: reduce) {
  .hero h1, .hero__lead, .hero__acts, .rig { animation: none; }
}

/* ── the rig: hero catalogue browser, framed like a tool window ── */
.rig {
  margin-top: clamp(40px, 6vw, 72px);
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--panel); overflow: hidden;
}
.rig__bar {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.rig__dots { display: flex; gap: var(--s-2); }
.rig__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.rig__dots i:first-child { background: var(--amber); }
.rig__bar .mono { margin-left: auto; }

.rig__tabs { padding: var(--s-4); border-bottom: 1px solid var(--line); }

.rig__item {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  height: 420px; overflow: hidden;
}
/* all projects share one cell, so the window keeps the height of the
   tallest one and the ‹ › buttons never move while browsing */
.rig__body { display: grid; position: relative; }
/* area slider: one shared input laid over the empty slot in the
   «площа» row, so it never moves or hides while being dragged */
.rig__sq { align-items: center; }
.rig__slot { flex: 1; min-width: 40px; height: 20px; }
.rig__sq dd:last-child { flex: none; width: 6.2em; text-align: right; white-space: nowrap; }
.rig__sqr {
  position: absolute; left: 0; top: 0; width: 0; height: 20px; margin: 0; z-index: 2;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
}
.rig__item { grid-area: 1 / 1; }
.rig__item[hidden] { display: grid; visibility: hidden; }
@media (max-width: 820px) { .rig__item { grid-template-columns: 1fr; grid-template-rows: 240px 1fr; height: 590px; } .rig__rooms { display: none; } }

.rig__stage {
  display: grid; place-items: center; padding: var(--s-5);
  border-right: 1px solid var(--line);
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
}
@media (max-width: 820px) { .rig__stage { border-right: 0; border-bottom: 1px solid var(--line); } }
.rig__stage { min-height: 0; overflow: hidden; }
.rig__stage .plan { width: 100%; height: 100%; max-width: 360px; max-height: 100%; }
.rig__info { min-height: 0; overflow: hidden; }

.rig__info { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-1); }
.rig__kind {
  color: var(--dim); margin-bottom: var(--s-4);
}
.rig__spec { display: grid; }
.rig__spec div {
  display: flex; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-3) 0; border-bottom: 1px solid var(--line);
}
.rig__spec dt {
  color: var(--dim);
}
.rig__spec dd { font-variant-numeric: tabular-nums; }
.rig__rooms {
  margin-top: var(--s-4); color: var(--dim);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.rig__go { margin-top: auto; padding-top: var(--s-5); }

.rig__foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); border-top: 1px solid var(--line); background: var(--panel-2);
}
.rig__foot .mono { min-width: 7ch; }
.rig__scrub {
  flex: 1; min-width: 0; height: 20px; margin: 0 var(--s-2);
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
}
.rig__sqr::-webkit-slider-runnable-track, .rig__scrub::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--line-2); }
.rig__sqr::-moz-range-track, .rig__scrub::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line-2); }
.rig__sqr::-webkit-slider-thumb, .rig__scrub::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6.5px;
  border-radius: 50%; background: var(--amber); border: 0;
}
.rig__sqr::-moz-range-thumb, .rig__scrub::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--amber); border: 0; }
.rig__sqr:focus-visible, .rig__scrub:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.rig__nav { display: flex; gap: var(--s-2); }
.rig__nav button {
  width: 34px; height: 34px; border-radius: var(--r-s); cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--text);
  display: grid; place-items: center; line-height: 1;
  transition: border-color .15s, background-color .15s;
}
.rig__nav button:hover { border-color: var(--text); background: rgba(233, 239, 228, .07); }

/* ── data strip ────────────────────────────────────────────── */
.strip { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
@media (min-width: 680px) { .strip { grid-template-columns: repeat(4, 1fr); } }
.strip > div { background: var(--void); padding: var(--s-5) var(--s-5) var(--s-6); }
.strip b {
  display: block; margin-bottom: var(--s-2);
  
}
.strip span {
  color: var(--dim);
}

/* ── plans ─────────────────────────────────────────────────── */
.plan { color: var(--spruce); }
.plan .walls { fill: none; stroke: currentColor; stroke-width: 2; }
.plan .logend { stroke: var(--amber); stroke-width: 2; stroke-linecap: round; }
.plan .dim { stroke: var(--line-2); stroke-width: 1; }
.plan .dimtext { fill: var(--dim); }
.section--light .plan { color: #55684f; }
.section--light .plan .dim { stroke: var(--rule); }
.section--light .plan .dimtext { fill: var(--ink-2); }

/* ── catalogue ─────────────────────────────────────────────── */
.filters { display: flex; flex-direction: column; gap: var(--s-3); margin-bottom: var(--s-6); }
.filters__row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.filters__label, .count {
  color: var(--ink-2);
}
.filters__label { min-width: 62px; }
.subnote {
  margin-top: var(--s-1); max-width: 72ch; color: var(--ink-2);
  border-left: 2px solid var(--rule); padding-left: var(--s-3);
}

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); } }

.card {
  display: flex; flex-direction: column; background: var(--paper);
  padding: var(--s-4) var(--s-4) var(--s-5); outline: 1px solid var(--rule);
  transition: background-color .16s;
}
.card:hover { background: var(--paper-2); }
.card:hover .card__code { color: var(--amber-ink); }
@media (max-width: 520px) { .card { padding: var(--s-3); } }
.card__fig {
  position: relative; display: block; margin-bottom: var(--s-4);
  aspect-ratio: 4 / 3; border-radius: var(--r-s); background: var(--paper-2);
}
/* fixed viewBox + fixed frame → one shared scale */
.card__fig .plan { position: absolute; inset: var(--s-2); width: calc(100% - 16px); height: calc(100% - 16px); }
.card__code {
  transition: color .16s;
}
.card__type {
  margin-top: var(--s-1); color: var(--ink-2);
  
}
.card__meta {
  margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: var(--s-2);
  color: var(--ink-2); font-variant-numeric: tabular-nums;
}
@media (max-width: 520px) { .card__meta { flex-direction: column; gap: var(--s-1); } }
.card__area { color: var(--ink); }
.card.is-hidden { display: none; }
.empty { padding: var(--s-8) 0; color: var(--ink-2); }

/* ── project page ──────────────────────────────────────────── */
.proj__draw {
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r);
  padding: clamp(18px, 4vw, 44px); display: grid; place-items: center;
}
.spec { border-top: 1px solid var(--ink); }
.spec__row {
  display: flex; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-4) 0; border-bottom: 1px solid var(--rule);
}
.spec__k {
  color: var(--ink-2);
}
.spec__v { font-variant-numeric: tabular-nums; text-align: right; }

.floors { display: grid; gap: var(--s-5); margin-top: var(--s-6); }
@media (min-width: 560px) { .floors { grid-template-columns: repeat(auto-fit, minmax(186px, 1fr)); } }
.floor__h {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3);
  padding-bottom: var(--s-2); margin-bottom: var(--s-3); border-bottom: 1px solid var(--rule);
}
.floor__a {
  color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.rooms li {
  display: flex; gap: var(--s-3); padding: var(--s-1) 0;
}
.rooms li::before { content: ''; flex: 0 0 8px; height: 1px; margin-top: 0.8em; background: var(--amber); }
.variant-note {
  margin-top: var(--s-5); padding: var(--s-4) var(--s-5);
  background: var(--paper-2); border-left: 2px solid var(--amber);
}

/* ── datasheet ─────────────────────────────────────────────
   One primitive for every key→value block that is not a
   project: the material, the terms of work. Same chrome as the
   hero rig, so specs read the same way everywhere. */
.sheet {
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--panel); overflow: hidden;
}
.section--light .sheet { background: var(--paper-2); border-color: var(--rule); }
.sheet__bar {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-3); flex-wrap: wrap;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line); background: var(--panel-2);
}
.section--light .sheet__bar { background: var(--paper); border-color: var(--rule); }
.sheet__sub { display: block; margin-top: 2px; color: var(--dim);
              }
.section--light .sheet__sub { color: var(--ink-2); }
.sheet__body { padding: 0 var(--s-4) var(--s-2); }
.sheet__row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--line);
}
.section--light .sheet__row { border-color: var(--rule); }
.sheet__row:last-child { border-bottom: 0; }
.sheet__k {
  color: var(--dim);
  flex: 0 0 auto;
}
.section--light .sheet__k { color: var(--ink-2); }
.sheet__v { text-align: right; }

/* a prose value cannot be flush right — the ragged left edge is unreadable.
   Rows carrying sentences become a grid so every value starts on one line. */
.sheet__row--wide {
  display: grid; grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr);
  align-items: baseline;
}
@media (max-width: 560px) { .sheet__row--wide { grid-template-columns: 1fr; gap: var(--s-1); } }
.sheet__row--wide .sheet__v {
  text-align: left; color: var(--text);
}
.section--light .sheet__row--wide .sheet__v { color: var(--ink); }

/* ── craft section ─────────────────────────────────────────── */
.craft {
  display: grid; grid-template-columns: minmax(0, 23rem) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px); align-items: start;
}
@media (max-width: 860px) { .craft { grid-template-columns: 1fr; } }
.craft__aside p { color: var(--dim); max-width: 50ch; }

.tags { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.tag {
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: var(--s-2) var(--s-4); color: var(--text);
  
}

/* ── services ──────────────────────────────────────────────── */
.svc {
  display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
@media (min-width: 760px) { .svc { grid-template-columns: repeat(2, 1fr); } }
.svc__item { background: var(--panel); padding: clamp(24px, 3vw, 40px); transition: background-color .16s; }
.svc__item:hover { background: var(--panel-2); }
.svc__item h3 { margin-bottom: var(--s-3); }
.svc__item p { color: var(--dim); max-width: 44ch; }
.svc__n { display: block; margin-bottom: var(--s-3); }
.svc__link {
  margin-top: var(--s-4); display: inline-block; color: var(--amber);
  
  border-bottom: 1px solid currentColor; padding-bottom: 2px;
}

/* ── craft photo rail ──────────────────────────────────────── */
.rail {
  display: flex; gap: var(--s-3); overflow-x: auto;
  margin-top: clamp(32px, 4vw, 56px); padding-bottom: var(--s-3);
  scroll-snap-type: x mandatory;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
/* explicit box: a missing or slow image must not blow the section open */
.rail img {
  flex: 0 0 auto; width: 272px; height: 204px; object-fit: cover;
  border-radius: 8px; scroll-snap-align: start; background: var(--panel-2);
}
@media (max-width: 560px) { .rail img { width: 212px; height: 159px; } }

/* ── advantages: editorial rows, not cards ─────────────────── */
.perks { border-top: 1px solid var(--rule); }
.perk {
  display: grid; grid-template-columns: minmax(0, 5ch) minmax(0, 19ch) minmax(0, 1fr);
  gap: clamp(12px, 3vw, 44px); padding: clamp(20px, 2.6vw, 34px) 0;
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 760px) { .perk { grid-template-columns: 1fr; gap: var(--s-2); } }
.perk p { color: var(--ink-2); max-width: 68ch; }

/* ── stages: a real sequence, so numbered ──────────────────── */
.stages {
  counter-reset: s; display: grid; gap: 1px;
  background: var(--rule); border-block: 1px solid var(--rule);
}
@media (min-width: 720px)  { .stages { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .stages { grid-template-columns: repeat(3, 1fr); } }
.stage { counter-increment: s; background: var(--paper); padding: var(--s-5) var(--s-5) var(--s-6); }
.stage::before {
  content: counter(s, decimal-leading-zero); display: block; margin-bottom: var(--s-3);
  
  color: var(--amber-ink);
}
.stage h3 { margin-bottom: var(--s-2); }
.stage p { color: var(--ink-2); }


/* ── gallery ───────────────────────────────────────────────── */
.masonry { columns: 4 262px; column-gap: var(--s-3); }
.shot {
  break-inside: avoid; margin-bottom: var(--s-3); position: relative; display: block;
  width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
}
.shot img { width: 100%; height: auto; border-radius: 8px; background: var(--panel-2); }
.shot::after {
  content: ''; position: absolute; inset: 0; border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--line); transition: background-color .16s;
}
.shot:hover::after { background: rgba(232, 163, 61, .16); }
.shot.is-hidden { display: none; }

/* gallery as a contact sheet: equal tiles, numbered */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 46%), 1fr)); gap: var(--s-3); }
.shot--tile { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; }
.shot--tile img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; transition: transform .45s ease; }
.shot--tile:hover img { transform: scale(1.05); }
.shot__n, .shot__cat {
  position: absolute; z-index: 1; bottom: var(--s-2); padding: 3px 7px; border-radius: 4px;
  background: rgba(14, 19, 16, .72); color: var(--text); pointer-events: none;
}
.shot__n { left: var(--s-2); }
.shot__cat { right: var(--s-2); opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.shot--tile:hover .shot__cat, .shot--tile:focus-visible .shot__cat { opacity: 1; transform: none; }
.chip__n { opacity: .55; margin-left: 2px; }
.cat-big--dark { -webkit-text-stroke-color: var(--line-2); }
.lb__n {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  padding: 4px 10px; border-radius: 4px; background: rgba(14, 19, 16, .72); color: var(--text);
}

dialog.lb {
  padding: 0; border: 0; background: transparent;
  max-width: 100vw; max-height: 100vh; width: 100%; height: 100%;
}
dialog.lb::backdrop { background: rgba(8, 11, 9, .95); }
.lb__img { width: 100%; height: 100%; object-fit: contain; }
.lb__x, .lb__nav {
  position: fixed; background: rgba(233, 239, 228, .1); color: #fff; border: 0;
  border-radius: 999px; cursor: pointer; width: 46px; height: 46px;
  display: grid; place-items: center; line-height: 1;
  transition: background-color .15s;
}
.lb__x:hover, .lb__nav:hover { background: rgba(233, 239, 228, .26); }
.lb__x { top: var(--s-4); right: var(--s-4); }
.lb__nav--prev { left: var(--s-4); top: 50%; transform: translateY(-50%); }
.lb__nav--next { right: var(--s-4); top: 50%; transform: translateY(-50%); }

/* ── form ──────────────────────────────────────────────────── */
.contact {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 88px); align-items: start;
}
@media (max-width: 880px) { .contact { grid-template-columns: 1fr; } }
.field { display: block; margin-bottom: var(--s-4); }
.field > span {
  display: block; margin-bottom: var(--s-2); color: var(--dim);
  
}
.field input, .field textarea {
  width: 100%; padding: var(--s-3) var(--s-4);
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r-s);
  transition: border-color .15s;
}
.field input::placeholder, .field textarea::placeholder { color: #5f6b5f; }
.field input:focus, .field textarea:focus { border-color: var(--amber); }
.field textarea { min-height: 124px; resize: vertical; }
.req { color: var(--amber); }
.formnote { margin-top: var(--s-3); color: var(--dim); }
.formstatus {
  margin-top: var(--s-3); min-height: 1.4em; 
}
.formstatus[data-ok] { color: var(--spruce); }
.formstatus[data-err] { color: #e2714f; }

.cx { border-top: 1px solid var(--line-2); }
.cx__row {
  display: flex; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-4) 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.cx__k {
  color: var(--dim);
}
.cx__v { text-align: right; }
.cx__v a:hover { color: var(--amber); }

/* ── footer ────────────────────────────────────────────────
   A navigation surface, not a sign-off: the catalogue broken
   out by type with its real counts, plus the contacts. */
.foot {
  background: var(--void); color: var(--dim);
  padding-block: var(--s-8) var(--s-6);
  border-top: 1px solid var(--line);
}
.foot__cols {
  display: grid; gap: var(--s-7);
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  padding-bottom: var(--s-6); border-bottom: 1px solid var(--line);
}
@media (max-width: 820px) { .foot__cols { grid-template-columns: 1fr 1fr; gap: var(--s-6); } }
@media (max-width: 520px) { .foot__cols { grid-template-columns: 1fr; } }
.foot__col h4 {
  margin-bottom: var(--s-4); color: var(--dim);
  
}
.foot__row {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4);
  padding: var(--s-2) 0; border-bottom: 1px solid var(--line);
}
.foot__row:last-child { border-bottom: 0; }
.foot__row a, .foot__row span:first-child { color: var(--text); }
.foot__row a:hover { color: var(--amber); }
.foot__n { color: var(--amber); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.foot__lede { margin-top: var(--s-3); max-width: 32ch; }
.foot__bot {
  padding-top: var(--s-5); display: flex; flex-wrap: wrap; gap: var(--s-3);
  justify-content: space-between;
  
}
.foot__bot a:hover { color: var(--amber); }
.foot .brand { color: var(--text); }

/* ── misc ──────────────────────────────────────────────────── */
.back {
  display: inline-block; margin-bottom: var(--s-5); color: var(--ink-2);
  
}
.back:hover { color: var(--amber-ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── style guide page ──────────────────────────────────────── */
.sg__row {
  display: grid; grid-template-columns: minmax(0, 13ch) minmax(0, 1fr);
  gap: var(--s-5); padding: var(--s-5) 0; border-bottom: 1px solid var(--line);
  align-items: baseline;
}
@media (max-width: 620px) { .sg__row { grid-template-columns: 1fr; gap: var(--s-2); } }
.sg__meta { color: var(--dim); }
.sg__meta b { display: block; color: var(--text); }
.sw { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.sw figure { width: 132px; }
.sw i { display: block; height: 56px; border-radius: var(--r-s); border: 1px solid var(--line); }
.sw figcaption { margin-top: var(--s-2); color: var(--dim); }

/* ── catalogue card with a visualisation ───────────────────
   Same frame as the drawn cards, so a mixed grid stays even. */
.card__fig--photo {
  position: relative; display: block; padding: 0; overflow: hidden;
}
.card__fig--photo img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .7, .3, 1);
}
.card:hover .card__fig--photo img { transform: scale(1.04); }
.card__tag {
  position: absolute; left: var(--s-2); bottom: var(--s-2);
  padding: 3px var(--s-2); border-radius: 999px;
  background: rgba(14, 19, 16, .72); color: var(--text);
}
@media (prefers-reduced-motion: reduce) { .card__fig--photo img { transition: none; } }

/* ── project page ──────────────────────────────────────────
   Photo first, the decision panel beside it, the plan below. */
.pp { padding-bottom: var(--sp); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-2); margin-bottom: var(--s-4); }
.crumbs a { color: inherit; transition: color .15s; }
.crumbs a:hover { color: var(--amber-ink); }
.crumbs [aria-current] { color: var(--ink); }
.pp__steps { display: flex; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-5); }
.pp__chip {
  white-space: nowrap; border-radius: var(--r);
  border-color: var(--rule); background: var(--paper-2); color: var(--ink);
}
.pp__chip:hover { border-color: var(--ink); }
@media (max-width: 520px) { .pp__chip-w { display: none; } }
.pp__top {
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px); align-items: start;
}
@media (max-width: 980px) { .pp__top { grid-template-columns: minmax(0, 1fr); } }
.pp__media, .pp__aside { min-width: 0; }

.gal__stage { position: relative; }
.gal__main {
  display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in;
  aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--r);
  background: var(--paper-2);
  box-shadow: 0 1px 0 var(--rule), 0 24px 48px -28px rgba(18, 24, 19, .45);
}
.gal__main img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; }
.gal__main img.is-loading { opacity: .35; }
.gal__go {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 999px; border: 0; cursor: pointer;
  display: grid; place-items: center; line-height: 1;
  background: rgba(242, 243, 236, .88); color: var(--ink);
  box-shadow: 0 6px 18px -8px rgba(18, 24, 19, .5);
  transition: background-color .15s;
}
.gal__go:hover { background: var(--paper-2); }
.gal__go--prev { left: var(--s-3); }
.gal__go--next { right: var(--s-3); }
.gal__count {
  position: absolute; right: var(--s-3); bottom: var(--s-3);
  padding: 4px var(--s-3); border-radius: 999px;
  background: rgba(14, 19, 16, .72); color: var(--text);
}
.gal__thumbs {
  display: flex; gap: var(--s-2); margin-top: var(--s-3);
  overflow-x: auto; padding-bottom: var(--s-1);
  scrollbar-width: thin; scrollbar-color: var(--rule) transparent;
}
.gal__th {
  flex: 0 0 auto; width: 104px; aspect-ratio: 4 / 3; padding: 0; cursor: pointer;
  border: 2px solid transparent; border-radius: var(--r-s); overflow: hidden;
  background: var(--paper-2); opacity: .72; transition: opacity .15s, border-color .15s;
}
.gal__th img { width: 100%; height: 100%; object-fit: cover; }
.gal__th:hover { opacity: 1; }
.gal__th[aria-current] { opacity: 1; border-color: var(--amber); }
@media (max-width: 560px) { .gal__th { width: 84px; } .gal__go { width: 38px; height: 38px; } }

.gal--plan .proj__draw { aspect-ratio: 16 / 10; }
.gal--plan .plan { width: min(100%, 560px); height: auto; max-height: 100%; }

.pp__aside { display: flex; flex-direction: column; gap: var(--s-4); }
@media (min-width: 981px) { .pp__aside { position: sticky; top: 88px; } }
.pp__aside .lede { color: var(--ink-2); }
.proj__facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r);
  overflow: hidden;
}
.proj__fact { background: var(--paper-2); padding: var(--s-3) var(--s-4) var(--s-4); }
.proj__fact span { display: block; margin-bottom: var(--s-1); color: var(--ink-2); }
.proj__fact b { display: block; color: var(--ink); }
.pp__acts { display: grid; gap: var(--s-2); }
.proj__note { color: var(--ink-2); }

.pp__plan {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px); align-items: start;
  margin-top: clamp(40px, 6vw, 80px); padding-top: clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--rule);
}
.pp__plan--solo { grid-template-columns: 1fr; }
@media (max-width: 880px) { .pp__plan { grid-template-columns: minmax(0, 1fr); } }
.pp__plan .proj__draw { display: grid; gap: var(--s-3); justify-items: center; }
.pp__plan .proj__draw .plan { width: 100%; max-width: 520px; height: auto; }
.proj__cap { color: var(--ink-2); text-align: center; }
.pp__rooms .floors { margin-top: var(--s-4); }

.pp__nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3);
  margin-top: clamp(40px, 6vw, 72px);
}
.proj__step {
  display: grid; gap: 2px; padding: var(--s-4) var(--s-5);
  border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper-2);
  transition: border-color .15s;
}
.proj__step:last-child { text-align: right; }
.proj__step:hover { border-color: var(--ink); }
.proj__step:hover .card__code { color: var(--amber-ink); }
.proj__step-m { color: var(--ink-2); }

/* ── footer brand and menu ─────────────────────────────── */
.foot__brand { display: flex; align-items: center; gap: var(--s-3); color: var(--text); }
.foot__brand .brand__full { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: var(--s-4); }
.brand__word { display: block; width: 92px; height: auto; }
.foot__nav { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.foot__nav a { color: var(--text); }
.foot__nav a:hover { color: var(--amber); }
.foot__bot { align-items: center; }


/* «Запитати ціну» modal */
.ask {
  width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--panel); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
.ask::backdrop { background: rgba(8, 11, 9, .72); backdrop-filter: blur(3px); }
.ask__form { position: relative; display: grid; gap: var(--s-3); padding: var(--s-6) var(--s-5) var(--s-5); }
.ask__t { margin-bottom: var(--s-2); }
.ask__x {
  position: absolute; top: var(--s-3); right: var(--s-3); width: 36px; height: 36px;
  display: grid; place-items: center; line-height: 1; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: var(--r-s); background: transparent; color: var(--text);
}
.ask__x:hover { border-color: var(--text); }
.ask .btn { justify-self: stretch; }
.ask .formnote a { color: var(--amber); }
[aria-invalid] { border-color: #e06c5a !important; }

/* contacts map: a live Google map in a frame knocked out of register,
   with the amber slab as its caption and a halftone patch */
.mapx { position: relative; margin-top: var(--s-7); padding: 0 0 var(--s-6); isolation: isolate; }
.mapx__frame {
  position: relative; height: clamp(360px, 46vw, 540px);
  border-radius: var(--r); overflow: hidden; background: var(--panel);
}
.mapx::before {
  content: ""; position: absolute; z-index: -1; inset: -12px 14px calc(var(--s-6) + 12px) -14px;
  border: 1.5px solid var(--text); border-radius: var(--r); transform: rotate(-.6deg); pointer-events: none;
}
.mapx__map {
  width: 100%; height: 100%; border: 0; display: block;
  filter: saturate(.85);
}
.mapx__card {
  position: absolute; z-index: 2; left: clamp(16px, 4vw, 48px); bottom: 0;
  width: min(380px, calc(100% - 32px)); color: var(--void);
}
.mapx__card > span { display: grid; gap: var(--s-2); justify-items: start; }
.mapx__card .slab__line { display: none; }
.mapx__k { color: rgba(14, 19, 16, .7) !important; }
.mapx__btn { margin-top: var(--s-3); background: var(--void); color: var(--text); }
.mapx__btn:hover { background: #000; }
.mapx .slab__dots { right: -14px; bottom: auto; top: -22px; transform: scaleY(-1); }
@media (max-width: 560px) {
  .mapx { padding-bottom: 0; }
  .mapx__frame { height: 380px; }
  .mapx__card { position: relative; left: 0; width: 100%; margin-top: -40px; }
  .mapx::before { bottom: -12px; }
}

/* footer contacts: same rows as the catalogue column, icon where the count sits */
.foot__ct { align-items: center; color: var(--text); }
.foot__ct span { color: inherit; }
.foot__ct:hover { color: var(--amber); }
.foot__i { flex: 0 0 auto; width: 17px; height: 17px; color: var(--amber); }
