/* РазумДом — design tokens & base */
:root {
  --bg: #FFFFFF;
  --bg-2: #EEF1F6;
  --surface: #FFFFFF;
  --ink: #131F38;
  --ink-2: #1C2E52;       /* primary: deep navy (buklet) */
  --ink-3: #41506E;
  --muted: #7A859B;
  --line: #DCE1EB;
  --line-2: #E7EBF2;
  --accent: #E89A1C;      /* amber (buklet) */
  --accent-2: #C57E12;
  --leak: #2E6FB5;
  --warm: #E89A1C;
  --safe: #2E9C6E;
  --warn: #D2603C;
  --good: #2E9C6E;
  --shadow-sm: 0 1px 0 rgba(21,32,26,0.04), 0 1px 2px rgba(21,32,26,0.04);
  --shadow-md: 0 1px 0 rgba(21,32,26,0.05), 0 8px 24px -8px rgba(21,32,26,0.10);
  --shadow-lg: 0 1px 0 rgba(21,32,26,0.05), 0 24px 48px -16px rgba(21,32,26,0.14);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --maxw: 1240px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html, body, #root {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  line-height: 1.45;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
@media (max-width: 720px) { .container { padding: 0 18px; } }

/* type scale */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.h-display {
  font-size: clamp(44px, 6.4vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 500;
  color: var(--ink-2);
  text-wrap: balance;
  margin: 0;
}
.h-section {
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 500;
  color: var(--ink-2);
  text-wrap: balance;
  margin: 0;
}
.h-card {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: var(--ink-2);
  margin: 0;
}
.lede {
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
  color: var(--ink-3);
  max-width: 56ch;
  text-wrap: pretty;
}
.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink-2);
  color: #F5F2EC;
}
.btn-primary:hover { background: #15291F; }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-2); }
.btn .arrow { transition: transform 200ms ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* sections */
section { position: relative; padding: clamp(72px, 9vw, 128px) 0; }
section + section { border-top: 1px solid var(--line-2); }

/* cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 180ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.card:hover { box-shadow: var(--shadow-md); }

.divider {
  height: 1px;
  background: var(--line-2);
  margin: 0;
  border: 0;
}

/* placeholder image with diagonal stripes */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      rgba(28,46,82,0.07) 0 8px,
      rgba(28,46,82,0.02) 8px 16px),
    var(--bg-2);
  color: var(--ink-3);
  border-radius: var(--radius);
  overflow: hidden;
}
.ph .ph-label {
  position: absolute;
  inset: auto 12px 12px auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(245,242,236,0.92);
  border: 1px solid var(--line);
  color: var(--ink-3);
  padding: 4px 8px;
  border-radius: 999px;
}

/* accent pill / chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-3);
}
.chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

/* dotted/grid background */
.grid-bg {
  background-image: radial-gradient(rgba(28,46,82,0.10) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
}

/* utility */
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* nav */
.nav {
  position: sticky;
  top: 12px;
  z-index: 50;
  margin: 12px auto 0;
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px 10px 18px;
  background: rgba(251,249,244,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; letter-spacing: -0.01em; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--ink-2);
  position: relative;
  display: grid; place-items: center;
}
.nav-links { display: flex; gap: 22px; }
.nav-links a { font-size: 14px; color: var(--ink-3); }
.nav-links a:hover { color: var(--ink-2); }
@media (max-width: 1000px) { .nav-links { display: none; } }

/* keyframes */
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.4); opacity: 0; }
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* focus */
*:focus-visible {
  outline: 2px solid var(--ink-2);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---- Marquee «Почему» (transform3d, GPU, читаемо но заметно) ---- */
.rd-marquee-wrap { overflow: hidden; }
.rd-marquee {
  display: flex;
  gap: 36px;
  white-space: nowrap;
  width: max-content;
  will-change: transform;
  animation: rd-marquee 28s linear infinite;
}
@keyframes rd-marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
@media (max-width: 720px) {
  .rd-marquee { gap: 22px; animation-duration: 18s; }
}
@media (prefers-reduced-motion: reduce) {
  .rd-marquee { animation-duration: 60s; }
}

/* ============================================================= */
/*  Критический мобильный адаптив — в глобальном CSS, чтобы блоки */
/*  не «разъезжались» до загрузки поздних inline <style>.        */
/* ============================================================= */
.hero-floats { max-width: 100%; }
@media (max-width: 980px) {
  /* Плавающие плитки убираем из absolute-потока на планшете/мобиле */
  .hero-floats {
    position: static !important;
    width: 100% !important;
    right: auto !important;
    top: auto !important;
    margin-top: 32px;
  }
}
@media (max-width: 760px) {
  .nav-inner { gap: 10px; padding: 9px 10px 9px 12px; }
  .nav-irk { display: none !important; }
  .nav-phone { display: none; }
  section { padding: clamp(56px, 12vw, 96px) 0; }
}
@media (max-width: 400px) {
  .nav-brand-name { font-size: 17px !important; }
}

/* print: only the КП/счёт document — одностраничный PDF */
@media print {
  html, body { background: #fff; }
  body * { visibility: hidden !important; }
  #kp-doc, #kp-doc * { visibility: visible !important; }
  #kp-doc {
    position: absolute !important;
    left: 0; top: 0; right: 0;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  /* сохранить фирменные цвета шапки/блоков на печати */
  #kp-doc, #kp-doc * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  #kp-doc .kp-actions { display: none !important; }
  /* компактнее, чтобы уместить большие сметы на один лист */
  #kp-doc .kp-row { padding-top: 6px !important; padding-bottom: 6px !important; }
  .tweaks-panel, .nav { display: none !important; }
  @page { size: A4 portrait; margin: 12mm; }
}
