/* ==========================================================================
   STEEL AGENTS — Premium Industrial
   Палитра: графит, чёрный, сталь, серебро, молочно-белый
   ========================================================================== */

:root {
  --ink: #0b0c0e;
  --graphite: #14161a;
  --graphite-2: #1c1f24;
  --steel: #5b6470;
  --steel-soft: #8a929e;
  --silver: #c9ced6;
  --milk: #f3f1ec;
  --cold: #9fb8cc;          /* холодный металлический акцент */
  --line: rgba(201, 206, 214, .14);

  --text: var(--milk);
  --text-dim: rgba(243, 241, 236, .84);
  --bg: var(--ink);
  --bg-alt: var(--graphite);

  --f-display: "Oswald", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: 16px;
  --max: 1280px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out-expo: cubic-bezier(.16, 1, .3, 1);
  --header-h: 72px;
}

/* Светлая тема по системной настройке — акцент на молочно-белый */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: var(--milk);
    --bg-alt: #e7e4dc;
    --text: #000;
    --text-dim: rgba(11, 12, 14, .86);
    --line: rgba(20, 22, 26, .18);
  }
}
:root[data-theme="light"] {
  --bg: var(--milk);
  --bg-alt: #e7e4dc;
  --text: #000;
  --text-dim: rgba(11, 12, 14, .86);
  --line: rgba(20, 22, 26, .18);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, figure, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--cold); color: var(--ink); }

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

.container { width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; }
.section { padding-block: clamp(96px, 14vw, 180px); position: relative; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 1000;
  background: var(--milk); color: var(--ink); padding: 10px 16px; border-radius: 4px;
}
.skip-link:focus { top: 12px; }

/* ---------- Типографика ---------- */
.eyebrow {
  font-size: 12px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--cold); font-weight: 500; margin-bottom: 20px;
}
.display {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(3rem, 8.4vw, 7.6rem);
  line-height: .98;
  letter-spacing: .005em;
  text-transform: uppercase;
}
.lead { font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.5; font-weight: 400; margin-bottom: 24px; }
.section-head { max-width: 860px; margin-bottom: clamp(48px, 7vw, 96px); }
.section-sub { margin-top: 24px; color: var(--text-dim); max-width: 60ch; font-size: 17px; }
.disclaimer { font-size: 14px; color: var(--text-dim); margin-top: 32px; }
.disclaimer--left { margin-top: 32px; padding-left: 14px; border-left: 1px solid var(--line); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 14px 28px; border-radius: 2px;
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase; font-weight: 500;
  border: 1px solid transparent; transition: background .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease), transform .3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn--primary { background: var(--milk); color: var(--ink); }
.btn--ghost { background: transparent; color: inherit; border-color: var(--line); }
.btn--small { min-height: 40px; padding: 10px 18px; font-size: 12px; }
.btn--wide { width: 100%; }
@media (hover: hover) {
  .btn--primary:hover { background: var(--cold); }
  .btn--ghost:hover { background: var(--milk); color: var(--ink); border-color: var(--milk); }
}
.btn:active { transform: scale(.98); }

/* ---------- Загрузчик ---------- */
.loader {
  position: fixed; inset: 0; z-index: 900;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  background: var(--ink); color: var(--milk);
  transition: opacity .8s var(--ease), visibility .8s;
}
.loader__mark {
  font-family: var(--f-display); font-size: clamp(1rem, 3vw, 1.4rem); letter-spacing: .3em;
  animation: loaderIn 1s var(--ease-out-expo) both;
}
.loader__bar { width: min(240px, 60vw); height: 1px; background: var(--line); overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 100%; background: var(--milk); transform-origin: left; animation: loadBar 1.4s var(--ease) forwards; }
.is-loaded .loader { opacity: 0; visibility: hidden; }
@keyframes loaderIn { from { opacity: 0; letter-spacing: .6em; } to { opacity: 1; letter-spacing: .3em; } }
@keyframes loadBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Шапка ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; gap: 32px;
  padding: 0 clamp(16px, 3vw, 40px);
  color: var(--milk);
  transition: transform .5s var(--ease), background .5s var(--ease), backdrop-filter .5s;
}
.site-header.is-scrolled { background: rgba(11, 12, 14, .72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.site-header.is-hidden { transform: translateY(-100%); }
.site-header.is-open { background: var(--ink); }

.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-display); font-size: 14px; letter-spacing: .18em; font-weight: 600; }
.logo__icon { width: 26px; height: 26px; }

