/* CSS Variables */
:root {
    --font-primary: 'System', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --color-primary: #000;
    --color-secondary: #fff;
    --color-gray: #666;
    --color-light-gray: #f5f5f5;
    --color-border: #e0e0e0;
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 40px;
    --spacing-xl: 60px;
    --transition-speed: 0.3s;
    --max-width: 1200px;
}

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

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--color-primary);
    background: var(--color-secondary);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Typography */
h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
}

h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 30px;
}

h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

p {
    font-size: 18px;
    margin-bottom: var(--spacing-md);
    color: var(--color-gray);
}

/* Header & Navbar */
.navbar {
    padding: 15px 0;
    min-height: 60px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    /* Frosted glass effect */
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.9),
        rgba(255, 255, 255, 0.85)
    );
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999;
    box-shadow: 
        0 1px 40px rgba(0, 0, 0, 0.02),
        inset 0 -1px 0 rgba(255, 255, 255, 0.5);
}

/* Article headers should NOT be sticky */
.article-header {
    position: static !important;
}

/* Support check for backdrop-filter */
@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
    .navbar {
        background: rgba(255, 255, 255, 0.85);
    }
}

.navbar {
    width: 100%;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

.nav-logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary) !important;
    text-decoration: none;
}

.nav-logo:hover {
    opacity: 0.8;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary);
}

/* Hamburger Menu Button - works with both .hamburger-menu and .mobile-menu-toggle */
.hamburger-menu,
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 10001;
    position: relative;
}

.hamburger-line,
.hamburger-menu span,
.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--color-primary);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.hamburger-menu.active .hamburger-line:nth-child(1),
.hamburger-menu.active span:nth-child(1),
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active .hamburger-line:nth-child(2),
.hamburger-menu.active span:nth-child(2),
.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3),
.hamburger-menu.active span:nth-child(3),
.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-menu li {
    list-style: none;
}

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

.nav-menu a:hover {
    opacity: 0.8;
}

.nav-menu .cta-button {
    background: var(--color-primary);
    color: var(--color-secondary) !important;
    padding: 8px 20px;
    border-radius: 4px;
    display: inline-block;
    text-align: center;
}

.nav-menu .cta-button:hover {
    opacity: 0.9;
    color: var(--color-secondary) !important;
}

/* Buttons */
.cta-button {
    background: var(--color-primary);
    color: var(--color-secondary);
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity var(--transition-speed);
    display: inline-block;
    cursor: pointer;
}

.cta-button:hover {
    opacity: 0.8;
    will-change: opacity;
}

/* Main sections */
section {
    padding: 80px 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 120px 0;
    background: var(--color-secondary);
    height: calc(100vh - 60px);
    height: calc(var(--vh, 1vh) * 100 - 60px);
    display: flex;
    align-items: center;
}

.hero h1 {
    color: var(--color-primary);
}

.hero .subtitle {
    font-size: 20px;
    color: var(--color-gray);
    margin-bottom: var(--spacing-lg);
}

/* What I Do Section */
.what-i-do {
    border-top: 1px solid var(--color-border);
}

.service-grid {
    display: grid;
    gap: 30px;
}

.service-item {
    padding: 30px;
    background: var(--color-light-gray);
    border-radius: 8px;
    border-left: 3px solid var(--color-primary);
}

.service-item h3 {
    font-size: 20px;
    margin-bottom: 15px;
}

/* Problems Section */
.problems {
    border-top: 1px solid var(--color-border);
}

.problem-list {
    list-style: none;
    margin-bottom: var(--spacing-lg);
}

.problem-list li {
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-light-gray);
}

.problem-list li:last-child {
    border-bottom: none;
}

.problem-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-primary);
}

/* Results Section */
.results {
    border-top: 1px solid var(--color-border);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.result {
    text-align: center;
}

.result-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-primary);
    display: block;
    margin-bottom: 8px;
}

.result-text {
    font-size: 14px;
    color: var(--color-gray);
}

/* Services Grid */
.services {
    border-top: 1px solid var(--color-border);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    align-items: stretch;
}

