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

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

body {
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
}

::selection {
    background: #E86A5B;
    color: white;
}

/* ── Scroll Reveal (progressive enhancement) ─────── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
}

/* ── Navbar ───────────────────────────────────────── */
#nav {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

#nav.scrolled {
    background: rgba(246, 246, 247, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

#nav.scrolled .font-serif {
    color: #1a1a21 !important;
}

/* ── Scroll Line Animation ────────────────────────── */
@keyframes scrollLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(400%); }
}

.animate-scroll-line {
    animation: scrollLine 1.8s ease-in-out infinite;
}

/* ── Mobile Menu ──────────────────────────────────── */
.mobile-link {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

.mobile-menu-open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu-open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu-open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu-open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu-open .mobile-link:nth-child(4) { transition-delay: 0.2s; }
.mobile-menu-open .mobile-link:nth-child(5) { transition-delay: 0.25s; }

/* ── Hamburger Animation ──────────────────────────── */
.menu-open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.menu-open .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-open .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 5px;
}

/* ── Floating Cards Hover ─────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .float-card {
        animation: float 6s ease-in-out infinite;
    }

    .float-card-delay-1 {
        animation-delay: -2s;
    }

    .float-card-delay-2 {
        animation-delay: -4s;
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(3deg); }
    50% { transform: translateY(-10px) rotate(3deg); }
}

/* ── Smooth Focus ─────────────────────────────────── */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #E86A5B;
    outline-offset: 4px;
    border-radius: 4px;
}

/* ── Custom Scrollbar ─────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #c4c4cc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9797a4;
}
