/* ==================== */
/* CSS Variables & Reset */
/* ==================== */

:root {
    --primary-bg: #000000;
    --secondary-bg: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --card-bg: rgba(20, 20, 20, 0.8);
    --card-border: rgba(255, 255, 255, 0.2);
    --transition-speed: 0.3s;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ==================== */
/* Milky Way Panoramic Background */
/* ==================== */

#milky-way-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: #000000 url('https://cdn.eso.org/images/large/eso0932a.jpg') repeat-x center center;
    background-size: auto 200%; /* Zoom in 100% */
    animation: rotateMilkyWay 60s linear infinite;
    overflow: hidden;
}

/* Mobile: Rotate 90 degrees */
@media (max-width: 768px) {
    #milky-way-bg {
        background-size: auto 250%; /* Even more zoom on mobile */
        transform: rotate(90deg);
        transform-origin: center center;
        width: 100vh;
        height: 100vw;
        top: 50%;
        left: 50%;
        margin-left: -50vh;
        margin-top: -50vw;
    }
}

@keyframes rotateMilkyWay {
    from {
        background-position: 0 center;
    }
    to {
        background-position: 100% center;
    }
}


/* ==================== */
/* Main Container */
/* ==================== */

.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px;
}

/* ==================== */
/* Hero Section */
/* ==================== */

.hero {
    text-align: center;
    margin-bottom: 15px;
    padding: 15px 20px;
}

.hero h1 {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.8rem, 4.5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 3px;
    margin-bottom: 15px;
}

.hero .subtitle {
    font-family: 'Cinzel', serif;
    font-size: clamp(1rem, 2vw, 1.4rem);
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0.9;
}

/* ==================== */
/* App Showcase - Horizontal Scroll Row */
/* ==================== */

.showcase {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-top: 40px;
    overflow: hidden;
}

.app-scroll-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px 50px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}

.app-scroll-row::-webkit-scrollbar {
    display: none;
}

/* ==================== */
/* App Cards */
/* ==================== */

.app-card {
    flex: 0 0 auto;
    width: 250px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all var(--transition-speed) ease;
    backdrop-filter: blur(10px);
}

.app-card:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Tappable card states */
.app-card:active {
    transform: scale(0.98);
}

.app-card:focus {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 3px;
}

.app-card:focus:not(:focus-visible) {
    outline: none;
}

/* Touch feedback for mobile */
@media (hover: none) {
    .app-card:active {
        transform: scale(0.96);
        box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
    }
}

/* ==================== */
/* Video Container - iOS Portrait Ratio */
/* ==================== */

.video-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.app-video {
    display: block;
    width: 100%;
    height: auto;
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: 12px;
}

.app-video.loaded {
    opacity: 1;
}

/* Video Overlay & Loader */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.app-video.loaded ~ .video-overlay {
    opacity: 0;
}

/* Loader Animation */
.loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ==================== */
/* Responsive Design */
/* ==================== */

@media (max-width: 1024px) {
    .app-scroll-row {
        gap: 30px;
        padding: 20px 30px;
    }
    
    .app-card {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 40px 15px;
    }
    
    .hero {
        margin-bottom: 30px;
        padding: 20px 10px;
    }
    
    .app-scroll-row {
        gap: 25px;
        padding: 15px 20px;
    }
    
    .app-card {
        width: 170px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }
    
    .app-scroll-row {
        gap: 20px;
        padding: 10px 15px;
    }
    
    .app-card {
        width: 140px;
    }
}

/* ==================== */
/* Contact Section */
/* ==================== */

.contact-section {
    display: flex;
    justify-content: center;
    padding: 25px 20px;
    margin-top: 100px;
}

.contact-btn {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 1px;
    text-decoration: none;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 12px 30px;
    border-radius: 4px;
    transition: all var(--transition-speed) ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
    position: relative;
}

.contact-btn .email-text {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.contact-btn .copied-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #4ade80;
    font-weight: 600;
}

.contact-btn.copied .email-text {
    opacity: 0;
}

.contact-btn.copied .copied-text {
    opacity: 1;
}

.contact-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.contact-btn:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .contact-section {
        padding: 20px 20px;
    }
    
    .contact-btn {
        font-size: 1rem;
        padding: 12px 40px;
    }
}

/* ==================== */
/* Performance Optimizations */
/* ==================== */

/* Reduce animations on low-power devices */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* GPU Acceleration */
.app-card,
.app-video {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}
