/* Infinite Carousel Section - Smooth Section Transitions */
section.loop-images,
section.image-motion-section,
section.carousel-content-section {
  position: relative;
  height: 100svh;
  width: 100%;
  overflow: hidden;
  margin: 0 !important;
  padding: 0;
  border: none;
  outline: none;
  display: block;
}

section.image-motion-section {
  height: min-content;
  min-height: 50vh;
  background-color: #0B0E13;
  margin: 0 !important;
}

.loop-images {
  background-color: #F5F6F7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: none;
  outline: none;
  margin: 0 !important;
}

.carousel-track {
  --left: -300rem;
  min-width: calc(10rem * var(--total));
  height: 30rem;
}

.carousel-track .carousel-item {
  position: absolute;
  width: 30rem;
  height: 30rem;
  left: 100%;
  display: flex;
  justify-content: center;
  perspective: 1000px;
  transform-style: preserve-3d;
  animation: scroll-left var(--time) linear infinite;
  animation-delay: calc(var(--time) / var(--total) * (var(--i) - 1) - var(--time));
  will-change: left;
  transition: 0.5s ease-in-out;
  cursor: pointer;
}

.carousel-track .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #F5F6F7;
  transform: rotateY(-45deg);
  transition: 0.5s ease-in-out;
  mask: linear-gradient(black 70%, transparent 100%);
}

.carousel-track .carousel-item:hover img {
  transform: rotateY(0deg) translateY(-1rem);
}

@keyframes scroll-left {
  to {
    left: var(--left);
  }
}

.image-motion {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-position: center;
  transform: rotatex(90deg);
  transform-origin: 50% 0;
}

.image-motion picture {
  display: block;
  width: 100%;
  height: 100%;
}

.image-motion picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #0B0E13;
}

.scroll-down {
  position: absolute;
  bottom: 5rem;
  left: 0;
  right: 0;
  font-family: 'Poppins', sans-serif;
  text-align: center;
  font-size: 1.6rem;
  color: #0B0E13;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
}

.carousel-content-section {
  --bg-color: #0B0E13;
  --text-primary: #EDEEEC;
  --text-secondary: #DADDE1;
  --text-white: #F5F6F7;
  --accent-primary: #4A90E2;
  --accent-secondary: #5FA3F0;
  --accent-tertiary: #7BB5F5;
  --accent-quaternary: #4A90E2;
  --accent-quinary: #3A7BC8;
  --border-radius: 25px;
  --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  background-color: #0B0E13;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-white);
  padding: 6rem 2rem 8rem 2rem;
  min-height: 100vh;
  background: var(--bg-color);
  overflow: hidden;
  border: none;
  outline: none;
  margin: 0;
  margin-bottom: 0 !important;
}

/* Smooth connection between carousel section and footer */
.carousel-content-section + .site-footer {
  margin-top: 0 !important;
  border-radius: 0;
}

.carousel-content-section .container {
  width: 100%;
  max-width: 1200px;
  margin: auto;
  text-align: center;
  position: relative;
  z-index: 2;
}

.carousel-content-section .title {
  font-size: 5rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  margin-bottom: 2.5rem;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 25%, var(--accent-tertiary) 50%, var(--accent-quaternary) 75%, var(--accent-quinary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  letter-spacing: -2px;
  position: relative;
}

.carousel-content-section .title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 2px;
}

.carousel-content-section .subtitle {
  position: relative;
  width: fit-content;
  margin-inline: auto;
  font-size: 1.6rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  color: var(--text-primary);
  margin-bottom: 2rem;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.carousel-content-section .subtitle::before {
  content: '◆';
  position: absolute;
  left: -30px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-primary);
  font-size: 1.2rem;
}

.carousel-content-section .subtitle::after {
  content: '◆';
  position: absolute;
  right: -30px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-primary);
  font-size: 1.2rem;
}

.carousel-content-section .text-content {
  margin-bottom: 6rem;
  position: relative;
}

.carousel-content-section .text {
  font-size: 1.3rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.9;
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.carousel-content-section .features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-top: 5rem;
}

.carousel-content-section .feature {
  background: linear-gradient(145deg, rgba(74, 144, 226, 0.1) 0%, rgba(74, 144, 226, 0.05) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(74, 144, 226, 0.3);
  border-radius: var(--border-radius);
  padding: 3.5rem 2.5rem;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.carousel-content-section .feature::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.2), transparent);
  transition: left 0.6s ease;
}

.carousel-content-section .feature:hover {
  transform: translateY(-15px) scale(1.02);
  background: linear-gradient(145deg, rgba(74, 144, 226, 0.2) 0%, rgba(74, 144, 226, 0.1) 100%);
  border-color: rgba(74, 144, 226, 0.6);
}

.carousel-content-section .feature:hover::before {
  left: 100%;
}

.carousel-content-section .feature .feature-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 2rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.carousel-content-section .feature:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
}

.carousel-content-section .feature h3 {
  font-size: 1.8rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--text-white) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.carousel-content-section .feature p {
  font-size: 1.1rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .carousel-content-section {
    padding: 4rem 1rem;
  }

  .carousel-content-section .container .title {
    font-size: 3.5rem;
    letter-spacing: -1px;
  }

  .carousel-content-section .container .title::after {
    width: 60px;
    height: 3px;
  }

  .carousel-content-section .container .subtitle {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    letter-spacing: 2px;
  }

  .carousel-content-section .container .subtitle::before,
  .carousel-content-section .container .subtitle::after {
    display: none;
  }

  .carousel-content-section .container .text-content {
    margin-bottom: 4rem;
  }

  .carousel-content-section .container .text-content .text {
    font-size: 1.1rem;
    text-align: center;
  }

  .carousel-content-section .container .features {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 3rem;
  }

  .carousel-content-section .container .features .feature {
    padding: 2.5rem 2rem;
  }

  .carousel-content-section .container .features .feature .feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
  }

  .carousel-content-section .container .features .feature h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .carousel-content-section .container .features .feature p {
    font-size: 1rem;
  }
}

