/*
 * single-project.css  —  Case Study single page styles
 *
 * Loaded only on: is_singular('projects')
 * CSS prefix:     cs-*
 * Spacing grid:   8pt  (8 | 16 | 24 | 32 | 40 | 48 | 64 | 80 | 96)
 * Design system:  Inherits variables from services-technology.css
 *
 * Section map:
 *  1.  Hero overrides              .cs-hero
 *  2.  Project meta strip          .cs-meta-strip
 *  3.  Section scaffold            .cs-section, .cs-container, .cs-section-badge
 *  4.  Challenge                   .cs-challenge
 *  5.  Solution                    .cs-solution
 *  6.  Shared WYSIWYG prose        .cs-wysiwyg
 *  7.  Technology stack            .cs-tech
 *  8.  Results                     .cs-results
 *  9.  Gallery                     .cs-gallery
 * 10.  Testimonial                 .cs-testimonial
 * 11.  Related case studies        .cs-related
 * 12.  Type / industry badges      .cs-type-badge, .cs-industry-badge
 * 13.  Callout block               .cs-callout
 * 14.  Solution pillars            .cs-pillars, .cs-pillar
 * 15.  Responsive
 */

/* ─────────────────────────────────────────────────────────────
   0.  LOCAL VARIABLE FALLBACKS
   Anchored to variables already defined in services-technology.css.
   These declarations act as safe fallbacks only — they do NOT
   override the originals because the original file loads first.
   ───────────────────────────────────────────────────────────── */
:root {
  --cs-primary: var(--services-primary-color, #f69320);
  --cs-bg-dark: var(--services-bg-dark, #0a0e27);
  --cs-bg-card: var(--services-bg-card, rgba(255, 255, 255, 0.03));
  --cs-border: var(--services-border-color, rgba(255, 255, 255, 0.1));
  --cs-text-primary: #ffffff;
  --cs-text-muted: rgba(255, 255, 255, 0.6);
  --cs-radius: 16px;
  --cs-radius-sm: 8px;
  --cs-container-max: 1200px;
}

/* ─────────────────────────────────────────────────────────────
   1.  HERO OVERRIDES
   services-technology-hero already handles the full hero style.
   These overrides handle cs-specific elements only.
   ───────────────────────────────────────────────────────────── */
/* Hero — fully visible overflow so stats grid is never clipped.
   .services-technology-hero has overflow:hidden in services-technology.css;
   this selector (.cs-hero.services-technology-hero) has higher specificity
   (2 classes vs 1 class) so it wins the cascade without !important. */
.cs-hero.services-technology-hero {
  overflow: visible;
  min-height: 100vh;
  /*padding-block: 80px;*/
}

/* Force hero stats to always be visible — belt-and-suspenders against any
   JS animation or stacking-context issue hiding these on page load. */
.cs-hero__stats {
  position: relative;
  z-index: 2;
}

.cs-hero__stats .services-stat-card {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cs-hero__stats .services-stat-number {
  display: block;
}

.cs-hero__stats .services-stat-label {
  display: block;
}

.cs-hero__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 50% at 70% 40%,
    rgba(246, 147, 32, 0.06) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.cs-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 70%, var(--cs-bg-dark) 100%);
  pointer-events: none;
}

/* Single-project hero visual upscale (desktop/laptop only)
   Keeps shared services hero intact on other templates. */
@media (min-width: 1025px) {
  .cs-hero .services-hero-container {
    max-width: 1320px;
  }

  .cs-hero .services-hero-content {
    grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
    gap: 52px;
  }

  .cs-hero .services-hero-text {
    position: relative;
    z-index: 35;
    margin-right: -10%;
  }

  .cs-hero .services-hero-visual {
    position: relative;
    z-index: 20;
    transform: translateX(4%);
    min-height: 640px;
  }

  .cs-hero .services-orbit-container {
    width: 600px;
    height: 600px;
  }

  .cs-hero .services-astronaut {
    width: 450px;
    height: 450px;
  }

  .cs-hero .services-float-card-1 {
    top: -14px;
    right: 20%;
    z-index: 30;
  }

  .cs-hero .services-float-card-2 {
    bottom: 40px;
    left: 10%;
    z-index: 30;
  }

  .cs-hero .services-float-card-3 {
    top: 45%;
    left: -7%;
    transform: translate(-8%, -8%);
    z-index: 30;
  }
}

@media (min-width: 1366px) {
  .cs-hero .services-hero-container {
    max-width: 1440px;
    padding-inline: 28px;
  }

  .cs-hero .services-hero-content {
    grid-template-columns: minmax(0, 56fr) minmax(0, 44fr);
    gap: 60px;
  }

  .cs-hero .services-hero-text {
    margin-right: -10%;
  }

  .cs-hero .services-hero-visual {
    transform: translateX(6%);
    min-height: 760px;
  }

  .cs-hero .services-orbit-container {
    width: 760px;
    height: 760px;
  }

  .cs-hero .services-astronaut {
    width: 590px;
    height: 590px;
  }

  .cs-hero .services-float-card-1 {
    top: -40px;
    right: 14%;
  }

  .cs-hero .services-float-card-2 {
    bottom: 52px;
    left: 6%;
  }

  .cs-hero .services-float-card-3 {
    top: 42%;
    left: -10%;
    transform: translate(-8%, -8%);
  }
}

/* Tablet (769px – 1024px): 2-col, scaled orbit; section already clips overflow */
@media (min-width: 769px) and (max-width: 1024px) {
  .cs-hero .services-hero-container {
    max-width: 100%;
    padding-inline: 24px;
  }

  .cs-hero .services-hero-content {
    grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
    gap: 24px;
    align-items: center;
  }

  .cs-hero .services-hero-text {
    margin-right: 0;
    z-index: 35;
  }

  .cs-hero .services-hero-text .services-hero-title {
    font-size: 34px !important;
    white-space: normal;
    line-height: 1.15em !important;
  }

  .cs-hero .services-hero-subtitle {
    font-size: 18px !important;
    line-height: 1.35em !important;
  }

  .cs-hero .services-hero-description {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .cs-hero .services-hero-visual {
    min-height: 340px;
    transform: none;
  }

  .cs-hero .services-orbit-container {
    width: 320px;
    height: 320px;
    transform: none;
  }

  .cs-hero .services-astronaut {
    width: 260px;
    height: 260px;
  }

  .cs-hero .services-float-card-1 {
    top: -10px;
    right: 5%;
  }

  .cs-hero .services-float-card-2 {
    bottom: 20px;
    left: 4%;
  }

  .cs-hero .services-float-card-3 {
    top: 44%;
    left: -4%;
    transform: translate(-4%, -8%);
  }
}

/* Breadcrumb */
.cs-breadcrumb {
  margin-bottom: 32px;
}

.cs-breadcrumb__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cs-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.cs-breadcrumb__link:hover,
.cs-breadcrumb__link:focus-visible {
  color: var(--cs-primary);
  text-decoration: none;
}

/* Badge row composites in hero */
.cs-hero__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

/* Equalize services-hero-badge height with cs-type-badge / cs-industry-badge */
.cs-hero__badges .services-hero-badge {
  padding: 4px 12px;
  margin-bottom: 0;
  font-size: 0.75rem;
  border-radius: 24px;
}

/* ─────────────────────────────────────────────────────────────
   2.  TYPE / INDUSTRY BADGES  (used in hero + related grid)
   ───────────────────────────────────────────────────────────── */
.cs-type-badge,
.cs-industry-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 24px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.cs-type-badge {
  background: rgba(246, 147, 32, 0.12);
  border: 1px solid rgba(246, 147, 32, 0.35);
  color: var(--cs-primary);
}

.cs-industry-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--cs-border);
  color: var(--cs-text-muted);
}

