/* ============================================================
   EPAV AI — design system & styles
   Vanilla CSS, dark-mode-first, colorful & premium
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* base surfaces — Aurora Violet (Linear/Vercel lineage) */
  --bg: #0a0a0f;
  --bg-soft: #101017;
  --bg-alt: #0d0d14;
  --surface: rgba(255, 255, 255, 0.032);
  --surface-2: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* brand */
  --brand-1: #7c5cfc; /* primary violet   */
  --brand-2: #6d28d9; /* deep violet      */
  --brand-3: #22d3ee; /* cyan accent      */
  --brand-4: #ec4899; /* pink             */
  --brand-secondary: #635bff; /* indigo   */
  --brand-glow: rgba(124, 92, 252, 0.55);

  --grad: linear-gradient(125deg, var(--brand-1), var(--brand-secondary));
  --grad-vivid: linear-gradient(120deg, var(--brand-2), var(--brand-1) 38%, var(--brand-3) 72%, var(--brand-4));
  --grad-cool: linear-gradient(120deg, var(--brand-1), var(--brand-3));
  --grad-text: linear-gradient(100deg, #a58bff, #7ce7ff 55%, #ff8fc0);

  /* text */
  --text: #f5f5f7;
  --text-soft: #d0d0d8;
  --muted: #a1a1aa;
  --dim: #71717a;

  /* semantic */
  --yes: #35e0a1;
  --ok: #ffd166;
  --no: #ff6b81;

  /* geometry */
  --radius: 16px;
  --radius-lg: 22px;
  --radius-sm: 11px;
  --maxw: 1160px;
  --gutter: clamp(18px, 4vw, 40px);

  /* type */
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 40px -6px var(--brand-glow);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset-ish ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.nav-open {
  overflow: hidden;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.02em;
}
p {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
img,
svg {
  display: block;
  max-width: 100%;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
button {
  font-family: inherit;
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--brand-3);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Background ambient glow ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 15% 0%, rgba(124, 92, 252, 0.18), transparent 60%),
    radial-gradient(50% 45% at 100% 10%, rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(45% 40% at 80% 100%, rgba(236, 72, 153, 0.1), transparent 60%);
  pointer-events: none;
}

/* Film-grain / noise overlay — kills banding, adds tactility */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container.narrow {
  max-width: 820px;
}
.section {
  padding-block: clamp(48px, 6.5vw, 92px);
  position: relative;
}
.section-alt {
  background: linear-gradient(180deg, transparent, var(--bg-alt) 12%, var(--bg-alt) 88%, transparent);
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand-1);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  z-index: 200;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.98rem;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s;
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 30px -10px var(--brand-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -10px var(--brand-glow), var(--shadow-glow);
}
.btn-ghost {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover {
  border-color: var(--brand-3);
  transform: translateY(-2px);
  color: #fff;
}
.btn-lg {
  padding: 15px 30px;
  font-size: 1.05rem;
}
.btn-block {
  width: 100%;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(7, 8, 15, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}
.brand-name {
  white-space: nowrap;
}
.logo-mark {
  flex: none;
  filter: drop-shadow(0 4px 14px var(--brand-glow));
}
.primary-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.primary-nav a {
  padding: 9px 14px;
  border-radius: 10px;
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.96rem;
  transition: color 0.2s, background 0.2s;
}
.primary-nav a:hover {
  color: #fff;
  background: var(--surface-2);
}
.primary-nav a.is-active {
  color: #fff;
}
.nav-cta {
  margin-left: 8px;
  color: #fff !important;
}
.nav-cta-short {
  display: none;
}
.nav-cta:hover {
  background: var(--grad) !important;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ---------- Language switcher ---------- */
.primary-nav {
  margin-left: auto;
}
.lang-switch {
  position: relative;
  margin-left: 10px;
  flex: none;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.lang-btn:hover {
  color: #fff;
  border-color: var(--brand-3);
}
.lang-globe {
  font-size: 1rem;
  line-height: 1;
}
.lang-current {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}
.lang-caret {
  font-size: 0.7rem;
  color: var(--muted);
  transition: transform 0.25s var(--ease);
}
.lang-switch.is-open .lang-caret {
  transform: rotate(180deg);
}
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 172px;
  padding: 6px;
  list-style: none;
  margin: 0;
  background: rgba(14, 14, 22, 0.96);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  z-index: 120;
}
.lang-switch.is-open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.lang-menu li {
  margin: 0;
}
.lang-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 9px;
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 0.95rem;
  text-align: left;
  transition: background 0.18s, color 0.18s;
}
.lang-menu button:hover {
  background: var(--surface-2);
  color: #fff;
}
.lang-menu button.is-active {
  color: #fff;
}
.lang-menu button.is-active::after {
  content: "✓";
  color: var(--brand-3);
  font-weight: 700;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(8px, 1.6vw, 22px);
  padding-bottom: 0;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: -10% -10% 0 -10%;
  z-index: -1;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  animation: float 28s ease-in-out infinite;
}
.blob-1 {
  width: 460px;
  height: 460px;
  background: var(--brand-1);
  top: -80px;
  left: 8%;
}
.blob-2 {
  width: 400px;
  height: 400px;
  background: var(--brand-3);
  top: 40px;
  right: 6%;
  animation-delay: -5s;
}
.blob-3 {
  width: 360px;
  height: 360px;
  background: var(--brand-4);
  top: 260px;
  left: 42%;
  animation-delay: -9s;
  opacity: 0.4;
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 75%);
}
@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -24px) scale(1.06);
  }
  66% {
    transform: translate(-24px, 20px) scale(0.96);
  }
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(30px, 5vw, 60px);
  align-items: center;
  padding-block: clamp(12px, 2.4vw, 32px);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-bottom: 22px;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-3);
  box-shadow: 0 0 0 0 rgba(45, 226, 230, 0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(45, 226, 230, 0.6);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(45, 226, 230, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(45, 226, 230, 0);
  }
}
.hero-title {
  font-size: clamp(2.3rem, 5.4vw, 4rem);
  margin-bottom: 22px;
}
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--text-soft);
  max-width: 40ch;
  margin-bottom: 30px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}
