/* -------------------------------------------------------------
   5. SERVICES Grid
   ------------------------------------------------------------- */
#services {
  padding-top: var(--section-vertical-padding);
  padding-bottom: var(--section-vertical-padding);
  background-color: transparent;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card-service {
  position: relative;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  border: 1px solid var(--border-card);
  padding: 24px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  justify-content: space-between;
  background-clip: padding-box !important; /* Prevents background image bleeding under borders */
  transform: translateZ(0); /* Fixes subpixel rendering gaps on high-DPI screens */
  -webkit-transform: translateZ(0);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, border-color, box-shadow; /* Promotes the card to its own GPU layer to prevent layout repaints during animation */
}

/* Subtle cyan hover gradient from index.html */
.card-service::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(135deg, rgba(97, 117, 162, 0.05) 0%, rgba(0, 0, 0, 0) 100%);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.card-service:hover::before {
  opacity: 1;
}

/* Primary bottom-shading gradient from index.html (updated to radial gradient) */
.card-service::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: radial-gradient(circle at 85% 15%, transparent 10%, rgba(26, 44, 66, 0.58) 45%, rgba(26, 44, 66, 0.97) 78%);
  z-index: 1;
  pointer-events: none;
}

.card-service:hover {
  transform: translateY(-6px);
  border-color: var(--accent-cyan);
  box-shadow: 0 10px 30px rgba(97, 117, 162, 0.12);
}

.card-service-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  stroke: var(--accent-cyan);
  fill: none; /* Contour line outline style */
  filter: drop-shadow(0 2px 8px rgba(26, 44, 66, 0.9)); /* High performance drop shadow */
  position: relative;
  z-index: 2;
}

.card-service-title,
.card-service-desc,
.card-service-link {
  text-shadow: 0 1px 8px rgba(26, 44, 66, 0.95); /* High performance text shadow */
  position: relative;
  z-index: 2;
}

.card-service-title {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--text-white);
  line-height: 1.2;
}

.card-service-desc {
  font-size: 0.9rem;
  color: var(--text-white); /* High contrast white text with heavy shadow */
  margin-bottom: 20px;
  line-height: 1.5;
}

.card-service-link {
  font-size: 0.85rem;
  color: var(--text-white); /* High contrast link */
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
  margin-top: auto;
}

.card-service-link:hover,
.card-service:hover .card-service-link {
  color: var(--accent-cyan);
}

/* Accessibility screen-reader only class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* -------------------------------------------------------------
   6. WHY IMPERITEL
   ------------------------------------------------------------- */
.advantages-section {
  border-top: 1px solid var(--border-card);
  border-bottom: 1px solid var(--border-card);
  background: transparent;
  padding: 25px 0;
  position: relative;
  z-index: 2;
}

.advantages-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}

@media (min-width: 1024px) {
  .advantages-grid {
    grid-template-columns: 0.9fr 3.1fr;
    gap: 50px;
  }
}

.advantages-title {
  font-size: 2rem;
  font-family: var(--font-serif);
  line-height: 1.25;
  font-weight: 600;
}

@media (min-width: 768px) {
  .advantages-title {
    font-size: 2.25rem;
  }
}

.advantages-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px 20px;
}

@media (min-width: 768px) {
  .advantages-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

.adv-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  transition: var(--transition-smooth);
}

.adv-item:hover {
  transform: translateY(-4px);
}

.adv-icon {
  width: auto;
  height: auto;
  background: none;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.adv-icon svg {
  width: 36px;
  height: 36px;
}

.adv-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-light-blue);
  line-height: 1.4;
  font-family: var(--font-sans);
}

/* -------------------------------------------------------------
   7. SOLUTIONS (Business Scenarios)
   ------------------------------------------------------------- */