.nav { margin-left: auto; }
.nav__list { display: flex; gap: clamp(16px, 2.2vw, 32px); }
.nav__list a {
  font-size: 13px; letter-spacing: .08em; color: var(--text-dim); position: relative; padding: 6px 0;
  transition: color .3s;
}
.nav__list a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease-out-expo);
}
.nav__list a:hover, .nav__list a:focus-visible { color: var(--milk); }
.nav__list a:hover::after { transform: scaleX(1); transform-origin: left; }

.header__cta { flex-shrink: 0; background: var(--milk); color: var(--ink); }
.header__cta:hover { background: var(--cold); }

.burger { display: none; width: 44px; height: 44px; margin-left: auto; background: none; border: 0; position: relative; color: inherit; }
.burger__line { position: absolute; left: 10px; right: 10px; height: 1.5px; background: currentColor; transition: transform .4s var(--ease), opacity .3s; }
.burger__line:nth-of-type(1) { top: 16px; }
.burger__line:nth-of-type(2) { top: 26px; }
.burger[aria-expanded="true"] .burger__line:nth-of-type(1) { transform: translateY(5px) rotate(45deg); }
.burger[aria-expanded="true"] .burger__line:nth-of-type(2) { transform: translateY(-5px) rotate(-45deg); }

/* ---------- HERO ---------- */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 560px;
  display: flex; align-items: flex-end; overflow: hidden;
  color: var(--milk); background: var(--ink);
}
.hero__bg { position: absolute; inset: -12% 0; will-change: transform; }
.hero__bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%;
  animation: kenburns 24s var(--ease) infinite alternate;
  transform-origin: center;
}
.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(11,12,14,.55) 0%, rgba(11,12,14,.05) 30%, rgba(11,12,14,.35) 65%, rgba(11,12,14,.96) 100%),
    linear-gradient(90deg, rgba(11,12,14,.65) 0%, rgba(11,12,14,0) 70%);
}
.hero__content { position: relative; z-index: 1; width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; padding-bottom: clamp(72px, 12vh, 140px); will-change: transform; }
.hero__title {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(3.4rem, 14vw, 12.5rem);
  line-height: .92; letter-spacing: .01em; text-transform: uppercase;
  margin-bottom: 28px;
}
.hero__title .line { display: block; overflow: hidden; padding: .08em 0 .06em; }
.hero__title .line > span { display: block; transform: translateY(105%); }
.hero__title .ch { display: inline-block; transition: transform .6s var(--ease-out-expo), color .4s; transition-delay: calc(var(--i) * 28ms); }
@media (hover: hover) {
  .hero__title:hover .ch { transform: translateY(-.06em) rotate(-4deg); color: var(--cold); }
  .hero__title:hover .ch:nth-child(even) { transform: translateY(.04em) rotate(3deg); }
}
.hero__lead { font-family: var(--f-display); font-size: clamp(1.1rem, 2.2vw, 1.6rem); letter-spacing: .06em; font-weight: 500; text-transform: uppercase; }
.hero__tagline { margin-top: 10px; color: var(--silver); font-size: clamp(1.05rem, 1.7vw, 1.3rem); letter-spacing: .02em; }
.hero__eyebrow { color: var(--silver); }
.hero__eyebrow, .hero__lead, .hero__tagline { opacity: 0; transform: translateY(18px); }

