/* ==========================================================================
    1. DESIGN SYSTEM & RESET
    ========================================================================== */
:root {
    /* Color Palette */
    --color-primary: hsl(225, 85%, 60%);
    --color-accent: hsl(38, 97%, 62%);
    --color-gradient-start: hsl(210, 100%, 75%);
    --color-gradient-end: hsl(250, 90%, 65%);

    /* Light Mode */
    --color-bg-light: #F9F9FB;
    --color-surface-light: #FFFFFF;
    --color-text-light: hsl(220, 10%, 45%);
    --color-heading-light: hsl(220, 20%, 15%);
    --color-border-light: hsl(220, 25%, 92%);
    --color-subtle-bg-light: #F0F2F5;

    /* Dark Mode */
    --color-bg-dark: #0D1017;
    --color-surface-dark: #131720;
    --color-text-dark: hsl(220, 15%, 70%);
    --color-heading-dark: hsl(220, 30%, 95%);
    --color-border-dark: hsl(220, 15%, 20%);
    --color-subtle-bg-dark: #10131A;

    /* Typography */
    --font-main: 'Poppins', sans-serif;

    /* Sizing & Spacing */
    --header-height: 5rem;
    --container-width: 1200px;
    --container-padding: 1.5rem;
    --border-radius: 12px;
    --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* NEW: Keyframe animation for a subtle float effect */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* NEW: Keyframe animation for icon bounce */
@keyframes icon-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* NEW: Keyframe for the hero background animation */
@keyframes background-pan {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 100%; }
body {
    font-family: var(--font-main);
    background-color: var(--color-bg-light);
    color: var(--color-text-light);
    transition: background-color 0.3s, color 0.3s;
}

body.dark-theme {
    --color-bg-light: var(--color-bg-dark);
    --color-surface-light: var(--color-surface-dark);
    --color-text-light: var(--color-text-dark);
    --color-heading-light: var(--color-heading-dark);
    --color-border-light: var(--color-border-dark);
    --color-subtle-bg-light: var(--color-subtle-bg-dark);
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
h1, h2, h3, h4 { font-weight: 700; color: var(--color-heading-light); line-height: 1.1; }

/* ==========================================================================
    2. GLOBAL & WRAPPER
    ========================================================================== */
#page-wrapper {
    max-width: 95%;
    margin: 0 auto;
    background-color: var(--color-surface-light);
    border-left: 1px solid var(--color-border-light);
    border-right: 1px solid var(--color-border-light);
    box-shadow: 0 30px 60px -20px hsla(220, 20%, 15%, 0.1);
}
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 var(--container-padding); }
.section-header { text-align: center; max-width: 750px; margin: 0 auto 4rem auto; }
.section-title { font-size: clamp(2.25rem, 4vw, 3rem); }
.section-subtitle { margin-top: 1rem; font-size: 1.125rem; line-height: 1.8; }

/* ==========================================================================
    3. HEADER
    ========================================================================== */
.main-header { 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    background-color: var(--color-surface-light); 
    border-bottom: 1px solid var(--color-border-light); 
    transition: background-color 0.3s, box-shadow 0.3s, border-bottom-color 0.3s;
}


/* Style for the header when scrolled */
.main-header.scrolled {
    box-shadow: 0 5px 20px -5px hsla(220, 20%, 15%, 0.08);
}
.dark-theme .main-header.scrolled {
    box-shadow: 0 5px 20px -5px hsla(220, 30%, 95%, 0.08);
}
.navbar { display: flex; justify-content: space-between; align-items: center; height: var(--header-height); }
.nav-logo { font-size: 1.5rem; font-weight: 700; color: var(--color-heading-light); }
.nav-list { display: flex; gap: 3rem; }
.nav-link { font-weight: 500; color: var(--color-text-light); transition: color 0.3s; }
.nav-link:hover { color: var(--color-heading-light); }
.nav-actions { display: flex; align-items: center; gap: 1.5rem; }

