/* ============================================================
   HyperMetrica redesign — base styles
   Identity: black + orange. Calm, enterprise, dense info.
   ============================================================ */

@import url('tokens.css');

:root {
  /* Brand override — pushed to deeper orange (per user direction) */
  --brand:        #F19101;          /* primary orange */
  --brand-hi:     #FABA23;          /* lighter accent */
  --brand-hover:  #D17A00;          /* hover */
  --brand-soft:   #FFF0AF;          /* tint */
  --brand-glow:   rgba(241, 145, 1, 0.18);

  --ink:          #0E0E14;          /* deeper near-black for premium feel */
  --ink-2:        #1A1A24;
  --ink-3:        #232332;
  --ink-4:        #2E2E3C;

  --paper:        #ffffff;
  --bg-soft:      #F7F7F9;
  --bg-cream:     #FAF7F0;          /* warm soft beige used as section break */
  --line:         #E4E4EA;
  --line-strong:  #C4C4CA;
  --fg-1:         #0E0E14;
  --fg-2:         #555560;
  --fg-3:         #878787;
  --fg-4:         #B5B5BC;

  --maxw:         1280px;
  --gutter:       80px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button { font-family: inherit; cursor: pointer; }

::selection { background: var(--brand); color: var(--ink); }

/* ====== Shell ====== */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (max-width: 1100px) {
  :root { --gutter: 32px; }
}

/* ====== Type ====== */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow .dot {
  width: 6px; height: 6px; background: var(--brand); border-radius: 50%;
  display: inline-block;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; color: var(--fg-1); letter-spacing: -0.015em; }
.display { font-size: clamp(40px, 4.6vw, 64px); font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; }
.h1 { font-size: clamp(40px, 4.4vw, 56px); font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
.h2 { font-size: clamp(28px, 2.8vw, 40px); font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; }
.h3 { font-size: 22px; font-weight: 700; line-height: 1.25; }
.h4 { font-size: 18px; font-weight: 700; line-height: 1.3; }
.lead { font-size: 18px; line-height: 1.65; color: var(--fg-2); font-weight: 400; }
.body { font-size: 16px; line-height: 1.7; color: var(--fg-2); }
.small { font-size: 14px; color: var(--fg-2); }
.mono { font-family: var(--font-mono); }

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 22px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-1);
  transition: background 160ms var(--ease-out), color 160ms, border-color 160ms, transform 80ms;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn-primary {
  background: var(--brand);
  color: var(--ink);
}
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--fg-1);
}
.btn-ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-dark {
  background: var(--ink);
  color: #fff;
}
.btn-dark:hover { background: var(--ink-3); }
.btn-on-dark-ghost {
  border-color: rgba(255,255,255,0.22);
  color: #fff;
}
.btn-on-dark-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.4); }
.btn-lg { padding: 16px 26px; font-size: 16px; }
.btn-sm { padding: 10px 16px; font-size: 14px; }

.btn .arrow {
  transition: transform 200ms var(--ease-out);
}
.btn:hover .arrow { transform: translateX(3px); }

/* ====== Sections ====== */
section { position: relative; }
.section { padding: clamp(64px, 9vw, 128px) 0; }
.section-tight { padding: clamp(48px, 6vw, 88px) 0; }

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 56px;
  max-width: 760px;
}
.section-head .h2 { margin-top: 4px; }

/* ====== Cards ====== */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  transition: transform 280ms var(--ease-out), box-shadow 280ms, border-color 280ms;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
  border-color: var(--line-strong);
}

/* ====== Page transitions ====== */
.page-enter { animation: pageIn 480ms var(--ease-out) both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ====== Header / Mega menu ====== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms, background 200ms;
}
.site-header.scrolled { border-color: var(--line); }