/* Smooth connection with preceding sections */
.fold-effect + .loop-images,
.wrapper-3d + .loop-images {
  margin-top: 0 !important;
}

/* Remove any potential gaps between carousel sections */
.loop-images + .section2,
.loop-images + .image-motion-section {
  margin-top: 0 !important;
}

.section2 + .section3,
.image-motion-section + .carousel-content-section {
  margin-top: 0 !important;
}

/* ========================================
   ENHANCED MOBILE RESPONSIVE STYLES
   ======================================== */

/* Large Phones (480px and below) */
@media (max-width: 480px) {
  .carousel-content-section {
    padding: 3rem 0.75rem;
  }

  .carousel-content-section .container .title {
    font-size: 2.5rem;
    letter-spacing: -0.5px;
    margin-bottom: 1.5rem;
  }

  .carousel-content-section .container .title::after {
    width: 50px;
    height: 2.5px;
    margin-top: 1rem;
  }

  .carousel-content-section .container .subtitle {
    font-size: 1rem;
    margin-bottom: 2.5rem;
    letter-spacing: 1.5px;
    padding: 0 1rem;
  }

  .carousel-content-section .container .text-content {
    margin-bottom: 3rem;
    padding: 0 0.5rem;
  }

  .carousel-content-section .container .text-content .text {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .carousel-content-section .container .features {
    gap: 1.5rem;
    margin-top: 2.5rem;
  }

  .carousel-content-section .container .features .feature {
    padding: 2rem 1.5rem;
    border-radius: 12px;
  }

  .carousel-content-section .container .features .feature .feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
  }

  .carousel-content-section .container .features .feature h3 {
    font-size: 1.3rem;
    margin-bottom: 0.85rem;
  }

  .carousel-content-section .container .features .feature p {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  /* Carousel controls */
  .carousel-nav {
    padding: 0 0.75rem;
  }

  .carousel-nav button {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .carousel-indicators {
    gap: 8px;
  }

  .carousel-indicator {
    width: 8px;
    height: 8px;
  }
}

/* Very Small Phones (375px and below) */
@media (max-width: 375px) {
  .carousel-content-section {
    padding: 2.5rem 0.5rem;
  }

  .carousel-content-section .container .title {
    font-size: 2.2rem;
    letter-spacing: -0.3px;
    margin-bottom: 1.25rem;
  }

  .carousel-content-section .container .title::after {
    width: 45px;
    height: 2px;
  }

  .carousel-content-section .container .subtitle {
    font-size: 0.9rem;
    margin-bottom: 2rem;
    letter-spacing: 1.2px;
  }

  .carousel-content-section .container .text-content {
    margin-bottom: 2.5rem;
  }

  .carousel-content-section .container .text-content .text {
    font-size: 0.875rem;
    line-height: 1.6;
  }

  .carousel-content-section .container .features {
    gap: 1.25rem;
    margin-top: 2rem;
  }

  .carousel-content-section .container .features .feature {
    padding: 1.75rem 1.25rem;
    border-radius: 10px;
  }

  .carousel-content-section .container .features .feature .feature-icon {
    font-size: 2.2rem;
    margin-bottom: 1rem;
  }

  .carousel-content-section .container .features .feature h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
  }

  .carousel-content-section .container .features .feature p {
    font-size: 0.85rem;
    line-height: 1.55;
  }

  .carousel-nav button {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
}

/* Extra Small Phones (320px) */
@media (max-width: 320px) {
  .carousel-content-section {
    padding: 2rem 0.5rem;
  }

  .carousel-content-section .container .title {
    font-size: 2rem;
  }

  .carousel-content-section .container .subtitle {
    font-size: 0.85rem;
    margin-bottom: 1.75rem;
  }

  .carousel-content-section .container .text-content .text {
    font-size: 0.8rem;
  }

  .carousel-content-section .container .features .feature {
    padding: 1.5rem 1rem;
  }

  .carousel-content-section .container .features .feature .feature-icon {
    font-size: 2rem;
  }

  .carousel-content-section .container .features .feature h3 {
    font-size: 1.1rem;
  }

  .carousel-content-section .container .features .feature p {
    font-size: 0.8rem;
  }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 900px) {
  .carousel-content-section {
    padding: 2rem 1rem;
  }

  .carousel-content-section .container .title {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

  .carousel-content-section .container .subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  .carousel-content-section .container .text-content {
    margin-bottom: 2rem;
  }

  .carousel-content-section .container .features {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
  }

  .carousel-content-section .container .features .feature {
    padding: 1.5rem 1rem;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .carousel-nav button {
    min-width: 44px;
    min-height: 44px;
  }

  .carousel-nav button:active {
    transform: scale(0.95);
  }

  .carousel-indicator {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .carousel-indicator::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: currentColor;
  }

  /* Swipe hint */
  .carousel-content-section::after {
    content: 'Swipe for more';
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    opacity: 0.5;
    pointer-events: none;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .carousel-content-section * {
    transition: none !important;
    animation: none !important;
  }
}
