.flex-container {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 15px;
  }
  .flex-slide {
    height: 700px;
    cursor: pointer;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    flex: 0 0 90px;
    transition: flex 500ms ease, padding 500ms ease;
    border: 2px solid rgba(178, 85, 255, 0.55);
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.35);
  }
  .flex-slide:hover {
    flex: 1 1 0;
  }
  .flex-background {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    border-radius: inherit;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
  }

  .flex-slide .bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    opacity: 0;
    transition: opacity 350ms ease;
    will-change: opacity;
    transform: translateZ(0);
  }

  .flex-slide.has-video .bg-video {
    opacity: 1;
  }

  .flex-slide.has-video .flexblur-overlay {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: rgba(88, 88, 88, 0.26);
  }

  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .flexblur-overlay {
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      background: rgba(88, 88, 88, 0.35);
    }
  }

  .e-commerce-solution {
    background: #592a9c;
  }
  .digital-marketing {
    background: #706f6f;
  }
  .content-creation {
    background: #ff4400;
  }
  .design-development {
    background: #662192;
  }
  .flex-title {
    width: 400px;
    height: 80px;
    color: #f1f1f1;
    position: relative;
    font-family: "ibr", sans-serif;
    font-size: clamp(1.65rem, 2.15vw, 2.35rem);
    font-weight: 500;
    margin: 0;
    transition: transform 500ms ease, top 500ms ease, left 500ms ease;
    display: flex;
    transform-origin: center;
    white-space: nowrap;
    text-transform: uppercase;
  }
  .flex-slide .flex-title {
    transform: rotate(-90deg);
    top: 395px;
    left: -185px;
  }
  .flex-slide:hover .flex-title {
    justify-content: flex-start;
    text-align: left;
    transform: rotate(0deg);
    top: 10%;
    left: 0px;
  }
  .flex-about {
    opacity: 0;
    color: #f1f1f1;
    position: relative;
    width: 100%;
    font-size: 18px;
    padding: 0;
    top: 20%;
    line-height: 1.3;
    text-align: left;
    transform: rotate(0deg);
    transition: opacity 500ms ease, top 500ms ease;
  }
  .flex-slide:hover .flex-about {
    opacity: 1;
    top: 10%;
  }
  .flex-slide.active {
  
    flex: 1 1 0; /* expanded */
  }
 
  .flex-slide.active .flex-title {
    justify-content: flex-start;
    text-align: left;
    transform: rotate(0deg);
    top: 10%;
    left: 0px;
  }
  .flex-slide.active .flex-about {
    opacity: 1;
    top: 10%;
  }
  
  @media only screen and (max-width: 768px) {
    .flex-container {
      flex-direction: column;
      gap: 8px;
    }

    .flex-slide {
      height: auto;
      min-height: 60px;
      flex: 0 0 auto;
      overflow: hidden;
      cursor: pointer;
      transition: min-height 400ms ease, box-shadow 300ms ease;
    }

    .flex-slide.active {
      min-height: min(85vh, 520px);
      flex: 0 0 auto;
    }

    .flex-title__short {
      display: inline;
    }

    .flex-title__full {
      display: none;
    }

    .flex-slide .flex-title,
    .flex-slide.active .flex-title,
    .flex-slide:hover .flex-title {
      position: static;
      top: auto;
      left: auto;
      width: 100%;
      height: auto;
      transform: none !important;
      justify-content: space-between;
      align-items: center;
      font-family: "ibr", sans-serif;
      font-size: clamp(0.9rem, 2.85vw, 1rem);
      font-weight: 500;
      letter-spacing: 0.07em;
      white-space: nowrap;
      text-transform: uppercase;
    }

    .flex-title--collapsed::after {
      content: "";
      flex-shrink: 0;
      width: 7px;
      height: 7px;
      margin-left: 10px;
      border-right: 2px solid currentColor;
      border-bottom: 2px solid currentColor;
      transform: rotate(45deg);
      transition: transform 300ms ease;
      opacity: 0.85;
    }

    .flex-slide.active .flex-title--collapsed::after {
      transform: rotate(-135deg);
    }

    .flex-overlay-content {
      justify-content: flex-start;
    }

    .flex-slide:not(.active) .flex-overlay-content {
      min-height: 60px;
      justify-content: center;
      padding: 14px 16px;
    }

    .flex-slide.active .flex-overlay-content {
      min-height: min(85vh, 520px);
      padding: 24px 16px 28px;
      gap: clamp(14px, 3.5vw, 22px);
    }

    .flex-title--expanded {
      font-size: clamp(20px, 6vw, 28px);
      line-height: 1.1;
      margin: 0;
    }

    .e-commerce-solution .flex-title--expanded {
      display: none;
    }

    .e-commerce-solution.active .flex-title--expanded {
      display: block;
    }

    .flex-about {
      padding: 0;
      font-size: 15px;
      line-height: 1.5;
      max-width: none;
      margin: 0;
    }

    .flex-slide p {
      font-size: 15px;
      margin: 0;
    }

    .flex-tags {
      display: none;
      flex-direction: column;
      gap: 6px;
      margin: 0;
      margin-top: auto;
      width: 100%;
      overflow: hidden;
    }

    .flex-tags-row {
      min-height: 28px;
      -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
              mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
    }

    .flex-tags-track {
      gap: 5px;
    }

    .flex-tags-track span {
      padding: 8px 14px;
      font-size: 12px;
      line-height: 1.2;
      letter-spacing: 0.01em;
      border-radius: 999px;
      border-width: 1px;
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
    }

    .flex-cta {
      margin-top: 12px;
      align-self: flex-start;
    }

    .flex-slide:not(.active) .flex-title--expanded,
    .flex-slide:not(.active) .flex-about,
    .flex-slide:not(.active) .flex-tags,
    .flex-slide:not(.active) .flex-cta {
      display: none;
      opacity: 0;
      pointer-events: none;
    }

    .flex-slide.active .flex-title--collapsed {
      display: none;
    }

    .flex-slide.active .flex-title--expanded,
    .flex-slide.active .flex-about,
    .flex-slide.active .flex-cta {
      display: block;
      opacity: 1;
      transform: none;
      pointer-events: auto;
    }

    .flex-slide.active .flex-tags {
      display: flex;
      opacity: 1;
      transform: none;
      pointer-events: auto;
    }

    .flex-slide.active .flex-about {
      display: block;
    }

    /* Prevent sticky :hover from opening cards on touch devices */
    .flex-slide:not(.active):hover .flex-title--expanded,
    .flex-slide:not(.active):hover .flex-about,
    .flex-slide:not(.active):hover .flex-tags,
    .flex-slide:not(.active):hover .flex-cta {
      display: none;
      opacity: 0;
      pointer-events: none;
    }

    .flex-slide:not(.active):hover .flex-title--collapsed {
      display: flex;
    }
  }

  @media only screen and (min-width: 769px) {
    .flex-title__short {
      display: none;
    }

    .flex-title__full {
      display: inline;
    }
  }
  
  @media only screen and (min-width: 767px) {
    .flex-slide {
      flex-basis: 120px;
    }

  }
  .flex-overlay-content{
 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 2;
    color: #fff;
  }

  @media only screen and (min-width: 769px) {
    .flex-overlay-content {
      padding: 48px 44px;
      gap: clamp(1.25rem, 2vw, 1.75rem);
    }
  }
  .flexblur-overlay{
    position: absolute;
    inset: 0;
    background: rgba(88, 88, 88, 0.212);
    border-radius: inherit;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    -moz-backdrop-filter: blur(10px);
    -ms-backdrop-filter: blur(10px);
    -o-backdrop-filter: blur(10px);
    z-index: 1;
  }

  /* Performance optimization: disable blur during scroll */


  /* ---- E-commerce card content styling (screenshot style) ---- */
  .flex-title--collapsed {
    font-family: "ibr", sans-serif;
    font-size: clamp(1.65rem, 2.15vw, 2.35rem);
    font-weight: 500;
    text-transform: uppercase;
  }

  .e-commerce-solution .flex-title--collapsed {
    width: 400px;
    height: 80px;
    opacity: 1;
  }

  .e-commerce-solution .flex-title--expanded {
    width: min(760px, 100%);
    margin: 0;
    height: auto;
    font-size: clamp(34px, 3.2vw, 60px);
    line-height: 1.05;
    letter-spacing: 0.5px;
    white-space: normal;
  }

  /* Only show collapsed label when closed; show big title when open */
  .e-commerce-solution:not(.active):not(:hover) .flex-title--expanded { display: none; }
  /* Hide the small (collapsed) title when the card is open */
  .e-commerce-solution.active .flex-title--collapsed,
  .e-commerce-solution:hover .flex-title--collapsed { display: none; }

  .flex-about {
    max-width: 760px;
    font-size: clamp(16px, 1.2vw, 22px);
    line-height: 1.35;
  }

  /* Make the e-commerce open layout "normal flex" (no top/left hacks). */
  @media only screen and (min-width: 769px) {
    .e-commerce-solution.active .flex-title--expanded,
    .e-commerce-solution:hover .flex-title--expanded {
      display: block;
    }
  }

  .e-commerce-solution.active .flex-about,
  .e-commerce-solution:hover .flex-about{
    position: static;
    top: auto;
  }

  /* Keep marquee spacing consistent — tags sit above the CTA at the card bottom. */
  .e-commerce-solution .flex-tags{
    margin-top: auto;
  }

  /* Generic (non e-commerce) expanded-title behaviour for the other cards */
  .flex-title--expanded{
    width: min(760px, 100%);
    margin: 0;
    height: auto;
    font-size: clamp(34px, 3.2vw, 60px);
    line-height: 1.05;
    letter-spacing: 0.5px;
    white-space: normal;
    text-transform: uppercase;
  }

  .flex-slide:not(.active):not(:hover) .flex-title--expanded { display: none; }
  .flex-slide.active .flex-title--collapsed,
  .flex-slide:hover .flex-title--collapsed { display: none; }

  /* Any flex content block should stay in normal flow */
  .flex-overlay-content .flex-about{
    position: static;
    top: auto;
  }

  .flex-tags {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    margin-top: auto;
    width: 100%;
  }

  .flex-tags-row {
    position: relative;
    overflow: hidden;
    width: 100%;
    /* soft fade at edges like the design */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  }

  .flex-tags-track {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    width: max-content;
    animation: tagsMarquee 50s linear infinite;
    will-change: transform;
  }

  .flex-tags-row.is-reverse .flex-tags-track {
    animation-direction: reverse;
    animation-duration: 50s;
  }

  .flex-tags-row:nth-child(3) .flex-tags-track {
    animation-duration: 50s;
  }

  .flex-tags-track span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    line-height: 1;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  @media only screen and (min-width: 769px) {
    .flex-tags-track span {
      padding: 14px 22px;
      font-size: 18px;
    }
  }

  @keyframes tagsMarquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
  }

  @media (prefers-reduced-motion: reduce) {
    .flex-tags-track { animation: none; }
  }

  /* Don’t render videos for reduced motion / mobile */
  @media (prefers-reduced-motion: reduce), (max-width: 768px) {
    .flex-slide .bg-video {
      display: none !important;
    }
  }

  .flex-cta {
    margin-top: clamp(0.75rem, 1.5vw, 1.25rem);
    width: fit-content;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "ibr", sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1;
    padding: 10px 20px;
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(178, 85, 255, 0.8);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition:
      background 0.18s ease,
      transform 0.18s ease,
      box-shadow 0.18s ease;
  }

  .flex-cta:hover {
    background: rgba(0, 0, 0, 0.6);
  }

  /* Keep the collapsed slide clean: only show title until hover/active */
  .flex-slide:not(.active):not(:hover) .flex-about,
  .flex-slide:not(.active):not(:hover) .flex-tags,
  .flex-slide:not(.active):not(:hover) .flex-cta {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
  }

  .flex-slide.active .flex-about,
  .flex-slide:hover .flex-about,
  .flex-slide.active .flex-tags,
  .flex-slide:hover .flex-tags,
  .flex-slide.active .flex-cta,
  .flex-slide:hover .flex-cta {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 500ms ease, transform 500ms ease;
  }