/* ========================================
   The Crazy Piña — Custom Styles
   ======================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection color */
::selection {
    background-color: #800020;
    color: #FFF0F5;
}

/* ========================================
   Navbar
   ======================================== */
#navbar {
    background: rgba(255, 248, 249, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(128, 0, 32, 0.08);
}

#navbar.scrolled {
    box-shadow: 0 4px 30px -10px rgba(128, 0, 32, 0.1);
}

/* ========================================
   Mobile Menu
   ======================================== */
.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 30px;
    height: 2px;
    background: #800020;
    transition: transform 0.3s ease;
}

.mobile-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* ========================================
   Scroll Reveal Animations
   Only applies when JS is available AND
   user prefers motion (progressive enhancement)
   ======================================== */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: opacity 0.8s ease, transform 0.8s ease;
    }

    .reveal.from-bottom {
        transform: translateY(30px);
    }

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

    .reveal.from-left {
        transform: translateX(-30px);
    }

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

    .reveal.from-right {
        transform: translateX(30px);
    }

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

    .reveal.scale-up {
        transform: scale(0.95);
    }

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

/* Fallback: ensure content is visible without JS */
.no-js .reveal,
.js-enabled .reveal {
    opacity: 1;
    transform: none;
}

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

/* ========================================
   Smooth Hover Transitions
   ======================================== */
a, button {
    transition: all 0.3s ease;
}

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

::-webkit-scrollbar-track {
    background: #FFF8F9;
}

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

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

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

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ========================================
   Tablet & Desktop Tweaks
   ======================================== */
@media (min-width: 768px) {
    .reveal {
        transition-delay: 0.1s;
    }
}

@media (min-width: 1024px) {
    .reveal {
        transition-delay: 0.2s;
    }
}
