/* ==========================================================================
   Arbuda Engineering — 3D Staggered Fanned Services Deck
   Mindframe-Inspired Luxury Editorial Architecture
   ========================================================================== */

.services-deck {
  position: relative;
  background-color: #ffffff;
  color: var(--color-text, #151717);
  padding: 8rem 0 6rem;
  overflow: hidden;
  z-index: 2;
  user-select: none;
}

/* Subtle Technical Drafting Watermark */
.services-deck::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(21, 23, 23, 0.04) 1px, transparent 0);
  background-size: 3.2rem 3.2rem;
  pointer-events: none;
  opacity: 0.6;
}

.services-deck .container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 3rem;
}

/* --------------------------------------------------------------------------
   Header: Editorial Mixed Typography & Offset Minimalist Tags
   -------------------------------------------------------------------------- */
.deck-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
  margin-bottom: 4.8rem;
}

.deck-header__title {
  font-size: 5.6rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #151717;
  margin: 0;
}

.deck-header__serif {
  font-family: var(--font-secondary, 'Lora', serif);
  font-style: italic;
  font-weight: 400;
  display: inline-block;
  margin-right: 0.6rem;
}

.deck-header__bold {
  font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #151717;
  margin-right: 0.6rem;
}

.deck-header__script {
  font-family: var(--font-secondary, 'Lora', serif);
  font-style: italic;
  font-weight: 400;
  color: #151717;
}

/* Right-aligned Offset Minimalist Tags (Mindframe Signature Layout) */
.deck-header__tags {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.8rem;
  padding-top: 0.8rem;
}

.deck-pill {
  font-family: var(--font-primary, sans-serif);
  font-size: 1.35rem;
  font-weight: 400;
  padding: 0.55rem 2.2rem;
  border-radius: 100px;
  border: 1.5px solid rgba(21, 23, 23, 0.85);
  background: transparent;
  color: #151717;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.deck-pill:first-child {
  margin-right: 1.6rem; /* Asymmetric offset matching reference */
}

.deck-pill:hover,
.deck-pill.is-active {
  background: rgba(21, 23, 23, 0.05);
  border-color: #151717;
}

/* --------------------------------------------------------------------------
   3D Staggered Fanned Stage (Vertically Centered Floating Deck)
   -------------------------------------------------------------------------- */
.deck-stage {
  position: relative;
  width: 100%;
  height: 64rem;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1400px;
  perspective-origin: 50% 50%;
  margin: 1rem 0 2rem;
}

.deck-track {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Individual Staggered Card (Folder Tab Silhouette & Centered 3D Matrix)
   -------------------------------------------------------------------------- */
.deck-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 37rem;
  height: 58rem;
  margin-top: -29rem;
  margin-left: -18.5rem;
  transform-origin: center center;
  cursor: pointer;
  isolation: isolate;
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
  filter: drop-shadow(0 24px 44px rgba(0, 0, 0, 0.22));
}

/* Inner Container with SVG Tab Notch Clip Path */
.deck-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  clip-path: url(#deck-card-tab-clip);
  -webkit-clip-path: url(#deck-card-tab-clip);
  background-color: #1a1c1d;
  overflow: hidden;
}

/* 3D Stacking Matrix (Exact Relative Fanned Positioning) */
.deck-card[data-pos="0"] {
  transform: translate3d(0, 0, 0) scale(1);
  z-index: 10;
  opacity: 1;
  filter: drop-shadow(0 32px 64px rgba(0, 0, 0, 0.28));
  cursor: default;
}

.deck-card[data-pos="1"] {
  transform: translate3d(78%, 0, -45px) scale(0.86);
  z-index: 8;
  opacity: 0.95;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.18)) brightness(0.95);
}

.deck-card[data-pos="2"] {
  transform: translate3d(144%, 0, -90px) scale(0.74);
  z-index: 6;
  opacity: 0.85;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.14)) brightness(0.92);
}

.deck-card[data-pos="-1"] {
  transform: translate3d(-78%, 0, -45px) scale(0.86);
  z-index: 8;
  opacity: 0.95;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.18)) brightness(0.95);
}

.deck-card[data-pos="-2"] {
  transform: translate3d(-144%, 0, -90px) scale(0.74);
  z-index: 6;
  opacity: 0.85;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.14)) brightness(0.92);
}

