/* -------------------------------------------------------
   Service carousel (homepage "What we do" section)
   Cards come from config('site.services').
   Behaviour lives in assets/js/service-carousel.js.
------------------------------------------------------- */
.service-carousel {
  --sc-base: var(--base-color, #dd6531);
  --sc-coral: #ef5f43;
  --sc-peach: #f38c4b;
  --sc-bg: #16181e;
  --sc-text: #a3a6b4;
  --sc-line: rgba(255, 255, 255, 0.08);
  --sc-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --sc-ease-spring: cubic-bezier(0.2, 0.9, 0.25, 1.25);
  position: relative;
  overflow: hidden;
  overflow: clip;
  background-color: var(--sc-bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(221, 101, 49, 0.12), transparent 60%),
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: auto, 28px 28px;
}

.sc-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
}

.sc-glow-1 {
  width: 480px;
  height: 480px;
  top: -160px;
  left: -140px;
  background: var(--sc-base);
  opacity: 0.18;
  animation: sc-drift 20s ease-in-out infinite;
}

.sc-glow-2 {
  width: 420px;
  height: 420px;
  bottom: -200px;
  right: 10%;
  background: var(--sc-coral);
  opacity: 0.14;
  animation: sc-drift 24s ease-in-out infinite reverse;
}

/* Heading + controls */
.sc-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 50px;
}

.sc-head-text {
  max-width: 640px;
}

.sc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--sc-peach);
  background: rgba(221, 101, 49, 0.1);
  border: 1px solid rgba(221, 101, 49, 0.3);
}

.sc-eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sc-base);
  animation: sc-pulse 1.8s ease-out infinite;
}

.sc-heading {
  margin-bottom: 14px;
  font-weight: 600;
  letter-spacing: -1px;
  color: #fff;
}

.sc-gradient-text {
  background: linear-gradient(90deg, var(--sc-base), var(--sc-peach), var(--sc-coral), var(--sc-base));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sc-text-flow 7s linear infinite;
}

.sc-sub {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--sc-text);
}

.sc-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sc-counter {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin-right: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.35);
}

.sc-current {
  display: inline-block;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -1px;
  color: #fff;
}

.sc-current.is-flipping {
  animation: sc-flip 0.5s var(--sc-ease-out);
}

.sc-total {
  font-size: 16px;
}

.sc-nav {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  font-size: 20px;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.4s var(--sc-ease-spring), box-shadow 0.3s ease;
}

.sc-nav:hover,
.sc-nav:focus-visible {
  background: var(--sc-base);
  border-color: transparent;
  box-shadow: 0 14px 30px -12px rgba(221, 101, 49, 0.9);
}

.sc-prev:hover {
  transform: translateX(-3px);
}

.sc-next:hover {
  transform: translateX(3px);
}

.sc-nav:active {
  transform: scale(0.92);
}

.sc-nav:focus-visible {
  outline: 3px solid rgba(221, 101, 49, 0.4);
  outline-offset: 3px;
}

/* Autoplay countdown ring around the "next" button */
.sc-ring {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  transform: rotate(-90deg);
  pointer-events: none;
}

.sc-ring circle {
  fill: none;
  stroke: var(--sc-peach);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 163.4;
  stroke-dashoffset: calc(163.4px * (1 - var(--sc-progress, 0)));
}

/* Track bleeds off the right edge of the container */
.sc-track {
  margin-right: calc(50% - 50vw);
}

.sc-swiper {
  overflow: hidden;
  padding: 14px 0 30px;
  cursor: grab;
}

.sc-swiper:active {
  cursor: grabbing;
}

.sc-swiper .swiper-slide {
  height: auto;
}

/* Card */
.sc-card {
  --mx: 50%;
  --my: 50%;
  --rx: 0deg;
  --ry: 0deg;
  --lift: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 440px;
  padding: 26px;
  border-radius: 26px;
  color: #fff;
  text-decoration: none;
  background: #22252d;
  border: 1px solid var(--sc-line);
  overflow: hidden;
  isolation: isolate;
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
  transition: transform 0.6s var(--sc-ease-out), border-color 0.4s ease, box-shadow 0.4s ease;
  -webkit-user-select: none;
  user-select: none;
}

.sc-card.is-tilting {
  transition: transform 0.12s linear, border-color 0.4s ease, box-shadow 0.4s ease;
}

.sc-media {
  position: absolute;
  inset: 0;
  z-index: -3;
}

.sc-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  transition: transform 1.2s var(--sc-ease-out), filter 0.6s ease;
  filter: saturate(0.85);
  -webkit-user-drag: none;
}

.sc-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(22, 24, 30, 0.55) 0%, rgba(22, 24, 30, 0) 32%),
    linear-gradient(0deg, rgba(22, 24, 30, 0.96) 12%, rgba(22, 24, 30, 0.55) 48%, rgba(22, 24, 30, 0.05) 75%);
  transition: opacity 0.5s ease;
}

/* Brand tint washes up from the bottom on hover */
.sc-shade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(221, 101, 49, 0.55), rgba(221, 101, 49, 0) 60%);
  opacity: 0;
  transition: opacity 0.6s ease;
  mix-blend-mode: soft-light;
}