/* Mobile navigation toggle button (hidden on desktop) */
.nav-toggle {
    display: none; /* Hidden by default on desktop */
    background: none;
    border: 1px solid var(--color-border-light);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    transition: color 0.3s, border-color 0.3s;
}
.nav-toggle:hover { 
    color: var(--color-heading-light); 
    border-color: var(--color-heading-light); 
}
.theme-toggle { 
    background: none; 
    border: 1px solid var(--color-border-light); 
    width: 44px; 
    height: 44px; 
    border-radius: 50%; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: var(--color-text-light); 
    transition: color 0.3s, border-color 0.3s; 
}
.theme-toggle:hover { color: var(--color-heading-light); border-color: var(--color-heading-light); }
.theme-toggle .moon, .dark-theme .theme-toggle .sun { display: none; }
.dark-theme .theme-toggle .moon { display: block; }

.cta-button {
    font-weight: 600;
    background-color: var(--color-primary);
    color: white;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
    display: inline-block;
}
.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px hsla(225, 85%, 60%, 0.25);
}

/* ==========================================================================
    4. SECTIONS
    ========================================================================== */
    

        /* Styles for Featured Portfolio Slider */
        .featured-portfolio-section {
            padding: 6rem 0;
            background-color: var(--color-bg-light); /* Or var(--color-subtle-bg-light) */
            border-top: 1px solid var(--color-border-light);
            border-bottom: 1px solid var(--color-border-light);
        }

        .slider-container {
            position: relative;
            overflow: hidden;
            width: 100%;
            padding: 0 1rem; /* Space for nav buttons on larger screens */
            box-sizing: border-box; /* Include padding in width */
            margin-bottom: 3rem; /* Space below slider to button */
        }

        .slider-track {
            display: flex;
            transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth transition */
            will-change: transform; /* Optimize for animation */
        }

        .slider-item {
            flex-shrink: 0;
            width: calc((100% / 3) - 2rem); /* 3 items per view, accounting for margin */
            margin: 0 1rem; /* Gap between items */
            box-sizing: border-box;
            /* Apply general portfolio-item styles here */
            background-color: var(--color-surface-light);
            border-radius: var(--border-radius);
            overflow: hidden;
            box-shadow: 0 10px 25px -5px hsla(220, 20%, 15%, 0.07);
            display: flex;
            flex-direction: column;
            height: auto; /* Allow height to adjust */
            min-height: 450px; /* Minimum height for slider cards */
            justify-content: space-between; /* Push button to bottom */
        }

        .dark-theme .slider-item {
            box-shadow: 0 10px 25px -5px hsla(220, 30%, 95%, 0.05);
        }

        /* Re-apply relevant portfolio-item child styles (make sure these are also in portfolio.html's <style>) */
        .slider-item .portfolio-embed {
            position: relative;
            width: 100%;
            padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
            height: 0;
            overflow: hidden;
            background-color: var(--color-subtle-bg-light);
        }

        .slider-item .portfolio-embed iframe,
        .slider-item .portfolio-embed img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: 0;
            object-fit: cover;
        }

        .slider-item .portfolio-embed.no-preview {
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--color-text-light);
            font-size: 0.9rem;
            text-align: center;
            padding: 1rem;
            min-height: 150px;
            padding-bottom: 0;
            height: auto;
        }

        .slider-item .portfolio-content {
            padding: 2rem;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
        }

        .slider-item .portfolio-title {
            font-size: 1.5rem;
            font-weight: 600;
            margin-bottom: 0.75rem;
            color: var(--color-heading-light);
        }

        .slider-item .portfolio-description {
            font-size: 0.95rem;
            line-height: 1.7;
            margin-bottom: 1.5rem; /* Space below description */
            color: var(--color-text-light);
            flex-grow: 1; /* Push button to bottom */
        }

        /* Read More styles within slider items */
        .slider-item .description-short-text {
            display: inline;
        }
        .slider-item .description-dots {
            display: inline;
        }
        .slider-item .description-full-text-hidden {
            display: none;
        }

        .slider-item .read-more-button {
            background: none;
            border: none;
            color: var(--color-primary);
            cursor: pointer;
            font-size: 0.9rem;
            font-weight: 500;
            padding: 0;
            margin-left: 0.25rem;
            text-decoration: underline;
            transition: color 0.2s ease;
        }
        .slider-item .read-more-button:hover {
            color: var(--color-heading-light);
        }

        .slider-item .portfolio-description.expanded .description-short-text {
            display: none;
        }
        .slider-item .portfolio-description.expanded .description-dots {
            display: none;
        }
        .slider-item .portfolio-description.expanded .description-full-text-hidden {
            display: inline;
        }

        .slider-item .portfolio-button {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            background-color: var(--color-primary);
            color: white;
            padding: 0.8rem 1.5rem;
            border-radius: 8px;
            transition: transform 0.3s, box-shadow 0.3s;
            text-decoration: none;
            width: max-content;
        }

        .slider-item .portfolio-button:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 15px hsla(225, 85%, 60%, 0.2);
        }


        .slider-nav-button {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background-color: rgba(0,0,0,0.5);
            color: white;
            border: none;
            padding: 1rem 0.75rem;
            cursor: pointer;
            z-index: 10;
            font-size: 1.5rem;
            border-radius: 4px;
            opacity: 0.8;
            transition: background-color 0.3s, opacity 0.3s;
        }

        .slider-nav-button:hover {
            background-color: rgba(0,0,0,0.7);
            opacity: 1;
        }

        .slider-nav-button.prev {
            left: 0;
            border-top-left-radius: 0;
            border-bottom-left-radius: 0;
        }

        .slider-nav-button.next {
            right: 0;
            border-top-right-radius: 0;
            border-bottom-right-radius: 0;
        }

        /* Responsive adjustments for slider */
        @media (max-width: 1024px) {
            .slider-item {
                width: calc((100% / 2) - 2rem); /* 2 items per view */
            }
        }

        @media (max-width: 768px) {
            .featured-portfolio-section {
                padding: 5rem 0;
            }
            .slider-container {
                padding: 0; /* Remove side padding on smaller screens */
            }
            .slider-item {
                width: calc(100% - 2rem); /* 1 item per view (adjust for its own margin) */
                margin: 0 1rem; /* Keep margin for single item gap */
            }
            .slider-nav-button {
                padding: 0.75rem 0.5rem;
                font-size: 1.2rem;
            }
        }
        
        