/* Hidden Overflow Cards in Looping Carousel */
.deck-card[data-pos="hidden-left"] {
  transform: translate3d(-180%, 0, -150px) scale(0.55);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.deck-card[data-pos="hidden-right"] {
  transform: translate3d(180%, 0, -150px) scale(0.55);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

/* Card Media & Scrim */
.deck-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.deck-card[data-pos="0"]:hover .deck-card__img {
  transform: scale(1.03);
}

.deck-card__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0) 45%,
    rgba(0, 0, 0, 0.35) 65%,
    rgba(0, 0, 0, 0.82) 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* Card Top Index Typography (Positioned inside the raised tab) */
.deck-card__tab {
  position: absolute;
  top: 1rem;
  right: 2.2rem;
  z-index: 3;
  pointer-events: none;
}

.deck-card__index {
  font-family: var(--font-primary, sans-serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: #4a4d50;
  display: inline-block;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Card Bottom Content */
.deck-card__bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2.6rem 2.6rem 2.8rem;
  z-index: 2;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.deck-card__title {
  font-family: var(--font-primary, sans-serif);
  font-size: 2.8rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 0.5rem;
}

.deck-card__sub {
  font-family: var(--font-primary, sans-serif);
  font-size: 1.35rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 1.2rem;
}

/* Spec Pills */
.deck-card__pills {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.8rem;
}

.spec-pill {
  font-family: var(--font-primary, sans-serif);
  font-size: 1.15rem;
  font-weight: 400;
  padding: 0.35rem 1rem;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   Center Active Card Quick Consultation Bar
   -------------------------------------------------------------------------- */
.deck-card__consult {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 100px;
  padding: 0.4rem 0.4rem 0.4rem 1.6rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

.deck-card__input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-primary, sans-serif);
  font-size: 1.35rem;
  color: #151717;
  outline: none;
  min-width: 0;
}

.deck-card__input::placeholder {
  color: rgba(21, 23, 23, 0.5);
}

.deck-card__submit {
  border: none;
  background: #151717;
  color: #ffffff;
  border-radius: 100px;
  padding: 0.95rem 1.8rem;
  font-family: var(--font-primary, sans-serif);
  font-size: 1.3rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
  transition: background 0.25s ease;
}

.deck-card__submit:hover {
  background: #333636;
}

.deck-card__submit svg {
  width: 1.3rem;
  height: 1.3rem;
  transition: transform 0.25s ease;
}

.deck-card__submit:hover svg {
  transform: translateX(3px);
}

/* Hide Consultation Bar on Non-Active (Flanking) Cards */
.deck-card:not([data-pos="0"]) .deck-card__consult {
  display: none;
}

/* --------------------------------------------------------------------------
   Bottom Row: Navigation Controls & Editorial Social Proof Metric
   -------------------------------------------------------------------------- */
.deck-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3.2rem;
  padding: 0 2rem;
  gap: 3rem;
}

.deck-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.deck-nav__btn {
  width: 4.8rem;
  height: 4.8rem;
  border-radius: 50%;
  border: 1px solid rgba(21, 23, 23, 0.2);
  background: #ffffff;
  color: var(--color-text, #151717);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.deck-nav__btn svg {
  width: 1.8rem;
  height: 1.8rem;
  transition: transform 0.25s ease;
}

.deck-nav__btn:hover {
  background: #151717;
  color: #ffffff;
  border-color: #151717;
  transform: scale(1.05);
}

.deck-nav__btn--prev:hover svg {
  transform: translateX(-2px);
}

.deck-nav__btn--next:hover svg {
  transform: translateX(2px);
}

/* Right-aligned Metric Block (Mindframe Position) */
.deck-metric {
  max-width: 42rem;
  font-family: var(--font-primary, sans-serif);
  font-size: 1.5rem;
  line-height: 1.45;
  color: #151717;
  text-align: right;
  margin: 0;
}

.deck-metric strong {
  font-size: 2rem;
  font-weight: 700;
  color: #151717;
  letter-spacing: -0.02em;
  display: inline-block;
  margin-right: 0.3rem;
}

.deck-metric em {
  font-family: var(--font-secondary, 'Lora', serif);
  font-style: italic;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
  .deck-header__title {
    font-size: 4.6rem;
  }

  .deck-stage {
    height: 58rem;
  }

  .deck-card {
    width: 32rem;
    height: 52rem;
    margin-top: -26rem;
    margin-left: -16rem;
  }

  .deck-card[data-pos="1"] {
    transform: translate3d(74%, 0, -40px) scale(0.86);
  }

  .deck-card[data-pos="2"] {
    transform: translate3d(136%, 0, -80px) scale(0.74);
  }

  .deck-card[data-pos="-1"] {
    transform: translate3d(-74%, 0, -40px) scale(0.86);
  }

  .deck-card[data-pos="-2"] {
    transform: translate3d(-136%, 0, -80px) scale(0.74);
  }
}

@media (max-width: 767px) {
  .services-deck {
    padding: 6rem 0 5rem;
  }

  .deck-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 3.2rem;
  }

  .deck-header__tags {
    flex-direction: row;
    padding-top: 0;
  }

  .deck-pill:first-child {
    margin-right: 0;
  }

  .deck-header__title {
    font-size: 3.8rem;
  }

  .deck-stage {
    height: 52rem;
  }

  .deck-card {
    width: min(86vw, 32rem);
    height: 48rem;
    margin-top: -24rem;
    margin-left: calc(-1 * min(43vw, 16rem));
  }

  .deck-card__bottom {
    padding: 2rem;
  }

  .deck-card__title {
    font-size: 2.2rem;
  }

  /* Mobile Stacking Matrix */
  .deck-card[data-pos="1"] {
    transform: translate3d(25%, 0, -30px) scale(0.88);
    opacity: 0.6;
  }

  .deck-card[data-pos="2"] {
    transform: translate3d(48%, 0, -60px) scale(0.76);
    opacity: 0;
    pointer-events: none;
  }

  .deck-card[data-pos="-1"] {
    transform: translate3d(-25%, 0, -30px) scale(0.88);
    opacity: 0.6;
  }

  .deck-card[data-pos="-2"] {
    transform: translate3d(-48%, 0, -60px) scale(0.76);
    opacity: 0;
    pointer-events: none;
  }

  .deck-bottom {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    gap: 2rem;
  }

  .deck-metric {
    text-align: center;
    font-size: 1.4rem;
  }
}