.solutions-section {
  padding-top: var(--section-vertical-padding);
  padding-bottom: var(--section-vertical-padding);
  background-color: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.solutions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 600px) {
  .solutions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .solutions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .solutions-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Vertical Cards */
.card-vertical {
  position: relative;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 380px;
  justify-content: space-between;
  background-clip: padding-box !important;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, border-color, box-shadow;
}

.card-vertical:hover {
  transform: translateY(-6px);
  border-color: var(--accent-cyan);
  box-shadow: 0 10px 30px rgba(97, 117, 162, 0.12);
}

.card-vertical::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(135deg, rgba(97, 117, 162, 0.05) 0%, rgba(0, 0, 0, 0) 100%);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.card-vertical:hover::before {
  opacity: 1;
}

.card-vertical::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: radial-gradient(circle at 85% 15%, transparent 10%, rgba(26, 44, 66, 0.58) 45%, rgba(26, 44, 66, 0.97) 78%);
  z-index: 1;
  pointer-events: none;
}

.card-vertical-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: flex-end;
  position: relative;
  z-index: 2;
  background: transparent !important;
}

.card-vertical-body > div {
  margin-top: auto;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.card-vertical-title,
.card-vertical-desc,
.card-vertical-link {
  text-shadow: 0 1px 8px rgba(26, 44, 66, 0.95);
}

.card-vertical-title {
  font-size: 1.25rem;
  color: var(--text-white);
  margin-bottom: 10px;
  font-family: var(--font-serif);
  line-height: 1.3;
}

.card-vertical-desc {
  font-size: 0.88rem;
  color: var(--text-white);
  margin-bottom: 20px;
  line-height: 1.5;
}

.card-vertical-link {
  font-size: 0.85rem;
  color: var(--text-white);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
  margin-top: 0;
}

.card-vertical-link:hover,
.card-vertical:hover .card-vertical-link {
  color: var(--accent-cyan);
  gap: 10px;
}

/* -------------------------------------------------------------
   8. COMPARISON TABLE
   ------------------------------------------------------------- */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--glow-shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 650px;
}

th, td {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
}

th {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text-white);
  background: rgba(13, 21, 48, 0.8);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Highlight Imperitel Column */
.col-highlight {
  background: rgba(97, 117, 162, 0.04);
  border-x: 1px solid rgba(97, 117, 162, 0.15);
  text-align: center;
  font-weight: 600;
  color: var(--accent-cyan);
}

th.col-highlight {
  background: rgba(97, 117, 162, 0.08);
  border-top: 2px solid var(--accent-cyan);
  color: var(--text-white);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td:not(.col-highlight) {
  background: rgba(255, 255, 255, 0.01);
}

.check-icon {
  color: var(--accent-cyan);
  font-weight: bold;
}

.cross-icon {
  color: #ef4444;
  font-weight: bold;
}

/* -------------------------------------------------------------
   11. FAQ ACCORDION (MUTUALLY EXCLUSIVE)
   ------------------------------------------------------------- */
.faq-section {
  padding-top: var(--section-vertical-padding);
  padding-bottom: 38.08px;
  background-color: transparent;
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: var(--container-max);
  margin: 0 auto;
}

.faq-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 1024px) {
  .faq-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

/* Standard Details Styling */
details.faq-item {
  background: transparent;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  overflow: hidden;
  transition: var(--transition-smooth);
}

details.faq-item[open] {
  border-color: rgba(97, 117, 162, 0.3);
  box-shadow: 0 4px 20px rgba(97, 117, 162, 0.05);
}

summary.faq-summary {
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-white);
  cursor: pointer;
  list-style: none; /* Hide default arrow */
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

summary.faq-summary::-webkit-details-marker {
  display: none; /* Hide default Safari arrow */
}

.faq-icon-wrapper {
  position: relative;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.faq-icon-plus {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 1.0s cubic-bezier(0.25, 1, 0.5, 1),
              transform 1.0s cubic-bezier(0.25, 1, 0.5, 1),
              stroke 0.3s ease;
}

.faq-icon-sparkle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.3);
  transition: opacity 1.0s cubic-bezier(0.25, 1, 0.5, 1), 
              transform 1.0s cubic-bezier(0.25, 1, 0.5, 1),
              filter 0.3s ease;
  pointer-events: none;
}

