
.cap-card {
  flex: 0 0 calc(30% - 20px);
  width: 350px;
  height: 500px;
  border-radius: 24px;
  overflow: hidden;
  color: #fff;
  position: relative;
  cursor: pointer;
  transform: scale(1);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin: 20px;
}
 
.cap-card:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}
 
.cap-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: inherit;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;

  z-index: 1;
  transform: scale(1);
  transition: transform 0.6s ease, filter 0.4s ease;
}
 
.cap-card:hover::before {
  transform: scale(1.1);
  filter: blur(0px);
}
 
.cap-card::after {
  content: '';
  position: absolute;
  top: 60%;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  z-index: 2;
  transition: background 0.4s ease;
}
 
.cap-card:hover::after {
  background: rgba(0, 0, 0, 0.15);
}
 
.cap-card .card-text-overlay {
  padding: 32px 24px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  text-align: left;
}


 .cap-card .card-text-overlay2 {

  bottom: 15px;
  left: 0;
  right: 0;
 }

 .cap-card .card-text-overlay4 {
 
  bottom: 40px;
  left: 0;
  right: 0;
 }
 .cap-card .card-text-overlay5 {
 
  bottom: 40px;
  left: 0;
  right: 0;
 }
 .cap-card .card-text-overlay6 {
 
  bottom: 0;
  left: 0;
  right: 0;
 }
 .cap-card .card-text-overlay7 {
 
  bottom: 40px;
  left: 0;
  right: 0;
 }
 .cap-card .card-text-overlay8 {
 
  bottom: 0;
  left: 0;
  right: 0;
 }
 
.cap-card:hover .card-text-overlay {
  transform: translateY(0);
}
 
.cap-card h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
 
.cap-card:hover h3 {
  transform: translateY(-5px);
  opacity: 1;
}
 
.cap-card p {
  font-size: 16px;
  font-weight: 400;
  margin: 0;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
 
#cap-carousel {
  overflow: hidden;
  width: 100%;
  padding: 28px 40px;
  perspective: 1000px; /* Add 3D perspective */
}
 
#cap-cards {
  display: flex;
  transition: transform 0.6s cubic-bezier(.77,0,.18,1);
  gap: 50px;
  transform-style: preserve-3d;
}
 
.cap-nav-btn {
  background: #fff;
  border: 1px solid #bdbdbd;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
 
.cap-nav-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 24px;
}
 
.cap-card img {
  transform: scale(1);
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
 
.cap-card:hover img {
  transform: scale(1.15);
}
 
.cap-card:hover p {
  transform: translateX(-5px);
  opacity: 1;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s, opacity 0.5s ease 0.1s;
}
 
/* Add floating animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.02);
  }
}
 

 
/* Pulse effect on hover */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 51, 204, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 51, 204, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 51, 204, 0);
  }
}
 
.cap-card:hover {
  animation: pulse 1.5s infinite;
}
 
@media (max-width: 1024px) {
  .cap-card {
    width: 340px;
    height: 500px;
  }
  
  #cap-cards {
    gap: 30px;
  }
}

@media (max-width: 768px) {
  #cap-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 16px;
    transform: none !important;
  }
 
  .cap-card {
    width: 100%;
    height: 280px; /* increased for readability */
    animation: none;
    margin: 0 0 12px 0;
    border-radius: 18px;
  }
 
  .cap-card::after {
    background: rgba(0, 0, 0, 0.7);
  }
 
  .cap-card .card-text-overlay {
    padding: 16px;
    transform: translateY(0);
    position: relative;
  }
 
  .cap-card:hover {
    transform: scale(1.02);
    animation: none;
  }
 
  .cap-nav-container {
    display: none;
  }
 
  #cap-carousel {
    overflow: visible;
    padding: 20px;
  }
 
  .cap-card h3 {
    font-size: 1.12rem;
    margin-bottom: 8px;
    line-height: 1.15;
  }
  
  .cap-card p {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  #cap-cards {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(8, 1fr);
  }
  
  .cap-card {
    height: 240px; /* larger on small phones for legibility */
    margin-bottom: 12px;
  }
  
  .cap-card h3 {
    font-size: 1.05rem;
  }
  
  .cap-card p {
    font-size: 0.95rem;
  }
}

