/* Shared layout: header, footer, page base — единый design system для всех страниц лендинга */
:root {
  /* Colors */
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --ink: #111827;
  --muted: #667085;
  --line: #e5e7ef;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #059669;
  --error: #dc2626;
  --warning: #d97706;
  /* Layout */
  --container: 1160px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 16px 48px rgba(16, 24, 40, 0.12);
  --header-h: 73px;
  /* Transitions */
  --ease: 0.2s ease;
  --ease-out: 0.25s cubic-bezier(0.33, 1, 0.68, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
body.menu-open { overflow: hidden; }

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
}
@media (max-width: 600px) {
  .container { width: calc(100% - 1.5rem); }
}

/* Header */
header#nav {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  min-height: var(--header-h);
}
.nav-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  min-width: 148px;
}
.brand img { height: 48px; width: auto; display: block; }

.menu {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}
.menu a {
  text-decoration: none;
  color: #4b556f;
  font-size: 0.94rem;
  font-weight: 600;
  transition: color .2s ease;
  white-space: nowrap;
}
.menu a:hover { color: #111827; }
.menu .menu-cta { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: #1f2a44;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.68rem 1.06rem;
  transition: .2s ease;
  box-shadow: 0 2px 10px rgba(16,24,40,.05);
}
.btn:hover { background: #f9fbff; border-color: #d5daec; }

.mobile-menu-btn {
  display: none;
  width: 42px; height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: #344054;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  touch-action: manipulation;
}
.mobile-menu-btn svg { width: 20px; height: 20px; display: block; }

@media (max-width: 980px) {
  .mobile-menu-btn { display: inline-flex; }
  .brand img { height: 42px; }
  header#nav { backdrop-filter: blur(12px); background: rgba(255,255,255,.98); overflow: visible; position: sticky; top: 0; }
  body.menu-open header#nav { z-index: 10000; }
  .menu {
    display: flex;
    position: fixed;
    left: 0; right: 0;
    bottom: 0;
    top: var(--header-h);
    background: rgba(255,255,255,.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: flex-start;
    gap: .95rem;
    padding: 1.35rem 1.1rem 1.6rem;
    z-index: 9999;
    overflow-y: auto;
    border-top: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    visibility: hidden;
    opacity: 0;
    transform: translateX(100%);
    transition: visibility .3s, opacity .3s, transform .35s var(--ease-out);
    pointer-events: none;
  }
  .menu.open {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
  }
  .menu a { font-size: 1.8rem; color: #111827; }
  .menu .menu-cta { display: inline-flex; margin-top: auto; width: 100%; justify-content: center; }
  .nav-inner > .btn { display: none; }
}

.menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  transition: opacity var(--ease);
}
.menu-backdrop.visible {
  display: block;
  opacity: 1;
}
@media (min-width: 981px) {
  .menu-backdrop { display: none !important; }
}

/* Mobile menu slide-in animation */
@media (max-width: 980px) {
  .menu {
    transform: translateX(100%);
    transition: transform var(--ease-out), opacity var(--ease);
  }
  .menu.open {
    transform: translateX(0);
  }
}

/* Page content */
.page-main {
  padding-top: calc(var(--header-h) + 48px);
  padding-bottom: 64px;
  min-height: calc(100vh - var(--header-h) - 180px);
}
.page-article {
  max-width: 720px;
  margin: 0 auto;
}
.page-article h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  color: var(--ink);
}
.page-article .lead {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 2rem;
}
.page-article h2 {
  font-size: 1.5rem;
  margin: 2rem 0 0.75rem;
  color: var(--ink);
}
.page-article h3 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; }
.page-article p { margin-bottom: 1rem; color: #374151; }
.page-article ul, .page-article ol {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}
.page-article li { margin-bottom: 0.35rem; }
.page-article a { color: var(--accent); text-decoration: none; }
.page-article a:hover { text-decoration: underline; }

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 36px 0 44px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2.5rem;
}
.footer-brand img {
  height: 48px;
  width: auto;
  display: block;
  margin-bottom: 12px;
}
.footer small {
  color: #8790a5;
  font-size: .9rem;
  display: block;
}
.footer h4 {
  font-size: .85rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 12px;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 8px; }
.footer a {
  text-decoration: none;
  color: #6b7280;
  font-size: .95rem;
}
.footer a:hover { color: #111827; }

@media (max-width: 700px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-brand { display: flex; flex-direction: column; align-items: center; }
}
