/*
 * Редактируемый слой КОСМИ-СТАЙЛ.
 * Исходная визуальная система находится в original.css.
 * Добавляйте изменения в этот файл: он подключён последним и безопасно
 * переопределяет базовые правила.
 */

:root {
  --editable-focus: #c79b56;
  --editable-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --editable-glass: rgba(7, 7, 7, 0.56);
  --editable-glass-strong: rgba(7, 7, 7, 0.76);
  --editable-glass-border: rgba(255, 255, 255, 0.2);
  --editable-content-max: 1920px;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: clip;
}

body.menu-open {
  overflow: hidden;
}

body.menu-open :is(.hero__header, .site-header) {
  z-index: 16;
}

/* Ограничиваем длину строк на сверхшироких экранах и сохраняем полезные поля. */
.section-shell {
  width: 100%;
  max-width: var(--editable-content-max);
  margin-inline: auto;
}

.hero__header,
.hero__intro,
.city-teaser__content,
.city-teaser > .site-header {
  width: min(100%, var(--editable-content-max));
  margin-inline: auto;
}

.hero__header,
.hero__intro,
.hero__bottom {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-inline: 0;
}

@media (min-width: 2025px) {
  .hero__header,
  .hero__intro,
  .hero__bottom {
    width: calc(100vw - (var(--page-padding) * 2));
    max-width: var(--editable-content-max);
    justify-self: center;
    margin-inline: auto;
  }
}

:where(h1, h2, h3) {
  text-wrap: balance;
}

:where(p, li, dd) {
  overflow-wrap: break-word;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  color: #111;
  background: #fff;
  border: 1px solid #111;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

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

:where(a, button, select) {
  cursor: pointer;
}

/* Кириллица сохраняет фирменную плотность без столкновения соседних букв. */
.city-showcase__heading .display-title {
  letter-spacing: -0.032em;
  font-kerning: normal;
  font-feature-settings: "kern" 1;
}

.city-showcase__heading .display-title > span {
  letter-spacing: -0.032em;
  line-height: 0.98;
  padding-block: 0.035em;
}

/* Изолируем «К» от отрицательного кернинга и создаём гарантированный зазор до «л». */
.city-showcase__heading .display-title > span > .city-showcase__letter-k {
  display: inline-block;
  margin-right: 0.12em;
  color: inherit;
  letter-spacing: 0;
  font-kerning: none;
  font-feature-settings: "kern" 0;
}

/*
 * Контрастный хедер: каждый интерактивный элемент имеет собственную тёмную
 * подложку, границу и состояние наведения. Так навигация читается на любом
 * участке фотографии и визуально воспринимается как набор кнопок.
 */
@media (min-width: 1181px) {
  :is(.hero__nav, .site-header__nav) {
    justify-content: center;
    gap: clamp(4px, 0.55vw, 10px);
  }

  :is(.hero__nav-item, .site-header__nav-item) {
    min-height: 42px;
    padding: 0 clamp(10px, 0.9vw, 17px);
    border: 1px solid var(--editable-glass-border);
    border-radius: 3px;
    background: var(--editable-glass);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
  }

  .site-header__nav-item,
  .site-header__meta,
  .site-header__phone {
    color: #fff !important;
  }

  :is(.hero__nav-item, .site-header__nav-item):is(:hover, :focus-visible),
  :is(.hero__nav-item, .site-header__nav-item)[aria-current='page'] {
    background: rgba(7, 7, 7, 0.84);
    border-color: rgba(255, 255, 255, 0.46);
    transform: translateY(-1px);
  }

  :is(.hero__nav-item, .site-header__nav-item)::after {
    display: none;
  }

  :is(.hero__meta, .site-header__meta) {
    width: max-content;
    min-width: 190px;
    padding: 9px 13px;
    border: 1px solid var(--editable-glass-border);
    border-radius: 3px;
    background: var(--editable-glass-strong);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
  }

  :is(.hero__audit, .site-header__cta) {
    min-width: 224px;
    width: auto;
    padding-inline: 22px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.58);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
    transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
  }

  :is(.hero__audit, .site-header__cta):is(:hover, :focus-visible) {
    color: #fff;
    background: rgba(7, 7, 7, 0.9);
    transform: translateY(-1px);
  }
}