.hero-microcopy {
  color: var(--dim);
  font-size: 0.86rem;
  margin-bottom: 22px;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Brand line (расшифровка EPAV) ---------- */
.brandline {
  border-block: 1px solid var(--border);
  padding-block: clamp(22px, 3vw, 36px);
  background: linear-gradient(90deg, transparent, var(--surface) 22%, var(--surface) 78%, transparent);
}
.brandline-inner {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.brandline-mark {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
}
.brandline-sep {
  color: var(--dim);
}
.brandline-text {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 1.9vw, 1.12rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}
.brandline-text .bl-i {
  color: var(--brand-3);
  font-weight: 700;
}
@media (max-width: 560px) {
  .brandline-sep {
    display: none;
  }
  /* трекинг вместо кегля: строка влезает и на 360px, иерархия к тикеру сохраняется */
  .brandline-text {
    letter-spacing: 0.03em;
  }
}

/* inline CTA (after comparison) */
.inline-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  padding: 22px 26px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(124, 92, 252, 0.12), rgba(34, 211, 238, 0.07));
  border: 1px solid var(--border);
  text-align: center;
}
.inline-cta p {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text);
}
.inline-cta .btn {
  flex: none;
}

/* risk reversal microcopy */
.risk-reversal {
  margin-top: 22px;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  display: inline-block;
}

/* hero visual */
.hero-visual {
  position: relative;
}
.glass-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
}
.code-card {
  overflow: hidden;
  transform: rotate(1.2deg);
  animation: cardfloat 8s ease-in-out infinite;
}
@keyframes cardfloat {
  0%,
  100% {
    transform: rotate(1.2deg) translateY(0);
  }
  50% {
    transform: rotate(1.2deg) translateY(-12px);
  }
}
.code-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.code-head .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.dot.red {
  background: #ff5f57;
}
.dot.yellow {
  background: #febc2e;
}
.dot.green {
  background: #28c840;
}
.code-file {
  margin-left: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  font-family: var(--font-mono);
}
.code-body {
  margin: 0;
  padding: 20px 22px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-soft);
  overflow-x: auto;
}
.c-com {
  color: #6b7394;
  font-style: italic;
}
.c-key {
  color: #b15cff;
}
.c-cls {
  color: #2de2e6;
}
.c-fn {
  color: #7ce7ff;
}
.c-str {
  color: #35e0a1;
}
.c-num {
  color: #ffd166;
}
.floating-chip {
  position: absolute;
  padding: 10px 15px;
  border-radius: 14px;
  background: rgba(12, 14, 26, 0.82);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
  font-size: 0.9rem;
  color: var(--text-soft);
  box-shadow: var(--shadow-lg);
  animation: chipfloat 6s ease-in-out infinite;
}
.floating-chip strong {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fff;
  font-size: 1.05rem;
}
.chip-1 {
  top: 6%;
  right: -6%;
  animation-delay: -1s;
}
.chip-2 {
  bottom: 16%;
  left: -8%;
  animation-delay: -3s;
}
.chip-3 {
  bottom: -4%;
  right: 8%;
  animation-delay: -2s;
}
@keyframes chipfloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ---------- Marquee ---------- */
.marquee {
  margin-top: clamp(20px, 4vw, 50px);
  padding-block: 22px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  gap: 44px;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee-track span {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1rem;
  color: var(--muted);
  white-space: nowrap;
}
@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Section heads ---------- */
.section-head {
  max-width: 720px;
  margin: 0 auto clamp(38px, 5vw, 60px);
  text-align: center;
}
.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-3);
  margin-bottom: 14px;
}
.section-title {
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  margin-bottom: 16px;
}
.section-lead {
  color: var(--text-soft);
  font-size: clamp(1rem, 1.4vw, 1.14rem);
}

/* ---------- Cards ---------- */
.cards-grid {
  display: grid;
  gap: 22px;
}
.problems-grid {
  grid-template-columns: repeat(4, 1fr);
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
  position: relative;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.card-ico {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.card h3 {
  font-size: 1.16rem;
  margin-bottom: 8px;
}
.card p {
  color: var(--muted);
  font-size: 0.97rem;
}

/* ---------- Split (approach) ---------- */
.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(30px, 5vw, 64px);
  align-items: center;
}
.split-copy .section-title {
  text-align: left;
}
.check-list {
  display: grid;
  gap: 14px;
  margin: 26px 0 30px;
}
.check-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--text-soft);
}
.ci {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(53, 224, 161, 0.14);
  color: var(--yes);
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 2px;
}
.split-visual {
  display: grid;
  place-items: center;
}
.equation {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 40px 26px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.eq-item {
  display: grid;
  gap: 8px;
  place-items: center;
  padding: 22px 18px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  min-width: 108px;
  font-weight: 600;
}
.eq-ico {
  font-size: 2rem;
}
.eq-op {
  font-family: var(--font-head);
  font-size: 1.8rem;
  color: var(--brand-3);
}
.eq-result {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

/* ---------- Comparison table ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.compare-table th,
.compare-table td {
  padding: 17px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.96rem;
  vertical-align: middle;
}
.compare-table thead th {
  font-family: var(--font-head);
  font-size: 0.98rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  position: sticky;
  top: 0;
}
.compare-table tbody th {
  color: var(--text-soft);
  font-weight: 600;
  font-family: var(--font-body);
}
.us-col {
  background: linear-gradient(180deg, rgba(110, 86, 247, 0.22), rgba(110, 86, 247, 0.08)) !important;
  color: #fff !important;
  border-left: 1px solid var(--border-strong);
  border-right: 1px solid var(--border-strong);
}
.th-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-size: 0.68rem;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
}
.compare-table td.us {
  background: rgba(110, 86, 247, 0.08);
  border-left: 1px solid var(--border-strong);
  border-right: 1px solid var(--border-strong);
  color: var(--text);
  font-weight: 500;
}
.compare-table tbody tr:last-child td,
.compare-table tbody tr:last-child th {
  border-bottom: none;
}
.yes,
.no,
.ok {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.yes::before {
  content: "✓";
  color: var(--yes);
  font-weight: 800;
}
.no::before {
  content: "✕";
  color: var(--no);
  font-weight: 800;
}
.ok::before {
  content: "~";
  color: var(--ok);
  font-weight: 800;
}

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  counter-reset: step;
}
.step {
  position: relative;
  padding: 28px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.step:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}
.step-num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: block;
  margin-bottom: 14px;
}
.step h3 {
  font-size: 1.08rem;
  margin-bottom: 7px;
}
.step p {
  color: var(--muted);
  font-size: 0.93rem;
}

/* ---------- Bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.bento-lg {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.bento-lg h3 {
  font-size: 1.5rem;
}
.bento-wide {
  grid-column: span 2;
}

/* ---------- Stats ---------- */
.stats-section {
  padding-block: clamp(40px, 6vw, 72px);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: clamp(30px, 5vw, 50px);
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(110, 86, 247, 0.14), rgba(45, 226, 230, 0.08));
  border: 1px solid var(--border-strong);
}
.stat {
  text-align: center;
}
.stat-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(2.1rem, 4.8vw, 3rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: block;
  margin-bottom: 10px;
}
.stat-label {
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* ---------- Offers ---------- */
.offers-grid {
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
}
.offer-card {
  display: flex;
  flex-direction: column;
  padding: 30px 28px;
}
.offer-featured {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, rgba(110, 86, 247, 0.16), var(--surface));
  box-shadow: var(--shadow-glow);
}
.offer-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.offer-name {
  font-size: 1.5rem;
  margin-bottom: 4px;
}
.offer-time {
  color: var(--brand-3);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.offer-desc {
  color: var(--text-soft);
  margin-bottom: 18px;
}
.offer-list {
  display: grid;
  gap: 11px;
  margin-bottom: 26px;
}
.offer-list li {
  position: relative;
  padding-left: 26px;
  color: var(--muted);
  font-size: 0.95rem;
}
.offer-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--yes);
  font-weight: 800;
}
.offer-card .btn {
  margin-top: auto;
}
.offers-note {
  text-align: center;
  color: var(--muted);
  margin-top: 26px;
  font-size: 0.95rem;
}

