/* Ragnarok Revival Landing Page Styles */

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

/* Optimized smooth scrolling for mobile */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: 'Sarabun', sans-serif;
    /* Simplified background for better mobile performance */
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1a1a1a 50%, var(--dark-bg) 100%);
    background-color: #0a0a0a;
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Optimize for mobile performance */
    -webkit-overflow-scrolling: touch;
    will-change: auto;
}

/* Optimize animations for performance */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Simplified grain effect for mobile performance */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.font-kanit {
    font-family: 'Kanit', sans-serif;
}

/* Hero Section - Enhanced Design */
.hero {
    min-height: 100vh;
    background: 
        linear-gradient(135deg, rgba(0,0,0,0.9) 0%, rgba(26,26,26,0.8) 50%, rgba(0,0,0,0.9) 100%),
        radial-gradient(circle at 20% 80%, rgba(245, 158, 11, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(217, 119, 6, 0.15) 0%, transparent 50%),
        linear-gradient(45deg, #0a0a0a 0%, #1a1a1a 25%, #2a1a0a 50%, #1a1a1a 75%, #0a0a0a 100%);
    background-size: 100% 100%, 800px 800px, 600px 600px, 100% 100%;
    background-position: center, 0% 0%, 100% 100%, center;
    background-attachment: scroll;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Enhanced hero overlay effects */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 50%, rgba(245, 158, 11, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(217, 119, 6, 0.12) 0%, transparent 50%);
    z-index: 1;
}

/* Animated particles effect for desktop */
@media (min-width: 769px) {
    .hero::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: 
            radial-gradient(circle at 25% 25%, rgba(245, 158, 11, 0.1) 1px, transparent 1px),
            radial-gradient(circle at 75% 75%, rgba(217, 119, 6, 0.1) 1px, transparent 1px);
        background-size: 50px 50px, 80px 80px;
        animation: particleDrift 20s linear infinite;
        opacity: 0.6;
        z-index: 1;
    }
    
    .hero::before {
        animation: heroGlow 8s ease-in-out infinite alternate;
    }
}

@keyframes heroGlow {
    0% { 
        opacity: 0.8;
        transform: scale(1);
    }
    100% { 
        opacity: 1;
        transform: scale(1.02);
    }
}

@keyframes particleDrift {
    0% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-5px) translateY(-10px); }
    50% { transform: translateX(5px) translateY(-5px); }
    75% { transform: translateX(-3px) translateY(-15px); }
    100% { transform: translateX(0) translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.hero-content {
    text-align: center;
    max-width: 1200px;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.logo {
    width: 300px;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
    /* Simplified animation for better mobile performance */
}

/* Only animate on larger screens */
@media (min-width: 769px) {
    .logo {
        animation: float 6s ease-in-out infinite;
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

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

.hero-episode {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 3rem;
    font-weight: 500;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.btn {
    padding: 1.2rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    min-width: 180px;
    backdrop-filter: blur(10px);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.btn:hover::before {
    left: 100%;
}

.btn span,
.btn i {
    position: relative;
    z-index: 2;
}

.btn-primary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    background-size: 200% 200%;
    color: white;
    box-shadow: 
        0 10px 30px rgba(245, 158, 11, 0.4),
        0 0 0 1px rgba(245, 158, 11, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(245, 158, 11, 0.5),
        0 0 0 1px rgba(245, 158, 11, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation-duration: 1s;
}

.btn-primary:active {
    transform: translateY(-2px) scale(1.01);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.8) 0%, rgba(45, 45, 45, 0.8) 100%);
    color: var(--text-light);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-secondary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50px;
    padding: 2px;
    background: linear-gradient(135deg, #f59e0b, #d97706, #b45309);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    z-index: -1;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    color: white;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(245, 158, 11, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-secondary:active {
    transform: translateY(-2px) scale(1.01);
}

/* Features Section - Enhanced Design */
.features {
    padding: 6rem 2rem;
    background: 
        linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 25%, #1a1a1a 50%, #2d2d2d 75%, #1a1a1a 100%),
        radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(217, 119, 6, 0.05) 0%, transparent 50%);
    background-size: 100% 100%, 600px 600px, 800px 800px;
    position: relative;
    overflow: hidden;
}

/* Enhanced background effects for desktop */
@media (min-width: 769px) {
    .features::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: 
            radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.03) 0%, transparent 70%),
            linear-gradient(45deg, transparent 30%, rgba(245, 158, 11, 0.02) 50%, transparent 70%);
        opacity: 0.7;
        z-index: 1;
    }
    
    .features::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: 
            radial-gradient(circle at 30% 70%, rgba(245, 158, 11, 0.08) 2px, transparent 2px),
            radial-gradient(circle at 70% 30%, rgba(217, 119, 6, 0.08) 1px, transparent 1px);
        background-size: 60px 60px, 90px 90px;
        animation: backgroundFloat 30s linear infinite;
        opacity: 0.4;
        z-index: 1;
    }
}

@keyframes backgroundFloat {
    0% { transform: translateX(0) translateY(0) rotate(0deg); }
    25% { transform: translateX(-10px) translateY(-5px) rotate(1deg); }
    50% { transform: translateX(5px) translateY(-10px) rotate(-1deg); }
    75% { transform: translateX(-5px) translateY(-3px) rotate(0.5deg); }
    100% { transform: translateX(0) translateY(0) rotate(0deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.section-title {
    text-align: center;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.feature-card {
    background: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.05) 100%),
        radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid rgba(245, 158, 11, 0.1);
    backdrop-filter: blur(15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.1), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card .feature-icon,
.feature-card .feature-title,
.feature-card .feature-description {
    position: relative;
    z-index: 2;
}

/* Enhanced hover effects for desktop */
@media (min-width: 769px) {
    .feature-card:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 
            0 20px 40px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(245, 158, 11, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
        border-color: rgba(245, 158, 11, 0.4);
        background: 
            linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.08) 100%),
            radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.08) 0%, transparent 50%);
    }
    
    .feature-card:hover .feature-icon {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.5));
    }
}