.site-header.dark {
  background: rgba(14, 14, 20, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.site-header.dark.scrolled { border-color: rgba(255,255,255,0.08); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}
.brand-mark {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.brand-mark .cube { width: 30px; height: 30px; }
.brand-mark .wordmark {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--fg-1);
}
.brand-mark .wordmark .b { font-weight: 700; }
.brand-mark .wordmark .l { font-weight: 300; }
.brand-mark .strap {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--fg-3);
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 500;
}

.dark .brand-mark .wordmark { color: #fff; }
.dark .brand-mark .strap { color: #B5B5BC; }

.nav-primary {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav-item {
  position: relative;
  padding: 0;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  color: var(--fg-1);
  border-radius: 6px;
  white-space: nowrap;
  transition: background 160ms, color 160ms;
  background: none;
  border: none;
  cursor: pointer;
}
.dark .nav-link { color: rgba(255,255,255,0.85); }
.nav-link:hover { background: var(--bg-soft); }
.dark .nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-link.active { color: var(--brand); }
.nav-link .chev {
  transition: transform 200ms var(--ease-out);
}
.nav-item.open .nav-link .chev { transform: rotate(180deg); }
.nav-item.open .nav-link { background: var(--bg-soft); }
.dark .nav-item.open .nav-link { background: rgba(255,255,255,0.06); }

.header-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.header-contacts {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 4px;
  border-right: 1px solid var(--line);
  margin-right: 4px;
}
.dark .header-contacts { border-right-color: rgba(255,255,255,0.12); }
.hc-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-2);
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  text-decoration: none;
}
.hc-icon:hover { background: var(--bg-soft); color: var(--brand); }
.dark .hc-icon { color: rgba(255,255,255,0.65); }
.dark .hc-icon:hover { background: rgba(255,255,255,0.08); color: var(--brand); }
.header-phone {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--fg-1);
  white-space: nowrap;
  text-decoration: none;
}
.header-phone:hover { color: var(--brand); }
.dark .header-phone { color: #fff; }

/* Mega menu panel */
.mega {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(14, 14, 20, 0.18), 0 4px 12px rgba(14, 14, 20, 0.08);
  padding: 24px;
  display: grid;
  gap: 4px;
  min-width: 320px;
  z-index: 100;
  animation: megaIn 220ms var(--ease-out) both;
}
@keyframes megaIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mega-wide {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  min-width: 720px;
}
.mega .group-title {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-3);
  margin: 0 0 12px 12px;
  font-weight: 600;
}
.mega-list { display: grid; gap: 2px; }
.mega-link {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  transition: background 160ms;
  cursor: pointer;
}
.mega-link:hover { background: var(--bg-soft); }
.mega-link .ml-icon {
  width: 28px; height: 28px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.mega-link .ml-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mega-link .ml-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--fg-1);
  margin: 0;
}
.mega-link .ml-desc {
  display: block;
  font-size: 13px;
  color: var(--fg-2);
  margin: 2px 0 0;
  line-height: 1.45;
}
.mega-link.is-current { background: var(--brand-soft); }
.mega-link.is-current .ml-title { color: var(--ink); }

.mega-promo {
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.mega-promo::after {
  content: '';
  position: absolute;
  right: -30px; bottom: -30px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, var(--brand-glow), transparent 70%);
}
.mega-promo .pp-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--brand);
  font-weight: 600;
}
.mega-promo .pp-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
}
.mega-promo .pp-text {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
}
.mega-promo .pp-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  position: relative;
  z-index: 2;
}
.mega-promo .pp-link:hover { color: var(--brand-hi); }

/* ====== Hero ====== */
.hero {
  background: var(--ink);
  color: #fff;  position: relative;
  overflow: hidden;
  padding: clamp(32px, 4vw, 60px) 0 clamp(36px, 4vw, 56px);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 2;
}
.hero h1 { color: #fff; }
.hero .accent { color: var(--brand); }
.hero .lead { color: rgba(255,255,255,0.72); font-size: 17px; max-width: 520px; line-height: 1.55; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.85);
}
.hero-eyebrow .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #43D17A;
  box-shadow: 0 0 0 0 rgba(67,209,122,0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(67,209,122,0.55); }
  70% { box-shadow: 0 0 0 10px rgba(67,209,122,0); }
  100% { box-shadow: 0 0 0 0 rgba(67,209,122,0); }
}

.hero-cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 28px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.hero-stat .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.02em;
}
.hero-stat .num .unit { color: var(--brand); }
.hero-stat .label {
  font-size: 12.5px;
  color: rgba(255,255,255,0.55);
  margin-top: 6px;
  font-family: var(--font-body);
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.5) 1px, transparent 0);
  background-size: 32px 32px;
  mask: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.05));
}
.hero-glow {
  position: absolute;
  width: 800px; height: 800px;
  right: -300px; top: -200px;
  background: radial-gradient(circle, rgba(241, 145, 1, 0.18), transparent 60%);
  pointer-events: none;
  filter: blur(40px);
}

/* ====== Hero Visual (server isometric) ====== */
.hero-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 560px;
  margin-left: auto;
}

/* ====== Logos strip ====== */
.logos-strip {
  background: var(--ink);
  padding: 28px 0 36px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.logos-strip .label {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  text-align: center;
  margin-bottom: 22px;
}
.logos-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 32px;
  align-items: center;
}
.client-logo {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.45);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  transition: color 160ms;
}
.client-logo:hover { color: rgba(255,255,255,0.85); }