/* ---------- Quotes ---------- */
.quotes-grid {
  grid-template-columns: repeat(3, 1fr);
}
.quote-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.quote-card blockquote {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.55;
}
.quote-card::before {
  content: "“";
  font-family: var(--font-head);
  font-size: 3rem;
  line-height: 0.6;
  color: var(--brand-2);
  height: 26px;
}
.q-role {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---------- FAQ ---------- */
.faq {
  display: grid;
  gap: 12px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.3s, background 0.3s;
}
.faq-item.is-open {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.04rem;
  text-align: left;
}
.faq-mark {
  flex: none;
  position: relative;
  width: 18px;
  height: 18px;
}
.faq-mark::before,
.faq-mark::after {
  content: "";
  position: absolute;
  background: var(--brand-3);
  border-radius: 2px;
  transition: transform 0.3s var(--ease);
}
.faq-mark::before {
  top: 8px;
  left: 0;
  width: 18px;
  height: 2px;
}
.faq-mark::after {
  top: 0;
  left: 8px;
  width: 2px;
  height: 18px;
}
.faq-item.is-open .faq-mark::after {
  transform: rotate(90deg);
  opacity: 0;
}
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
}
.faq-item.is-open .faq-a {
  max-height: 240px;
}
.faq-a p {
  padding: 0 22px 22px;
  color: var(--muted);
}

