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

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

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(212, 160, 23, 0.3);
    color: #f0f3f9;
}

/* === Navbar === */
#navbar {
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

#navbar.scrolled {
    background: rgba(6, 14, 26, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(212, 160, 23, 0.08);
}

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

#mobileMenu.open .mobile-link {
    animation: slideIn 0.4s ease forwards;
}

#mobileMenu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobileMenu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Menu button animation */
.menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

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

.menu-btn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 1.5rem;
}

/* === Hero Shapes === */
.hero-shape {
    opacity: 0;
    animation: floatIn 1s ease forwards;
}

.shape-circle-1 { animation-delay: 0.4s; }
.shape-circle-2 { animation-delay: 0.6s; }
.shape-rect-1 { animation-delay: 0.8s; }
.shape-diamond { animation-delay: 1s; }

@keyframes floatIn {
    from { opacity: 0; transform: scale(0.8) rotate(0deg); }
    to { opacity: 1; transform: scale(1) rotate(var(--rotate, 0deg)); }
}

.shape-rect-1 {
    --rotate: 45deg;
}

.shape-diamond {
    --rotate: 45deg;
}

/* Continuous floating for shapes */
@keyframes float1 {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.03) rotate(2deg); }
}

@keyframes float2 {
    0%, 100% { transform: scale(1) rotate(45deg); }
    50% { transform: scale(1.05) rotate(47deg); }
}

.shape-circle-1 { animation: floatIn 1s ease 0.4s forwards, float1 8s ease-in-out 1.4s infinite; }
.shape-circle-2 { animation: floatIn 1s ease 0.6s forwards, float2 10s ease-in-out 1.6s infinite; }
.shape-rect-1 { animation: floatIn 1s ease 0.8s forwards, float1 12s ease-in-out 1.8s infinite; }
.shape-diamond { animation: floatIn 1s ease 1s forwards, float2 9s ease-in-out 2s infinite; }

/* === Spirit Cards === */
.spirit-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

.spirit-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.spirit-card:nth-child(1) { transition-delay: 0.1s; }
.spirit-card:nth-child(2) { transition-delay: 0.2s; }
.spirit-card:nth-child(3) { transition-delay: 0.3s; }

/* === Story Shapes === */
.story-shape {
    opacity: 0;
    transition: opacity 1s ease;
}

.story-shape.revealed {
    opacity: 1;
}

.shape-geo-1 { transition-delay: 0.3s; }
.shape-geo-2 { transition-delay: 0.5s; }

@keyframes gentleRotate {
    0%, 100% { transform: translate(-50%, -50%) rotate(12deg); }
    50% { transform: translate(-50%, -50%) rotate(15deg); }
}

@keyframes gentleFloat {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(-10px); }
}

.shape-geo-1.revealed {
    animation: gentleRotate 12s ease-in-out infinite;
    transform-origin: center;
}

.shape-geo-2.revealed {
    animation: gentleFloat 8s ease-in-out infinite;
}

/* === Contact Shapes === */
.contact-shape {
    opacity: 0;
    transition: opacity 1s ease;
}

.contact-shape.revealed {
    opacity: 1;
}

.shape-cta-circle { animation: pulseCircle 6s ease-in-out infinite; }
.shape-cta-diamond { animation: floatDiamond 10s ease-in-out infinite; }

@keyframes pulseCircle {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.08); opacity: 0.8; }
}

@keyframes floatDiamond {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(-15px); }
}

/* === Scroll Reveal (progressive enhancement) === */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

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

    .reveal-left {
        opacity: 0;
        transform: translateX(-30px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

    .reveal-left.revealed {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === Custom scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a1628;
}

::-webkit-scrollbar-thumb {
    background: #1e3666;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d4a017;
}

/* === Focus styles === */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #d4a017;
    outline-offset: 2px;
}

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