/* Custom Properties & Base Styling (Modernized & Refined) */
:root {
    --primary-color: #007bff; /* Biru cerah */
    --secondary-color: #6c757d; /* Abu-abu sedang */
    --accent-color: #28a745; /* Hijau untuk aksi */
    --background-light: #f8f9fa; /* Latar belakang sangat terang */
    --background-dark: #2c3e50; /* Latar belakang gelap, sedikit lebih soft */
    --text-dark: #212529; /* Teks gelap */
    --text-light: #f8f9fa; /* Teks terang */
    --border-color: #e0e0e0; /* Warna border halus */
    --shadow-light: rgba(0, 0, 0, 0.08); /* Shadow halus */
    --shadow-medium: rgba(0, 0, 0, 0.18); /* Shadow sedang, sedikit lebih kuat */
    --shadow-strong: rgba(0, 0, 0, 0.3); /* Shadow kuat */
    --transition-ease: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); /* Transisi lebih responsif */
    --transition-fast: all 0.3s ease-out; /* Transisi cepat */
    --border-radius-base: 12px; /* Sedikit lebih membulat */
    --border-radius-large: 20px; /* Lebih membulat */
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    background-color: var(--background-light);
    color: var(--text-dark);
    scroll-behavior: smooth;
    overflow-x: hidden; /* Mencegah scroll horizontal yang tidak diinginkan */
}

.container {
    width: 90%;
    max-width: 1280px; /* Max width lebih besar */
    margin: auto;
    overflow: hidden;
    padding: 60px 0; /* Padding lebih besar */
}

section {
    padding: 100px 0; /* Padding vertikal lebih besar untuk kesan lapang */
    text-align: center;
    background-color: #fff;
    margin-bottom: 40px; /* Margin bawah lebih besar */
    border-radius: var(--border-radius-large);
    box-shadow: 0 12px 30px var(--shadow-light); /* Shadow lebih menonjol */
    position: relative;
    overflow: hidden;
    transform: translateZ(0); /* Memaksa akselerasi hardware */
}

h1, h2, h3, h4 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-weight: 700;
    letter-spacing: -0.8px; /* Sedikit lebih rapat */
}

h1 {
    font-size: 3.8em;
    line-height: 1.1;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.05);
}

h2 {
    font-size: 3em;
    position: relative;
    padding-bottom: 15px;
}

h2:after { /* Garis bawah elegan untuk judul bagian */
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

p {
    margin-bottom: 25px;
    font-size: 1.15em;
    line-height: 1.7;
    color: var(--secondary-color);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius-base);
}

/* Header */
header {
    background: linear-gradient(to right, var(--primary-color) 0%, #0056b3 100%);
    color: var(--text-light);
    padding: 30px 0;
    text-align: center;
    box-shadow: 0 6px 15px var(--shadow-medium);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

header.scrolled {
    background: var(--background-dark);
    padding: 18px 0;
    box-shadow: 0 4px 12px var(--shadow-strong);
}

header h1 {
    margin: 0;
    color: var(--text-light);
    font-size: 3em;
    letter-spacing: 1.5px;
    transition: var(--transition-ease);
}

header.scrolled h1 {
    font-size: 2.2em; /* Mengecil saat di-scroll */
}

header nav ul {
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

header nav ul li {
    margin: 0 25px;
}

header nav ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.15em;
    padding: 10px 18px;
    border-radius: 8px;
    transition: var(--transition-ease);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    transform: translateZ(0); /* Memaksa akselerasi hardware */
}

header nav ul li a:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0); /* Awalnya tidak terlihat */
    width: 100%;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

header nav ul li a:hover:before {
    transform: translateX(-50%) scaleX(1); /* Membesar dari tengah */
}

header nav ul li a:hover {
    color: #e0eaff;
    transform: translateY(-5px) scale(1.03); /* Efek naik dan sedikit membesar */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

header nav ul li a i {
    margin-right: 12px;
    font-size: 1.3em;
    transform: translateZ(0);
}

/* Hero Section */
#hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom right, #eaf4fb, #dbeff7);
    padding: 120px 30px;
    box-shadow: none;
    gap: 80px;
    border-radius: var(--border-radius-large);
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
}

#hero:before {
    content: '';
    position: absolute;
    top: -100px;
    left: -100px;
    right: -100px;
    bottom: -100px;
    background: radial-gradient(circle at top left, rgba(0,123,255,0.08) 0%, transparent 40%),
                radial-gradient(circle at bottom right, rgba(0,123,255,0.08) 0%, transparent 40%);
    z-index: 0;
    animation: backgroundMove 30s infinite alternate linear; /* Animasi lebih lambat */
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
    100% { transform: translate(0, 0); }
}

