/* ==========================================================================
   Металлообработка на станках ЧПУ — общий стиль для обоих сайтов
   Палитра повторяет исходный сайт: #111 / #fff / #f5f5f5 / #efefef + оранжевая кнопка.
   ========================================================================== */

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/onest-cyrillic-wght-normal.woff2") format("woff2-variations");
  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: 100 900;
  font-display: swap;
  src: url("../fonts/onest-latin-wght-normal.woff2") format("woff2-variations");
  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: "Onest", Arial, sans-serif;

  --white: #ffffff;
  --light: #f5f5f5;
  --light-2: #efefef;
  --dark: #111111;
  --dark-2: #222222;

  --text: #000000;
  --text-muted: #555555;
  --line: #dddddd;

  --text-inv: #ffffff;
  --text-inv-muted: #b5b5b5;
  --line-inv: #333333;

  --accent: #f5914f;
  --accent-hover: #e8803c;

  --radius: 3px;
  --container: 1200px;
  --gutter: 20px;
  --header-h: 72px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 600; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding: 0; }
strong, b { font-weight: 600; }
button { font: inherit; color: inherit; }

.icon { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

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

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 14px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 30px;
  border-radius: var(--radius); border: 1px solid transparent;
  font-weight: 500; font-size: 16px; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-hover); }
.btn--ghost { border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn--ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .1); }
.btn .icon { width: 18px; height: 18px; }

/* ---------- Шапка ---------- */

.header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: var(--white);
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.header__inner { height: 100%; display: flex; align-items: center; gap: 28px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: 0 1 auto; min-width: 0; }
.brand__mark { width: 36px; height: 36px; border-radius: var(--radius); background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.brand__mark .icon { width: 22px; height: 22px; stroke-width: 1.75; }
.brand__name { font-weight: 500; font-size: 15px; line-height: 1.25; max-width: 250px; }

.nav { margin-left: auto; }
.nav__list { list-style: none; display: flex; align-items: center; gap: 2px; }
.nav__link {
  display: block; padding: 8px 12px;
  font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  text-decoration: none; color: var(--text);
  background: none; border: 0; cursor: pointer;
  transition: color .2s;
}
.nav__link:hover { color: var(--accent); }

.nav__dropdown { position: relative; }
.nav__dropdown > .nav__link { display: inline-flex; align-items: center; gap: 4px; }
.nav__dropdown > .nav__link .icon { width: 14px; height: 14px; transition: transform .2s; }
.nav__submenu {
  list-style: none; position: absolute; top: 100%; left: 0; min-width: 290px;
  background: var(--white); padding: 10px 0; border-top: 2px solid var(--accent);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .08);
  opacity: 0; visibility: hidden; transition: opacity .15s, visibility .15s;
}
.nav__dropdown:hover .nav__submenu,
.nav__dropdown:focus-within .nav__submenu,
.nav__dropdown.is-open .nav__submenu { opacity: 1; visibility: visible; }
.nav__dropdown:hover > .nav__link .icon,
.nav__dropdown.is-open > .nav__link .icon { transform: rotate(180deg); }
.nav__submenu .nav__link { padding: 10px 20px; }

.header__phone { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 16px; text-decoration: none; white-space: nowrap; }
.header__phone .icon { width: 18px; height: 18px; color: var(--accent); }
.header__cta { min-height: 42px; padding: 8px 20px; font-size: 14px; }

.burger { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; background: none; color: var(--text); cursor: pointer; }
.burger .icon { width: 26px; height: 26px; margin: auto; }
.burger .icon-close { display: none; }

@media (max-width: 1240px) {
  .header__cta { display: none; }
}

@media (max-width: 1040px) {
  .burger { display: grid; margin-left: 0; }
  .header__phone { margin-left: auto; }
  .nav {
    position: fixed; inset: var(--header-h) 0 0 0; margin: 0;
    background: var(--white); overflow-y: auto;
    padding: 12px var(--gutter) 40px;
    opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
  }
  .nav-open .nav { opacity: 1; visibility: visible; }
  .nav-open .burger .icon-menu { display: none; }
  .nav-open .burger .icon-close { display: block; }
  .nav-open { overflow: hidden; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__link { font-size: 15px; padding: 16px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
  .nav__dropdown > .nav__link { display: none; }
  .nav__submenu { position: static; opacity: 1; visibility: visible; background: none; border: 0; padding: 0; min-width: 0; }
  .nav__submenu .nav__link { padding: 16px 0; }
  .nav__mobile-contacts { display: flex !important; }
}
.nav__mobile-contacts { display: none; flex-direction: column; gap: 12px; margin-top: 28px; }
.nav__mobile-contacts .btn { width: 100%; }
.nav__mobile-contacts .btn--ghost { border-color: var(--line); color: var(--text); }
.nav__mobile-contacts .btn--ghost:hover { border-color: var(--text); background: none; }

@media (max-width: 600px) {
  .header__phone { display: none; }
  .burger { margin-left: auto; }
  .brand__name { font-size: 14px; }
}

/* ---------- Первый экран ---------- */

.hero {
  position: relative; color: #fff; isolation: isolate;
  min-height: calc(100vh - var(--header-h));
  max-height: 900px;
  display: flex; align-items: center;
  padding: 80px 0;
  background: var(--dark);
}
.hero__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(0, 0, 0, .6); }
.hero__content { max-width: 760px; }
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); font-weight: 600; margin-bottom: 24px; }
.hero__lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: rgba(255, 255, 255, .85); max-width: 620px; margin-bottom: 36px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Секции ---------- */

