/* ============================================================
   Современные цифровые решения — основные стили
   Все цвета — через CSS-переменные на :root.
   ============================================================ */

:root {
  --color-bg-primary: #FFFFFF;
  --color-bg-secondary: #F5F7FA;
  --color-bg-dark: #1A1A2E;
  --color-text-primary: #1A1A2E;
  --color-text-secondary: #6B7280;
  --color-text-on-dark: #FFFFFF;
  --color-text-muted-on-dark: rgba(255, 255, 255, 0.7);
  --color-accent: #2563EB;
  --color-accent-hover: #1D4ED8;
  --color-accent-light: #EFF6FF;
  --color-success: #059669;
  --color-border: #E5E7EB;

  --shadow-card-hover: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-nav: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.1);

  --radius-button: 12px;
  --radius-card: 16px;
  --radius-input: 8px;

  --container-max-width: 1200px;
  --container-padding: 24px;

  --font-h1: 34px;
  --font-h2: 28px;
  --font-h3: 22px;
  --font-body: 16px;
  --font-small: 14px;
  --font-caption: 12px;
  --font-metric: 38px;

  --section-gap: 60px;
  --heading-gap: 32px;
  --grid-gap: 16px;

  --font-stack: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Reset / base ----------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-stack);
  font-size: var(--font-body);
  line-height: 1.6;
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-text-primary);
}
h1 { font-size: var(--font-h1); line-height: 1.1; }
h2 { font-size: var(--font-h2); }
h3 { font-size: var(--font-h3); line-height: 1.3; }
p  { margin: 0; }
strong { font-weight: 700; }

/* --- Utilities -------------------------------------------- */

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -100px; left: 8px;
  padding: 12px 16px;
  background: var(--color-accent);
  color: var(--color-text-on-dark);
  border-radius: var(--radius-button);
  z-index: 100;
  font-weight: 700;
}
.skip-link:focus { top: 8px; color: var(--color-text-on-dark); }

.section {
  padding: var(--section-gap) 0;
  background: var(--color-bg-primary);
}
.section h2,
.section h2:first-child { margin-bottom: var(--heading-gap); max-width: 22ch; }

.section-secondary { background: var(--color-bg-secondary); }
.section-dark      { background: var(--color-bg-dark); color: var(--color-text-on-dark); }
.section-dark h2   { color: var(--color-text-on-dark); }
.section-accent-light { background: var(--color-accent-light); }

/* --- Components ------------------------------------------- */

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 16px 32px;
  border-radius: var(--radius-button);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
  min-height: 48px;
  line-height: 1.2;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-text-on-dark);
  min-width: 200px;
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  color: var(--color-text-on-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
}
.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn-secondary:hover {
  background: var(--color-accent-light);
  color: var(--color-accent-hover);
}

.card {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 24px;
  transition: box-shadow .2s ease;
}
.card:hover { box-shadow: var(--shadow-card-hover); }
.card p + p { margin-top: 16px; }

.grid-3 { display: grid; grid-template-columns: 1fr; gap: var(--grid-gap); }

/* --- Header / Nav ----------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  height: 64px;
  display: flex;
  align-items: center;
  background: transparent;
  z-index: 50;
  transition: background-color .3s ease, box-shadow .3s ease;
}
.site-header.scrolled {
  background: var(--color-bg-primary);
  box-shadow: var(--shadow-nav);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--color-text-primary); }

.nav-menu {
  position: fixed;
  inset: 64px 0 0 0;
  background: var(--color-bg-primary);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 32px var(--container-padding);
  z-index: 49;
}
.nav-menu.is-open { display: flex; }
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  font-size: 20px;
}
.nav-list a {
  color: var(--color-text-primary);
  font-weight: 700;
  padding: 8px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav-list a:hover { color: var(--color-accent); }
.nav-cta { min-width: 220px; }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 44px;
  height: 44px;
  padding: 12px 10px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* --- Hero ------------------------------------------------- */

.hero {
  padding: 80px 0 64px;
}
.hero .caption {
  display: inline-block;
  font-size: var(--font-caption);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 16px;
}
.hero h1 {
  max-width: 18ch;
  margin-bottom: 24px;
}
.hero .lead {
  font-size: 18px;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin-bottom: 32px;
}

/* --- Problems --------------------------------------------- */

.quote {
  font-size: 18px;
  color: var(--color-text-primary);
  font-style: italic;
  line-height: 1.5;
}

/* --- Product sections ------------------------------------- */

.section-product { padding: 60px 0; }
.product { max-width: 720px; }
.product-icon {
  color: var(--color-accent);
  margin-bottom: 24px;
}
.product h2 { margin-bottom: 8px; }
.product-sub {
  font-size: 18px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}
.product-body {
  margin-bottom: 24px;
  max-width: 680px;
}
.product-list {
  margin: 0 0 32px;
  display: grid;
  gap: 12px;
}
.product-list li {
  position: relative;
  padding-left: 28px;
  line-height: 1.5;
}
.product-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 16px; height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
}

