/* =====================================================
   CODEZA v4 — МАСТЕРСКАЯ
   Система ограничений (Refactoring UI):
   Отступы: 4/8/16/24/32/48/64/96/128
   Кегли: 13/15/18/22/32/48/72/104
   Цвета: бумага, чернила, оранж-сургут, графит
   Шрифты: Unbounded (дисплей), Manrope (текст), JetBrains Mono (моно)
   ===================================================== */

:root {
  --paper: #F4EFE8;        /* бумага тёплая */
  --ink: #171512;          /* чернила */
  --accent: #E8542F;       /* сургучно-оранжевый */
  --accent-dark: #B93E1F;
  --graphite: #6B675F;     /* второстепенный текст */
  --line: rgba(23,21,18,.14);
  --mono: 'JetBrains Mono', monospace;
  --display: 'Unbounded', sans-serif;
  --text: 'Manrope', sans-serif;
  --s4: 4px; --s8: 8px; --s16: 16px; --s24: 24px; --s32: 32px;
  --s48: 48px; --s64: 64px; --s96: 96px; --s128: 128px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.42;
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

.mono { font-family: var(--mono); font-size: 13px; letter-spacing: .04em; }

::selection { background: var(--accent); color: var(--paper); }

/* ---------- Курсор ---------- */
.cursor, .cursor-ring {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%,-50%);
}
.cursor { width: 8px; height: 8px; background: var(--accent); }
.cursor-ring {
  width: 40px; height: 40px;
  border: 1.5px solid var(--accent);
  transition: width .25s, height .25s, background .25s, opacity .25s;
  opacity: .5;
}
.cursor-ring--drag { width: 64px; height: 64px; background: rgba(232,84,47,.12); opacity: 1; }
.cursor-ring--drag::after {
  content: '↳'; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 14px; color: var(--accent); font-family: var(--mono);
}
@media (pointer: coarse) { .cursor, .cursor-ring { display: none; } }

/* ---------- Прелоадер ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--ink); color: var(--paper);
  display: grid; place-content: center; gap: var(--s16);
  transition: opacity .6s, visibility .6s;
}
.preloader--done { opacity: 0; visibility: hidden; }
.preloader__counter {
  font-family: var(--display); font-weight: 800; font-size: 104px;
  text-align: center; line-height: 1; color: var(--accent);
}
.preloader__word { text-align: center; opacity: .5; }

/* ---------- Навигация ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s24) var(--s48);
  mix-blend-mode: normal;
}
.nav__logo {
  font-family: var(--display); font-weight: 800; font-size: 22px;
  color: var(--ink); text-decoration: none;
}
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: var(--s32); align-items: center; }
.nav__links a {
  color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500;
  position: relative;
}
.nav__links a::after {
  content: ''; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px;
  background: var(--accent); transition: width .3s;
}
.nav__links a:hover::after { width: 100%; }
.nav__cta {
  border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 10px 22px !important;
}
.nav__cta::after { display: none; }
.nav__cta:hover { background: var(--ink); color: var(--paper); }

/* ---------- Герой ---------- */
.hero {
  min-height: 100vh;
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--s128) var(--s48) var(--s96);
  overflow: hidden;
}
#conveyor { position: absolute; inset: 0; z-index: 0; opacity: .5; }
.hero__grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.2fr .8fr; gap: var(--s64);
  align-items: center; max-width: 1440px; margin: 0 auto; width: 100%;
}
.hero__tag {
  color: var(--accent); margin-bottom: var(--s24);
  text-transform: uppercase;
}
.hero__title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(48px, 7.5vw, 104px);
  line-height: 1.02; letter-spacing: -.02em;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > * { display: inline-block; transform: translateY(110%); animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
.hero__title .line:nth-child(2) > * { animation-delay: .12s; }
.hero__title .line:nth-child(3) > * { animation-delay: .24s; }
.hero__title em { font-style: normal; color: var(--accent); }
.line--accent { color: var(--ink); }
@keyframes rise { to { transform: translateY(0); } }

.hero__sub {
  max-width: 52ch; margin-top: var(--s32);
  font-size: 19px; color: var(--graphite);
}
.hero__actions { display: flex; gap: var(--s16); margin-top: var(--s48); flex-wrap: wrap; }

.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-family: var(--text); font-weight: 700; font-size: 16px;
  padding: 16px 32px; border-radius: 999px;
  transition: transform .25s, background .25s, color .25s, box-shadow .25s;
  border: none;
}
.btn--primary { background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 var(--accent); }
.summary .btn--primary { background: var(--accent); color: var(--paper); box-shadow: 4px 4px 0 rgba(244,239,232,.25); }
.btn--primary:hover { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 var(--accent); }
.btn--primary:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--accent); }
.btn--ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--big { font-size: 20px; padding: 22px 44px; }
.btn--full { width: 100%; text-align: center; }

