:root {
  --color-navy: #102a43;
  --color-teal: #176b73;
  --color-orange: #f26b3a;
  --color-orange-hover: #d95a2f;
  --color-sand: #f7f3ea;
  --color-mist: #e8f0f1;
  --color-ink: #17212b;
  --color-white: #ffffff;
  --color-border: #ccd8db;
  --color-muted: #3d5260;

  --font-sans: "Manrope", Arial, sans-serif;
  --container-max: 1240px;
  --section-padding: clamp(3.5rem, 6vw, 6.5rem);
  --radius-card: 16px;
  --radius-btn: 12px;
  --header-offset: 6rem;
  --shadow-card: 0 4px 24px rgba(16, 42, 67, 0.06);
  --transition: 200ms ease;

  --text-body: 1.0625rem;
  --text-body-lg: clamp(1.125rem, 2vw, 1.25rem);
  --text-h1: clamp(2rem, 3.5vw, 2.75rem);
  --text-h2: clamp(1.5rem, 2.5vw, 1.875rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-offset);
}

section[id],
[id]:is(section, h1, h2, h3) {
  scroll-margin-top: var(--header-offset);
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.site {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--color-navy);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(242, 107, 58, 0.35);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--color-navy);
  color: var(--color-white);
  text-decoration: none;
  border-radius: var(--radius-btn);
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: min(100% - 2rem, var(--container-max));
  margin-inline: auto;
}

@media (min-width: 768px) {
  .container {
    width: min(100% - 3rem, var(--container-max));
  }
}

/* —— Header —— */
.header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  padding-block: 1rem;
  background: var(--color-white);
  box-shadow: 0 1px 0 var(--color-border);
  transition: background var(--transition), box-shadow var(--transition);
}

.header--scrolled {
  background: rgba(255, 255, 255, 0.98);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.header__brand:hover {
  color: inherit;
}

.header__logo {
  flex-shrink: 0;
  border-radius: 10px;
}

.header__brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.header__name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-navy);
  line-height: 1.2;
}

.header__descriptor {
  font-size: 0.75rem;
  color: var(--color-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header__nav {
  display: none;
  gap: 0.875rem;
  margin-inline: auto;
  flex-wrap: wrap;
  justify-content: center;
}

.header__nav a {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy);
}

.header__nav a:hover,
.header__nav a.is-active {
  color: var(--color-teal);
}

.header__nav a.is-active {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.header__cta {
  display: none;
  padding-inline: 1rem;
  min-height: 44px;
  font-size: 0.9375rem;
}

.header__menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  background: var(--color-white);
  cursor: pointer;
}

.header__menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  margin-inline: auto;
  background: var(--color-navy);
}

.mobile-menu {
  position: fixed;
  left: 0;
  right: 0;
  top: 72px;
  bottom: 0;
  z-index: 99;
  width: 100%;
  height: calc(100vh - 72px);
  height: calc(100dvh - 72px);
  background: var(--color-white);
  padding: 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-menu a {
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-navy);
}

.mobile-menu a.is-active {
  color: var(--color-teal);
}

.mobile-menu .btn {
  margin-top: 0.5rem;
  width: 100%;
}

@media (min-width: 1024px) {
  .header__nav {
    display: flex;
  }

  .header__cta {
    display: inline-flex;
  }

  .header__menu-btn,
  .mobile-menu {
    display: none;
  }
}

@media (min-width: 1280px) {
  .header__nav {
    gap: 1.125rem;
  }

  .header__nav a {
    font-size: 0.9375rem;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .header__cta {
    display: inline-flex;
  }
}

body.menu-open {
  overflow: hidden;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn--primary {
  background: var(--color-orange);
  color: var(--color-white);
}

.btn--primary:hover {
  background: var(--color-orange-hover);
  color: var(--color-white);
}

.btn--secondary {
  background: transparent;
  color: var(--color-navy);
  border: 1px solid var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-mist);
  color: var(--color-navy);
}

/* —— Page / sections —— */
.page-main {
  flex: 1;
  padding-top: var(--header-offset);
}

.section {
  padding-block: var(--section-padding);
}

.section--sand {
  background: var(--color-sand);
}

.section__eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-teal);
  margin-bottom: 0.75rem;
}

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

.section__eyebrow a:hover {
  color: var(--color-navy);
}

