/* =====================================================================
   ЧЕСТНЫЕ КВАРТИРЫ — design system (brandbook v1)
   Палитра, типографика, сквозные компоненты. Mobile-first.
   ===================================================================== */

:root {
  /* --- Brand palette (облегчённая, воздушная) --- */
  --navy:     #33475B;   /* мягкий сланец вместо тяжёлого navy: заголовки, тёмные секции */
  --amber:    #E8943A;   /* ценность/CTA: тёплое окно, кнопки, бейджи */
  --paper:    #FBF8F3;   /* светлее и воздушнее — основной фон */
  --graphite: #2D2D2D;   /* основной текст */
  --line:     #E8E2D8;   /* разделители, рамки карточек */

  /* derived */
  --navy-900: #26323D;   /* футер / самые тёмные секции (облегчён) */
  --navy-700: #2a3a49;
  --amber-600:#D27E26;   /* hover на amber */
  --amber-100:#FBEBD7;   /* мягкая янтарная заливка */
  --paper-2:  #FFFFFF;   /* карточки — чистый белый, легче */
  --ink-70:   #2d2d2db3;
  --ink-55:   #2d2d2d8c;
  --ink-40:   #2d2d2d66;
  --navy-70:  #33475Bcc;
  --navy-55:  #33475B99;
  --paper-line:#ffffff14;
  --sky:      #E9F0F4;   /* мягкое небо — прохладный лёгкий фон (опц.) */
  --sky-ink:  #7BA7C4;

  /* service (калькулятор) */
  --plus:  #2F8F5B;      /* приглушённый зелёный */
  --plus-bg:#2f8f5b14;
  --minus: #C0492F;      /* приглушённый кирпичный (НЕ ярко-красный) */
  --minus-bg:#c0492f12;

  /* fonts */
  --sans: 'Manrope', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  /* radii / shadow (tweakable) */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 0 #1e3a5f0d, 0 2px 8px -4px #1e3a5f1f;
  --shadow:    0 1px 0 #1e3a5f0d, 0 14px 34px -16px #1e3a5f33;
  --shadow-lg: 0 2px 0 #1e3a5f0d, 0 30px 60px -24px #1e3a5f40;

  /* layout */
  --maxw: 1200px;
  --gutter: clamp(18px, 5vw, 56px);
  --header-h: 72px;
}

/* ------------------- reset ------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--graphite);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
ul { list-style: none; }
::selection { background: var(--amber); color: #fff; }

/* ------------------- typography ------------------- */
h1, h2, h3, h4 {
  font-family: var(--sans);
  color: var(--navy);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: wrap;
}
.h1 { font-size: clamp(34px, 5.4vw, 60px); }
.h2 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.022em; }
.h3 { font-size: clamp(21px, 2.4vw, 28px); font-weight: 700; letter-spacing: -0.015em; }
p  { text-wrap: pretty; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy-55);
}
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.lead { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; color: var(--ink-70); }
.muted { color: var(--ink-55); }

/* ------------------- layout helpers ------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.wrap-wide { max-width: 1320px; margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 8vw, 104px); }
.section-sm { padding-block: clamp(40px, 5vw, 64px); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.center { display: flex; align-items: center; justify-content: center; }
.grid { display: grid; }

/* ------------------- buttons ------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  padding: 14px 24px;
  border-radius: var(--r-pill);
  transition: transform .14s ease, background .16s ease, box-shadow .16s ease, color .16s ease, border-color .16s ease;
  white-space: nowrap;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-amber {
  background: var(--amber);
  color: #fff;
  box-shadow: 0 1px 0 #ffffff40 inset, 0 8px 20px -8px #e8943a99;
}
.btn-amber:hover { background: var(--amber-600); box-shadow: 0 1px 0 #ffffff40 inset, 0 10px 24px -8px #e8943aaa; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-700); }
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn-ghost-paper {
  background: #fff;
  color: var(--navy);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-ghost-paper:hover { border-color: var(--navy); }
.btn-lg { padding: 17px 30px; font-size: 17px; }
.btn-sm { padding: 11px 18px; font-size: 14px; }
.btn-block { width: 100%; }

/* ------------------- badges & chips ------------------- */
.badge-sofia {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.005em;
  color: var(--navy);
  background: var(--amber-100);
  border: 1px solid #e8943a3d;
  padding: 7px 13px 7px 9px;
  border-radius: var(--r-pill);
}
.badge-sofia .tick {
  width: 18px; height: 18px; border-radius: 5px;
  background: var(--amber); color: #fff;
  display: grid; place-items: center; flex-shrink: 0;
}
.badge-sofia.on-photo { background: #fffffff2; backdrop-filter: blur(6px); box-shadow: var(--shadow-sm); }
.badge-sofia.on-dark { background: #ffffff14; border-color: #ffffff26; color: #fff; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy-70);
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: var(--r-pill);
}
.chip .mono { font-size: 12.5px; color: var(--ink-55); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--navy); background: var(--amber-100);
  padding: 5px 9px; border-radius: 6px;
}

