/* ===== SCROLL ANIMATIONS ===== */
.tech-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Title Animation */
.title-wrapper.tech-animate {
    transform: translateY(30px) scale(0.95);
}

.title-wrapper.tech-animate.animate-in {
    transform: translateY(0) scale(1);
}

/* ===== ENHANCED TITLE STYLING ===== */
.title6 {
    margin: 0;
    flex: 1;
    position: relative;
    font-size: inherit;
    line-height: 120%;
    font-weight: 700;
    font-family: inherit;
    display: inline-block;
    max-width: 100%;
    color: #354c6b;
    background: linear-gradient(135deg, #354c6b 0%, #2d3748 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-wrapper {
    align-self: stretch;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    padding: 0 2rem;
    box-sizing: border-box;
    max-width: 100%;
    margin-bottom: 3rem;
}

/* ===== ENHANCED CARD STYLING ===== */
.group-div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
    margin: 0px 25px 40px 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 35px 30px 30px 30px;
    min-width: 0;
    width: 100%;
    min-height: 450px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

/* Hover Effects */
.group-div:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(53, 76, 107, 0.2);
}

.group-div::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.group-div:hover::before {
    left: 100%;
}

/* Icon Enhancements */
.atom-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0 auto 1.5rem auto;
    padding: 15px;
    background: rgba(53, 76, 107, 0.05);
    border-radius: 50%;
    width: 120px;
    height: 120px;
    transition: all 0.3s ease;
}

.group-div:hover .atom-row {
    background: rgba(53, 76, 107, 0.1);
    transform: scale(1.1);
}

.atom-1-icon,
.TensorFlow,
.pytorch,
.Scikit-learn {
    height: 70px;
    width: 70px;
    position: relative;
    object-fit: contain;
    z-index: 1;
    transition: transform 0.3s ease;
}

.group-div:hover .atom-1-icon,
.group-div:hover .TensorFlow,
.group-div:hover .pytorch,
.group-div:hover .Scikit-learn {
    transform: scale(1.1);
}

/* Enhanced Text Styling */
.title7 {
    margin: 0 0 1rem 0;
    width: 100%;
    font-size: 1.5rem;
    line-height: 120%;
    font-weight: 700;
    font-family: inherit;
    color: #354c6b;
    text-align: center;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.group-div:hover .title7 {
    color: #2d3748;
}

.lorem-ipsum-dolor3 {
    font-size: 0.95rem;
    font-weight: 400;
    font-family: var(--font-inter);
    text-align: justify;
    color: #4a5568;
    line-height: 1.6;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
    flex: 1;
}

.group-div:hover .lorem-ipsum-dolor3 {
    color: #2d3748;
}

/* Where each technology was used */
.tech-uses {
    align-self: stretch;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 0.95rem;
    font-family: var(--font-inter);
    color: #4a5568;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.tech-uses li {
    position: relative;
    padding-left: 1.1rem;
}

.tech-uses li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #354c6b;
}

.tech-uses strong {
    color: #354c6b;
    font-weight: 700;
}

.group-div:hover .tech-uses {
    color: #2d3748;
}

.title-row {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.8rem;
    flex: 1;
}

/* Grid Layout */
.frame-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: stretch;
    justify-content: center;
    max-width: 100%;
    padding: 0 2rem;
}

.frame-main {
    align-self: stretch;
    gap: 58px;
    max-width: 100%;
}