/* ---------- CTA / contact ---------- */
.cta-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
  padding: clamp(32px, 5vw, 56px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(110, 86, 247, 0.2), transparent 55%),
    radial-gradient(80% 120% at 100% 100%, rgba(45, 226, 230, 0.14), transparent 55%),
    var(--surface);
  border: 1px solid var(--border-strong);
}
.cta-copy .section-title {
  text-align: left;
}
.contact-list {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}
.contact-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-soft);
}
.contact-list a:hover {
  color: #fff;
  text-decoration: underline;
}
.contact-form {
  padding: 28px;
  display: grid;
  gap: 16px;
}
.field {
  display: grid;
  gap: 7px;
}
.field label {
  font-size: 0.88rem;
  color: var(--text-soft);
  font-weight: 500;
}
.field input,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.98rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder {
  color: #5f6685;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(177, 92, 255, 0.2);
}
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.form-status {
  min-height: 0;
  font-size: 0.92rem;
  color: var(--muted);
  transition: color 0.3s;
}
.form-status.is-success {
  color: var(--yes);
}
.form-status.is-error {
  color: var(--no);
}
.form-fineprint {
  font-size: 0.8rem;
  color: #5f6685;
  text-align: center;
}
.form-fineprint a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.form-fineprint a:hover,
.form-fineprint a:focus-visible {
  color: var(--text-soft);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-top: clamp(48px, 6vw, 72px);
  margin-top: 40px;
  background: linear-gradient(180deg, transparent, rgba(110, 86, 247, 0.05));
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 2.6fr;
  gap: 40px;
  padding-bottom: 40px;
}
.footer-company {
  margin-top: 16px;
  color: var(--dim);
  font-size: 0.82rem;
  line-height: 1.7;
}
.footer-tagline {
  color: var(--muted);
  margin-top: 16px;
  max-width: 34ch;
  font-size: 0.95rem;
}
.footer-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.footer-col h4 {
  font-size: 0.92rem;
  margin-bottom: 14px;
  color: var(--text);
}
.footer-col a {
  display: block;
  color: var(--muted);
  padding: 5px 0;
  font-size: 0.94rem;
  transition: color 0.2s;
}
.footer-col a:hover {
  color: #fff;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-block: 26px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Reveal animation ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-copy {
    max-width: 640px;
    margin-inline: auto;
  }
  .hero-sub {
    margin-inline: auto;
  }
  .hero-actions,
  .hero-badges {
    justify-content: center;
  }
  .hero-visual {
    max-width: 460px;
    margin: 20px auto 0;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .split-copy .section-title,
  .cta-copy .section-title {
    text-align: center;
  }
  .split-copy {
    text-align: center;
  }
  .check-list {
    text-align: left;
    max-width: 460px;
    margin-inline: auto;
  }
  .split-copy .btn {
    display: inline-flex;
  }
  .problems-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }
  .bento-lg {
    grid-row: auto;
  }
  .bento-wide {
    grid-column: span 2;
  }
  .offers-grid,
  .quotes-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-inline: auto;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px 20px;
  }
  .cta-panel {
    grid-template-columns: 1fr;
  }
  .cta-copy {
    text-align: center;
  }
  .contact-list {
    justify-items: center;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* Nav sizing, measured in-browser rather than estimated.
   Space for the nav row = min(1160, vw) - 2*gutter - brand(91) - langSwitch(78,
   flex:none) - 10. Because .container caps at 1160px that tops out at 901px and
   never grows, so a nav row that does not fit at 1240px never fits at all.
   Widths the desktop row needs (worst locale first):
     long CTA  + 7 items: es 911 (overflows 901), fr 901 (zero slack), ru 866
     short CTA + 7 items: es 799, fr 798, ru 801  -> ~100px slack
     short CTA + compact padding: es 689, fr 687, ru 694 -> fits down to 1025px
   Hence: short label for the whole desktop row, compact padding 1025-1200, and
   the burger from 1024 down. The long, persuasive label still shows in the
   burger panel, where the CTA is full-width.
   This also fixes a pre-existing bug: with the old 6 items + long CTA the row
   needed ~809px, so it already overflowed below ~1070px while the burger stayed
   hidden until 720px — and body{overflow-x:hidden} clipped the language
   switcher off-screen instead of letting the page scroll to it. */
@media (min-width: 1025px) {
  .nav-cta-long {
    display: none;
  }
  .nav-cta-short {
    display: inline;
  }
}

@media (max-width: 1200px) and (min-width: 1025px) {
  .primary-nav {
    gap: 4px;
  }
  .primary-nav a {
    padding: 9px 10px;
    font-size: 0.9rem;
  }
  .nav-cta {
    padding: 11px 16px;
  }
}

@media (max-width: 1024px) {
  .primary-nav {
    position: fixed;
    inset: 72px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 18px var(--gutter) 26px;
    background: rgba(9, 11, 21, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-140%);
    transition: transform 0.35s var(--ease);
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
  }
  .primary-nav.is-open {
    transform: translateY(0);
  }
  .primary-nav a {
    padding: 13px 14px;
    font-size: 1.02rem;
  }
  .nav-cta {
    margin-left: 0;
    margin-top: 8px;
    justify-content: center;
  }
  .nav-toggle {
    display: flex;
  }
  .lang-switch {
    margin-left: auto;
    margin-right: 8px;
  }
}

@media (max-width: 720px) {
  .footer-nav {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .footer-bottom {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .problems-grid,
  .steps,
  .bento,
  .stats {
    grid-template-columns: 1fr;
  }
  .bento-wide {
    grid-column: auto;
  }
  .floating-chip {
    display: none;
  }
  body {
    font-size: 16px;
  }
}

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

/* ---------- Company / trust section ---------- */
.company-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}
.company-card {
  padding: 30px 28px;
}
.company-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  margin-bottom: 18px;
}
.company-name {
  font-family: var(--font-head);
  font-size: 1.5rem;
  margin-bottom: 18px;
}
.company-reqs {
  display: grid;
  gap: 14px;
  margin: 0 0 22px;
}
.company-reqs dt {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 3px;
}
.company-reqs dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--text);
}
.company-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.company-legal-links a {
  color: var(--brand-3);
}
.company-legal-links a:hover {
  text-decoration: underline;
}
.company-points {
  display: grid;
  gap: 14px;
}
.company-points li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.company-points li:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.cp-ico {
  font-size: 1.4rem;
  flex: none;
  line-height: 1.4;
}
.company-points h4 {
  font-size: 1.02rem;
  margin-bottom: 4px;
}
.company-points p {
  color: var(--muted);
  font-size: 0.93rem;
}

/* ---------- Contact legal address ---------- */
.contact-address {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-style: normal;
  font-size: 0.86rem;
  color: var(--text-soft);
  line-height: 1.6;
}
.contact-address strong {
  color: var(--text);
}

/* ---------- Cookie notice ---------- */
.cookie-notice {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 200;
  width: min(720px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px 14px 20px;
  border-radius: 16px;
  background: rgba(14, 14, 22, 0.96);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
}
.cookie-notice[hidden] {
  display: none;
}
.cookie-text {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-soft);
  line-height: 1.5;
}
.cookie-text a {
  color: var(--brand-3);
}
.cookie-accept {
  flex: none;
}