@media (max-width: 1180px) {
  #cap-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 16px;
    transform: none !important;
  }
 
  .cap-card {
    width: 100%;
    height: 300px; /* slightly taller on small laptops/tablets */
    animation: none;
    margin: 0 0 12px 0;
  }
 
  .cap-card::after {
    background: rgba(0, 0, 0, 0.7);
  }
 
  .cap-card .card-text-overlay {
    padding: 16px;
    transform: translateY(0);
    position: relative;
  }
 
  .cap-card:hover {
    transform: scale(1.02);
    animation: none;
  }
 
  .cap-nav-container {
    display: none;
  }
 
  #cap-carousel {
    overflow: visible;
    padding: 20px;
  }
  
  .cap-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }
  
  .cap-card p {
    font-size: 0.95rem;
  }
}

/* iPhone 13 specific fix */
@media only screen and (device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) {
  .cap-card h3 {
    font-size: 0.95rem !important;
    line-height: 1.1 !important;
  }
  
  .cap-card p {
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
  }
  
  #A-human .cap-card .card-text-overlay {
    overflow: hidden !important;
    max-height: 180px !important;
  }
  
  #A-human .cap-card h3 {
    font-size: 0.9rem !important;
    line-height: 1.1 !important;
    margin-bottom: 4px !important;
  }
  
  #A-human .cap-card p {
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
  }
}

/* AI-Human section transparent background for text */
#A-human .cap-card .card-text-overlay {
  background: transparent !important;
  border-radius: 0 !important;
  backdrop-filter: none !important;
  margin: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  bottom: 16px !important;
}

#A-human .cap-card {
  width: 385px;
  height: 550px;
}

#A-human .cap-card h3 {
  color: #fff !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8) !important;
}

#A-human .cap-card p {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8) !important;
}

/* AI-Human desktop matches capabilities */
@media (min-width: 1181px) {
  #A-human #cap-cards {
    display: flex !important;
    gap: 50px;
  }
  
  #A-human .cap-nav-container {
    display: flex;
  }
  
  #A-human #cap-carousel {
    overflow: hidden;
    padding: 28px 40px;
  }
  
  #A-human .cap-card .card-text-overlay {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 12px !important;
    backdrop-filter: blur(10px) !important;
  }
  
  #A-human .cap-card h3 {
    color: #003394 !important;
    text-shadow: none !important;
  }
  
  #A-human .cap-card p {
    color: #333 !important;
    text-shadow: none !important;
  }
}

/* AI-Human tablet/mobile uses 2x2 grid */
@media (max-width: 1180px) {
  #A-human #cap-cards {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 16px;
    transform: none !important;
  }
  
  #A-human .cap-card {
    width: 100% !important;
    height: 300px !important;
    margin: 0 !important;
  }
  
  #A-human .cap-nav-container {
    display: none;
  }
  
  #A-human #cap-carousel {
    overflow: visible;
    padding: 20px;
  }
  
  #A-human .cap-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }
  
  #A-human .cap-card p {
    font-size: 0.95rem;
  }
}

@media (max-width: 768px) and (min-width: 481px) {
  #A-human .cap-card {
    height: 380px !important;
  }
  
  #A-human .cap-card .card-text-overlay {
    padding: 12px;
    position: relative;
    transform: translateY(0);
  }
  
  #A-human .cap-card h3 {
    font-size: 1rem;
    margin-bottom: 6px;
  }
  
  #A-human .cap-card p {
    font-size: 0.9rem;
    line-height: 1.3;
  }
}

@media (max-width: 480px) {
  #A-human .cap-card {
    height: 340px !important;
  }
  
  #A-human .cap-card .card-text-overlay {
    background: transparent !important;
    padding: 10px;
    position: relative;
    transform: translateY(0);
  }
  
  #A-human .cap-card h3 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: #fff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  }
  
  #A-human .cap-card p {
    font-size: 0.85rem;
    line-height: 1.2;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  }
}