/* ─────────────────────────────────────────────────────────────
   3.  SECTION SCAFFOLD
   .cs-container  — max-width wrapper
   .cs-section    — vertical rhythm
   .cs-section-badge — orange uppercase pill
   .cs-section__header — title block
   ───────────────────────────────────────────────────────────── */
.cs-container {
  max-width: var(--cs-container-max);
  margin-inline: auto;
  padding-inline: 24px;
}

.cs-section {
  padding-block: 96px;
  /* background intentionally omitted — page body provides dark base;
	   add cs-section--glass for glass effect or let body colour show through */
}

/* ── Glass modifier — applied via ACF toggle per section ──────────────────── *
 * Works on .cs-section, .cs-meta-strip and .contact-section alike.            *
 * Uses var(--slm-border) to stay consistent with glassmorphism used sitewide. */
.cs-section--glass {
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--slm-border, rgba(255, 255, 255, 0.08));
  border-bottom: 1px solid var(--slm-border, rgba(255, 255, 255, 0.08));
}

.cs-section + .cs-section {
  border-top: 1px solid var(--cs-border);
}

/* ── Glass modifier — applied via ACF toggle per section ──────────────────── *
 * Defined AFTER the + .cs-section separator so its border-top naturally wins  *
 * in the cascade. Works on .cs-section, .cs-meta-strip and .contact-section.  *
 * Uses var(--slm-border) to stay consistent with glassmorphism used sitewide. */
.cs-section--glass {
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--slm-border, rgba(255, 255, 255, 0.08));
  border-bottom: 1px solid var(--slm-border, rgba(255, 255, 255, 0.08));
}

.cs-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(246, 147, 32, 0.1);
  border: 1px solid rgba(246, 147, 32, 0.3);
  border-radius: 24px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cs-primary);
  margin-bottom: 16px;
}