/* NEW: Base styles for reveal animation (simplified and robust) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Hero Section */
.hero-section { 
    position: relative; /* Needed for the absolute positioning of the animated background */
    padding: 6rem 0; 
    overflow: hidden; 
    isolation: isolate; /* Creates a new stacking context */
}
/* NEW: Animated background for the hero section */
.hero-bg-animated {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        45deg,
        var(--color-primary),
        var(--color-gradient-start),
        var(--color-primary),
        var(--color-gradient-end)
    );
    background-size: 200% 200%;
    animation: background-pan 15s ease infinite;
    opacity: 0.1; /* Make it subtle */
    transition: opacity 0.5s;
}
.dark-theme .hero-bg-animated {
    opacity: 0.2;
}

.hero-container { 
    position: relative;
    z-index: 1;
    display: grid; 
    grid-template-columns: 1.1fr 1fr; 
    align-items: center; 
    gap: 4rem; 
}
.hero-tagline { font-weight: 600; color: var(--color-primary); margin-bottom: 1.5rem; display: block; letter-spacing: 1px; }
.hero-title { font-size: 50px; line-height: 1.1; margin-bottom: 1.5rem; }
.hero-subtitle { font-size: 1.125rem; line-height: 1.9; max-width: 550px; margin-bottom: 2.5rem; }
.hero-image img { border-radius: var(--border-radius); }

