/* ─── Base & Reset ─── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }

/* ─── Header scroll state ─── */
#site-header {
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
#site-header.scrolled {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(88, 28, 135, 0.08);
}

/* ─── Nav link underline animation ─── */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #fbbf24;
    transition: width 0.25s ease;
}
.nav-link:hover::after {
    width: 100%;
}

/* ─── Mobile menu ─── */
#mobile-menu.open {
    translate: 0;
    opacity: 1;
    pointer-events: auto;
}
#mobile-menu.closed {
    translate: -10px 0;
    opacity: 0;
    pointer-events: none;
}
.menu-line:nth-child(1) { transform-origin: center; }
.menu-line:nth-child(2) { transform-origin: center; }
.menu-line:nth-child(3) { transform-origin: center; }
body.menu-open .menu-line:nth-child(1) { transform: translateY(2.5px) rotate(45deg); }
body.menu-open .menu-line:nth-child(2) { opacity: 0; }
body.menu-open .menu-line:nth-child(3) { transform: translateY(-2.5px) rotate(-45deg); width: 5; }

/* ─── Floating stat cards ─── */
@keyframes float-slow {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}
@keyframes float-medium {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-7px); }
}
@keyframes float-fast {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}
.animate-float-slow    { animation: float-slow 4s ease-in-out infinite; }
.animate-float-medium  { animation: float-medium 3.2s ease-in-out infinite; }
.animate-float-fast    { animation: float-fast 2.6s ease-in-out infinite; }

/* ─── Scroll reveal ─── */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal[data-reveal-state="hidden"] {
    opacity: 0;
    transform: translateY(24px);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    html { scroll-behavior: auto; }
    .animate-float-slow,
    .animate-float-medium,
    .animate-float-fast {
        animation: none;
    }
}

/* ─── Back to top ─── */
#back-to-top.visible {
    opacity: 1;
    translate: 0;
    pointer-events: auto;
}

/* ─── Selection color ─── */
::selection {
    background: rgba(147, 51, 234, 0.2);
    color: inherit;
}

/* ─── Focus visible ─── */
:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

/* ─── Custom scrollbar ─── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #faf5ff; }
::-webkit-scrollbar-thumb { background: #d8b4fe; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a855f7; }
</style>