#hero .hero-content {
    max-width: 750px;
    text-align: center;
    z-index: 1;
    animation: fadeInSlideUp 1.5s ease-out forwards; /* Animasi muncul awal */
    opacity: 0; /* Mulai tersembunyi */
}

#hero .hero-content h2 {
    font-size: 4.5em; /* Ukuran lebih besar */
    color: var(--primary-color);
    line-height: 1.1;
    margin-bottom: 25px;
    text-shadow: 3px 3px 8px rgba(0,0,0,0.08);
}

#hero .hero-content p {
    font-size: 1.4em;
    color: #5f6f7f;
    margin-bottom: 40px;
}

#hero .hero-image-container {
    width: 100%;
    max-width: 650px; /* Ukuran gambar lebih besar */
    overflow: hidden;
    border-radius: var(--border-radius-large);
    box-shadow: 0 15px 30px var(--shadow-strong); /* Shadow lebih kuat */
    transform: perspective(1200px) rotateY(-8deg) scale(0.95); /* Efek 3D lebih dramatis */
    transition: transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
    animation: scaleIn 1.5s cubic-bezier(0.25, 0.8, 0.25, 1) 0.5s forwards; /* Animasi muncul awal */
    opacity: 0;
}

#hero .hero-image-container:hover {
    transform: perspective(1200px) rotateY(0deg) scale(1.05); /* Kembali rata dan membesar */
}

#hero .hero-image-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Button Styling (Unified & Enhanced) */
.btn-primary {
    background-color: var(--accent-color);
    color: var(--text-light);
    padding: 16px 35px; /* Padding lebih besar */
    border: none;
    border-radius: 10px; /* Lebih membulat */
    cursor: pointer;
    font-size: 1.3em; /* Ukuran font lebih besar */
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin-top: 30px;
    letter-spacing: 0.8px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.btn-primary:after { /* Efek gelombang saat hover */
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease-out, height 0.6s ease-out, opacity 0.6s ease-out;
    z-index: 0;
}

.btn-primary:hover:after {
    width: 300%;
    height: 300%;
    opacity: 1;
}

.btn-primary:hover {
    background-color: #218838;
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.btn-primary span { /* Untuk memastikan teks di atas efek after */
    position: relative;
    z-index: 1;
}

/* Product Section */
#produk .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Ukuran minimum lebih besar */
    gap: 50px; /* Jarak lebih besar */
    padding: 40px;
    max-width: 1280px;
    margin: 0 auto;
}

.product-item {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-large);
    padding: 35px;
    text-align: center;
    transition: var(--transition-ease);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 8px 25px var(--shadow-light);
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.product-item:hover {
    transform: translateY(-15px) scale(1.03); /* Efek hover lebih menonjol */
    box-shadow: 0 18px 35px var(--shadow-medium);
}

.product-item h3 {
    color: var(--text-dark);
    margin-top: 25px;
    margin-bottom: 18px;
    font-size: 2em;
}

.product-item p {
    color: var(--secondary-color);
    font-size: 1.05em;
    flex-grow: 1;
}

.product-image-wrapper {
    width: 100%;
    padding-top: 75%; /* Rasio aspek 4:3, umum dan bagus */
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-base);
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-base);
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.product-item:hover .product-image-wrapper img {
    transform: scale(1.15) rotate(2deg); /* Zoom yang lebih kuat dan sedikit rotasi */
}

