:root {
  --bg: #0a0c10;
  --bg-alt: #0e1117;
  --surface: #12161f;
  --surface-2: #161b26;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f2f4f7;
  --text-muted: #9aa3b2;
  --text-dim: #6b7382;
  --accent: #ff2e3c;
  --accent-soft: rgba(255, 46, 60, 0.14);
  --accent-glow: rgba(255, 46, 60, 0.35);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --container: 1200px;
  --radius: 18px;
  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Кастомный курсор: скрываем системный на устройствах с точным указателем */
@media (hover: hover) and (pointer: fine) {
  body.custom-cursor,
  body.custom-cursor a,
  body.custom-cursor button,
  body.custom-cursor * {
    cursor: none !important;
  }
}

#cursor-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

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

.accent {
  color: var(--accent);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform var(--transition), background var(--transition),
    color var(--transition), border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 30px -10px var(--accent-glow);
}
.btn-primary:hover {
  background: #ff4a55;
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -12px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--text);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 11px 22px;
  font-size: 14px;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background var(--transition), padding var(--transition),
    border-color var(--transition);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(10, 12, 16, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
  padding: 12px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-name {
  font-weight: 700;
  font-size: 16px;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 34px;
}
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}
.nav-link:hover {
  color: var(--text);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 90px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 75%);
}
.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(closest-side, var(--accent-glow), transparent);
  filter: blur(40px);
  opacity: 0.6;
}
.hero-inner {
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}

.hero-title {
  font-size: clamp(44px, 7.5vw, 92px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}
.hero-lead {
  max-width: 620px;
  font-size: 19px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 72px;
}

.hero-stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.hero-stats li {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-value {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}
.stat-value .suffix {
  color: var(--accent);
}
.stat-label {
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- Clients ---------- */
.clients {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.clients-caption {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 22px;
}
.clients-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.clients-track {
  display: flex;
  align-items: center;
  gap: 72px;
  width: max-content;
  animation: marquee 30s linear infinite;
}
.client-logo {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  white-space: nowrap;
  transition: color var(--transition);
}
.client-logo:hover {
  color: var(--text);
}
@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Sections ---------- */
.section {
  padding: 120px 0;
}
.section-alt {
  background: var(--bg-alt);
}

.section-head {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 64px;
}
.section-index {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--accent);
  padding-top: 8px;
  letter-spacing: 0.05em;
}
.section-title {
  font-size: clamp(30px, 4.5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  max-width: 720px;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}
.about-lead {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.about-copy p {
  color: var(--text-muted);
  font-size: 17px;
  margin-bottom: 20px;
}
.about-copy p:last-child {
  margin-bottom: 0;
}

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 30px;
  transition: transform var(--transition), border-color var(--transition),
    background var(--transition);
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.service-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 22px;
}
.service-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.service-card p {
  color: var(--text-muted);
  font-size: 15px;
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 38px 36px;
  transition: transform var(--transition), border-color var(--transition);
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}
.project-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 22px;
}
.project-card h3 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.project-card > p {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 26px;
}
.project-meta {
  list-style: none;
  display: flex;
  gap: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.project-meta li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 15px;
  font-weight: 600;
}
.project-meta li span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 400;
}

/* ---------- Process ---------- */
.process-list {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.process-list li {
  position: relative;
  padding: 30px 26px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform var(--transition), border-color var(--transition);
}
.process-list li:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
}
.process-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
  margin-bottom: 22px;
}
.process-list h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}
.process-list p {
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- CTA ---------- */
.cta {
  padding: 120px 0;
  background: linear-gradient(160deg, #12101f 0%, #0a0c10 100%);
}
.cta-inner {
  position: relative;
}
.cta-content {
  max-width: 640px;
}
.cta-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 20px;
}
.cta-text {
  color: var(--text-muted);
  font-size: 18px;
  margin-bottom: 34px;
}
.cta-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 40px;
}
.cta-link {
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 15px;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 4px;
  transition: border-color var(--transition), color var(--transition);
}
.cta-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-copy {
  color: var(--text-dim);
  font-size: 14px;
}
.footer-domain {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------- Map ---------- */
.map-intro {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 17px;
  margin-top: -28px;
  margin-bottom: 48px;
}
.map-wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}
.map-shell {
  position: relative;
  width: 100%;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(255, 46, 60, 0.05), transparent),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
#map-svg {
  display: block;
  width: 100%;
  height: auto;
}
.map-land {
  fill: rgba(255, 255, 255, 0.04);
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 0.08;
  stroke-linejoin: round;
  transition: fill var(--transition);
}
.map-shell:hover .map-land {
  fill: rgba(255, 46, 60, 0.05);
}

/* маркеры городов */
.map-marker {
  cursor: pointer;
}
.map-marker .dot {
  fill: var(--accent);
}
.map-marker .halo {
  fill: none;
  stroke: var(--accent);
  stroke-width: 0.5;
  transform-origin: center;
  transform-box: fill-box;
  animation: pulse 2.4s ease-out infinite;
  opacity: 0;
}
.map-marker:hover .dot {
  fill: #fff;
}
@keyframes pulse {
  0% {
    transform: scale(0.4);
    opacity: 0.9;
  }
  100% {
    transform: scale(3.2);
    opacity: 0;
  }
}

.map-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 16px));
  transition: opacity 0.15s ease;
  z-index: 5;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.6);
}
.map-tooltip.show {
  opacity: 1;
}

.map-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.legend-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav {
    display: none;
  }
  .nav-toggle {
    display: flex;
  }
  .site-header .btn-sm {
    display: none;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .process-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 20px;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 20px;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
  .process-list {
    grid-template-columns: 1fr;
  }
  .section {
    padding: 80px 0;
  }
  .hero {
    padding-top: 120px;
  }
  .section-head {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .clients-track {
    animation: none;
  }
  #cursor-canvas {
    display: none;
  }
}