@media (max-width: 780px) {
  .company-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .cookie-notice {
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-accept {
    width: 100%;
  }
}

/* ---------- Cases ---------- */
.case-card {
  padding: clamp(26px, 4vw, 40px);
}
.case-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.case-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(53, 224, 161, 0.14);
  color: var(--yes);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.case-tag .pulse-dot {
  background: var(--yes);
}
.case-name {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 10px;
}
.case-tagline {
  color: var(--text-soft);
  font-size: 1.05rem;
  max-width: 54ch;
}
.case-link {
  flex: none;
}
.case-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin: 0 0 24px;
}
.case-features li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--text-soft);
  font-size: 0.96rem;
}
.case-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.case-stack-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.case-stack-tags {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text-soft);
}
.cases-more {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 30px;
  text-align: center;
}
.cases-more p {
  margin: 0;
  color: var(--text-soft);
  font-size: 1.02rem;
}
@media (max-width: 640px) {
  .case-features {
    grid-template-columns: 1fr;
  }
  .case-link {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- Cases — 2-card grid ---------- */
.cases-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.case-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.case-features {
  grid-template-columns: 1fr;
}
.case-stack {
  padding-top: 0;
  border-top: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.case-foot {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.case-tag-beta {
  background: rgba(255, 209, 102, 0.14);
  color: var(--ok);
}
.case-tag-beta .pulse-dot {
  background: var(--ok);
}
@media (max-width: 860px) {
  .cases-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Cases — 3-card portfolio (no links, neutral icons) ---------- */
.cases-grid {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}
.case-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.case-top .case-tag {
  margin-bottom: 0;
}
.case-ico {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex: none;
}
.case-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
@media (max-width: 900px) {
  .cases-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* ============================================================
   Services (svc) — «Замена платного ПО на бесплатные аналоги»
   Appended deliberately: this file is ordered base → global
   responsive → reduced-motion → per-component blocks, each
   carrying its own media queries. Keep that shape.
   ============================================================ */

/* Deep links (#services in emails, footer link) must clear the 72px sticky
   header. Applies to every section, fixing the existing ones too. */
section[id] {
  scroll-margin-top: 84px;
}

.svc-item {
  display: block;
}

/* ---------- service intro ---------- */
.svc-head {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.svc-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-3);
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  margin-bottom: 18px;
}
.svc-name {
  font-size: clamp(1.5rem, 3.1vw, 2.1rem);
  text-wrap: balance;
  hyphens: auto;
  overflow-wrap: anywhere;
}
.svc-lead {
  margin-top: 18px;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.3vw, 1.08rem);
}

/* ---------- sub-heading with gradient rule ---------- */
.svc-sub {
  margin: clamp(46px, 5.4vw, 68px) auto 26px;
  text-align: center;
  font-size: clamp(1.16rem, 2.2vw, 1.5rem);
  text-wrap: balance;
  max-width: 32ch;
}
.svc-sub::after {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  border-radius: 2px;
  margin: 14px auto 0;
  background: var(--grad-cool);
}
.svc-sub-flush {
  margin-top: 0;
}

/* ---------- why they overpay ---------- */
.svc-reasons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 16px;
}
.svc-reason {
  padding: 20px;
}
.svc-reason .card-ico {
  width: 42px;
  height: 42px;
  font-size: 1.28rem;
  border-radius: 11px;
  margin-bottom: 14px;
}
.svc-reason h5 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  hyphens: auto;
}
.svc-reason p {
  font-size: 0.89rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- cost chart ---------- */
.svc-chart-card {
  margin-top: clamp(26px, 3.4vw, 40px);
  padding: clamp(18px, 2.4vw, 30px);
}
.svc-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 26px;
  margin-bottom: clamp(20px, 2.6vw, 30px);
}
.svc-chart-titles {
  min-width: 0;
}
.svc-chart-title {
  font-size: clamp(1.05rem, 1.9vw, 1.3rem);
  text-wrap: balance;
}
.svc-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--text-soft);
}
.svc-chart-legend li {
  display: flex;
  align-items: center;
  gap: 9px;
}
.svc-sw {
  flex: none;
  width: 18px;
  height: 3px;
  border-radius: 2px;
}
.svc-sw-lic {
  background: var(--no);
}
.svc-sw-mig {
  background: var(--yes);
}

/* hero figure: proportional sans, never tabular — 5.2 would read loose */
.svc-chart-kpi {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}
.svc-kpi-num {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.2vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.svc-kpi-unit {
  font-size: 0.48em;
  margin-left: 0.2em;
}
.svc-kpi-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 9px;
}

/* Axis labels ride in CSS grid, not absolute positions: the tick sets are evenly
   spaced (y 0/2/4/6/8, x 0…5), so space-between lands them on the gridlines
   exactly, in any of the six locales, with no magic numbers. */
.svc-chart-frame {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  column-gap: 11px;
  row-gap: 7px;
}
.svc-unit-y,
.svc-unit-x,
.svc-ticks-y,
.svc-ticks-x {
  font-family: var(--font-mono);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.svc-unit-y {
  grid-area: 1 / 1 / 2 / 3;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}
.svc-ticks-y {
  grid-area: 2 / 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.72rem;
  line-height: 1;
  /* pulls the column half a line past the plot so tick centres, not tick
     edges, sit on the first and last gridline */
  margin-block: -0.5em;
}
.svc-ticks-x {
  grid-area: 3 / 2;
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
}
/* zero-width items so space-between puts their centres at 0/20/…/100% */
.svc-ticks-x span {
  width: 0;
  display: flex;
  justify-content: center;
  white-space: nowrap;
}
.svc-unit-x {
  grid-area: 4 / 2;
  justify-self: end;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.svc-chart-plot {
  grid-area: 2 / 2;
  position: relative;
  aspect-ratio: 960 / 420;
}
/* preserveAspectRatio="none" makes viewBox x/y map onto 0–100% of this box by
   definition, so aspect-ratio is a pure CSS knob and the % overlay below never
   drifts. non-scaling-stroke keeps every stroke crisp under that anisotropy. */
.svc-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.svc-grid line {
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 1;
}
.svc-axis,
.svc-rule-break {
  stroke: var(--border-strong);
  stroke-width: 1;
}
.svc-rect-invest {
  fill: rgba(255, 255, 255, 0.045);
}
.svc-area-save {
  fill: var(--yes);
  fill-opacity: 0.1;
}
.svc-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.svc-line-lic {
  stroke: var(--no);
}
.svc-line-mig {
  stroke: var(--yes);
}

.svc-chart-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.svc-chart-labels > * {
  position: absolute;
}
/* markers live here, not in the SVG: a viewBox <circle> would both shrink below
   the 8px floor on mobile and turn elliptical under the anisotropic scale */
.svc-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--bg-soft);
}
.svc-dot-lic {
  background: var(--no);
  left: 100%;
  top: 12.5%;
  transform: translate(-50%, -50%);
}
.svc-dot-mig {
  background: var(--yes);
  left: 100%;
  top: 77.5%;
  transform: translate(-50%, -50%);
}
.svc-dot-break {
  width: 10px;
  height: 10px;
  background: var(--text);
  left: 16.667%;
  top: 87.5%;
  transform: translate(-50%, -50%);
}
/* text wears text tokens; identity comes from the coloured dot beside it */
.svc-endlabel {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text);
  white-space: nowrap;
}
.svc-end-lic {
  left: 100%;
  top: 12.5%;
  transform: translate(-100%, -180%);
}
.svc-end-mig {
  left: 100%;
  top: 77.5%;
  transform: translate(-100%, 80%);
}
.svc-band-label {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  white-space: nowrap;
  color: var(--dim);
}
.svc-band-invest {
  left: 8.333%;
  top: 2.5%;
  transform: translateX(-50%);
}
.svc-band-save {
  left: 62%;
  top: 52%;
  transform: translate(-50%, -50%);
  color: var(--text-soft);
}
/* the break-even marker sits bottom-left where both curves bunch, so the label
   goes to the empty upper-left and reaches it with a leader */