/* Digital Services Section */
#layanan-digital .service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); /* Ukuran minimum lebih besar */
    gap: 50px;
    padding: 40px;
    max-width: 1280px;
    margin: 0 auto;
}

.service-item {
    background-color: #f5fafd; /* Warna latar lebih soft */
    border-radius: var(--border-radius-large);
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 20px var(--shadow-light);
    transition: var(--transition-ease);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.service-item:after { /* Efek border animasi */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-radius: inherit;
    transition: border-color 0.5s ease;
    pointer-events: none; /* Agar tidak mengganggu klik */
}

.service-item:hover:after {
    border-color: var(--primary-color);
}


.service-item:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow: 0 14px 28px var(--shadow-medium);
    background-color: #eaf6ff;
}

.service-item h3 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 2.2em;
}

.service-item .logo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin-top: 25px;
    margin-bottom: 35px;
    min-height: 120px;
    padding: 15px;
    border-top: 1px solid #e0f0ff;
    border-bottom: 1px solid #e0f0ff;
}

.service-logo {
    width: 80px; /* Ukuran logo lebih besar */
    height: 80px;
    object-fit: contain;
    border-radius: 10px;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.5s ease;
    filter: grayscale(90%) contrast(1.1); /* Lebih abu-abu dan kontras */
}

.service-logo:hover {
    transform: scale(1.3) rotate(5deg); /* Zoom dan rotasi saat hover */
    filter: grayscale(0%) contrast(1); /* Warna asli */
}

/* Gallery Section */
#gallery .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    padding: 40px;
    max-width: 1280px;
    margin: 0 auto;
}

.gallery-item {
    background-color: #fff;
    border-radius: var(--border-radius-large);
    overflow: hidden;
    box-shadow: 0 8px 20px var(--shadow-light);
    transition: var(--transition-ease);
    cursor: pointer;
    position: relative;
    transform: translateZ(0);
}

.gallery-item:hover {
    transform: scale(1.07); /* Lebih besar */
    box-shadow: 0 16px 35px var(--shadow-medium);
}

.gallery-photo {
    width: 100%;
    height: 320px; /* Tinggi galeri lebih besar */
    object-fit: cover;
    display: block;
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.5s ease;
    filter: brightness(0.95); /* Sedikit gelap secara default */
}

.gallery-item:hover .gallery-photo {
    transform: scale(1.15) rotate(-3deg); /* Zoom dan rotasi yang lebih kuat */
    filter: brightness(1); /* Kembali normal */
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%); /* Gradien lebih kuat */
    color: var(--text-light);
    padding: 25px;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.5s ease-out;
    opacity: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%; /* Agar overlay menutupi seluruh gambar */
    box-sizing: border-box; /* Agar padding tidak menambah tinggi */
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
    opacity: 1;
}

.gallery-overlay h4 {
    color: var(--text-light);
    margin: 0 0 8px 0;
    font-size: 1.6em;
    font-weight: 700;
}

.gallery-overlay p {
    color: #eeeeee;
    font-size: 1em;
    margin: 0;
}


/* Contact Section */
#contact form {
    max-width: 800px; /* Form lebih lebar */
    margin: 0 auto;
    padding: 50px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-large);
    background-color: #fff;
    text-align: left;
    box-shadow: 0 10px 25px var(--shadow-light);
    transform: translateZ(0);
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.15em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: calc(100% - 28px); /* Mengurangi padding + border */
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-base);
    font-size: 1.1em;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.3);
    outline: none;
    transform: scale(1.005); /* Sedikit efek membesar saat fokus */
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

