/* Берег — дизайн-система «Премиум закат».
   Один акцент (коралл), графитовые тёмные секции, тёплые светлые поверхности,
   тонированные тени, зерно, премиум-доверие. */

:root {
  /* Поверхности */
  --graphite: #1c2430;
  --graphite-2: #141d29;
  --bg: #f6f4f1;          /* тёплый off-white */
  --surface: #ffffff;
  --surface-2: #fbf9f6;

  /* Текст */
  --ink: #1b2430;
  --muted: #5c6770;
  --on-dark: #eef2f5;
  --on-dark-muted: #9fb0bd;

  /* Единственный акцент — коралл заката */
  --coral: #ff6b4a;
  --coral-600: #e8512f;
  --coral-100: #ffe7df;

  /* Линии / тени (тонированы под навы) */
  --line: #e8e2da;
  --line-dark: rgba(255,255,255,.10);
  --shadow-sm: 0 2px 10px -4px rgba(20,32,46,.16);
  --shadow: 0 14px 34px -16px rgba(20,32,46,.26);
  --shadow-lg: 0 30px 60px -24px rgba(20,32,46,.34);

  /* Статусы */
  --ok: #1c7c4a; --ok-bg: #e6f4ec;
  --warn: #b3531a; --warn-bg: #fbeee0;
  --danger: #a32020; --danger-bg: #fbe6e6;

  --r-lg: 20px; --r: 14px; --r-sm: 9px;
  --container: 1200px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
}

/* Тонкое зерно поверх всего, чтобы убрать «пластиковую» плоскость */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--coral-600); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { letter-spacing: -.02em; line-height: 1.1; color: var(--ink); text-wrap: balance; }
h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; margin: 0 0 6px; }
h3 { font-size: 19px; font-weight: 700; margin: 0 0 4px; }
p { text-wrap: pretty; }
.tnum { font-variant-numeric: tabular-nums; }

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--coral-600); margin: 0 0 10px; }
.lead { color: var(--muted); font-size: 18px; max-width: 62ch; }

/* Skip link (доступность) */
.skip { position: absolute; left: -999px; top: 0; background: var(--coral); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--r-sm) 0; z-index: 10000; }
.skip:focus { left: 0; }

:where(a, button, input, select):focus-visible {
  outline: 2px solid var(--coral); outline-offset: 2px; border-radius: 4px;
}

