/* Дизайн-доктрина — Projects/dom53_hub/RULES.md §6. Светло, солнечно, спокойно. Других цветов нет. */
:root {
  --color-bg: #fffcf5;
  --color-surface: #ffffff;
  --color-cream: #fdf5e4;
  --color-line: #efe4cf;
  --color-ink: #3b342c;
  --color-muted: #776d61;
  --color-sun: #ffcb52;
  --color-sun-hover: #ffbd2e;
  --color-sun-soft: #fff1c9;
  --color-sun-glow: rgba(255, 203, 82, 0.45);
  --color-sage: #5f8a5c;
  --color-sage-soft: #eef4e6;
  --color-sky: #2f7095;
  --color-sky-soft: #edf5f8;
  --color-glass: rgba(255, 252, 245, 0.86);
  --color-shade: rgba(45, 38, 30, 0.9);
  --color-on-color: #ffffff;
  --color-wa: #25a45a;
  --color-max: #6a4fe0;
  --color-tg: #229ed9;

  --font-head: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;

  --z-base: 0;
  --z-sticky: 100;
  --z-widget: 200;
  --z-overlay: 900;
  --z-modal: 1000;

  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-ink);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img, video, iframe { max-width: 100%; height: auto; display: block; }
a { color: var(--color-sky); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 500; line-height: 1.2; margin: 0; }
em { font-style: italic; color: var(--color-sage); }
p { margin: 0 0 12px; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--color-sky); outline-offset: 3px; border-radius: 4px; }
.ico { width: 20px; height: 20px; flex: 0 0 auto; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 780px; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px; border-radius: 999px;
  font-weight: 600; font-size: 16px; text-decoration: none;
  transition: background .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn--sun { background: var(--color-sun); color: var(--color-ink); }
.btn--sun:hover { background: var(--color-sun-hover); }
.btn--sm { min-height: 42px; padding: 0 20px; font-size: 15px; }

/* Шапка */
.header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: var(--color-glass); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-line);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 19px; color: var(--color-ink); text-decoration: none; }
.logo__sun { width: 14px; height: 14px; border-radius: 50%; background: var(--color-sun); box-shadow: 0 0 0 5px var(--color-sun-soft); }
.nav { display: none; gap: 30px; }
.nav a { color: var(--color-muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--color-ink); }
.header__phone {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--color-ink); font-weight: 600; font-size: 16px; text-decoration: none; white-space: nowrap;
}
.header__phone:hover { color: var(--color-sky); }
@media (max-width: 479px) {
  .logo { font-size: 16px; gap: 8px; }
  .header__phone { font-size: 15px; }
}
@media (max-width: 369px) { .logo__text { display: none; } }

/* Первый экран */
.hero { position: relative; overflow: hidden; padding: 40px 0 48px; }
.hero::before {
  content: ''; position: absolute; z-index: var(--z-base); pointer-events: none;
  top: -180px; right: -160px; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, var(--color-sun-glow) 0%, transparent 68%);
}
.hero__grid { position: relative; display: grid; grid-template-columns: 1fr; gap: 36px; align-items: center; }
.hero__text, .hero__media { min-width: 0; }
.eyebrow { margin-bottom: 18px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--color-sage); }
.hero__title { font-size: clamp(32px, 6vw, 56px); line-height: 1.12; margin-bottom: 20px; }
.hero__lead { color: var(--color-muted); font-size: 18px; max-width: 540px; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 26px 0 28px; }
.price__value { font-family: var(--font-head); font-size: clamp(30px, 5vw, 40px); font-weight: 500; }
.price__note { padding: 4px 14px; border-radius: 999px; background: var(--color-sage-soft); color: var(--color-sage); font-weight: 600; font-size: 15px; }
.slider { position: relative; aspect-ratio: 5 / 4; border-radius: var(--radius-l); overflow: hidden; border: 1px solid var(--color-sun); }
.slider__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .9s ease;
}
.slider__img.is-active { opacity: 1; }
.slider__dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; }
.slider__dot {
  width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%;
  background: var(--color-surface); opacity: .55; cursor: pointer; transition: opacity .2s, transform .2s;
}
.slider__dot.is-active { opacity: 1; transform: scale(1.25); }
.hero__note {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0; padding: 10px 20px 10px 12px; border-radius: 999px;
  background: var(--color-sun-soft); border: 1px solid var(--color-sun);
  font-size: 15px; font-weight: 600; color: var(--color-ink);
}
.hero__note-year {
  padding: 4px 12px; border-radius: 999px; background: var(--color-sun);
  font-family: var(--font-head); font-size: 17px; font-weight: 500;
}

/* Цифры */
.facts { padding: 8px 0 24px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--color-line); }
.stat { display: flex; flex-direction: column; padding: 20px 4px; border-bottom: 1px solid var(--color-line); }
.stat__num { font-family: var(--font-head); font-size: clamp(24px, 4vw, 32px); line-height: 1.2; }
.stat__label { font-size: 14px; color: var(--color-muted); }
.stat:last-child { grid-column: 1 / -1; }