/* ====== Service cards ====== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.service-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: all 280ms var(--ease-out);
  cursor: pointer;
  min-height: 280px;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 320ms var(--ease-out);
}
.service-card:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-3); }
.service-card:hover::before { transform: scaleX(1); }
.service-card .sc-icon {
  width: 52px; height: 52px;
  background: var(--brand-soft);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.service-card .sc-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1.2; }
.service-card .sc-desc { color: var(--fg-2); font-size: 15px; line-height: 1.55; flex: 1; }
.service-card .sc-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.service-card .sc-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--bg-soft);
  color: var(--fg-2);
  font-weight: 500;
  font-family: var(--font-display);
}
.service-card .sc-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  margin-top: 4px;
}
.service-card .sc-link .arrow { transition: transform 200ms var(--ease-out); }
.service-card:hover .sc-link .arrow { transform: translateX(3px); }

/* Featured card variant */
.service-card.featured {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  grid-column: span 2;
  flex-direction: row;
  align-items: stretch;
  gap: 32px;
  min-height: 320px;
}
.service-card.featured .sc-title { color: #fff; font-size: 30px; }
.service-card.featured .sc-desc { color: rgba(255,255,255,0.72); font-size: 16px; }
.service-card.featured .sc-tag { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.85); }
.service-card.featured .sc-link { color: var(--brand); }
.service-card.featured .sc-icon { background: var(--brand); }
.service-card.featured .sc-body { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.service-card.featured .sc-visual {
  flex: 0 0 240px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}

/* ====== Metrics row ====== */
.metrics {
  background: var(--bg-cream);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 64px 0;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.metric {
  display: flex; flex-direction: column; gap: 6px;
  padding-left: 20px;
  border-left: 2px solid var(--brand);
}
.metric .num {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.metric .num .unit { font-size: 28px; color: var(--brand); margin-left: 4px; }
.metric .label {
  font-size: 14px;
  color: var(--fg-2);
  font-weight: 500;
  margin-top: 4px;
  max-width: 220px;
}

/* ====== Tech stack ====== */
.tech-section {
  position: relative;
}
.tech-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.tech-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: all 240ms var(--ease-out);
  min-height: 110px;
  justify-content: center;
}
.tech-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  background: #fff;
  box-shadow: 0 6px 20px rgba(241, 145, 1, 0.08);
}
.tech-card .tc-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.tech-card .tc-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--fg-1);
}
.tech-card .tc-cat {
  font-size: 11px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ====== Process steps ====== */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
}
.process-grid::before {
  content: '';
  position: absolute;
  top: 28px;
  left: 56px;
  right: 56px;
  height: 1px;
  background: linear-gradient(90deg, var(--brand), var(--brand) 50%, var(--line) 50%, var(--line));
  background-size: 12px 1px;
  background-repeat: repeat-x;
  z-index: 0;
}
.process-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.process-step .num {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  flex-shrink: 0;
}
.process-step.active .num { background: var(--brand); border-color: var(--brand); }
.process-step .ps-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--fg-1);
  margin-top: 8px;
}
.process-step .ps-desc { color: var(--fg-2); font-size: 14px; line-height: 1.55; }

/* ====== Big CTA ====== */
.cta-block {
  background: var(--ink);
  color: #fff;
  border-radius: 16px;
  padding: 64px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.cta-block::after {
  content: '';
  position: absolute;
  right: -100px; top: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--brand-glow), transparent 60%);
  filter: blur(20px);
}
.cta-block .h2 { color: #fff; }
.cta-block .lead { color: rgba(255,255,255,0.72); }
.cta-form {
  background: var(--ink);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  z-index: 2;
}
.cta-block .cta-form {
  background: rgba(255,255,255,0.04);
}
.cta-form .input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 160ms;
}
.cta-form .input:focus {
  outline: none;
  border-color: var(--brand);
}
.cta-form .input::placeholder { color: rgba(255,255,255,0.4); }
.cta-form .agree {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
}

/* ====== Footer ====== */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 80px 0 32px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 64px;
}
.footer-col h4 {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}
.footer-col a {
  display: block;
  padding: 6px 0;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  transition: color 160ms;
}
.footer-col a:hover { color: var(--brand); }
.footer-brand .desc {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  margin: 16px 0 24px;
  max-width: 320px;
}
.footer-contact {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}
.footer-contact .phone {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  flex-wrap: wrap;
  gap: 16px;
}

/* ====== Internal page header ====== */
.page-hero {
  background: var(--bg-cream);
  border-bottom: 1px solid var(--line);
  padding: clamp(64px, 7vw, 112px) 0 clamp(48px, 6vw, 80px);
  position: relative;
  overflow: hidden;
}
.page-hero .container { position: relative; z-index: 2; }
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-3);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.breadcrumbs a { color: var(--fg-2); cursor: pointer; }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs .sep { color: var(--fg-4); }
.breadcrumbs .current { color: var(--ink); font-weight: 500; }

.page-hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  align-items: end;
}
.page-hero h1 { max-width: 720px; }
.page-hero .lead { max-width: 560px; margin-top: 20px; }
.page-hero-meta {
  display: flex; flex-direction: column; gap: 12px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
}
.page-hero-meta .row { display: flex; justify-content: space-between; gap: 24px; padding: 8px 0; }
.page-hero-meta .row + .row { border-top: 1px solid var(--line); }
.page-hero-meta .row .k { color: var(--fg-2); }
.page-hero-meta .row .v { font-weight: 600; color: var(--ink); }

