/* ===== ROOT VARIABLES ===== */
:root {
    --primary-color: #c89b3c;
    --secondary-color: #785a28;
    --accent-gold: #f0e6d2;
    --dark-bg: #010a13;
    --darker-bg: #000000;
    --card-bg: #0a1428;
    --card-border: #1e2328;
    --text-primary: #f0e6d2;
    --text-secondary: #a09b8c;
    --text-muted: #5b5a56;
    --accent-blue: #0bc6df;
    --accent-purple: #8b5cf6;
    --glow-color: rgba(200, 155, 60, 0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ===== CANVAS BACKGROUND ===== */
#materia-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== NAVIGATION ===== */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(1, 10, 19, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--primary-color);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 0 2px 10px var(--glow-color);
    letter-spacing: 3px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    background: var(--primary-color);
    color: var(--dark-bg);
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    padding: 6rem 2rem 2rem;
    text-align: center;
}

.hero-content h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-gold) 50%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 20px var(--glow-color));
    margin-bottom: 1rem;
    letter-spacing: 4px;
}

/* Glitch Effect */
.glitch {
    position: relative;
    animation: glitch-animation 3s infinite;
}

@keyframes glitch-animation {
    0%, 90%, 100% {
        transform: translate(0);
    }
    92% {
        transform: translate(-2px, 2px);
    }
    94% {
        transform: translate(2px, -2px);
    }
    96% {
        transform: translate(-2px, -2px);
    }
    98% {
        transform: translate(2px, 2px);
    }
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 300;
}

.hero-stats {
    display: flex;
    gap: 4rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 0 2px 15px var(--glow-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-top: 0.5rem;
}

.cta-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--dark-bg);
    border: 2px solid var(--primary-color);
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px var(--glow-color);
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-button:hover::before {
    width: 300px;
    height: 300px;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--glow-color);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--primary-color);
    font-size: 0.9rem;
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    transform: rotate(45deg);
    margin-top: 0.5rem;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
    min-height: 100vh;
}

.content-section.dark {
    background: rgba(5, 8, 16, 0.8);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--primary-color) 50%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 4rem;
    filter: drop-shadow(0 2px 10px var(--glow-color));
    letter-spacing: 3px;
}

/* ===== TIMELINE ===== */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, transparent, var(--primary-color), transparent);
}

.timeline-item {
    display: flex;
    margin-bottom: 4rem;
    position: relative;
}

.timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-item::before {
    content: attr(data-year);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-bg);
    color: var(--primary-color);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    padding: 1rem 2rem;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 20px var(--glow-color);
    z-index: 2;
}

.timeline-content {
    flex: 1;
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    margin: 3rem 2rem 0;
    transition: var(--transition);
}

.timeline-content:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(200, 155, 60, 0.3);
    transform: translateY(-5px);
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: calc(50% + 2rem);
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: calc(50% + 2rem);
}

.timeline-content h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.timeline-content p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ===== IMAGE CONTAINERS ===== */
.image-container {
    width: 100%;
    margin: 1.5rem 0;
    border: 1px solid var(--card-border);
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

.image-container:hover img {
    transform: scale(1.05);
}

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    text-align: center;
}

/* ===== STORY GRID ===== */
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.story-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.story-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(200, 155, 60, 0.3);
    transform: translateY(-10px);
}

.card-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.story-card:hover .card-image img {
    transform: scale(1.1);
}

.card-content {
    padding: 2rem;
}

.card-content h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card-content p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ===== CHARACTERS GRID ===== */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.character-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.character-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(200, 155, 60, 0.3);
    transform: translateY(-10px);
}

.character-image {
    width: 150px;
    height: 150px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    overflow: hidden;
    box-shadow: 0 4px 20px var(--glow-color);
}

.character-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-card h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.character-role {
    color: var(--accent-blue);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.character-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ===== WORLD SECTION ===== */
.world-content {
    display: grid;
    gap: 3rem;
}

.world-map {
    width: 100%;
    border: 1px solid var(--primary-color);
    box-shadow: 0 8px 30px rgba(200, 155, 60, 0.3);
}

.world-map img {
    width: 100%;
    height: auto;
    display: block;
}

.world-locations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.location-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.location-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(200, 155, 60, 0.3);
    transform: translateY(-10px);
}

.location-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.location-card:hover img {
    transform: scale(1.1);
}

.location-card h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-size: 1.3rem;
    padding: 1rem 1rem 0.5rem;
}

.location-card p {
    color: var(--text-secondary);
    padding: 0 1rem 1.5rem;
    line-height: 1.6;
}

/* ===== REMAKE SECTION ===== */
.remake-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.remake-hero {
    width: 100%;
    border: 1px solid var(--primary-color);
    box-shadow: 0 8px 30px rgba(200, 155, 60, 0.3);
    overflow: hidden;
}

.remake-hero img {
    width: 100%;
    height: auto;
    display: block;
}

.remake-info h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.remake-info p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.remake-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 2rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.feature:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(200, 155, 60, 0.3);
}

.feature h4 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.feature p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.remake-timeline h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.remake-games {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.remake-game {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.remake-game:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(200, 155, 60, 0.3);
    transform: translateY(-10px);
}

.remake-game img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.remake-game h4 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-size: 1.3rem;
    padding: 1.5rem 1.5rem 0.5rem;
}

.remake-game p {
    color: var(--text-secondary);
    padding: 0 1.5rem 1.5rem;
}

/* ===== LEGACY SECTION ===== */
.legacy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.legacy-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.legacy-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(200, 155, 60, 0.3);
    transform: translateY(-10px);
}

.legacy-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.legacy-item h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.legacy-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.compilation {
    margin-top: 3rem;
}

.compilation h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.compilation-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.compilation-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.compilation-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(200, 155, 60, 0.3);
    transform: translateY(-10px);
}

.compilation-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.compilation-card h4 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-size: 1.3rem;
    padding: 1.5rem 1.5rem 0.5rem;
}

.compilation-card p {
    color: var(--text-secondary);
    padding: 0 1.5rem 1.5rem;
    line-height: 1.6;
}

/* ===== FOOTER ===== */
.main-footer {
    background: var(--darker-bg);
    border-top: 1px solid var(--primary-color);
    position: relative;
    z-index: 1;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-section h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-bottom {
    background: var(--dark-bg);
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid var(--card-border);
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        flex-direction: row;
    }
    
    .timeline-content,
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 80px;
        margin-right: 0;
    }
    
    .timeline-item::before {
        left: 30px;
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .characters-grid,
    .story-grid,
    .world-locations,
    .remake-features,
    .remake-games,
    .legacy-grid,
    .compilation-items {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 1rem;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .content-section {
        padding: 4rem 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* ===== LOADING & ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-item,
.story-card,
.character-card,
.location-card,
.remake-game,
.legacy-item,
.compilation-card {
    animation: fadeIn 0.6s ease-out;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