.is-loaded .hero__title .line > span { animation: titleUp 1.3s var(--ease-out-expo) .15s forwards; }
.is-loaded .hero [data-anim="fade"] { animation: fadeUp 1.2s var(--ease-out-expo) forwards; animation-delay: calc(.35s + var(--d, 0s)); }
.is-loaded .hero__eyebrow { animation-delay: .3s; }

.scroll-cue {
  position: absolute; right: clamp(16px, 4vw, 48px); bottom: 36px; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  writing-mode: vertical-rl; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--silver);
  min-height: 44px; justify-content: center;
}
.scroll-cue__line { width: 1px; height: 64px; background: var(--line); position: relative; overflow: hidden; }
.scroll-cue__line span { position: absolute; left: 0; top: 0; width: 100%; height: 40%; background: var(--milk); animation: cueMove 2.2s var(--ease) infinite; }

/* ---------- О компании ---------- */
.about__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(40px, 6vw, 120px); align-items: start; }
.about__text p:not(.lead) { color: var(--text-dim); margin-bottom: 20px; max-width: 60ch; }
.checklist { margin-top: 32px; display: grid; gap: 14px; }
.checklist li { padding-left: 28px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .72em; width: 14px; height: 1px; background: var(--cold); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: clamp(72px, 10vw, 140px); border-top: 1px solid var(--line); }
.stat { padding: 40px 24px 0 0; display: flex; flex-direction: column; gap: 8px; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat__value { font-family: var(--f-display); font-size: clamp(3rem, 7vw, 6rem); font-weight: 600; line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--text-dim); font-size: 17px; }
.stat__note { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--steel-soft); margin-top: 6px; }

/* ---------- Сцены (параллакс) ---------- */
.scene { position: relative; height: 100vh; height: 100svh; min-height: 480px; overflow: hidden; display: flex; align-items: center; background: var(--ink); color: var(--milk); }
.scene--tall { height: 120vh; height: 120svh; }
.scene__bg { position: absolute; inset: -15% 0; will-change: transform; }
.scene__bg img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.6) contrast(1.05); }
.scene::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,12,14,.25), rgba(11,12,14,.7)); pointer-events: none; }
.scene__content { position: relative; z-index: 1; }
.scene__quote { font-family: var(--f-display); font-size: clamp(2.6rem, 8vw, 7rem); font-weight: 600; line-height: 1; letter-spacing: 0; max-width: 16ch; text-transform: uppercase; }
.scene__sub { margin-top: 24px; color: var(--silver); font-size: clamp(1.1rem, 1.8vw, 1.4rem); max-width: 40ch; }

