/* ============================================================
   КАРКАС · Premium — main.css
   ============================================================ */

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

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--font-body);
  background: var(--bg-graphite);
  color: var(--text);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Слои фона ---------- */
#grid-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.axis {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: var(--frame);
  max-width: 96vw;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.axis__line {
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  background: var(--line);
  transform: scaleY(0);
  transform-origin: top center;
}
.axis__line--left  { left: 0; }
.axis__line--right { right: 0; }

/* ---------- Preloader: сборка каркаса ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-graphite);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s var(--ease-out);
}
.preloader.is-done { opacity: 0; pointer-events: none; }
.preloader__mark { width: 84px; height: 84px; }
.preloader__mark .pdraw {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: drawLine 0.8s var(--ease-out) forwards;
}
.preloader__mark .pdraw:nth-child(2) { animation-delay: 0.4s; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }

/* ---------- Кастомный курсор ---------- */
.cursor { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; display: none; }
.cursor__dot {
  position: fixed;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor__ring {
  position: fixed;
  width: 34px; height: 34px;
  border: 1px solid var(--text-muted);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  will-change: transform;
}
.cursor.is-link .cursor__ring {
  width: 52px; height: 52px;
  border-color: var(--green);
  background: rgba(62, 200, 122, 0.08);
}
.cursor.is-text .cursor__ring { width: 18px; height: 18px; }
body.has-cursor { cursor: none; }
body.has-cursor a, body.has-cursor button { cursor: none; }
body.has-cursor .cursor { display: block; }

/* Контент над слоями */
.page { position: relative; z-index: 2; }

.container {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 60px;
}
.container--narrow { max-width: 680px; }

.section { position: relative; padding: var(--section-y) 0; }
/* Чертёжная нумерация секции на левом поле (B7) */
.section[data-index]::before {
  content: attr(data-index);
  position: absolute;
  top: var(--section-y);
  left: max(20px, calc((100% - var(--frame)) / 2 + 16px));
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--text-muted-2);
  opacity: 0.6;
}
@media (max-width: 1380px) { .section[data-index]::before { display: none; } }
.section--sand {
  background: var(--bg-sand);
  color: var(--text-dark);
  position: relative;
  z-index: 1;
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.28), 0 24px 60px rgba(0, 0, 0, 0.28);
}
.section--graphite-2 { background: var(--bg-graphite-2); }

.label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 24px;
}
.label::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--green);
  vertical-align: middle;
  margin-right: 12px;
}

.section__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 56px;
}
.section--sand .section__title { color: var(--text-dark); }

.section__sub {
  font-size: 19px;
  color: var(--text-muted);
  max-width: 640px;
  margin: -32px 0 56px;
}
.section--sand .section__sub { color: var(--text-muted-2); }

/* ---------- Кнопки ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  padding: 17px 32px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease-out), box-shadow 0.3s ease, background 0.25s ease, color 0.25s ease;
}
.btn--primary { background: var(--green); color: var(--text-dark); box-shadow: 0 6px 24px rgba(62, 200, 122, 0.22); }
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 48px var(--green-glow);
}
/* Пульсация главной CTA в Hero (B3) */
.hero__buttons .btn--primary { animation: ctaPulse 2.8s ease-in-out infinite; }
.hero__buttons .btn--primary:hover { animation-play-state: paused; }
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(62, 200, 122, 0.22); }
  50%      { box-shadow: 0 10px 40px rgba(62, 200, 122, 0.5); }
}
.btn--ghost {
  background: transparent;
  border: 1px solid var(--green);
  color: var(--green);
}
.btn--ghost:hover { background: rgba(62, 200, 122, 0.08); transform: translateY(-2px); }
.btn--block { width: 100%; justify-content: center; }
.btn__arrow { transition: transform 0.25s var(--ease-out); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ============ НАВИГАЦИЯ ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 72px;
  z-index: 50;
  transition: background 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease;
}
.nav--scrolled {
  background: rgba(17, 20, 29, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}
.nav__inner {
  max-width: var(--frame);
  margin: 0 auto;
  height: 100%;
  padding: 0 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__logo { display: flex; align-items: center; gap: 12px; }
.nav__logo-mark { width: 30px; height: 30px; }
.nav__logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.02em;
}
.nav__menu { display: flex; align-items: center; gap: 36px; }
.nav__link {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.nav__link:hover { color: var(--green); }
.nav__cta { padding: 11px 22px; font-size: 14px; }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
}
.hero__logo { width: 132px; height: 132px; margin-bottom: 44px; }
.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}
.hero__line { display: block; overflow: hidden; }
.hero__line > span { display: block; will-change: transform; }
.hero__sub {
  font-size: 20px;
  color: var(--text-muted);
  max-width: 580px;
  margin-bottom: 44px;
}
.hero__buttons { display: flex; gap: 16px; margin-bottom: 80px; }

