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

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(13, 79, 79, 0.15);
    color: #0a3d3d;
}

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

    .reveal.revealed {
        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; }
}

/* Fallback: always visible if JS disabled or reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* === Navbar === */
#navbar {
    transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(9, 14, 24, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* === Mobile Menu === */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.open .mobile-link {
    animation: fadeDown 0.3s ease forwards;
    opacity: 0;
}

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

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

/* === Mobile menu button animation === */
body.menu-open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

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

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

/* === Buttons & Links === */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid rgba(13, 79, 79, 0.6);
    outline-offset: 2px;
    border-radius: 4px;
}

/* === Form === */
input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(13, 79, 79, 0.1);
}

/* === Card hover === */
.group:hover .group-hover\\:scale-110 {
    transform: scale(1.1) rotate(3deg);
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(13, 79, 79, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(13, 79, 79, 0.5);
}

/* === Print === */
@media print {
    #navbar, #mobile-menu, .animate-bounce { display: none; }
    body { color: #000; background: #fff; }
    a { color: #0D4F4F; }
}