.svc-break-label {
  left: 17%;
  top: 24%;
  max-width: 40%;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-soft);
}
.svc-leader {
  left: 16.667%;
  top: 31%;
  height: 56%;
  border-left: 1px dashed rgba(255, 255, 255, 0.22);
}

.svc-chart-invest {
  margin-top: clamp(20px, 2.4vw, 28px);
  font-size: 0.94rem;
  color: var(--text-soft);
  max-width: 74ch;
}
.svc-chart-note {
  margin-top: 14px;
  font-size: 0.79rem;
  line-height: 1.55;
  color: var(--dim);
  max-width: 84ch;
}

/* ---------- numbers twin: no value is gated behind hover ---------- */
.svc-numbers {
  margin-top: 20px;
}
.svc-numbers summary,
.calc-src summary,
.calc-numbers summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-3);
}
.svc-numbers summary::-webkit-details-marker,
.calc-src summary::-webkit-details-marker,
.calc-numbers summary::-webkit-details-marker {
  display: none;
}
.svc-numbers summary::after,
.calc-src summary::after,
.calc-numbers summary::after {
  content: "▾";
  font-size: 0.92em;
  transition: transform 0.25s var(--ease);
}
.svc-numbers[open] summary::after,
.calc-src[open] summary::after,
.calc-numbers[open] summary::after {
  transform: rotate(180deg);
}
.svc-numbers .table-wrap {
  margin-top: 10px;
}
.svc-table,
.calc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 460px;
  font-variant-numeric: tabular-nums;
}
.svc-table caption,
.calc-table caption {
  caption-side: top;
  padding: 14px 18px 2px;
  text-align: left;
  font-size: 0.77rem;
  color: var(--dim);
}
.svc-table th,
.svc-table td,
.calc-table th,
.calc-table td {
  padding: 10px 18px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  font-size: 0.87rem;
}
.svc-table thead th,
.calc-table thead th {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.83rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}
.svc-table thead th:first-child,
.svc-table th[scope="row"],
.calc-table thead th:first-child,
.calc-table th[scope="row"] {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
}
.svc-table tbody tr:last-child th,
.svc-table tbody tr:last-child td,
.calc-table .calc-tr-total th,
.calc-table .calc-tr-total td {
  border-bottom: none;
  color: var(--text);
  font-weight: 700;
}
.svc-neg {
  color: var(--dim);
}

/* ---------- process: 4 steps, not the section-wide 5 ---------- */
.svc-steps {
  grid-template-columns: repeat(4, 1fr);
}
.svc-steps h5 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 9px;
  hyphens: auto;
}
.svc-steps p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- software categories ---------- */
.svc-cats {
  margin-top: clamp(46px, 5.4vw, 68px);
  text-align: center;
}
.svc-cat-note {
  color: var(--muted);
  font-size: 0.94rem;
  margin-bottom: 20px;
}
/* wrapping chips, never a fixed-column grid: "Dokumentenmanagement" is 20 chars */
.svc-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.svc-chip {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

/* ---------- licence block ---------- */
.svc-lic {
  margin: clamp(46px, 5.4vw, 68px) auto 0;
  max-width: 880px;
  padding: clamp(24px, 3vw, 38px);
}
.svc-lic-list {
  margin: 26px 0 0;
}
.svc-lic-note {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---------- KPI row: deliberately lighter than the site-wide .stats ---------- */
.svc-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: clamp(34px, 4vw, 48px);
}
.svc-kpi {
  padding: 20px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}
.svc-kpi-v {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.2vw, 2.05rem);
  line-height: 1.1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.svc-kpi-l {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ---------- responsive (own block: the global queries run earlier) ---------- */
@media (max-width: 980px) {
  .svc-steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .svc-leader {
    display: none;
  }
  .svc-band-invest {
    display: none;
  }
}

@media (max-width: 780px) {
  .svc-chart-kpi {
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .svc-chart-plot {
    aspect-ratio: 16 / 9;
  }
  /* visibility, not display: the hidden ticks must keep their slots so 8/4/0
     stay on the 0/50/100% gridlines */
  .svc-ticks-y span:nth-child(2),
  .svc-ticks-y span:nth-child(4) {
    visibility: hidden;
  }
  .svc-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .svc-chart-plot {
    aspect-ratio: 4 / 3;
  }
  .svc-chart-card {
    backdrop-filter: none;
  }
  .svc-band-save {
    display: none;
  }
  .svc-break-label {
    display: none;
  }
  .svc-endlabel {
    font-size: 0.72rem;
  }
}

@media (max-width: 480px) {
  .svc-chart-plot {
    aspect-ratio: 5 / 4;
  }
  .svc-steps {
    grid-template-columns: 1fr;
  }
  .svc-kpis {
    grid-template-columns: 1fr;
  }
  .svc-reasons {
    grid-template-columns: 1fr;
  }
}

/* The global reduced-motion block runs earlier and its !important transition
   kill still wins; this only pins what is ours. */
@media (prefers-reduced-motion: reduce) {
  .svc-numbers summary::after,
  .calc-src summary::after,
  .calc-numbers summary::after {
    transition: none;
  }
}

/* ============================================================
   Калькулятор человеко-токенов (#calc)
   Follows the file convention: component block, then its own
   media queries. Shares .card/.glass-card/.btn/.table-wrap and
   the .svc-table + disclosure rules extended above.
   ============================================================ */

.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: clamp(20px, 3vw, 38px);
  align-items: start;
  margin-top: clamp(28px, 4vw, 44px);
}

/* ---------- controls ---------- */
.calc-controls {
  min-width: 0;
}
.calc-block {
  border: 0;
  margin: 0 0 clamp(22px, 3vw, 34px);
  padding: 0;
  min-width: 0; /* fieldset defaults to min-content; without this the grid overflows */
}
.calc-legend {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0;
  margin-bottom: 14px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.calc-step {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--brand-3);
}

/* ---------- goal presets ---------- */
.calc-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 10px;
}
.calc-preset {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease),
    transform 0.25s var(--ease);
}
.calc-preset:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.calc-preset.is-active {
  background: var(--surface-2);
  border-color: var(--brand-1);
  box-shadow: var(--shadow-glow);
}
.calc-preset-ico {
  font-size: 1.15rem;
  line-height: 1;
}
.calc-preset-name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
}
.calc-preset-desc {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- fields ---------- */
.calc-field + .calc-field {
  margin-top: 20px;
}
.calc-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.calc-out {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.86rem;
  color: var(--brand-3);
  white-space: nowrap;
}
.calc-note {
  margin: 8px 0 0;
  font-size: 0.79rem;
  line-height: 1.5;
  color: var(--dim);
}

/* Range: the native track/thumb are unstylable as one, so both vendor
   pseudo-element sets are written out in full — they cannot be combined
   into one rule, a single unknown selector would drop the whole block. */
.calc-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
}
.calc-range::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}
.calc-range::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}
.calc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5.5px;
  border-radius: 50%;
  border: 0;
  background: var(--grad-cool);
  box-shadow: 0 0 0 3px var(--bg-alt), 0 0 14px -2px var(--brand-glow);
}
.calc-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 0;
  background: var(--brand-1);
  box-shadow: 0 0 0 3px var(--bg-alt), 0 0 14px -2px var(--brand-glow);
}

