:root {
    --bg-color: #E2EBFA;
    /* Light lavender-ish blue from the reference */
    --card-bg: #FFFFFF;
    --text-primary: #1A2B4B;
    /* Dark navy */
    --text-secondary: #5A6B8B;
    --accent-blue: #8DA9E6;
    /* Periwinkle blue for accents */
    --accent-dark: #6B8BC6;
    --font-family: 'Outfit', sans-serif;
    --divider-color: #E0E0E0;
    /* New variable for divider */

    /* New Semantic Colors for Dark Mode Support */
    --landing-bg: #F5F7FA;
    --header-bg: rgba(255, 255, 255, 0.85);
    --mobile-menu-bg: rgba(255, 255, 255, 0.98);
    --text-muted: #666666;
    --text-light-muted: #999999;
    --shadow-color: rgba(0, 0, 0, 0.05);

    /* Backgrounds that need switching */
    --hero-gradient: radial-gradient(circle at 50% 30%, #f0f4ff 0%, #e2ebfa 70%);
    --hero-gradient: radial-gradient(circle at 50% 30%, #f0f4ff 0%, #e2ebfa 70%);
    --icon-bg: #f0f4ff;

    /* TOC Colors */
    --toc-bg: #f8f9fa;
    --toc-border: #e9ecef;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0F172A;
        /* Slate 900 */
        --card-bg: #1E293B;
        /* Slate 800 */
        --text-primary: #F1F5F9;
        /* Slate 100 */
        --text-secondary: #94A3B8;
        /* Slate 400 */
        --divider-color: #334155;
        /* Slate 700 */

        --landing-bg: #0B1120;
        /* Darker Slate */
        --header-bg: rgba(15, 23, 42, 0.85);
        --mobile-menu-bg: rgba(15, 23, 42, 0.98);
        --text-muted: #94A3B8;
        --text-light-muted: #64748B;
        --shadow-color: rgba(0, 0, 0, 0.3);

        --hero-gradient: radial-gradient(circle at 50% 30%, #1E293B 0%, #0B1120 70%);
        --icon-bg: rgba(255, 255, 255, 0.05);

        --toc-bg: rgba(255, 255, 255, 0.05);
        /* Slightly lighter than card */
        --toc-border: #334155;
    }
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

body.landing-page {
    display: block;
    padding: 0;
    overflow-x: hidden;
    background-color: var(--landing-bg);
}

/* Add padding to body when sticky header is present on subpages */
body.subpage {
    padding-top: 100px;
}

.main-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.header {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card {
    background-color: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 4px 20px var(--shadow-color);
    width: 100%;
    overflow: hidden;
    text-align: center;
    padding: 40px 30px;
}

.card-header h2 {
    color: var(--accent-blue);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.greeting {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    font-weight: 600;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
    /* Center items explicitly */
}

/* Store Badge Styles */
.store-buttons {
    display: flex;
    gap: 15px;
    padding-left: 5px;
    padding-right: 5px;
    justify-content: space-between;
    /* Allow them to fill space */
    width: 100%;
    /* Ensure container is full width */
    margin-bottom: 5px;
    /* Reduced bottom margin to specific spacing */
}

.store-badge {
    flex: 1;
    /* Grow to fill space */
    height: auto;
    /* Let height scale */
    transition: transform 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.store-badge img {
    width: 100%;
    /* Fill the flex item width */
    height: auto;
    /* Maintain aspect ratio */
    min-width: 140px;
    /* Ensure they don't get too small */
    display: block;
}

.store-badge:hover {
    transform: scale(1.03);
    /* Subtle scale on hover */
}

.divider {
    width: 100%;
    height: 1px;
    background-color: var(--divider-color);
    margin: 10px 0;
    /* Add some vertical spacing */
}

.btn-secondary {
    display: inline-block;
    padding: 15px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: center;
    background-color: var(--accent-blue);
    color: white;
    font-size: 1rem;
    width: 100%;
    /* Make buttons full width in container by default or let them size naturally? keeping consistent */
}

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

.info-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 20px;
}

.footer p {
    margin: 5px 0;
}

/* Responsive tweaks */
@media (max-width: 400px) {
    .card {
        padding: 30px 20px;
    }

    .store-badge {
        height: 36px;
        /* Slightly smaller on very small screens */
    }
}

.text-left {
    text-align: left;
}

.text-left p {
    margin-bottom: 15px;
}

.text-left h3 {
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.text-left h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--text-primary);
}

.text-left ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.text-left li {
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

th,
td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

th {
    background-color: var(--bg-color);
    color: var(--text-primary);
}

code {
    background-color: #f4f4f4;
    padding: 2px 4px;
    border-radius: 4px;

    font-family: monospace;
}

/* Table of Contents Box */
.toc-box {
    background-color: var(--toc-bg);
    padding: 20px;
    border-radius: 12px;
    /* Corner radius as before */
    margin-bottom: 30px;
    border: 1px solid var(--toc-border);
    /* Border width and color */
}

.toc-box ul {
    list-style-type: none;
    padding-left: 0;
}

.toc-box li {
    margin-bottom: 8px;
}

.toc-box a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
}

/* =========================================
   Landing Page Redesign Styles
   ========================================= */

/* Body override for landing page */
body.landing-page {
    display: block;
    padding: 0;
    overflow-x: hidden;
    background-color: var(--landing-bg);
    /* Lighter background for the landing */
}

/* Sticky Header */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 0 var(--shadow-color);
    transition: transform 0.3s ease;
}

.sticky-header .logo {
    font-size: 1.2rem;
    margin: 0;
    z-index: 1001;
    /* Ensure logo is above menu overlay */
    position: relative;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
    padding: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    transition: 0.3s;
}

/* Mobile Menu Open State */
.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

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

/* Responsive Navigation */
@media (max-width: 768px) {
    .header-actions {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--mobile-menu-bg);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        transition: 0.3s ease-in-out;
        z-index: 1000;
    }

    .header-actions.active {
        right: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-actions .btn-sm {
        font-size: 1.2rem;
        padding: 15px 30px;
        background: transparent;
        color: var(--text-primary);
    }

    /* Highlight the main CTA in mobile menu differently if needed */
    .header-actions a[href*="#download"] {
        background-color: var(--accent-blue);
        color: white;
        margin-top: 20px;
    }
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 20px;
    background-color: var(--accent-blue);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s;
}

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

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 20px 60px;
    position: relative;
    position: relative;
    overflow: hidden;
    background: var(--hero-gradient);
}

.hero-content {
    max-width: 800px;
    z-index: 2;
    margin-bottom: 40px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #1A2B4B 0%, #6B8BC6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

@media (prefers-color-scheme: dark) {
    .hero-title {
        background: linear-gradient(135deg, #E2EBFA 0%, #8DA9E6 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-weight: 400;
}

.hero-image-container {
    width: 100%;
    max-width: 900px;
    /* Reduced from 1000px to be safe */
    position: relative;
    z-index: 1;
    perspective: 1000px;
}

.hero-image {
    width: 100%;
    height: auto;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: rotateX(5deg);
    transition: transform 0.5s ease;
}

/* Feature Section (Alternating) */
.feature-section {
    padding: 100px 20px;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 60px;
}

.feature-section.reverse {
    flex-direction: row-reverse;
}

.feature-text {
    flex: 1;
}

.feature-text h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.feature-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.feature-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
}

.feature-image {
    width: 100%;
    max-width: 400px;
    border-radius: 30px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

/* Bento Grid */
.bento-container {
    max-width: 1100px;
    margin: 80px auto;
    padding: 0 20px;
}

.section-label {
    text-align: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-dark);
    margin-bottom: 40px;
    font-weight: 700;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.bento-item {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bento-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.bento-icon {
    font-size: 2rem;
    margin-bottom: 20px;
    display: inline-block;
    background: var(--icon-bg);
    width: 60px;
    height: 60px;
    line-height: 60px;
    text-align: center;
    border-radius: 50%;
    color: var(--accent-blue);
}

.bento-item h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.bento-item p {
    color: var(--text-muted);
}

/* Call to Action Footer */
.cta-footer {
    text-align: center;
    padding: 100px 20px;
    background: var(--card-bg);
    /* Use card-bg or landing-bg? section implies white usually, so card-bg fits */
}

.cta-footer h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Landing Page */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .feature-section {
        flex-direction: column;
        padding: 60px 20px;
        text-align: center;
    }

    .feature-section.reverse {
        flex-direction: column;
    }

    .feature-text {
        order: 1;
        /* Text first on mobile? Or image? usually image then text or text then image. Let's keep text first for flow */
    }

    .feature-image-wrapper {
        order: 2;
        margin-top: 30px;
    }
}