/* ── общий каркас шапки ───────────────────────────────────────────────── */

/* Одна шапка на весь сайт: и на главной, и на внутренних страницах.
   Раньше на главной навигация вставлялась в плавающую .header клона —
   а у неё display:flex объявлен только в мобильном медиазапросе, поэтому
   на десктопе логотип и пункты меню ложились друг на друга и на текст hero.
   Здесь шапка живёт в обычном потоке и ничего не перекрывает. */

:root { --header-h: 4.75rem; }

.container {
  width: min(100%, 72rem);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 3vw, 2.25rem);
}

/* Высота задана явно, а не набегает из padding: hero считает свою высоту как
   calc(100svh - var(--header-h)), и расхождение в пару пикселей давало бы
   лишнюю полосу прокрутки на первом экране. */
.page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  height: var(--header-h);
  background: rgba(4, 6, 14, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line, #1b2440);
  color: #fff;
}

.page-header__inner {
  width: min(calc(100% - 3rem), 72rem);
  margin-inline: auto;
  padding-inline: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(1.5rem, 2.5vw, 2.75rem);
}

/* ── логотип ──────────────────────────────────────────────────────────── */

/* Текстовый лок-ап вместо SVG чужой фирмы. Цвет — currentColor: клон
   анимирует color у body на переходе тёмная/светлая секция, поэтому
   логотип перекрашивается вместе с темой сам, без отдельной логики. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: currentColor;
  text-decoration: none;
  line-height: 1.1;
}

.brand__mark {
  flex: none;
  width: 3.15rem;
  height: 3.15rem;
  background: url('/assets/brand/marina-rodina-mark.svg') center / contain no-repeat;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding-left: 0.9rem;
  border-left: 1px solid #7448f2;
}

.brand__name {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: 1.02rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand__sub {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: Manrope, sans-serif;
  font-weight: 500;
  font-size: 0.56rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  opacity: 0.72;
  white-space: nowrap;
}

.brand__sub i {
  width: 1.8rem;
  height: 1px;
  background: currentColor;
  opacity: 0.65;
}

@media (max-width: 767px) {
  .brand__mark { width: 2.75rem; height: 2.75rem; }
  .brand__name { font-size: 0.9rem; }
  .brand__sub { font-size: 0.5rem; }
}

@media (max-width: 480px) {
  .brand__text { display: none; }
}

/* nav.css — навигация по страницам сайта. Подключается и на главной,
   и на внутренних страницах, чтобы шапка была одна и та же.

   На главной уже есть своя навигация — рельса точек .dots по секциям.
   Это разные вещи: точки водят внутри главной, .sitenav — между страницами.
   На узких экранах обе уезжают в один бургер. */

.sitenav {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: clamp(1rem, 1.55vw, 1.65rem);
}

.sitenav a {
  position: relative;
  color: currentColor;
  font-family: Manrope, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.72;
  transition: opacity 200ms ease;
}

.sitenav a:hover,
.sitenav a[aria-current="page"] { opacity: 1; }

/* Подчёркивание активного пункта — брендовым градиентом. */
.sitenav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.45rem;
  height: 2px;
  background: linear-gradient(135deg, #7b4bff 0%, #2f6bff 100%);
}

.header__cta {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.1rem 1.45rem 0;
  border: 0;
  border-radius: 0.55rem;
  background: var(--brand-gradient, linear-gradient(135deg, #7b4bff 0%, #2f6bff 100%));
  color: #fff;
  font-family: Manrope, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 180ms ease, transform 180ms ease;
}

.header__cta:hover,
.header__cta:focus-visible {
  color: #fff;
  filter: saturate(1.1) brightness(1.08);
  transform: translateY(-1px);
}

.header__cta span,
.header__cta-mobile span { font-size: 0.9rem; }

.header__cta:focus-visible,
.sitenav a:focus-visible,
.brand:focus-visible,
.header__burger:focus-visible {
  outline: 2px solid #a990ff;
  outline-offset: 4px;
}

.header__cta-mobile { display: none; }

/* ── мобильная раскладка ──────────────────────────────────────────────── */

/* Тот же порог, на котором клон прячет рельсу точек, — чтобы обе навигации
   уходили в бургер одновременно, а не по очереди. */
@media (max-width: 768px) {
  .page-header__inner {
    display: flex;
    justify-content: space-between;
  }

  .header__cta { display: none; }

  .sitenav {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100svh;
    box-sizing: border-box;
    z-index: 15;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.35rem;
    padding: 6rem clamp(1.5rem, 8vw, 3rem) 3rem;
    background: rgba(4, 6, 14, 0.97);
    backdrop-filter: blur(18px);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.35s ease, visibility 0.35s ease;
  }

  .sitenav.open { visibility: visible; opacity: 1; }

  .sitenav a { color: #fff; font-size: 1.5rem; opacity: 0.85; }
  .sitenav a[aria-current="page"]::after { bottom: -0.35rem; }

  .sitenav .header__cta-mobile {
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    padding: 0 1.25rem;
    margin-top: 0.35rem;
    gap: 0.8rem;
    border: 0;
    border-radius: 0.55rem;
    background: var(--brand-gradient, linear-gradient(135deg, #7b4bff 0%, #2f6bff 100%));
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sitenav,
  .sitenav a,
  .header__cta { transition-duration: 0.01ms; }
}

/* Бургер в оригинале показывался только на узких экранах — там он и остаётся. */
@media (min-width: 769px) {
  .header__burger { display: none; }
}

@media (max-width: 768px) {
  :root { --header-h: 6rem; }
}
