:root {
  --depth-line: rgba(255, 255, 255, 0.12);
  --depth-panel: rgba(8, 11, 24, 0.42);
  --depth-panel-strong: rgba(8, 11, 24, 0.66);
  --depth-glow-blue: rgba(57, 169, 255, 0.18);
  --depth-glow-lime: rgba(185, 255, 74, 0.13);
}

section {
  position: relative;
}

.section-head {
  position: relative;
  z-index: 2;
}

.services,
.features,
.process,
.faq-grid,
.catalog-grid,
.quote-page-grid,
.catalog-layout {
  overflow: visible;
  perspective: 1300px;
  transform-style: preserve-3d;
}

.services[data-scroll-services] {
  cursor: grab;
  user-select: none;
}

.services[data-scroll-services].is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.services[data-scroll-services].is-dragging .service-card {
  pointer-events: none;
}

.service-card,
.feature-card,
.faq-card,
.step,
.product-card,
.quote-panel,
.form-panel,
.event-panel,
.catalog-toolbar,
.contact {
  position: relative;
  overflow: visible;
  border-color: var(--depth-line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    radial-gradient(circle at 18% 12%, var(--depth-glow-blue), transparent 34%),
    var(--depth-panel);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform-style: preserve-3d;
}

.service-card::after,
.feature-card::after,
.faq-card::after,
.step::after,
.product-card::after,
.quote-panel::after,
.form-panel::after,
.event-panel::after,
.catalog-toolbar::after,
.contact::after {
  position: absolute;
  right: 8%;
  bottom: -18px;
  left: 8%;
  z-index: -1;
  height: 34px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.42), transparent 68%);
  content: "";
  filter: blur(10px);
  pointer-events: none;
  transform: translateZ(-60px);
}

.service-card {
  --tilt-y: -5deg;
  --lift-z: 14px;
  border-radius: 22px;
  transform:
    translate(
      calc(var(--enter-x, 0px) * (1 - var(--service-progress, 1))),
      calc(var(--enter-y, 0px) * (1 - var(--service-progress, 1)))
    )
    rotateY(var(--tilt-y))
    translateZ(var(--lift-z))
    scale(calc(0.94 + (var(--service-progress, 1) * 0.06)));
  transition:
    transform 240ms ease,
    box-shadow 240ms ease,
    opacity 180ms ease;
}

.service-card:nth-child(2),
.service-card:nth-child(4) {
  --tilt-y: 4deg;
  --lift-z: 28px;
  margin-top: 24px;
}

.service-card:nth-child(3) {
  --tilt-y: 0deg;
  --lift-z: 46px;
  margin-top: -14px;
}

