.services-carousel {
  --services-bg: #e7ebf3;
  --services-panel: rgba(213, 220, 232, 0.58);
  --services-navy: #1b3b4d;
  --services-gold: #c8a46a;
  --services-white: #ffffff;
  --services-muted-border: #bfc5ca;
  --services-track: rgba(0, 0, 0, 0.08);
  --services-card-width: 450px;
  --services-card-width-active: 1000px;
  --services-card-height: 600px;
  --services-gap: 24px;
  --services-inner-offset: max(0px, calc((100vw - 1728px) / 2));
  --services-rail: clamp(24px, calc((100vw - 1290px) / 2), 219px);

  position: relative;
  overflow: hidden;
  padding: 96px 0;
  background: linear-gradient(
    to bottom,
    transparent 0,
    var(--services-bg) 50%,
    var(--services-bg) 100%
  );
  color: var(--services-navy);
}

.services-carousel__inner {
  width: min(100%, 1728px);
  margin: 0 auto;
}

.services-carousel__header {
  width: min(1290px, calc(100% - (var(--services-rail) * 2)));
  margin: 0 auto 96px;
}

.services-carousel__eyebrow-wrap {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.services-carousel__eyebrow-line {
  display: block;
  width: 48px;
  height: 1px;
  flex: 0 0 auto;
  background: var(--services-navy);
}

.services-carousel__eyebrow {
  color: var(--services-navy);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: var(--fw-bold);
  line-height: 1.1;
  letter-spacing: 0;
}

.services-carousel__title {
  display: flex;
  flex-direction: column;
  width: min(740px, 100%);
  margin: 0;
  font-family: var(--font-display);
  font-size: 67px;
  font-weight: var(--fw-regular);
  line-height: 1.1;
  letter-spacing: 0;
}

.services-carousel__title-rest {
  color: var(--services-navy);
}

.services-carousel__title-highlight {
  color: var(--services-gold);
}

.services-carousel__shell {
  width: calc(100vw - var(--services-inner-offset) - var(--services-rail));
  margin-left: var(--services-rail);
  padding: 0 0 38px 0;
  border-radius: 16px;


}

.services-carousel__shell-backdrop {
  position: absolute;
  height: calc(var(--services-card-height) + 76px);
  background-color: var(--services-panel);
  width: 90%;
  top: 40%;
  right: 0;
  z-index: 0;
  border-radius: 16px 0 0 16px;

  
}

.services-carousel__viewport {
  overflow: visible;
  padding-left: 0;
}

.services-carousel__track {
  display: flex;
  align-items: stretch;
  gap: var(--services-gap);
  width: max-content;
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.services-carousel__card {
  position: relative;
  flex: 0 0 var(--services-card-width);
  width: var(--services-card-width);
  height: var(--services-card-height);
  overflow: hidden;
  border: 2px solid var(--services-muted-border);
  border-radius: 16px;
  background: #07121a;
  color: var(--services-white);
  cursor: pointer;
  transition:
    width 500ms cubic-bezier(0.22, 1, 0.36, 1),
    flex-basis 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.services-carousel__card.is-active {
  flex-basis: var(--services-card-width-active);
  width: var(--services-card-width-active);
  cursor: default;
}

.services-carousel__card-bg-wrap,
.services-carousel__card-bg-wrap picture,
.services-carousel__card-bg,
.services-carousel__card-overlay {
  position: absolute;
  inset: 0;
}

.services-carousel__card-bg-wrap {
  z-index: 1;
}

.services-carousel__card-bg-wrap picture,
.services-carousel__card-bg {
  display: block;
  width: 100%;
  height: 100%;
}

.services-carousel__card-bg {
  object-fit: cover;
  object-position: center;
  transition: transform 500ms ease;
}

.services-carousel__card-bg--fallback {
  background:
    radial-gradient(circle at 24% 18%, rgba(200, 164, 106, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(27, 59, 77, 0.78), rgba(8, 32, 48, 0.98));
}

.services-carousel__card-overlay {
  z-index: 2;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.6) 100%);
}

.services-carousel__card-content {
  position: absolute;
  inset: auto 0 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 208px;
  padding: 0 48px 48px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.services-carousel__card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: min(550px, 100%);
}

.services-carousel__card-eyebrow {
  color: var(--services-gold);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: var(--fw-bold);
  line-height: 1.1;
  letter-spacing: 0;
}

.services-carousel__card-title {
  margin: 0;
  color: var(--services-white);
  font-family: var(--font-display);
  font-size: 33px;
  font-weight: var(--fw-regular);
  line-height: 1.1;
  letter-spacing: 0;
}

.services-carousel__card-body {
  width: min(550px, 100%);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  color: var(--services-white);
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: var(--fw-regular);
  line-height: 1.7;
  letter-spacing: 0;
  transition:
    max-height 360ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms ease,
    visibility 220ms ease;
}

.services-carousel__card.is-active .services-carousel__card-body {
  max-height: 180px;
  opacity: 1;
  visibility: visible;
}

.services-carousel__card-description {
  margin: 0;
}

.services-carousel__card-ctas {
  position: absolute;
  right: 48px;
  bottom: 48px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 232px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 240ms ease,
    visibility 240ms ease,
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.services-carousel__card.is-active .services-carousel__card-ctas {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.services-carousel__card-cta.button {
  width: 100%;
  min-height: 66px;
  padding: 0;
  border-radius: 0;
}

.services-carousel__card-cta.button .button__inner {
  width: 100%;
  min-height: 66px;
  padding: 24px 48px;
  border-radius: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: var(--fw-bold);
  line-height: 1.1;
  letter-spacing: 0;
}

.services-carousel__card-cta--primary.button,
.services-carousel__card-cta--primary.button .button__inner {
  background: #8fd3d1;
  color: var(--services-navy);
}

.services-carousel__card-cta--secondary.button,
.services-carousel__card-cta--secondary.button .button__inner {
  border: 1px solid #8fd3d1;
  background: rgba(255, 255, 255, 0.1);
  color: #8fd3d1;
  backdrop-filter: blur(4px);
}

.services-carousel__card:hover .services-carousel__card-bg,
.services-carousel__card:focus-within .services-carousel__card-bg {
  transform: scale(1.035);
}

.services-carousel__controls {
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(1290px, calc(100% - 48px));
  margin: 40px auto 0;
  z-index: 1;
  position: relative;
}

.services-carousel__progress {
  flex: 1 1 auto;
  min-width: 0;
  z-index: 1;
}

.services-carousel__progress-track {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 70px;
  background: var(--services-track);
  z-index: 1;
}

.services-carousel__progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--services-navy);
  transition: width 250ms ease;
  z-index: 1;
}

.services-carousel__nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.services-carousel__control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: var(--services-navy);
  color: var(--services-white);
  cursor: pointer;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.services-carousel__control:hover,
.services-carousel__control:focus-visible {
  background: color-mix(in srgb, var(--services-navy) 86%, var(--services-white));
  transform: translateY(-1px);
}

.services-carousel__control:focus-visible {
  outline: 2px solid var(--services-gold);
  outline-offset: 3px;
}

.services-carousel__control svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 1399px) {
  .services-carousel {
    --services-rail: 48px;
  }

  .services-carousel__header {
    width: calc(100% - (var(--services-rail) * 2));
  }

  .services-carousel__shell {
    width: calc(100vw - var(--services-rail));
    margin-left: var(--services-rail);
  }

  .services-carousel__controls {
    width: calc(100% - (var(--services-rail) * 2));
  }
}

@media (max-width: 1139px) {
  .services-carousel {
    --services-rail: 20px;
  }

  .services-carousel {
    padding: 80px 0;
  }

  .services-carousel__header {
    margin-bottom: 72px;
  }

  .services-carousel__title {
    font-size: 56px;
  }

  .services-carousel__shell {
    width: calc(100vw - var(--services-rail));
    margin-left: var(--services-rail);
  }

  .services-carousel__viewport {
    overflow-x: auto;
    overflow-y: visible;
    padding: 0 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

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

  .services-carousel__track {
    transform: none !important;
  }

  .services-carousel__card,
  .services-carousel__card.is-active {
    flex-basis: min(420px, 82vw);
    width: min(420px, 82vw);
    height: 560px;
    scroll-snap-align: start;
    cursor: default;
  }

  .services-carousel__card-body,
  .services-carousel__card-ctas {
    display: none;
  }
}

@media (max-width: 767px) {
  .services-carousel {
    padding: 64px 0;
  }

  .services-carousel__header,
  .services-carousel__controls {
    width: calc(100% - 40px);
  }

  .services-carousel__header {
    margin-bottom: 48px;
  }

  .services-carousel__eyebrow {
    font-size: 16px;
  }

  .services-carousel__title {
    font-size: 42px;
  }

  .services-carousel__shell {
    background:
      linear-gradient(to bottom, transparent 0, transparent 28px, var(--services-panel) 28px, var(--services-panel) 100%);
  }

  .services-carousel__card,
  .services-carousel__card.is-active {
    flex-basis: min(340px, 82vw);
    width: min(340px, 82vw);
    height: 460px;
  }

  .services-carousel__card-content {
    padding: 0 24px 32px;
  }

  .services-carousel__card-title {
    font-size: 28px;
  }

  .services-carousel__controls {
    align-items: stretch;
    flex-direction: column;
    margin-top: 32px;
  }

  .services-carousel__progress,
  .services-carousel__nav {
    width: 100%;
  }

  .services-carousel__nav {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .services-carousel__track,
  .services-carousel__progress-bar,
  .services-carousel__card-bg,
  .services-carousel__control {
    transition: none;
  }
}
