/*
    STARWYNX - SILENT CINEMATIC EXPERIENCE
    =======================================
    Creative Technologist: Gemini
    Version: 7.0 (Silent Cinematic Pass)
*/

:root {
    --primary-color: #9F54FF;
    --secondary-color: #8e44ad;
    --dark-bg-start: #020412;
    --dark-bg-end: #0a0c23;
    --light-bg: rgba(10, 12, 35, 0.5);
    --text-color: #EAEAEA;
    --text-muted: #b0b0b0;
    --glow-color: rgba(159, 84, 255, 0.6);
    --font-family: 'Exo 2', sans-serif;
    --container-width: 1200px;
}

/* --- Base & Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    background-color: var(--dark-bg-start);
    background-image: linear-gradient(to bottom, var(--dark-bg-start), var(--dark-bg-end));
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
}
body a, body button { cursor: none; }

/* --- Magical Cursor --- */
#custom-cursor { position: fixed; top: 0; left: 0; width: 12px; height: 12px; background-color: var(--primary-color); border-radius: 50%; pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); transition: transform 0.1s ease-out, width 0.2s ease, height 0.2s ease; box-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color); }
#custom-cursor.hover { width: 24px; height: 24px; background-color: rgba(159, 84, 255, 0.5); }
.stardust-particle { position: fixed; background-color: white; border-radius: 50%; pointer-events: none; z-index: 9998; animation: fade-out 0.5s forwards; }
@keyframes fade-out { to { transform: scale(0); opacity: 0; } }

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--dark-bg-start); }
::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--secondary-color); }

/* --- Reusable Components --- */
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 2rem; }
.section-title { position: relative; overflow: hidden; font-weight: 900; font-size: 3rem; text-align: center; text-transform: uppercase; margin-bottom: 1.5rem; color: var(--text-color); text-shadow: 0 0 15px var(--glow-color); }
.section-title::after { content: ''; position: absolute; top: 0; left: -10%; width: 120%; height: 3px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent); opacity: 0; transform: translateY(-20px) scaleX(0.5); transition: none; }
.animate-on-scroll.visible .section-title.anim-child::after { animation: scanline 1.2s cubic-bezier(0.23, 1, 0.32, 1) 300ms forwards; }
@keyframes scanline { 0% { transform: translateY(0) scaleX(0.5); opacity: 0; } 10% { transform: translateY(10px) scaleX(1); opacity: 1; } 70% { transform: translateY(50px) scaleX(1); opacity: 1; } 100% { transform: translateY(60px) scaleX(0.5); opacity: 0; } }
.section-subtitle { text-align: center; max-width: 600px; margin: 0 auto 4rem auto; color: var(--text-muted); }

/* --- Holographic Energy Divider --- */
.section-divider { height: 2px; width: 100%; background: linear-gradient(90deg, transparent, var(--primary-color), transparent); position: relative; margin: 0 auto; transform: scaleX(0); opacity: 0; transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.8s ease; }
.section-divider.visible { transform: scaleX(1); opacity: 0.5; }

/* --- Hyperspace Preloader --- */
#preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #000; display: flex; justify-content: center; align-items: center; z-index: 9999; transition: opacity 1s ease-out; }
#hyperspace-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.preloader-logo { max-width: 150px; z-index: 10000; opacity: 0; animation: fade-in-logo 2s 0.5s forwards; }
@keyframes fade-in-logo { to { opacity: 1; } }
#flash-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: white; opacity: 0; pointer-events: none; }
#main-content { opacity: 0; transition: opacity 1s ease; }

/* --- Multi-Layered Parallax Background --- */
#background-effects { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; overflow: hidden; }
#background-effects canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transition: transform 0.2s ease-out; }

