:root {
    --color-primary: #162B4D;
    --color-primary-light: #234275;
    --color-primary-dark: #0A1829;
    --color-accent: #C6A85C;
    --color-white: #FFFFFF;
    --color-grey-light: #EEF1F5;
    --color-grey-dark: #3E5A71;
    --color-text-primary: #162B4D;
    --color-text-secondary: #3D4B5C;

    --transition-speed: 0.3s;
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base font size untuk rem calculation */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-grey-light);
    overflow-x: hidden;
    font-size: clamp(0.9rem, 2vw, 1rem); /* Responsive base font size */
}

.app-container {
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    color: var(--color-white);
    position: fixed; /* Changed from absolute to fixed */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100; /* Increased z-index */
    background-color: rgba(22, 43, 77, 0.95); /* Semi-transparent background */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    backdrop-filter: blur(6px);
    transition: padding 0.3s ease;
}

.scrolled-nav {
    padding: 0.6rem 5%; /* Smaller padding when scrolled */
}

.logo {
    display: flex;
    align-items: center;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 700;
    gap: 10px;
    width: 50%;
}

.logo-img {
    height: clamp(32px, 8vw, 48px); /* Responsive logo size */
    width: auto;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 200;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--color-white);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--color-white);
    font-weight: 500;
    transition: color var(--transition-speed);
}

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

.nav-cta {
    background-color: var(--color-accent);
    color: var(--color-primary-dark) !important;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: var(--color-white);
    position: relative;
    padding: clamp(7rem, 15vw, 12rem) 5% clamp(4rem, 10vw, 6rem);
    overflow: hidden;
    min-height: 100vh; /* Ensures hero is at least full viewport height */
    display: flex;
    align-items: center;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    font-weight: 700;
    line-height: 1.2;
}

.subheading {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: rgba(255,255,255,0.85);
    margin-bottom: clamp(1.5rem, 5vw, 2.5rem);
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: clamp(0.8rem, 3vw, 1.5rem);
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.7rem, 2vw, 0.9rem) clamp(1.2rem, 3vw, 1.5rem);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
    font-weight: 600;
    min-width: 140px; /* Minimum button width */
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-primary-dark);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-white);
    border: 2px solid var(--color-white);
}

.btn-primary:hover {
    background-color: #AD8D3A;
    transform: translateY(-5px);
}

.btn-secondary:hover {
    background-color: rgba(255,255,255,0.1);
    transform: translateY(-5px);
}

.button-icon {
    width: clamp(16px, 4vw, 20px);
    height: auto;
    margin-right: 8px;
    vertical-align: middle;
}

a:focus-visible, button:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
}

/* Sections Common Styles */
.features, .screenshots, .testimonials, .download {
    padding: clamp(3rem, 10vw, 6rem) 5%;
    background-color: var(--color-white);
    text-align: center;
}

.section-header {
    margin-bottom: clamp(2rem, 5vw, 3rem);
}

.section-header h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: clamp(0.8rem, 2vw, 1rem);
    color: var(--color-primary);
}

.section-header p {
    color: var(--color-text-secondary);
    max-width: 800px;
    margin: 0 auto;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

/* Features Section */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(1.5rem, 3vw, 2rem);
    max-width: 1200px;
    margin: 0 auto;
}