/* Why Us Section */
.why-us-section { padding: 6rem 0; background-color: var(--color-subtle-bg-light); border-top: 1px solid var(--color-border-light); border-bottom: 1px solid var(--color-border-light); }
.why-us-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.feature-card { 
    padding: 2.5rem; 
    text-align: left; 
    transition: all 0.3s var(--transition);
}
/* Hover animation for the whole card */
.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px -10px hsla(220, 20%, 15%, 0.1);
}
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background-color: var(--color-surface-light);
    border: 1px solid var(--color-border-light);
    color: var(--color-primary);
    border-radius: 50%;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.nav-logo .logo-img {
    height: 60px; /* atau sesuaikan */
    width: auto;
    display: block;
}

/* Icon float animation on card hover */
.feature-card:hover .feature-icon {
    background-color: var(--color-primary);
    color: white;
    transform: scale(1.1);
    animation: icon-bounce 1s ease-in-out infinite;
}
.feature-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; }

/* Services Section */
.services-section { padding: 8rem 0; }
.service-item { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 5rem; }
.service-item:not(:last-child) { margin-bottom: 8rem; }
.service-item:nth-child(even) .service-image { order: 2; }
.service-image img { border-radius: var(--border-radius); }
.service-tag { font-weight: 600; letter-spacing: 1px; margin-bottom: 1rem; display: block; }
.service-content h3 { font-size: 2rem; line-height: 2rem; margin-bottom: 1.5rem; }

/* Animated service CTA */
.service-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-text-light);
    background-color: var(--color-surface-light);
    border: 1px solid var(--color-border-light);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
}
.service-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary);
    transition: transform 0.3s ease-in-out;
    z-index: -1;
    transform: skewX(-20deg);
}
.service-cta:hover {
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px hsla(225, 85%, 60%, 0.15);
}
.service-cta:hover::before {
    transform: translateX(100%) skewX(-20deg);
}
.service-cta svg {
    transition: fill 0.3s ease;
    fill: var(--color-text-light);
}
.service-cta:hover svg {
    fill: white;
}
.dark-theme .service-cta {
    background-color: var(--color-surface-dark);
    border-color: var(--color-border-dark);
    color: var(--color-text-dark);
}
.dark-theme .service-cta svg {
    fill: var(--color-text-dark);
}
.dark-theme .service-cta:hover {
    color: white;
    border-color: var(--color-primary);
}
.dark-theme .service-cta:hover svg {
    fill: white;
}

/* Process Section */
.process-section { padding: 6rem 0; background-color: var(--color-subtle-bg-light); border-top: 1px solid var(--color-border-light); border-bottom: 1px solid var(--color-border-light); }
.process-timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    position: relative;
}
.process-timeline::before {
    content: '';
    position: absolute;
    top: 32px;
    left: 5%;
    width: 90%;
    height: 2px;
    background-color: var(--color-border-light);
    z-index: 0;
}
.timeline-item { text-align: left; position: relative; }
.timeline-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-border-light);
    background-color: var(--color-subtle-bg-light);
    border-radius: 50%;
    margin: 0 auto 1.5rem auto;
    color: var(--color-primary);
    z-index: 1;
    position: relative;
    transition: transform 0.3s var(--transition);
}
.timeline-item:hover .timeline-icon {
    transform: scale(1.1) rotate(10deg);
}
.timeline-item h4 { font-size: 1.125rem; font-weight: 600; line-height: 1.5rem; margin-bottom: 0.5rem; }

/* Contact Section */
.contact-section { padding: 8rem 0; text-align: center; }
.contact-container { max-width: 700px; margin: 0 auto; }
.contact-title { font-size: 2rem; line-height: 2.5rem; margin-bottom: 1rem; }
.contact-subtitle { font-size: 1.125rem; margin-bottom: 2.5rem; }
.contact-section .cta-button { font-size: 1.125rem; padding: 1rem 2.5rem; }

/* ==========================================================================
    5. FOOTER & FLOATING BUTTON
    ========================================================================== */
