@font-face {
    font-family: "FrameHead-Roman";
    src: url("../fonts/FrameHead-Roman-Web.woff2") format("woff2"),
         url("../fonts/FrameHead-Roman-Web.woff") format("woff");
    font-style: normal;
    font-weight: normal;
}

.services-footer {
    background: #ffffff;
    padding: 40px;
    text-align: center;
    width: 100%;
    overflow: hidden; /* Important for animations */
    position: relative;
    height: clamp(200px, 32vh, 320px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04); /* Added shadow */
}

/* --- Text & Underline Container --- */
.initial-content {
    position: absolute;
    width: 100%;
    transition: opacity 0.4s ease;
}

/* --- Text Animation Setup --- */
.services-main-footer {
    font-size: clamp(2.2rem, 5vw, 5.5rem);
    font-weight: 500;
    margin: 0;
    display: inline-block;
}

.services-main-footer .char {
    display: inline-block;
    transform: translateY(-70%);
    transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1); /* Removed opacity transition */
}

/* Animate text OUT on hover */
.services-footer:hover .char {
    transform: translateY(-250%);
    /* Opacity is no longer changed */
}

/* Stagger the letter animation */
.services-footer:hover .char:nth-child(1) { transition-delay: 0.0s; }
.services-footer:hover .char:nth-child(2) { transition-delay: 0.03s; }
.services-footer:hover .char:nth-child(3) { transition-delay: 0.06s; }
.services-footer:hover .char:nth-child(4) { transition-delay: 0.09s; }
.services-footer:hover .char:nth-child(5) { transition-delay: 0.12s; }
.services-footer:hover .char:nth-child(6) { transition-delay: 0.15s; }
.services-footer:hover .char:nth-child(7) { transition-delay: 0.18s; }
.services-footer:hover .char:nth-child(8) { transition-delay: 0.21s; }
.services-footer:hover .char:nth-child(9) { transition-delay: 0.24s; }
.services-footer:hover .char:nth-child(10) { transition-delay: 0.27s; }
.services-footer:hover .char:nth-child(11) { transition-delay: 0.3s; }
.services-footer:hover .char:nth-child(12) { transition-delay: 0.33s; }
.services-footer:hover .char:nth-child(13) { transition-delay: 0.36s; }
.services-footer:hover .char:nth-child(14) { transition-delay: 0.39s; }


/* --- Underline Animation Setup --- */
.services-footer-underline {
    width: 35%;
    height: 2px;
    background: #000000;
    margin: -50px auto 0 auto;
    border-radius: 2px;
    transform: scaleX(1);
    transform-origin: right;
    transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Animate underline OUT on hover */
.services-footer:hover .services-footer-underline {
    transform: scaleX(0);
}

/* --- Service Boxes Animation Setup --- */
.service-boxes-container {
    display: flex;
    justify-content: center; /* Center the items */
    align-items: center;
    width: 100%;
    height: 100%; /* Take full height */
    position: absolute;
}

.service-items {
    display: flex;
    width: 100%; /* Take full width */
    height: 100%;
    gap: 0; /* No gap between items */
}

.service-box {
    flex: 1; /* Each box takes equal space */
    height: 100%; /* Full height */
    background: #F8F6F5; /* Beige background */
    border: none; /* No border */
    display: flex;
    flex-direction: column; /* Stack image and text vertically */
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: #333;
    gap: 5px; /* Space between image and text */
    padding: 20px;
    box-sizing: border-box;
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.5s;
}

.service-box img {
    height: 70%; /* Adjust logo size */
}

.service-box span {
    font-size: 1rem;
}

/* Style for the last box */
.service-box.cloud-services-box {
    background: #ffffff;
    font-family: 'FrameHead-Roman', sans-serif;
}

/* Animate boxes IN on hover */
.services-footer:hover .service-box {
    transform: translateY(0);
    opacity: 1;
}

/* Stagger the box animation to be more simultaneous with text */
.services-footer:hover .service-box:nth-child(1) { transition-delay: 0.0s; }
.services-footer:hover .service-box:nth-child(2) { transition-delay: 0.05s; }
.services-footer:hover .service-box:nth-child(3) { transition-delay: 0.1s; }
.services-footer:hover .service-box:nth-child(4) { transition-delay: 0.15s; }
.services-footer:hover .service-box:nth-child(5) { transition-delay: 0.2s; }

/* --- Media Query untuk Mobile --- */
@media (max-width: 768px) {

    /* Sesuaikan padding utama agar tidak terlalu lebar di mobile */
    .services-footer {
        padding: 20px;
        height: clamp(400px, 65vh, 500px); /* Beri ruang lebih untuk konten vertikal */
    }

    /* Sesuaikan underline agar proporsional */
    .services-footer-underline {
        width: 60%;
        margin-top: -30px; /* Sesuaikan posisi karena font-size mungkin lebih kecil */
    }

    /* Kunci Perubahan: Ubah layout service-items menjadi vertikal */
    .service-items {
        flex-direction: column; /* Susun kotak layanan dari atas ke bawah */
        gap: 0; /* Pastikan tidak ada celah */
    }

    .service-box {
        flex: 1; /* Biarkan setiap box mengambil ruang yang sama secara vertikal */
        flex-direction: row; /* Posisikan gambar dan teks berdampingan */
        justify-content: flex-start; /* Mulai konten dari kiri */
        align-items: center; /* Pusatkan item secara vertikal di dalam box */
        padding: 0 20px; /* Beri padding horizontal */
        gap: 15px; /* Beri jarak antara gambar dan teks */
        width: 100%; /* Pastikan lebar penuh */
        border-bottom: 1px solid #eee; /* Beri pemisah antar item */
    }

    /* Hapus border pada item terakhir */
    .service-box:last-child {
        border-bottom: none;
    }

    /* Sesuaikan ukuran gambar agar tidak terlalu besar */
    .service-box img {
        height: 40px; /* Gunakan nilai tetap, bukan persentase */
        width: 40px;
        object-fit: contain;
    }

    /* Sesuaikan ukuran font di dalam box */
    .service-box span {
        font-size: 0.9rem;
    }

    /* Atur ulang animasi hover untuk mobile */
    /* Animasi akan tetap berfungsi saat di-tap pada banyak browser mobile */
    .services-footer:hover .service-box:nth-child(1) { transition-delay: 0.15s; }
    .services-footer:hover .service-box:nth-child(2) { transition-delay: 0.2s; }
    .services-footer:hover .service-box:nth-child(3) { transition-delay: 0.25s; }
    .services-footer:hover .service-box:nth-child(4) { transition-delay: 0.3s; }
    .services-footer:hover .service-box:nth-child(5) { transition-delay: 0.35s; }
}