.calc-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.calc-select,
.calc-num {
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.calc-select {
  flex: 1 1 200px;
  min-width: 0;
}
.calc-select option {
  background: var(--bg-soft);
  color: var(--text);
}
.calc-num-wrap {
  position: relative;
  flex: 0 0 128px;
}
.calc-num {
  width: 100%;
  padding-right: 42px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.calc-num-unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--dim);
}

/* ---------- mode chips ---------- */
.calc-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
/* Подсказка живёт вплотную под своей группой чипов, зазор до следующего
   поля отдан ей, а не .calc-modes. */
.calc-chip-note {
  margin: 0 0 20px;
}
.calc-mode {
  cursor: pointer;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease),
    background 0.25s var(--ease);
}
.calc-mode:hover {
  border-color: var(--border-strong);
}
.calc-mode.is-active {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--brand-3);
}

/* ---------- result panel ---------- */
.calc-result {
  position: sticky;
  top: 96px;
  padding: clamp(20px, 2.4vw, 28px);
  min-width: 0;
  /* Pinned panels taller than the viewport hide their own bottom, so opening
     the breakdown scrolls inside the card rather than orphaning the CTA. */
  max-height: calc(100vh - 112px);
  overflow-y: auto;
}
.calc-unit-line {
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.calc-unit-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
}
.calc-unit-value {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.1vw, 1.42rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.calc-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-block: 18px;
  border-block: 1px solid var(--border);
}
.calc-total {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.calc-total-l {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-soft);
}
.calc-total-v {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.6vw, 1.72rem);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.calc-total-classic .calc-total-v {
  color: var(--muted);
}
.calc-total-axioma .calc-total-v {
  color: var(--text);
}
.calc-total-s {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
}
.calc-total-sep {
  color: var(--border-strong);
}
.calc-total-axioma .calc-total-fig {
  color: var(--yes);
}
.calc-total-fig.is-worse {
  color: var(--no);
}

