:root {
    /* Theme Variables - Light Mode (Default) */
    --bg-main: #F8FAFC;
    --bg-card: #FFFFFF;
    --primary-blue: #2563EB;
    --primary-hover: #1D4ED8;
    --text-dark: #0F172A;
    --text-muted: #64748B;
    --border-light: #E2E8F0;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    /* Theme Variables - Dark Mode */
    --bg-main: #0F172A;
    --bg-card: #1E293B;
    --primary-blue: #3B82F6;
    --primary-hover: #60A5FA;
    --text-dark: #F8FAFC;
    --text-muted: #94A3B8;
    --border-light: #334155;
    --nav-bg: rgba(15, 23, 42, 0.85);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', 'Kanit', sans-serif;
}

html, body {
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scroll on entire document */
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Scroll Animations --- */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-up.in-view {
    opacity: 1;
    transform: translateY(0);
}
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }

/* --- Navigation --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-dark);
    display: inline-block;
}

.logo span {
    color: var(--primary-blue);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.nav-links a:hover {
    color: var(--text-dark);
}

/* --- Theme Toggle --- */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-dark);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.theme-toggle:hover {
    background-color: var(--bg-card);
    border-color: var(--primary-blue);
}

/* --- Buttons --- */
.btn-cta {
    background-color: var(--primary-blue);
    color: white;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-cta:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
    color: white;
}

.btn-outline {
    background-color: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-light);
    box-shadow: none;
}

.btn-outline:hover {
    background-color: var(--bg-card);
    border-color: #CBD5E1;
    color: var(--text-dark);
    transform: translateY(-2px);
}

.btn-back {
    color: var(--text-dark);
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}
.btn-back:hover { color: var(--primary-blue); }

.btn-visit {
    background-color: var(--primary-blue); color: white;
    padding: 18px 36px; border-radius: 14px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 12px; width: fit-content;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2); transition: 0.3s;
    text-decoration: none;
}
.btn-visit:hover { background-color: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3); }

/* --- Hero Section --- */
#hero {
    padding: 200px 0 120px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, rgba(248, 250, 252, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

.hero-content {
    max-width: 850px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-blue);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.hero-content h1 {
    font-size: 3.7rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.5px;
    color: var(--text-dark);
    margin-bottom: 24px;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 40px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* --- Portfolio Grid Section --- */
#portfolio, .samples-grid-section {
    padding: 100px 0;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.section-header, .page-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-header h2, .page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

.section-header p, .page-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 40px;
}

.portfolio-card {
    background-color: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s ease;
    text-decoration: none;
    color: inherit;
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue);
}

.portfolio-img-wrapper {
    padding: 24px 24px 0 24px;
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--border-light);
}

.portfolio-img {
    width: 100%;
    height: 240px;
    background-size: cover;
    background-position: top center;
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--border-light);
    border-bottom: none;
}

.portfolio-info {
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tech-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 12px;
}

.portfolio-info h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-dark);
    letter-spacing: -0.3px;
}

.portfolio-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.view-case {
    margin-top: auto;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.portfolio-card:hover .view-case {
    color: var(--primary-blue);
}

/* --- Testimonial Section --- */
#testimonials {
    padding: 160px 0;
    background-color: var(--bg-main);
    overflow: hidden;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 80px;
    align-items: center;
}

.testimonial-left {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.testimonial-badge {
    color: #8A3FFC;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 0.8rem;
}

.testimonial-left h2 {
    font-size: 3.5rem;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -2px;
    color: var(--text-dark);
}

.testimonial-left p {
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1.6;
}

.testimonial-nav {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.nav-btn-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--text-dark);
    font-size: 1.1rem;
    box-shadow: var(--shadow-sm);
}

.nav-btn-circle:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.testimonial-slider-container {
    width: 100%;
    min-width: 0;
}

.testimonial-slider .swiper-slide {
    width: auto;
}

.testimonial-card {
    background-color: var(--bg-card);
    padding: 48px;
    border-radius: 24px;
    border: 1px solid var(--border-light);
    width: 400px;
    height: 100%;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.testimonial-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    transform: translateY(-8px);
    border-color: var(--primary-blue);
}

.star-rating {
    color: #FFB800;
    display: flex;
    gap: 5px;
    font-size: 0.85rem;
}

