/* Каркас страницы и адаптивность. */

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header__inner {
  width: min(1040px, 100% - 32px);
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  color: inherit;
  text-decoration: none;
}

.brand:hover .brand__name {
  color: var(--accent);
}

.brand__name {
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand__tag {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 550;
  text-decoration: none;
}

.nav__link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav__link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.view {
  flex: 1;
  width: min(1040px, 100% - 32px);
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  max-width: 760px;
  margin-bottom: 24px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow a {
  text-decoration: none;
}

.hero h1 {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.lead {
  max-width: 68ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}

.stack {
  display: grid;
  gap: 16px;
}

.section {
  margin-top: 28px;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.section__title {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.section__note {
  color: var(--muted);
  font-size: 0.88rem;
}

.footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}

.footer__inner {
  width: min(1040px, 100% - 32px);
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .site-header__inner,
  .view,
  .footer__inner {
    width: min(100% - 24px, 1040px);
  }

  .site-header__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px 0 6px;
  }

  .brand__name {
    font-size: 1rem;
  }

  .brand__tag {
    font-size: 0.72rem;
  }

  /* Разделы не переносятся на вторую строку: одна прокручиваемая полоса.
     Иначе шапка на телефоне занимает четверть экрана. */
  .nav {
    width: 100%;
    flex-wrap: nowrap;
    gap: 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav__link {
    flex: 0 0 auto;
    padding: 0 12px;
    font-size: 0.86rem;
  }

  .view {
    padding-top: 18px;
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  }

  .section {
    margin-top: 22px;
  }

  .footer__inner {
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }
}
