:root {
  --bg: #0d1013;
  --bg-soft: #141a20;
  --card: #171e25;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .22);
  --text: #eef2f6;
  --muted: #98a4b2;
  --accent: #ff7a18;
  --accent-2: #ffb35c;
  --steel: #4ea3ff;
  --mint: #35d6b0;
  --radius: 14px;
  --shadow: 0 22px 50px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 85% -12%, rgba(255, 122, 24, .14), transparent 62%),
    radial-gradient(900px 460px at 5% 0%, rgba(78, 163, 255, .10), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.65 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }

/* ---------- шапка ---------- */
.top {
  border-bottom: 1px solid var(--line);
  background: rgba(13, 16, 19, .72);
  backdrop-filter: blur(12px);
}
.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #ff4d00);
  box-shadow: 0 0 22px rgba(255, 122, 24, .45);
  flex: none;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__phone { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.brand__phone:hover { color: var(--accent-2); }
.brand__text small { color: var(--muted); font-size: 12.5px; }
.top__mail { color: var(--muted); font-size: 15px; }

/* ---------- вкладки ---------- */
.tabs {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(13, 16, 19, .9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.tabs__inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 0;
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  padding: 16px 18px 16px 58px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .012));
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform .18s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
}
.tab:hover { transform: translateY(-3px); border-color: var(--accent); }
.tab__num {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 15px;
  color: var(--muted);
  transition: background .22s ease, color .22s ease, border-color .22s ease;
}
.tab__label { font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.tab__hint { font-size: 13px; color: var(--muted); }

.tab.is-active {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 122, 24, .20), rgba(255, 122, 24, .06));
  box-shadow: 0 14px 34px rgba(255, 122, 24, .20);
}
.tab.is-active .tab__num {
  background: linear-gradient(135deg, var(--accent), #ff4d00);
  border-color: transparent;
  color: #fff;
}
.tab.is-active .tab__hint { color: var(--accent-2); }
.tab:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

/* ---------- панели с фонами ---------- */
.panel {
  position: relative;
  overflow: hidden;
  padding: 46px 0 72px;
  border-bottom: 1px solid var(--line);
}
.panel[hidden] { display: none; }
.panel:focus { outline: none; }

/* Слои снизу вверх: SVG-фон (всегда есть) → фото (если положили) → затемнение.
   Порядок в background-image: первый слой рисуется поверх остальных. */
.panel__bg {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  pointer-events: none;
}
.panel--machines .panel__bg {
  background-image:
    linear-gradient(180deg, rgba(13, 16, 19, .62), rgba(13, 16, 19, .82) 55%, rgba(13, 16, 19, .96)),
    url('img/machines.jpg'),
    url('img/bg-machines.svg');
}
.panel--cnc .panel__bg {
  background-image:
    linear-gradient(180deg, rgba(13, 16, 19, .64), rgba(13, 16, 19, .84) 55%, rgba(13, 16, 19, .96)),
    url('img/cnc.jpg'),
    url('img/bg-cnc.svg');
}
.panel--weld .panel__bg {
  background-image:
    linear-gradient(180deg, rgba(13, 16, 19, .58), rgba(13, 16, 19, .80) 55%, rgba(13, 16, 19, .96)),
    url('img/weld.jpg'),
    url('img/bg-weld.svg');
}
.panel__inner { position: relative; z-index: 1; }

/* ---------- герой ---------- */
.hero { padding: 12px 0 8px; }
.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid rgba(255, 122, 24, .35);
  background: rgba(255, 122, 24, .08);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 20px;
}
.hero h1 { font-size: clamp(28px, 4.6vw, 50px); max-width: 22ch; }
.lead { font-size: clamp(15.5px, 1.6vw, 18px); color: var(--muted); max-width: 68ch; }