/* ---------- bars ---------- */
.calc-bars {
  margin-top: 18px;
}
.calc-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.calc-bar-row + .calc-bar-row {
  margin-top: 8px;
}
.calc-bar-name {
  flex: 0 0 84px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.calc-bar-track {
  flex: 1 1 auto;
  display: flex;
  min-width: 0;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.calc-bar-seg {
  height: 100%;
  transition: width 0.4s var(--ease);
}
.calc-seg-classic {
  background: var(--no);
}
.calc-seg-people {
  background: var(--brand-1);
}
.calc-seg-tokens {
  background: var(--brand-3);
}
.calc-bar-legend {
  list-style: none;
  margin: 12px 0 0;
  padding: 0 0 0 94px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.75rem;
  color: var(--muted);
}
.calc-bar-legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.calc-sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.calc-sw-people {
  background: var(--brand-1);
}
.calc-sw-tokens {
  background: var(--brand-3);
}

.calc-hint {
  margin: 18px 0 0;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.81rem;
  line-height: 1.5;
  color: var(--text-soft);
}

.calc-numbers {
  margin-top: 12px;
}
.calc-numbers .table-wrap {
  margin-top: 8px;
}
.calc-table {
  min-width: 340px;
}
.calc-dash {
  color: var(--dim);
}

.calc-cta-wrap {
  margin-top: 20px;
}
.calc-cta {
  width: 100%;
  justify-content: center;
}
.calc-cta-note {
  margin: 10px 0 0;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--dim);
  text-align: center;
}

/* ---------- assumptions ---------- */
.calc-src {
  margin-top: clamp(24px, 3vw, 36px);
}
.calc-src-body {
  margin-top: 10px;
  padding: clamp(18px, 2.2vw, 26px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.calc-src-body > p {
  font-size: 0.87rem;
  color: var(--text-soft);
}
.calc-formula {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--brand-3);
  overflow-x: auto;
}
/* Source column carries sentences, not figures — left-align it and let it take
   the width, unlike the numeric .calc-table it inherits from. */
.calc-src-table {
  min-width: 520px;
}
.calc-src-table thead th,
.calc-src-table td {
  text-align: left;
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}
.calc-src-table th[scope="row"] {
  white-space: nowrap;
}
.calc-src-method {
  margin-top: 14px;
  font-size: 0.82rem !important;
  color: var(--muted) !important;
}
.calc-src-head {
  margin-top: 22px;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
}
.calc-src-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  font-size: 0.83rem;
}
.calc-src-links a {
  border-bottom: 1px solid rgba(34, 211, 238, 0.25);
}
.calc-src-note {
  margin-bottom: 0;
  color: var(--dim) !important;
  font-size: 0.8rem !important;
}

@media (max-width: 980px) {
  .calc-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .calc-result {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 720px) {
  .calc-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .calc-bar-legend {
    padding-left: 0;
  }
}

@media (max-width: 480px) {
  .calc-presets {
    grid-template-columns: minmax(0, 1fr);
  }
  .calc-totals {
    grid-template-columns: minmax(0, 1fr);
  }
  .calc-bar-name {
    flex-basis: 68px;
  }
  .calc-num-wrap {
    flex: 1 1 100%;
  }
}

/* The global reduced-motion block runs earlier and its !important transition
   kill already covers the bars; this only pins what is ours. */
@media (prefers-reduced-motion: reduce) {
  .calc-bar-seg {
    transition: none;
  }
}

/* ============================================================
   Форма заявки на замену платного ПО (replace.html)
   Follows the file convention: component block, then its own
   media queries. Reuses .field / .calc-* controls and .glass-card
   rather than introducing a third input family.
   ============================================================ */

/* ---------- hero ---------- */
.rep-hero {
  padding-top: clamp(96px, 11vw, 132px);
  padding-bottom: clamp(20px, 3vw, 32px);
}
.rep-hero .section-title {
  margin: 10px 0 14px;
}
.rep-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.rep-trust li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* ---------- shell ---------- */
.replace-form {
  padding: clamp(20px, 3vw, 34px);
}
.rep-row2 {
  display: grid;
  /* min() обязателен: без него auto-fit держит трек в 220px и на узком
     контейнере колонка вылезает за край вместо того, чтобы сжаться. */
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 16px;
  /* Колонки разной высоты (у одной есть подсказка) — без этого грид тянет
     обе до высоты большей, и одинокий инпут раздувается вслед за строкой. */
  align-items: start;
}
/* Только ПРЯМЫЕ потомки шага: без `>` правило добирается до второй колонки
   внутри .rep-row2 (она тоже .field рядом с .field) и опускает её на 18px
   ниже соседней — колонки разъезжаются по вертикали. */
.rep-step > .field + .field,
.rep-step > .rep-row2 + .field,
.rep-step > .field + .rep-row2 {
  margin-top: 18px;
}

/* ---------- progress ---------- */
.rep-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.rep-progress-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 12px;
  border-top: 2px solid var(--border);
  font-size: 0.82rem;
  color: var(--dim);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.rep-progress-item.is-done,
.rep-progress-item.is-active {
  border-top-color: var(--brand-1);
  color: var(--text);
}
/* Пройденные шаги кликабельны — назад; будущие нет, поэтому курсор только у них. */
.rep-progress-item.is-done {
  cursor: pointer;
}
.rep-progress-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: inherit;
}
.rep-progress-item.is-active .rep-progress-num {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}
.rep-progress-item.is-done .rep-progress-num {
  border-color: var(--brand-1);
  color: var(--brand-1);
}
.rep-stepof {
  margin: 0 0 20px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- restored draft ---------- */
.rep-draft {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.84rem;
  color: var(--text-soft);
}
.rep-draft-clear {
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  color: var(--brand-3);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
}

/* ---------- product rows ---------- */
.rep-products {
  display: grid;
  gap: 10px;
}
.rep-product {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.rep-prod-name {
  flex: 1 1 190px;
  min-width: 0;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.rep-prod-name::placeholder {
  color: #5f6685;
}
.rep-prod-cost-wrap {
  flex: 0 0 132px;
}
/* Стрелки у number-поля крадут место под знак валюты и не нужны на суммах. */
.rep-prod-cost {
  width: 100%;
  padding-right: 30px;
  -moz-appearance: textfield;
}
.rep-prod-cost::-webkit-outer-spin-button,
.rep-prod-cost::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.rep-prod-period {
  flex: 0 1 128px;
}
.rep-prod-del {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--dim);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.rep-prod-del:hover {
  color: var(--no);
  border-color: var(--no);
}
/* Единственную строку удалять некуда — скрипт тут же вернёт пустую, так что
   крестик у неё только сбивает с толку. */
.rep-product:only-child .rep-prod-del {
  visibility: hidden;
}
.rep-add {
  /* .field — это grid, и без этого кнопка растягивается на всю колонку. */
  justify-self: start;
  margin-top: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.rep-add:hover {
  border-color: var(--brand-3);
  color: var(--text);
}

/* ---------- chips & checks ---------- */
.rep-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rep-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 8px 16px;
}
.rep-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-soft);
}
.rep-check input {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--brand-1);
  cursor: pointer;
}
.rep-consent {
  align-items: flex-start;
}
.rep-consent a {
  color: var(--brand-3);
  text-decoration: underline;
}

/* ---------- errors ---------- */
.rep-error {
  margin: 7px 0 0;
  font-size: 0.82rem;
  color: var(--no);
}
.replace-form [aria-invalid='true'] {
  border-color: var(--no);
}

/* ---------- footer of the form ---------- */
.rep-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.rep-nav .rep-next,
.rep-nav .rep-submit {
  flex: 1 1 auto;
}
.replace-form .form-status:empty {
  display: none;
}
.replace-form .form-status {
  margin: 14px 0 0;
}

/* ---------- success ---------- */
.rep-success {
  padding: clamp(28px, 4vw, 46px);
  text-align: center;
}
.rep-success:focus {
  outline: none;
}
.rep-success-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: var(--grad);
  box-shadow: var(--shadow-glow);
  font-size: 1.6rem;
  color: #fff;
}
.rep-success .check-list {
  display: inline-grid;
  gap: 10px;
  margin: 22px 0 26px;
  text-align: left;
}
.rep-success .ci {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

@media (max-width: 640px) {
  .rep-progress {
    gap: 6px;
  }
  /* На узком экране подпись шага не помещается рядом с цифрой; номер и
     активная полоса продолжают показывать, где мы находимся. */
  .rep-progress-item span:not(.rep-progress-num) {
    display: none;
  }
  .rep-progress-item {
    justify-content: center;
  }
  .rep-prod-name {
    flex: 1 1 100%;
  }
  /* Название занимает свою строку, сумма и период делят вторую вместе с
     крестиком — иначе строка продукта разъезжается на три яруса. */
  .rep-prod-cost-wrap {
    flex: 1 1 110px;
  }
  .rep-prod-period {
    flex: 1 1 110px;
  }
  .rep-nav {
    flex-direction: column-reverse;
  }
  .rep-nav .btn {
    width: 100%;
  }
}

/* Атрибут hidden проигрывает авторскому display, поэтому каждому компоненту
   с заданным display нужна парная строка — тот же приём, что у
   .cookie-notice[hidden] выше. Без неё скрытые шаги и кнопки остаются на
   экране, хотя в DOM они помечены hidden. */
.rep-draft[hidden],
.rep-step[hidden],
.rep-nav .btn[hidden] {
  display: none;
}