/* ====== TOC / two-column layout ====== */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 48px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 100px;
  font-size: 14px;
  border-left: 1px solid var(--line);
  padding-left: 20px;
}
.toc .toc-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-3);
  font-weight: 600;
  margin-bottom: 14px;
}
.toc a {
  display: block;
  padding: 6px 0;
  color: var(--fg-2);
  cursor: pointer;
  transition: color 160ms;
  font-size: 14px;
}
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--brand); font-weight: 600; }

.side-cta {
  position: sticky;
  top: 100px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.side-cta h4 { color: #fff; font-size: 17px; }
.side-cta .sc-text { font-size: 13px; color: rgba(255,255,255,0.65); line-height: 1.5; }

/* ====== Content blocks ====== */
.content-block { margin-bottom: 72px; }
.content-block h2 { margin-bottom: 12px; }
.content-block h3 { margin-bottom: 12px; margin-top: 32px; }
.content-block p { color: var(--fg-2); line-height: 1.75; font-size: 16px; margin: 0 0 14px; }
.content-block ul { padding-left: 0; list-style: none; margin: 16px 0; }
.content-block ul li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  color: var(--fg-2);
  line-height: 1.65;
}
.content-block ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 14px; height: 12px;
  background: var(--brand);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin: 24px 0;
}
.feature-grid .fg-item {
  background: #fff;
  padding: 28px;
  display: flex; flex-direction: column; gap: 10px;
}
.feature-grid .fg-item h4 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}
.feature-grid .fg-item .icn {
  width: 32px; height: 32px;
  color: var(--brand);
  margin-bottom: 6px;
}
.feature-grid .fg-item p { color: var(--fg-2); font-size: 14px; line-height: 1.55; margin: 0; }

/* SLA table */
.sla-table {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
}
.sla-table table { width: 100%; border-collapse: collapse; }
.sla-table th {
  background: var(--bg-soft);
  text-align: left;
  padding: 14px 20px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
}
.sla-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  color: var(--fg-1);
  vertical-align: top;
}
.sla-table tr:last-child td { border-bottom: none; }
.sla-table .badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
  font-family: var(--font-display);
}

/* Code-like block */
.code-block {
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  padding: 20px 22px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  overflow-x: auto;
  margin: 16px 0;
}
.code-block .c-comment { color: rgba(255,255,255,0.4); }
.code-block .c-key { color: var(--brand-hi); }
.code-block .c-val { color: #C7E5FF; }

/* Plan / pricing cards */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: stretch;
}
.plan {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan.featured {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  position: relative;
}
.plan.featured::before {
  content: 'Рекомендуем';
  position: absolute;
  top: -10px;
  left: 20px;
  background: var(--brand);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.plan .pname {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: inherit;
  line-height: 1.2;
}
.plan .pdesc { font-size: 13px; color: var(--fg-2); line-height: 1.4; min-height: 36px; }
.plan.featured .pdesc { color: rgba(255,255,255,0.7); }
.plan .price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.02em;
  color: inherit;
  line-height: 1;
}
.plan .price-unit { color: var(--fg-3); font-weight: 400; font-size: 14px; }
.plan.featured .price-unit { color: rgba(255,255,255,0.5); }
.plan ul { list-style: none; padding: 0; margin: 4px 0 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.plan ul li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px;
  color: var(--fg-1);
  line-height: 1.45;
}
.plan.featured ul li { color: rgba(255,255,255,0.85); }
.plan ul li::before {
  content: '';
  width: 16px; height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23F19101' d='M6.5 11.5 3 8l1.4-1.4 2.1 2.1 5.1-5.1L13 5z'/%3E%3C/svg%3E") no-repeat center;
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}
.faq-item summary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink);
  padding: 8px 0;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 24px;
  font-weight: 300;
  color: var(--brand);
  transition: transform 280ms;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.faq-item[open] summary::after { content: '–'; }
.faq-item p { color: var(--fg-2); margin: 8px 0 0; line-height: 1.7; max-width: 720px; }

/* Architecture diagram base */
.arch-diagram {
  background: var(--bg-cream);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 40px;
  margin: 24px 0;
}

/* Dashboard mock card */
.dashboard-mock {
  background: var(--ink);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  position: relative;
}

/* Tag pills */
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-1);
  font-family: var(--font-display);
}
.tag-pill.brand { background: var(--brand-soft); border-color: var(--brand-hi); }
.tag-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

