:root {
    /* Light Theme (Default) */
    --bg: #ffffff;
    --text: #1d1d1f;
    --text-secondary: #86868b;
    --accent: #0066cc; /* Slightly softer blue for Light Mode */
    --card-bg: rgba(245, 245, 247, 0.4);
    --border: rgba(0, 0, 0, 0.08);
    --glass: rgba(255, 255, 255, 0.72);
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --section-padding: 140px; /* Increased breathing room */
    --gap: 2rem; /* Standardized spatial gap */
}

[data-theme="dark"] {
    --bg: #000000;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --accent: #2997ff;
    --card-bg: rgba(28, 28, 30, 0.5);
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(0, 0, 0, 0.72);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Typography */
h1 { font-size: 80px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; }
h2 { font-size: 52px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
h3 { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }
p { font-size: 20px; line-height: 1.5; color: var(--text-secondary); font-weight: 400; }

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 48px;
    background: var(--glass);
    backdrop-filter: saturate(180%) blur(20px);
    z-index: 9999;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-links {
    display: flex;
    gap: 2rem;
    font-size: 12px;
    font-weight: 400;
    color: var(--text);
    opacity: 0.8;
}

/* Sections */
.section {
    padding: var(--section-padding) 0;
}

.hero {
    text-align: center;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    /* Premium deep dark treatment */
    background-image: 
        radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.8) 100%),
        url('hero_bg_premium_new.png');
    background-size: cover;
    background-position: center;
    background-blend-mode: multiply; /* Blends the image into the dark gradient */
    filter: brightness(0.8) contrast(1.2) saturate(0.9); /* Cinematic color grading */
    color: white;
}

/* Ensure text on hero stays readable in light mode too */
[data-theme="light"] .hero {
    background-image: linear-gradient(rgba(255,255,255,0.4), rgba(255,255,255,0.4)), url('hero_bg_premium_new.png');
    background-blend-mode: normal;
    filter: none;
    color: #000000;
}

.hero p { color: inherit; opacity: 0.9; }
.hero h1 { margin-bottom: 1rem; color: inherit; }

/* Language Switcher */
.lang-switcher {
    position: fixed;
    top: 14px;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10000;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s;
    text-transform: uppercase;
}

.lang-btn.active {
    opacity: 1;
}

/* Case Study Cards */
.case-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 3rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    backdrop-filter: blur(20px);
}

.case-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(var(--accent), 0.3);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.metric {
    font-size: 48px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

html {
    scroll-behavior: smooth;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 400px;
    gap: var(--gap);
}

.bento-item {
    grid-column: span 6;
    background: var(--card-bg);
    border-radius: 32px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
}

.bento-item h2, .bento-item h3 { margin-bottom: 1.5rem; color: var(--text); }
.bento-item p { max-width: 600px; } 

/* Library Card Theme Alignment */
.library-card {
    background: rgba(255, 255, 255, 0.03) !important;
    color: var(--text) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="light"] .library-card {
    background: rgba(0, 0, 0, 0.02) !important;
    color: var(--text) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* Specific Library Button - Inverted for contrast */
.lib-btn-custom {
    background: var(--text) !important;
    color: var(--bg) !important;
    border: none !important;
    font-weight: 600 !important;
}

[data-theme="light"] .lib-btn-custom {
    background: #000000 !important;
    color: #ffffff !important;
}

/* Ensure centering is bulletproof */
.bento-item h3 {
    width: 100%;
    margin-bottom: 1.5rem;
}

.bento-item:hover {
    transform: scale(1.02);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--accent);
    color: white !important;
}

.btn-secondary {
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--text);
}

[data-theme="dark"] .btn-secondary {
    background: rgba(255,255,255,0.1);
    color: white;
}

.btn-primary:hover {
    background-color: #0077ed;
    opacity: 1;
    transform: scale(1.02);
}

/* Button Shimmer Effect */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(30deg);
    transition: none;
    pointer-events: none;
}

.btn-primary:hover::after {
    left: 130%;
    transition: left 0.6s ease-in-out;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--glass);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

