/* ═══════════════════════════════════════════════════════════════════
   EcomConnector — Design System
   Base styles, nav and footer for every page of the site.
   Load after tokens.css and before any page-specific stylesheet.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* Цвета, шрифты и радиусы — в tokens.css (подключается перед этим файлом). Здесь только раскладка сайта. */
  --page:   1200px;
  --gutter: 24px;
  --nav-h:  64px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: rgba(0,114,245,.35); color: #fff; }

:focus-visible {
  outline: 2px solid var(--blue-2);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  color: var(--fg-strong);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.15;
}

.mono { font-family: var(--font-mono); font-feature-settings: 'ss01'; }

.container {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: 100%;
}
.container-narrow { max-width: 760px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 20px;
}

/* ═══ BUTTONS ═════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.01em;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background .15s var(--ease), border-color .15s var(--ease),
              color .15s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: scale(.985); }
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--accent); color: var(--accent-fg); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-fg); }

.btn-secondary { background: transparent; border-color: var(--border); color: var(--fg-strong); }
.btn-secondary:hover { border-color: var(--gray-600); background: var(--gray-100); color: var(--fg-strong); }

.btn-blue { background: var(--blue); color: #fff; font-weight: 600; }
.btn-blue:hover { background: #0063d6; color: #fff; }

.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 7px; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }

/* ═══ NAV ═════════════════════════════════════════════════════════ */
header.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(0,0,0,.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--fg-strong);
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; color: var(--fg-strong); }
.brand-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: linear-gradient(140deg, #fff 0%, #9a9a9a 100%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 28px;
  flex: 1;
  min-width: 0;
}
.nav-links a {
  font-size: 14px;
  color: var(--fg-muted);
  padding: 7px 11px;
  border-radius: 6px;
  white-space: nowrap;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.nav-links a:hover { color: var(--fg-strong); background: var(--gray-100); text-decoration: none; }

.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }

.nav-burger {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  align-items: center; justify-content: center;
  color: var(--fg);
}
.nav-burger:hover { background: var(--gray-100); }

.mobile-menu {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 99;
  padding: 12px var(--gutter) 32px;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu a.mm-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 2px;
  font-size: 17px;
  font-weight: 500;
  color: var(--fg-strong);
  border-bottom: 1px solid var(--border);
}
.mobile-menu a.mm-link:hover { text-decoration: none; }
.mobile-menu a.mm-link svg { color: var(--fg-subtle); }
.mobile-menu .mm-cta { margin-top: 24px; }

/* ═══ FOOTER ══════════════════════════════════════════════════════ */
footer.site-footer { border-top: 1px solid var(--border); padding: 56px 0 36px; margin-top: 0; }
.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 44px;
}
.foot-brand p {
  margin-top: 16px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--fg-subtle);
  max-width: 34ch;
}
.foot-social { display: flex; gap: 8px; margin-top: 20px; }
.foot-social a {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-muted);
  transition: all .18s var(--ease);
}
.foot-social a:hover { border-color: var(--gray-600); color: var(--fg-strong); background: var(--gray-100); text-decoration: none; }
.foot-col h4 {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-subtle); font-weight: 500;
  margin-bottom: 16px;
}
.foot-col a {
  display: block;
  font-size: 13.5px;
  color: var(--fg-muted);
  padding: 5px 0;
  transition: color .15s var(--ease);
}
.foot-col a:hover { color: var(--fg-strong); text-decoration: none; }
.foot-bottom {
  border-top: 1px solid var(--border);
  padding-top: 26px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--fg-subtle);
  line-height: 1.6;
}

.foot-tm {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--fg-subtle);
  line-height: 1.5;
}

/* ═══ SHARED BLOCKS ═══════════════════════════════════════════════ */
.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
  padding: 26px;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.card:hover { border-color: var(--gray-500); background: var(--bg-elevated); }

.tag {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.tag-paid  { background: rgba(245,166,35,.11); color: var(--amber);   border: 1px solid rgba(245,166,35,.25); }
.tag-incl  { background: rgba(69,165,87,.11);  color: var(--green-2); border: 1px solid rgba(69,165,87,.28); }
.tag-blue  { background: rgba(0,114,245,.11);  color: var(--blue-2);  border: 1px solid rgba(0,114,245,.28); }

/* Page hero used by inner pages */
.page-hero {
  position: relative;
  padding: 88px 0 56px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: -260px; left: 50%;
  width: 900px; height: 520px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0,114,245,.14), rgba(142,78,198,.07) 42%, transparent 70%);
  pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: -.04em;
  line-height: 1.06;
}
.page-hero p.lede {
  margin-top: 20px;
  max-width: 62ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-muted);
}

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 13px; color: var(--fg-subtle);
  margin-bottom: 28px;
}
.breadcrumb a { color: var(--fg-muted); }
.breadcrumb a:hover { color: var(--fg-strong); text-decoration: none; }
.breadcrumb .sep { color: var(--gray-500); }

/* CTA band */
.cta-band {
  position: relative;
  text-align: center;
  padding: 100px 0;
  border-top: 1px solid var(--border);
  overflow: hidden;
}
.cta-band::before {
  content: '';
  position: absolute;
  top: -180px; left: 50%;
  width: 800px; height: 480px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0,114,245,.15), rgba(142,78,198,.07) 42%, transparent 70%);
  pointer-events: none;
}
.cta-band .container { position: relative; z-index: 1; }
.cta-band h2 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.04em; }
.cta-band p { margin: 18px auto 0; max-width: 520px; font-size: 16px; line-height: 1.55; color: var(--fg-muted); }
.cta-band .acts { margin-top: 28px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ═══ RESPONSIVE ══════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .nav-right .btn { display: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .foot-brand { grid-column: span 2; }
  .page-hero { padding: 64px 0 44px; }
  .cta-band { padding: 72px 0; }
}

@media (max-width: 640px) {
  :root { --gutter: 18px; }
  .foot-grid { grid-template-columns: 1fr; }
  .foot-brand { grid-column: span 1; }
  .cta-band .acts { flex-direction: column; align-items: stretch; }
  .cta-band .acts .btn { width: 100%; }
  .card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Burger icon: two glyphs toggled by .is-open (no innerHTML swapping) */
.nav-burger .ico-close { display: none; }
.nav-burger.is-open .ico-open { display: none; }
.nav-burger.is-open .ico-close { display: block; }