/* Cube background motif */
.cube-bg {
  position: absolute;
  pointer-events: none;
  opacity: 0.5;
}

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ====== Floating contact ====== */
.floating-contact {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.fc-trigger {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 32px rgba(0,0,0,0.18), 0 4px 10px var(--brand-shadow, rgba(241,145,1,0.32));
  position: relative;
  transition: transform 180ms var(--ease-out), background 180ms;
}
.fc-trigger:hover { background: var(--brand-hover); color: #fff; transform: translateY(-2px); }
.fc-pulse {
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  opacity: 0.6;
  animation: fcPulse 2.4s infinite;
}
@keyframes fcPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  70% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}
.fc-panel {
  width: 300px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.18);
  overflow: hidden;
  animation: fcIn 220ms var(--ease-out) both;
}
@keyframes fcIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fc-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.fc-close {
  width: 26px; height: 26px; border-radius: 6px; border: none;
  background: var(--bg-soft); color: var(--fg-2); font-size: 18px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.fc-close:hover { background: var(--line); color: var(--ink); }
.fc-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  transition: background 140ms;
}
.fc-row:last-child { border-bottom: none; }
.fc-row:hover { background: var(--bg-cream); }
.fc-row b { font-family: var(--font-display); font-weight: 700; font-size: 14px; display: block; }
.fc-row .fc-sub { display: block; font-size: 12px; color: var(--fg-3); margin-top: 2px; }
.fc-ic {
  width: 34px; height: 34px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

/* ============================================================
   Tweaks panel
   ============================================================ */
.tweaks-shell {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 320px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(14,14,20,0.18), 0 4px 12px rgba(14,14,20,0.08);
  z-index: 9999;
  font-family: var(--font-body);
  overflow: hidden;
  animation: tweaksIn 280ms cubic-bezier(0.22,1,0.36,1);
}
@keyframes tweaksIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.tweaks-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.tweaks-eyebrow {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-3); font-weight: 600;
}
.tweaks-title {
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  color: var(--ink); margin-top: 4px;
}
.tweaks-close {
  width: 28px; height: 28px; border-radius: 6px; border: none;
  background: var(--bg-soft); color: var(--fg-2); font-size: 18px;
  cursor: pointer; display: grid; place-items: center;
  transition: background 160ms;
}
.tweaks-close:hover { background: var(--line); color: var(--ink); }
.tweaks-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.tweaks-section:last-child { border-bottom: none; }
.tweaks-label {
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--fg-2); font-weight: 600; margin-bottom: 10px;
}
.tweaks-hint { font-size: 12px; color: var(--fg-3); }
.tweaks-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.tweaks-swatches { display: flex; gap: 8px; }
.tw-swatch {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  background: var(--paper); border: 1px solid var(--line);
  font-size: 12px; font-weight: 500; color: var(--ink);
  cursor: pointer; transition: all 160ms;
}
.tw-swatch:hover { border-color: var(--line-strong); }
.tw-swatch.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.tw-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.tweaks-segmented {
  display: flex; gap: 4px; padding: 3px; background: var(--bg-soft);
  border-radius: 8px;
}
.tw-seg {
  flex: 1; padding: 8px 12px; border: none; background: transparent;
  font-size: 13px; font-weight: 500; color: var(--fg-2); cursor: pointer;
  border-radius: 6px; transition: all 160ms;
}
.tw-seg.active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.tw-toggle {
  width: 42px; height: 24px; border-radius: 999px; border: none;
  background: var(--line-strong); position: relative; cursor: pointer;
  transition: background 160ms;
}
.tw-toggle.on { background: var(--brand); }
.tw-knob {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform 240ms cubic-bezier(0.22,1,0.36,1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.tw-toggle.on .tw-knob { transform: translateX(18px); }

/* Density */
html[data-density="compact"] .section { padding: 56px 0; }
html[data-density="compact"] .hero { padding: 80px 0 60px; }

/* Pattern toggle */
html[data-pattern="off"] .pattern-bg,
html[data-pattern="off"] .cube-decoration { display: none; }

/* Override !important for editor compatibility */

/* ============================================================
   Legal requisites grid (About page)
   ============================================================ */
.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.legal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.legal-card--wide { padding: 28px 30px; }
.legal-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.legal-card__rows {
  display: grid;
  gap: 10px;
}
.legal-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 18px;
  font-size: 14.5px;
  line-height: 1.55;
  align-items: baseline;
}
.legal-row--block { grid-template-columns: 1fr; gap: 6px; }
.legal-row__k {
  color: var(--fg-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.legal-row__v { color: var(--ink); font-weight: 500; }
.legal-row__v.mono { font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.02em; }

.okved-list { display: grid; gap: 8px; }
.okved-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border-radius: 8px;
  align-items: baseline;
}
.okved-row__code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--brand);
  letter-spacing: 0.02em;
}
.okved-row__name {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}
@media (max-width: 767px) {
  .legal-grid { grid-template-columns: 1fr; gap: 12px; }
  .legal-card { padding: 20px; }
  .legal-row { grid-template-columns: 1fr; gap: 4px; }
  .okved-row { grid-template-columns: 56px 1fr; gap: 10px; }
}

/* ============================================================
   Form states + toast system + spinner
   ============================================================ */
