/* Fragments of Ancient:Tome - Main Stylesheet */
/* Dark Mystical Theme with Deep Purple & Ancient Gold */

/* ===== CSS Variables ===== */
:root {
    /* Colors - Deep Purple & Ancient Gold */
    --color-primary: #7B68EE;
    --color-primary-light: #8A6FB5;
    --color-primary-dark: #5B4BC7;
    --color-secondary: #B8941F;
    --color-gold: #D4AF37;
    --color-gold-light: #E6C158;
    
    /* Dark Background & Text */
    --color-bg: #0D0D1A;
    --color-bg-light: #1A1A2E;
    --color-bg-card: #1F1F35;
    --color-text: #E8E8F0;
    --color-text-secondary: #B8B8D0;
    --color-text-muted: #8888A0;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-display: Georgia, 'Times New Roman', serif;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 24px rgba(123, 104, 238, 0.4);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-light);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(13, 13, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(123, 104, 238, 0.2);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

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

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.header-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
}

.header-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.header-nav {
    display: none;
}

.nav-link {
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link:active {
    color: var(--color-primary);
}

.cta-button-header {
    background: var(--color-primary);
    color: white;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 0 16px rgba(123, 104, 238, 0.3);
    transition: all var(--transition-fast);
}

.cta-button-header:hover,
.cta-button-header:active {
    background: var(--color-primary-light);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 80px var(--spacing-md) var(--spacing-xl);
}

.hero-banner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(13, 13, 26, 0.85) 0%, rgba(13, 13, 26, 0.75) 50%, rgba(13, 13, 26, 0.9) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.hero-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glow);
    animation: etherealFloat 3s ease-in-out infinite;
}

@keyframes etherealFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.02); }
}

.hero-title {
    font-family: var(--font-family-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 12px rgba(123, 104, 238, 0.5);
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary-light);
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 8px rgba(123, 104, 238, 0.3);
}

.hero-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    align-items: center;
}

/* ===== Store Buttons ===== */
.store-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-base);
    min-height: 56px;
    width: 100%;
    max-width: 280px;
    position: relative;
}

.store-button.google-play {
    background: var(--color-primary);
    color: white;
    border: 2px solid var(--color-primary);
    box-shadow: 0 0 20px rgba(123, 104, 238, 0.4);
}

.store-button.google-play:hover,
.store-button.google-play:active {
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.store-button.app-store {
    background: #2a2a2a;
    color: #888;
    border: 2px solid #3a3a3a;
    opacity: 0.55;
    filter: grayscale(0.6);
    cursor: not-allowed;
}

.store-button.app-store .coming-soon-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #666;
    color: white;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.store-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.store-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.store-label {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.store-name {
    font-size: 18px;
    font-weight: 600;
}

.store-button.large {
    max-width: 320px;
    padding: 16px 32px;
}

/* ===== Section Base Styles ===== */
section {
    padding: var(--spacing-xxl) 0;
}

.section-title {
    font-family: var(--font-family-display);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    color: var(--color-text);
    margin-bottom: var(--spacing-xl);
    text-shadow: 0 2px 8px rgba(123, 104, 238, 0.3);
}

/* ===== Features Section ===== */
.features {
    background: var(--color-bg-light);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

.feature-card {
    background: var(--color-bg-card);
    border: 1px solid rgba(123, 104, 238, 0.2);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    transition: all var(--transition-base);
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 24px rgba(123, 104, 238, 0.3);
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
    filter: drop-shadow(0 0 8px rgba(123, 104, 238, 0.5));
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
}

.feature-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

/* ===== Screenshots Section ===== */
.screenshots {
    background: var(--color-bg);
}

.screenshots-container {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--color-bg-light);
    padding-bottom: var(--spacing-md);
}

.screenshots-container::-webkit-scrollbar {
    height: 8px;
}

.screenshots-container::-webkit-scrollbar-track {
    background: var(--color-bg-light);
    border-radius: var(--radius-sm);
}

.screenshots-container::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: var(--radius-sm);
}

.screenshot-item {
    flex: 0 0 280px;
    scroll-snap-align: center;
}

.screenshot-item img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 2px solid rgba(123, 104, 238, 0.3);
}

.screenshot-item img:hover {
    box-shadow: 0 0 24px rgba(123, 104, 238, 0.5);
    transform: scale(1.02) rotateY(2deg);
}

/* ===== Download CTA Section ===== */
.download-cta {
    background: linear-gradient(135deg, #1A1A2E 0%, #2D2548 50%, #1A1A2E 100%);
    text-align: center;
    padding: var(--spacing-xxl) var(--spacing-md);
    position: relative;
}

.download-title {
    font-family: var(--font-family-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 12px rgba(123, 104, 238, 0.5);
}

.download-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Floating CTA (Mobile) ===== */
.floating-cta {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(13, 13, 26, 0.98);
    backdrop-filter: blur(10px);
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid rgba(123, 104, 238, 0.3);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
    z-index: 900;
}

.floating-button {
    display: block;
    width: 100%;
    background: var(--color-primary);
    color: white;
    padding: 14px var(--spacing-lg);
    border-radius: var(--radius-full);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 0 20px rgba(123, 104, 238, 0.4);
    transition: all var(--transition-fast);
}

.floating-button:hover,
.floating-button:active {
    background: var(--color-primary-light);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

/* ===== About Section ===== */
.about {
    background: var(--color-bg-light);
}

.about-text {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
    max-width: 800px;
    margin: 0 auto var(--spacing-lg);
    text-align: center;
}

.about-contact {
    font-size: 1rem;
    color: var(--color-text-secondary);
    text-align: center;
}

.about-contact a {
    color: var(--color-primary);
    font-weight: 600;
}

.about-contact a:hover {
    color: var(--color-gold);
}

/* ===== Footer ===== */
.footer {
    background: var(--color-bg);
    border-top: 1px solid rgba(123, 104, 238, 0.2);
    padding: var(--spacing-xl) 0 var(--spacing-lg);
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.footer-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
}

.footer-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
}

.footer-links {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-primary);
}

.footer-contact {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
}

.footer-contact a {
    color: var(--color-primary);
}

.footer-copyright {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* ===== Responsive: Tablet (768px+) ===== */
@media (min-width: 768px) {
    .header {
        height: 64px;
    }
    
    .header-nav {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);
    }
    
    .header-title {
        font-size: 16px;
    }
    
    .hero {
        padding: 120px var(--spacing-lg) var(--spacing-xxl);
    }
    
    .hero-icon {
        width: 140px;
        height: 140px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
    
    .download-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .floating-cta {
        display: none;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .screenshot-item {
        flex: 0 0 360px;
    }
    
    .download-title {
        font-size: 2.5rem;
    }
}

/* ===== Responsive: Desktop (1024px+) ===== */
@media (min-width: 1024px) {
    .hero-content {
        max-width: 700px;
    }
    
    .hero-icon {
        width: 160px;
        height: 160px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .screenshots-container {
        justify-content: center;
        flex-wrap: wrap;
        overflow-x: visible;
    }
    
    .screenshot-item {
        flex: 0 0 360px;
    }
}