.cs-section__header {
  margin-bottom: 48px;
}

.cs-section__header--centered {
  text-align: center;
}

.cs-section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: var(--cs-text-primary);
  line-height: 1.2;
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────
   4.  PROJECT META STRIP
   ───────────────────────────────────────────────────────────── */
.cs-meta-strip {
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--cs-border);
  border-bottom: 1px solid var(--cs-border);
  /* Full-bleed: span full viewport width regardless of any parent container */
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  box-sizing: border-box;
}

.cs-meta-strip__inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  width: 100%;
  /*padding-inline: 24px;*/
}

.cs-meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 16px 24px;
  border-right: 1px solid var(--cs-border);
  flex: 1 1 0;
  min-width: 0;
}

.cs-meta-item:last-child {
  border-right: none;
}

/* Row 1: icon + label side by side, centred */
.cs-meta-item__header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cs-meta-item__icon {
  color: var(--cs-primary);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.cs-meta-item__logo {
  height: 0.875rem;
  width: auto;
  max-width: 48px;
  object-fit: contain;
  vertical-align: middle;
  display: block;
  /* Orange tint matching var(--cs-primary) #f39222 */
  filter: brightness(0) saturate(100%) invert(63%) sepia(63%) saturate(556%)
    hue-rotate(357deg) brightness(101%) contrast(94%);
  flex-shrink: 0;
}

/* Row 2: value below */
.cs-meta-item__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cs-text-muted);
}

.cs-meta-item__value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cs-text-primary);
}

.cs-meta-item--link {
  /* inherits .cs-meta-item layout — matches other items exactly */
}

.cs-meta-link {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  color: #f39222;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.cs-meta-link:hover,
.cs-meta-link:focus-visible {
  opacity: 0.75;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─────────────────────────────────────────────────────────────
   5.  CHALLENGE / SOLUTION FLIP CARD
   ───────────────────────────────────────────────────────────── */
.cs-flip-anchor {
  display: block;
  position: relative;
  top: -110px;
  visibility: hidden;
}

.cs-flip-section {
  position: relative;
  /* overflow:clip prevents the 3D-perspective card from causing horizontal
	   scroll, without creating a BFC (unlike overflow:hidden) so internal
	   box-shadows are not clipped within the section's ample padding. */
  overflow: clip;
}

/* ── Shell & nav ─────────────────────────────────────────────── */
.cs-flip-shell {
  position: relative;
  z-index: 1;
}

/* Pills sit above + overlap the card's top edge */
.cs-flip-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0;
  padding: 0;
  margin-bottom: -22px;
  background: none;
  border: none;
  box-shadow: none;
  position: relative;
  z-index: 10;
}

/* Each pill is independently floating */
.cs-flip-pill {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 10px 16px;
  min-height: 50px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 14, 28, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition:
    color 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.2s ease;
}

.cs-flip-pill__label {
  white-space: nowrap;
}

.cs-flip-pill__icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  background: rgba(246, 147, 32, 0.22);
  color: #f69320;
  flex-shrink: 0;
  transition:
    background 0.22s ease,
    color 0.2s ease;
}

.cs-flip-pill:hover,
.cs-flip-pill:focus-visible {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.cs-flip-pill:focus-visible {
  outline: 2px solid rgba(246, 147, 32, 0.5);
  outline-offset: 3px;
}

/* Active pill — brighter + coloured border */
.cs-flip-pill.is-active {
  color: #fff;
  border-color: rgba(246, 147, 32, 0.5);
  background: rgba(10, 14, 28, 0.92);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(246, 147, 32, 0.2);
}

.cs-flip-pill.is-active .cs-flip-pill__icon {
  background: #f69320;
  color: #fff;
}

/* ── 3D flip mechanics ────────────────────────────────────────── */
.cs-flip {
  position: relative;
  z-index: 1;
  perspective: 1800px;
}

.cs-flip__inner {
  position: relative;
  transform-style: preserve-3d;
  transition:
    transform 0.78s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.cs-flip.is-flipped .cs-flip__inner {
  transform: rotateY(180deg);
}

/* ── Face base ────────────────────────────────────────────────── */
/* NOTE: backdrop-filter is intentionally NOT set here — it breaks
   backface-visibility in all major browsers, causing the back face
   to bleed through the front face. Glass effect is achieved via
   high-opacity background colors instead. */
.cs-flip__face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: clamp(20px, 3.5vw, 48px);
  padding: clamp(28px, 3.6vw, 52px);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  overflow: hidden;
  isolation: isolate;
  /* Visibility timing trick: hard-hide the non-active face
	   exactly at the midpoint of the flip transition (0.39s = half of 0.78s). */
  transition: visibility 0s linear 0.39s;
  visibility: visible;
}

.cs-flip__face > * {
  position: relative;
  z-index: 2;
}

/* Glassmorphism blur layer — on ::before child so backface-visibility on parent still works */
.cs-flip__face::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-radius: inherit;
  pointer-events: none;
}