.service-card:hover,
.product-card:hover,
.feature-card:hover,
.faq-card:hover {
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.42),
    0 0 46px rgba(57, 169, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.service-card:hover {
  transform:
    translate(
      calc(var(--enter-x, 0px) * (1 - var(--service-progress, 1))),
      calc(var(--enter-y, 0px) * (1 - var(--service-progress, 1)) - 8px)
    )
    rotateY(0deg)
    translateZ(62px)
    scale(calc(0.96 + (var(--service-progress, 1) * 0.06)));
}

.service-art,
.product-media {
  border-radius: 18px;
  margin: 10px;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.service-body,
.product-body {
  position: relative;
  z-index: 1;
}

.features {
  gap: clamp(16px, 3vw, 30px);
}

.feature-card,
.faq-card {
  border-radius: 20px;
  transform: rotateX(0deg) rotateY(var(--card-tilt, -3deg)) translateZ(var(--card-z, 12px));
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}

.feature-card:nth-child(2),
.faq-card:nth-child(2),
.faq-card:nth-child(4) {
  --card-tilt: 3deg;
  --card-z: 26px;
  margin-top: 18px;
}

.feature-card:nth-child(3),
.faq-card:nth-child(3) {
  --card-tilt: -1deg;
  --card-z: 40px;
  margin-top: -10px;
}

.feature-card span {
  box-shadow: 0 14px 34px rgba(36, 217, 255, 0.16);
  transform: translateZ(28px);
}

.feature-card:hover,
.faq-card:hover {
  border-color: rgba(57, 169, 255, 0.34);
  transform: rotateY(0deg) translateY(-8px) translateZ(54px);
}

.process {
  align-items: stretch;
  gap: clamp(14px, 2.4vw, 28px);
}

.process > .step {
  align-self: stretch;
  border: 1px solid var(--depth-line);
  border-top: 1px solid var(--depth-line);
  border-radius: 20px;
  box-sizing: border-box;
  height: 100%;
  padding: 24px;
  transform: none;
}

.process > .step::before {
  transform: translateZ(30px);
  box-shadow: 0 16px 34px rgba(6, 63, 209, 0.24);
}

.contact {
  border-radius: 30px;
  background:
    radial-gradient(circle at 82% 18%, rgba(185, 255, 74, 0.16), transparent 28%),
    radial-gradient(circle at 24% 32%, rgba(57, 169, 255, 0.22), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--depth-panel-strong);
  transform: perspective(1200px) rotateX(2deg) translateZ(26px);
}

.product-card {
  transform: rotateY(var(--product-tilt, -3deg)) translateZ(var(--product-z, 8px));
}

.product-card:nth-child(even) {
  --product-tilt: 3deg;
  --product-z: 24px;
  margin-top: 20px;
}

.product-card.is-selected {
  transform: rotateY(0deg) translateY(-6px) translateZ(42px);
}

.quote-panel,
.event-panel {
  transform: translateZ(34px);
}

.form-panel {
  transform: rotateY(-2deg) translateZ(18px);
}

.catalog-toolbar {
  transform: translateZ(22px);
}

@media (max-width: 960px) {
  .service-card,
  .feature-card,
  .faq-card,
  .step,
  .product-card,
  .quote-panel,
  .form-panel,
  .event-panel,
  .catalog-toolbar,
  .contact {
    margin-top: 0;
    transform: none;
  }

  .service-card:hover,
  .feature-card:hover,
  .faq-card:hover,
  .product-card:hover {
    transform: translateY(-4px);
  }

  .catalog-layout > .quote-panel {
    overflow: hidden;
  }

  .catalog-layout > .quote-panel::after {
    display: none;
  }

  .services {
    display: flex;
    grid-template-columns: none;
    gap: clamp(16px, 2.8vw, 28px);
    margin-right: calc(var(--container-pad, 18px) * -1);
    margin-left: calc(var(--container-pad, 18px) * -1);
    overflow-x: auto;
    overflow-y: visible;
    padding: 18px var(--container-pad, 18px) 34px;
    perspective: 1100px;
    scroll-padding: var(--container-pad, 18px);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .services::-webkit-scrollbar {
    display: none;
  }

  .services .service-card {
    flex: 0 0 clamp(260px, 48vw, 390px);
    min-height: clamp(390px, 62vw, 520px);
    border: 0;
    border-radius: 26px;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    overflow: visible;
    scroll-snap-align: center;
    transform: rotateY(var(--mobile-tilt, -5deg)) translateZ(var(--mobile-z, 0)) scale(var(--mobile-scale, 0.94));
  }

  .services .service-card:nth-child(2n) {
    --mobile-tilt: 4deg;
    --mobile-z: 12px;
    --mobile-scale: 0.95;
  }

  .services .service-card:nth-child(3) {
    --mobile-tilt: 0deg;
    --mobile-z: 24px;
    --mobile-scale: 0.98;
  }

  .services .service-card::after {
    right: 10%;
    bottom: -22px;
    left: 10%;
    height: 44px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.46), transparent 70%);
    filter: blur(14px);
  }

  .services .service-art {
    position: absolute;
    inset: 0;
    min-height: 0;
    margin: 0;
    border-radius: inherit;
    background: transparent;
    box-shadow:
      0 26px 64px rgba(0, 0, 0, 0.42),
      0 0 46px rgba(57, 169, 255, 0.14);
    overflow: hidden;
  }

  .services .service-art::before {
    display: none;
  }

  .services .service-art::after {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
      linear-gradient(180deg, rgba(5, 6, 11, 0) 0%, rgba(5, 6, 11, 0.02) 52%, rgba(5, 6, 11, 0.58) 100%),
      radial-gradient(circle at 50% 20%, transparent 58%, rgba(5, 6, 11, 0.14) 100%);
    content: "";
    pointer-events: none;
  }

  .services .service-art img,
  .services .service-art video,
  .services .service-art.contain img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0;
  }

  .services .service-body {
    position: absolute;
    right: clamp(16px, 4vw, 24px);
    bottom: clamp(16px, 4vw, 24px);
    left: clamp(16px, 4vw, 24px);
    z-index: 3;
    padding: 14px 0 0;
    transform: translateZ(46px);
  }

  .services .service-body h3 {
    max-width: 13ch;
    color: #fff;
    font-size: clamp(22px, 5vw, 30px);
    line-height: 1.08;
    text-shadow:
      0 3px 10px rgba(0, 0, 0, 0.9),
      0 10px 28px rgba(0, 0, 0, 0.72);
  }

  .services .service-body p {
    max-width: 27ch;
    margin-top: 10px;
    color: rgba(246, 247, 251, 0.88);
    font-size: clamp(13px, 2.7vw, 16px);
    line-height: 1.42;
    text-shadow:
      0 2px 8px rgba(0, 0, 0, 0.92),
      0 8px 22px rgba(0, 0, 0, 0.68);
  }
}

