/* ==========================================================================
   /services/landing/ — «Лендинги». Concept: «Траектория» — one goal; the
   whole page moves one way, toward the button.
   Hero: one large comet, still. Its tail runs off the top-right corner, so it
   reads as already flying; its head — the brightest point — sits right of the
   headline, on the comet's own axis that leads to «Обсудить проект». From the
   head a dotted course runs ahead to the button; now and then a spark runs
   along it and the button answers with a soft pulse. The comet barely drifts
   and its head breathes. Geometry is computed by landing.js from the real
   position of the button and the copy, so it holds at every width.
   Below: blocks arrive along the same diagonal; the steps sit on a route.
   ========================================================================== */

.service-landing { --lp-w: clamp(900px, 92vw, 1700px); }

/* --- Hero: comet -------------------------------------------------------- */
.lp-sky .lp-comet {
  position: absolute;
  left: 46%;                                  /* no-JS fallback; landing.js places it */
  top: calc(var(--lp-w) * -0.3);
  width: var(--lp-w);
  mix-blend-mode: screen;                     /* artwork black → page graphite */
}
.lp-sky .lp-comet img { width: 100%; height: auto; }
.lp-js .lp-sky .lp-comet { opacity: 0; transition: opacity 1.2s ease; }
.lp-js .lp-sky .lp-comet.is-placed { opacity: 1; }

/* the head's glow */
.lp-glow {
  position: absolute;
  left: 8.08%;
  top: 85.25%;
  width: 9%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .5) 0%, rgba(235, 238, 242, .16) 30%, transparent 68%);
  transform: translate(-50%, -50%);
}

@media (prefers-reduced-motion: no-preference) {
  /* a slow drift forward along the axis and back */
  .lp-sky .lp-comet { animation: lp-drift 50s ease-in-out infinite alternate; }
  .lp-glow { animation: lp-breathe 6s ease-in-out infinite alternate; }
}
@keyframes lp-drift { from { transform: translate(0, 0); } to { transform: translate(-22px, 10px); } }
@keyframes lp-breathe { from { opacity: .55; transform: translate(-50%, -50%) scale(.85); } to { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } }

/* shade for the copy on the left; a soft top edge */
.lp-sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(14, 15, 15, .85) 0, rgba(14, 15, 15, 0) clamp(60px, 7vw, 120px)),   /* no hard cut under the header */
    linear-gradient(90deg, rgba(14, 15, 15, .9) 0%, rgba(14, 15, 15, .6) 34%, rgba(14, 15, 15, 0) 56%);
}

