/* ============================================
   The Boarding House at Seminary Hill
   Custom Styles
   ============================================ */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Base styles */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selection color */
::selection {
    background-color: rgba(161, 36, 62, 0.15);
    color: #6e1c2e;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fdf9f3;
}
::-webkit-scrollbar-thumb {
    background: #f4a8ba;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #ec7496;
}

/* Navbar transition */
#navbar.scrolled {
    background: rgba(254, 253, 251, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(110, 28, 46, 0.08);
}

#navbar.scrolled .font-serif {
    color: #6e1c2e;
}

/* Mobile menu animation */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.closed {
    opacity: 0;
    pointer-events: none;
}

.mobile-link {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Reveal animations - progressive enhancement */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }

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

    /* Staggered delays for grid items */
    .reveal:nth-child(1) { transition-delay: 0.05s; }
    .reveal:nth-child(2) { transition-delay: 0.15s; }
    .reveal:nth-child(3) { transition-delay: 0.25s; }
    .reveal:nth-child(4) { transition-delay: 0.35s; }
}

/* Hero parallax-like subtle effect */
#hero {
    background-attachment: fixed;
}

@media (max-width: 768px) {
    #hero {
        background-attachment: scroll;
    }
}

/* Image hover effect */
.rounded-2xl.overflow-hidden {
    will-change: transform;
}

/* Button focus styles */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #ec7496;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Link underline animation */
a {
    text-decoration: none;
}

/* Subtle grain texture overlay (optional, for visual warmth) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    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");
    z-index: 9999;
}

/* Print styles */
@media print {
    #navbar,
    #hero,
    .reveal {
        background: none;
        box-shadow: none;
    }
    body {
        color: #000;
        background: #fff;
    }
}