/* Чек-стих (предпросмотр в герое) */
.hero__receipt {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  padding: var(--s24);
  transform: rotate(2deg);
  transition: transform .4s;
}
.hero__receipt:hover { transform: rotate(0deg) translateY(-4px); }
.receipt__head { color: var(--accent); border-bottom: 2px dashed var(--line); padding-bottom: var(--s8); margin-bottom: var(--s16); }
.receipt__row { display: flex; justify-content: space-between; padding: var(--s4) 0; font-size: 15px; color: var(--graphite); }
.receipt__row b { font-variant-numeric: tabular-nums; }
.receipt__total {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 2px solid var(--ink); margin-top: var(--s8); padding-top: var(--s12);
  font-weight: 700; font-size: 22px;
}
.receipt__total b { font-family: var(--display); font-size: 28px; color: var(--accent); }
.receipt__note { margin-top: var(--s16); color: var(--graphite); font-size: 11px; }

.hero__scroll {
  position: absolute; bottom: var(--s32); left: 50%; transform: translateX(-50%);
  color: var(--graphite); z-index: 1;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translate(-50%,-6px); } }

/* ---------- Секции: общее ---------- */
section { padding: var(--s128) var(--s48); max-width: 1440px; margin: 0 auto; }
.section-head { margin-bottom: var(--s64); }
.section-head .mono { color: var(--accent); display: block; margin-bottom: var(--s16); }
.section-head h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(32px, 4.5vw, 64px); line-height: 1.08; letter-spacing: -.015em;
}

/* ---------- Манифест ---------- */
.manifest { padding-top: var(--s96); }
.manifest__text {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(22px, 3vw, 40px); line-height: 1.3;
  max-width: 26ch;
}
.manifest__dim { color: var(--graphite); }
.manifest__nums {
  display: flex; gap: var(--s96); margin-top: var(--s96); flex-wrap: wrap;
}
.manifest__nums b {
  display: block; font-family: var(--display); font-size: 64px; font-weight: 800;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.manifest__nums span { color: var(--graphite); font-size: 13px; }

/* ---------- Услуги ---------- */
.services { border-top: 2px solid var(--ink); }
.srv {
  display: grid; grid-template-columns: 64px 1fr; gap: var(--s24) var(--s32);
  padding: var(--s32) 0;
  border-bottom: 1.5px solid var(--line);
  position: relative; cursor: pointer;
  transition: padding .3s;
}
.srv:hover { padding-left: var(--s16); }
.srv::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent); transform: scaleY(0); transform-origin: top;
  transition: transform .35s;
}
.srv:hover::before { transform: scaleY(1); }
.srv__num { color: var(--accent); padding-top: 6px; }
.srv h3 {
  font-family: var(--display); font-weight: 600; font-size: 26px;
  margin-bottom: var(--s8);
}
.srv p { color: var(--graphite); max-width: 60ch; margin-bottom: var(--s8); }
.srv__meta { color: var(--ink); font-weight: 500; }
.srv:active { background: rgba(232,84,47,.04); }

/* ---------- Работы ---------- */
.works { border-top: 2px solid var(--ink); }
.works__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--s24); }
.case {
  border: 2px solid var(--ink); padding: var(--s32);
  background: var(--paper);
  transition: transform .35s, box-shadow .35s;
  position: relative;
}
.case:nth-child(1) { transform: rotate(-.6deg); }
.case:nth-child(2) { transform: rotate(.5deg) translateY(24px); }
.case:nth-child(3) { transform: rotate(-.4deg); }
.case:hover { transform: rotate(0) translateY(-6px); box-shadow: 8px 8px 0 var(--accent); z-index: 2; }
.case__tag { color: var(--accent); margin-bottom: var(--s16); display: block; }
.case h3 { font-family: var(--display); font-size: 22px; font-weight: 600; margin-bottom: var(--s16); }
.case__before { color: var(--graphite); font-size: 15px; margin-bottom: var(--s8); }
.case__before::before { content: '× '; color: var(--accent-dark); font-weight: 700; }
.case__after { font-size: 16px; margin-bottom: var(--s16); }
.case__after::before { content: '→ '; color: var(--accent); font-weight: 700; }
.case__nums { display: flex; gap: var(--s16); flex-wrap: wrap; }
.case__nums span {
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 11px;
}

/* ---------- Конструктор ---------- */
.build { border-top: 2px solid var(--ink); }
.build__wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--s64); align-items: start; }
.build__hint { color: var(--graphite); max-width: 50ch; margin-bottom: var(--s32); }
.opt-group { display: flex; flex-direction: column; }
.opt {
  display: grid; grid-template-columns: 28px 1fr auto; gap: var(--s16); align-items: center;
  padding: var(--s16) 0; border-bottom: 1.5px solid var(--line); cursor: pointer;
  transition: padding .25s;
}
.opt:hover { padding-left: var(--s8); }
.opt input { display: none; }
.opt__box {
  width: 26px; height: 26px; border: 2px solid var(--ink);
  display: grid; place-items: center; transition: background .2s;
  position: relative;
}
.opt input:checked + .opt__box { background: var(--accent); border-color: var(--accent); }
.opt input:checked + .opt__box::after {
  content: '✓'; color: var(--paper); font-weight: 700; font-size: 16px;
}
.opt__name { font-weight: 600; font-size: 17px; }
.opt__price { color: var(--graphite); }

