/* ChipTonPro — палитра «Огненный уголь» + ягодный акцент */
:root {
  --plum: #1F102B;
  --plum-2: #2B1A3A;
  --plum-line: #3E2A50;
  --flame: #FF4C1C;
  --berry: #FF2E63;
  --cream: #FFF3EB;
  --cream-2: #F6E4D8;
  --muted-dark: #C9B8C4;   /* текст второго плана на тёмном */
  --muted-light: #5E4A63;  /* текст второго плана на светлом */

  --font-display: "Unbounded", "Arial Black", sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(80px, 11vw, 150px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--plum);
  color: var(--cream);
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.9rem, 4vw, 3.25rem); }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--flame); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--cream); color: var(--plum); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

.f-flame { fill: var(--flame); }
.f-berry { fill: var(--berry); }
.f-cream { fill: var(--cream); }
.f-plum { fill: var(--plum); }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 30px;
  background: var(--flame); color: var(--plum);
  font: 700 1rem/1 var(--font-body);
  text-decoration: none; border: 0; border-radius: 999px; cursor: pointer;
  transition: background-color .25s, transform .4s var(--ease-out);
}
.btn:hover { background: var(--berry); }
.btn-small { min-height: 44px; padding: 0 22px; font-size: .9375rem; }
.btn-ghost { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 2px var(--plum-line); }
.btn-ghost:hover { background: var(--plum-2); }
.btn-full { width: 100%; }