/* Gradient sheen (z-index 1, sits above texture) */
.cs-flip__face::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* FRONT — cool blue / midnight blue diagonal glass */
.cs-flip__face--front {
  background: linear-gradient(
    135deg,
    rgba(18, 28, 60, 0.5) 0%,
    rgba(22, 10, 38, 0.35) 55%,
    rgba(8, 18, 48, 0.5) 100%
  );
  border: 1px solid rgba(90, 140, 220, 0.42);
  /* Show front immediately when card is not flipped */
  transition: visibility 0s linear 0s;
}

.cs-flip__face--front::before {
  /* no SVG texture */
}

.cs-flip__face--front::after {
  background:
    radial-gradient(
      ellipse 52% 44% at 90% 88%,
      rgba(59, 90, 200, 0.35) 0%,
      transparent 65%
    ),
    radial-gradient(
      ellipse 38% 30% at 78% 12%,
      rgba(246, 147, 32, 0.18) 0%,
      transparent 55%
    );
}

/* BACK — warm amber / brown diagonal glass, hidden until flip midpoint */
.cs-flip__face--back {
  transform: rotateY(180deg);
  background: linear-gradient(
    135deg,
    rgba(58, 28, 6, 0.5) 0%,
    rgba(38, 18, 4, 0.35) 50%,
    rgba(26, 12, 2, 0.5) 100%
  );
  border: 1px solid rgba(246, 147, 32, 0.46);
  /* Hide back face by default; reveal only after flip midpoint */
  visibility: hidden;
  transition: visibility 0s linear 0.39s;
}

/* When flipped: back face becomes visible immediately, front hides at midpoint */
.cs-flip.is-flipped .cs-flip__face--back {
  visibility: visible;
  transition: visibility 0s linear 0s;
}

.cs-flip.is-flipped .cs-flip__face--front {
  visibility: hidden;
  transition: visibility 0s linear 0.39s;
}

.cs-flip__face--back::before {
  /* no SVG texture */
}

.cs-flip__face--back::after {
  background:
    radial-gradient(
      ellipse 50% 42% at 10% 85%,
      rgba(180, 90, 10, 0.38) 0%,
      transparent 65%
    ),
    radial-gradient(
      ellipse 36% 28% at 22% 10%,
      rgba(246, 147, 32, 0.22) 0%,
      transparent 55%
    );
}

/* ── Two-column face grid ─────────────────────────────────────── */
.cs-face-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
  height: 100%;
}

/* Reversed: image/logo on left, text on right */
.cs-face-grid--reversed {
  grid-template-columns: 1fr 2fr;
}

.cs-face-col {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2vw, 28px);
}

/* ── Title inside face ────────────────────────────────────────── */
.cs-face__title {
  font-size: clamp(1.55rem, 2.8vw, 2.4rem);
  line-height: 1.2;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px;
}

/* Orange accent on last line / keyword — keep existing pattern */
.cs-flip__face--back .cs-face__title {
  color: #fff;
}

/* ── Text in face ─────────────────────────────────────────────── */
.cs-flip__face .cs-wysiwyg {
  font-size: clamp(0.88rem, 1.1vw, 0.97rem);
  line-height: 1.78;
  color: rgba(255, 255, 255, 0.82);
}

/* ── Callout overrides inside face ───────────────────────────── */
.cs-flip__face .cs-callout {
  position: static;
  top: auto;
  background: rgba(246, 147, 32, 0.1);
  border: 1px solid rgba(246, 147, 32, 0.35);
  border-radius: 16px;
  padding: 24px 20px;
}

.cs-flip__face .cs-callout__bar {
  background: #f69320;
}

.cs-flip__face .cs-callout__quote {
  font-size: 0.93rem;
  line-height: 1.65;
}

/* ── Orbit / logo circle ─────────────────────────────────────── */
.cs-face-logo {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-face-logo__img {
  width: clamp(140px, 22vw, 220px);
  height: clamp(140px, 22vw, 220px);
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.cs-face-logo--flat .cs-face-logo__img {
  border-radius: 12px;
  width: clamp(100px, 16vw, 160px);
  height: auto;
}

/* ── Architecture diagram (solution image) ───────────────────── */
.cs-face-figure {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(246, 147, 32, 0.22);
  background: rgba(246, 147, 32, 0.06);
}

.cs-face-figure__img {
  width: 100%;
  height: auto;
  display: block;
}

.cs-face-figure__caption {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  padding: 8px 12px;
  text-align: center;
}

/* ── Pillars inside solution face ────────────────────────────── */
.cs-face-pillars {
  margin-top: 6px;
  gap: 8px;
}

.cs-flip__face .cs-pillar {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.9);
  /* override .services-card padding:30px */
  padding: 0 !important;
  /* override GSAP scroll-animation initial state */
  opacity: 1 !important;
  transform: none !important;
}

.cs-flip__face .cs-pillar .services-card-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
}

