/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #2a8478;
    border-radius: 999px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #1f6b60;
}

/* ===== Intro Loader Animations ===== */
@keyframes introFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes introScaleIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes ringExpand {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    60% {
        opacity: 0.4;
    }

    100% {
        opacity: 0.25;
        transform: scale(1);
    }
}

@keyframes ringExpand2 {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    70% {
        opacity: 0.3;
    }

    100% {
        opacity: 0.2;
        transform: scale(1);
    }
}

@keyframes dotPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.7);
    }
}

.intro-logo svg {
    animation: introScaleIn 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.intro-ring {
    transform-origin: center;
    animation: ringExpand 1.6s ease-out both;
}

.intro-ring-2 {
    transform-origin: center;
    animation: ringExpand2 1.8s ease-out both;
}

.intro-dot {
    transform-origin: center;
    animation: dotPulse 1.8s ease-in-out infinite 1.2s;
}

.intro-title {
    opacity: 0;
    animation: introFadeUp 0.9s ease-out 0.9s forwards;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.intro-subtitle {
    opacity: 0;
    animation: introFadeUp 0.9s ease-out 1.1s forwards;
}

#intro.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* ===== Hero entrance ===== */
@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-item {
    opacity: 0;
    animation: heroFadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Hero subtle zoom */
@keyframes heroZoom {
    from {
        transform: scale(1.15);
    }

    to {
        transform: scale(1);
    }
}

.hero-zoom {
    animation: heroZoom 8s ease-out forwards;
}

/* Soft bounce for scroll indicator */
@keyframes bounceSoft {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(8px);
    }
}

.animate-bounce-soft {
    animation: bounceSoft 2s ease-in-out infinite;
}

/* Slow pulse */
@keyframes pulseSlow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.08);
    }
}

.animate-pulse-slow {
    animation: pulseSlow 4s ease-in-out infinite;
}

/* ===== Navbar links ===== */
.nav-link {
    position: relative;
    display: inline-block;
    padding: 0.5rem 1rem;
    font-weight: 500;
    color: #1a564d;
    border-radius: 0.75rem;
    transition: color 0.4s ease, background-color 0.4s ease;
}

.dark .nav-link {
    color: #d0ece8;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0.35rem;
    right: 50%;
    left: 50%;
    height: 2px;
    border-radius: 999px;
    background: #e36a12;
    transition: right 0.4s ease, left 0.4s ease;
}

.nav-link:hover {
    color: #e36a12;
}

.dark .nav-link:hover {
    color: #f5ab5a;
}

.nav-link:hover::after {
    right: 0.75rem;
    left: 0.75rem;
}

/* Mobile links */
.mobile-link {
    display: block;
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: #1a564d;
    border-radius: 0.75rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dark .mobile-link {
    color: #d0ece8;
}

.mobile-link:hover {
    background-color: #eaf7f5;
    color: #e36a12;
}

.dark .mobile-link:hover {
    background-color: #163f3a;
    color: #f5ab5a;
}

/* ===== Navbar scrolled state ===== */
#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.dark #navbar.scrolled {
    background-color: rgba(8, 24, 22, 0.85);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ===== Reveal on scroll ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

    .reveal.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

/* Card hover sheen */
.card {
    position: relative;
}

    .card::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 1.5rem;
        padding: 1px;
        background: linear-gradient(135deg, rgba(42, 132, 120, 0.3), transparent 50%);
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        opacity: 0;
        transition: opacity 0.5s ease;
        pointer-events: none;
    }

    .card:hover::before {
        opacity: 1;
    }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-item, .intro-title, .intro-subtitle {
        opacity: 1;
    }
}