.faq-icon-sparkle path {
  fill: #ffffff;
  stroke: none;
}

/* Sparkling star state: plus stays put, white star simply appears on top */
.faq-icon-wrapper.sparkling .faq-icon-sparkle {
  opacity: 1;
  transform: translate(-50%, -50%) scale(0.85);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.85));
}

/* Plus subtly glows and grows while the star appears */
.faq-icon-wrapper.sparkling .faq-icon-plus {
  stroke: #ffffff;
  transform: scale(1.12);
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5));
}

details.faq-item[open] .faq-icon-plus {
  transform: rotate(45deg);
  stroke: var(--accent-cyan);
}

.faq-content {
  padding: 0 20px 16px 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.02);
}

/* -------------------------------------------------------------
   HORIZONTAL STICKY SCROLL SECTION
   ------------------------------------------------------------- */
.horizontal-scroll-section {
  position: relative;
  width: 100%;
  background-color: transparent;
}

.horizontal-scroll-section .container {
  max-width: 100%;
  padding-left: var(--section-padding);
  padding-right: var(--section-padding);
}

/* Desktop layout: sticky horizontal track scroll */
@media (min-width: 1024px) {
  .horizontal-scroll-section {
    /* Height is set dynamically in JS (e.g., ~250vh-350vh based on content width) */
    height: 300vh;
    --track-gap: clamp(16px, 2vw, 30px);
  }

  .horizontal-scroll-section .sticky-viewport {
    position: sticky;
    top: 112px; /* Aligns viewport exactly below the 112px fixed header */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: clamp(40px, 6vh, 80px);
    padding-bottom: clamp(30px, 4vh, 60px);
    box-sizing: border-box;
  }

  #services,
  #solutions {
    padding-top: 0;
    padding-bottom: 0;
    scroll-margin-top: 112px; /* Link scrolls exactly to the top edge of the block (header bottom) */
  }

  #services .sticky-viewport {
    height: auto;
    overflow: visible;
  }

  #solutions .sticky-viewport {
    height: auto;
    overflow: visible;
  }

  .horizontal-scroll-section .scroll-content-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--section-padding);
    box-sizing: border-box;
  }

  .horizontal-scroll-section .horizontal-scroll-viewport {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    overflow: hidden;
    margin-top: 0;
    padding-top: 12px;
    padding-bottom: 18px;
  }

  .horizontal-scroll-section .scroll-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: var(--track-gap, clamp(16px, 2vw, 30px));
    padding-left: var(--section-padding, clamp(24px, 6vw, 120px));
    padding-right: var(--section-padding, clamp(24px, 6vw, 120px));
    will-change: transform;
  }

  .horizontal-scroll-section .card-service {
    width: calc((100vw - 2 * var(--section-padding, clamp(24px, 6vw, 120px)) - 4 * var(--track-gap, clamp(16px, 2vw, 30px))) / 5);
    min-width: 180px;
    flex-shrink: 0;
  }

  .horizontal-scroll-section .card-vertical {
    width: calc((100vw - 2 * var(--section-padding, clamp(24px, 6vw, 120px)) - 5 * var(--track-gap, clamp(16px, 2vw, 30px))) / 6);
    min-width: 180px;
    flex-shrink: 0;
  }

  /* Responsive padding and typography tuning for smaller desktop screens */
  @media (max-width: 1280px) {
    .horizontal-scroll-section .card-service {
      padding: 18px;
    }
    .horizontal-scroll-section .card-service-icon {
      width: 38px;
      height: 38px;
      margin-bottom: 12px;
    }
    .horizontal-scroll-section .card-service-title {
      font-size: 1.15rem;
      margin-bottom: 6px;
    }
    .horizontal-scroll-section .card-service-desc {
      font-size: 0.82rem;
      margin-bottom: 12px;
    }

    .horizontal-scroll-section .card-vertical {
      min-height: 340px;
    }
    .horizontal-scroll-section .card-vertical-body {
      padding: 18px;
    }
    .horizontal-scroll-section .card-vertical-title {
      font-size: 1.1rem;
      margin-bottom: 6px;
    }
    .horizontal-scroll-section .card-vertical-desc {
      font-size: 0.8rem;
      margin-bottom: 12px;
    }
  }
}