/* Touch-friendly interactions for mobile */
@media (max-width: 768px) {
    .feature-card {
        padding: 2rem;
        transition: background-color 0.2s ease, transform 0.2s ease;
        backdrop-filter: none;
        background: rgba(255, 255, 255, 0.08);
    }
    
    .feature-card:active {
        background: rgba(255, 255, 255, 0.12);
        transform: scale(0.98);
    }
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.feature-description {
    color: var(--text-muted);
    line-height: 1.8;
}

/* Server Info Section */
.server-info {
    padding: 6rem 2rem;
    background: var(--dark-bg);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.info-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
}

.info-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.info-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.info-label {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Download Section */
.download {
    padding: 6rem 2rem;
    background: var(--gradient-dark);
    text-align: center;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.download-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.download-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
}

.platform-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.platform-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.platform-description {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    background: var(--card-bg);
    padding: 3rem 2rem 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section p,
.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    line-height: 1.8;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

/* Optimized scroll reveal animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design - Mobile Optimized */
@media (max-width: 768px) {
    /* Disable expensive effects on mobile */
    *,
    *::before,
    *::after {
        backface-visibility: visible !important;
        perspective: none !important;
        transform-style: flat !important;
    }

    /* Optimize animations for mobile */
    .hero::before {
        animation: none;
    }

    body::before {
        background: none;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .logo {
        width: 250px;
        animation: none;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .features {
        padding: 4rem 1rem;
    }

    .hero-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .logo {
        width: 200px;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        max-width: 280px;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 2rem;
    }
}

/* Loading Animation */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(245, 158, 11, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sparkle Animation */
@keyframes sparkleAnim {
    0% {
        opacity: 1;
        transform: scale(0) rotate(0deg) translateZ(0);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg) translateZ(0);
    }
    100% {
        opacity: 0;
        transform: scale(0) rotate(360deg) translateZ(0);
    }
}

/* CSS Variables */
:root {
    --primary-color: #f59e0b;
    --secondary-color: #d97706;
    --dark-bg: #101010;
    --card-bg: #1a1a1a;
    --text-light: #fafafd;
    --text-muted: #c8c7d8;
    --border-color: #374151;
    --gradient-primary: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-dark: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

/* Additional Mobile Performance Optimizations */
@media (max-width: 768px) {
    /* Reduce repaints and reflows on mobile */
    .btn {
        contain: layout style;
    }
    
    .feature-card {
        contain: layout style;
    }
    
    /* Optimize touch scrolling */
    body {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: auto;
    }
    
    /* Reduce blur effects on mobile for better performance */
    .feature-card,
    .download-card {
        backdrop-filter: none;
        background: rgba(255, 255, 255, 0.08);
    }
    
    /* Simplify gradients on mobile */
    .btn-primary {
        background: var(--primary-color);
    }
    
    .hero-title {
        background: var(--primary-color);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

/* Optimize critical rendering path */
.above-fold {
    contain: layout style paint;
}

/* End of file */
