/* CLIFF EVENT — единый компонент шапки
   Один бренд-лок, один набор ссылок, один слот контекстного CTA.
   Спецификация меню: высота 80, отступы 40/20, ссылки 14/28, CTA 44×20, радиус 2. */

cliff-header {
  display: contents;
}

.cliff-header {
  --header-h: 80px;
  --header-fg: var(--text-main, #181716);
  --header-desc: var(--text-light, #68645c);
  --header-hairline: var(--hairline, rgba(24, 23, 22, 0.11));
  --header-cta: var(--swatch--brand, #c02d2d);
  --header-cta-fg: var(--text-main, #181716);
  --header-cta-border: rgba(24, 23, 22, 0.34);
  position: sticky;
  top: 0;
  z-index: var(--z-header, 500);
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--header-h);
  color: var(--header-fg);
  background-color: var(--page-bg, #fcfbf8);
  border-bottom: 1px solid var(--header-hairline);
  transition: background-color 280ms ease, border-color 280ms ease,
    color 280ms ease;
}

.cliff-header.is-scrolled {
  background-color: var(--page-bg, #fcfbf8);
  border-bottom-color: var(--hairline-strong, rgba(24, 23, 22, 0.22));
}

/* Прозрачная шапка поверх тёмного видео-холста главной. */
.cliff-header--overlay {
  position: fixed;
  inset: 0 0 auto 0;
  background-color: rgba(18, 17, 16, 0.45);
  border-bottom-color: transparent;
  --header-fg: var(--on-dark, #f7f6f2);
  --header-desc: rgba(247, 246, 242, 0.72);
  --header-cta-fg: var(--on-dark, #f7f6f2);
  --header-cta-border: rgba(247, 246, 242, 0.6);
}

.cliff-header--overlay.is-scrolled {
  --header-fg: var(--text-main, #181716);
  --header-desc: var(--text-light, #68645c);
  --header-cta-fg: var(--text-main, #181716);
  --header-cta-border: rgba(24, 23, 22, 0.34);
  background-color: var(--page-bg, #fcfbf8);
  border-bottom-color: var(--hairline, rgba(24, 23, 22, 0.11));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.cliff-header .cliff-container {
  width: 100%;
  max-width: var(--container-max, 1600px);
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

.cliff-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
  width: 100%;
}

/* ---------- бренд-лок ---------- */

.cliff-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  color: inherit;
  text-decoration: none;
}

/* Специфичность выше page-global `img { height:auto; max-width:100% }` (residence/components). */
.cliff-header .cliff-nav__brand img {
  display: block;
  width: 32px;
  height: 32px;
  max-width: none;
  object-fit: contain;
  flex-shrink: 0;
  transition: filter 280ms ease;
}

/* Над видео тёмный знак не читается: остаётся чистый текстовый лок. */
.cliff-header--overlay:not(.is-scrolled) .cliff-nav__brand img {
  display: none;
}

.cliff-nav__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 0.9;
}

.cliff-nav__brand-name {
  font-family: var(--font--wordmark, 'Oswald', 'Arial Narrow', sans-serif);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  color: inherit;
}

.cliff-nav__brand-desc {
  margin-top: 3px;
  font-family: var(--font--sans, 'Manrope', sans-serif);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.1em;
  color: var(--header-desc);
  transition: color 280ms ease;
}

.cliff-header.is-dark-zone .cliff-nav__brand img {
  filter: invert(1) brightness(1.1);
}

.cliff-header.is-dark-zone .cliff-nav__brand-desc {
  color: var(--text-dark-faint, #969188);
}

/* ---------- ссылки ---------- */

.cliff-nav__menu {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}

.cliff-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  font-family: var(--font--sans, 'Manrope', sans-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease;
}

.cliff-nav__link::before {
  content: "";
  position: absolute;
  inset: -14px -6px;
}

.cliff-nav__link:hover,
.cliff-nav__link.is-active,
.cliff-nav__trigger[aria-expanded="true"] {
  color: var(--swatch--brand, #c02d2d);
}

.cliff-header--overlay:not(.is-scrolled) .cliff-nav__link:hover,
.cliff-header--overlay:not(.is-scrolled) .cliff-nav__link.is-active,
.cliff-header--overlay:not(.is-scrolled) .cliff-nav__trigger[aria-expanded="true"],
.cliff-header.is-dark-zone .cliff-nav__link:hover,
.cliff-header.is-dark-zone .cliff-nav__link.is-active {
  color: var(--on-dark, #f7f6f2);
}

.cliff-nav__link.is-active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: currentColor;
}

/* ---------- выпадающее подменю ---------- */

.cliff-nav__group {
  position: relative;
  display: inline-flex;
}

.cliff-nav__trigger {
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}

.cliff-nav__chevron {
  flex: 0 0 auto;
  margin-top: 1px;
  transition: transform 180ms ease;
}

.cliff-nav__trigger[aria-expanded="true"] .cliff-nav__chevron {
  transform: rotate(180deg);
}

.cliff-nav__panel {
  position: absolute;
  top: calc(100% + 26px);
  right: 0;
  z-index: 55;
  width: 284px;
  padding: 16px 0;
  background: var(--page-bg, #fcfbf8);
  border: 1px solid var(--hairline-strong, rgba(24, 23, 22, 0.22));
  border-radius: 2px;
  box-shadow: 0 16px 36px rgba(18, 17, 16, 0.1);
  color: var(--text-main, #181716);
}

.cliff-nav__panel[hidden] {
  display: none;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.cliff-nav__panel:not([hidden]) {
  animation: panelIn 150ms ease;
}

.cliff-nav__panel-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cliff-nav__panel-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 20px;
  transition: background-color 160ms ease;
}

.cliff-nav__panel-list > li + li .cliff-nav__panel-item {
  border-top: 1px solid var(--hairline, rgba(24, 23, 22, 0.11));
}

.cliff-nav__panel-item:hover {
  background: var(--surface, #ffffff);
}

.cliff-nav__panel-item:focus-visible {
  outline-offset: -2px;
}

.cliff-nav__panel-name {
  font-family: var(--font--sans, 'Manrope', sans-serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-main, #181716);
}

.cliff-nav__panel-item[aria-current="page"] .cliff-nav__panel-name {
  color: var(--swatch--brand, #c02d2d);
}

.cliff-nav__panel-desc {
  font-family: var(--font--sans, 'Manrope', sans-serif);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--text-muted, #524e47);
}

/* ---------- действия ---------- */

.site-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 0;
}

/* Контекстный CTA: один слот во всех шапках — меняются только href и подпись. */
.cliff-header .cliff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  min-height: 44px;
  padding: 0 20px;
  font-family: var(--font--sans, 'Manrope', sans-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--header-cta-border);
  border-radius: 2px;
  background-color: transparent;
  color: var(--header-cta-fg);
  transition: background-color 160ms ease, border-color 160ms ease,
    color 160ms ease;
}

.cliff-header .cliff-btn:hover {
  background-color: var(--header-cta);
  border-color: var(--header-cta);
  color: #ffffff;
}

.cliff-header .cliff-btn:active {
  background-color: color-mix(in oklab, var(--swatch--brand, #c02d2d) 82%, #181716);
  border-color: color-mix(in oklab, var(--swatch--brand, #c02d2d) 82%, #181716);
  color: #ffffff;
}

.cliff-header .cliff-btn:focus-visible {
  outline: 2px solid var(--header-cta-fg);
  outline-offset: 2px;
}

.site-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--header-hairline);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: var(--font--sans, 'Manrope', sans-serif);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}

.site-burger:hover {
  border-color: var(--swatch--brand, #c02d2d);
  color: var(--swatch--brand, #c02d2d);
}

.cliff-header--overlay:not(.is-scrolled) .site-burger,
.cliff-header.is-dark-zone .site-burger {
  border-color: rgba(247, 246, 242, 0.32);
}

.cliff-header--overlay:not(.is-scrolled) .site-burger:hover,
.cliff-header.is-dark-zone .site-burger:hover {
  border-color: var(--on-dark, #f7f6f2);
  color: var(--on-dark, #f7f6f2);
}

.cliff-header a:focus-visible,
.cliff-header button:focus-visible,
.site-drawer a:focus-visible,
.site-drawer button:focus-visible {
  outline: 2px solid var(--swatch--brand, #c02d2d);
  outline-offset: 3px;
}

.cliff-header--overlay:not(.is-scrolled) a:focus-visible,
.cliff-header--overlay:not(.is-scrolled) button:focus-visible,
.cliff-header.is-dark-zone a:focus-visible,
.cliff-header.is-dark-zone button:focus-visible {
  outline-color: var(--on-dark, #f7f6f2);
}

/* ---------- мобильная шторка ---------- */

.site-drawer {
  display: none;
}

.site-drawer.is-open {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: var(--header-h, 80px) 0 0;
  z-index: calc(var(--z-header, 500) - 1);
  padding: 24px 20px 32px;
  background: var(--page-bg, #fcfbf8);
  border-bottom: 1px solid var(--hairline, rgba(24, 23, 22, 0.11));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.site-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--hairline, rgba(24, 23, 22, 0.11));
}

.site-drawer__wordmark {
  font-family: var(--font--wordmark, 'Oswald', 'Arial Narrow', sans-serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-main, #181716);
}

.site-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--hairline-strong, rgba(24, 23, 22, 0.22));
  background: transparent;
  color: var(--text-main, #181716);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.site-drawer__close:hover {
  border-color: var(--swatch--brand, #c02d2d);
  color: var(--swatch--brand, #c02d2d);
}

.site-drawer__nav {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-drawer__nav li {
  border-bottom: 1px solid var(--hairline, rgba(24, 23, 22, 0.11));
}

.site-drawer__nav a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 15px 0;
  font-family: var(--font--fk-legacy, 'Oswald', 'Arial Narrow', sans-serif);
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  color: var(--text-main, #181716);
  text-decoration: none;
  transition: color 160ms ease;
}

.site-drawer__nav a:hover {
  color: var(--swatch--brand, #c02d2d);
}

.site-drawer__num,
.site-drawer__group-toggle .site-drawer__num {
  flex: 0 0 auto;
  font-family: var(--font--sans, 'Manrope', sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--swatch--brand, #c02d2d);
}

.site-drawer__nav a[aria-current="page"] {
  color: var(--swatch--brand, #c02d2d);
}

.site-drawer__nav > li > a[aria-current="page"]::after {
  content: "●";
  margin-left: auto;
  font-family: var(--font--sans, 'Manrope', sans-serif);
  font-size: 9px;
  letter-spacing: 0;
}

/* подменю «Другие проекты» внутри мобильного меню */

.site-drawer__group-toggle {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 15px 0;
  text-align: left;
  font-family: var(--font--fk-legacy, 'Oswald', 'Arial Narrow', sans-serif);
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  color: var(--text-main, #181716);
  transition: color 160ms ease;
}

.site-drawer__group-toggle:hover,
.site-drawer__group-toggle[aria-expanded="true"] {
  color: var(--swatch--brand, #c02d2d);
}

.site-drawer__group-label {
  margin-right: auto;
}

.site-drawer__group-sign {
  flex: 0 0 auto;
  font-family: var(--font--sans, 'Manrope', sans-serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  color: var(--text-muted, #524e47);
  transition: transform 180ms ease, color 160ms ease;
}

.site-drawer__group-toggle[aria-expanded="true"] .site-drawer__group-sign {
  transform: rotate(45deg);
  color: var(--swatch--brand, #c02d2d);
}

.site-drawer__sub {
  padding: 2px 0 14px;
}

.site-drawer__sub[hidden] {
  display: none;
}

.site-drawer__sub a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 0;
  border-top: 1px solid var(--hairline, rgba(24, 23, 22, 0.11));
  font-family: var(--font--sans, 'Manrope', sans-serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-main, #181716);
}

.site-drawer__sub a:first-child {
  border-top: 0;
}

.site-drawer__sub a:hover {
  color: var(--swatch--brand, #c02d2d);
}

.site-drawer__sub-desc {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted, #524e47);
}

.site-drawer__meta {
  margin-top: auto;
  padding-top: 32px;
  font-family: var(--font--sans, 'Manrope', sans-serif);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-muted, #524e47);
}

.site-drawer__meta p {
  margin: 0;
}

.site-drawer__meta a {
  color: inherit;
  text-decoration: none;
}

.site-drawer__meta a:hover {
  color: var(--swatch--brand, #c02d2d);
}

.site-drawer__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  margin-top: 20px;
  border-radius: 2px;
  background-color: var(--swatch--brand, #c02d2d);
  color: #ffffff;
  font-family: var(--font--sans, 'Manrope', sans-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
}

.site-drawer__cta:hover {
  background-color: var(--swatch--brand-hover, #a52424);
  color: #ffffff;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 600;
  padding: 12px 18px;
  background: var(--charcoal-950, #0a0909);
  color: var(--text-dark-theme, #f7f6f2);
  font-family: var(--font--sans, 'Manrope', sans-serif);
  font-size: 13px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

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

/* ---------- адаптив ---------- */

@media (max-width: 1080px) {
  .cliff-nav__menu {
    display: none;
  }

  .site-nav-actions {
    margin-left: auto;
  }

  .site-burger {
    display: inline-flex;
  }

  .site-nav-actions .cliff-btn {
    display: none;
  }
}

@media (max-width: 768px) {
  .cliff-header .cliff-container {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 640px) {
  .site-drawer.is-open {
    padding-left: 20px;
    padding-right: 20px;
  }

  .cliff-nav__brand img {
    width: 28px;
    height: 28px;
  }

  .cliff-nav__brand-name {
    font-size: 20px;
  }
}
