/* ─── Base & Utilities ─── */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    overflow-x: hidden;
}

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

::selection {
    background: #0d9488;
    color: #fff;
}

/* ─── Scroll Reveal ─── */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.revealed {
    opacity: 1;
    transform: none;
}

/* Default state for below-fold reveals — progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(32px);
    }
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Hero Reveal ─── */
.reveal-hero {
    opacity: 1;
    transform: none;
    animation: heroFadeIn 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.reveal-hero:nth-child(2) {
    animation-delay: 0.15s;
}

.reveal-hero:nth-child(3) {
    animation-delay: 0.3s;
}

.reveal-hero:nth-child(4) {
    animation-delay: 0.45s;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

#navbar.scrolled {
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: #2dd4bf;
    transition: width 0.3s ease;
}

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

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

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

.mobile-link {
    position: relative;
}

/* ─── Button Hover Effects ─── */
a {
    text-decoration: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

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

/* ─── Smooth Scroll Offset ─── */
section[id] {
    scroll-margin-top: 80px;
}

/* ─── Responsive Tweaks ─── */
@media (max-width: 640px) {
    .font-serif {
        word-spacing: -0.02em;
    }
}

@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 {
        opacity: 1;
        transform: none;
    }
}
