/* Reset & Base Styles */
:root {
    --bg-color: #000000;
    --text-color: #f5f5f7;
    --text-secondary: #86868b;
    --accent-color: #2997ff;
    --accent-hover: #0071e3;
    --nav-bg: rgba(0, 0, 0, 0.8);
    --card-bg: #1d1d1f;
    --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Animation Variables (Updated by JS) */
    --scroll-pct: 0;
    --hero-opacity: 1;
    --hero-scale: 1;
    --desktop-progress: 0;
    --mobile-progress: 0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: transparent; /* Changed from var(--bg-color) to transparent */
    color: var(--text-color);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    -webkit-user-select: none;
}

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* Typography */
h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

h2 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Shimmer Effect for Titles */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.hero-title, .section-title, .text-area h2 {
    background: linear-gradient(
        110deg, 
        #888888 0%, 
        #ffffff 15%, 
        #888888 30%, 
        #888888 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 6s linear infinite;
}

h3 { font-size: 1.5rem; font-weight: 600; }
p { font-size: 1.3rem; color: var(--text-secondary); font-weight: 400; }

.version-tag {
    display: inline-block;
    background: rgba(41, 151, 255, 0.15);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-top: 1.5rem;
    backdrop-filter: blur(10px);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 980px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: center;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 0 20px rgba(41, 151, 255, 0.4);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 0 30px rgba(41, 151, 255, 0.6);
}

.btn-secondary { background-color: white; color: black; }
.btn-secondary:hover { background-color: #e8e8ed; }
.btn-outline { border: 1px solid var(--accent-color); color: var(--accent-color); }
.btn-outline:hover { background-color: rgba(41, 151, 255, 0.1); }

.link-more {
    color: var(--accent-color);
    font-size: 1.1rem;
    margin-left: 20px;
    position: relative;
}
.link-more::after {
    content: '>';
    display: inline-block;
    margin-left: 5px;
    transition: transform 0.3s ease;
}
.link-more:hover::after { transform: translateX(5px); }

/* Navigation */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 52px;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 1000;
    display: flex; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background-color 0.3s ease;
}
.navbar .container {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 20px;
}
.logo { font-weight: 600; font-size: 1.3rem; color: white; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 30px; }
.nav-links a { font-size: 0.85rem; color: #d6d6d6; opacity: 0.8; }
.nav-links a:hover { color: white; opacity: 1; }
.btn-nav { background: white; color: black !important; padding: 4px 12px; border-radius: 12px; font-weight: 500; opacity: 1 !important; }
.hamburger { display: none; cursor: pointer; }
.hamburger span { display: block; width: 20px; height: 2px; background: white; margin: 5px 0; }

/* =========================================
   AMBIENT BACKGROUND
   ========================================= */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -100; /* Lower z-index to ensure it's behind everything */
    background: #000; /* Fallback */
    background: radial-gradient(circle at center, #111 0%, #000000 100%); /* Slightly lighter center */
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px); /* Reduced blur slightly for more definition */
    opacity: 0.8; /* Increased opacity from 0.5 */
    animation: float 20s infinite ease-in-out alternate;
    will-change: transform;
}

.orb-1 {
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, rgba(41, 151, 255, 0.25) 0%, rgba(0,0,0,0) 70%); /* Increased opacity */
    top: -20%;
    left: -10%;
    animation-duration: 25s;
}

.orb-2 {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(100, 50, 255, 0.2) 0%, rgba(0,0,0,0) 70%); /* Increased opacity */
    bottom: -10%;
    right: -20%;
    animation-duration: 30s;
    animation-delay: -5s;
}

.orb-3 {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(0, 100, 255, 0.15) 0%, rgba(0,0,0,0) 70%); /* Increased opacity */
    top: 40%;
    left: 30%;
    animation-duration: 35s;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, 50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
    100% { transform: translate(10px, -30px) scale(1.05); }
}

/* =========================================
   HERO SECTION (Parallax & Scale)
   ========================================= */
.hero {
    position: relative;
    height: 120vh; /* Extra height for scroll effect */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 150px;
    overflow: hidden;
    text-align: center;
}

.hero-content {
    position: relative;
    z-index: 2;
    /* Controlled by JS variables */
    opacity: var(--hero-opacity);
    transform: translateY(calc(var(--scroll-pct) * -50px)) scale(calc(1 - var(--scroll-pct) * 0.1));
    will-change: transform, opacity;
}