.cs-flip__face .cs-pillar .cs-pillar-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cs-flip__face .cs-pillar .services-card-icon {
  color: #f69320;
  font-size: 1rem;
  flex-shrink: 0;
  width: auto;
  height: auto;
  margin: 0;
}

.cs-flip__face .cs-pillar .services-card-title,
.cs-flip__face .cs-pillar .cs-pillar__title {
  color: #fff;
  margin: 0;
  line-height: 1.3;
}

.cs-flip__face .cs-pillar .services-card-description,
.cs-flip__face .cs-pillar .cs-pillar__desc {
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
  font-size: 0.82rem !important;
  line-height: 1.5;
}

/* ── Reduced-motion bypass ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cs-flip__inner {
    transition: none;
  }
}

/* ── Responsive ──────────────────────────────────────────────── */

/* ── ≤ 860px: completely disable 3D — switch to crossfade ────────
   CSS 3D (preserve-3d + rotateY) cannot be clipped by ANY overflow
   rule (overflow:clip/hidden on ancestors is bypassed by the shared
   3D rendering context). Solution: kill perspective + preserve-3d,
   use opacity crossfade instead. JS still works — it only toggles
   the .is-flipped class which we re-map to opacity below.       ── */
@media (max-width: 860px) {
  .cs-face-grid,
  .cs-face-grid--reversed {
    grid-template-columns: 1fr;
  }

  .cs-face-logo {
    justify-content: flex-start;
  }

  /* ── Disable 3D on the flip root ── */
  .cs-flip {
    perspective: none;
  }

  /* Inner: no longer rotates — acts only as a height-managed stacking context */
  .cs-flip__inner {
    transform-style: flat;
    transform: none !important;
    transition: none;
  }

  /* Faces: crossfade instead of 3D flip ── */
  .cs-flip__face {
    -webkit-backface-visibility: visible;
    backface-visibility: visible;
    width: 90%;
    left: 0%;
  }

  /* Front — visible by default */
  .cs-flip__face--front {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition:
      opacity 0.42s ease,
      visibility 0s linear 0s;
  }

  /* Back — hidden by default (override the rotateY(180deg)) */
  .cs-flip__face--back {
    opacity: 0;
    visibility: hidden;
    transform: none;
    transition:
      opacity 0.42s ease,
      visibility 0s linear 0.42s;
  }

  /* When flipped: front fades out, back fades in */
  .cs-flip.is-flipped .cs-flip__inner {
    transform: none !important;
  }

  .cs-flip.is-flipped .cs-flip__face--front {
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.42s ease,
      visibility 0s linear 0.42s;
  }

  .cs-flip.is-flipped .cs-flip__face--back {
    opacity: 1;
    visibility: visible;
    transition:
      opacity 0.42s ease,
      visibility 0s linear 0s;
  }
}

@media (max-width: 480px) {
  .cs-flip-nav {
    margin-bottom: -16px;
  }
}

@media (max-width: 680px) {
  .cs-flip-pill {
    padding: 8px 14px 8px 12px;
    min-height: 44px;
    font-size: 0.82rem;
    gap: 8px;
  }

  .cs-flip-pill__icon {
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
  }

  .cs-flip__face {
    padding: clamp(20px, 5vw, 32px);
  }

  .cs-face-logo__img {
    width: 120px;
    height: 120px;
  }
}

/* ─────────────────────────────────────────────────────────────
   6.  CHALLENGE SECTION
   ───────────────────────────────────────────────────────────── */
.cs-challenge__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 900px) {
  .cs-challenge__body {
    grid-template-columns: 1fr 360px;
    align-items: start;
  }
}

/* ─────────────────────────────────────────────────────────────
	7.  CALLOUT / PULL QUOTE
   ───────────────────────────────────────────────────────────── */
.cs-callout {
  display: flex;
  gap: 16px;
  background: rgba(246, 147, 32, 0.06);
  border: 1px solid rgba(246, 147, 32, 0.2);
  border-radius: var(--cs-radius);
  padding: 32px;
  align-self: start;
  position: sticky;
  top: 120px;
}

.cs-callout__bar {
  width: 3px;
  border-radius: 3px;
  background: var(--cs-primary);
  flex-shrink: 0;
}

.cs-callout__quote {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.85);
  font-style: italic;
}

.cs-callout__icon {
  color: var(--cs-primary);
  margin-right: 8px;
  font-size: 0.875rem;
  vertical-align: middle;
}