/* --- Header --- */
#main-header { position: fixed; width: 100%; top: 0; left: 0; z-index: 1000; padding: 1.5rem 0; transition: all 0.4s ease; }
#main-header.scrolled { background-color: rgba(2, 4, 18, 0.7); backdrop-filter: blur(10px); padding: 1rem 0; border-bottom: 1px solid rgba(159, 84, 255, 0.2); }
#main-header nav { display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 40px; }
.nav-links { list-style: none; display: flex; gap: 2.5rem; }
.nav-links a { color: var(--text-color); text-decoration: none; font-size: 1.1rem; font-weight: 700; position: relative; padding-bottom: 0.5rem; transition: color 0.3s ease; }
.nav-links a::after { content: ''; position: absolute; bottom: 0; left: 50%; width: 100%; height: 2px; background-color: var(--primary-color); transform: translateX(-50%) scaleX(0); transform-origin: center; transition: transform 0.4s ease-out; }
.nav-links a:hover { color: var(--primary-color); }
.nav-links a:hover::after { transform: translateX(-50%) scaleX(1); }

/* --- Hero Section & Connection Hub --- */
#hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 1rem; }
.hero-logo { max-width: 600px; width: 90%; margin-bottom: 1rem; animation: breathe 5s infinite ease-in-out; }
@keyframes breathe { 0%, 100% { filter: drop-shadow(0 0 25px var(--glow-color)); } 50% { filter: drop-shadow(0 0 40px var(--glow-color)); } }
.subtitle { font-size: 1.5rem; font-weight: 700; text-transform: uppercase; letter-spacing: 3px; margin-bottom: 2.5rem; color: var(--primary-color); text-shadow: 0 0 10px var(--glow-color); min-height: 1.5rem; }
.subtitle::after { content: '_'; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
#connection-hub { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.btn-connect { position: relative; background: rgba(0,0,0,0.3); border: 2px solid var(--primary-color); color: var(--text-color); padding: 1rem 2rem; border-radius: 8px; transition: all 0.2s ease; backdrop-filter: blur(5px); display: flex; flex-direction: column; gap: 0.25rem; }
.btn-connect:hover { box-shadow: 0 0 25px var(--glow-color), 0 0 40px var(--primary-color); }
.platform-title { font-size: 1.2rem; font-weight: 700; }
.platform-ip { font-size: 1rem; color: var(--text-muted); }
.port { color: #ffc107; }
.server-status { font-size: 1.1rem; font-weight: 700; }
#player-count.glitch { animation: glitch-effect 0.3s ease-in-out; }
@keyframes glitch-effect { 0%, 100% { text-shadow: 0 0 5px #fff; color: #fff; } 25% { text-shadow: 2px 2px 5px var(--primary-color), -2px -2px 5px #00ffff; color: #eee; } 50% { text-shadow: -2px 2px 5px var(--primary-color), 2px -2px 5px #00ffff; color: #fff; } 75% { text-shadow: 2px -2px 5px var(--primary-color), -2px 2px 5px #00ffff; color: #eee; } }

/* --- Holographic Grid & Card Effects --- */
.feature-card, .vote-card { position: relative; overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.feature-card::before, .vote-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: radial-gradient(circle, var(--primary-color) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.feature-card::after, .vote-card::after {
    content: '';
    position: absolute;
    top: -100%; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 100%);
    transition: top 0.5s ease;
}
.feature-card:hover, .vote-card:hover { transform: translateY(-10px); box-shadow: 0 0 30px var(--glow-color); }
.feature-card:hover::before, .vote-card:hover::before { opacity: 0.1; }
.feature-card:hover::after, .vote-card:hover::after { top: 0; }

/* --- Features Section --- */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }
.feature-card { padding: 2.5rem 2rem; text-align: center; background: var(--light-bg); border-radius: 15px; border: 1px solid rgba(159, 84, 255, 0.3); }
.feature-icon { height: 60px; margin-bottom: 1.5rem; }
.feature-card h3 { font-size: 1.5rem; margin-bottom: 0.5rem; font-weight: 700; }

/* --- Voting Section --- */
.vote-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.vote-card { background: var(--light-bg); border: 1px solid rgba(159, 84, 255, 0.3); color: var(--text-color); text-decoration: none; padding: 2rem; border-radius: 10px; text-align: center; font-size: 1.2rem; font-weight: 700; }

/* --- Gallery Section --- */
#gallery { background-color: var(--light-bg); }
.gallery-container { position: relative; overflow: hidden; border-radius: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.gallery-slider { display: flex; transition: transform 0.5s ease-in-out; }
.gallery-image { width: 100%; flex-shrink: 0; display: block; }
.slider-btn { position: absolute; top: 50%; transform: translateY(-50%); background-color: rgba(0, 0, 0, 0.5); color: white; border: none; z-index: 10; border-radius: 50%; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.slider-btn:hover { background-color: var(--primary-color); transform: translateY(-50%) scale(1.1); }
.prev-btn { left: 15px; }
.next-btn { right: 15px; }

/* --- Custom Discord Hub --- */
.community-content { text-align: center; }
.discord-hub { max-width: 500px; margin: 0 auto 80px auto; background: rgba(10, 12, 35, 0.4); backdrop-filter: blur(10px); border-radius: 15px; border: 1px solid rgba(159, 84, 255, 0.3); padding: 2rem; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); }
.discord-hub-header { display: flex; align-items: center; text-align: left; }
.discord-server-icon { width: 50px; height: 50px; border-radius: 50%; margin-right: 1rem; }
.discord-hub-info h3 { font-size: 1.5rem; margin: 0; }
.discord-hub-info p { margin: 0; color: var(--text-muted); }
.btn-discord { background-color: #5865F2; color: white; padding: 0.8rem 1.5rem; border-radius: 8px; text-decoration: none; font-weight: 700; transition: all 0.3s ease; }
.btn-discord:hover { transform: scale(1.05); box-shadow: 0 0 20px #5865f2a1; }
.btn-discord i { margin-right: 0.5rem; }

/* --- Footer --- */
#main-footer { padding: 4rem 0 2rem; border-top: 1px solid rgba(159, 84, 255, 0.2); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.footer-logo { height: 40px; margin-bottom: 1rem; }
.copyright { font-size: 0.9rem; color: var(--text-muted); }
.footer-column h4 { font-weight: 700; font-size: 1.2rem; margin-bottom: 1rem; color: var(--primary-color); }
.footer-column ul { list-style: none; }
.footer-column li { margin-bottom: 0.5rem; }
.footer-column a { color: var(--text-color); text-decoration: none; transition: color 0.3s ease; }
.footer-column a:hover { color: var(--primary-color); }
.social-icons { display: flex; gap: 1.5rem; margin-top: 0.5rem; }
.social-icons a { font-size: 1.5rem; color: var(--text-color); transition: all 0.3s ease; animation: pulse-icons 4s infinite ease-in-out; }
.social-icons a:hover { color: var(--primary-color); transform: scale(1.2); animation: none; }
@keyframes pulse-icons { 0%, 100% { filter: drop-shadow(0 0 2px var(--primary-color)); } 50% { filter: drop-shadow(0 0 8px var(--primary-color)); } }

/* --- Back to Top Button --- */
#back-to-top-btn { position: fixed; bottom: 20px; right: 20px; background-color: var(--primary-color); color: white; border: none; border-radius: 50%; width: 50px; height: 50px; z-index: 100; opacity: 0; visibility: hidden; transition: all 0.3s; transform: translateY(20px); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; animation: pulse-icons 3s infinite ease-in-out; }
#back-to-top-btn.show { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top-btn:hover { background-color: var(--secondary-color); transform: scale(1.1); animation: none; }

/* --- Cinematic On-Scroll Animations --- */
.animate-on-scroll .anim-child { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; transition-delay: var(--delay, 0ms); }
.animate-on-scroll.visible .anim-child { opacity: 1; transform: translateY(0); }

/* --- Responsive Design --- */
@media (max-width: 768px) {
    #custom-cursor { display: none; }
    body { cursor: auto; }
    body a, body button { cursor: pointer; }
    .section-title { font-size: 2.2rem; }
    .nav-links { display: none; }
    #connection-hub { flex-direction: column; }
    .discord-hub { flex-direction: column; gap: 1.5rem; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-column.about, .social-icons { justify-content: center; align-items: center; margin: 0 auto; }
    .footer-logo { margin: 0 auto 1rem auto; }
}
