/* ================= RESET & BASE ================= */

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

/* ================= FONTS ================= */

@font-face {
    font-family: 'Retro Gaming';
    src: url('assets/fonts/Retro Gaming.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Pixeled';
    src: url('assets/fonts/Pixeled.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'VT323';
    src: url('assets/fonts/VT323-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #E03231;
    --secondary-color: #2984B9;
    --dark-bg: #2d2f33;
    --darker-bg: #0f172a;
    --light-text: #f1f5f9;
    --gray-text: #94a3b8;
    --card-bg: #18455fb9;
    --navbar-height: 64px;
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --font-retro: 'Retro Gaming', 'Press Start 2P', monospace;
    --font-pixeled: 'Pixeled', monospace;
    --font-vt323: 'VT323', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
    background: var(--darker-bg);
    color: var(--light-text);
    line-height: 1.6;
}

/* ================= LOADING SCREEN ================= */

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

.loading-content {
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid rgba(99, 102, 241, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-family: var(--font-pixeled);
    font-size: 14px;
    color: var(--light-text);
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 1px;
}

.loading-bar {
    width: 300px;
    max-width: 90vw;
    height: 6px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 10px;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

.loading-percentage {
    font-size: 14px;
    color: var(--gray-text);
    font-weight: 500;
}

/* ================= SCROLL INDICATOR ================= */

.scroll-indicator {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    text-align: center;
    opacity: 0;
    animation: fadeInBounce 1s ease 1.5s forwards;
}

@keyframes fadeInBounce {
    0% {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.scroll-indicator.hidden {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.scroll-icon {
    width: 30px;
    height: 50px;
    border: 2px solid var(--light-text);
    border-radius: 15px;
    margin: 0 auto 10px;
    position: relative;
    opacity: 0.7;
}

.scroll-wheel {
    width: 4px;
    height: 10px;
    background: var(--light-text);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollDown 2s ease-in-out infinite;
}

@keyframes scrollDown {
    0%, 100% {
        top: 8px;
        opacity: 1;
    }
    50% {
        top: 24px;
        opacity: 0.3;
    }
}

.scroll-text {
    font-size: 14px;
    color: var(--light-text);
    opacity: 0.7;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ================= NAVBAR ================= */

#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--navbar-height);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

.logo {
    text-decoration: none;
    color: white;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 40px;
    width: auto;
    display: block;
}

.logo-text {
    font-family: var(--font-retro);
    font-size: 16px;
    color: var(--light-text);
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    font-family: var(--font-retro);
    color: var(--gray-text);
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    transition: color 0.3s ease;
    position: relative;
    letter-spacing: 1px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--light-text);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ================= HAMBURGER MENU (MOBILE) ================= */

.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
    transition: transform 0.3s ease;
}

.hamburger-menu:hover {
    transform: scale(1.1);
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--light-text);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* ================= DROPDOWN MENU ================= */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    font-family: var(--font-retro);
    background: none;
    border: none;
    color: var(--gray-text);
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.3s ease;
    letter-spacing: 1px;
}

.dropdown-btn:hover {
    color: var(--light-text);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: -10px;
    background: rgba(30, 41, 59, 0.98);
    backdrop-filter: blur(10px);
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 10px;
    padding-top: 14px;
    margin-top: 0;
    z-index: 1001;
    border: 1px solid rgba(99, 102, 241, 0.2);
    overflow: visible;
}

.dropdown-content::before {
    content: '';
    position: absolute;
    top: -14px;
    left: -10px;
    right: -10px;
    height: 20px;
    background: transparent;
}

.dropdown-content a {
    color: var(--light-text);
    padding: 14px 20px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: background 0.3s ease, color 0.3s ease;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: dropdownFade 0.3s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================= BANNER STAGE ================= */

#banner-stage {
    position: relative;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #000000 0%, #1a1a2e 100%);
    z-index: 1;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
    z-index: 2;
}

canvas {
    position: absolute;
    top: 0;
    left: 50%;
    transform-origin: top center;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    z-index: 1;
    will-change: transform, opacity;
}

/* ================= CONTENT ================= */

#content {
    position: relative;
    background: linear-gradient(180deg, var(--darker-bg) 0%, var(--dark-bg) 50%, var(--darker-bg) 100%);
    z-index: 10;
    padding-top: 0;
}

.content-section {
    padding: 50px 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.content-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.content-section h1 {
    margin-top: 20px;
    font-family: var(--font-retro);
    font-size: 42px;
    font-weight: 400;
    margin-bottom: 32px;
    background: var(--gray-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    line-height: 1.4;
    letter-spacing: 2px;
    animation: blink 1s infinite;
}

.content-section h2 {
    font-family: var(--font-retro);
    font-size: 40px;
    font-weight: 400;
    margin-bottom: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    line-height: 1.4;
    letter-spacing: 2px;
}

.content-section p {
    font-family: var(--font-vt323);
    font-size: 24px;
    color: var(--gray-text);
    margin-bottom: 16px;
    line-height: 1.6;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ================= PHASES GRID ================= */

.phases-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin-top: 48px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.phase-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    transition: transform 0.3s var(--transition-smooth), box-shadow 0.3s var(--transition-smooth);
    border: 1px solid rgba(99, 102, 241, 0.1);
    text-align: center;
    min-height: 350px;
}

.phase-card:nth-child(4) {
    grid-column: auto;
    max-width: none;
    margin: 0;
}

.phase-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
}

.phase-icon {
    width: 100%;
    height: 180px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phase-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.phase-card:hover .phase-icon img {
    transform: scale(1.1);
    filter: drop-shadow(0 8px 16px rgba(99, 102, 241, 0.5));
}

.phase-card h3 {
    font-family: var(--font-retro);
    font-size: 26px;
    font-weight: 400;
    margin-bottom: 16px;
    color: var(--light-text);
    letter-spacing: 1px;
}

.phase-card p {
    font-size: 18px;
    color: var(--gray-text);
    line-height: 1.6;
    text-align: center;
}

/* Phase description - expandable on hover */
.phase-description {
    font-family: var(--font-vt323);
    font-size: 24px !important;
    color: var(--gray-text) !important;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.5s ease, margin-top 0.5s ease, padding 0.5s ease;
    margin-top: 0;
    margin-bottom: 0 !important;
    line-height: 1.6;
    padding: 0;
}

.phase-card:hover .phase-description {
    max-height: 400px;
    opacity: 1;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(99, 102, 241, 0.3);
}

/* ================= CONTACT SECTION ================= */

.contact-info {
    font-size: 24px !important;
    margin: 32px 0 !important;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 600;
}

.contact-info a:hover {
    color: var(--secondary-color);
}

/* Social Links */
.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.social-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    background: var(--card-bg);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    color: var(--light-text);
    text-decoration: none;
    font-family: var(--font-vt323);
    font-size: 20px;
    transition: all 0.3s var(--transition-smooth);
}

.social-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.4);
}

.social-button i {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.social-button:hover i {
    transform: scale(1.2);
}

/* Instagram hover */
.social-button:nth-child(1):hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-color: transparent;
}

/* Facebook hover */
.social-button:nth-child(2):hover {
    background: #1877f2;
    border-color: transparent;
}

/* Email hover */
.social-button:nth-child(3):hover {
    background: var(--primary-color);
    border-color: transparent;
}

/* ================= FOOTER ================= */

.site-footer {
    background: var(--darker-bg);
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    padding: 40px 20px;
    text-align: center;
    color: var(--gray-text);
    margin-top: 0;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 1024px) {
    .phases-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .phase-card:nth-child(4) {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 56px;
    }
    
    #navbar {
        padding: 0 20px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .nav-links {
        gap: 20px;
    }
    
    .nav-links a, .dropdown-btn {
        font-size: 14px;
    }
    
    .content-section {
        padding: 80px 20px;
    }
    
    .content-section h2 {
        font-size: 24px;
        letter-spacing: 1px;
    }
    
    .content-section p {
        font-size: 16px;
    }
    
    .phases-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .phase-card {
        padding: 24px;
    }
    
    .phase-card:nth-child(4) {
        grid-column: 1;
        max-width: 100%;
    }
    
    .phase-card h3 {
        font-size: 16px;
    }
    
    .contact-info {
        font-size: 18px !important;
    }
    
    .scroll-indicator {
        bottom: 30px;
    }
    
    /* Social links responsive */
    .social-links {
        flex-direction: column;
        gap: 16px;
    }
    
    .social-button {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 18px;
    }
    
    .social-button i {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    /* Mostra o botão hambúrguer no mobile */
    .hamburger-menu {
        display: flex;
    }
    
    /* Menu mobile - escondido por padrão */
    .nav-links {
        position: fixed;
        top: var(--navbar-height);
        right: -100%;
        width: 280px;
        height: calc(100vh - var(--navbar-height));
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        gap: 0;
        padding: 20px;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 999;
    }
    
    /* Menu mobile aberto */
    .nav-links.active {
        right: 0;
    }
    
    /* Links no menu mobile */
    .nav-links > div {
        width: 100%;
        padding: 12px 0;
        border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    }
    
    .nav-links > div:last-child {
        border-bottom: none;
    }
    
    .nav-links a {
        font-size: 14px;
        display: block;
        padding: 8px 0;
    }
    
    .nav-links a::after {
        display: none;
    }
    
    /* Dropdown no mobile */
    .dropdown {
        width: 100%;
        display: block;
    }
    
    .dropdown-btn {
        width: 100%;
        text-align: left;
        padding: 8px 0;
        font-size: 14px;
    }
    
    .dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
        background: rgba(30, 41, 59, 0.5);
        margin-top: 12px;
        padding: 10px;
        border-radius: 8px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .dropdown-content::before {
        display: none;
    }
    
    .dropdown.active .dropdown-content {
        max-height: 500px;
        display: block;
    }
    
    .dropdown-content a {
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .content-section h2 {
        font-size: 28px;
    }
    
    .phase-card h3 {
        font-size: 20px;
    }
    
    #navbar {
        padding: 0 16px;
    }
    
    .loading-bar {
        width: 250px;
    }
    
    .logo-text {
        font-size: 12px;
    }
    
    .logo-img {
        height: 32px;
    }
}

/* ================= PERFORMANCE OPTIMIZATIONS ================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Smooth rendering */
canvas {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}