/* ─────────────────────────────────────────────────────────────
	8.  SOLUTION SECTION
   ───────────────────────────────────────────────────────────── */
.cs-solution__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  margin-bottom: 64px;
}

@media (min-width: 900px) {
  .cs-solution__grid {
    grid-template-columns: 1fr 400px;
    align-items: start;
  }
}

.cs-solution__figure {
  margin: 0;
}

.cs-solution__image {
  width: 100%;
  height: auto;
  border-radius: var(--cs-radius);
  border: 1px solid var(--cs-border);
  display: block;
}

.cs-solution__caption {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--cs-text-muted);
  text-align: center;
}

/* ─────────────────────────────────────────────────────────────
   8.  SOLUTION PILLARS  (max 3, evenly distributed)
   ───────────────────────────────────────────────────────────── */
.cs-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.cs-pillar {
  /* inherits .services-card glassmorphism styles */
}

.cs-pillar__title {
  font-size: 1rem !important;
}

.cs-pillar__desc {
  font-size: 0.875rem !important;
}

/* ─────────────────────────────────────────────────────────────
   9.  WYSIWYG PROSE
   Consistent typography for ACF wysiwyg fields.
   ───────────────────────────────────────────────────────────── */
.cs-wysiwyg {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.75;
  font-size: 1rem;
}

.cs-wysiwyg h2,
.cs-wysiwyg h3,
.cs-wysiwyg h4 {
  color: var(--cs-text-primary);
  margin-top: 32px;
  margin-bottom: 16px;
}

.cs-wysiwyg p {
  margin-bottom: 20px;
}

.cs-wysiwyg p:last-child {
  margin-bottom: 0;
}

.cs-wysiwyg ul,
.cs-wysiwyg ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.cs-wysiwyg li {
  margin-bottom: 8px;
}

.cs-wysiwyg a {
  color: var(--cs-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cs-wysiwyg strong {
  color: var(--cs-text-primary);
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────
   10. TECHNOLOGY STACK
   Reuses .technologies-tag classes —  only sizing/spacing here.
   ───────────────────────────────────────────────────────────── */
.cs-tech__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.cs-tech__tag {
  font-size: 0.875rem;
  padding: 10px 20px;
}

/* ─────────────────────────────────────────────────────────────
   11. RESULTS SECTION
   ───────────────────────────────────────────────────────────── */
.cs-results__stats {
  justify-content: center;
  margin-bottom: 64px;
}

/* GSAP sets opacity:0 on .services-stat-card globally — override for results */
.cs-results__stats .services-stat-card {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cs-results__stats .cs-results__stat-icon,
.cs-results__stats .services-stat-number,
.cs-results__stats .cs-results__stat-number,
.cs-results__stats .services-stat-label {
  display: block;
  width: 100%;
  text-align: center;
}

/* Stat cards from services-technology get slightly larger numbers */
.cs-results__stat-card .services-stat-number,
.cs-results__stat-number {
  font-size: clamp(2rem, 5vw, 3.5rem) !important;
}

.cs-results__stat-icon {
  color: var(--cs-primary);
  font-size: 1.5rem;
  margin-bottom: 8px;
}

/* Outcomes two-column list */
.cs-results__outcomes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 0;
  list-style: none;
  margin: 0 0 48px;
}

@media (min-width: 640px) {
  .cs-results__outcomes {
    grid-template-columns: 1fr 1fr;
  }
}

.cs-results__outcome {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
  padding: 16px;
  background: var(--cs-bg-card);
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius-sm);
}

.cs-results__outcome-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  background: var(--cs-primary);
  margin-top: 6px;
}

.cs-results__summary {
  text-align: center;
  color: var(--cs-text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
  max-width: 640px;
  margin-inline: auto;
}

/* ─────────────────────────────────────────────────────────────
   12. GALLERY
   ───────────────────────────────────────────────────────────── */
.cs-gallery {
  padding-block: 80px;
}

.cs-gallery__single {
  margin: 0 auto;
  max-width: 900px;
}

.cs-gallery__single-img {
  width: 100%;
  height: auto;
  border-radius: var(--cs-radius);
  border: 1px solid var(--cs-border);
  display: block;
}

.cs-gallery__swiper {
  max-width: 960px;
  margin-inline: auto;
  border-radius: var(--cs-radius);
  overflow: hidden;
}

.cs-gallery__figure {
  margin: 0;
}

.cs-gallery__img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  display: block;
}

.cs-gallery__caption {
  display: block;
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--cs-text-muted);
  text-align: center;
  padding: 0 16px 16px;
}

.cs-gallery__prev,
.cs-gallery__next {
  color: var(--cs-primary);
}

.cs-gallery__prev::after,
.cs-gallery__next::after {
  font-size: 1.25rem;
}