.input.has-error { border-color: #E6333F !important; box-shadow: 0 0 0 3px rgba(230,51,63,0.18); }
.input:disabled { opacity: 0.6; cursor: not-allowed; }

.spinner {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 700ms linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cta-form--light {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
}
.cta-form--light .input {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
}
.cta-form--light .input::placeholder { color: var(--fg-3); }
.cta-form--light .agree { color: var(--fg-2); }

.toast-stack {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  padding: 14px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.22), 0 4px 12px rgba(0,0,0,0.12);
  pointer-events: auto;
  animation: toastIn 280ms var(--ease-out);
  border-left: 3px solid var(--brand);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toast--success { border-left-color: #43D17A; }
.toast--error   { border-left-color: #E6333F; }
.toast--info    { border-left-color: var(--brand); }
.toast__ic {
  width: 24px; height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08);
  margin-top: 1px;
}
.toast--success .toast__ic { color: #43D17A; }
.toast--error .toast__ic   { color: #E6333F; }
.toast--info .toast__ic    { color: var(--brand); }
.toast__msg {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}
.toast__close {
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 18px; cursor: pointer; padding: 0; margin-top: -2px;
  width: 22px; height: 22px;
}
.toast__close:hover { color: #fff; }

@media (max-width: 767px) {
  .toast-stack { right: 12px; left: 12px; bottom: 80px; }
  .toast { min-width: 0; max-width: none; }
}

/* ============================================================
   ===============   MOBILE RESPONSIVE LAYER   ================
   Breakpoints:
     ≤ 1100px  — tablet (gutter shrink, header adjusts)
     ≤ 900px   — small tablet (hero stack, page-hero stack)
     ≤ 767px   — mobile (single column, mobile nav drawer)
     ≤ 480px   — narrow mobile
   ============================================================ */

/* Hide burger on desktop */
.burger { display: none; }
.mobile-drawer, .mobile-drawer__scrim { display: none; }

/* ---------- ≤ 1100px ---------- */
@media (max-width: 1100px) {
  :root { --gutter: 24px; --maxw: 100%; }
  .header-inner { gap: 16px; }
  .nav-primary { gap: 0; }
  .nav-link { padding: 7px 8px; font-size: 13.5px; }
  .header-contacts { display: none; }
  .docs-layout { grid-template-columns: 200px 1fr; }
  .docs-layout .side-cta { display: none; }
  .mega-wide { min-width: 600px; }
}

/* ---------- ≤ 900px : tablet ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-visual { max-width: 460px; margin: 0 auto; }
  .page-hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .service-card.featured { grid-column: span 2; flex-direction: column; }
  .service-card.featured .sc-visual { flex: 0 0 220px; width: 100%; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .tech-grid { grid-template-columns: repeat(4, 1fr); }
  .process-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .process-grid::before { display: none; }
  .feature-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .plans-grid { grid-template-columns: 1fr; gap: 14px; }
  .cta-block { grid-template-columns: 1fr; padding: 40px 32px; gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .docs-layout { grid-template-columns: 1fr; }
  .toc { position: static; border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 16px; }
  .toc { display: flex; flex-wrap: wrap; gap: 6px 16px; }
  .toc .toc-label { width: 100%; }
  .related-grid, [data-related-grid] { grid-template-columns: 1fr !important; }
}

/* ---------- ≤ 767px : mobile ---------- */
@media (max-width: 767px) {
  :root {
    --gutter: 16px;
    --sp-section: 56px;
  }

  /* Type scale */
  html, body { font-size: 15px; }
  .display { font-size: 36px; line-height: 1.08; }
  .h1 { font-size: 30px; line-height: 1.12; }
  .h2 { font-size: 24px; line-height: 1.18; }
  .h3 { font-size: 19px; }
  .h4 { font-size: 17px; }
  .lead { font-size: 16px; }
  .body { font-size: 15px; }

  /* Section padding */
  .section { padding: 48px 0; }
  .section-tight { padding: 36px 0; }
  .section-head { margin-bottom: 28px; gap: 12px; }
  html[data-density="compact"] .section { padding: 40px 0; }
  html[data-density="compact"] .hero { padding: 48px 0 36px; }

  /* Header — keep brand + burger, hide rest */
  .site-header.scrolled { background: rgba(255,255,255,0.98); }
  .site-header.dark { background: rgba(14,14,20,0.98); }
  .header-inner { height: 56px; gap: 12px; }
  .brand-mark .cube { width: 28px; height: 28px; }
  .brand-mark .wordmark { font-size: 17px; }
  .brand-mark .strap { display: none; }
  .nav-primary { display: none; }
  .header-cta { display: none; }
  .header-contacts { display: none; }
  .burger {
    display: inline-flex; flex-direction: column; justify-content: center; align-items: center;
    width: 40px; height: 40px; border: none; background: transparent; cursor: pointer;
    gap: 5px; margin-left: auto; padding: 0;
  }
  .burger span {
    display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px;
    transition: transform 240ms var(--ease-out), opacity 200ms, background 200ms;
  }
  .dark .burger span { background: #fff; }
  .burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger.is-open span:nth-child(2) { opacity: 0; }
  .burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Mobile drawer */
  .mobile-drawer {
    display: block;
    position: fixed;
    top: 0; right: 0;
    width: min(420px, 100%);
    height: 100vh; height: 100dvh;
    background: #fff;
    z-index: 80;
    transform: translateX(100%);
    transition: transform 320ms var(--ease-out);
    overflow-y: auto;
    box-shadow: -20px 0 60px rgba(0,0,0,0.15);
    padding-top: 56px;
  }
  .mobile-drawer.is-open { transform: translateX(0); }
  .mobile-drawer__scrim {
    display: block;
    position: fixed; inset: 0; top: 56px;
    background: rgba(14,14,20,0.5);
    z-index: 70;
    animation: scrimIn 240ms ease;
  }
  @keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }
  .mobile-drawer__inner { padding: 8px 0 32px; min-height: 100%; display: flex; flex-direction: column; }
  .mobile-nav { display: flex; flex-direction: column; padding: 8px 0; }
  .mobile-nav__group { border-bottom: 1px solid var(--line); }
  .mobile-nav__row { display: flex; align-items: stretch; }
  .mobile-nav__label {
    flex: 1; padding: 18px 24px;
    font-family: var(--font-display); font-weight: 600; font-size: 17px;
    color: var(--ink); text-decoration: none;
    display: flex; align-items: center; min-height: 56px;
  }
  .mobile-nav__label.is-active { color: var(--brand); }
  .mobile-nav__toggle {
    width: 56px; height: 56px;
    border: none; background: transparent;
    color: var(--fg-2); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform 240ms;
  }
  .mobile-nav__group.is-expanded .mobile-nav__toggle { transform: rotate(180deg); color: var(--brand); }
  .mobile-nav__sub {
    background: var(--bg-soft);
    padding: 8px 0 16px;
    animation: subIn 240ms var(--ease-out);
  }
  @keyframes subIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
  .mobile-nav__col + .mobile-nav__col { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
  .mobile-nav__coltitle {
    padding: 10px 24px 6px;
    font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--fg-3); font-weight: 600;
  }
  .mobile-nav__subitem {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 24px; min-height: 48px;
    color: var(--ink); text-decoration: none;
    font-size: 15px; font-weight: 500;
  }
  .mobile-nav__subitem.is-active { color: var(--brand); background: var(--brand-soft); }
  .mobile-nav__ic {
    width: 28px; height: 28px; border-radius: 6px;
    background: #fff; border: 1px solid var(--line);
    color: var(--brand);
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  }
  .mobile-nav__subitem.is-active .mobile-nav__ic { background: #fff; border-color: var(--brand); }
  .mobile-nav__desc { display: block; font-size: 12.5px; color: var(--fg-2); font-weight: 400; margin-top: 2px; line-height: 1.4; }
  .mobile-drawer__cta { padding: 24px 24px 16px; }
  .mobile-drawer__contacts {
    display: flex; justify-content: center; gap: 10px;
    padding: 8px 24px 16px;
  }
  .mobile-drawer__contacts a {
    width: 44px; height: 44px; border-radius: 10px;
    background: var(--bg-soft); border: 1px solid var(--line);
    color: var(--fg-2);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 160ms;
  }
  .mobile-drawer__contacts a:hover { color: var(--brand); border-color: var(--brand); }

  /* Hero */
  .hero { padding: 36px 0 32px; text-align: left; }
  .hero-grid { gap: 24px; }
  .display { font-size: 32px; }
  .hero .lead { font-size: 15px; max-width: 100%; }
  .hero-cta-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-cta-row .btn { justify-content: center; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 16px 20px; margin-top: 20px; padding-top: 18px; }
  .hero-stat:last-child { grid-column: span 2; }
  .hero-stat .num { font-size: 24px; }
  .hero-stat .label { font-size: 12px; }
  .hero-visual { max-width: 360px; margin: 4px auto 0; }
  .hero-glow { transform: translate(20%, -20%); width: 100%; height: 600px; }

  /* Buttons / touch */
  .btn { padding: 12px 18px; font-size: 14px; min-height: 44px; }
  .btn-lg { padding: 14px 20px; font-size: 15px; min-height: 48px; }
  .btn-sm { padding: 10px 14px; font-size: 13.5px; min-height: 40px; }

  /* Services + cards */
  .services-grid { grid-template-columns: 1fr; gap: 12px; }
  .service-card { padding: 22px; min-height: 0; }
  .service-card.featured { grid-column: span 1; padding: 24px; }
  .service-card.featured .sc-visual { display: none; }
  .service-card.featured .sc-title { font-size: 22px; }
  .service-card .sc-icon { width: 44px; height: 44px; }
  .service-card .sc-title { font-size: 19px; }
  .service-card .sc-desc { font-size: 14px; }

  /* Metrics */
  .metrics { padding: 40px 0; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
  .metric { padding-left: 14px; }
  .metric .num { font-size: 36px; }
  .metric .num .unit { font-size: 20px; }
  .metric .label { font-size: 13px; }

  /* Tech */
  .tech-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tech-card { padding: 16px 12px; min-height: 92px; }
  .tech-card .tc-name { font-size: 13.5px; }
  .tech-card .tc-cat { font-size: 10.5px; }

  /* Process */
  .process-grid { grid-template-columns: 1fr; gap: 18px; }
  .process-step { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: start; }
  .process-step .num { width: 44px; height: 44px; font-size: 16px; }
  .process-step .ps-title { margin-top: 0; font-size: 16px; }
  .process-step .ps-desc { font-size: 13.5px; grid-column: 2; }
  .process-step > .ps-title, .process-step > .ps-desc { grid-column: 2; }

  /* Features */
  .feature-grid { grid-template-columns: 1fr !important; gap: 0; border-radius: 10px; }
  .feature-grid .fg-item { padding: 22px 18px; }
  .feature-grid .fg-item h4 { font-size: 16px; }
  .feature-grid .fg-item p { font-size: 14px; }

  /* Plans / pricing */
  .plans-grid { grid-template-columns: 1fr; gap: 14px; }
  .plan { padding: 22px 18px; }
  .plan .pname { font-size: 18px; }
  .plan .price { font-size: 30px; }

  /* CTA block */
  .cta-block { padding: 32px 24px; border-radius: 14px; }
  .cta-block .h2 { font-size: 24px; }
  .cta-form { padding: 20px; }
  .cta-form .input { font-size: 16px; padding: 12px 14px; } /* 16px prevents iOS zoom */

  /* Page hero */
  .page-hero { padding: 36px 0 32px; }
  .page-hero h1 { font-size: 28px; }
  .page-hero-grid { gap: 20px; }
  .page-hero-meta { padding: 18px; }
  .page-hero-meta .row { padding: 6px 0; gap: 12px; flex-wrap: wrap; }
  .breadcrumbs { font-size: 12.5px; gap: 6px; margin-bottom: 16px; }
  .breadcrumbs a, .breadcrumbs span { white-space: nowrap; }

  /* Footer */
  .site-footer { padding: 48px 0 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; margin-bottom: 36px; }
  .footer-col h4 { margin-bottom: 14px; font-size: 13px; }
  .footer-col a { padding: 8px 0; font-size: 14px; min-height: 36px; display: flex; align-items: center; }
  .footer-brand .desc { max-width: 100%; }
  .footer-contact .phone { font-size: 20px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; font-size: 12px; }
  .footer-bottom > span:last-child { display: flex; flex-direction: column; gap: 8px; }

  /* Mega menu hidden on mobile entirely (drawer takes over) */
  .mega, .mega-wide { display: none !important; }

  /* SLA table — make scrollable horizontally */
  .sla-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .sla-table table { min-width: 560px; }
  .sla-table th, .sla-table td { padding: 12px 14px; font-size: 13.5px; }

  /* Code block */
  .code-block { font-size: 12px; padding: 16px; line-height: 1.55; }

  /* Architecture diagram — fit svg */
  .arch-diagram { padding: 16px; border-radius: 10px; }
  .arch-diagram svg { min-width: 0; }

  /* Tweaks panel */
  .tweaks-shell {
    right: 12px; left: 12px; bottom: 12px;
    width: auto; max-width: none;
  }
  .tweaks-segmented { flex-wrap: wrap; }
  .tw-seg { min-height: 40px; }
  .tw-swatch { min-height: 40px; }

  /* Floating contact */
  .floating-contact { right: 14px; bottom: 14px; }
  .fc-trigger { width: 52px; height: 52px; }
  .fc-panel { width: calc(100vw - 28px); max-width: 320px; }

  /* Content block */
  .content-block { margin-bottom: 48px; }
  .content-block h2 { font-size: 22px; }
  .content-block ul li { font-size: 14.5px; padding-left: 24px; }
  .content-block ul li::before { width: 12px; height: 10px; top: 8px; }

  /* TOC — collapsed into row of chips */
  .toc { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; padding-top: 12px; }
  .toc .toc-label { font-size: 10px; }
  .toc a { padding: 6px 10px; background: var(--bg-soft); border-radius: 6px; min-height: 36px; }
  .toc a.active { background: var(--brand-soft); }

  /* Section index cards (services-grid used for indexes) — already 1col above */
}

/* ---------- ≤ 480px : narrow ---------- */
@media (max-width: 480px) {
  :root { --gutter: 14px; }
  .display { font-size: 28px; }
  .h1 { font-size: 26px; }
  .h2 { font-size: 22px; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stat .num { font-size: 22px; }
  .metric .num { font-size: 32px; }
  .service-card.featured .sc-title { font-size: 20px; }
  .cta-block { padding: 28px 18px; }
  .cta-block .h2 { font-size: 22px; }
  .page-hero h1 { font-size: 26px; }
  .breadcrumbs .sep { margin: 0 2px; }
  .mobile-drawer { width: 100%; }
  .fc-trigger { width: 48px; height: 48px; }
}

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