/* Mobile & Tablet layout: native horizontal swipe */
@media (max-width: 1023px) {
  .horizontal-scroll-section {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .horizontal-scroll-section .sticky-viewport {
    position: relative;
    top: 0;
    height: auto;
  }

  .horizontal-scroll-section .scroll-content-wrapper {
    display: flex;
    flex-direction: column;
    padding: 0;
  }

  .horizontal-scroll-section .section-header-flex {
    padding-left: 24px;
    padding-right: 24px;
  }

  .section-scroll-nav--mobile {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .horizontal-scroll-section .horizontal-scroll-viewport {
    width: 100vw;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin-top: 25px;
    /* Hide scrollbar on mobile browsers */
    scrollbar-width: none;
  }

  .horizontal-scroll-section .horizontal-scroll-viewport::-webkit-scrollbar {
    display: none;
  }

  .horizontal-scroll-section .scroll-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 20px;
    padding-left: 24px;
    padding-right: 24px;
    width: max-content;
  }

  .horizontal-scroll-section .card-service {
    width: 250px;
    flex-shrink: 0;
    scroll-snap-align: center;
  }

  .horizontal-scroll-section .card-vertical {
    width: 250px;
    flex-shrink: 0;
    scroll-snap-align: center;
  }
}

/* -------------------------------------------------------------
   3D CYLINDER ROLL-UP REVEAL ANIMATION FOR CARDS
   ------------------------------------------------------------- */
.card-service.reveal,
.card-vertical.reveal {
  opacity: 0;
  transform: perspective(1400px) rotateX(-15deg) scale(0.95);
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: opacity 1.3s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 1.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-service.reveal.active,
.card-vertical.reveal.active {
  opacity: 1;
  transform: perspective(1400px) rotateX(0deg) scale(1);
}

/* On desktop — hide arrow nav (only relevant on mobile/tablet swipe) */
@media (min-width: 1024px) {
  .section-scroll-nav--mobile {
    display: none;
  }
}

/* Staggered transition delay on desktop viewports */
@media (min-width: 1024px) {
  .scroll-track .card-service.reveal:nth-child(1) { transition-delay: 0s; }
  .scroll-track .card-service.reveal:nth-child(2) { transition-delay: 0.1s; }
  .scroll-track .card-service.reveal:nth-child(3) { transition-delay: 0.2s; }
  .scroll-track .card-service.reveal:nth-child(4) { transition-delay: 0.3s; }
  .scroll-track .card-service.reveal:nth-child(5) { transition-delay: 0.4s; }

  .scroll-track .card-vertical.reveal:nth-child(1) { transition-delay: 0s; }
  .scroll-track .card-vertical.reveal:nth-child(2) { transition-delay: 0.1s; }
  .scroll-track .card-vertical.reveal:nth-child(3) { transition-delay: 0.2s; }
  .scroll-track .card-vertical.reveal:nth-child(4) { transition-delay: 0.3s; }
  .scroll-track .card-vertical.reveal:nth-child(5) { transition-delay: 0.4s; }
  .scroll-track .card-vertical.reveal:nth-child(6) { transition-delay: 0.5s; }
}



/* Specificity overrides to ensure smooth, immediate 3D-aware hover interactions */
.card-service.reveal.active:hover,
.card-vertical.reveal.active:hover {
  transform: perspective(1400px) rotateX(0deg) translateY(-6px) scale(1);
  border-color: var(--accent-cyan);
  box-shadow: 0 10px 30px rgba(97, 117, 162, 0.12);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: 0s;
}



/* -------------------------------------------------------------
   TESTIMONIALS SECTION
   ------------------------------------------------------------- */
.testimonials-section {
  padding-top: 57.12px;
  padding-bottom: var(--section-vertical-padding);
  background-color: transparent;
  border-bottom: 1px solid var(--border-card);
}

/* Slider nav arrows */
.testimonials-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.testimonials-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-card);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.testimonials-arrow svg {
  width: 18px;
  height: 18px;
}

.testimonials-arrow:hover:not(:disabled) {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(97, 117, 162, 0.08);
}

.testimonials-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Slider wrapper */
.testimonials-slider-wrap {
  overflow: hidden;
  overflow-y: visible;
  margin-top: 16px;
  padding-top: 8px;
  /* Extra space below so lifted cards don't get clipped and mousemove zone extends */
  padding-bottom: 12px;
  margin-bottom: -12px;
}

/* During entry animation — clip only vertically, allow horizontal fly-in from right */
.testimonials-slider-wrap.animating {
  overflow: visible;
  clip-path: inset(0 0 0 0);
}

.testimonials-track {
  display: grid;
  grid-template-columns: repeat(6, calc((100% - 40px) / 3));
  gap: 20px;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

@media (max-width: 999px) {
  .testimonials-track {
    grid-template-columns: repeat(6, calc((100% - 20px) / 2));
  }
}

@media (max-width: 699px) {
  .testimonials-track {
    grid-template-columns: repeat(6, 100%);
  }
}

@keyframes testimonial-fly-in {
  from {
    opacity: 0;
    transform: translateX(120vw);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Horizontal card: text left, image right (30%) */
.testimonial-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow: hidden;
  height: 220px;
  background-color: #152943;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  background-clip: padding-box;
  opacity: 0;
  transform: translateX(0);
  transition: border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.testimonial-card.visible {
  opacity: 1;
}

.testimonial-card.animating {
  animation: testimonial-fly-in 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.testimonial-card.visible.hovered {
  transform: translateY(-6px);
  border-color: var(--accent-cyan);
  box-shadow: 0 10px 30px rgba(97, 117, 162, 0.12);
}

.testimonial-body {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 70%;
  padding: 22px 24px 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
}

/* Image as a background, pinned to the right, out of the text flow */
.testimonial-image {
  position: absolute;
  top: 0;
  right: -8%;
  bottom: 0;
  z-index: 1;
  height: 100%;
  pointer-events: none;
}

.testimonial-image img {
  width: auto;
  height: 100%;
  object-fit: contain;
  object-position: right center;
  display: block;
}

/* Line 1: company icon + name, and stars */
.testimonial-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.testimonial-company {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.testimonial-company-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  color: var(--accent-blue);
  background: rgba(124, 145, 191, 0.12);
  border: 1px solid var(--border-glow);
}

.testimonial-company-icon svg {
  width: 16px;
  height: 16px;
}

.testimonial-company-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.testimonial-stars {
  color: var(--accent-blue);
  font-size: 0.9rem;
  letter-spacing: 1px;
  flex-shrink: 0;
}

/* Line 2: review text */
.testimonial-quote {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

/* Line 3: author name + role (role on its own line) */
.testimonial-author {
  display: flex;
  flex-direction: column;
}

.testimonial-author-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-white);
  font-family: var(--font-serif);
}

.testimonial-author-role {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.8;
}

@media (max-width: 480px) {
  .testimonial-body {
    width: 78%;
    padding: 18px;
  }

  .testimonial-image {
    right: -13%;
    height: 100%;
    top: 0;
    transform: none;
    bottom: 0;
  }

  .testimonial-image img {
    max-width: none;
  }
}
