/* Сайты от Невзорова — общие стили: шрифты, темы, кнопки, формы */

@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/unbounded-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/unbounded-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/onest-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/onest-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/onest-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/onest-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Токены: тёмная тема по умолчанию ---------- */
:root {
  --font-display: "Unbounded", "Arial Black", "Segoe UI", sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1240px;
  --header-h: 64px;

  color-scheme: dark;
  --bg: #0a0a0d;
  --bg-soft: #0f0f14;
  --surface: #131319;
  --surface-2: #1b1b23;
  --line: rgb(255 255 255 / .08);
  --line-strong: rgb(255 255 255 / .16);
  --text: #f4f4f6;
  --text-2: #a6a6b3;
  --text-3: #74747f;
  --accent: #c6ff33;
  --accent-ink: #0a0a0d;
  --accent-text: #c6ff33;
  --blue: #3d5cff;
  --blue-text: #8fa0ff;
  --focus: #c6ff33;
  --danger: #ff7a7a;
  --header-bg: rgb(10 10 13 / .72);
  --shadow-card: 0 24px 48px -26px rgb(0 0 0 / .75);
  --shadow-lift: 0 40px 70px -30px rgb(0 0 0 / .85), 0 0 0 1px rgb(198 255 51 / .35);
  --grain: .07;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f3f2ed;
    --bg-soft: #ebeae4;
    --surface: #ffffff;
    --surface-2: #efeee8;
    --line: rgb(12 12 20 / .09);
    --line-strong: rgb(12 12 20 / .18);
    --text: #0b0b10;
    --text-2: #4c4c57;
    --text-3: #6f6f79;
    --accent-text: #3f6d00;
    --blue: #2b47ff;
    --blue-text: #2b47ff;
    --focus: #2b47ff;
    --danger: #c62828;
    --header-bg: rgb(243 242 237 / .8);
    --shadow-card: 0 1px 2px rgb(20 20 40 / .06), 0 24px 48px -30px rgb(20 20 40 / .3);
    --shadow-lift: 0 40px 70px -34px rgb(20 20 40 / .45), 0 0 0 1px rgb(63 109 0 / .4);
    --grain: .05;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f2ed;
  --bg-soft: #ebeae4;
  --surface: #ffffff;
  --surface-2: #efeee8;
  --line: rgb(12 12 20 / .09);
  --line-strong: rgb(12 12 20 / .18);
  --text: #0b0b10;
  --text-2: #4c4c57;
  --text-3: #6f6f79;
  --accent-text: #3f6d00;
  --blue: #2b47ff;
  --blue-text: #2b47ff;
  --focus: #2b47ff;
  --danger: #c62828;
  --header-bg: rgb(243 242 237 / .8);
  --shadow-card: 0 1px 2px rgb(20 20 40 / .06), 0 24px 48px -30px rgb(20 20 40 / .3);
  --shadow-lift: 0 40px 70px -34px rgb(20 20 40 / .45), 0 0 0 1px rgb(63 109 0 / .4);
  --grain: .05;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  transition: background-color .4s, color .4s;
}

img, svg, video, iframe { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

.container {
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 16px; top: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .2s;
}
.skip-link:focus { transform: none; }

/* ---------- Кнопки ---------- */
.btn {
  --h: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: var(--h);
  padding: 0 1.6em;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .3s var(--ease), background-color .25s, border-color .25s, box-shadow .3s, color .25s;
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; transition: transform .35s var(--ease); }
.btn:active { transform: scale(.97); }

.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -12px rgb(198 255 51 / .6); }
.btn--primary:hover svg { transform: translateX(3px); }
.btn--primary.btn--down:hover svg { transform: translateY(3px); }

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

.btn--sm { --h: 42px; padding: 0 1.15em; font-size: .9375rem; }

.icon-btn {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color .25s, border-color .25s, transform .3s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.icon-btn svg { width: 20px; height: 20px; }

/* Переключатель темы: солнце в тёмной, луна в светлой */
.theme-toggle .i-sun { display: block; }
.theme-toggle .i-moon { display: none; }
[data-theme-now="light"] .theme-toggle .i-sun { display: none; }
[data-theme-now="light"] .theme-toggle .i-moon { display: block; }

/* ---------- Кнопки связи ---------- */
.contact-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }

.contact-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 12px 18px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  text-decoration: none;
  transition: transform .3s var(--ease), border-color .25s, background-color .25s;
}
.contact-btn:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.contact-btn__ico {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--c, var(--blue));
  color: #fff;
}
.contact-btn__ico svg { width: 22px; height: 22px; }
.contact-btn__txt { min-width: 0; }
.contact-btn__txt b { display: block; font-weight: 600; font-size: 1.0625rem; }
.contact-btn__txt small { display: block; color: var(--text-2); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-btn__arr { margin-left: auto; width: 20px; height: 20px; flex: none; color: var(--text-3); transition: transform .3s var(--ease), color .25s; }
.contact-btn:hover .contact-btn__arr { transform: translateX(4px); color: var(--text); }
.contact-btn--tg { --c: #229ed9; }
.contact-btn--wa { --c: #1aa64a; }
.contact-btn--ph { --c: var(--blue); }

/* ---------- Форма заявки ---------- */
.lead { position: relative; display: grid; gap: 16px; }
.lead__fields { display: grid; gap: 14px; }

.field { display: grid; gap: 7px; }
.field label { font-size: .875rem; font-weight: 600; color: var(--text-2); }
.input {
  width: 100%;
  height: 58px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--bg);
  font-size: 1rem;
  transition: border-color .2s, box-shadow .2s, background-color .4s;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--text-3); }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 22%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.field__err { margin: 0; color: var(--danger); font-size: .8125rem; font-weight: 600; }

.lead__work {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: .9375rem;
}
.lead__work span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead__work button {
  margin-left: auto;
  width: 30px; height: 30px;
  flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--bg);
  cursor: pointer;
}
.lead__work button svg { width: 14px; height: 14px; }

.lead__submit { width: 100%; }
.lead__submit .spin { display: none; }
.lead[data-state="sending"] .lead__submit { pointer-events: none; opacity: .8; }
.lead[data-state="sending"] .lead__submit .spin { display: block; }
.lead[data-state="sending"] .lead__submit .arr { display: none; }

.lead__note { margin: 0; color: var(--text-3); font-size: .8125rem; text-align: center; }

.lead__done, .lead__fallback { display: grid; gap: 14px; }
.lead__done[hidden], .lead__fallback[hidden] { display: none; }
.lead__done { justify-items: center; text-align: center; padding: 18px 0 6px; }
.lead__done-ico {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  animation: pop .6s var(--ease) both;
}
.lead__done-ico svg { width: 30px; height: 30px; }
.lead__done h3, .lead__fallback h3 { margin: 0; font: 700 1.25rem/1.25 var(--font-display); letter-spacing: -.01em; }
.lead__done p, .lead__fallback p { margin: 0; color: var(--text-2); }
.lead[data-state="done"] .lead__form-part,
.lead[data-state="fallback"] .lead__form-part { display: none; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.spin {
  width: 18px; height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ---------- Уведомление ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 300;
  max-width: calc(100% - 32px);
  padding: 13px 18px;
  border-radius: 16px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: .9375rem;
  box-shadow: 0 20px 40px -16px rgb(0 0 0 / .5);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity .3s, transform .4s var(--ease);
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Появление при прокрутке ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgb(198 255 51 / .55); }
  70% { box-shadow: 0 0 0 9px rgb(198 255 51 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(198 255 51 / 0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}
