html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Scroll-reveal: elements fade + rise into place when they enter the viewport.
   JS toggles the .in-view class via IntersectionObserver. */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Lazy-loaded images fade in once they've finished loading */
.lazy-img.loaded {
    opacity: 1 !important;
}

/* Slim, quiet scrollbar to match the light, minimal palette */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #E5E5E5;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #CFCFD6;
}

/* Visible keyboard focus everywhere (accessibility floor) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #10A37F;
    outline-offset: 2px;
}

/* ChatGPT-style "thinking" dot loader, shown briefly in the navbar
   before it resolves into the name via the typewriter effect. */
.nav-loader {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}

.nav-loader span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #10A37F;
    animation: nav-dot-bounce 1.1s ease-in-out infinite;
}

.nav-loader span:nth-child(2) {
    animation-delay: 0.15s;
}

.nav-loader span:nth-child(3) {
    animation-delay: 0.3s;
}

.nav-loader.done {
    display: none;
}

@keyframes nav-dot-bounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Active nav link underline */
.nav-link {
    position: relative;
}

.nav-link.active {
    color: #0D0D0D;
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    border-radius: 2px;
    background-color: #10A37F;
}

/* Scroll progress bar in the navbar — fills smoothly as the page scrolls */
#scrollProgress {
    width: 0%;
    transition: width 0.1s linear;
}