/* ---------- Каталог ---------- */
.catalog { background: var(--bg-alt); }
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.product { display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.product__media { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--graphite); }
.product__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease-out-expo), filter .8s; filter: saturate(.7); }
.product__body { padding: 26px 24px 28px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.product__index { font-family: var(--f-display); font-size: 14px; color: var(--cold); letter-spacing: .1em; }
.product__title { font-family: var(--f-display); font-size: 24px; font-weight: 500; letter-spacing: .02em; line-height: 1.2; text-transform: uppercase; }
.product__desc { color: var(--text-dim); font-size: 16px; flex: 1; }
.product .btn { align-self: flex-start; }
@media (hover: hover) {
  .product:hover .product__media img { transform: scale(1.09); filter: saturate(1); }
  .product:hover { border-color: var(--cold); }
}
.product:active .product__media img { transform: scale(1.04); }

/* ---------- Галерея проектов (горизонтальная) ---------- */
.projects { position: relative; background: var(--ink); color: var(--milk); }
.projects__sticky { position: relative; padding-block: clamp(96px, 12vw, 160px) 40px; overflow: hidden; }
.projects__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: clamp(40px, 6vw, 80px); flex-wrap: wrap; }
.projects__head > div:first-child { display: flex; flex-direction: column; }
.projects__head .eyebrow { margin-bottom: 14px; }
.projects__head .eyebrow { color: var(--cold); }
.projects__hint { max-width: 36ch; font-size: 15px; color: var(--steel-soft); }
.projects__track {
  display: flex; gap: clamp(20px, 3vw, 48px); padding: 0 max(var(--gutter), calc((100vw - var(--max)) / 2));
  will-change: transform;
  overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.projects__track::-webkit-scrollbar { display: none; }
.project { flex: 0 0 clamp(260px, 30vw, 440px); scroll-snap-align: start; display: flex; flex-direction: column; gap: 22px; }
.project__media { position: relative; overflow: hidden; aspect-ratio: 4 / 5; background: var(--graphite-2); }
.project:nth-child(even) .project__media { aspect-ratio: 1 / 1; }
.project:nth-child(3n) .project__media { aspect-ratio: 16 / 11; }
.project__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ease-out-expo), filter .8s; filter: grayscale(.25) contrast(1.05); }
/* Полосы фото (создаются JS на устройствах с курсором): при наведении разъезжаются в стороны */
.project__media.is-sliced img { opacity: 0; }
.project__slice {
  position: absolute; inset: 0; pointer-events: none;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  clip-path: inset(calc(var(--i) * 25%) 0 calc((3 - var(--i)) * 25%) 0);
  filter: grayscale(.25) contrast(1.05);
  transition: transform 1s var(--ease-out-expo), filter .8s;
}
.project__caption { display: grid; gap: 10px; }
.project__no { font-family: var(--f-display); font-size: 15px; color: var(--cold); letter-spacing: .08em; }
.project__caption h3 { font-family: var(--f-display); font-size: 1.6rem; font-weight: 500; letter-spacing: .01em; text-transform: uppercase; line-height: 1.15; }
.project__caption p { color: var(--steel-soft); font-size: 16px; max-width: 42ch; }
@media (hover: hover) {
  .project:hover .project__slice { filter: grayscale(0) contrast(1.05); }
  .project:hover .project__slice:nth-child(odd) { transform: translate3d(-9%, 0, 0); }
  .project:hover .project__slice:nth-child(even) { transform: translate3d(9%, 0, 0); }
  .project:hover .project__media img { filter: grayscale(0) contrast(1.05); }
}
.projects__progress { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 32px; height: 1px; background: var(--line); }
.projects__progress span { display: block; height: 100%; width: 100%; background: var(--milk); transform-origin: left; transform: scaleX(var(--p, 0)); }

/* Включается JS только на десктопе без reduced-motion */
.hscroll-on .projects { height: 380vh; }
.hscroll-on .projects__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-block: 96px 56px; }
.hscroll-on .projects__track { overflow: visible; scroll-snap-type: none; }

/* ---------- Команда ---------- */
.team__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.member { display: flex; flex-direction: column; gap: 8px; }
.member__photo {
  aspect-ratio: 3 / 4; margin-bottom: 14px; position: relative; overflow: hidden;
  background: var(--graphite-2);
}
.member__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; filter: grayscale(.3) contrast(1.05); transition: transform 1.2s var(--ease-out-expo), filter .8s; }
@media (hover: hover) { .member:hover .member__photo img { transform: scale(1.05); filter: grayscale(0); } }
.member__name { font-family: var(--f-display); font-size: 1.5rem; font-weight: 500; letter-spacing: .01em; text-transform: uppercase; line-height: 1.15; }
.member__role { font-size: 15px; color: var(--cold); letter-spacing: .02em; }
.member__bio { font-size: 15px; color: var(--text-dim); }

