/* =========================================================
   ДЕЛЮКС — base system
   Engineering / paper / orange
   ========================================================= */

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/Montserrat-var.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-var.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #f3f1ec;
  --paper-2: #e9e6de;
  --paper-3: #dedad0;
  --ink: #141619;
  --ink-2: #22262b;
  --steel: #58626c;
  --muted: #7c848c;
  --orange: #ed7d31;
  --orange-2: #ff9a52;
  --orange-3: #c85f1d;
  --line: rgba(20, 22, 25, 0.14);
  --line-soft: rgba(20, 22, 25, 0.08);
  --line-dark: rgba(243, 241, 236, 0.16);
  --dark: #0e1013;
  --dark-2: #15181c;
  --display: "Montserrat", "Segoe UI", sans-serif;
  --body: "Inter", "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-2: cubic-bezier(0.76, 0, 0.24, 1);
  --container: min(1360px, calc(100% - clamp(32px, 8vw, 128px)));
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.62;
  letter-spacing: 0.005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
h1, h2, h3, h4, blockquote, figure { margin: 0; }
::selection { background: var(--orange); color: #fff; }

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

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--paper-2); }
::-webkit-scrollbar-thumb { background: var(--ink-2); border-radius: 8px; }

/* ---------- utility ---------- */
.container { width: var(--container); margin: 0 auto; }
.section { position: relative; padding: clamp(72px, 9vw, 140px) 0; }
.section--tight { padding: clamp(52px, 6vw, 92px) 0; }
.dark { background: var(--dark); color: var(--paper); }
.dark .lead, .dark p { color: rgba(243, 241, 236, 0.72); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--orange);
}
.dark .eyebrow { color: rgba(243, 241, 236, 0.62); }

