/* ===================================
   The Legendarium — Custom Styles
   Premium Dark Luxury
   =================================== */

/* Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    background-color: #050d1a;
    color: #ffffff;
    font-family: 'Montserrat', system-ui, sans-serif;
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: rgba(201, 168, 76, 0.3);
    color: #ffffff;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #0a1628;
}
::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, 0.3);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 168, 76, 0.5);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scrollDown {
    0% {
        top: 0;
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-scroll-down {
    animation: scrollDown 1.5s ease-in-out infinite;
}

/* Scroll Reveal */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.reveal-on-scroll.revealed:nth-child(2) {
    transition-delay: 0.1s;
}

.reveal-on-scroll.revealed:nth-child(3) {
    transition-delay: 0.2s;
}

/* Navbar */
#navbar {
    background: transparent;
    transition: background 0.5s ease, box-shadow 0.5s ease, backdrop-filter 0.5s ease;
}

#navbar.scrolled {
    background: rgba(5, 13, 26, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(201, 168, 76, 0.1);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #c9a84c;
    transition: width 0.3s ease;
}

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

.nav-link:hover {
    color: #c9a84c !important;
}

/* Mobile Menu */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

.mobile-link {
    font-size: 1rem;
}

.menu-line {
    transition: all 0.3s ease;
}

#menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

#menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menu-toggle.active .menu-line:nth-child(3) {
    width: 6px;
    transform: rotate(-45deg) translate(3px, -3px);
}

/* Menu Tabs */
.menu-tab {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.menu-tab.active {
    color: #c9a84c;
}

.menu-tab .tab-indicator {
    width: 24px;
    height: 2px;
    background: transparent;
    transition: background 0.3s ease, width 0.3s ease;
}

.menu-tab.active .tab-indicator {
    background: #c9a84c;
    width: 40px;
}

.menu-tab:hover {
    color: rgba(255, 255, 255, 0.7);
}

.menu-tab:hover .tab-indicator {
    background: rgba(201, 168, 76, 0.5);
    width: 32px;
}

/* Menu Panels */
.menu-panel {
    animation: fadeIn 0.5s ease-out;
}

/* Input Focus */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* Button hover glow */
button[type="submit"]:hover {
    box-shadow: 0 0 30px rgba(201, 168, 76, 0.2);
}

/* Image hover containers */
.overflow-hidden {
    position: relative;
}

.overflow-hidden::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(5, 13, 26, 0.2), transparent);
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 60px;
    }

    #hero h1 {
        font-size: 3rem;
    }

    #hero h1 span:last-child {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 640px) {
    #hero h1 {
        font-size: 2.5rem;
    }

    #hero h1 span:last-child {
        font-size: 1.25rem !important;
    }
}

/* Print */
@media print {
    #navbar,
    #menu-toggle,
    .animate-scroll-down {
        display: none;
    }
}