#contact button {
    background-color: var(--primary-color); /* Warna tombol kirim berbeda */
    color: var(--text-light);
    padding: 16px 35px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.3em;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin-top: 30px;
    letter-spacing: 0.8px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

#contact button:hover {
    background-color: #0056b3;
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}


/* Footer */
footer {
    background: var(--background-dark);
    color: var(--text-light);
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
    font-size: 1em;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.25);
}

footer p {
    color: #cccccc;
    margin: 0;
    font-size: 0.9em;
}

/* Scroll-based Animations (Requires JavaScript) */
.animated-section {
    opacity: 0;
    transform: translateY(70px); /* Jarak geser awal lebih jauh */
    transition: opacity 1.2s cubic-bezier(0.25, 0.8, 0.25, 1), transform 1.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: opacity, transform; /* Optimalisasi performa */
}

.animated-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Keyframe Animations (Applied to specific elements for initial load or by JS) */
@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Responsive Design */
@media (min-width: 1024px) { /* Layar yang lebih besar dari tablet */
    #hero {
        flex-direction: row;
        text-align: left;
        padding: 150px 60px;
    }

    #hero .hero-content {
        text-align: left;
        margin-right: 80px;
    }

    #hero .hero-image-container {
        margin-left: 0;
        order: 2;
    }

    header nav ul {
        margin-top: 0;
    }
}

@media (max-width: 1023px) {
    h1 { font-size: 3em; }
    h2 { font-size: 2.5em; }
    p { font-size: 1.05em; }
    .container { padding: 40px 0; }
    section { padding: 80px 0; margin-bottom: 30px; }

    #hero .hero-content h2 { font-size: 3.5em; }
    #hero .hero-content p { font-size: 1.2em; }
    #hero .hero-image-container { margin-top: 50px; transform: perspective(1000px) rotateY(-5deg) scale(1); }
    #hero .hero-image-container:hover { transform: perspective(1000px) rotateY(0deg) scale(1.02); }
}

@media (max-width: 767px) {
    h1 { font-size: 2.5em; }
    h2 { font-size: 2em; margin-bottom: 20px;}
    h2:after { width: 60px; height: 3px; }
    p { font-size: 1em; }

    header h1 { font-size: 2.5em; }
    header nav ul {
        flex-direction: column;
        align-items: center;
        margin-top: 15px;
    }

    header nav ul li {
        margin: 10px 0;
    }
    header nav ul li a {
        font-size: 1.05em;
        padding: 8px 15px;
    }

    #hero {
        padding: 80px 20px;
        gap: 40px;
    }
    #hero .hero-content h2 { font-size: 3em; }
    #hero .hero-content p { font-size: 1.1em; }
    #hero .hero-image-container { max-width: 90%; margin-top: 30px;}

    #produk .product-grid,
    #layanan-digital .service-grid,
    #gallery .gallery-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 35px;
    }

    .product-item, .service-item, .gallery-item {
        padding: 25px;
        border-radius: var(--border-radius-large);
    }
    .product-image-wrapper { padding-top: 65%; }
    .gallery-photo { height: 250px; }
    .service-logo { width: 60px; height: 60px; }

    #contact form {
        padding: 30px;
    }

    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group textarea {
        width: calc(100% - 20px);
        padding: 12px;
    }

    .btn-primary, #contact button {
        padding: 12px 25px;
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 2em; }
    h2 { font-size: 1.6em; }
    header h1 { font-size: 2em; }
    #hero .hero-content h2 { font-size: 2.5em; }
    p { font-size: 0.95em; }

    #hero { padding: 60px 15px; }

    .product-item, .service-item, .gallery-item { padding: 20px; }
    .product-item h3 { font-size: 1.6em; }
    .service-item h3 { font-size: 1.8em; }
    .gallery-photo { height: 200px; }
    .service-logo { width: 50px; height: 50px; }

    #contact form { padding: 20px; }
    .form-group label { font-size: 1em; }
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group textarea { padding: 10px; }
}