@media (min-width: 1181px) and (max-width: 1360px) {
  :is(.hero__header, .site-header) {
    column-gap: 12px;
  }

  :is(.hero__nav-item, .site-header__nav-item) {
    padding-inline: 8px;
  }

  :is(.hero__meta, .site-header__meta) {
    min-width: 172px;
  }

  :is(.hero__audit, .site-header__cta) {
    min-width: 188px;
    padding-inline: 14px;
  }
}

:is(.hero__menu, .site-header__menu) {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  background: rgba(5, 5, 5, 0.58);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

:is(.hero__menu, .site-header__menu):is(:hover, :focus-visible) {
  background: rgba(5, 5, 5, 0.86);
  border-color: rgba(255, 255, 255, 0.62);
}

/* Усиленные подложки для текста поверх рендеров. */
.hero::after {
  content: '';
  z-index: -2;
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.12) 58%, rgba(0, 0, 0, 0.38) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.62) 0%, transparent 48%, rgba(0, 0, 0, 0.2) 100%);
}

.city-hero__shade {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.67) 0%, rgba(0, 0, 0, 0.12) 58%, rgba(0, 0, 0, 0.46) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.84) 0%, transparent 62%, rgba(0, 0, 0, 0.24) 100%);
}

.city-teaser__shade {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.76) 0%, rgba(0, 0, 0, 0.25) 70%, rgba(0, 0, 0, 0.4) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.78) 0%, transparent 68%);
}

:is(.hero__title, .hero__project, .hero__side-copy, .hero__stat, .city-hero__content, .city-teaser__content) {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.82);
}