.section { padding: clamp(60px, 8vw, 90px) 0; }
.section--light { background: var(--light); }
.section--dark { background: var(--dark); color: var(--text-inv); }
.section--dark-2 { background: var(--dark-2); color: var(--text-inv); }

.section__title { font-size: clamp(1.75rem, 3.4vw, 2.5rem); margin-bottom: clamp(28px, 4vw, 44px); }
.section__title--center { text-align: center; }
.section__sub { display: block; font-size: .6em; font-weight: 400; margin-top: 8px; }

.muted { color: var(--text-muted); }
.section--dark .muted, .section--dark-2 .muted { color: var(--text-inv-muted); }

/* О компании */
.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 80px); }
.about__text p { color: var(--text-muted); }
.about__text p:first-child { color: var(--text); font-size: 19px; }
.about__price { margin-top: 28px; padding-left: 18px; border-left: 3px solid var(--accent); color: var(--text-muted); }
.about__price b { display: block; font-size: 24px; font-weight: 500; color: var(--text); }
.about__list { list-style: none; }
.about__list li { padding: 20px 0; border-top: 1px solid var(--line); }
.about__list li:first-child { padding-top: 0; border-top: 0; }
.about__list h3 { font-size: 18px; margin-bottom: 6px; }
.about__list p { font-size: 15px; color: var(--text-muted); }

/* Услуги */
.service { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
.service--reverse .service__media { order: -1; }
.service__text .section__title { margin-bottom: 20px; }
.service__text p { color: var(--text-muted); }
.section--dark .service__text p { color: var(--text-inv-muted); }
.service__text p strong { color: var(--text); }
.section--dark .service__text p strong { color: var(--text-inv); }
.machine { font-weight: 500; color: var(--text); }
.section--dark .machine { color: var(--text-inv); }
.list { list-style: none; display: grid; gap: 6px; margin: 0 0 1em; }
.list li { position: relative; padding-left: 20px; }
.list li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; background: var(--accent); }
.section--dark .list li { color: var(--text-inv-muted); }
.list strong { color: inherit; }
.section--dark .list strong { color: var(--text-inv); }

/* Галерея */
.gallery__main { display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; overflow: hidden; background: #ccc; aspect-ratio: 4 / 3; }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.gallery__thumb { padding: 0; border: 0; cursor: pointer; aspect-ratio: 4 / 3; background: #ccc; opacity: .5; transition: opacity .2s; position: relative; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb:hover { opacity: .85; }
.gallery__thumb.is-active { opacity: 1; }
.gallery__thumb.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); }

/* Характеристики — простые колонки, как на исходном сайте */
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px 48px; margin-top: clamp(40px, 5vw, 60px); padding-top: clamp(32px, 4vw, 44px); border-top: 1px solid var(--line); }
.section--dark .specs { border-top-color: var(--line-inv); }
.spec h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.spec ul { list-style: none; display: grid; gap: 4px; font-size: 15px; }
.spec ul li { position: relative; padding-left: 16px; }
.spec ul li::before { content: "•"; position: absolute; left: 0; color: var(--accent); }
.spec p { font-size: 15px; }
.spec dl { margin: 0; font-size: 15px; }
.spec dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.section--dark .spec dl div { border-bottom-color: var(--line-inv); }
.spec dt { color: var(--text-muted); }
.section--dark .spec dt, .section--dark .spec ul, .section--dark .spec p { color: var(--text-inv-muted); }
.spec dd { margin: 0; font-weight: 500; white-space: nowrap; text-align: right; }

/* Иконки с подписями */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 32px; }
.feature { text-align: center; }
.feature .icon { width: 48px; height: 48px; stroke-width: 1.25; margin: 0 auto 18px; }
.feature h3 { font-size: 17px; font-weight: 500; margin-bottom: 8px; }
.feature p { font-size: 15px; color: var(--text-muted); }