.service {
    padding: 32px 24px;
    background: var(--color-light-gray);
    border-radius: 8px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.service {
    will-change: transform;
}

.service:hover {
    background: #f0f0f0;
    border-left-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.service-cta {
    background: var(--color-primary);
    color: var(--color-secondary);
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    margin-top: auto;
    transition: opacity var(--transition-speed);
}

.service-cta:hover {
    opacity: 0.8;
}

.service-price {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.service-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.service-description {
    font-size: 16px;
    color: var(--color-gray);
    margin-bottom: var(--spacing-md);
}

.service-features {
    list-style: none;
    margin-bottom: var(--spacing-md);
    flex-grow: 1;
}

.service-features li {
    padding: 2px 0;
    font-size: 14px;
    color: var(--color-gray);
}

/* AiBsCleaner Section */
.aibscleaner-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.aibscleaner-section h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.aibscleaner-section .intro-text {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.95;
}

.aibscleaner-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.aibscleaner-features .feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.aibscleaner-features .feature-icon {
    font-size: 20px;
}

.aibscleaner-widget-wrapper {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.aibscleaner-section .privacy-note {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aibscleaner-section .privacy-note .icon {
    font-size: 24px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
    will-change: transform;
}

.modal-content {
    background: var(--color-secondary);
    padding: var(--spacing-lg);
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-gray);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-speed);
}

.modal-close:hover {
    background: var(--color-light-gray);
}

.modal h3 {
    margin-bottom: 10px;
}

.modal-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.modal form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal input,
.modal textarea,
.modal select {
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.modal input:focus,
.modal textarea:focus,
.modal select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.modal textarea {
    min-height: 100px;
    resize: vertical;
}

.modal button[type="submit"] {
    background: var(--color-primary);
    color: var(--color-secondary);
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    font-size: 16px;
    transition: opacity var(--transition-speed);
}

.modal button[type="submit"]:hover {
    opacity: 0.8;
}

/* AI Note */
.ai-note {
    background: var(--color-light-gray);
    padding: 30px;
    border-radius: 8px;
    margin: var(--spacing-lg) 0;
    font-size: 16px;
}

.ai-note strong {
    display: block;
    margin-bottom: 10px;
}

/* Contact Section */
.contact {
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.contact-buttons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-top: 30px;
}

/* Footer */
footer {
    background: #1a1a1a;
    color: #fff;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section p {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #999;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #fff;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid #333;
    text-align: center;
}

.footer-bottom p {
    color: #666;
    font-size: 0.85rem;
    margin: 0;
    text-align: center;
}
.footer-legal {
    margin-top: 0.5rem;
    text-align: center;
}
.footer-legal a {
    color: #888;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.85rem;
}
.footer-legal a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Fixed CTA Bar */
.cta-bar {
    position: sticky;
    top: 60px; /* Just below navbar */
    left: 0;
    right: 0;
    background: var(--color-primary);
    color: var(--color-secondary);
    padding: 12px 0;
    z-index: 1001; /* Higher than navbar (1000) */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cta-bar-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
}

.cta-bar span {
    font-size: 15px;
}

.cta-bar-button {
    background: var(--color-secondary);
    color: var(--color-primary);
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: opacity var(--transition-speed);
}

.cta-bar-button:hover {
    opacity: 0.9;
}

/* Adjust header for fixed navbar */
body {
    padding-top: 60px; /* Height of fixed navbar */
}

/* Blog specific adjustments */
.blog-container {
    padding-top: 20px; /* Additional space for blog header */
}

/* Tech Stack Section */
.tech-stack {
    padding: 80px 0;
    background: var(--color-light-gray);
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.stack-item {
    background: var(--color-secondary);
    padding: var(--spacing-lg);
    border-radius: 8px;
    border-left: 3px solid var(--color-primary);
}

.stack-item h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--color-primary);
}

.stack-item p {
    color: var(--color-gray);
    font-size: 15px;
    margin: 0;
}

/* Form Success/Error Messages */
.form-success,
.form-error {
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
    animation: slideIn 0.3s ease;
}

.form-success {
    background: #4CAF50;
    color: white;
}

.form-error {
    background: #f44336;
    color: white;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translate3d(0, -10px, 0);
        opacity: 0;
    }
    to {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile Navigation */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 2001;
    position: relative;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--color-primary);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Responsive - Tablet */
@media (max-width: 768px) {
    /* Show hamburger menu */
    .hamburger-menu {
        display: block !important;
    }
    
    /* Hide nav menu by default on mobile */
    .nav-menu {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        /* Elegant dark gradient with noise texture */
        background: 
            radial-gradient(
                ellipse at top,
                rgba(30, 30, 35, 0.95) 0%,
                rgba(10, 10, 12, 0.98) 100%
            ) !important;
        /* Try blur but don't rely on it */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        /* Subtle inner shadow for depth */
        box-shadow: 
            inset 0 0 100px rgba(0, 0, 0, 0.3),
            inset 0 0 20px rgba(255, 255, 255, 0.02);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        z-index: 10000;
        padding: 20px;
        animation: slideInRight 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        /* Force the menu to stay in viewport when scrolled */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    /* Light text for dark background - with higher specificity */
    @media (max-width: 768px) {
        .nav-menu a {
            color: #ffffff !important;
            font-size: 20px !important;
            font-weight: 300 !important;
            letter-spacing: 0.5px !important;
        }
        
        .nav-menu .cta-button {
            background: #ffffff !important;
            color: #000000 !important;
            padding: 12px 30px !important;
            font-weight: 500 !important;
            border-radius: 6px !important;
        }
        
        /* Make hamburger X white when menu is open */
        .hamburger-menu.active .hamburger-line {
            background: #ffffff !important;
        }
    }
    
    /* Show nav menu when active */
    .nav-menu.active {
        display: flex !important;
    }
    
    .nav-menu li {
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }
    
    .nav-menu a {
        display: block;
        padding: 10px;
    }
    
    /* Adjust nav container */
    .nav-container,
    .header-content {
        padding: 0 20px;
    }
    
    /* Typography */
    h1 {
        font-size: 24px;
        line-height: 1.2;
    }

    h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    h3 {
        font-size: 16px;
    }
    
    p {
        font-size: 14px;
    }

    /* Footer responsive - force 2 columns */
    footer .footer-container {
        padding: 0 1rem;
    }
    
    footer .footer-content {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 1.5rem;
        text-align: left;
    }
    
    footer .footer-section {
        display: block !important;
    }
    
    footer .footer-section:first-child {
        grid-column: 1 / -1;
        text-align: center;
        padding-bottom: 1rem;
        border-bottom: 1px solid #333;
        margin-bottom: 1rem;
    }
    
    footer .footer-section:nth-child(2),
    footer .footer-section:nth-child(3) {
        grid-column: span 1 !important;
    }
    
    footer .footer-section h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    footer .footer-section p,
    footer .footer-section a {
        font-size: 0.85rem;
    }
    
    footer .footer-section ul {
        padding: 0;
    }
    
    footer .footer-bottom {
        padding-top: 1.5rem;
        font-size: 0.75rem;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    /* Layout */
    section {
        padding: var(--spacing-xl) 0;
    }

    .container {
        padding: 0 15px;
    }

    /* Hero */
    .hero {
        padding: 60px 0;
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
    }
    
    .hero .subtitle {
        font-size: 18px;
    }

    /* Navigation */
    .mobile-menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-secondary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        z-index: 2000;
    }

    .nav-menu.active {
        display: flex !important;
    }

    .nav-menu li {
        text-align: center;
    }

    .nav-menu a {
        font-size: 18px;
        padding: 8px;
    }

    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .service {
        padding: 24px 20px;
    }

    /* Results */
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Stack */
    .stack-grid {
        grid-template-columns: 1fr;
    }

    /* CTA Bar */
    .cta-bar {
        top: 100px; /* Move CTA bar lower on mobile */
        padding: 10px 0;
    }
    
    .cta-bar-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 0 15px;
    }
    
    body {
        padding-top: 65px; /* Adjusted for mobile navbar */
    }

    /* Contact Buttons */
    .contact-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-buttons .cta-button {
        width: 100%;
        text-align: center;
    }

    /* Modal */
    .modal-content {
        padding: 30px 20px;
        width: 95%;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    /* Typography */
    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 16px;
    }
    
    p {
        font-size: 14px;
    }

    /* Hero */
    .hero {
        padding: 40px 0;
    }

    /* Sections */
    section {
        padding: 40px 0;
    }

    /* Results */
    .results-grid {
        grid-template-columns: 1fr;
    }

    .result-number {
        font-size: 28px;
    }

    /* Service Items */
    .service-item {
        padding: 20px;
    }

    /* Problem List */
    .problem-list li {
        padding: 15px 0;
    }

    /* Modal */
    .modal-content {
        padding: 25px 15px;
    }

    .modal h3 {
        font-size: 20px;
    }

    /* Footer */
    footer {
        padding: 30px 0;
    }
    
    /* About grid */
    .about-grid {
        grid-template-columns: 1fr !important;
        text-align: center;
    }
    
    .about-grid img {
        margin: 0 auto;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap targets */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-menu a {
        padding: 12px 16px;
    }

    .cta-button {
        padding: 12px 24px;
    }

    /* Remove hover effects on touch devices */
    .service:hover {
        transform: none;
        box-shadow: none;
    }
}