@media (min-width: 961px) {
  .services {
    display: flex;
    min-height: 540px;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    margin-right: -24px;
    margin-left: -24px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 22px 24px 54px;
    scroll-padding: 24px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .services::-webkit-scrollbar {
    display: none;
  }

  .service-card {
    flex: 0 0 clamp(205px, 18vw, 272px);
    min-height: 470px;
    margin-left: -18px;
    border-radius: 24px;
    background: rgba(6, 8, 18, 0.28);
    scroll-snap-align: center;
  }

  .service-card:first-child {
    margin-left: 0;
  }

  .service-card:nth-child(2),
  .service-card:nth-child(4) {
    margin-top: 34px;
  }

  .service-card:nth-child(3) {
    flex-basis: clamp(235px, 20vw, 305px);
    min-height: 520px;
    margin-top: -20px;
  }

  .service-art {
    position: absolute;
    inset: 0;
    min-height: 0;
    margin: 0;
    border-radius: inherit;
  }

  .service-art::after {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
      linear-gradient(180deg, rgba(5, 6, 11, 0) 0%, rgba(5, 6, 11, 0.04) 48%, rgba(5, 6, 11, 0.58) 100%),
      radial-gradient(circle at 50% 24%, transparent 56%, rgba(5, 6, 11, 0.16));
    content: "";
    pointer-events: none;
  }

  .service-art img,
  .service-art video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0;
  }

  .service-art.contain img {
    object-fit: cover;
  }

  .service-body {
    position: absolute;
    right: 18px;
    bottom: 18px;
    left: 18px;
    z-index: 3;
    padding: 14px 0 0;
    transform: translateZ(48px);
  }

  .service-body h3 {
    max-width: 12ch;
    text-shadow:
      0 3px 10px rgba(0, 0, 0, 0.9),
      0 10px 26px rgba(0, 0, 0, 0.68);
  }

  .service-body p {
    max-width: 24ch;
    margin-top: 10px;
    color: rgba(246, 247, 251, 0.88);
    font-size: 14px;
    line-height: 1.45;
    text-shadow:
      0 2px 8px rgba(0, 0, 0, 0.9),
      0 8px 20px rgba(0, 0, 0, 0.62);
  }
}

@media (max-width: 720px) {
  .services {
    gap: clamp(18px, 5vw, 24px);
    margin-right: calc(var(--container-pad, 12px) * -1);
    margin-left: calc(var(--container-pad, 12px) * -1);
    padding: 8px max(var(--container-pad, 12px), 20px) 30px;
    scroll-padding: max(var(--container-pad, 12px), 20px);
  }

  .services .service-card {
    flex-basis: min(72vw, 300px);
    min-height: 430px;
  }

  .product-media {
    margin: 8px;
    border-radius: 16px;
  }

  .service-card,
  .feature-card,
  .faq-card,
  .step,
  .product-card,
  .quote-panel,
  .form-panel,
  .event-panel,
  .catalog-toolbar,
  .contact {
    border-radius: 18px;
    box-shadow:
      0 22px 54px rgba(0, 0, 0, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.07);
  }
}

@media (min-width: 721px) and (max-width: 960px) {
  .services {
    margin-right: 0;
    margin-left: 0;
    padding-right: 0;
    padding-left: 0;
  }
}

/* Keep service photos clean on mobile Safari: no vignette, glass, or contain crop. */
.services .service-art::before,
.services .service-art::after,
.services .service-media::before,
.services .service-media::after {
  display: none !important;
  background: none !important;
  content: none !important;
}

.services .service-art,
.services .service-media {
  background: transparent !important;
  box-shadow: none !important;
}

.services .service-media img,
.services .service-media video,
.services .service-art img,
.services .service-art video,
.services .service-art.contain img {
  filter: none !important;
  object-fit: cover !important;
  padding: 0 !important;
}

.services .service-body {
  border-radius: 0;
  background: none;
  text-shadow: none;
}
