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

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
}

/* === Navbar === */
#navbar {
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

#navbar.scrolled {
    background: rgba(250, 245, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(88, 28, 135, 0.08);
    padding: 0;
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #a855f7, #f59e0b);
    border-radius: 1px;
    transition: width 0.3s ease;
}

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

/* === Mobile Menu === */
.mobile-link {
    font-family: 'DM Serif Display', Georgia, serif;
}

/* === Animations === */
@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* === Scroll Reveal (progressive enhancement) === */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        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: translateY(0);
    }

    .reveal:nth-child(2) { transition-delay: 0.1s; }
    .reveal:nth-child(3) { transition-delay: 0.2s; }
    .reveal:nth-child(4) { transition-delay: 0.3s; }
}

/* Reduced motion: always show content */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* When JS is active, apply reveal states */
.js-active .reveal:not(.revealed) {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-active .reveal.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* === Selection === */
::selection {
    background: rgba(168, 85, 247, 0.2);
    color: #581c87;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #faf5ff;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #a855f7, #f59e0b);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #9333ea, #d97706);
}

/* === Image optimization === */
img {
    max-width: 100%;
    height: auto;
}

/* === Print === */
@media print {
    #navbar, .animate-float, #menu-btn { display: none; }
    body { color: #000; background: #fff; }
    a { color: #000; }
}
