/* ТК ЕВА — 3D particle background + pinned services scene.
   Default styles = graceful fallback (no WebGL / no JS / reduced motion):
   slides render as a static stacked column, sections keep solid surfaces.
   html.bg3d-on is added by scripts/scene3d.js once the scene is rendering. */

/* fixed canvas behind all content */
.bg3d {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.bg3d canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* the 3D space replaces solid section surfaces (index page only) */
html.bg3d-on .hero {
  background: transparent;
}
html.bg3d-on .section.bg-1 {
  background: transparent;
}
html.bg3d-on .trust {
  background: transparent;
}

/* ============ services slides ============ */
.svc-scene__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
}
.svc-slide {
  padding-block: 2.2rem;
}
.svc-slide__num {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.svc-slide__num::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--accent);
}
.svc-slide__title {
  font-size: clamp(2.1rem, 1.2rem + 3.6vw, 4rem);
  text-transform: uppercase;
  margin-top: var(--sp-3);
  max-width: 14ch;
}
.svc-slide__text {
  color: var(--ink-2);
  font-size: var(--fs-lead);
  margin-top: var(--sp-4);
  max-width: 46ch;
}
.svc-slide .btn {
  margin-top: var(--sp-5);
}

/* pinned scroll choreography — only when the scene is live */
html.bg3d-on .svc-scene {
  height: 1100vh;
  padding-block: 0;
}
html.bg3d-on .svc-scene__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}
html.bg3d-on .svc-scene__stage > .container {
  display: flex;
  flex-direction: column;
  /* break out of the centered grid: text hugs the left edge, model owns the right */
  max-width: none;
  width: 100%;
  padding-inline: clamp(20px, 4.5vw, 96px);
}
/* keep the text a narrow column on the left so the model never sits under it */
html.bg3d-on .svc-slide__title {
  max-width: min(14ch, 44vw);
}
html.bg3d-on .svc-slide__text {
  max-width: min(40ch, 30vw);
}
html.bg3d-on .svc-scene__head {
  padding-top: clamp(5.5rem, 4rem + 4vw, 8rem);
}
html.bg3d-on .svc-scene__slides {
  position: relative;
  flex: 1;
}
html.bg3d-on .svc-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-block: 0;
  opacity: 0;
  visibility: hidden;
  will-change: transform, opacity;
}

/* short mobile-only hero lead (hidden on desktop) */
.hero__lead--m {
  display: none;
}

@media (max-width: 767px) {
  .svc-slide__text {
    font-size: var(--fs-body);
  }

  /* redesign: drop the promo cards under the hero on mobile */
  .hero .promo {
    display: none;
  }

  /* HERO — headline top-left, short lead bottom-right, crate floats in the centre */
  html.bg3d-on .hero__inner {
    min-height: 100svh;
  }
  html.bg3d-on .hero__content {
    display: flex;
    flex-direction: column;
    min-height: calc(100svh - 5rem);
    padding-top: 1.2rem;
    padding-bottom: 1.6rem;
  }
  html.bg3d-on .hero__regions {
    display: none; /* keep the centre clear for the crate */
  }
  html.bg3d-on .hero__lead {
    display: none; /* long lead replaced by the short one on mobile */
  }
  html.bg3d-on .hero__lead--m {
    display: block;
    margin-top: auto; /* pushed to the bottom… */
    margin-left: auto; /* …and to the right */
    max-width: 26ch;
    text-align: right;
    color: var(--ink-2);
  }
  html.bg3d-on .hero__actions {
    margin-top: 1.3rem;
  }

  /* SERVICES — title above, 3D centred, text below; everything full width */
  html.bg3d-on .svc-scene {
    height: 1000vh;
  }
  html.bg3d-on .svc-slide {
    justify-content: flex-start;
    align-items: stretch;
    padding-block: 0;
  }
  html.bg3d-on .svc-slide__title {
    max-width: none;
  }
  html.bg3d-on .svc-slide__text {
    max-width: none;
    margin-top: auto; /* drop to the bottom — the vehicle shows in the gap above */
    padding-bottom: 9vh;
  }

  /* BUTTONS — stretched & centred, with the container gutter as breathing room */
  .hero__actions .btn,
  .svc-slide .btn,
  .btn--lg {
    width: 100%;
    justify-content: center;
  }
}