/* generic surface card */
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

/* ------------------- header (sticky, injected) ------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #f8f5f0cc;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: 1320px; margin: 0 auto;
  padding-inline: var(--gutter);
  height: var(--header-h);
  display: flex; align-items: center; gap: 28px;
}
.brand-logo { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark { width: 38px; height: 38px; flex-shrink: 0; }
.brand-word { font-weight: 800; font-size: 20px; letter-spacing: -0.025em; line-height: 1; }
.brand-word .b1 { color: var(--navy); }
.brand-word .b2 { color: var(--ink-55); font-weight: 500; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.site-nav a {
  font-weight: 600; font-size: 15px; color: var(--navy-70);
  padding: 9px 13px; border-radius: var(--r-pill);
  transition: color .14s, background .14s; letter-spacing: -0.01em;
}
.site-nav a:hover { color: var(--navy); background: #1e3a5f0d; }
.site-nav a.active { color: var(--navy); background: #1e3a5f12; }
.header-spacer { flex: 1; }
.header-cta { flex-shrink: 0; }
.burger { display: none; width: 44px; height: 44px; border-radius: 12px; align-items: center; justify-content: center; }
.burger:hover { background: #1e3a5f0d; }
.burger svg { width: 24px; height: 24px; }

/* mobile drawer */
.m-drawer {
  position: fixed; inset: 0; z-index: 200;
  background: var(--paper);
  display: flex; flex-direction: column;
  padding: 18px var(--gutter) 40px;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  visibility: hidden;
}
.m-drawer.open { transform: translateX(0); visibility: visible; }
.m-drawer__top { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); margin-bottom: 14px; }
.m-drawer nav { display: flex; flex-direction: column; gap: 2px; }
.m-drawer nav a {
  font-size: 22px; font-weight: 700; color: var(--navy);
  letter-spacing: -0.02em; padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.m-drawer nav a.active { color: var(--amber); }
.m-drawer .btn { margin-top: 26px; }
.m-close { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; }
body.no-scroll { overflow: hidden; }

/* ------------------- footer (injected) ------------------- */
.site-footer { background: var(--navy-900); color: #fff; padding-top: clamp(48px, 6vw, 76px); }
.site-footer a { color: #ffffffcc; transition: color .14s; }
.site-footer a:hover { color: var(--amber); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.3fr;
  gap: 40px 32px;
}
.footer-col h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 16px; letter-spacing: 0.01em; }
.footer-col .eyebrow { color: #ffffff66; margin-bottom: 16px; }
.footer-links { display: flex; flex-direction: column; gap: 11px; font-size: 15px; }
.footer-brand .brand-word .b1 { color: #fff; }
.footer-brand .brand-word .b2 { color: #ffffff99; font-weight: 500; }
.footer-slogan { color: #ffffffcc; font-size: 16px; margin-top: 16px; max-width: 280px; }
.footer-geo { color: #ffffff80; font-size: 14px; margin-top: 10px; font-family: var(--mono); letter-spacing: 0.02em; }
.footer-cta-card {
  background: #ffffff0f; border: 1px solid #ffffff1f;
  border-radius: var(--r); padding: 22px;
}
.footer-cta-card p { color: #ffffffcc; font-size: 14.5px; margin: 6px 0 16px; }
.footer-bottom {
  border-top: 1px solid #ffffff1f;
  margin-top: clamp(40px, 5vw, 60px);
  padding-block: 24px;
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  font-family: var(--mono); font-size: 12.5px; color: #ffffff80; letter-spacing: 0.02em;
}
.footer-contact-row { display: flex; align-items: center; gap: 10px; }
.footer-contact-row .ic { width: 30px; height: 30px; border-radius: 8px; background: #ffffff14; display: grid; place-items: center; flex-shrink: 0; }

/* ------------------- trust bar ------------------- */
.trust-bar { background: var(--navy); color: #fff; }
.trust-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: #ffffff1a;
}
.trust-cell { background: var(--navy); padding: clamp(22px, 3vw, 34px) clamp(16px, 2vw, 28px); }
.trust-num { font-family: var(--mono); font-weight: 600; font-size: clamp(28px, 3.6vw, 40px); color: var(--amber); letter-spacing: -0.02em; line-height: 1; }
.trust-label { font-size: 14px; color: #ffffffb3; margin-top: 10px; line-height: 1.35; }

/* ------------------- forms ------------------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--navy-70); }
.input, .select, .textarea {
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 15px; font-size: 16px; color: var(--graphite);
  transition: border-color .14s, box-shadow .14s; width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--amber);
  box-shadow: 0 0 0 3px #e8943a26;
}
.textarea { resize: vertical; min-height: 110px; }
.form-status { font-size: 14px; font-weight: 600; }

/* ------------------- misc ------------------- */
.divider { height: 1px; background: var(--line); border: none; }
.section-head { max-width: 720px; margin-bottom: clamp(32px, 4vw, 52px); }
.section-head .eyebrow { margin-bottom: 16px; }
.section-head p { margin-top: 16px; }

/* focus-visible for a11y */
:focus-visible { outline: 2.5px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

/* ------------------- tweak effects (toggled by assets/tweaks.js) ------------------- */
/* CTA tone: outline variant for amber buttons */
body.tw-cta-outline .btn-amber {
  background: transparent;
  color: var(--amber-600);
  border: 1.5px solid var(--amber);
  box-shadow: none;
}
body.tw-cta-outline .btn-amber:hover { background: var(--amber); color: #fff; }
/* density */
body.tw-dense .section { padding-block: clamp(40px, 5vw, 68px); }
body.tw-dense .section-sm { padding-block: clamp(28px, 3.5vw, 44px); }
body.tw-comfy .section { padding-block: clamp(72px, 10vw, 132px); }
body.tw-comfy .section-sm { padding-block: clamp(52px, 7vw, 84px); }

/* ------------------- apartment card (shared: home + catalog) ------------------- */
.apt-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .2s cubic-bezier(.2,.7,.2,1), box-shadow .2s ease;
}
.apt-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.apt-photo { aspect-ratio: 3 / 2; position: relative; }
.apt-badge { position: absolute; top: 12px; left: 12px; }
.apt-body { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.apt-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.apt-chip {
  font-size: 12.5px; font-weight: 600; color: var(--navy-70);
  background: #1e3a5f0a; border: 1px solid var(--line);
  padding: 4px 10px; border-radius: var(--r-pill);
}
.apt-chip.mono { font-family: var(--mono); font-size: 11.5px; }
.apt-title { font-size: 20px; font-weight: 700; color: var(--navy); letter-spacing: -0.015em; line-height: 1.1; }
.apt-geo { font-size: 13.5px; color: var(--ink-55); margin-top: -2px; }
.apt-desc { font-size: 14.5px; color: var(--ink-70); line-height: 1.45; flex: 1; }
.apt-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.apt-price { display: flex; align-items: baseline; gap: 6px; }
.apt-price-num { font-size: 22px; font-weight: 600; color: var(--navy); letter-spacing: -0.02em; }
.apt-price-unit { font-size: 13px; color: var(--ink-55); }
.apt-foot-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.apt-status { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.apt-status.managed { color: var(--plus); }
.apt-status.soon { color: var(--ink-55); }
.apt-mini { font-size: 12.5px; color: var(--ink-55); }
.apt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: clamp(18px, 2.4vw, 28px);
}
@media (max-width: 560px) { .apt-grid { grid-template-columns: 1fr; } }

/* photo placeholder (brand-styled, replaces real photos for now) */
.photo-ph { position: relative; overflow: hidden; background: var(--line); }
.photo-ph svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ------------------- responsive ------------------- */
@media (max-width: 1000px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col.footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .site-nav, .header-cta { display: none; }
  .burger { display: flex; }
  .trust-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .footer-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr 1fr; }
}
