/* =========================================================
   RenCAD — лендинг
   Тёмная «чертёжная» тема: синяя сетка, тонкие линии, моноширинные акценты.
   ========================================================= */

:root {
  --bg:        #0b0f16;
  --bg-alt:    #0e141d;
  --surface:   #121a25;
  --surface-2: #17212e;
  --line:      #22303f;
  --line-soft: #1a2532;

  --text:      #e6edf5;
  --text-dim:  #9fb0c3;
  --text-mute: #6b7d92;

  --accent:    #4da3ff;
  --accent-2:  #7ee0c0;
  --accent-dim:#2b6cb0;
  --danger:    #ff6b6b;

  --radius:    14px;
  --radius-sm: 9px;
  --wrap:      1160px;
  --gutter:    16px;

  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 650; }
h3 { font-size: 1.12rem; font-weight: 600; }
p  { margin: 0 0 1em; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 760px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #05080d; padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------------- Шапка ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 15, 22, .72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background .25s;
}
.nav--scrolled { border-bottom-color: var(--line); background: rgba(11, 15, 22, .92); }

.nav__inner { display: flex; align-items: center; gap: 24px; height: 68px; }

.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo__mark {
  width: 22px; height: 22px; flex: none;
  border: 2px solid var(--accent);
  border-radius: 4px;
  position: relative;
}
.logo__mark::after {
  content: ""; position: absolute; inset: 4px 4px auto auto;
  width: 6px; height: 6px; background: var(--accent-2); border-radius: 1px;
}
.logo__text { font-size: 1.12rem; letter-spacing: .04em; font-weight: 400; }
.logo__text strong { font-weight: 700; }

.nav__links { display: flex; gap: 26px; margin-left: auto; }
.nav__links a { color: var(--text-dim); font-size: .95rem; }
.nav__links a:hover { color: var(--text); text-decoration: none; }

.nav__burger {
  display: none; margin-left: auto;
  width: 40px; height: 40px; padding: 9px;
  background: none; border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav__burger span { display: block; height: 2px; background: var(--text); margin: 3px 0; border-radius: 2px; }

/* ---------------- Кнопки ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .98rem; font-weight: 550; color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: transform .15s, background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--accent-dim); }
.btn:active { transform: translateY(0); }
.btn--primary {
  background: linear-gradient(180deg, var(--accent) 0%, #3b8ce0 100%);
  border-color: transparent; color: #05101c; font-weight: 650;
  box-shadow: 0 6px 24px -10px rgba(77, 163, 255, .9);
}
.btn--primary:hover { box-shadow: 0 10px 30px -10px rgba(77, 163, 255, .95); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 9px 18px; font-size: .9rem; }
.btn--wide { width: 100%; padding: 15px; font-size: 1.02rem; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------------- Hero ---------------- */
.hero { position: relative; padding: clamp(70px, 11vw, 130px) 0 clamp(50px, 8vw, 90px); overflow: hidden; }
.hero__grid {
  position: absolute; inset: -40% -10% auto -10%; height: 150%;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 22%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 22%, #000 0%, transparent 72%);
  opacity: .8;
  pointer-events: none;
}
.hero__inner { position: relative; }

.eyebrow {
  font-family: var(--mono);
  font-size: .8rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-2); margin-bottom: 14px;
}

.lead { font-size: clamp(1.02rem, 1.5vw, 1.2rem); color: var(--text-dim); max-width: 680px; }
.lead--narrow { max-width: 620px; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 48px; }

.hero__stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin: 0; padding-top: 30px; border-top: 1px solid var(--line);
  max-width: 820px;
}
.hero__stats dt { font-family: var(--mono); font-size: 1.22rem; color: var(--text); margin-bottom: 4px; }
.hero__stats dd { margin: 0; font-size: .9rem; color: var(--text-mute); line-height: 1.45; }

/* ---------------- Секции ---------------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--tight { padding-block: clamp(44px, 6vw, 72px); }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line-soft); }

/* ---------------- Карточки ---------------- */
.cards { display: grid; gap: 18px; margin-top: 36px; }
.cards--3 { grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: border-color .25s, transform .25s, background .25s;
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-3px); }
.card p { margin: 0; color: var(--text-dim); font-size: .95rem; }
.card--plain { background: transparent; }
.card__icon {
  display: inline-block; font-family: var(--mono); font-size: .8rem;
  color: var(--accent); letter-spacing: .1em; margin-bottom: 14px;
}