/* Шапка: всегда на месте при прокрутке */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  transition: transform .45s var(--ease-out), background-color .3s;
}
.site-header.is-solid { background: rgba(31, 16, 43, .9); backdrop-filter: blur(12px); }
.header-row { display: flex; align-items: center; gap: 32px; min-height: 76px; }
.logo img { height: 40px; width: auto; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a, .header-phone { text-decoration: none; font-weight: 500; font-size: .9375rem; color: var(--muted-dark); transition: color .2s; }
.nav a:hover, .header-phone:hover { color: var(--cream); }
.header-phone { white-space: nowrap; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: grid; align-items: center; padding: 120px 0 80px; overflow: hidden; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-kicker { color: var(--flame); font-weight: 700; margin-bottom: 24px; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 4.6rem); font-weight: 900; line-height: .98; letter-spacing: -0.03em; }
/* «Трафик» — пиксельная шахматка, как частицы вокруг; «заявки» — сплошные */
.hero h1 .reveal-line:nth-child(2) > span {
  color: transparent;
  background: conic-gradient(var(--cream) 25%, transparent 0 50%, var(--cream) 0 75%, transparent 0) 0 0 / 6px 6px;
  -webkit-background-clip: text; background-clip: text;
}
.hero-lead { margin-top: 32px; max-width: 40ch; font-size: 1.1875rem; color: var(--muted-dark); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

/* Построчное появление заголовка — синхронно со сборкой знака */
.reveal-line { display: block; overflow: hidden; padding-bottom: .06em; }
.reveal-line > span { display: inline-block; }
.js .reveal-line > span { transform: translateY(110%); transition: transform 1.1s var(--ease-out); }
.js .is-loaded .reveal-line > span { transform: none; }
.js .is-loaded h1 .reveal-line:nth-child(1) > span { transition-delay: .1s; }
.js .is-loaded h1 .reveal-line:nth-child(2) > span { transition-delay: .18s; }
.js .is-loaded h1 .reveal-line:nth-child(3) > span { transition-delay: .26s; }
.js .hero-lead, .js .hero-actions, .js .mark-labels { opacity: 0; transform: translateY(16px); transition: opacity .8s .5s, transform .8s .5s var(--ease-out); }
.js .is-loaded .hero-lead, .js .is-loaded .hero-actions { opacity: 1; transform: none; }
.js .is-loaded .mark-labels { opacity: 1; transform: none; transition-delay: 1.6s; }

.hero-mark { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1; margin-left: auto; cursor: pointer; }
.hero-static { position: absolute; inset: 8%; width: 84%; height: 84%; }
.swarm-on .hero-static { visibility: hidden; }

/* Выноски: линия от лепестка к подписи, без рамок */
.callouts { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.callout polyline { fill: none; stroke: rgba(255, 243, 235, .35); stroke-width: .25; stroke-dasharray: 1; transition: stroke .3s; }
.callout rect { transition: transform .3s var(--ease-out); transform-box: fill-box; transform-origin: center; }
.callout-perf rect { fill: var(--flame); }
.callout-smm rect { fill: var(--cream); }
.callout-buying rect { fill: var(--berry); }
.hero-mark[data-hl="perf"] .callout-perf polyline { stroke: var(--flame); }
.hero-mark[data-hl="smm"] .callout-smm polyline { stroke: var(--cream); }
.hero-mark[data-hl="buying"] .callout-buying polyline { stroke: var(--berry); }
.hero-mark[data-hl="perf"] .callout-perf rect,
.hero-mark[data-hl="smm"] .callout-smm rect,
.hero-mark[data-hl="buying"] .callout-buying rect { transform: scale(1.8); }
@media (prefers-reduced-motion: no-preference) {
  .js .callout polyline { stroke-dashoffset: 1; transition: stroke-dashoffset 1s 1.5s var(--ease-out), stroke .3s; }
  .js .is-loaded .callout polyline { stroke-dashoffset: 0; }
  .js .callout rect { opacity: 0; transition: opacity .4s 1.4s, transform .3s var(--ease-out); }
  .js .is-loaded .callout rect { opacity: 1; }
}

.mark-labels { list-style: none; margin: 0; padding: 0; }
.mark-label { position: absolute; display: block; text-decoration: none; transition: transform .35s var(--ease-out); }
.mark-label b { display: block; font: 700 clamp(1.125rem, 1.7vw, 1.5rem)/1.1 var(--font-display); letter-spacing: -0.01em; }
.mark-label span { display: block; margin-top: 4px; font-size: .875rem; color: var(--muted-dark); }
.label-perf { right: 0; bottom: calc(92% + 8px); text-align: right; }
.label-perf b { color: var(--flame); }
.label-perf:hover, .label-perf:focus-visible { transform: translateX(-6px); }
.label-smm { left: 3%; top: calc(93% + 8px); }
.label-smm:hover, .label-smm:focus-visible { transform: translateX(6px); }
.label-buying { right: 0; top: calc(82% + 8px); text-align: right; }
.label-buying b { color: var(--berry); }
.label-buying:hover, .label-buying:focus-visible { transform: translateX(-6px); }

/* ---------- Услуги: знак поворачивается на каждую услугу ---------- */
.services { position: relative; z-index: 1; background: var(--cream); color: var(--plum); padding: var(--section) 0; }
.section-head { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px 64px; align-items: end; margin-bottom: clamp(24px, 4vw, 48px); }
.section-head h2 { max-width: 16ch; }
.section-head > p { max-width: 44ch; font-size: 1.125rem; color: var(--muted-light); }

.pin { position: relative; height: 330vh; }
.pin-stage { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; align-items: center; overflow: hidden; }
.pin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; width: 100%; }
.pin-visual { position: relative; }
.pin-mark { width: min(100%, 62vh); margin: 0 auto; overflow: visible; }
.pin-petal { transition: opacity .6s; }
.pin.is-live .pin-petal:not(.is-on) { opacity: .12; }
/* Прогресс по направлениям: полоска заполняется по мере скролла */
.pin-progress { list-style: none; padding: 0; margin: 40px auto 0; max-width: 460px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-progress li { --p: 0; --c: var(--flame); }
.pin-progress .prog-smm { --c: var(--plum); }
.pin-progress .prog-buying { --c: var(--berry); }
.pin-progress button {
  width: 100%; padding: 0 0 12px; border: 0; background: none; cursor: pointer; text-align: left;
  font: 500 .9375rem/1.2 var(--font-display); color: var(--muted-light);
  background-image: linear-gradient(90deg, var(--c) calc(var(--p) * 100%), var(--cream-2) 0);
  background-size: 100% 3px; background-repeat: no-repeat; background-position: bottom;
  transition: color .3s;
}
.pin-progress li.is-on button { color: var(--c); }

.pin-panels { display: grid; }
.panel { grid-area: 1 / 1; scroll-margin-top: 30vh; }
.pin.is-live .panel { opacity: 0; transform: translateY(48px); transition: opacity .6s, transform .8s var(--ease-out); pointer-events: none; }
.pin.is-live .panel.is-past { transform: translateY(-48px); }
.pin.is-live .panel.is-on { opacity: 1; transform: none; pointer-events: auto; }
.panel h3 { font-size: clamp(2.5rem, 5.4vw, 4.5rem); font-weight: 900; letter-spacing: -0.03em; }
.panel[data-panel="perf"] h3 { color: var(--flame); }
.panel[data-panel="buying"] h3 { color: var(--berry); }
.panel-tag { margin: 8px 0 24px; font-weight: 700; color: var(--muted-light); }
.panel > p:not(.panel-tag) { font-size: 1.1875rem; max-width: 46ch; }
.panel-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.panel-list li { padding-left: 22px; position: relative; }
.panel-list li::before { content: ""; position: absolute; left: 0; top: .55em; width: 9px; height: 9px; background: var(--flame); }

.combo {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 24px 40px; align-items: center;
  padding: clamp(28px, 4vw, 52px);
  background: var(--plum); color: var(--cream); border-radius: 32px;
}
.combo-mark { width: 110px; height: 110px; animation: spin 24s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.combo h3 { font-size: clamp(1.375rem, 2.4vw, 1.875rem); margin-bottom: 10px; }
.combo p { color: var(--muted-dark); max-width: 58ch; }

/* ---------- Процесс: линия прорисовывается, точка-лид зажигает шаги ---------- */
.process { padding: var(--section) 0; }
.process-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px 96px; align-items: start; }
.process-head { position: sticky; top: 140px; }
.process-head h2 { max-width: 12ch; }
.process-head p { margin-top: 20px; color: var(--muted-dark); font-size: 1.125rem; }
.steps { --progress: 0; list-style: none; margin: 0; padding: 0 0 0 64px; position: relative; counter-reset: step; }
/* --line: от центра первого кружка до центра последнего, считается в JS */
.steps::before, .steps::after { content: ""; position: absolute; left: 23px; top: 24px; height: var(--line, calc(100% - 48px)); width: 2px; background: var(--plum-line); }
.steps::after { background: linear-gradient(var(--flame), var(--berry)); transform-origin: top; transform: scaleY(var(--progress)); }
.step { position: relative; counter-increment: step; padding: 0 0 72px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: counter(step);
  position: absolute; left: -64px; top: 0; z-index: 1;
  width: 48px; height: 48px; display: grid; place-items: center;
  font: 700 1.125rem/1 var(--font-display); color: var(--muted-dark);
  background: var(--plum); border: 2px solid var(--plum-line); border-radius: 50%;
  transition: background-color .4s, color .4s, border-color .4s, transform .5s var(--ease-out);
}
.step.is-lit::before { background: var(--flame); border-color: var(--flame); color: var(--plum); transform: scale(1.1); }
.step h3 { font-size: clamp(1.375rem, 2.6vw, 2rem); padding-top: 6px; transition: color .4s; }
.js .step:not(.is-lit) h3 { color: var(--muted-dark); }
.step p { margin-top: 10px; color: var(--muted-dark); max-width: 44ch; }
.steps-dot { position: absolute; left: 17px; top: 18px; z-index: 2; width: 14px; height: 14px; border-radius: 50%; background: var(--cream); box-shadow: 0 0 0 6px rgba(255, 76, 28, .35), 0 0 24px 6px rgba(255, 46, 99, .6); }

/* ---------- О нас ---------- */
.about { background: var(--cream-2); color: var(--plum); padding: var(--section) 0; }
.statement { font-size: clamp(1.9rem, 4.6vw, 4rem); line-height: 1.12; max-width: 24ch; }
.js .statement .w { opacity: .14; transition: opacity .3s; }
.js .statement .w.is-on { opacity: 1; }
.values { margin: clamp(56px, 8vw, 104px) 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.values > div { padding-top: 22px; border-top: 3px solid var(--plum); }
.values dt { font: 700 1.25rem/1.25 var(--font-display); }
.values dd { margin: 10px 0 0; color: var(--muted-light); }

/* ---------- Контакты ---------- */
.contact { position: relative; padding: var(--section) 0; overflow: hidden; isolation: isolate; scroll-margin-top: 40px; }
.contact-blobs { position: absolute; inset: 0; z-index: -1; opacity: .6; }
.contact-blobs i { position: absolute; width: 60vw; height: 60vw; --c: var(--flame); background: radial-gradient(closest-side, var(--c), transparent); }
.contact-blobs i:nth-child(1) { left: -14vw; bottom: -26vw; animation: drift-a 18s ease-in-out infinite alternate; }
.contact-blobs i:nth-child(2) { --c: var(--berry); right: -16vw; top: -24vw; animation: drift-b 22s ease-in-out infinite alternate; }
.contact-blobs i:nth-child(3) { --c: #6A2C8F; left: 30vw; top: 10%; width: 40vw; height: 40vw; animation: drift-a 26s ease-in-out infinite alternate-reverse; }
@keyframes drift-a { to { transform: translate(18vw, -10vw) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-14vw, 12vw) scale(.9); } }
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px 80px; align-items: start; }
.contact-copy h2 { font-size: clamp(2.1rem, 4.6vw, 3.75rem); max-width: 14ch; }
.contact-copy p { margin-top: 24px; font-size: 1.125rem; color: var(--muted-dark); max-width: 44ch; }
.contact-links { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-wrap: wrap; gap: 12px; }
.contact-links a {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 20px;
  border-radius: 999px; box-shadow: inset 0 0 0 2px rgba(255, 243, 235, .25);
  text-decoration: none; font-weight: 700; transition: box-shadow .2s;
}
.contact-links a:hover { box-shadow: inset 0 0 0 2px var(--cream); }

.form { background: var(--cream); color: var(--plum); border-radius: 32px; padding: clamp(24px, 4vw, 40px); display: grid; gap: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--muted-light); }
.field input {
  width: 100%; min-height: 54px; padding: 0 16px;
  font: 500 1rem var(--font-body); color: var(--plum);
  background: #fff; border: 2px solid var(--cream-2); border-radius: 14px;
  transition: border-color .2s;
}
.field input:focus { outline: none; border-color: var(--flame); }
.field input[aria-invalid="true"] { border-color: #C2261B; }
.field-error { margin-top: 6px; font-size: .875rem; color: #A3200F; font-weight: 500; }
.consent { display: grid; grid-template-columns: 22px 1fr; gap: 12px; font-size: .875rem; color: var(--muted-light); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--flame); }
.form-done { font-weight: 700; background: var(--cream-2); padding: 14px 16px; border-radius: 14px; }

/* Футер */
.site-footer { border-top: 1px solid var(--plum-line); padding: 48px 0; font-size: .9375rem; color: var(--muted-dark); line-height: 1.9; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; align-items: start; }
.site-footer img { height: 40px; width: auto; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--cream); text-decoration: underline; }

/* Кольцо за курсором — только мышь */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .cursor {
    display: block; position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none;
    width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%;
    border: 2px solid var(--flame); mix-blend-mode: difference;
    transition: width .3s var(--ease-out), height .3s var(--ease-out), margin .3s var(--ease-out), background-color .3s, opacity .3s;
    opacity: 0;
  }
  .cursor.is-visible { opacity: 1; }
  .cursor.is-hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: var(--flame); }
}

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .nav { display: none; }
  .header-phone { margin-left: auto; }
  .values { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .hero { padding-top: 96px; align-items: start; }
  .hero-grid, .section-head, .process-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-mark { order: -1; max-width: 340px; margin: 0 auto; }
  .mark-labels, .callouts { display: none; }
  .process-head { position: static; }
  .combo { grid-template-columns: 80px 1fr; }
  .combo-mark { width: 80px; height: 80px; }
  .combo .btn { grid-column: 1 / -1; justify-self: start; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Телефон: закрепление остаётся — знак сверху, прогресс, текст услуги снизу */
@media (max-width: 860px) {
  .pin-stage { align-items: start; padding-top: 92px; }
  .pin-grid { grid-template-columns: 1fr; gap: 20px; }
  .pin-mark { width: min(58vw, 30svh); }
  .pin-progress { margin-top: 16px; }
  .pin-progress button { font-size: .8125rem; padding-bottom: 10px; }
  .panel h3 { font-size: clamp(2rem, 10vw, 2.75rem); }
  .panel-tag { margin: 4px 0 12px; }
  .panel > p:not(.panel-tag) { font-size: 1rem; }
  .panel-list { margin-top: 14px; gap: 6px; font-size: .9375rem; }
}
/* Низкие телефоны: список пунктов не влезает в экран — прячем, суть в абзаце */
@media (max-width: 860px) and (max-height: 720px) {
  .pin.is-live .panel-list { display: none; }
  .pin-mark { width: min(50vw, 26svh); }
}

/* Reduced motion: без закрепления, услуги друг под другом */
@media (prefers-reduced-motion: reduce) {
  .pin { height: auto; }
  .pin-stage { position: static; height: auto; display: block; overflow: visible; padding-top: 0; }
  .pin-grid { display: block; }
  .pin-visual { display: none; }
  .pin-panels { gap: 56px; padding-bottom: 56px; }
  .panel { grid-area: auto; padding-top: 32px; border-top: 3px solid var(--plum); }
}

@media (max-width: 560px) {
  .header-phone { display: none; }
  .header-row { justify-content: space-between; }
  .logo img { height: 34px; }
  .hero-actions .btn { width: 100%; }
  .hero h1 .reveal-line:nth-child(2) > span { background-size: 4px 4px; }
  .steps { padding-left: 56px; }
  .step::before { left: -56px; width: 40px; height: 40px; font-size: 1rem; }
  .steps::before, .steps::after { left: 19px; }
  .steps-dot { left: 13px; }
  .values { grid-template-columns: 1fr; }
  .combo { grid-template-columns: 1fr; }
  /* Футер на телефоне — по центру: логотип, контакты, мессенджеры, юр. строка */
  .site-footer { padding: 40px 0 32px; text-align: center; }
  .footer-grid { grid-template-columns: 1fr; justify-items: center; gap: 24px; }
  .footer-phone { font: 700 1.25rem/1.6 var(--font-display); color: var(--cream); }
  .footer-social { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
  .footer-social br { display: none; }
  .footer-social a {
    display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
    border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--plum-line); line-height: 1;
  }
  .footer-legal { justify-self: stretch; padding-top: 20px; border-top: 1px solid var(--plum-line); font-size: .8125rem; }
}

@media (prefers-reduced-motion: reduce) {
  .combo-mark, .contact-blobs i { animation: none; }
  .js .reveal-line > span, .js .hero-lead, .js .hero-actions, .js .mark-labels { transform: none; opacity: 1; transition: none; }
  .js .statement .w { opacity: 1; }
}