.opt-slider { margin-top: var(--s48); }
.opt-slider__label { font-weight: 600; margin-bottom: var(--s16); }
#urgency {
  width: 100%; -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--line); border-radius: 2px; outline: none;
}
#urgency::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px var(--accent); cursor: grab;
}
#urgency::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px var(--accent); cursor: grab;
}
.opt-slider__marks { display: flex; justify-content: space-between; margin-top: var(--s8); color: var(--graphite); }

.summary {
  border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
  padding: var(--s32) var(--s32) var(--s40); position: sticky; top: var(--s96);
  box-shadow: 10px 10px 0 var(--accent);
}
.summary__head { color: var(--accent); margin-bottom: var(--s16); text-transform: uppercase; }
.summary__list { min-height: 120px; }
.summary__row {
  display: flex; justify-content: space-between; padding: var(--s8) 0;
  border-bottom: 1px dashed rgba(244,239,232,.2); font-size: 15px;
  animation: slideIn .3s;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } }
.summary__empty { color: rgba(244,239,232,.4); font-style: italic; padding: var(--s24) 0; }
.summary__total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: var(--s16); padding-top: var(--s16);
  border-top: 2px solid var(--accent);
  font-size: 18px;
}
.summary__total b { font-family: var(--display); font-size: 34px; color: var(--accent); font-variant-numeric: tabular-nums; }
.summary__term { color: rgba(244,239,232,.5); margin: var(--s8) 0 var(--s24); }
.summary__note { margin-top: var(--s16); font-size: 11px; color: rgba(244,239,232,.4); clear: both; }

/* ---------- Процесс ---------- */
.process { border-top: 2px solid var(--ink); }
.road { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s32); counter-reset: step; }
.road__step { position: relative; padding-top: var(--s48); }
.road__step::before {
  content: ''; position: absolute; top: 20px; left: 0; right: 0; height: 2px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 16px);
}
.road__num {
  position: absolute; top: 4px; left: 0;
  background: var(--accent); color: var(--paper);
  padding: 6px 14px; border-radius: 999px;
}
.road h3 { font-family: var(--display); font-size: 19px; font-weight: 600; margin: var(--s16) 0 var(--s8); }
.road p { color: var(--graphite); font-size: 15px; max-width: 34ch; }

/* ---------- Контакт ---------- */
.contact { border-top: 2px solid var(--ink); min-height: 70vh; display: grid; place-content: center; text-align: left; }
.contact__scene { max-width: 720px; }
.contact__big {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(40px, 6.5vw, 88px); line-height: 1.05; letter-spacing: -.02em;
}
.contact__accent { color: var(--accent); }
.contact__sub { color: var(--graphite); margin: var(--s32) 0 var(--s48); max-width: 46ch; font-size: 19px; }
.contact__preview {
  margin-top: var(--s24); background: var(--ink); color: var(--paper);
  padding: var(--s16); border-radius: 12px; white-space: pre-wrap; font-size: 12px;
  max-width: 480px;
}

/* ---------- Футер ---------- */
.footer { border-top: 2px solid var(--ink); padding: var(--s48); }
.footer__grid { display: flex; justify-content: space-between; align-items: center; gap: var(--s24); flex-wrap: wrap; max-width: 1440px; margin: 0 auto; }
.footer__brand { font-family: var(--display); font-weight: 800; font-size: 20px; }
.footer__brand span { color: var(--accent); }
.footer__note, .footer__meta { color: var(--graphite); font-size: 13px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity .7s, transform .7s; }
.reveal--in { opacity: 1; transform: translateY(0); }

/* ---------- Адаптив ---------- */
@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__receipt { max-width: 420px; }
  .build__wrap { grid-template-columns: 1fr; }
  .summary { position: static; }
  section, .hero { padding-left: var(--s24); padding-right: var(--s24); }
  .nav { padding: var(--s16) var(--s24); }
  .nav__links a:not(.nav__cta) { display: none; }
  .manifest__nums { gap: var(--s48); }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .hero__title { font-size: 44px; }
  .btn { width: 100%; text-align: center; }
  .hero__actions { flex-direction: column; }
}


/* Каналы в контактах */
.contact__channels { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.contact__channel {
  color: var(--ink-soft, #6B675F);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.04em;
  border-bottom: 1px dashed currentColor;
  align-self: flex-start;
  transition: color .2s;
}
.contact__channel:hover { color: var(--ink, #171512); }