.hero__stats {
  display: flex;
  gap: 72px;
  border-top: 1px solid var(--line);
  padding-top: 40px;
}
.stat__num {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 3.6vw, 56px);
  line-height: 1;
  color: var(--green);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.stat__label { font-size: 14px; color: var(--text-muted); max-width: 190px; }

/* Подсказка скролла */
.scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 56px;
  background: var(--line);
  overflow: hidden;
}
.scroll-hint::after {
  content: "";
  position: absolute;
  top: -16px;
  left: 0;
  width: 1px;
  height: 16px;
  background: var(--green);
  animation: scrollRun 1.8s ease-in-out infinite;
}
@keyframes scrollRun {
  0%   { transform: translateY(0); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(72px); opacity: 0; }
}

/* ============ КАРТОЧКИ (общее) ============ */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012) 40%);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 36px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.45s var(--ease-out), background 0.4s ease, box-shadow 0.4s ease;
}
/* зелёная балка сверху прочерчивается */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s var(--ease-out);
}
.card.is-visible::before { transform: scaleX(1); }
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(62, 200, 122, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(62, 200, 122, 0.12);
}
.card__num {
  position: absolute;
  top: 18px; right: 22px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 44px;
  color: rgba(62, 200, 122, 0.12);
  line-height: 1;
}
.card__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: block;
}
.card__title { font-size: 23px; font-weight: 700; margin-bottom: 14px; line-height: 1.25; }
.card__text { font-size: 16px; color: var(--text-muted); }

/* Боль */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.pain__conclusion {
  text-align: center;
  font-size: 22px;
  color: var(--text-muted);
  max-width: 720px;
  margin: 64px auto 0;
}
.pain__conclusion b { color: var(--green); font-weight: 700; }

/* ============ УСЛУГИ (tilt) ============ */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; perspective: 1200px; }
.service {
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
  transition: transform 0.2s ease, background 0.35s ease;
}
.service__schema {
  width: 48px; height: 48px;
  margin-bottom: 20px;
}
.service__schema path, .service__schema rect, .service__schema line {
  stroke: var(--green);
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  transition: stroke-dashoffset 0.7s var(--ease-out);
}
.service:hover .service__schema path,
.service:hover .service__schema rect,
.service:hover .service__schema line { stroke-dashoffset: 0; }
.service .card__text { flex-grow: 1; margin-bottom: 22px; }
.tag {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green);
  background: rgba(62, 200, 122, 0.08);
  border: 1px solid rgba(62, 200, 122, 0.3);
  border-radius: var(--r-btn);
  padding: 8px 12px;
  margin-bottom: 22px;
}
.service__cta {
  font-weight: 700;
  font-size: 16px;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}
.service__cta .btn__arrow { transition: transform 0.25s var(--ease-out); }
.service:hover .service__cta .btn__arrow { transform: translateX(5px); }

/* ============ КЕЙСЫ ============ */
.cases { display: flex; flex-direction: column; gap: 24px; }
.case {
  background: #fff;
  border: 1px solid var(--line-sand);
  border-radius: var(--r-card);
  padding: 44px;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease;
}
.case:hover { transform: translateY(-6px); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08); }
.case__tag {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 18px;
  display: block;
}
.case__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.15;
  color: var(--text-dark);
  margin-bottom: 18px;
}
.case__text { font-size: 16px; color: #4B5563; max-width: 780px; margin-bottom: 26px; }
.case__result {
  position: relative;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-dark);
  padding-left: 22px;
}
.case__result::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--green);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.6s var(--ease-out);
}
.case.is-visible .case__result::before { transform: scaleY(1); }
.case__metric { color: var(--green); }

/* ============ ОБ ОСНОВАТЕЛЕ ============ */
.founder { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 72px; align-items: center; }
.founder__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}
.founder__text p { font-size: 17px; line-height: 1.7; color: var(--text-muted); margin-bottom: 18px; }
.founder__badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.badge {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  padding: 7px 12px;
}
.badge--green { color: var(--green); border-color: rgba(62, 200, 122, 0.4); }

