*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Fade-up animation for hero */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeUp 0.8s ease-out forwards;
}

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

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

/* Nav scroll state */
nav.scrolled {
    background: rgba(26, 10, 30, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(139, 58, 150, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

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

::-webkit-scrollbar-track {
    background: #1a0a1e;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #6b2478;
}

/* Selection */
::selection {
    background: rgba(212, 146, 14, 0.3);
    color: #f0d8f5;
}

/* Image aspect ratios */
img {
    display: block;
    max-width: 100%;
}

/* Subtle grain overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}