/* Секции */
.section { padding: 64px 0; }
.section--cream { background: var(--color-cream); }
.section--sage { background: var(--color-sage-soft); }
.section--sky { background: var(--color-sky-soft); }
.section__head { max-width: 680px; margin-bottom: 32px; }
.section__title { font-size: clamp(28px, 4.4vw, 42px); margin-bottom: 14px; }
.section__lead { color: var(--color-muted); font-size: 18px; }

/* Вкладки галереи */
.tabs { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-bottom: 24px; border-bottom: 1px solid var(--color-line); }
.tabs__btn {
  min-height: 44px; padding: 0 0 10px; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: none; color: var(--color-muted);
  font: 500 16px/1.2 var(--font-body); cursor: pointer;
}
.tabs__btn:hover { color: var(--color-ink); }
.tabs__btn.is-active { color: var(--color-ink); border-bottom-color: var(--color-sun); }
.tabs__count { font-size: 13px; color: var(--color-muted); margin-left: 2px; }

/* Галерея */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.gallery__item { margin: 0; min-width: 0; aspect-ratio: 4 / 3; border-radius: var(--radius-s); overflow: hidden; }
.gallery__item--wide, .gallery__item--tail { grid-column: span 2; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: transform .5s; }
.gallery__item img:hover { transform: scale(1.03); }

/* Этажи */
.floors { display: grid; grid-template-columns: 1fr; gap: 12px 40px; }
.floor { min-width: 0; padding-top: 20px; border-top: 1px solid var(--color-line); }
.floor__num { display: block; font-family: var(--font-head); font-style: italic; font-size: 15px; color: var(--color-sage); margin-bottom: 4px; }
.floor__title { font-size: 24px; margin-bottom: 14px; }
.list li { position: relative; padding-left: 20px; margin-bottom: 8px; }
.list li::before {
  content: ''; position: absolute; left: 0; top: 11px; pointer-events: none;
  width: 8px; height: 8px; border-radius: 50%; background: var(--color-sun);
}
.list--leaf { margin: 22px 0 30px; }
.list--leaf li::before { background: var(--color-sage); }

.utilities { margin-top: 40px; padding: 28px; border-radius: var(--radius-m); background: var(--color-surface); }
.utilities__title { font-size: 22px; margin-bottom: 14px; }
.utilities__list { display: grid; grid-template-columns: 1fr; gap: 14px 40px; }
.utility { display: flex; align-items: center; gap: 14px; min-width: 0; }
.utility__icon {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 50%; background: var(--color-sun-soft); color: var(--color-sage);
}
.utility__icon .ico { width: 22px; height: 22px; }

/* Участок */
.yard { display: grid; grid-template-columns: 1fr; gap: 36px; align-items: center; }
.yard__text, .yard__media { min-width: 0; }
.yard__subtitle { font-size: 22px; margin-bottom: 10px; }
.plants { color: var(--color-muted); }
.mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mosaic img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-s); }
.mosaic .mosaic__big { grid-column: span 2; border-radius: var(--radius-m); }

/* Район */
.location { display: grid; grid-template-columns: 1fr; gap: 32px; }
.distances { min-width: 0; align-self: start; }
.distance { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; }
.distance__name { min-width: 0; }
.distance__dots { flex: 1 1 20px; border-bottom: 2px dotted var(--color-line); transform: translateY(-4px); }
.distance__m { font-family: var(--font-head); font-size: 20px; color: var(--color-sky); white-space: nowrap; }
.map { min-width: 0; }
.map__frame { width: 100%; height: 320px; border: 0; border-radius: var(--radius-m); background: var(--color-surface); }
.map__note { margin-top: 10px; font-size: 14px; color: var(--color-muted); }

/* История дома + частые вопросы */
.story__eyebrow { margin-bottom: 14px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--color-sage); }
.story__lead { font-family: var(--font-head); font-style: italic; font-size: clamp(20px, 3vw, 24px); line-height: 1.45; margin: 8px 0 8px; }
.story__title { font-size: 24px; margin: 44px 0 14px; }
.story p { font-size: 18px; }
.story__facts { margin: 0 0 20px; display: grid; gap: 12px; }
.story__facts li { position: relative; padding: 14px 18px 14px 44px; border-radius: var(--radius-m); background: var(--color-sun-soft); font-size: 17px; }
.story__facts li::before {
  content: ''; position: absolute; left: 18px; top: 23px; pointer-events: none;
  width: 10px; height: 10px; border-radius: 50%; background: var(--color-sun);
}
.story__cta { font-weight: 600; }
.story__title--faq { margin-top: 56px; }
.story .faq { margin-top: 8px; }