.display {
  font-family: var(--display);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-size: clamp(38px, 5.4vw, 84px);
  text-wrap: balance;
}
.h2 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-size: clamp(30px, 3.6vw, 54px);
  text-wrap: balance;
}
.h3 {
  font-family: var(--display);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-size: clamp(21px, 2vw, 28px);
}
.lead {
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.62;
  color: var(--steel);
  max-width: 62ch;
  text-wrap: pretty;
}
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.accent { color: var(--orange); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: clamp(36px, 5vw, 72px);
}
.section-head__text { max-width: 760px; }
.section-head .h2 { margin-top: 18px; }
.section-head .lead { margin-top: 20px; }
.section-head__aside { flex: 0 0 auto; text-align: right; }

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 30px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  overflow: hidden;
  transition: color .45s var(--ease), border-color .45s var(--ease), background .45s var(--ease);
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform .55s var(--ease-2);
  z-index: 0;
}
.btn span, .btn svg { position: relative; z-index: 1; }
.btn:hover::after { transform: translateY(0); }
.btn--solid { background: var(--orange); color: #fff; }
.btn--solid::after { background: var(--ink); }
.btn--solid:hover { color: #fff; }
.btn--ghost { border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { color: var(--paper); border-color: var(--ink); }
.hero .btn--ghost { color: var(--paper); border-color: rgba(243,241,236,.45); }
.hero .btn--ghost::after { background: var(--paper); }
.hero .btn--ghost:hover { color: var(--ink); border-color: var(--paper); }
.dark .btn--ghost { border-color: var(--line-dark); color: var(--paper); }
.dark .btn--ghost::after { background: var(--paper); }
.dark .btn--ghost:hover { color: var(--ink); border-color: var(--paper); }
.btn--light { background: var(--paper); color: var(--ink); }
.btn--light::after { background: var(--orange); }
.btn--light:hover { color: #fff; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  transition: color .3s, border-color .3s;
}
.link-arrow svg { width: 18px; transition: transform .4s var(--ease); }
.link-arrow:hover { color: var(--orange); border-color: var(--orange); }
.link-arrow:hover svg { transform: translateX(5px); }

/* ---------- overlays ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

.blueprint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 78%);
  opacity: .8;
}
.dark .blueprint {
  background-image:
    linear-gradient(to right, rgba(243, 241, 236, .055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(243, 241, 236, .055) 1px, transparent 1px);
}

/* ---------- page transition veil ---------- */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 700;
  background: var(--dark);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
html.nav-enter::before,
html.nav-leave::before { opacity: 1; }
html.nav-leave::before { pointer-events: auto; }

/* ---------- scroll progress ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 180;
  background: rgba(20,22,25,.06);
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 150;
  padding: 20px 0;
  color: var(--paper);
  border-bottom: 1px solid transparent;
  transition: padding .45s var(--ease), background .45s ease, color .45s ease, border-color .45s ease, transform .55s var(--ease);
}
.header__inner {
  width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 30px;
}
.header__brand { display: flex; align-items: center; flex: 0 0 auto; }
.header__brand img { height: 42px; width: auto; }
.header__brand .logo-dark { display: none; }
.header.is-stuck {
  padding: 11px 0;
  background: rgba(243, 241, 236, .97);
  color: var(--ink);
  border-color: var(--line);
}
.header.is-stuck .header__brand .logo-light { display: none; }
.header.is-stuck .header__brand .logo-dark { display: block; }
.header.is-hidden { transform: translateY(-105%); }

.header__nav { display: flex; align-items: center; gap: clamp(16px, 2vw, 30px); margin-left: auto; }
.header__nav a {
  position: relative;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
  opacity: .82;
  transition: opacity .3s, color .3s;
}
.header__nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .4s var(--ease);
}
.header__nav a:hover { opacity: 1; }
.header__nav a:hover::after { transform: scaleX(1); }
.header__nav a.is-active { color: var(--orange); opacity: 1; }
.header.is-stuck .header__nav a.is-active { color: var(--orange-3); }

.header__actions { display: flex; align-items: center; gap: 18px; }
.header__phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
}
.header__phone svg { width: 15px; height: 15px; }
.header__cta {
  min-height: 42px;
  padding: 0 20px;
  font-size: 11px;
  color: inherit;
  border-color: currentColor;
}
.header__cta::after { background: var(--orange); }
.header__cta:hover { color: #fff; border-color: var(--orange); }

/* light page heroes: header must switch to dark ink at top */
body.theme-light .header:not(.is-stuck) { color: var(--ink); }
body.theme-light .header:not(.is-stuck) .logo-light { display: none; }
body.theme-light .header:not(.is-stuck) .logo-dark { display: block; }

.burger {
  display: none;
  width: 42px;
  height: 42px;
  position: relative;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.burger span {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 1px;
  background: currentColor;
  transition: transform .4s var(--ease), top .3s;
}
.burger span:first-child { top: 18px; }
.burger span:last-child { top: 24px; }
.burger.is-open span:first-child { top: 21px; transform: rotate(45deg); }
.burger.is-open span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- mobile nav ---------- */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: var(--dark);
  color: var(--paper);
  padding: 110px var(--container-pad, 24px) 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .7s var(--ease-2);
  pointer-events: none;
}
.nav-overlay.is-open { clip-path: inset(0 0 0 0); pointer-events: auto; }
.nav-overlay nav { display: flex; flex-direction: column; gap: 4px; }
.nav-overlay nav a {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(30px, 7vw, 48px);
  letter-spacing: -.03em;
  line-height: 1.18;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .6s var(--ease), color .3s;
}
.nav-overlay.is-open nav a { opacity: 1; transform: none; }
.nav-overlay nav a:nth-child(1) { transition-delay: .12s; }
.nav-overlay nav a:nth-child(2) { transition-delay: .17s; }
.nav-overlay nav a:nth-child(3) { transition-delay: .22s; }
.nav-overlay nav a:nth-child(4) { transition-delay: .27s; }
.nav-overlay nav a:nth-child(5) { transition-delay: .32s; }
.nav-overlay nav a:nth-child(6) { transition-delay: .37s; }
.nav-overlay nav a:hover { color: var(--orange); }
.nav-overlay__foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line-dark);
  padding-top: 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(243,241,236,.55);
}

/* ---------- reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s ease, transform .65s var(--ease);
  transition-delay: var(--d, 0s);
}
[data-reveal].is-in { opacity: 1; transform: none; }

[data-split] .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; }
[data-split] .word__i {
  display: inline-block;
  transform: translateY(112%);
  transition: transform .8s var(--ease);
  transition-delay: calc(var(--i) * .04s);
}
[data-split].is-in .word__i { transform: none; }

[data-img] { clip-path: inset(0 0 100% 0); transition: clip-path .9s var(--ease-2); }
[data-img].is-in { clip-path: inset(0 0 0 0); }

/* ---------- footer ---------- */
.footer { background: var(--dark); color: var(--paper); padding: clamp(56px, 7vw, 96px) 0 30px; }
.footer__top {
  display: grid;
  grid-template-columns: 1.3fr .7fr .7fr .9fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line-dark);
}
.footer__brand img { height: 52px; width: auto; margin-bottom: 24px; }
.footer__brand p { color: rgba(243,241,236,.6); max-width: 34ch; font-size: 14px; }
.footer h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(243,241,236,.45);
  margin-bottom: 18px;
}
.footer ul { display: flex; flex-direction: column; gap: 10px; }
.footer ul a, .footer ul li { font-size: 14px; color: rgba(243,241,236,.78); transition: color .3s; }
.footer ul a:hover { color: var(--orange); }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 24px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: rgba(243,241,236,.4);
}

/* ---------- responsive base ---------- */
@media (max-width: 1120px) {
  .header__nav { display: none; }
  .burger { display: block; }
  .header__cta { display: none; }
  .footer__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .header { padding: 14px 0; }
  .header__brand img { height: 34px; }
  .header__phone span { display: none; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 18px; }
  .section-head__aside { text-align: left; }
  .footer__top { grid-template-columns: 1fr; gap: 30px; }
  .footer__bottom { flex-direction: column; }
}

/* screenshot helper */
html.shot [data-reveal],
html.shot [data-split] .word__i,
html.shot [data-img] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
html.shot .hero { min-height: 940px; }

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