.founder__photo {
  position: relative;
  height: 500px;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--bg-graphite-2);
  border: 1px solid var(--line);
}
.founder__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.founder__photo-stub {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  color: var(--text-muted-2);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
}
.founder__photo--empty .founder__photo-stub { display: flex; }
/* чертёжные уголки */
.founder__corner {
  position: absolute;
  width: 28px; height: 28px;
  stroke: var(--green);
  stroke-width: 2;
  fill: none;
  z-index: 2;
  transform-origin: center;
  transform-box: view-box;
}
.founder__corner path { stroke-dasharray: 56; stroke-dashoffset: 56; transition: stroke-dashoffset 0.8s var(--ease-out); }
.founder__photo.is-visible .founder__corner path { stroke-dashoffset: 0; }
.founder__corner--tl { top: 10px; left: 10px; }
.founder__corner--tr { top: 10px; right: 10px; transform: rotate(90deg); }
.founder__corner--br { bottom: 10px; right: 10px; transform: rotate(180deg); }
.founder__corner--bl { bottom: 10px; left: 10px; transform: rotate(270deg); }

/* ============ ФОРМЫ ============ */
.form { max-width: 580px; }
.form__row { position: relative; margin-bottom: 18px; }
.form__input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 16px 18px;
  border-radius: var(--r-btn);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--text);
  transition: background 0.25s ease, box-shadow 0.3s ease;
}
.form__input::placeholder { color: var(--text-muted-2); }
.form__input:focus {
  outline: none;
  background: rgba(62, 200, 122, 0.04);
  box-shadow: 0 0 0 1px var(--green), 0 0 24px rgba(62, 200, 122, 0.12);
}
.form__input.is-error { box-shadow: 0 0 0 1px #EF4444; }
.form__textarea { min-height: 120px; resize: vertical; }

.form--light .form__input { background: #fff; border-color: var(--line-sand); color: var(--text-dark); }
.form--light .form__input::placeholder { color: var(--text-muted); }
.form--light .form__input:focus { background: #fff; }

.form__note { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-top: 14px; line-height: 1.6; }
.form--light .form__note { color: var(--text-muted-2); }

.form__submit { position: relative; overflow: hidden; }
.form__submit.is-loading { pointer-events: none; }
.form__submit-line {
  position: absolute;
  inset: 0;
  border-radius: var(--r-btn);
  pointer-events: none;
}

/* success: галочка-каркас */
.form__success { display: none; flex-direction: column; align-items: flex-start; gap: 20px; padding: 8px 0; }
.form__success.is-shown { display: flex; }
.form__success svg { width: 56px; height: 56px; }
.form__success svg path { stroke: var(--green); stroke-width: 3; fill: none; stroke-dasharray: 80; stroke-dashoffset: 80; }
.form__success.is-shown svg path { animation: drawCheck 0.7s var(--ease-out) forwards; }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }
.form__success-text { font-size: 20px; font-weight: 700; color: var(--green); }
.form--light .form__success-text { color: var(--navy); }

/* ============ ФУТЕР ============ */
.footer { position: relative; background: var(--bg-graphite-2); padding: 80px 0 40px; }
.footer__foundation {
  height: 3px;
  background: var(--green);
  box-shadow: 0 0 24px var(--green-glow);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.9s var(--ease-out);
}
.footer__foundation.is-visible { transform: scaleX(1); }
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 56px;
}
.footer__logo { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer__logo-mark { width: 26px; height: 26px; }
.footer__logo-mark .raskos { animation: raskosPulse 3s ease-in-out infinite; }
@keyframes raskosPulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
.footer__brand { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.footer__sub { font-size: 14px; color: var(--text-muted); }
.footer__col--center { display: flex; gap: 24px; padding-top: 6px; }
.footer__link { position: relative; font-family: var(--font-mono); font-size: 13px; color: var(--text); }
.footer__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.footer__link:hover::after { transform: scaleX(1); }
.footer__geo { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); text-align: right; }
.footer__legal {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
}
.footer__legal-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted-2);
  letter-spacing: 0.02em;
}
.footer__legal-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer__legal-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted-2);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.15);
  transition: color 0.2s, text-decoration-color 0.2s;
}
.footer__legal-link:hover {
  color: var(--text-muted);
  text-decoration-color: rgba(255,255,255,0.4);
}
.footer__bottom {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted-2);
}

/* ---- Галочка согласия в формах ---- */
.form__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 4px;
}
.form__consent-check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--green);
  cursor: pointer;
}
.form__consent-text {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.form__consent-link {
  color: var(--green);
  text-decoration: underline;
  text-decoration-color: rgba(62,200,122,0.4);
  transition: text-decoration-color 0.2s;
}
.form__consent-link:hover { text-decoration-color: var(--green); }
.form__consent.is-error {
  outline: 1px solid #E53E3E;
  outline-offset: 4px;
  border-radius: 4px;
}
/* светлая форма (форма разбора) */
.form--light .form__consent-text { color: rgba(26,30,42,0.6); }
.form--light .form__consent-link { color: var(--green); }