/* Вакансии */
.job { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: start; max-width: 900px; }
.job > .icon { width: 72px; height: 72px; stroke-width: 1.1; }
.job h3 { font-size: 24px; margin-bottom: 4px; }
.job__type { color: var(--text-muted); margin-bottom: 16px; }
.job .list { margin-bottom: 24px; }

/* Форма */
.form { max-width: 760px; margin: 0 auto; }
.form__grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form__field--wide { grid-column: 1 / -1; }
.form input[type="text"],
.form input[type="tel"],
.form input[type="email"],
.form textarea {
  width: 100%; font: inherit; font-size: 16px; font-weight: 400; color: var(--text);
  background: #fff; border: 1px solid #fff; border-radius: var(--radius);
  padding: 14px 16px;
}
.form textarea { min-height: 110px; resize: vertical; }
.form input::placeholder, .form textarea::placeholder { color: #8a8a8a; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.form__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 16px; }
.form__consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-inv-muted); cursor: pointer; max-width: 440px; }
.form__consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.form__consent a { color: var(--text-inv); }
.form__status { margin-top: 14px; font-size: 15px; min-height: 1.5em; text-align: center; }
.form__status.is-error { color: #ff8a80; }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form.is-sent .form__body { display: none; }
.form__done { display: none; text-align: center; padding: 20px 0; }
.form.is-sent .form__done { display: block; }
.form__done h3 { font-size: 24px; margin-bottom: 8px; }

/* Подвал — контакты, как на исходном сайте */
.footer { background: var(--light-2); text-align: center; padding: clamp(60px, 8vw, 90px) 0 0; }
.footer__contacts { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 36px; }
.footer__big { font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-weight: 500; text-decoration: none; border-bottom: 3px solid var(--accent); line-height: 1.25; }
.footer__big:hover { color: var(--accent-hover); }
.footer__tg { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 16px; font-weight: 400; text-decoration: none; }
.footer__tg .icon { width: 20px; height: 20px; color: var(--accent); }
.footer__tg:hover { text-decoration: underline; }
.footer__req { font-size: 14px; color: var(--text-muted); line-height: 1.7; }
.footer__req p { margin: 0; }
.footer__req b { font-weight: 500; color: var(--text); }
.footer__req .gap { margin-top: 14px; }
.footer__bottom { margin-top: 48px; padding: 20px 0; background: var(--dark); color: var(--text-inv-muted); font-size: 13px; }
.footer__bottom .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }
.footer__bottom a { color: var(--text-inv-muted); }
.footer__bottom a:hover { color: #fff; }

/* Лайтбокс */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(0, 0, 0, .92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox__img { max-width: calc(100vw - 32px); max-height: calc(100vh - 120px); width: auto; height: auto; object-fit: contain; }
.lightbox__btn { position: fixed; width: 48px; height: 48px; border: 0; cursor: pointer; background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; }
.lightbox__btn:hover { background: rgba(255, 255, 255, .2); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__count { position: fixed; bottom: 20px; left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, .7); font-size: 14px; }

/* Простые страницы (политика, 404) */
.page { padding: clamp(48px, 8vw, 90px) 0; }
.page .container { max-width: 820px; }
.page h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 24px; }
.page h2 { font-size: 20px; margin: 32px 0 12px; }
.page p, .page li { color: var(--text-muted); }
.page ul { padding-left: 22px; margin-bottom: 1em; }
.page--center { text-align: center; min-height: 60vh; display: flex; align-items: center; }
.page--center .btn { margin-top: 24px; }

/* Появление при прокрутке — едва заметное. Только если JS работает, иначе блоки видны сразу. */
.js .reveal { opacity: 0; transition: opacity .7s ease; }
.js .reveal.is-visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transition: none; } }

/* ---------- Адаптив ---------- */

@media (max-width: 1000px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .about, .service { grid-template-columns: 1fr; }
  .service--reverse .service__media { order: 0; }
  .service__media { order: 2; }
  .form__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero { min-height: auto; padding: 64px 0; }
  .hero__actions .btn { flex: 1 1 100%; }
  .features { grid-template-columns: 1fr; }
  .form__grid { grid-template-columns: 1fr; }
  .form__bottom .btn { width: 100%; }
  .job { grid-template-columns: 1fr; gap: 16px; }
  .job > .icon { width: 56px; height: 56px; }
  .spec dl div { flex-direction: column; gap: 0; }
  .spec dd { text-align: left; white-space: normal; }
}