.section__title {
  font-size: var(--text-h1);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--color-navy);
}

.section__lead {
  margin-top: 1rem;
  font-size: var(--text-body-lg);
  line-height: 1.55;
  color: var(--color-muted);
  max-width: 62ch;
}

/* —— Blog list —— */
.blog-page__content {
  margin-top: 2.5rem;
}

.blog-empty {
  max-width: 36rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-white);
}

.blog-empty__title {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.2;
}

.blog-empty__text {
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: var(--text-body-lg);
  color: var(--color-muted);
  line-height: 1.5;
}

.blog-list {
  display: grid;
  gap: 1rem;
}

.blog-list__item {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-white);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  height: 100%;
}

.blog-list__item:hover {
  border-color: var(--color-teal);
  box-shadow: var(--shadow-card);
  color: inherit;
}

.blog-list__cover {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
}

.blog-list__title,
.blog-list__date,
.blog-list__excerpt {
  margin-inline: clamp(1.25rem, 3vw, 1.75rem);
}

.blog-list__title {
  margin-top: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.3;
}

.blog-list__date {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.blog-list__excerpt {
  margin-top: 0.375rem;
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
  font-size: 0.9875rem;
  color: var(--color-muted);
  line-height: 1.5;
}

/* Если обложки нет — верхний отступ у заголовка = padding карточки */
.blog-list__item > .blog-list__title:first-child {
  margin-top: clamp(1.25rem, 3vw, 1.75rem);
}

.blog-list__item > .blog-list__title:last-child,
.blog-list__item > .blog-list__date:last-child,
.blog-list__item > .blog-list__excerpt:last-child {
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

@media (min-width: 768px) {
  .blog-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* —— Article —— */
.article {
  max-width: 72ch;
}

.article__cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius-card);
  margin-bottom: 1.75rem;
  border: 1px solid var(--color-border);
}

.article__title {
  font-size: var(--text-h1);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-navy);
}

.article__meta {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  color: var(--color-muted);
}

.article__lead {
  margin-top: 1.25rem;
  font-size: var(--text-body-lg);
  color: var(--color-muted);
  line-height: 1.55;
}

.article__back {
  margin-top: 2.5rem;
}

.prose {
  margin-top: 1.75rem;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-ink);
}

.prose > * + * {
  margin-top: 1rem;
}

.prose h2,
.prose h3 {
  color: var(--color-navy);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-top: 2rem;
}

.prose h2 {
  font-size: var(--text-h2);
}

.prose h3 {
  font-size: 1.25rem;
}

.prose a {
  color: var(--color-teal);
}

.prose a:hover {
  color: var(--color-navy);
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
  list-style: revert;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  margin-block: 1.25rem;
  border: 1px solid var(--color-border);
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background: var(--color-mist);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.prose pre {
  background: var(--color-navy);
  color: var(--color-sand);
  padding: 1rem 1.15rem;
  border-radius: var(--radius-btn);
  overflow-x: auto;
}

.prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.prose blockquote {
  margin: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--color-teal);
  color: var(--color-muted);
}

/* —— 404 —— */
.not-found {
  max-width: 36rem;
}

.not-found__actions {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* —— Footer —— */
.footer {
  padding-block: 2.5rem;
  background: var(--color-ink);
  color: rgba(255, 255, 255, 0.82);
}

.footer__inner {
  display: grid;
  gap: 2rem;
}

.footer__name {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-white);
}

.footer__descriptor,
.footer__geo {
  margin-top: 0.375rem;
  font-size: 0.875rem;
}

.footer__geo {
  color: #8fd4d9;
  font-weight: 600;
}

.footer__nav {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer__nav a {
  font-size: 0.9375rem;
  font-weight: 600;
}

.footer__legal-name {
  font-size: 0.9375rem;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 0.75rem;
}

.footer__requisites {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.footer__req-row {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 0.5rem;
  align-items: baseline;
}

.footer__req-row dt {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}

.footer__req-row dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.footer__meta {
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.footer__operator {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.45;
}

.footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.footer a:hover {
  color: var(--color-white);
  text-decoration: underline;
}

@media (min-width: 768px) {
  .footer__inner {
    grid-template-columns: 1fr auto 1.4fr auto;
    align-items: start;
    gap: 2rem 2.5rem;
  }
}