/* the course ahead: drawn by landing.js in hero coordinates */
.lp-route {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.lp-route line { stroke: rgba(241, 235, 221, .42); stroke-width: 1; stroke-dasharray: 2 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.lp-spark { fill: #fff; opacity: 0; filter: drop-shadow(0 0 4px rgba(255, 255, 255, .9)); }
html:not(.lp-js) .lp-route { display: none; }

/* the target: the hero button and its pulse */
.lp-target { position: relative; display: inline-flex; }
.lp-ring {
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(241, 235, 221, .6);
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
}
.service-landing .svc-hero .button-primary { background-color: rgba(14, 15, 15, .35); }
.service-landing .svc-hero .button-primary:hover { background-color: var(--nk2-cream); }

/* --- Scope: the steps sit on a route ------------------------------------ */
.service-landing .svc-scope {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.service-landing .svc-scope .svc-label { padding-top: 8px; }
.lp-steps {
  position: relative;
  margin-top: 0;
  padding-left: clamp(36px, 3.6vw, 52px);
}
/* the rail and its fill */
.lp-steps::before,
.lp-steps::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 4px;
  width: 1px;
  background: var(--svc-line);
}
.lp-steps::after {
  background: rgba(241, 235, 221, .6);
  transform-origin: 50% 0;
}
.lp-steps li { position: relative; }
/* the step descriptions: 16px on phones, up to 17px on desktop */
.service-landing .lp-steps p { font-size: clamp(1rem, 1.15vw, 1.0625rem); line-height: 1.6; }
.lp-steps li + li { margin-top: clamp(28px, 3vw, 44px); }
/* a stop on the route */
.lp-steps li::before {
  content: "";
  position: absolute;
  top: .45em;
  left: calc(-1 * clamp(36px, 3.6vw, 52px));
  width: 9px;
  height: 9px;
  border: 1px solid rgba(241, 235, 221, .6);
  border-radius: 50%;
  background: var(--svc-bg);
  transition: background-color .6s ease;
}

/* --- Reveal: along the comet's diagonal (from up-right, moving down-left) - */
.svc-motion .service-landing .svc-reveal { transform: translate3d(56px, -32px, 0); }
.svc-motion .service-landing .svc-reveal.is-visible { transform: none; }
/* (without landing.js the rail simply fills once on reveal) */
.svc-motion .service-landing .lp-steps:not(.lp-scroll)::after { transform: scaleY(0); transition: transform 2.6s cubic-bezier(.45, 0, .2, 1) .3s; }
.svc-motion .service-landing .svc-scope.is-visible .lp-steps:not(.lp-scroll)::after { transform: scaleY(1); }
.svc-motion .service-landing .lp-steps:not(.lp-scroll) li::before { transition-delay: calc(.4s + var(--i, 0) * .6s); }
.svc-motion .service-landing .svc-scope.is-visible .lp-steps:not(.lp-scroll) li::before,
html:not(.svc-motion) .lp-steps:not(.lp-scroll) li::before { background: rgba(241, 235, 221, .85); }
html:not(.svc-motion) .lp-steps::after { display: none; }

/* --- Scope, driven by scroll (landing.js adds .lp-side, .lp-count, the
   spark and .lp-scroll): the step number on the left sticks and counts the
   route; the rail fills down to the reader's eye line, a spark rides its
   end and lights the stops it passes. ------------------------------------ */
.lp-side { position: sticky; top: 28vh; align-self: start; }
.lp-count {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: clamp(28px, 3vw, 44px) 0 0;
  color: var(--svc-ink);
  font-family: var(--svc-serif);
  line-height: .9;
}
.lp-count-n { display: inline-block; font-size: clamp(4.5rem, 7.5vw, 7.5rem); font-weight: 300; letter-spacing: -.05em; }
.lp-count-total { color: var(--svc-label); font-size: clamp(1.25rem, 1.6vw, 1.625rem); font-weight: 300; letter-spacing: -.02em; }
.lp-steps.lp-scroll::after { transform: scaleY(var(--p, 0)); transition: none; }
.lp-rail-spark {
  position: absolute;
  top: calc(10px + var(--p, 0) * (100% - 20px));
  left: 4.5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 2px rgba(255, 255, 255, .7), 0 0 18px 6px rgba(255, 255, 255, .18);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.lp-steps.lp-scroll li::before { background: var(--svc-bg); transition: background-color .4s ease, box-shadow .4s ease; transition-delay: 0s; }
.lp-steps.lp-scroll li.is-passed::before { background: rgba(241, 235, 221, .9); box-shadow: 0 0 10px rgba(255, 255, 255, .35); }

/* --- Tablet / mobile ----------------------------------------------------- */
@media (max-width: 960px) {
  .service-landing .svc-scope { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .lp-side { position: static; }
  .lp-count { display: none; }
}
@media (max-width: 680px) {
  .service-landing { --lp-w: 200vw; }
  .lp-route { display: none; }
  .service-landing .svc-hero { padding-top: 220px; }
  .svc-hero-actions .lp-target { flex: 1 1 100%; }
  .lp-target .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-js .lp-sky .lp-comet { transition: none; }
  .lp-steps::after { display: none; }
  .lp-steps li::before { background: rgba(241, 235, 221, .85); }
}