/* ---------- ряд контактов: почта · telegram · телефон ---------- */
.contact-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 960px;
  margin: 30px auto 0;
}
.cbtn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(20, 26, 33, .88);
  backdrop-filter: blur(4px);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .2s ease, box-shadow .22s ease;
}
.cbtn:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.cbtn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.cbtn__ico {
  width: 42px; height: 42px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  font-size: 19px;
  background: rgba(255, 255, 255, .07);
}
.cbtn__body { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.cbtn__title { font-size: 16.5px; font-weight: 650; }
.cbtn__sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

.cbtn--mail .cbtn__ico { background: rgba(78, 163, 255, .16); color: var(--steel); }
.cbtn--tg { border-color: rgba(255, 122, 24, .5); }
.cbtn--tg .cbtn__ico { background: rgba(255, 122, 24, .16); color: var(--accent-2); }
.cbtn--tel .cbtn__ico { background: rgba(53, 214, 176, .15); color: var(--mint); }

/* состояние "адрес скопирован" */
.cbtn.is-copied { border-color: var(--mint); }
.cbtn.is-copied .cbtn__ico { background: rgba(53, 214, 176, .18); color: var(--mint); }
.cbtn.is-copied .cbtn__sub { color: var(--mint); font-weight: 600; }

/* ---------- всплывающее уведомление ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  max-width: calc(100% - 32px);
  padding: 12px 22px;
  border: 1.5px solid var(--mint);
  border-radius: 999px;
  background: #1b2430;
  color: var(--text);
  font-size: 14.5px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity .24s ease, transform .24s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- этапы ---------- */
.h2 { font-size: clamp(20px, 2.4vw, 28px); margin-top: 40px; }
.steps { counter-reset: s; display: grid; gap: 12px; margin-top: 18px; }
.steps li {
  position: relative;
  counter-increment: s;
  padding: 16px 18px 16px 62px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--muted);
  transition: border-color .2s ease, transform .18s ease;
}
.steps li:hover { border-color: var(--line-strong); transform: translateX(3px); }
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 16px; top: 16px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(255, 122, 24, .14);
  border: 1px solid rgba(255, 122, 24, .4);
  color: var(--accent-2);
  font-weight: 700;
  font-size: 14px;
}
.steps b { color: var(--text); }

/* ---------- чипсы ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chips li {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 14.5px;
  transition: border-color .2s ease, color .2s ease;
}
.chips li:hover { border-color: var(--accent); color: var(--text); }

/* ---------- карточки услуг ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 26px 0 8px;
}
.card {
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: transform .2s ease, border-color .2s ease, box-shadow .24s ease;
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 122, 24, .55);
  box-shadow: var(--shadow);
}
.card h3 { font-size: 19px; }
.card p { color: var(--muted); margin: 0; font-size: 15px; }

/* ---------- заголовок вкладки ---------- */
.h1-hero { font-size: clamp(30px, 5vw, 54px); max-width: 20ch; }

/* ---------- подвал ---------- */
.foot { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: 14px; }
.foot__inner { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.foot__legal { margin-top: 10px; font-size: 12px; color: var(--muted); opacity: .72; }

/* ---------- перекрёстная ссылка между услугами ---------- */
.note {
  margin-top: 34px;
  padding: 18px 20px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(255, 122, 24, .10);
  backdrop-filter: blur(3px);
  color: var(--muted);
  font-size: 15px;
}
.note a { color: var(--accent-2); border-bottom: 1px solid rgba(255, 122, 24, .5); }
.note a:hover { color: var(--text); border-color: var(--accent); }

/* ---------- полупрозрачные блоки поверх фоновых картинок ---------- */
.card,
.steps li,
.chips li {
  background: rgba(20, 26, 33, .84);
  backdrop-filter: blur(3px);
}

/* ---------- адаптив ---------- */
@media (max-width: 860px) {
  .contact-row { max-width: 620px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-row .cbtn--tel { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .tabs__inner { grid-template-columns: 1fr; gap: 8px; }
  .tab { padding: 12px 14px 12px 52px; }
  .top__mail { display: none; }
  .panel { padding: 26px 0 48px; }
}
@media (max-width: 560px) {
  .contact-row { grid-template-columns: 1fr; max-width: 420px; }
  .contact-row .cbtn--tel { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
