.home-services-carousel {
  position: relative;
  overflow: hidden;
  color: var(--jomaliq-text-primary, #10182b);
  background:
    radial-gradient(circle at 92% 10%, color-mix(in srgb, var(--jomaliq-accent, #174ee7) 14%, transparent), transparent 34%),
    var(--jomaliq-bg, #f4f7fc);
}

.home-services-carousel__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(24px, 5vw, 72px);
  margin-bottom: clamp(34px, 5vw, 64px);
}

.home-services-carousel__eyebrow {
  display: block;
  margin-bottom: 14px;
  color: var(--jomaliq-accent-strong, #082589);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.home-services-carousel__header h2 {
  max-width: 900px;
  margin: 0;
}

.home-services-carousel__header p {
  max-width: 64ch;
  margin: 20px 0 0;
  color: var(--jomaliq-text-secondary, #4d5c74);
}

.home-services-carousel__all {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--jomaliq-link, #082589);
  font-weight: 750;
  text-underline-offset: 5px;
}

.home-services-carousel__frame {
  overflow: hidden;
  border: 1px solid var(--jomaliq-glass-border, rgba(19, 50, 115, 0.16));
  border-radius: clamp(18px, 3vw, 34px);
  background: var(--jomaliq-glass, rgba(255, 255, 255, 0.78));
  box-shadow: var(--jomaliq-shadow, 0 20px 60px rgba(7, 25, 68, 0.12));
  backdrop-filter: blur(var(--jomaliq-blur, 18px)) saturate(125%);
  -webkit-backdrop-filter: blur(var(--jomaliq-blur, 18px)) saturate(125%);
}

.home-services-carousel__viewport {
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.home-services-carousel__track {
  --service-offset: 0%;
  display: flex;
  transform: translate3d(var(--service-offset), 0, 0);
  transition: transform 440ms cubic-bezier(0.2, 0.75, 0.2, 1);
  will-change: transform;
}

.home-service-slide {
  min-width: 100%;
  min-height: clamp(470px, 55vw, 650px);
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  align-items: stretch;
}

.home-service-slide[aria-hidden="true"] {
  visibility: hidden;
}

.home-service-slide__visual {
  position: relative;
  min-height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  border-right: 1px solid var(--jomaliq-glass-border, rgba(19, 50, 115, 0.16));
  background:
    radial-gradient(circle at 70% 24%, rgba(255, 255, 255, 0.8), transparent 12%),
    radial-gradient(circle at 42% 58%, color-mix(in srgb, var(--jomaliq-accent, #174ee7) 44%, transparent), transparent 31%),
    linear-gradient(145deg, color-mix(in srgb, var(--jomaliq-accent-soft, #dce7ff) 82%, white), var(--jomaliq-surface-muted, #eef3fb));
}

html[data-color-theme="dark"] .home-service-slide__visual {
  background:
    radial-gradient(circle at 70% 24%, rgba(193, 213, 255, 0.3), transparent 12%),
    radial-gradient(circle at 42% 58%, color-mix(in srgb, var(--jomaliq-accent, #6f98ff) 45%, transparent), transparent 31%),
    linear-gradient(145deg, var(--jomaliq-night-raised), var(--jomaliq-night));
}

.home-service-slide__visual::before,
.home-service-slide__visual::after {
  content: "";
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--jomaliq-accent, #174ee7) 32%, transparent);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.home-service-slide__visual::before {
  width: 70%;
  aspect-ratio: 1;
}

.home-service-slide__visual::after {
  width: 96%;
  aspect-ratio: 1;
  border-style: dashed;
  opacity: 0.58;
}

.home-service-slide__icon {
  position: relative;
  z-index: 2;
  width: clamp(120px, 16vw, 210px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 36%;
  color: #ffffff;
  background: var(--jomaliq-action-bg, #082589);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.72),
    inset -18px -22px 46px rgba(0, 0, 0, 0.18),
    0 28px 70px color-mix(in srgb, var(--jomaliq-accent, #174ee7) 36%, transparent);
  transform: rotate(-7deg);
}

.home-service-slide__icon svg {
  width: 43%;
  height: 43%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(7deg);
}

.home-service-slide__orb {
  position: absolute;
  z-index: 1;
  width: 36px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), var(--jomaliq-accent, #174ee7));
  box-shadow: 0 10px 30px rgba(4, 24, 70, 0.24);
}

.home-service-slide__orb--one {
  top: 22%;
  right: 19%;
}

.home-service-slide__orb--two {
  bottom: 16%;
  left: 18%;
  width: 22px;
}

.home-service-slide__content {
  align-self: center;
  padding: clamp(34px, 6vw, 88px);
}

.home-service-slide__category {
  margin: 0 0 20px;
  color: var(--jomaliq-highlight-text, #8a6a16);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-service-slide h3 {
  max-width: 18ch;
  margin: 0;
  color: var(--jomaliq-text-primary, #10182b);
  font-family: var(--premium-display, Georgia, serif);
  font-size: clamp(2.2rem, 4.8vw, 5rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.home-service-slide__description {
  max-width: 56ch;
  margin: 28px 0 14px;
  color: var(--jomaliq-text-secondary, #4d5c74);
  font-size: clamp(1rem, 1.3vw, 1.2rem);
}

.home-service-slide__pricing {
  margin: 0;
  color: var(--jomaliq-text-muted, #68748a);
  font-size: 0.88rem;
  font-weight: 700;
}

.home-service-slide__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
}

.home-service-slide__actions .btn {
  min-height: 48px;
}

.home-service-slide__staff {
  border: 1px solid var(--jomaliq-glass-border, rgba(19, 50, 115, 0.16));
  color: var(--jomaliq-text-primary, #10182b);
  background: var(--jomaliq-glass-strong, rgba(255, 255, 255, 0.92));
}

.home-service-slide__details {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding-inline: 8px;
  color: var(--jomaliq-link, #082589);
  font-size: 0.9rem;
  font-weight: 750;
  text-underline-offset: 5px;
}

.home-services-carousel__footer {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  align-items: center;
  gap: clamp(18px, 4vw, 46px);
  padding: 15px clamp(18px, 3vw, 36px);
  border-top: 1px solid var(--jomaliq-glass-border, rgba(19, 50, 115, 0.16));
}

.home-services-carousel__controls {
  display: flex;
  gap: 8px;
}

.home-services-carousel__control {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--jomaliq-glass-border, rgba(19, 50, 115, 0.16));
  border-radius: 50%;
  color: var(--jomaliq-text-primary, #10182b);
  background: var(--jomaliq-glass-strong, rgba(255, 255, 255, 0.92));
  cursor: pointer;
}

.home-services-carousel__control:hover {
  color: #ffffff;
  background: var(--jomaliq-accent-strong, #082589);
  transform: translateY(-2px);
}

.home-services-carousel__control:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.home-services-carousel__meter {
  display: grid;
  grid-template-columns: auto minmax(64px, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--jomaliq-text-secondary, #4d5c74);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.home-services-carousel__progress {
  --service-progress: 10%;
  position: relative;
  height: 2px;
  overflow: hidden;
  background: var(--jomaliq-glass-border, rgba(19, 50, 115, 0.16));
}

.home-services-carousel__progress::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--service-progress);
  background: var(--jomaliq-highlight-text, #8a6a16);
  transition: width 320ms ease;
}

.home-services-carousel__dots {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0;
}

.home-services-carousel__dot {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.home-services-carousel__dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--jomaliq-text-muted, #68748a);
  transform: translate(-50%, -50%);
  transition: width 160ms ease;
}

.home-services-carousel__dot[aria-current="true"]::after {
  width: 24px;
  border-radius: 99px;
  background: var(--jomaliq-highlight-text, #8a6a16);
}

.home-services-carousel__skeleton {
  min-width: 100%;
  min-height: clamp(470px, 55vw, 650px);
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  background: var(--jomaliq-surface-raised, #f9fbff);
}

.home-services-carousel__skeleton span {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--jomaliq-surface-muted, #eef3fb), var(--jomaliq-glass-strong, #fff), var(--jomaliq-surface-muted, #eef3fb));
  background-size: 220% 100%;
  animation: home-service-skeleton 1.5s ease-in-out infinite;
}

.home-services-carousel__skeleton-visual {
  margin: clamp(34px, 6vw, 80px);
  border-radius: 28px !important;
}

.home-services-carousel__skeleton-copy {
  align-self: center;
  display: grid;
  gap: 18px;
  padding: clamp(34px, 6vw, 88px);
}

.home-services-carousel__skeleton-copy span:nth-child(1) { width: 34%; height: 14px; }
.home-services-carousel__skeleton-copy span:nth-child(2) { width: 82%; height: 68px; border-radius: 18px; }
.home-services-carousel__skeleton-copy span:nth-child(3) { width: 94%; height: 18px; }
.home-services-carousel__skeleton-copy span:nth-child(4) { width: 64%; height: 18px; }
.home-services-carousel__skeleton-copy span:nth-child(5) { width: 52%; height: 48px; margin-top: 12px; }

.home-services-carousel[data-state="loaded"] .home-services-carousel__skeleton,
.home-services-carousel[data-state="empty"] .home-services-carousel__footer,
.home-services-carousel[data-state="error"] .home-services-carousel__footer {
  display: none;
}

.home-services-carousel__fallback {
  min-width: 100%;
  min-height: 360px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 16px;
  padding: clamp(36px, 8vw, 96px);
}

.home-services-carousel__fallback h3,
.home-services-carousel__fallback p {
  max-width: 60ch;
  margin: 0;
}

.home-services-carousel__fallback p {
  color: var(--jomaliq-text-secondary, #4d5c74);
}

@keyframes home-service-skeleton {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (min-width: 901px) {
  .home-services-carousel__footer {
    /* Keep the final indicators clear of the fixed Fati launcher. */
    padding-right: clamp(150px, 17vw, 230px);
  }
}

@media (max-width: 900px) {
  .home-services-carousel__header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .home-services-carousel__all {
    width: max-content;
  }

  .home-service-slide,
  .home-services-carousel__skeleton {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .home-service-slide__visual {
    min-height: 300px;
    border-right: 0;
    border-bottom: 1px solid var(--jomaliq-glass-border, rgba(19, 50, 115, 0.16));
  }

  .home-services-carousel__skeleton-visual {
    min-height: 260px;
  }

  .home-services-carousel__footer {
    grid-template-columns: auto 1fr;
  }

  .home-services-carousel__dots {
    grid-column: 1 / -1;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  body:has(.home-services-carousel) .back-to-top {
    /* The fixed control would cover the stacked service actions on narrow screens. */
    display: none;
  }

  .home-service-slide__visual {
    min-height: 230px;
  }

  .home-service-slide__content {
    padding: 30px 22px 36px;
  }

  .home-service-slide h3 {
    font-size: clamp(2.15rem, 12vw, 3.25rem);
  }

  .home-service-slide__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .home-service-slide__actions .btn,
  .home-service-slide__details {
    width: 100%;
    justify-content: center;
  }

  .home-services-carousel__footer {
    gap: 14px;
    padding-inline: 14px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .home-services-carousel__track,
  .home-services-carousel__progress::after {
    transition: none;
  }

  .home-services-carousel__skeleton span {
    animation: none;
  }
}