/* ---------- Science of Steel ---------- */
.science { background: var(--graphite); color: var(--milk); }
.science .section-sub { color: var(--steel-soft); }
.science__block { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 110px); align-items: center; padding-block: clamp(56px, 8vw, 110px); border-top: 1px solid var(--line); }
.science__text h3 { font-family: var(--f-display); font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 500; margin-bottom: 20px; letter-spacing: .01em; text-transform: uppercase; }
.science__text p { color: var(--text-dim); max-width: 56ch; font-size: 17px; }
.science__big { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.big-number { font-family: var(--f-display); font-size: clamp(4.5rem, 14vw, 12rem); font-weight: 700; line-height: .9; letter-spacing: 0; font-variant-numeric: tabular-nums; color: var(--milk); }
.big-unit { font-family: var(--f-display); font-size: clamp(1.1rem, 2vw, 1.6rem); color: var(--cold); text-transform: uppercase; letter-spacing: .04em; }
.big-word { font-family: var(--f-display); font-size: clamp(3.4rem, 10vw, 8.5rem); font-weight: 700; line-height: .95; letter-spacing: 0; text-transform: uppercase; color: transparent; -webkit-text-stroke: 1px var(--silver); }

/* Диаграмма */
.chart { display: grid; gap: 28px; }
.chart__row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; }
.chart__label { font-size: 16px; color: var(--text-dim); grid-column: 1 / -1; display: flex; justify-content: space-between; }
.chart__bar { grid-column: 1 / 2; height: 14px; background: var(--graphite-2); position: relative; overflow: hidden; }
.chart__bar span { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, var(--steel), var(--cold)); transition: width 1.8s var(--ease-out-expo); }
.chart__value { font-family: var(--f-display); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.chart__unit { font-size: 12px; color: var(--steel-soft); grid-column: 2; }
.chart__note { font-size: 13px; color: var(--steel-soft); margin-top: 8px; }

/* Калькулятор */
.calc { display: grid; gap: 28px; background: var(--graphite-2); padding: clamp(24px, 4vw, 40px); border: 1px solid var(--line); }
.calc__field { display: grid; gap: 12px; font-size: 14px; color: var(--text-dim); }
.calc__field output { color: var(--milk); font-family: var(--f-display); font-size: 13px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--cold) var(--fill, 50%), var(--line) var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 2px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 2px; background: var(--cold); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -10px; border-radius: 50%; background: var(--milk); border: 3px solid var(--graphite-2); box-shadow: 0 0 0 1px var(--cold); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--milk); border: 0; }
.calc__results { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--line); padding-top: 24px; }
.calc__results > div { display: grid; gap: 6px; }
.calc__k { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--steel-soft); }
.calc__v { font-family: var(--f-display); font-size: clamp(1.2rem, 2.4vw, 1.8rem); }
.calc__v b { font-weight: 600; font-variant-numeric: tabular-nums; }
.calc__beam { position: relative; height: 56px; border-top: 2px solid var(--silver); margin-inline: 14px; }
.calc__beam::before, .calc__beam::after { content: ""; position: absolute; top: 2px; width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 12px solid var(--silver); transform: translateX(-50%); }
.calc__beam::before { left: 0; }
.calc__beam::after { left: 100%; }
#beam-bend { position: absolute; left: 0; top: 0; height: 2px; width: 100%; }

/* Точность */
.science__big--text { min-height: 120px; }
.tolerance { margin-top: 36px; display: grid; gap: 10px; }
.tolerance__track { position: relative; height: 1px; background: var(--line); }
.tolerance__dot { position: absolute; left: 50%; top: -6px; width: 13px; height: 13px; border-radius: 50%; background: var(--cold); transform: translateX(-50%); animation: wobble 4.5s var(--ease) infinite; }
.tolerance__scale { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--steel-soft); }

/* ---------- Преимущества ---------- */
.advantages__grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(40px, 7vw, 140px); align-items: start; }
.advantages__head { position: sticky; top: 120px; }
.advantages__sub { margin-top: 28px; color: var(--text-dim); max-width: 36ch; }
.advantages__list { border-top: 1px solid var(--line); }
.adv { display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: clamp(28px, 4vw, 44px) 0; border-bottom: 1px solid var(--line); transition: padding .6s var(--ease); }
.adv__no { font-family: var(--f-display); font-size: 13px; color: var(--cold); padding-top: 6px; }
.adv h3 { font-family: var(--f-display); font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 500; margin-bottom: 12px; letter-spacing: .01em; text-transform: uppercase; line-height: 1.1; }
.adv p { color: var(--text-dim); max-width: 52ch; font-size: 17px; }
@media (hover: hover) { .adv:hover { padding-left: 14px; } }