.sc-card-spot {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(340px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.14), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

/* Glowing border that follows the pointer */
.sc-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(240px circle at var(--mx) var(--my), var(--sc-peach), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.sc-card:hover,
.sc-card:focus-visible {
  --lift: -8px;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 40px 70px -35px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(221, 101, 49, 0.15);
}

.sc-card:hover::before,
.sc-card:hover .sc-card-spot,
.sc-card:hover .sc-shade::after,
.sc-card:focus-visible::before,
.sc-card:focus-visible .sc-shade::after {
  opacity: 1;
}

.sc-card:hover .sc-media img,
.sc-card:focus-visible .sc-media img {
  transform: scale(1.16);
  filter: saturate(1.1);
}

.sc-card:focus-visible {
  outline: 2px solid var(--sc-base);
  outline-offset: 3px;
}

.sc-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sc-icon {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 22px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.5s var(--sc-ease-spring), box-shadow 0.4s ease;
}

.sc-card:hover .sc-icon,
.sc-card:focus-visible .sc-icon {
  background: linear-gradient(135deg, var(--sc-base), var(--sc-peach));
  border-color: transparent;
  box-shadow: 0 12px 26px -10px rgba(221, 101, 49, 0.9);
  transform: rotate(-8deg) scale(1.08);
}

.sc-num {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(22, 24, 30, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.sc-body {
  display: flex;
  flex-direction: column;
  transform: translateY(46px);
  transition: transform 0.6s var(--sc-ease-out);
}

.sc-name {
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.5px;
  color: #fff;
}

.sc-tagline {
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
}

.sc-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.6s var(--sc-ease-out);
}

.sc-more i {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 15px;
  color: var(--sc-bg);
  background: #fff;
  transition: transform 0.45s var(--sc-ease-spring), background-color 0.3s ease, color 0.3s ease;
}

.sc-card:hover .sc-body,
.sc-card:focus-visible .sc-body {
  transform: none;
}

.sc-card:hover .sc-more,
.sc-card:focus-visible .sc-more {
  opacity: 1;
  transform: none;
  transition-delay: 0.08s;
}

.sc-card:hover .sc-more i,
.sc-card:focus-visible .sc-more i {
  color: #fff;
  background: var(--sc-base);
  transform: rotate(45deg);
}

/* Touch screens have no hover, so show everything up front */
@media (hover: none) {
  .sc-body,
  .sc-more {
    opacity: 1;
    transform: none;
  }
}

/* Footer: progress + view all */
.sc-foot {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-top: 20px;
}

.sc-progress {
  position: relative;
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.sc-progress-bar {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--sc-base), var(--sc-peach));
  transform-origin: left center;
  transform: scaleX(var(--sc-scroll, 0.14));
  transition: transform 0.6s var(--sc-ease-out);
}

.sc-all {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 8px 8px 26px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
  isolation: isolate;
  transition: border-color 0.3s ease, transform 0.35s var(--sc-ease-out), box-shadow 0.35s ease;
}

.sc-all::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, var(--sc-peach), var(--sc-coral));
  transform: translateX(-101%);
  transition: transform 0.5s var(--sc-ease-out);
}

.sc-all:hover,
.sc-all:focus-visible {
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -16px rgba(221, 101, 49, 0.8);
}

.sc-all:hover::before,
.sc-all:focus-visible::before {
  transform: none;
}

.sc-all:focus-visible {
  outline: 3px solid rgba(221, 101, 49, 0.4);
  outline-offset: 3px;
}

.sc-all-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  color: var(--sc-bg);
  background: #fff;
  transition: transform 0.45s var(--sc-ease-spring);
}

.sc-all:hover .sc-all-icon {
  transform: rotate(45deg);
}

/* Scroll reveal (only hidden once JS is running) */
.sc-js .sc-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.8s var(--sc-ease-out);
  transition-delay: calc(var(--sc-i, 0) * 120ms);
}

.sc-js .sc-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Cards rise in one after another when the track first appears.
   "backwards" fill keeps hover transforms working once it ends. */
.sc-js .sc-track.sc-reveal {
  transform: none;
}

.sc-js .sc-track:not(.is-visible) .sc-card {
  opacity: 0;
}

.sc-js .sc-track.is-visible .sc-card {
  animation: sc-rise 1s var(--sc-ease-out) backwards;
  animation-delay: calc(var(--sc-i, 0) * 110ms + 150ms);
}

/* Keyframes */
@keyframes sc-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.12); }
}

@keyframes sc-pulse {
  0% { box-shadow: 0 0 0 0 rgba(221, 101, 49, 0.6); }
  100% { box-shadow: 0 0 0 10px rgba(221, 101, 49, 0); }
}

@keyframes sc-text-flow {
  to { background-position: 300% 0; }
}

@keyframes sc-flip {
  from { opacity: 0; transform: translateY(60%); }
  to { opacity: 1; transform: none; }
}

@keyframes sc-rise {
  from {
    opacity: 0;
    transform: perspective(1000px) translateY(80px) rotateX(14deg) scale(0.94);
  }
}

/* Responsive */
@media (max-width: 991px) {
  .sc-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 26px;
    margin-bottom: 36px;
  }

  .sc-card {
    min-height: 400px;
  }
}

@media (max-width: 575px) {
  .sc-current {
    font-size: 28px;
  }

  .sc-nav {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .sc-card {
    min-height: 380px;
    padding: 22px;
    border-radius: 22px;
  }

  .sc-name {
    font-size: 21px;
  }

  .sc-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
  }

  .sc-all {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sc-glow,
  .sc-eyebrow-dot,
  .sc-gradient-text,
  .sc-current.is-flipping,
  .sc-js .sc-track.is-visible .sc-card {
    animation: none;
  }

  .sc-js .sc-reveal,
  .sc-card,
  .sc-media img,
  .sc-body,
  .sc-more {
    transition: none;
  }

  .sc-card {
    transform: none;
  }
}
