/* ── Base & Typography ── */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(251, 191, 36, 0.3);
    color: #faf5ff;
}

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

#navbar.scrolled {
    background: rgba(59, 7, 100, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(148, 52, 211, 0.2), 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ── Mobile Menu ── */
.mobile-link {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.35s ease, transform 0.35s ease, color 0.2s ease;
}

#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

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

/* ── Hamburger ── */
.nav-line {
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

#menu-toggle.active .nav-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

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

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

/* ── Reveal Animations ── */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: none;
}

/* Default state for JS-enabled: content is visible */
.js-enabled .reveal {
    /* Content already visible by default — progressive enhancement */
}

/* With JS: add hidden state and animate in */
.js-enabled .reveal:not(.revealed) {
    opacity: 1;
    transform: translateY(0);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        transition: none;
    }
}

/* ── Smooth image loading ── */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

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

::-webkit-scrollbar-track {
    background: #3b0764;
}

::-webkit-scrollbar-thumb {
    background: #7e22ce;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9333ea;
}

/* ── Focus styles ── */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 3px;
    border-radius: 4px;
}

/* ── Card hover effects ── */
.group:hover .group-hover\:text-amber-400 {
    color: #fbbf24;
}

/* ── Gallery hover ── */
.rounded-2xl.overflow-hidden {
    position: relative;
}

.rounded-2xl.overflow-hidden::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(59, 7, 100, 0.2) 0%, transparent 40%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.rounded-2xl.overflow-hidden:hover::after {
    opacity: 1;
}

/* ── Stat card floating animation ── */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    50% { transform: translateY(-5px) translateX(4px); }
}

/* Apply floating to hero cards with staggered delays */
.hero-card-1 { animation: float 4s ease-in-out infinite; }
.hero-card-2 { animation: float-slow 5s ease-in-out infinite 0.5s; }
.hero-card-3 { animation: float 4.5s ease-in-out infinite 1s; }

/* ── Pulse dot ── */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

.animate-pulse {
    animation: pulse-dot 2s ease-in-out infinite;
}

/* ── Responsive tweaks ── */
@media (max-width: 767px) {
    .font-serif {
        line-height: 1.1;
    }
}