/* ---------- Форма ---------- */
.cta { background: var(--bg-alt); overflow: hidden; }
.cta__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(40px, 7vw, 120px); align-items: start; }
.cta__sub { margin-top: 28px; font-family: var(--f-display); font-size: clamp(1.1rem, 1.9vw, 1.4rem); color: var(--cold); letter-spacing: .03em; text-transform: uppercase; }
.form { display: grid; gap: 26px; background: var(--bg); padding: clamp(24px, 4vw, 48px); border: 1px solid var(--line); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.field { display: grid; gap: 8px; align-content: start; }
.field label { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); font-weight: 500; }
.field label span { color: var(--cold); }
.field input, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; background: transparent;
  border: 1px solid var(--line); border-radius: 0; font-size: 16px; font-weight: 400;
  transition: border-color .3s, background .3s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input::placeholder, .field textarea::placeholder { color: var(--steel-soft); opacity: .8; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--cold); background: rgba(159,184,204,.06); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #e07a6a; }
.field__error { font-size: 14px; color: #c9584a; min-height: 0; }
.field__error:empty { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form__status { font-size: 15px; min-height: 1.5em; }
.form__status.is-error { color: #e07a6a; }
.form__status.is-success { color: var(--cold); }
.btn__spinner { display: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.btn.is-loading .btn__spinner { display: inline-block; }
.btn.is-loading .btn__label { opacity: .6; }
.btn[disabled] { pointer-events: none; opacity: .7; }

/* ---------- Контакты ---------- */
.contacts { background: var(--ink); color: var(--milk); }
.contacts__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(40px, 6vw, 110px); align-items: stretch; }
.contacts__list { margin-top: 40px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.contacts__list > div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.contacts__list dt { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--steel-soft); padding-top: 3px; }
.contacts__list dd { font-size: 19px; }
.contacts__list a { border-bottom: 1px solid transparent; transition: border-color .3s, color .3s; }
@media (hover: hover) { .contacts__list a:hover { border-color: var(--cold); color: var(--cold); } }
.socials { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 10px; }
.socials a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border: 1px solid var(--line); font-size: 13px; letter-spacing: .06em; transition: background .3s, color .3s; }
@media (hover: hover) { .socials a:hover { background: var(--milk); color: var(--ink); } }
.map { position: relative; min-height: 420px; border: 1px solid var(--line); overflow: hidden; background: var(--graphite); }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; filter: grayscale(1) invert(.92) contrast(.9); transition: filter .6s; }
@media (hover: hover) { .map:hover iframe { filter: grayscale(.2) invert(.92) contrast(.95); } }
.map__link { position: absolute; left: 16px; bottom: 16px; z-index: 1; background: var(--milk); color: var(--ink); padding: 12px 16px; font-size: 13px; letter-spacing: .04em; min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- Футер ---------- */
.footer { background: var(--ink); color: var(--milk); border-top: 1px solid var(--line); padding-block: 32px; font-size: 13px; color: var(--steel-soft); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer .logo { color: var(--milk); font-size: 12px; }
.to-top { min-height: 44px; display: inline-flex; align-items: center; color: var(--silver); }

/* ---------- Модальное окно ---------- */
.modal { border: 0; padding: 0; background: transparent; max-width: min(calc(100% - 32px), 640px); width: 100%; color: var(--milk); }
.modal::backdrop { background: rgba(5,6,7,.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal[open] { animation: modalIn .6s var(--ease-out-expo); }
.modal__inner { background: var(--graphite); border: 1px solid var(--line); padding: clamp(28px, 5vw, 48px); display: grid; gap: 18px; position: relative; }
.modal__close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; background: none; border: 0; font-size: 28px; line-height: 1; color: var(--silver); }
.modal__title { font-family: var(--f-display); font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; letter-spacing: -.01em; text-transform: uppercase; }
.modal__text { color: var(--text-dim); }
.modal__list { display: grid; gap: 10px; margin-bottom: 8px; }
.modal__list li { padding-left: 24px; position: relative; color: var(--silver); font-size: 15px; }
.modal__list li::before { content: ""; position: absolute; left: 0; top: .75em; width: 12px; height: 1px; background: var(--cold); }
.modal .btn { justify-self: start; }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Появление при скролле ---------- */
[data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity 1.1s var(--ease-out-expo) var(--d, 0s), transform 1.1s var(--ease-out-expo) var(--d, 0s); }
[data-reveal].is-visible { opacity: 1; transform: none; }
.scene [data-reveal] { transform: translateY(30px); }

/* ---------- Анимации ---------- */
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.12); } }
@keyframes titleUp { to { transform: translateY(0); } }
@keyframes fadeUp { to { opacity: 1; transform: none; } }
@keyframes cueMove { 0% { transform: translateY(-100%); } 100% { transform: translateY(260%); } }
@keyframes wobble { 0%, 100% { left: 50%; } 25% { left: 46%; } 50% { left: 53%; } 75% { left: 48%; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Адаптивность ---------- */
@media (max-width: 1100px) {
  .products { grid-template-columns: repeat(2, 1fr); }
  .team__grid { grid-template-columns: repeat(2, 1fr); }
  .nav__list { gap: 18px; }
  .nav__list a { font-size: 12px; }
}

@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .nav { position: fixed; inset: var(--header-h) 0 auto 0; background: var(--ink); padding: 24px var(--gutter) 32px; border-bottom: 1px solid var(--line); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), transform .4s var(--ease), visibility .4s; margin: 0; }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__list { flex-direction: column; gap: 4px; }
  .nav__list a { display: block; font-size: 16px; padding: 12px 0; color: var(--milk); }
  .header__cta { display: none; }
  .burger { display: block; }
  .about__grid, .cta__grid, .contacts__grid, .advantages__grid, .science__block { grid-template-columns: 1fr; }
  .advantages__head { position: static; }
  .stats { grid-template-columns: 1fr; }
  .stat, .stat + .stat { padding: 28px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
  .science__block--chart .science__text, .science__block--calc .science__text { order: 0; }
  .products { grid-template-columns: 1fr; }
  .product__media { aspect-ratio: 4 / 3; }
  .team__grid { grid-template-columns: repeat(2, 1fr); }
  .scroll-cue { display: none; }
  .projects__sticky { padding-top: 80px; }
  .project { flex-basis: min(78vw, 360px); }
  .projects__progress { position: static; margin: 32px var(--gutter) 0; }
  .projects__track { overflow-x: auto; }
  .map { min-height: 340px; }
}

@media (max-width: 600px) {
  .form__row { grid-template-columns: 1fr; }
  .team__grid { grid-template-columns: 1fr; }
  .team__grid .member__photo { aspect-ratio: 4 / 5; }
  .form__row { gap: 20px; }
  .contacts__list > div { grid-template-columns: 1fr; gap: 6px; }
  .footer__inner { flex-direction: column; text-align: center; }
  .hero__title { font-size: clamp(2.4rem, 13vw, 3.6rem); }
  .hero__lead { font-size: 15px; letter-spacing: .04em; line-height: 1.4; }
  .lead { font-size: 1.1rem; }
  .field input, .field textarea { font-size: 16px; } /* без автозума iOS */
  .btn--wide { min-height: 52px; }
}

/* ---------- Режим пониженной анимации ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .hero__bg img, .scene__bg { transform: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .hero__title .line > span, .hero__eyebrow, .hero__lead, .hero__tagline, .hero [data-anim="fade"] { opacity: 1; transform: none; }
  .loader { display: none; }
  .hscroll-on .projects { height: auto; }
  .hscroll-on .projects__sticky { position: relative; height: auto; }
  .tolerance__dot { animation: none; }
}