.testimonial-text {
    font-size: 1.15rem;
    color: var(--text-dark);
    line-height: 1.7;
    font-weight: 500;
    letter-spacing: -0.2px;
}

.testimonial-user {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: auto;
}

.user-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--bg-main);
    border: 1px solid var(--border-light);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.user-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Contact Section --- */
#contact {
    padding: 120px 0;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-light);
}

.contact-wrapper {
    max-width: 650px;
    margin: 0 auto;
    background-color: var(--bg-card);
    padding: 48px;
    border-radius: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
}

.contact-header { text-align: center; margin-bottom: 40px; }
.contact-header h2 { font-size: 2.2rem; font-weight: 800; margin-bottom: 12px; }
.contact-header p { color: var(--text-muted); }

.form-group { margin-bottom: 24px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 0.9rem; font-weight: 600; }
.form-control {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border-light);
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--text-dark);
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}
.form-control:focus { border-color: var(--primary-blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1); }

textarea.form-control { min-height: 120px; }
.submit-btn { width: 100%; padding: 16px; font-size: 1.05rem; margin-top: 16px; }

/* --- Detail Content (Project Detail Page) --- */
.detail-content { padding: 160px 0 120px; }
.project-header { margin-bottom: 60px; max-width: 800px; }
.project-header h1 { font-size: 4rem; font-weight: 800; margin-bottom: 28px; letter-spacing: -2px; line-height: 1.1; }
.project-desc { font-size: 1.25rem; color: var(--text-muted); line-height: 1.8; border-left: 4px solid var(--primary-blue); padding-left: 24px; }

.gallery { display: flex; flex-direction: column; gap: 80px; }
.gallery-item { background-color: var(--bg-card); border-radius: 32px; overflow: hidden; border: 1px solid var(--border-light); box-shadow: var(--shadow-lg); }
.gallery-item img { width: 100%; display: block; border-bottom: 1px solid var(--border-light); }
.gallery-item-info { padding: 40px; }
.gallery-item-info h4 { font-size: 1.4rem; font-weight: 700; color: var(--primary-blue); }

/* --- Sample Showcase (Clean Rebuild) --- */
.showcase-section { padding: 160px 0 120px; overflow: hidden; } /* Ensure swiper doesn't break horizontal scroll */
.showcase-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 80px; align-items: center; }

.showcase-info { display: flex; flex-direction: column; gap: 24px; }
.showcase-info .sample-badge { color: #8A3FFC; text-transform: uppercase; font-weight: 700; letter-spacing: 1.5px; font-size: 0.85rem; display: inline-block; }
.showcase-info h1 { font-size: 3.2rem; font-weight: 800; line-height: 1.1; letter-spacing: -1.5px; color: var(--text-dark); margin: 0; }
.showcase-info .desc { font-size: 1.15rem; color: var(--text-muted); line-height: 1.7; border-left: 4px solid var(--primary-blue); padding-left: 20px; margin: 0; }

.showcase-info .feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.showcase-info .feature-item { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 600; color: var(--text-dark); }
.showcase-info .feature-item i { color: #10B981; font-size: 1.1rem; }

.showcase-actions { display: flex; flex-direction: column; gap: 20px; margin-top: 16px; }
.showcase-actions .btn-visit { width: fit-content; padding: 16px 32px; border-radius: 12px; }

.showcase-gallery { width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.swiper-showcase { width: 100%; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--border-light); background: var(--bg-card); }
.swiper-showcase img { width: 100%; height: auto; display: block; border-radius: 24px; } /* Ensures image respects container */

.showcase-controls { display: flex; gap: 16px; justify-content: flex-end; }
.zoom-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(12px);
    z-index: 2000; display: none; align-items: center; justify-content: center;
    cursor: zoom-out;
}
.zoom-overlay img { max-width: 90%; max-height: 90%; border-radius: 16px; box-shadow: 0 30px 60px -12px rgba(0,0,0,0.6); }

/* --- Mobile Menu (Hostinger Style) --- */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-dark);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: 0.3s;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    right: -100%; /* Start off-screen */
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 2000;
    transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    justify-content: flex-end;
}

.mobile-menu-overlay.active {
    right: 0;
}

.mobile-menu-drawer {
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: var(--bg-card);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: background-color 0.3s ease;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
}