/* ---------- Header ---------- */
.topbar { background: var(--graphite-2); color: var(--on-dark-muted); font-size: 13.5px; }
.topbar .wrap { display: flex; gap: 18px; align-items: center; justify-content: flex-end; height: 38px; }
.topbar a { color: var(--on-dark-muted); }
.topbar a:hover { color: #fff; text-decoration: none; }
.topbar .phone { margin-right: auto; color: var(--on-dark); font-weight: 700; letter-spacing: .01em; }

.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(28,36,48,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-dark);
}
.header .wrap { display: flex; align-items: center; gap: 24px; height: 66px; }
.logo { font-weight: 800; font-size: 21px; letter-spacing: -.02em; color: #fff; display: inline-flex; align-items: center; gap: 9px; }
.logo:hover { text-decoration: none; }
.logo .mark { color: var(--coral); }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { color: var(--on-dark); font-size: 15px; font-weight: 500; opacity: .9; }
.nav a:hover { opacity: 1; text-decoration: none; }
.nav a.active { color: var(--coral); opacity: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 15px; padding: 12px 22px; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer; transition: transform .15s var(--ease), background .2s, box-shadow .2s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn--primary { background: var(--coral); color: #fff; box-shadow: 0 10px 22px -10px rgba(232,81,47,.7); }
.btn--primary:hover { background: var(--coral-600); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn--ghost:hover { border-color: #fff; background: rgba(255,255,255,.06); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #0f1620; }
.btn--block { width: 100%; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 700; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.muted { background: #eef1f3; color: var(--muted); }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--graphite); color: var(--on-dark); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(255,107,74,.30), transparent 55%),
    radial-gradient(90% 80% at 0% 110%, rgba(40,90,120,.45), transparent 60%),
    linear-gradient(180deg, #1c2430, #141d29);
}
.hero .wrap { position: relative; padding: 76px 24px 64px; }
.hero h1 { color: #fff; font-size: clamp(32px, 5vw, 52px); font-weight: 800; max-width: 16ch; margin: 0 0 16px; }
.hero p { color: var(--on-dark); opacity: .92; font-size: clamp(16px,1.8vw,20px); max-width: 56ch; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

/* Строка поиска в hero */
.searchbar {
  margin-top: 34px; background: rgba(255,255,255,.96); border-radius: var(--r);
  box-shadow: var(--shadow-lg); padding: 14px; display: grid; gap: 12px;
  grid-template-columns: 1.2fr 1fr 1fr auto; align-items: end;
}
.searchbar label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 5px; font-weight: 600; }
.searchbar select, .searchbar input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 15px; background: #fff; color: var(--ink);
}

/* ---------- Trust strip ---------- */
.trust { background: var(--surface); border-bottom: 1px solid var(--line); }
.trust .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 22px 24px; }
.trust .item { display: flex; gap: 12px; align-items: flex-start; }
.trust .ico { color: var(--coral); flex: none; margin-top: 2px; }
.trust b { display: block; font-size: 15px; }
.trust span { font-size: 13.5px; color: var(--muted); }

/* ---------- Grids / cards ---------- */
.grid { display: grid; gap: 20px; }
.grid--cats { grid-template-columns: repeat(4, 1fr); }
.grid--zhk { grid-template-columns: repeat(3, 1fr); }
.grid--cities { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-sm);
  border: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column;
  transition: transform .18s var(--ease), box-shadow .2s; text-decoration: none; color: inherit;
}
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.card h3 { margin-bottom: 6px; }
.card .muted { color: var(--muted); font-size: 14px; }
.card .spacer { margin-top: auto; }

.cat { gap: 10px; }
.cat .ico { width: 40px; height: 40px; border-radius: 11px; background: var(--coral-100); color: var(--coral-600); display: grid; place-items: center; margin-bottom: 6px; }

/* ЖК-карточка с «фото»-плейсхолдером (градиент, оффлайн-устойчиво) */
.zhk { padding: 0; overflow: hidden; }
.zhk .ph {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #24506a, #16323f);
  position: relative; overflow: hidden;
}
/* Base transition lives on the image itself so the scale-down is also smooth */
.zhk .ph-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
  transition: transform .55s var(--ease);
  will-change: transform;
}
/* Two-stop gradient replaced with a three-stop: top vignette (badge readability)
   + transparent midfield + bottom ramp (price/distance legibility).
   Colour tinted to graphite-2 to stay on-palette instead of pure black. */
.zhk .ph::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(
      180deg,
      rgba(20,29,41,.58)  0%,
      rgba(20,29,41,.08) 28%,
      rgba(20,29,41,.04) 52%,
      rgba(20,29,41,.72) 100%
    );
}
.zhk .ph .pin { position: absolute; top: 12px; left: 12px; }
/* Hover: lift card + zoom photo; scale defined here, not duplicated in hover */
a.card.zhk:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
a.card.zhk:hover .ph-img { transform: scale(1.06); }
.zhk .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.zhk .price { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.zhk .meta { color: var(--muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0 12px; }
/* Badge row: tighter drop-shadow so labels stay legible over any photo tone */
.zhk .ph-top {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  display: flex; gap: 6px; flex-wrap: wrap;
  filter: drop-shadow(0 1px 3px rgba(20,29,41,.45));
}
/* Distance-to-sea tag: frosted pill instead of raw text */
.zhk .ph-sea {
  position: absolute; bottom: 12px; left: 12px; z-index: 2;
  color: #fff; font-size: 12.5px; font-weight: 700;
  background: rgba(20,29,41,.42);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.18);
  padding: 3px 9px;
  border-radius: 20px;
  text-shadow: none;
}
.zhk .ph-sea::before { content: "〜 "; color: #aee3ef; }
.roommatrix { margin: 12px 0 2px; border-top: 1px solid var(--line); }
.roommatrix .rm { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.roommatrix .rm span { color: var(--muted); }
.roommatrix .rm b { font-variant-numeric: tabular-nums; }
.yieldteaser { background: var(--coral-100); color: var(--coral-600); font-weight: 700; font-size: 13px; padding: 7px 11px; border-radius: var(--r-sm); margin-bottom: 10px; }
.yieldteaser span { background: #fff; color: var(--muted); font-weight: 600; font-size: 11px; padding: 1px 6px; border-radius: 5px; margin-left: 4px; }

/* ---------- Honest-analytics band (dark, акцент-секция) ---------- */
.analytics { background: var(--graphite); color: var(--on-dark); }
.analytics .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 64px 24px; }
.analytics h2 { color: #fff; }
.analytics .lead { color: var(--on-dark); opacity: .9; }
.analytics ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.analytics li { display: flex; gap: 10px; align-items: flex-start; }
.analytics li .ico { color: var(--coral); flex: none; }
.analytics .panel { background: rgba(255,255,255,.05); border: 1px solid var(--line-dark); border-radius: var(--r); padding: 22px; }
.analytics .panel .range { font-size: 40px; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.analytics .panel .scn { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line-dark); font-size: 14px; }
.analytics .panel .scn:last-child { border-bottom: 0; }
.analytics .panel .scn b { color: #fff; }

/* ---------- Lead form ---------- */
.leadform { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 32px; }
.leadform .row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
.field label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 5px; font-weight: 600; }
.field input, .field select { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 15px; background: #fff; }
.consent { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

/* ---------- Estimate block ---------- */
.est { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow-sm); }
.est .range { font-size: 34px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.est table { width: 100%; border-collapse: collapse; margin-top: 14px; font-variant-numeric: tabular-nums; }
.est th, .est td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.est th { background: var(--surface-2); font-weight: 600; color: var(--muted); }
.est tr:last-child td { border-bottom: 0; }
.disc { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; margin-top: 14px; font-size: 13px; color: #5a5046; }
.disc ul { margin: 6px 0 0; padding-left: 18px; }
.src { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---------- Tables / generic ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.table th { background: var(--surface-2); font-weight: 600; color: var(--muted); }

.notice { display: flex; gap: 10px; align-items: center; background: var(--warn-bg); border: 1px solid #f0d8bd; color: #7a4a1c; border-radius: var(--r-sm); padding: 11px 16px; font-size: 13.5px; }
.notice .ico { color: var(--warn); flex: none; }

.crumbs { font-size: 13px; color: var(--muted); padding: 18px 0 0; }
.crumbs a { color: var(--muted); }

/* Filter bar */
.filters { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.filters .fl label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 4px; font-weight: 600; }
.filters select { padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14px; background: #fff; }
.filters .fl-check { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink); padding-bottom: 9px; }

/* Gallery (ЖК page) */
/* Outer wrapper: establish a shared height so main + thumb column match exactly */
.gallery {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 12px;
  margin-top: 18px;
  /* Anchor height so both columns fill identically */
  height: 420px;
}
/* Main photo: fills the full left column height */
.gallery .g-main {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--r-lg);         /* larger radius = more premium than cards */
  box-shadow: var(--shadow);
  display: block;
  transition: opacity .2s;
}
.gallery .g-main:hover { opacity: .94; }
/* Right column: 2×2 grid of equal-height thumbs using fr units */
.gallery .g-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;        /* equal rows, fill parent height */
  gap: 10px;
}
.gallery .g-thumbs img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--r);
  display: block;
  transition: transform .35s var(--ease), box-shadow .25s;
  cursor: pointer;
}
.gallery .g-thumbs img:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow);
  position: relative; z-index: 1;     /* bring above siblings when scaled */
}

/* Video block (poster placeholder) */
.videoblock {
  position: relative;
  margin-top: 14px;
  border-radius: var(--r-lg);        /* consistent with gallery main */
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
}
/* Darken poster slightly and add a subtle warm overlay so the coral play
   button reads clearly against any photo content */
.videoblock .vb-poster {
  width: 100%;
  aspect-ratio: 16/9;               /* predictable height, removes max-height guess */
  object-fit: cover;
  display: block;
  filter: brightness(.75) saturate(.9);
  transition: filter .35s var(--ease);
}
.videoblock:hover .vb-poster { filter: brightness(.68) saturate(.95); }
/* Bottom-third scrim: legibility layer for label, tinted to graphite palette */
.videoblock::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(20,29,41,0)    50%,
    rgba(20,29,41,.62) 100%
  );
  pointer-events: none;
}
/* Play button: centred absolutely, coral fill, strong coral glow, soft pulse on hover */
.videoblock .vb-play {
  position: absolute; inset: 0; margin: auto;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255,107,74,.95);
  border: 2px solid rgba(255,255,255,.30);
  color: #fff;
  display: grid; place-items: center;
  font-size: 24px; padding-left: 4px;
  box-shadow:
    0 0 0 0       rgba(232,81,47,.50),
    0 14px 36px -8px rgba(232,81,47,.72);
  transition:
    transform .25s var(--ease),
    box-shadow .25s var(--ease),
    background .2s;
  z-index: 2;
}
.videoblock:hover .vb-play {
  transform: scale(1.10);
  background: var(--coral-600);
  box-shadow:
    0 0 0 10px    rgba(232,81,47,.18),
    0 16px 40px -8px rgba(232,81,47,.80);
}
/* Label: sits above the scrim layer (z-index > ::after), frosted pill styling */
.videoblock .vb-label {
  position: absolute; left: 16px; bottom: 14px;
  z-index: 2;
  color: #fff; font-size: 13px; font-weight: 700;
  letter-spacing: .01em;
  text-shadow: 0 1px 8px rgba(20,29,41,.7);
}

/* Construction stage tracker */
.stages { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.stages .st { flex: 1; min-width: 64px; text-align: center; font-size: 11.5px; color: var(--muted); }
.stages .st .bar { height: 6px; border-radius: 4px; background: var(--line); margin-bottom: 6px; }
.stages .st.done .bar { background: var(--coral); }
.stages .st.done { color: var(--ink); font-weight: 600; }

/* Шахматка (chess board) */
.chess { overflow-x: auto; margin-top: 14px; }
.chess table { border-collapse: collapse; min-width: 100%; }
.chess td, .chess th { border: 1px solid var(--line); padding: 0; }
.chess th { background: var(--surface-2); font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; white-space: nowrap; }
.chess .cell { display: block; min-width: 86px; padding: 7px 9px; font-size: 12px; line-height: 1.3; text-decoration: none; }
.chess .cell b { display: block; font-size: 13px; font-variant-numeric: tabular-nums; }
.chess .free { background: #e9f6ee; color: #15623a; }
.chess .free:hover { background: #d6efe0; }
.chess .reserved { background: #fbeee0; color: #8a4413; }
.chess .sold { background: #f0eeec; color: #9a9088; text-decoration: line-through; }
.chess .empty { background: var(--surface); }
.chess-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.chess-legend span::before { content: "■ "; }
.chess-legend .lf::before { color: #2f9e63; } .chess-legend .lr::before { color: #d98a3a; } .chess-legend .ls::before { color: #b8b0a8; }

/* Quiz */
.qbar { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 18px; }
.qbar > span { display: block; height: 100%; width: 20%; background: var(--coral); transition: width .3s var(--ease); }
.qstep { border: 0; padding: 0; margin: 0; }
.qstep legend { font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 14px; padding: 0; }
.qopts { display: grid; gap: 10px; margin-bottom: 18px; }
.qopts label { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font-size: 15px; transition: border-color .15s, background .15s; }
.qopts label:hover { border-color: var(--coral); background: var(--surface-2); }
.qopts input { accent-color: var(--coral); }
.qstep .btn { margin-right: 8px; }

/* Mortgage / payment calculator */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.calc-out { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.calc-out .big { font-size: 32px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */
.footer { background: var(--graphite-2); color: var(--on-dark-muted); margin-top: 56px; }
.footer .wrap { padding: 40px 24px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.footer h4 { color: #fff; font-size: 15px; margin: 0 0 12px; }
.footer a { color: var(--on-dark-muted); display: block; padding: 3px 0; }
.footer a:hover { color: #fff; text-decoration: none; }
.footer .legal { border-top: 1px solid var(--line-dark); }
.footer .legal .wrap { padding: 16px 24px; grid-template-columns: 1fr; font-size: 12.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .searchbar, .leadform .row { grid-template-columns: 1fr 1fr; }
  .grid--cats { grid-template-columns: repeat(2, 1fr); }
  .grid--zhk { grid-template-columns: repeat(2, 1fr); }
  .trust .wrap { grid-template-columns: repeat(2, 1fr); }
  .analytics .wrap { grid-template-columns: 1fr; }
  .footer .wrap { grid-template-columns: 1fr 1fr; }
  /* Gallery: reduce fixed height on mid-size screens */
  .gallery { height: 320px; }
}
@media (max-width: 620px) {
  .nav { display: none; }
  .searchbar, .leadform .row, .grid--cats, .grid--zhk, .grid--cities, .trust .wrap, .footer .wrap { grid-template-columns: 1fr; }
  .hero .wrap { padding: 52px 20px 44px; }
  .section { padding: 44px 0; }
  /* Gallery: collapse to single column, auto height so image isn't squashed */
  .gallery {
    grid-template-columns: 1fr;
    height: auto;
  }
  .gallery .g-main { aspect-ratio: 16/9; height: auto; border-radius: var(--r); }
  .gallery .g-thumbs { grid-template-rows: auto; }
  .gallery .g-thumbs img { aspect-ratio: 4/3; height: auto; border-radius: var(--r-sm); }
  /* Video: play button slightly smaller on narrow screens */
  .videoblock .vb-play { width: 58px; height: 58px; font-size: 20px; }
  /* ZHK card: slightly taller photo crop on mobile for impact */
  .zhk .ph { aspect-ratio: 3/2; }
}

/* Fallback fill, чтобы не было белой дыры, если фото не загрузилось */
.gallery .g-main, .gallery .g-thumbs img, .videoblock .vb-poster { background: linear-gradient(135deg, #24506a, #16323f); }

/* ── ИИ-помощник (плавающий остров) ───────────────────────────── */
.ai { position: fixed; right: 18px; bottom: 18px; z-index: 60; }
.ai-fab {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--graphite); color: var(--on-dark);
  border: none; border-radius: 999px; padding: 12px 18px;
  font: 600 15px/1 Manrope, system-ui, sans-serif; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .15s var(--ease);
}
.ai-fab:hover { transform: translateY(-2px); }
.ai-fab__icon { color: var(--coral); font-size: 16px; }
.ai-panel {
  position: absolute; right: 0; bottom: 56px; width: min(380px, calc(100vw - 28px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
}
.ai-panel__head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.ai-panel__head strong { font-size: 15px; }
.ai-mode {
  font-size: 11px; color: var(--muted); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px;
}
.ai-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 16px; line-height: 1; padding: 4px;
}
.ai-log { max-height: 52vh; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.ai-msg--bot { background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-msg--user { background: var(--graphite); color: var(--on-dark); align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-zhks { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ai-zhk {
  display: block; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); font-weight: 600; font-size: 13px; color: var(--ink); text-decoration: none;
}
.ai-zhk:hover { border-color: var(--coral); }
.ai-zhk__city { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }
.ai-src { margin-top: 8px; font-size: 11px; color: var(--muted); }
.ai-src a { color: var(--muted); }
.ai-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.ai-form input {
  flex: 1; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px;
  font: 400 14px Manrope, system-ui, sans-serif; background: var(--surface);
}
.ai-form input:focus { outline: 2px solid var(--coral-100); border-color: var(--coral); }
.ai-form button {
  background: var(--coral); color: #fff; border: none; border-radius: var(--r-sm);
  width: 42px; font-size: 18px; cursor: pointer;
}
.ai-form button:hover { background: var(--coral-600); }
.ai-disc { padding: 0 12px 12px; font-size: 11px; color: var(--muted); }
.ai-dots { display: inline-flex; gap: 4px; }
.ai-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: aiblink 1s infinite; }
.ai-dots i:nth-child(2) { animation-delay: .2s; }
.ai-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes aiblink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
@media (max-width: 520px) { .ai-fab__txt { display: none; } }

/* ══════════════════════════════════════════════════════════════════
   ДВИЖЕНИЕ И ПОЯВЛЕНИЕ (анимации)
   Принципы: только transform/opacity (GPU); включается ТОЛЬКО при
   html.anim (ставится синхронно в <head>, если пользователь не просил
   reduced-motion) → без JS и при reduced-motion ничего не скрыто, контент
   виден сразу. Класс на <html> ставится до первой отрисовки → нет мигания.
   ══════════════════════════════════════════════════════════════════ */

@keyframes brg-rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes brg-hero-drift { from { transform: scale(1) translateY(0); } to { transform: scale(1.08) translateY(-1.5%); } }

@media (prefers-reduced-motion: no-preference) {
  /* — Вход первого экрана (на загрузке, без JS-зависимости) — */
  /* Hero: стаггер прямых детей (eyebrow → h1 → текст → поиск → кнопки) */
  html.anim .hero .wrap > * { animation: brg-rise .7s var(--ease) both; }
  html.anim .hero .wrap > *:nth-child(2) { animation-delay: .07s; }
  html.anim .hero .wrap > *:nth-child(3) { animation-delay: .14s; }
  html.anim .hero .wrap > *:nth-child(4) { animation-delay: .21s; }
  html.anim .hero .wrap > *:nth-child(5) { animation-delay: .28s; }
  /* Ambient: очень медленный дрейф закатного градиента — «живой» фон */
  html.anim .hero::before { animation: brg-hero-drift 22s ease-in-out infinite alternate; will-change: transform; }
  /* Внутренние страницы: мягкий вход первого блока целиком (без hero).
     На главной первая <section> = .hero → не проходит :not(.hero), а .trust
     (вторая секция) не проходит :first-of-type → правило там НЕ срабатывает
     (hero анимируется отдельно выше). На внутренних страницах первая секция
     контента совпадает и плавно въезжает. */
  html.anim main > section:not(.hero):first-of-type { animation: brg-rise .6s var(--ease) both; }

  /* — Появление на скролле (ставит JS: .reveal → .reveal.in) — */
  .reveal {
    opacity: 0; transform: translateY(22px);
    transition: opacity .65s var(--ease), transform .65s var(--ease);
    transition-delay: calc(var(--rev, 0) * 70ms);
  }
  .reveal.in { opacity: 1; transform: none; }
}

/* Подчёркивание навигации (текущая страница + hover) — понятная навигация.
   Кнопку «Подобрать» (.btn) не подчёркиваем. */
.nav a:not(.btn) { position: relative; }
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--coral); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease);
}
.nav a:not(.btn):hover::after, .nav a:not(.btn).active::after { transform: scaleX(1); }

/* Hover строки таблицы сравнения — легче читать ряд */
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }

/* Доступность: уважаем запрос на сокращение движения — глушим всё движение. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}