.hero__side-copy {
  max-width: 34ch;
  padding: 14px 16px;
  border-left: 2px solid rgba(199, 155, 86, 0.88);
  background: rgba(7, 7, 7, 0.46);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.city-teaser__content > span,
.city-hero__lead,
.city-hero__support {
  color: rgba(255, 255, 255, 0.92);
}

/* Основной текст: комфортная ширина строки и нижняя граница размера. */
:is(
  .hero__side-copy,
  .city-teaser__content > span,
  .city-hero__lead,
  .city-hero__support,
  .about-section p,
  .contact__heading > p,
  .articles-index__grid > article > p,
  .privacy-page p,
  .privacy-page li
) {
  font-size: clamp(14px, 1vw, 18px);
  line-height: 1.58;
}

.articles-index__content > h1 {
  max-width: min(100%, 12ch);
}

.articles-index__content > h1 span {
  overflow-wrap: anywhere;
}

.articles-index__grid > article > p,
.about-section p,
.privacy-page p,
.privacy-page li {
  max-width: 72ch;
}

/* Крупные и средние планшеты получают компактный мобильный хедер. */
@media (max-width: 1180px) {
  :is(.hero__header, .site-header) {
    grid-template-columns: minmax(150px, 1fr) auto auto;
    column-gap: clamp(10px, 2vw, 20px);
  }

  :is(.hero__nav, .site-header__nav),
  :is(.hero__audit, .site-header__cta) {
    display: none;
  }

  :is(.hero__menu, .site-header__menu) {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  :is(.hero__meta, .site-header__meta) {
    justify-self: end;
  }

  .mobile-nav {
    z-index: 15;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    background: #080808;
    flex-direction: column;
    justify-content: space-between;
    padding: 118px clamp(20px, 5vw, 54px) 32px;
    transition: opacity 0.35s, visibility 0.35s;
    display: flex;
    position: fixed;
    inset: 0;
  }

  .mobile-nav.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-nav nav {
    display: grid;
  }

  .mobile-nav nav a {
    min-height: 62px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    font-size: clamp(26px, 5vw, 48px);
    letter-spacing: -0.04em;
    display: flex;
    align-items: baseline;
  }

  .mobile-nav nav a span {
    width: clamp(40px, 7vw, 70px);
    color: rgba(255, 255, 255, 0.42);
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .mobile-nav__phone {
    font-size: clamp(21px, 4vw, 34px);
  }
}

@media (max-width: 768px) {
  .section-shell {
    padding-inline: clamp(20px, 5vw, 28px);
  }

  :is(.hero__header, .site-header) {
    grid-template-columns: minmax(132px, 1fr) auto auto;
    min-height: 88px;
    padding-top: 18px;
  }

  :is(.hero__brand-logo, .site-header__brand img) {
    width: 145px;
    max-width: none;
    height: auto;
  }

  :is(.hero__brand, .site-header__brand) {
    width: 145px;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  :is(.hero__meta, .site-header__meta) {
    min-width: 0;
  }

  :is(.hero__phone, .site-header__phone) {
    padding: 8px 10px;
    border-radius: 3px;
    background: rgba(7, 7, 7, 0.56);
    font-size: clamp(13px, 3.8vw, 17px);
    white-space: nowrap;
    color: #fff !important;
  }

  :is(.hero__worktime, .site-header__hours) {
    display: none;
  }

  :is(.hero__menu, .site-header__menu) {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .hero {
    min-height: max(100svh, 780px);
  }

  .hero__title {
    font-size: clamp(38px, 11vw, 54px);
    line-height: 0.98;
  }

  .hero__project,
  .hero__side-copy {
    font-size: clamp(14px, 3.8vw, 16px);
    line-height: 1.5;
  }

  .hero__side-copy {
    max-width: 100%;
    padding: 12px 14px;
  }

  .hero__stat p {
    font-size: 12px;
    line-height: 1.35;
  }

  .hero__cta,
  .project-button,
  .contact-form button[type='submit'] {
    min-height: 54px;
  }

  .display-title,
  .city-heading--l2 {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: auto;
  }

  /* Длинное слово «Ответственность» должно помещаться без обрезки глифов. */
  .about-page .display-title {
    font-size: clamp(38px, 11.4vw, 54px);
    letter-spacing: -0.035em;
  }

  .about-page .display-title > span {
    letter-spacing: -0.028em;
  }

  .articles-index__content > h1 {
    max-width: 100%;
    margin-top: 52px;
    margin-bottom: 58px;
    font-size: clamp(42px, 13vw, 62px);
    line-height: 0.94;
    letter-spacing: -0.065em;
  }

  .articles-index__content > h1 span {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: auto;
  }

  .articles-index__grid > article > h2 {
    font-size: clamp(25px, 7vw, 34px);
    line-height: 1.06;
  }

  .page-header {
    gap: 20px;
    font-size: 9px;
  }

  .pill-filters {
    gap: 8px;
  }

  .pill-filters button {
    min-height: 44px;
    padding: 10px 14px;
    line-height: 1.25;
  }

  .projects-grid {
    gap: 56px;
  }

  .project-card__body > p,
  .insight-card > p {
    font-size: 15px;
    line-height: 1.55;
  }

  .contact-form :is(input, select, textarea) {
    min-height: 52px;
    font-size: 16px;
  }
}

@media (max-width: 390px) {
  :is(.hero__header, .site-header) {
    grid-template-columns: minmax(118px, 1fr) auto 42px;
    column-gap: 7px;
  }

  :is(.hero__brand-logo, .site-header__brand img) {
    width: 132px;
  }

  :is(.hero__brand, .site-header__brand) {
    width: 132px;
  }

  :is(.hero__phone, .site-header__phone) {
    padding-inline: 7px;
    font-size: 12px;
  }

  :is(.hero__menu, .site-header__menu) {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

  .hero__title {
    font-size: clamp(36px, 10.8vw, 44px);
  }
}

/* Низкие горизонтальные экраны: контент не ужимается в один перегруженный кадр. */
@media (min-width: 600px) and (max-height: 620px) {
  .hero {
    min-height: 650px;
  }

  .hero__intro {
    align-self: start;
    margin-top: 24px;
  }

  .hero__side-copy {
    display: none;
  }

  .hero__title {
    font-size: clamp(46px, 6.4vw, 66px);
  }

  .hero__bottom {
    margin-top: 24px;
  }

  .hero__cta {
    min-width: 0;
  }

  .hero__cta span {
    white-space: normal;
  }

  .city-teaser {
    min-height: 620px;
  }
}

/* Унифицированная иконка меню для расширенного планшетного брейкпоинта. */
:is(.hero__menu, .site-header__menu) {
  position: relative;
}

:is(.hero__menu, .site-header__menu) span {
  width: 18px;
  height: 1px;
  background: #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transition: transform 220ms ease;
}

:is(.hero__menu, .site-header__menu) span:first-child {
  transform: translate(-50%, -4px);
}

:is(.hero__menu, .site-header__menu) span:last-child {
  transform: translate(-50%, 4px);
}

:is(.hero__menu, .site-header__menu)[aria-expanded='true'] span:first-child {
  transform: translate(-50%, 0) rotate(45deg);
}

:is(.hero__menu, .site-header__menu)[aria-expanded='true'] span:last-child {
  transform: translate(-50%, 0) rotate(-45deg);
}

/* Стартовый экран главной страницы. */
.hero__veil {
  transform-origin: top center;
  transition: transform 900ms var(--editable-ease), visibility 0s linear 900ms;
}

body.is-ready .hero__veil {
  visibility: hidden;
  transform: scaleY(0);
}

body.is-ready .hero [data-reveal] {
  animation: editable-hero-reveal 700ms var(--editable-ease) both;
}

body.is-ready .hero__title-mask:nth-child(2) [data-reveal] {
  animation-delay: 100ms;
}

body.is-ready .hero__project [data-reveal] {
  animation-delay: 180ms;
}

@keyframes editable-hero-reveal {
  from { opacity: 0; transform: translateY(110%); }
  to { opacity: 1; transform: translateY(0); }
}

/* Лёгкие появления заменяют недоступную анимационную библиотеку сборки. */
.motion-ready .js-reveal,
.motion-ready .js-image-reveal,
.motion-ready .js-split {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 650ms var(--editable-ease), transform 650ms var(--editable-ease);
}

.motion-ready :is(.js-reveal, .js-image-reveal, .js-split).is-visible {
  opacity: 1;
  transform: none;
}

/* Горизонтальные галереи работают мышью, тачем и клавиатурой. */
.gallery__viewport,
.process-slider__viewport,
.city-about__slider,
.city-architecture__stage {
  cursor: grab;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.gallery__viewport.is-dragging,
.process-slider__viewport.is-dragging,
.city-about__slider.is-dragging,
.city-architecture__stage.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  user-select: none;
}

.gallery-card,
.process-slider__card,
.city-about__card,
.city-architecture__slide {
  scroll-snap-align: start;
}

.gallery__counter {
  min-width: 66px;
  color: rgba(255, 255, 255, 0.96);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.gallery__counter > span {
  color: rgba(255, 255, 255, 0.48);
}

.contact-form__comment {
  grid-column: 1 / -1;
}

.contact-form__comment textarea {
  width: 100%;
  min-height: 112px;
  padding-top: 14px;
  line-height: 1.5;
  resize: vertical;
}

.city-architecture__stage {
  overflow-x: auto;
  overflow-y: hidden;
}

.city-architecture__track {
  transform: none !important;
}

/* Каталог проектов. */
.project-card[hidden] {
  display: none !important;
}

.projects-grid.is-updating .project-card {
  animation: editable-card-in 320ms var(--editable-ease) both;
}

@keyframes editable-card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.projects-result-count {
  width: 100%;
  margin: 0 0 18px;
  color: rgba(15, 15, 15, 0.58);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Формы остаются демонстрационными, но дают полноценную обратную связь. */
.contact-form__status {
  grid-column: 1 / -1;
  margin: 14px 0 0;
  font-size: 14px;
}

.contact-form__status--success { color: #8caf77; }
.contact-form__status--error { color: #d36d61; }

.contact-form button[disabled] {
  cursor: wait;
  opacity: 0.62;
}

/* Интерактивная планировка. */
.city-house__popup {
  transition: opacity 220ms ease, transform 220ms var(--editable-ease);
  transform: translateY(6px);
}

.city-house__popup.is-visible {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  .motion-ready .js-reveal,
  .motion-ready .js-image-reveal,
  .motion-ready .js-split {
    opacity: 1;
    transform: none;
  }
}