.mobile-menu-close {
    background: none;
    border: 1px solid var(--border-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-dark);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-nav-links a {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    padding: 16px 20px;
    border-radius: 12px;
    background: var(--bg-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
    text-decoration: none;
}

.mobile-nav-links a::after {
    content: '\f061';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.8rem;
    opacity: 0.3;
}

.mobile-nav-links a:hover {
    background: var(--primary-blue);
    color: white;
}

/* --- Responsive Refinement --- */
@media (max-width: 1200px) {
    .container { max-width: 960px; }
    .hero-content h1 { font-size: 3.2rem; }
    .detail-grid { gap: 40px; grid-template-columns: 1fr 1fr; }
    .detail-gallery { padding: 0 40px; }
    .swiper-detail, .swiper-sample { width: 100%; }
}

@media (max-width: 1024px) {
    .container { max-width: 800px; }
    .hero-content h1 { font-size: 2.8rem; }
    .testimonial-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
    .testimonial-left { align-items: center; text-align: center; }
    .testimonial-nav { justify-content: center; }
    
    .detail-grid { grid-template-columns: 1fr; text-align: center; gap: 60px; }
    .detail-info { position: static; align-items: center; max-width: 100%; }
    .detail-gallery { padding: 0; width: 100%; display: flex; flex-direction: column; align-items: center; }
    .swiper-detail, .swiper-sample { width: 100%; max-width: 100%; }
    .slider-nav-abs { position: relative; width: 100%; top: 0; transform: none; margin-top: 24px; left: 0; right: 0; justify-content: center; gap: 20px; }
    .nav-btn-sq { width: 48px; height: 48px; }
    .feature-list { justify-content: center; }
    .detail-actions { align-items: center; }
}

@media (max-width: 768px) {
    nav .container { padding: 0 16px; }
    .nav-links { display: none; }
    .hide-mobile { display: none !important; }
    .mobile-menu-toggle { display: flex; }
    .logo { font-size: 20px; }
    
    #hero { padding: 120px 0 60px; }
    .hero-content h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -0.5px; }
    .hero-content p { font-size: 1rem; }
    .hero-buttons { flex-direction: column; width: 100%; }
    
    .section-header h2, .page-header h1 { font-size: 1.8rem; }
    .portfolio-grid { grid-template-columns: 1fr; gap: 30px; }
    
    .testimonial-left h2 { font-size: 2rem; }
    .testimonial-card { width: 100%; max-width: 100%; padding: 32px; }
    
    /* Showcase Detail Mobile Optimization */
    .showcase-grid { grid-template-columns: 1fr; gap: 48px; text-align: center; }
    .showcase-info { padding: 0 24px; align-items: center; }
    .showcase-info h1 { font-size: 2.2rem; margin-bottom: 16px; }
    .showcase-info .desc { font-size: 1.05rem; text-align: left; padding-left: 16px; margin: 0 auto; max-width: 500px; }
    .showcase-info .feature-list { grid-template-columns: 1fr; text-align: left; width: 100%; max-width: 320px; margin: 24px auto; }
    
    .showcase-gallery { 
        padding: 0; 
        width: 100%;
        overflow: visible; /* Allow swiper peek effect */
    }
    
    .swiper-showcase { 
        overflow: visible; 
        width: 100%;
        background: none;
        box-shadow: none;
        border: none;
    }
    
    .swiper-showcase .swiper-slide {
        padding: 0 8px;
        width: auto; /* Swiper handles width via slidesPerView: 1.1 */
    }
    
    .swiper-showcase img {
        border-radius: 20px;
        border: 1px solid var(--border-light);
        box-shadow: var(--shadow-md);
    }

    .showcase-controls { justify-content: center; margin-top: 32px; }
    .showcase-actions { align-items: center; width: 100%; }
    .showcase-actions .btn-visit { width: 100%; max-width: 300px; }
    
    .contact-wrapper { padding: 32px 20px; border-radius: 16px; }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 1.7rem; }
    .page-header h1 { font-size: 1.6rem; }
    .btn-visit { width: 100%; justify-content: center; font-size: 0.95rem; padding: 14px 24px; }
    .showcase-info h1 { font-size: 1.8rem; }
}

/* --- Footer --- */
footer {
    padding: 80px 0;
    text-align: center;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    background-color: var(--bg-main);
}

.footer-logo { font-size: 20px; font-weight: 800; color: var(--text-dark); margin-bottom: 16px; }
.footer-logo span { color: var(--primary-blue); }