/* FAQ */
.faq { margin-top: 20px; border-top: 1px solid var(--color-line); }
.faq__item { border-bottom: 1px solid var(--color-line); }
.faq__item summary { position: relative; cursor: pointer; list-style: none; padding: 20px 44px 20px 0; font-size: 18px; font-weight: 600; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: '+'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 26px; font-weight: 400; color: var(--color-sage); pointer-events: none;
}
.faq__item[open] summary::after { content: '−'; }
.faq__item p { padding: 0 0 20px; margin: 0; color: var(--color-muted); }

/* Контакты */
.contacts { background: linear-gradient(180deg, var(--color-sun-soft) 0%, var(--color-bg) 100%); }
.contacts__inner { text-align: center; max-width: 720px; }
.contacts__lead { font-size: 18px; color: var(--color-muted); margin-bottom: 20px; }
.contacts__phone {
  display: inline-block; margin-bottom: 24px;
  font-family: var(--font-head); font-size: clamp(28px, 6vw, 44px); color: var(--color-ink); text-decoration: none;
}
.messengers { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.messenger {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px 0 18px;
  border-radius: 999px; color: var(--color-on-color); font-weight: 600; text-decoration: none;
}
.messenger--wa { background: var(--color-wa); }
.messenger--max { background: var(--color-max); }
.messenger__logo { width: 22px; height: 22px; border-radius: 5px; box-shadow: 0 0 0 1px var(--color-on-color); }
.messenger--tg { background: var(--color-tg); }
.messenger:hover { filter: brightness(1.06); }

/* Подвал */
.footer { padding: 28px 0 100px; border-top: 1px solid var(--color-line); color: var(--color-muted); font-size: 14px; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

/* Виджет связи: мобилка — панель снизу, десктоп — колонка справа */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-widget);
  display: grid; grid-template-columns: 1fr repeat(3, 46px); gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--color-glass); backdrop-filter: blur(12px); border-top: 1px solid var(--color-line);
}
.dock__btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  border-radius: 999px; font-weight: 600; text-decoration: none; color: var(--color-on-color);
  transition: transform .2s, filter .2s;
}
.dock__btn:hover { filter: brightness(1.06); }
.dock__btn .ico { width: 22px; height: 22px; }
.dock__btn:not(.dock__btn--call) .dock__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dock__btn--call { background: var(--color-sun); color: var(--color-ink); }
.dock__btn--tg { background: var(--color-tg); }
.dock__btn--wa { background: var(--color-wa); }
.dock__btn--max { background: none; }
.dock__logo { display: block; width: 100%; height: 100%; }

/* Лайтбокс */
.lightbox {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: 56px 12px; background: var(--color-shade);
}
.lightbox[hidden] { display: none; }
.lightbox__figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox__img { max-height: calc(100vh - 150px); width: auto; border-radius: var(--radius-s); }
.lightbox__caption { color: var(--color-surface); font-weight: 500; font-size: 15px; text-align: center; }
.lightbox__close, .lightbox__nav {
  position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: var(--color-surface); color: var(--color-ink); font-size: 28px; line-height: 1; cursor: pointer;
}
.lightbox__close { top: 12px; right: 12px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
body.is-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slider__img { transition: none; }
}

@media (min-width: 640px) {
  .slider { aspect-ratio: 16 / 10; }
  .utilities__list { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); grid-auto-flow: column; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat:last-child { grid-column: auto; }
  .gallery { gap: 12px; }
}

@media (min-width: 960px) {
  body { font-size: 18px; }
  .container { padding: 0 32px; }
  .nav { display: flex; }
  .hero { padding: 72px 0 56px; }
  .section { padding: 104px 0; }
  .stats { grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--color-line); }
  .stat { border-bottom: 0; padding: 24px 16px; border-left: 1px solid var(--color-line); }
  .stat:first-child { border-left: 0; padding-left: 0; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 290px; grid-auto-flow: dense; }
  .gallery__item { aspect-ratio: auto; }
  .gallery__item--tail { grid-column: auto; }
  .floors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .yard { grid-template-columns: 1fr 1.1fr; gap: 72px; }
  .location { grid-template-columns: 1fr 1.2fr; gap: 56px; }
  .map__frame { height: 100%; min-height: 380px; }
  .footer { padding-bottom: 28px; }
  .dock {
    left: auto; right: 14px; top: 50%; bottom: auto; transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 8px; padding: 8px;
    border: 1px solid var(--color-line); border-radius: 999px;
  }
  .dock__btn { width: 44px; height: 44px; min-height: 0; padding: 0; }
  .dock__btn:hover { transform: scale(1.08); }
  .dock__btn--call { display: none; }
}

/* место под виджет справа, пока поля экрана уже самого виджета */
@media (min-width: 960px) and (max-width: 1339px) {
  .container { padding-right: 84px; }
}

/* первый экран в две колонки: фото ровно по высоте текста */
@media (min-width: 1200px) {
  .hero__grid { grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: stretch; }
  .hero__title { font-size: 50px; }
  .hero__media { display: flex; }
  .slider { flex: 1; aspect-ratio: auto; }
}