/* Animations */
@keyframes reveal {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.reveal {
    animation: reveal 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* --- Mobile Adaptation & Responsiveness --- */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
        --gap: 1.5rem;
    }

    /* Typography Scaling */
    h1 { font-size: 38px !important; line-height: 1.1; }
    h2 { font-size: 30px !important; line-height: 1.2; }
    h3 { font-size: 22px !important; }
    p { font-size: 17px !important; }

    .container {
        padding: 0 1.2rem;
    }

    /* Navigation Fix */
    nav {
        height: auto;
        padding: 12px 0;
    }

    .nav-links {
        gap: 0.8rem;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0 10px;
        font-size: 11px;
    }

    .lang-switcher {
        position: relative;
        top: 0;
        right: 0;
        justify-content: center;
        margin-top: 70px;
        margin-bottom: -30px;
    }

    .theme-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 38px;
        height: 38px;
    }

    /* Hero Section */
    .hero {
        padding-top: 60px;
        height: auto;
        min-height: 70vh;
    }

    .hero h1 { font-size: 36px !important; }
    .hero p { font-size: 18px !important; }

    /* Stacking Helpers */
    .grid-3-col, .grid-2-col, .flex-row-to-col {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        gap: 2.5rem !important;
    }

    /* Bento & Grids */
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .bento-item {
        grid-column: span 12 !important;
        padding: 2rem 1.25rem;
        height: auto;
        min-height: 250px;
    }

    /* Process Icons */
    .process-step-img {
        height: 200px !important;
    }

    /* Hardware Section */
    .hw-img-container {
        height: 350px !important;
    }

    .hw-card-overlay {
        bottom: 1.5rem !important;
        left: 1.5rem !important;
        right: 1.5rem !important;
        padding: 1.5rem !important;
    }

    /* VS Comparison */
    .vs-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
    }

    .vs-card {
        padding: 1.5rem !important;
    }

    /* Impact Grid */
    #cases-grid, #more-cases.active {
        display: flex !important;
        flex-direction: column !important;
    }
    #cases-grid, #more-cases {
        grid-template-columns: 1fr !important;
    }

    .case-card {
        padding: 2rem 1.5rem;
    }
}

/* --- NEW ENHANCEMENTS --- */

/* Sticky Header CTA */
.nav-cta {
    position: absolute;
    right: 8rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px !important;
    padding: 6px 14px !important;
    white-space: nowrap;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-cta:hover {
    transform: translateY(-50%) scale(1.02) !important;
}

@media (max-width: 768px) {
    .nav-cta {
        display: none !important;
    }
}

/* Privacy Badge */
.privacy-badge {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    color: #34c759;
    border: 1px solid rgba(52, 199, 89, 0.3);
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

[data-theme="light"] .privacy-badge {
    background: rgba(255, 255, 255, 0.8);
}

/* SVG Icons Anatomy */
.anatomy-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    color: var(--accent);
    filter: drop-shadow(0 0 12px rgba(0, 102, 204, 0.4));
}

[data-theme="dark"] .anatomy-icon {
    filter: drop-shadow(0 0 12px rgba(41, 151, 255, 0.4));
}

/* FAQ Accordion */
.faq-section {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
}

.faq-question {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.faq-question::after {
    content: '+';
    font-size: 24px;
    font-weight: 400;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, margin-top 0.4s ease;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    margin-top: 1rem;
}

/* Enhanced Hover for Pro Card and secondary btn */
.case-card.pro:hover {
    box-shadow: 0 20px 50px rgba(0, 102, 204, 0.3);
    border-color: var(--accent);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Mobile Menu Burger */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    z-index: 10001;
    position: fixed;
    top: 14px;
    left: 2rem;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: 0.3s;
}

@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    
    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: var(--bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 9998;
        font-size: 24px !important;
        opacity: 0;
        visibility: hidden;
    }

    .nav-links.active {
        left: 0;
        opacity: 1;
        visibility: visible;
    }

    .nav-links a {
        font-size: 24px !important;
    }
}

/* Scroll to Top */
#scroll-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--glass);
    border: 1px solid var(--border);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: transform 0.3s, opacity 0.3s;
    opacity: 0;
}

#scroll-top.visible {
    display: flex;
    opacity: 1;
}

#scroll-top:hover {
    transform: translateY(-5px);
}

/* Mobile Adjustments for existing elements */
@media (max-width: 768px) {
    .lang-switcher { right: 1rem; top: 12px; }
}
