/* ============================================================
   SALUT site — paper, ink, sparks
   Палитра снята с оригинала знака: чернила #161612, бумага #FAF7E3
   ============================================================ */

:root {
  --paper: #FFFEF9;
  --cream: #F7F3E2;
  --ink: #161612;
  --ink-2: #5C5850;
  --hair: rgba(22, 22, 18, 0.16);
  --red: #E0502A;
  --amber: #E9A53C;
  --blue: #4169C8;
  --green: #7E9F77;
  --pink: #DC7CA5;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --w-content: 1080px;
  --w-text: 660px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html.launching { overflow: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: rgba(233, 165, 60, 0.45); }

h1, h2, h3 { font-weight: 500; margin: 0; }
em { font-style: italic; }
p { margin: 0; }

/* ---------- шапка ---------- */

.top {
  display: flex;
  justify-content: center;
  padding: 26px 20px 22px;
  border-bottom: 1px solid var(--hair);
}

.sparkmark {
  appearance: none;
  background: none;
  border: 0;
  padding: 6px;
  cursor: pointer;
  color: var(--ink);
  line-height: 0;
  border-radius: 12px;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sparkmark:hover { transform: rotate(22deg) scale(1.08); }
.sparkmark:active { transform: rotate(36deg) scale(0.94); }
.sparkmark .spark-glyph { width: 38px; height: 42px; display: block; }

html.pre .sparkmark, html.launching .sparkmark { opacity: 0; }
html.landed .sparkmark { opacity: 1; }

/* ---------- герой ---------- */

.hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 92px 24px 64px;
  text-align: center;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}
.eyebrow sup { font-size: 7px; letter-spacing: 0; margin-left: -0.3em; }
.eyebrow .mini-spark { width: 11px; height: 12px; color: var(--red); }

.hero h1 {
  font-size: clamp(34px, 5.3vw, 58px);
  line-height: 1.16;
  letter-spacing: -0.012em;
  max-width: 19ch;
  margin: 0 auto;
}

/* рукописное подчёркивание под курсивом */
.u { position: relative; white-space: nowrap; }
.u .u-line {
  position: absolute;
  left: -2%;
  bottom: -0.18em;
  width: 104%;
  height: 0.22em;
  overflow: visible;
}
.u .u-line path {
  fill: none;
  stroke: var(--red);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-dasharray: 460;
  stroke-dashoffset: 0;
}
html.pre .u .u-line path { stroke-dashoffset: 460; }
html.settled .u .u-line path { transition: stroke-dashoffset 0.9s ease-out 1.15s; stroke-dashoffset: 0; }

.lede {
  max-width: 560px;
  margin: 26px auto 0;
  font-size: 18.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.cta { margin-top: 38px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--paper);
  background: var(--ink);
  text-decoration: none;
  padding: 15px 28px 16px;
  border-radius: 255px 22px 245px 24px / 24px 245px 22px 255px; /* рукотворный овал */
  box-shadow: 3px 4px 0 rgba(22, 22, 18, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn:hover {
  transform: translate(-1px, -2px);
  box-shadow: 5px 7px 0 rgba(22, 22, 18, 0.24);
  background: #23231d;
}
.btn:hover .btn-spark { transform: rotate(140deg) scale(1.15); color: var(--amber); }
.btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 rgba(22, 22, 18, 0.22); }
.btn-spark { width: 17px; height: 19px; color: var(--paper); transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s; }

.cta-note {
  margin-top: 16px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-2);
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* поэтапный въезд героя после салюта */
html.pre [data-stage] { opacity: 0; transform: translateY(20px); }
html.settled [data-stage] {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
html.settled [data-stage="1"] { transition-delay: 0.05s; }
html.settled [data-stage="2"] { transition-delay: 0.16s; }
html.settled [data-stage="3"] { transition-delay: 0.3s; }
html.settled [data-stage="4"] { transition-delay: 0.44s; }

/* ---------- лента телефонов ---------- */

.strip {
  max-width: var(--w-content);
  margin: 0 auto;
  padding: 26px 24px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.strip::-webkit-scrollbar { display: none; }
.strip-art { width: 100%; min-width: 740px; height: auto; display: block; }

/* ---------- фичи ---------- */

.features {
  max-width: var(--w-content);
  margin: 0 auto;
  padding: 96px 24px 30px;
  text-align: center;
}

.features h2,
.steps h2,
.cases h2 {
  font-size: clamp(27px, 3.4vw, 38px);
  line-height: 1.22;
  letter-spacing: -0.01em;
}

.feature-grid {
  list-style: none;
  margin: 64px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px 36px;
  text-align: left;
}

.feature-grid li { max-width: 230px; }
.ficon { width: 84px; height: 84px; display: block; margin-bottom: 18px; }
.feature-grid h3 { font-size: 17.5px; font-weight: 600; margin-bottom: 9px; }
.feature-grid p { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }

/* ---------- кремовая полоса ---------- */

.band { padding: 96px 0; }
.band-inner {
  max-width: var(--w-content);
  margin: 0 auto;
  background: var(--cream);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 24px;
  padding: 56px 56px;
  border-radius: 4px;
}
.band-text h2 { font-size: clamp(24px, 3vw, 34px); line-height: 1.25; }
.band-text p { margin-top: 18px; max-width: 46ch; font-size: 16.5px; color: var(--ink-2); }

.link-arrowless {
  display: inline-block;
  margin-top: 26px;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--red);
  padding-bottom: 3px;
}
.link-arrowless:hover { border-bottom-style: dashed; }

.band-art { margin: -96px 0; }
.band-art svg { width: 100%; max-width: 400px; height: auto; display: block; margin: 0 auto; }

/* ---------- шаги ---------- */

.steps {
  max-width: var(--w-content);
  margin: 0 auto;
  padding: 40px 24px 72px;
  text-align: center;
}

.step-grid {
  list-style: none;
  margin: 60px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px;
  counter-reset: step;
  text-align: center;
}

.step-num {
  position: relative;
  display: inline-block;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
}
.step-num svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.step-num b {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 25px;
}
.step-grid li:nth-child(1) .step-num svg path { stroke: var(--red); }
.step-grid li:nth-child(2) .step-num svg path { stroke: var(--amber); }
.step-grid li:nth-child(3) .step-num svg path { stroke: var(--blue); }

.step-grid h3 { font-size: 18px; font-weight: 600; margin-bottom: 9px; }
.step-grid p { font-size: 15px; color: var(--ink-2); max-width: 30ch; margin: 0 auto; }

/* ---------- кейсы (скрыты до первых роликов) ---------- */

.cases {
  max-width: var(--w-content);
  margin: 0 auto;
  padding: 20px 24px 96px;
  text-align: center;
}
.cases-note { margin-top: 14px; color: var(--ink-2); font-size: 15.5px; }
.case-grid {
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 240px));
  justify-content: center;
  gap: 36px;
}
.case-slot { margin: 0; position: relative; }
.case-slot svg { width: 100%; height: auto; color: var(--ink); opacity: 0.5; }
.case-slot video {
  position: absolute;
  inset: 3%;
  width: 94%;
  height: 94%;
  object-fit: cover;
  border-radius: 16px;
}

/* ---------- финальный призыв ---------- */

.cta-final {
  position: relative;
  max-width: var(--w-content);
  margin: 0 auto;
  padding: 96px 24px 124px;
  text-align: center;
  overflow: hidden;
}
.cta-final h2 {
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.18;
  position: relative;
  z-index: 1;
}
.cta-final p {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 20px auto 34px;
  color: var(--ink-2);
}
.cta-final .btn { position: relative; z-index: 1; }
.cta-final .u .u-line path { stroke: var(--amber); }
html.settled .cta-final .u .u-line path { transition: none; stroke-dashoffset: 0; }

.ghosts { position: absolute; inset: 0; color: var(--ink); }
.ghosts .g { position: absolute; opacity: 0.13; }
.g1 { width: 130px; left: 4%; top: 18%; transform: rotate(-7deg); }
.g2 { width: 96px; left: 16%; bottom: -6%; transform: rotate(4deg); }
.g3 { width: 140px; right: 3%; top: 10%; transform: rotate(6deg); }
.g4 { width: 104px; right: 14%; bottom: -8%; transform: rotate(-5deg); }

/* ---------- подвал ---------- */

.foot {
  border-top: 1px solid var(--hair);
  max-width: 100%;
  padding: 44px 28px 50px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  font-family: var(--sans);
}

.foot-brand { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.foot-spark { width: 21px; height: 24px; color: var(--ink); flex: none; }
.foot-lockup { font-size: 12.5px; font-weight: 600; letter-spacing: 0.22em; }
.foot-lockup sup { font-size: 7px; letter-spacing: 0; }
.foot-tag { font-family: var(--serif); font-style: italic; font-size: 13.5px; color: var(--ink-2); }

.foot-links { display: flex; gap: 26px; justify-content: center; }
.foot-links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-bottom: 1.5px solid transparent;
  padding-bottom: 2px;
}
.foot-links a:hover { border-bottom-color: var(--red); }

.foot-legal {
  justify-self: end;
  font-size: 12.5px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.legal-spark { width: 11px; height: 12px; color: var(--red); }

/* ---------- появление секций при скролле ---------- */

html.js [data-reveal] { opacity: 0; transform: translateY(22px); }
html.js [data-reveal].in {
  opacity: 1;
  transform: none;
  transition: opacity 0.85s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.85s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- оверлей запуска ---------- */

#launch {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--paper);
  cursor: pointer;
}
#launch.pop { background: transparent; pointer-events: none; }
#launch.clear { background: transparent; }
#launch.out { opacity: 0; transition: opacity 0.32s ease; }
#launch canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* гифка-интро: колонна 9:16 по центру, multiply прячет границы на бумаге */
.intro-vid {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  mix-blend-mode: multiply;
}

/* кодовый разлёт искр поверх гифки: на весь вьюпорт любого устройства */
.spark-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#launchRocket {
  position: absolute;
  left: 0;
  top: 0;
  width: 58px;
  height: 106px;
  color: var(--ink);
  will-change: transform;
}

.spark-fly { position: absolute; will-change: transform; z-index: 2; }
.spark-fly svg { width: 100%; height: 100%; display: block; color: var(--ink); }

.launch-hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  opacity: 0;
  animation: hint-in 0.6s ease 1.6s forwards;
}
@keyframes hint-in { to { opacity: 0.75; } }