.cs-gallery__pagination .swiper-pagination-bullet {
  background: var(--cs-text-muted);
  opacity: 1;
}

.cs-gallery__pagination .swiper-pagination-bullet-active {
  background: var(--cs-primary);
}

/* Clickable gallery images */
.cs-gallery__img,
.cs-gallery__single-img {
  cursor: zoom-in;
}

/* ─────────────────────────────────────────────────────────────
   12b. GALLERY LIGHTBOX — glassmorphism overlay
   ───────────────────────────────────────────────────────────── */
.cs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0s linear 0.3s;
}

.cs-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

.cs-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 25, 0.78);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  cursor: pointer;
}

.cs-lightbox__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 92vw;
}

.cs-lightbox__close {
  margin-bottom: 10px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 0.9rem;
  transition: background 0.2s;
  flex-shrink: 0;
}

.cs-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.26);
}

.cs-lightbox__img {
  display: block;
  max-width: 92vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.65);
}

.cs-lightbox__caption {
  display: block;
  width: 100%;
  margin-top: 12px;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
}

.cs-lightbox__caption:empty {
  display: none;
}

.cs-lightbox__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
  min-height: 20px;
}

.cs-lightbox__counter {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Prev / Next navigation buttons */
.cs-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 1rem;
  transition:
    background 0.2s,
    transform 0.2s;
  flex-shrink: 0;
}

.cs-lightbox__nav:hover {
  background: rgba(246, 147, 32, 0.25);
  border-color: rgba(246, 147, 32, 0.5);
  transform: translateY(-50%) scale(1.08);
}

.cs-lightbox__nav--prev {
  left: 16px;
}

.cs-lightbox__nav--next {
  right: 16px;
}

@media (max-width: 600px) {
  .cs-lightbox__nav {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }

  .cs-lightbox__nav--prev {
    left: 6px;
  }
  .cs-lightbox__nav--next {
    right: 6px;
  }
}

/* ─────────────────────────────────────────────────────────────
   13. CLIENT TESTIMONIAL
   ───────────────────────────────────────────────────────────── */
.cs-testimonial {
  background: linear-gradient(
    135deg,
    rgba(246, 147, 32, 0.04) 0%,
    rgba(10, 14, 39, 0.6) 100%
  );
}

.cs-testimonial__card {
  position: relative;
  max-width: 800px;
  margin-inline: auto;
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(246, 147, 32, 0.2);
  border-radius: var(--cs-radius);
  padding: 56px 48px 48px;
  overflow: hidden;
}

.cs-testimonial__quote-mark {
  position: absolute;
  top: 16px;
  left: 40px;
  font-size: 8rem;
  line-height: 1;
  font-family: Georgia, serif;
  color: rgba(246, 147, 32, 0.12);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  font-weight: 700;
}

.cs-testimonial__blockquote {
  position: relative;
  margin: 0 0 40px;
}

.cs-testimonial__icon {
  color: var(--cs-primary);
  font-size: 1.25rem;
  margin-bottom: 16px;
  display: block;
}

.cs-testimonial__text {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.88);
  font-style: italic;
  margin: 0;
}

.cs-testimonial__author {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cs-testimonial__avatar {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(246, 147, 32, 0.4);
}

.cs-testimonial__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Initials fallback — mirrors testimonial-avatar from services page */
.cs-testimonial__avatar--initials {
  background: linear-gradient(
    135deg,
    var(--cs-primary),
    rgba(246, 147, 32, 0.4)
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-testimonial__avatar--initials::after {
  content: attr(data-initials);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
}

.cs-testimonial__author-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cs-testimonial__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cs-text-primary);
}

.cs-testimonial__role {
  font-size: 0.8125rem;
  color: var(--cs-text-muted);
}

.cs-testimonial__company {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cs-primary);
}

.cs-testimonial__stars {
  color: var(--cs-primary);
  font-size: 0.75rem;
  margin-top: 4px;
}

.cs-testimonial__stars i + i {
  margin-left: 2px;
}

/* ─────────────────────────────────────────────────────────────
   14. RELATED CASE STUDIES GRID
   ───────────────────────────────────────────────────────────── */
.cs-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
  gap: 24px;
  justify-content: center;
}

.cs-related__card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* inherits services-card glassmorphism */
}

.cs-related__thumbnail {
  height: 200px;
  overflow: hidden;
  border-radius: var(--cs-radius) var(--cs-radius) 0 0;
}

.cs-related__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.cs-related__card:hover .cs-related__img {
  transform: scale(1.04);
}

.cs-related__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-related__type-badge {
  margin-bottom: 4px;
}

.cs-related__title {
  font-size: 1rem !important;
  margin-bottom: 4px;
}

