/* ── Base & Utilities ── */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: #FF7F5F;
    color: white;
}

/* ── Navbar Scroll State ── */
#site-header.scrolled {
    background-color: rgba(255, 252, 248, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 4px 20px rgba(0, 0, 0, 0.04);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #FF7F5F;
    border-radius: 1px;
    transition: all 0.25s ease;
    transform: translateX(-50%);
}

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

/* ── Floating Card Animations ── */
@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) translateX(16px); }
    50% { transform: translateY(-5px) translateX(16px); }
}

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

.animate-float-medium {
    animation: float-medium 3.2s ease-in-out infinite;
    animation-delay: 0.5s;
}

.animate-float-fast {
    animation: float-fast 2.8s ease-in-out infinite;
    animation-delay: 1s;
}

/* ── Scroll Reveal ── */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.reveal[data-reveal-id] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

/* Staggered delays for grid children */
.reveal[data-reveal-id] + .reveal[data-reveal-id] { transition-delay: 0.1s; }
.reveal[data-reveal-id] + .reveal[data-reveal-id] + .reveal[data-reveal-id] { transition-delay: 0.2s; }
.reveal[data-reveal-id] + .reveal[data-reveal-id] + .reveal[data-reveal-id] + .reveal[data-reveal-id] { transition-delay: 0.3s; }

/* ── Mobile Menu ── */
#mobile-menu {
    animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-link {
    display: block;
}

.mobile-link:hover {
    padding-left: 0.75rem;
}

/* ── Focus Styles ── */
a:focus-visible, button:focus-visible {
    outline: 2px solid #FF7F5F;
    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; }
    .reveal[data-reveal-id] {
        opacity: 1;
        transform: none;
    }
}

/* ── Responsive Tweaks ── */
@media (max-width: 640px) {
    .font-serif {
        line-height: 1.15;
    }
}