/* ---------- адаптив ---------- */

@media (max-width: 960px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 44px 32px; }
  .feature-grid li { max-width: none; }
  .band-inner { grid-template-columns: 1fr; padding: 46px 36px 0; }
  .band-art { margin: 10px 0 0; }
  .band-art svg { max-width: 330px; }
  .foot { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 18px; }
  .foot-brand { justify-content: center; }
  .foot-legal { justify-self: center; }
}

@media (max-width: 420px) {
  .band-text h2 { font-size: 22px; }
}

@media (max-width: 640px) {
  .hero { padding: 64px 22px 52px; }
  .lede { font-size: 16.5px; }
  .features { padding-top: 72px; }
  .feature-grid { grid-template-columns: 1fr; gap: 40px; }
  .ficon { width: 72px; height: 72px; }
  .step-grid { grid-template-columns: 1fr; gap: 40px; }
  .band { padding: 64px 0; }
  .band-inner { border-radius: 0; padding: 42px 26px 0; }
  .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .cta-final { padding: 84px 22px 100px; }
  .g2, .g4 { display: none; }
  .strip { padding-top: 12px; }
}

/* ---------- бережно к движению ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-reveal] { opacity: 1; transform: none; }
  html.pre [data-stage] { opacity: 1; transform: none; }
  .btn, .sparkmark, .btn-spark { transition: none; }
}