/* ---------------- Сравнение до/после ---------------- */
.compare {
  position: relative; margin: 38px 0 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--surface);
  user-select: none;
}
.compare__img { width: 100%; height: auto; display: block; }
.compare__after {
  position: absolute; inset: 0; width: 50%;
  overflow: hidden;
  border-right: 2px solid var(--accent);
}
.compare__after .compare__img {
  /* ширина контейнера режется, картинка внутри остаётся в полный размер */
  width: var(--compare-w, 100%);
  max-width: none;
}
.compare__range {
  position: absolute; inset: auto 0 0 0; width: 100%;
  margin: 0; padding: 0;
  height: 100%;
  opacity: 0; cursor: ew-resize;
}
.compare__range:focus-visible { opacity: .01; outline: 2px solid var(--accent); }
.compare__handle {
  position: absolute; top: 50%; left: 50%;
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 2px 14px rgba(0, 0, 0, .55);
  pointer-events: none;
}
.compare__handle::before,
.compare__handle::after {
  content: ""; position: absolute; top: 50%; width: 0; height: 0;
  border-block: 5px solid transparent;
}
.compare__handle::before { left: 9px;  margin-top: -5px; border-right: 6px solid #05101c; }
.compare__handle::after  { right: 9px; margin-top: -5px; border-left:  6px solid #05101c; }

.compare__caption {
  display: flex; justify-content: space-between;
  padding: 10px 16px; font-family: var(--mono); font-size: .78rem;
  color: var(--text-mute); letter-spacing: .1em; text-transform: uppercase;
  border-top: 1px solid var(--line); background: var(--bg-alt);
}

/* ---------------- Цифры ---------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-top: 40px; }
.stat {
  padding: 22px 20px; border-left: 2px solid var(--accent-dim);
  background: linear-gradient(90deg, rgba(77, 163, 255, .06), transparent 70%);
}
.stat b { display: block; font-family: var(--mono); font-size: 2.1rem; color: var(--text); line-height: 1; margin-bottom: 8px; }
.stat span { font-size: .92rem; color: var(--text-dim); }

/* ---------------- Видео ---------------- */
.player {
  position: relative; margin-top: 34px;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #000;
  aspect-ratio: 16 / 9;
}
.player__video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.player__fallback { color: var(--text-dim); padding: 20px; }

.player__play {
  position: absolute; inset: 0; margin: auto;
  width: 84px; height: 84px;
  border: none; border-radius: 50%;
  background: rgba(77, 163, 255, .93);
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 10px 40px -8px rgba(0, 0, 0, .8);
  transition: transform .2s, background .2s, opacity .25s;
}
.player__play:hover { transform: scale(1.06); background: var(--accent); }
.player__play[hidden] { display: none; }
.player__triangle {
  width: 0; height: 0; margin-left: 5px;
  border-block: 14px solid transparent;
  border-left: 23px solid #05101c;
}
.player__missing {
  position: absolute; inset: auto 0 0 0;
  margin: 0; padding: 14px 18px;
  background: rgba(11, 15, 22, .92);
  color: var(--text-dim); font-size: .88rem; text-align: center;
  border-top: 1px solid var(--line);
}
.player__missing code { font-family: var(--mono); color: var(--accent-2); font-size: .85em; }

/* ---------------- Шаги ---------------- */
.steps {
  list-style: none; margin: 36px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px;
}
.step { position: relative; padding-top: 20px; border-top: 1px solid var(--line); }
.step__n {
  display: block; font-family: var(--mono); font-size: .82rem;
  color: var(--accent); letter-spacing: .12em; margin-bottom: 10px;
}
.step p { margin: 0; color: var(--text-dim); font-size: .94rem; }

/* ---------------- Форма ---------------- */
.form { margin-top: 32px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.field { display: block; margin-bottom: 16px; }
.field__label { display: block; font-size: .86rem; color: var(--text-dim); margin-bottom: 7px; }
.field__label i { color: var(--accent); font-style: normal; }
.field__input {
  width: 100%; padding: 13px 15px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 1rem;
  transition: border-color .2s, background .2s;
}
.field__input:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }
.field__input::placeholder { color: var(--text-mute); }
.field__input--area { resize: vertical; min-height: 110px; }
.field--error .field__input { border-color: var(--danger); }

.form__hint { font-size: .84rem; color: var(--text-mute); margin: -6px 0 18px; }

.check { display: flex; gap: 11px; align-items: flex-start; margin: 6px 0 22px; font-size: .9rem; color: var(--text-dim); }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }

/* honeypot: невидим для человека, но доступен боту */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__status { margin-top: 14px; font-size: .94rem; min-height: 1.4em; }
.form__status--ok { color: var(--accent-2); }
.form__status--err { color: var(--danger); }

/* ---------------- Подвал ---------------- */
.footer { border-top: 1px solid var(--line); padding: 34px 0; background: var(--bg-alt); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.footer__note { margin: 0; color: var(--text-mute); font-size: .88rem; }
.footer__links { margin-left: auto; }
.footer__links a { color: var(--text-mute); font-size: .86rem; }

/* ---------------- Появление при скролле ----------------
   Прячем блоки только если JS действительно работает (класс .js ставит
   app.js первой строкой). Без скрипта страница просто показывается целиком,
   а не остаётся пустой. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal--in { opacity: 1; transform: none; }

/* ---------------- Адаптив ---------------- */
@media (max-width: 860px) {
  .nav__links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg-alt); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px;
    display: none;
  }
  .nav__links--open { display: flex; }
  .nav__links a { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  .nav__burger { display: block; order: 3; margin-left: 0; }
  .nav__inner > .btn { margin-left: auto; }
  .hero__stats { grid-template-columns: 1fr; gap: 18px; }
  .form__row { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card { transition: none; }
}