/* --- Cases ------------------------------------------------ */

.case h3 { margin-bottom: 16px; }
.case-result {
  color: var(--color-success);
  font-weight: 700;
  margin-top: 16px;
}

/* --- Numbers ---------------------------------------------- */

.section-dark p,
.section-dark .numbers-body { color: var(--color-text-on-dark); }
.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 0 0 32px;
}
.metrics li:nth-child(5) { grid-column: span 2; }
.metric { display: flex; flex-direction: column; gap: 4px; }
.metric-num {
  font-size: var(--font-metric);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-accent);
  letter-spacing: -0.02em;
}
.section-dark .metric-num { color: var(--color-text-on-dark); }
.metric-desc {
  font-size: 16px;
  color: var(--color-text-secondary);
}
.section-dark .metric-desc { color: var(--color-text-muted-on-dark); }
.numbers-body { max-width: 680px; line-height: 1.6; }

/* --- Process ---------------------------------------------- */

.process {
  display: grid;
  gap: 32px;
}
.process-step {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}
.step-num {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-text-on-dark);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.process-step h3 { margin-bottom: 8px; }
.process-step p { color: var(--color-text-secondary); }

/* --- Contact ---------------------------------------------- */

.contact {
  display: grid;
  gap: 32px;
}
.contact-info h2 { margin-bottom: 24px; }
.contact-info .lead {
  font-size: 18px;
  color: var(--color-text-primary);
  margin-bottom: 24px;
  max-width: 480px;
}
.contact-alt {
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text-secondary);
}
.contact-alt a { font-weight: 700; }
.form-embed {
  width: 100%;
  max-width: 650px;
  margin: 0 auto;
  background: var(--color-bg-primary);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card-hover);
  overflow: hidden;
}
.form-embed iframe {
  width: 100%;
  min-height: 560px;
  border: 0;
}

/* --- Footer ----------------------------------------------- */

.site-footer {
  padding: 32px 0;
  background: var(--color-bg-primary);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: var(--font-small);
}
.footer-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}
.site-footer .brand { font-size: 16px; }
.site-footer .copy { color: var(--color-text-secondary); }

/* --- Reveal animation ------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .4s ease, transform .4s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Tablet — 768px+
   ============================================================ */

@media (min-width: 768px) {
  :root {
    --section-gap: 76px;
    --heading-gap: 36px;
    --grid-gap: 20px;
  }
  .hero { padding: 100px 0 80px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .metrics li:nth-child(5) { grid-column: auto; }
  .contact { grid-template-columns: 1fr; }
  .form-embed iframe { min-height: 640px; }
  .footer-row { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 24px; }
  .site-footer .copy { margin-left: auto; }
}

/* ============================================================
   Desktop — 1024px+
   ============================================================ */

@media (min-width: 1024px) {
  :root {
    --font-h1: 52px;
    --font-h2: 38px;
    --font-h3: 26px;
    --font-body: 18px;
    --font-small: 16px;
    --font-caption: 14px;
    --font-metric: 52px;
    --section-gap: 100px;
    --heading-gap: 44px;
    --grid-gap: 24px;
  }
  body { font-size: var(--font-body); }
  .hero {
    min-height: 90vh;
    padding: 120px 0 80px;
    display: flex;
    align-items: center;
  }
  .hero .lead { font-size: 20px; }

  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .card { padding: 32px; }

  .section-product { padding: 100px 0; }
  .product { max-width: 760px; }
  .product-list { grid-template-columns: repeat(2, 1fr); column-gap: 32px; }

  .metrics { grid-template-columns: repeat(5, 1fr); gap: 32px; }

  .process { grid-template-columns: repeat(4, 1fr); gap: 24px; position: relative; }
  .process-step {
    grid-template-columns: 1fr;
    gap: 16px;
    position: relative;
  }
  .process-step::after {
    content: "";
    position: absolute;
    top: 23px;
    left: 64px;
    right: -12px;
    height: 2px;
    background: var(--color-border);
    z-index: 0;
  }
  .process-step:last-child::after { display: none; }
  .step-num { position: relative; z-index: 1; }

  .contact {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
  }
  .form-embed iframe { min-height: 700px; }

  /* Mobile menu hidden, desktop nav visible */
  .nav-toggle { display: none; }
  .nav-menu {
    position: static;
    inset: auto;
    display: flex;
    flex-direction: row;
    background: transparent;
    padding: 0;
    gap: 32px;
    align-items: center;
    justify-content: flex-end;
  }
  .nav-list {
    flex-direction: row;
    gap: 24px;
    font-size: var(--font-small);
  }
  .nav-list a {
    color: var(--color-text-primary);
    font-weight: 400;
    padding: 4px 8px;
    min-height: auto;
  }
  .nav-cta {
    min-width: auto;
    padding: 12px 24px;
    font-size: 14px;
    min-height: auto;
  }
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