.technologies {
    width: 100%;
    position: relative;
    background: #d4d8e4;
    overflow: hidden;
    padding: 4rem 2rem 0rem 2rem;
    box-sizing: border-box;
    gap: 2rem;
    line-height: normal;
    letter-spacing: normal;
    text-align: center;
    font-size: 3rem;
    color: var(--color-gray-100);
    font-family: var(--title-h1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Remove unused styles */
.rectangle-div {
    display: none;
}

.frame-child3 {
    display: none;
}

/* ===== RESPONSIVE DESIGN ===== */
@media screen and (max-width: 1200px) {
    .frame-section {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
        padding: 0 1.5rem;
    }
    
    .group-div {
        margin: 0 0 30px 0;
    }
}

@media screen and (max-width: 1050px) {
    .title6 {
        font-size: 2.5rem;
    }
    
    .frame-section {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 1.5rem;
    }
    
    .technologies {
        padding: 3rem 1.5rem;
        gap: 1.5rem;
    }
}

@media screen and (max-width: 750px) {
    .title6 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .title-wrapper {
        padding: 0 1rem;
        margin-bottom: 2rem;
    }
    
    .frame-section {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.2rem;
        padding: 0 1rem;
    }
    
    .group-div {
        padding: 25px 20px 25px 20px;
        margin: 0 0 20px 0;
        min-height: 320px;
    }
    
    .title7 {
        font-size: 1.3rem;
        line-height: 1.3;
    }
    
    .lorem-ipsum-dolor3 {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .atom-row {
        width: 100px;
        height: 100px;
        margin-bottom: 1rem;
    }
    
    .atom-1-icon,
    .TensorFlow,
    .pytorch,
    .Scikit-learn {
        height: 60px;
        width: 60px;
    }
    
    .technologies {
        padding: 2rem 1rem;
    }
}

@media screen and (max-width: 450px) {
    .title6 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .frame-section {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .group-div {
        padding: 20px 15px;
        margin: 0 0 15px 0;
        min-width: auto;
        min-height: 300px;
    }
    
    .title7 {
        font-size: 1.2rem;
    }
    
    .lorem-ipsum-dolor3 {
        font-size: 0.85rem;
    }
    
    .atom-row {
        width: 80px;
        height: 80px;
    }
    
    .atom-1-icon,
    .TensorFlow,
    .pytorch,
    .Scikit-learn {
        height: 50px;
        width: 50px;
    }
    
    .technologies {
        padding: 1.5rem 0.5rem;
    }
    
    .title-wrapper {
        padding: 0 0.5rem;
    }
}
/* ===== CAROUSEL =====
   The cards scroll horizontally with snap points; arrows, dots, swipe and
   arrow keys move it, and scripts.js auto-advances it. */
.tech-carousel {
    --per-view: 4;
    --gap: 2rem;
    position: relative;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 3.5rem;
}

.carousel-track {
    position: relative;
    display: flex;
    gap: var(--gap);
    /* the old grid centred its items; a scroller must start at the left */
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* room for the cards' shadow and hover lift inside the scroller */
    padding: 20px 4px 30px;
    overscroll-behavior-x: contain;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-track:focus-visible {
    outline: 2px solid #354c6b;
    outline-offset: 4px;
    border-radius: 20px;
}

.carousel-track .group-div {
    flex: 0 0 calc((100% - (var(--per-view) - 1) * var(--gap)) / var(--per-view));
    margin: 0;
    scroll-snap-align: start;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #354c6b 0%, #4a6384 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(53, 76, 107, 0.3);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.carousel-btn:hover {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 12px 30px rgba(53, 76, 107, 0.4);
}

.carousel-btn svg {
    width: 22px;
    height: 22px;
}

.carousel-prev {
    left: 0;
}

.carousel-next {
    right: 0;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding-bottom: 3rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(53, 76, 107, 0.3);
    cursor: pointer;
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* invisible 24px hit area around the small dot */
.carousel-dot {
    position: relative;
}

.carousel-dot::after {
    content: '';
    position: absolute;
    inset: -7px;
}

.carousel-dot[aria-current="true"] {
    width: 28px;
    background: #354c6b;
}

@media screen and (max-width: 1200px) {
    .tech-carousel {
        --per-view: 3;
        --gap: 1.5rem;
    }
}

@media screen and (max-width: 900px) {
    .tech-carousel {
        --per-view: 2;
    }
}

@media screen and (max-width: 600px) {
    .tech-carousel {
        --per-view: 1;
        --gap: 1rem;
        padding: 0;
    }

    /* on phones: swipe, with the arrows tucked under the cards next to the dots */
    .carousel-btn {
        top: auto;
        /* same height as the dots/counter row (its bottom padding) */
        bottom: 3.2rem;
        transform: none;
        width: 40px;
        height: 40px;
    }

    .carousel-btn:hover {
        transform: scale(1.08);
    }

    .carousel-prev {
        left: 0.5rem;
    }

    .carousel-next {
        right: 0.5rem;
    }

    .carousel-dots {
        padding: 0.8rem 4rem 3.2rem;
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .carousel-track {
        scroll-behavior: auto;
    }
}

/* page counter shown instead of dots when there are many pages */
.carousel-count {
    font-family: var(--font-nunito);
    font-size: 16px;
    font-weight: 700;
    color: #354c6b;
    line-height: 40px;
    letter-spacing: 1px;
}