.hero-title {
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 1.8rem;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, #fff 0%, #888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-image-container {
    margin-top: 40px;
    width: 90%;
    max-width: 1100px;
    perspective: 1000px;
    z-index: 1;
}

.hero-img {
    border-radius: 12px;
    box-shadow: 0 0 80px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.15);
    /* Parallax Scale Effect */
    transform: scale(var(--hero-scale)) translateY(calc(var(--scroll-pct) * -100px));
    will-change: transform;
    transition: transform 0.1s linear; /* Smooth out JS updates */
}

/* =========================================
   DESKTOP SHOWCASE (Sticky Stack & Switcher)
   ========================================= */
.showcase-desktop {
    position: relative;
    height: 250vh; /* Long scroll area */
    background: transparent; /* Reveal ambient bg */
}

.sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.desktop-content {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.text-area {
    text-align: center;
    margin-bottom: 20px;
    z-index: 10;
    /* Fade out text slightly as we scroll deep */
    opacity: calc(1 - var(--desktop-progress) * 0.2);
    transform: translateY(calc(var(--desktop-progress) * -20px));
}

.desktop-stage {
    position: relative;
    width: 100%;
    height: 65vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    perspective: 2000px; /* For 3D effect */
}

.desktop-visuals {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Entrance Animation controlled by scroll */
    opacity: var(--desktop-progress);
    transform: translateY(calc(100px * (1 - var(--desktop-progress))));
}

.visual-card {
    position: absolute;
    width: 65%; /* Base width */
    max-width: 900px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smooth switching */
    background: #1d1d1f;
    cursor: pointer;
}

/* 
   Position Classes 
   Combined with Scroll Entrance Logic:
   When progress < 1, cards are further apart (fly-in effect).
*/

/* Center (Active) */
.visual-card.pos-center {
    z-index: 10;
    transform: translateX(0) scale(1);
    filter: brightness(1);
}

/* Left */
.visual-card.pos-left {
    z-index: 5;
    /* Base: -55%, Rotate -15deg. 
       Entrance: Add extra -20% when progress is 0 */
    transform: translateX(calc(-55% - (1 - var(--desktop-progress)) * 20%)) scale(0.85) rotateY(25deg) translateZ(-100px);
    filter: brightness(0.5);
    opacity: calc(0.6 + var(--desktop-progress) * 0.4);
}

/* Right */
.visual-card.pos-right {
    z-index: 5;
    /* Base: 55%, Rotate 15deg. 
       Entrance: Add extra 20% when progress is 0 */
    transform: translateX(calc(55% + (1 - var(--desktop-progress)) * 20%)) scale(0.85) rotateY(-25deg) translateZ(-100px);
    filter: brightness(0.5);
    opacity: calc(0.6 + var(--desktop-progress) * 0.4);
}

/* Hover effects for side cards */
.visual-card.pos-left:hover,
.visual-card.pos-right:hover {
    filter: brightness(0.8);
    z-index: 6; /* Bring slightly forward on hover */
}

/* Controls */
.desktop-controls {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    background: rgba(255,255,255,0.1);
    padding: 6px;
    border-radius: 99px;
    backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(20px);
    /* Show controls only when scrolled in */
    animation: fadeInControls 0.5s forwards;
    animation-delay: 0.5s; /* Wait for cards */
    animation-play-state: paused; /* Controlled by JS via class? Or just use opacity transition */
    transition: opacity 0.5s, transform 0.5s;
}

/* We'll use a class to show controls when ready */
.desktop-controls.visible {
    opacity: 1;
    transform: translateY(0);
}

.control-btn {
    background: transparent;
    border: none;
    color: #86868b;
    padding: 8px 20px;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    color: white;
}

.control-btn.active {
    background: white;
    color: black;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* =========================================
   MOBILE SHOWCASE (Horizontal Scroll)
   ========================================= */
.showcase-mobile-scroll {
    position: relative;
    height: 400vh; /* Very long to allow horizontal scroll */
    background: transparent; /* Changed from #f5f5f7 to transparent */
    color: var(--text-color); /* Changed from #1d1d1f */
}

.showcase-mobile-scroll .sticky-container {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mobile-text {
    position: absolute;
    top: 10%;
    left: 10%;
    z-index: 10;
    opacity: calc(1 - var(--mobile-progress) * 2); /* Fade out quickly */
}

.mobile-text h2 { color: var(--text-color); } /* Changed from #1d1d1f */
.mobile-text p { color: var(--text-secondary); } /* Changed from #86868b */

.horizontal-track {
    display: flex;
    gap: 60px;
    padding-left: 100vw; /* Start off-screen */
    /* Move left based on scroll progress */
    transform: translateX(calc(0px - (var(--mobile-progress) * 150vw))); 
    will-change: transform;
}

.mobile-card {
    flex: 0 0 300px;
    border-radius: 40px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    border: 10px solid #1d1d1f;
    background: #000;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.mobile-card:hover {
    transform: scale(1.05) translateY(-10px);
}

/* =========================================
   DOWNLOAD SECTION
   ========================================= */
.download-section {
    padding: 150px 0;
    background-color: transparent; /* Reveal ambient bg */
    text-align: center;
    position: relative;
    z-index: 2;
}

.section-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 80px;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.download-card {
    background: rgba(29, 29, 31, 0.6); /* Semi-transparent */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 40px 30px;
    border-radius: 24px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.download-card:hover {
    transform: translateY(-8px);
    background: rgba(40, 40, 43, 0.7);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 20px rgba(41, 151, 255, 0.1); /* Subtle glow */
    border-color: rgba(255,255,255,0.2);
}

.card-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    color: #f5f5f7;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

.download-card:hover .card-icon {
    transform: scale(1.1);
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.download-card h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #f5f5f7;
    letter-spacing: -0.02em;
}

.card-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
    color: #86868b;
    font-size: 0.9rem;
    font-family: "SF Mono", "Menlo", "Monaco", "Courier New", monospace;
    opacity: 0.8;
}

.card-info .sep {
    color: #424245;
    font-weight: 300;
}

.card-info .version {
    color: var(--text-color);
    font-weight: 600;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: auto; /* Push to bottom if height varies */
}

.btn-sm {
    padding: 12px 20px;
    font-size: 1rem;
    width: 100%;
    border-radius: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Download Card Specific Button Overrides */
.download-card .btn-primary {
    box-shadow: 0 4px 12px rgba(41, 151, 255, 0.3);
}

.download-card .btn-primary:hover {
    box-shadow: 0 6px 16px rgba(41, 151, 255, 0.5);
    transform: translateY(-1px);
}

.download-card .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.download-card .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Specific Icon Colors on Hover (Optional) */
.download-card:hover .windows-icon { color: #0078D6; }
.download-card:hover .apple-icon { color: #fff; }
.download-card:hover .android-icon { color: #3DDC84; }

/* Footer */
footer {
    background-color: rgba(0,0,0,0.3); /* Semi-transparent */
    backdrop-filter: blur(20px);
    padding: 60px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.8rem;
    color: #666;
}
.footer-content { display: flex; justify-content: space-between; max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.footer-links a { margin-left: 30px; color: #666; }
.footer-links a:hover { color: #999; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-title { font-size: 3rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .nav-links { display: none; }
    .hamburger { display: block; }
    
    .card-side-1, .card-side-2 { display: none; } /* Simplify desktop view on mobile */
    .card-main { width: 90%; }
    
    .horizontal-track {
        padding-left: 20px;
        transform: none; /* Disable horizontal scroll logic on actual mobile devices if preferred, or keep it */
        overflow-x: auto;
        width: 100%;
    }
    .showcase-mobile-scroll { height: auto; }
    .showcase-mobile-scroll .sticky-container { height: auto; position: relative; display: block; }
    .mobile-text { position: relative; top: 0; left: 0; padding: 40px 20px; text-align: center; opacity: 1; }

    /* Footer Mobile Fix */
    .footer-content {
        flex-direction: column-reverse;
        gap: 20px;
        text-align: center;
    }
    
    .footer-links {
        display: flex;
        justify-content: center;
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .footer-links a {
        margin-left: 0;
    }
}

/* =========================================
   MODAL STYLES
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(29, 29, 31, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #fff;
}

.modal-body {
    margin-bottom: 30px;
    color: #d2d2d7;
    font-size: 1rem;
    line-height: 1.6;
}

.modal-body p {
    margin-bottom: 15px;
    font-size: 1rem;
    color: #d2d2d7;
}

.modal-body .highlight {
    background: rgba(41, 151, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    color: #fff;
    font-weight: 500;
    border: 1px solid rgba(41, 151, 255, 0.2);
}

.modal-body .note {
    font-size: 0.85rem;
    color: #86868b;
    font-weight: 400;
}

.modal-body .small-text {
    font-size: 0.8rem;
    color: #6e6e73;
    margin-top: 20px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-actions .btn {
    min-width: 120px;
}