.site-footer{
    padding-top: 5rem;
    padding-bottom: 5rem;
    text-align: center;
    line-height: 2.5rem;
}

.footer-logo-text {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-heading-light);
  
}

.footer-social-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center; /* Atur tengah jika diperlukan */
  gap: 1.5rem;
}

.footer-social-wrap .social-link {
  position: relative;
  padding: 0 0.75rem;
  color: var(--color-text-light);
  font-weight: 500;
  text-decoration: none;
}

/* Tambahkan garis pemisah | kecuali untuk elemen terakhir */
.footer-social-wrap .social-link:not(:last-child)::after {
  content: "|";
  position: absolute;
  right: -0.75rem;
  color: var(--color-border-light); /* Sesuaikan dengan tema */
}

.floating-whatsapp-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    animation: float 2s ease-in-out infinite;
    cursor: pointer;
    padding: 0.5rem;
}


/* Optional: animasi floating */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.floating-whatsapp-button:hover { transform: scale(1.1); box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4); animation: none; }


/* ==========================================================================
    6. RESPONSIVENESS
    ========================================================================== */

/* TABLET & SMALLER DESKTOPS (max-width: 1200px) */
@media (max-width: 1200px) {
    #page-wrapper {
        max-width: 100%;
        border-left: none;
        border-right: none;
        border-radius: 0;
        box-shadow: none;
    }
}

/* TABLET (max-width: 1024px) */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-subtitle { margin: 0 auto 2.5rem auto; }
    .hero-image { margin-top: 4rem; }
    
    .why-us-grid { grid-template-columns: 1fr; }
    
    .service-item {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    .service-item:nth-child(even) .service-image { order: -1; }
    .service-image { margin-bottom: 2rem; }

    .process-timeline {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .process-timeline::before { display: none; }
}

/* MOBILE (max-width: 768px) */
@media (max-width: 768px) {
    :root { --header-height: 4.5rem; }
    
    /* Hide desktop nav list and CTA button, show mobile toggle button */
    .nav-list,
    .nav-actions .nav-cta {
        display: none; 
    }
    .nav-toggle {
        display: flex; /* Show the mobile toggle button */
    }

    /* Style for the off-canvas mobile navigation menu (controlled by JS) */
    .nav-menu {
        position: fixed;
        top: var(--header-height); /* Position it right below the header */
        left: 0;
        width: 100%;
        background-color: var(--color-surface-light);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        height: calc(100vh - var(--header-height));
        transform: translateY(-100%);
        transition: transform 0.4s ease-in-out;
        /* NEW: Set display to flex when active to override 'display: none' from other rules */
        display: none;
    }
    .nav-menu.active {
        transform: translateY(0);
        /* NEW: Display the menu when active */
        display: flex;
    }
    
    /* NEW: This rule is now redundant as we control the parent display, but keep it for clarity */
    .nav-menu .nav-list {
        display: flex;
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .nav-menu .nav-link {
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--color-heading-light);
    }
    
    .hero-section { padding: 4rem 0; }
    .hero-title { font-size: 2.25rem; }
    .hero-subtitle { font-size: 1rem; }
    
    .why-us-section, .services-section, .process-section, .contact-section {
        padding: 5rem 0;
    }
    .section-title { font-size: 2rem; }
    .section-subtitle { font-size: 1rem; }
    
    .service-content h3 { font-size: 1.5rem; }
    .service-item:not(:last-child) { margin-bottom: 5rem; }

    .site-footer{
    padding-top: 5rem;
    padding-bottom: 5rem;
    text-align: center;
    line-height: 1.9rem;
    }

    .footer-logo-text {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-heading-light);
    
    }

    .footer-social-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .social-link {
    font-size: 1rem;
    text-align: center;
  }
        
    .floating-whatsapp-button {
        width: 38px;
        height: 38px;
        display: block;
        object-fit: contain;
        pointer-events: none;
    }
}


/* PREFERS-REDUCED-MOTION */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}