/* =====================================================================
   BEXBID — services grid on a scrolling painted background
   ===================================================================== */

.services{
  position: relative;
  padding: 120px 0 130px;
  background: #f9f9f9;
  overflow: hidden;
}

/* no pin: the section scrolls normally */
.services-scroll{
  position: relative;
  background: #f9f9f9;
}

/* the exact painted image used by the reference (static fallback while
   the WebGL dissolve engine boots, or if WebGL is unavailable) */
.services__paint{
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
  user-select: none;
  -webkit-mask-image: url("paint-bg.svg");
  mask-image: url("paint-bg.svg");
  -webkit-mask-size: cover;
  mask-size: cover;
  -webkit-mask-position: 50% 100%;
  mask-position: 50% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* WebGL dissolve layer (same engine as the reference) */
.services__dissolve{
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: url("paint-bg.svg");
  mask-image: url("paint-bg.svg");
  -webkit-mask-size: cover;
  mask-size: cover;
  -webkit-mask-position: 50% 100%;
  mask-position: 50% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.services__inner{
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
}

.services__head{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
}

.services__title{
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: clamp(42px, 6vw, 92px);
  line-height: .94;
  font-weight: 600;
  letter-spacing: -0.045em;
  color: #054B71;
}
.services__title em{
  font-style: normal;
  color: #2AA7EB;
}

.services__desc{
  max-width: 420px;
  margin: 0 0 10px;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #5b7180;
  text-align: right;
}

/* ---------- grid of trades ---------- */
.services__grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 52px;
}

.service-tile{
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 16px 20px;
  min-height: 178px;
  border-radius: 16px;
  border: 1px solid rgba(5,75,113,.14);
  background: rgba(255,253,249,.74);
  text-decoration: none;
  color: #054B71;
  font-family: "Poppins", sans-serif;
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s ease,
              border-color .3s ease, background .3s ease;
}
.service-tile:hover{
  transform: translateY(-5px);
  border-color: rgba(42,167,235,.55);
  background: #fffdf9;
  box-shadow: 0 22px 44px rgba(5,75,113,.13);
}

.service-tile__art{
  width: 112px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #f2efe9;
}
.service-tile__art img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform .5s cubic-bezier(.16,1,.3,1);
}
.service-tile:hover .service-tile__art img{ transform: scale(1.08); }

.service-tile__name{
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-align: center;
}

.service-tile__arrow{
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 14px;
  color: #2AA7EB;
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity .25s ease, transform .25s ease;
}
.service-tile:hover .service-tile__arrow{ opacity: 1; transform: translateX(0); }

/* ---------- mobile ---------- */
@media (max-width: 900px){
  .services{ padding: 74px 0 84px; }
  .services__inner{ padding: 0 20px; }
  .services__head{
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .services__desc{ text-align: left; max-width: 100%; }
  .services__grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 30px;
  }
  .service-tile{
    min-height: 150px;
    padding: 18px 10px 14px;
    gap: 10px;
  }
  .service-tile__art{ width: 86px; height: 64px; }
  .service-tile__name{ font-size: 13px; }
}