.feature-box {
    background-color: var(--color-grey-light);
    padding: clamp(1.5rem, 4vw, 2rem);
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    height: 100%; /* Equal height boxes */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.feature-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.feature-icon {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.feature-icon img {
    width: clamp(40px, 8vw, 48px);
    height: auto;
    object-fit: contain;
}

.feature-box h3 {
    margin-bottom: 1rem;
    color: var(--color-primary);
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
}

.feature-box p {
    font-size: clamp(0.9rem, 1.8vw, 1rem);
    flex-grow: 1;
}

/* Screenshots Section */
.screenshots {
    background-color: var(--color-grey-light);
}

.screenshot-gallery {
    display: flex;
    justify-content: center;
    gap: clamp(1rem, 3vw, 2rem);
    flex-wrap: wrap; /* Allow wrap on smaller screens */
    max-width: 1200px;
    margin: 0 auto;
}

.screenshot-item {
    position: relative;
    text-align: center;
    flex: 1;
    min-width: 250px; /* Minimum width for each screenshot */
    max-width: 320px; /* Maximum width to maintain proportions */
}

.screenshot-item img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    transition: all var(--transition-speed);
}

.screenshot-item span {
    display: block;
    margin-top: 1rem;
    color: var(--color-text-secondary);
    font-size: clamp(0.9rem, 1.8vw, 1rem);
}

.screenshot-item:hover img {
    transform: scale(1.05);
}

/* Testimonials */
.testimonials {
    background-color: var(--color-white);
}

.testimonial-slider {
    max-width: 800px;
    margin: 0 auto;
}

.testimonial-card {
    background-color: var(--color-grey-light);
    padding: clamp(1.5rem, 5vw, 2.5rem);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.testimonial-card p {
    font-size: clamp(1rem, 2vw, 1.1rem);
    font-style: italic;
    margin-bottom: 1rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: clamp(1rem, 3vw, 1.5rem);
}

.testimonial-author img {
    width: clamp(24px, 5vw, 28px);
    height: clamp(24px, 5vw, 28px);
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
}

/* Download Section */
.download {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    color: var(--color-white);
}

.download-content {
    max-width: 800px;
    margin: 0 auto;
}

.download-content h2 {
    color: var(--color-white);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.download-content p {
    color: rgba(255,255,255,0.9);
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: clamp(1rem, 3vw, 1.5rem);
    margin-top: clamp(1.5rem, 4vw, 2rem);
    flex-wrap: wrap; /* Allow buttons to wrap */
}

/* Footer */
.footer {
    background-color: var(--color-grey-dark);
    color: var(--color-white);
    padding: clamp(2rem, 5vw, 3rem) 5%;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap; /* Allow wrap on smaller screens */
    gap: 1.5rem;
}

.footer-brand, .footer-links, .footer-social {
    margin: 0.5rem 0;
}

.footer-links, .footer-social {
    display: flex;
    gap: clamp(1rem, 3vw, 1.5rem);
    flex-wrap: wrap; /* Allow wrap on very small screens */
}

.footer-links a, .footer-social a {
    color: var(--color-white);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity var(--transition-speed);
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
}

.footer-links a:hover, .footer-social a:hover {
    opacity: 1;
}

/* Enhanced Responsive Design */
@media screen and (max-width: 1024px) {
    .feature-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media screen and (max-width: 900px) {
    /* Mobile Navigation */
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--color-primary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.5s ease;
        z-index: 90;
    }

    .nav-links.active {
        right: 0;
        overflow-y: auto;
    }

    .nav-links li {
        margin: 1.5rem 0;
    }

    /* Mobile menu overlay */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 80;
        display: none;
    }

    .mobile-overlay.active {
        display: block;
    }

    /* Adjust screenshot gallery */
    .screenshot-gallery {
        flex-direction: column;
        align-items: center;
    }

    .screenshot-item {
        width: 100%;
        max-width: 350px;
    }

    /* Make hero more compact on mobile */
    .hero {
        padding-top: 6rem;
        min-height: 80vh;
    }
}

@media screen and (max-width: 768px) {
    /* Adjust footer layout */
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links, .footer-social {
        justify-content: center;
    }

    /* Further compact feature boxes */
    .feature-grid {
        grid-template-columns: 1fr;
        max-width: 450px;
        margin: 0 auto;
    }

    /* Make testimonials more compact */
    .testimonial-card {
        padding: 1.5rem;
    }

    /* More compact download section */
    .download-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-primary, .btn-secondary {
        width: 80%;
        max-width: 250px;
    }
}

@media screen and (max-width: 480px) {
    /* Smallest screens adjustments */
    .hero h1 {
        font-size: 1.8rem;
    }

    .subheading {
        font-size: 0.9rem;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo-img {
        height: 32px;
    }

    /* Extra compact spacing */
    .features, .screenshots, .testimonials, .download {
        padding: 2.5rem 5%;
    }

    .feature-box, .testimonial-card, .screenshot-item img {
    box-shadow: none;
  }
}

/* Accessibility and Performance Enhancements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }

    html {
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Support - Enhanced */
@media (prefers-color-scheme: dark) {
    :root {
        --color-grey-light: #1E2D3D;
        --color-text-secondary: #B3C5D9;
    }

    body {
        background-color: var(--color-primary-dark);
        color: var(--color-white);
    }

    .features, .screenshots, .testimonials {
        background-color: var(--color-primary);
    }

    .feature-box {
        background-color: var(--color-primary-light);
        color: var(--color-white);
    }

    .testimonial-card {
        background-color: var(--color-primary-light);
        color: var(--color-white);
    }

    .section-header h2 {
        color: var(--color-white);
    }

    .section-header p {
        color: var(--color-text-secondary);
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .hero, .main-nav, .download, .footer {
        display: none;
    }

    .features, .screenshots, .testimonials {
        padding: 1rem 0;
        break-inside: avoid;
    }
}

/* Utility Classes */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Animation Utilities */
.fade-in {
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.8s ease-in-out;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.feature-box,
.screenshot-item img,
.testimonial-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}