.cs-related__client {
  font-size: 0.8125rem;
  color: var(--cs-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.cs-related__excerpt {
  font-size: 0.875rem !important;
  color: var(--cs-text-muted) !important;
  margin-bottom: auto !important;
}

.cs-related__link {
  margin-top: 16px;
}

/* ─────────────────────────────────────────────────────────────
   15. RESPONSIVE
   ───────────────────────────────────────────────────────────── */

/* Tablet (≤ 1024px) */
@media (max-width: 1024px) {
  .cs-section {
    padding-block: 64px;
  }

  .cs-meta-strip__inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .cs-meta-item {
    padding: 14px 18px;
    border-right: 1px solid var(--cs-border);
    border-bottom: 1px solid var(--cs-border);
    flex: unset;
  }

  /* Remove right border on every 3rd item (end of each row) */
  .cs-meta-item:nth-child(3n) {
    border-right: none;
  }

  /* Remove bottom border on last row (last 3 items) */
  .cs-meta-item:nth-last-child(-n + 3) {
    border-bottom: none;
  }

  .cs-testimonial__card {
    padding: 40px 32px 32px;
  }

  .cs-testimonial__quote-mark {
    font-size: 5rem;
    left: 24px;
  }
}

/* Mobile (≤ 767px) */
@media (max-width: 767px) {
  .cs-section {
    padding-block: 48px;
  }

  .cs-section__header {
    margin-bottom: 32px;
  }

  .cs-meta-strip__inner {
    display: grid;
    grid-template-columns: 1fr;
  }

  .cs-meta-item {
    border-right: none;
    border-bottom: 1px solid var(--cs-border);
    padding: 12px 16px;
    flex: unset;
  }

  /* Override tablet nth-child rules for mobile */
  .cs-meta-item:nth-child(3n) {
    border-right: none;
  }

  .cs-meta-item:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--cs-border);
  }

  .cs-meta-item:last-child {
    border-bottom: none;
  }

  .cs-flip__face {
    padding: 28px 20px;
    border-radius: 16px;
  }

  .cs-flip__face::before {
    opacity: 0.12;
  }

  .cs-flip__actions {
    margin-top: 28px;
  }

  .cs-flip__face .cs-section__header {
    margin-bottom: 22px;
    padding-bottom: 12px;
  }

  .cs-flip__face .cs-section-title {
    font-size: clamp(1.35rem, 6.2vw, 1.95rem);
  }

  .cs-flip__face .cs-solution__grid {
    margin-bottom: 28px;
  }

  .cs-flip__actions--front,
  .cs-flip__actions--back {
    justify-content: center;
  }

  .cs-flip__button {
    width: 100%;
    justify-content: center;
  }

  .cs-challenge__body,
  .cs-solution__grid {
    grid-template-columns: 1fr;
  }

  .cs-callout {
    position: static;
  }

  .cs-testimonial__card {
    padding: 32px 24px 24px;
  }

  .cs-testimonial__quote-mark {
    display: none;
  }

  .cs-gallery__img {
    height: 280px;
  }

  .cs-related__grid {
    grid-template-columns: 1fr;
  }

  .cs-pillars {
    grid-template-columns: 1fr;
  }

  .cs-results__stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* Small mobile (≤ 480px) */
@media (max-width: 480px) {
  .cs-container {
    padding-inline: 16px;
  }

  .cs-results__stats {
    grid-template-columns: 1fr;
  }

  .cs-results__outcomes {
    grid-template-columns: 1fr;
  }

  .cs-testimonial__author {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-flip__inner {
    transition: none;
  }

  .cs-flip__button {
    transition: none;
  }
}

/* ─────────────────────────────────────────────────────────────
   16. RELATED SECTION — bypass services-technology.js scroll animation
       services-technology.js injects:  .services-card { opacity: 0 }
       and adds .animate-in via IntersectionObserver. Related cards
       don't need an entrance animation — force them always visible.
   ───────────────────────────────────────────────────────────── */
.cs-related__card.services-card,
.cs-related__card.services-card.animate-in {
  opacity: 1 !important;
  transform: none !important;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease !important;
}

/* ─────────────────────────────────────────────────────────────
   17. ACCESSIBILITY / REDUCED MOTION
   ───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cs-related__img {
    transition: none;
  }
}

/* Section typography alignment (same scale as services-technology). */
.cs-section-title,
.contact-title {
  font-family: "Montserrat", sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.2;
}

.contact-description {
  font-family: "Hind", sans-serif;
  font-size: 1.1rem;
  line-height: 1.8;
}

@media (max-width: 768px) {
  .cs-section-title,
  .contact-title {
    font-size: clamp(1.7rem, 6vw, 2.4rem);
  }

  .contact-description {
    font-size: 0.95rem;
    line-height: 1.7;
  }
}

@media (max-width: 480px) {
  .cs-section-title,
  .contact-title {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  .contact-description {
    font-size: 0.9rem;
    line-height: 1.65;
  }
}
