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

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

body {
    margin: 0;
}

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

::selection {
    background: rgba(20, 184, 166, 0.3);
    color: #f0fdfa;
}

/* ── Scroll Reveal (progressive enhancement) ──────────── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(28px);
        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:nth-child(2) { transition-delay: 0.08s; }
    .reveal:nth-child(3) { transition-delay: 0.16s; }
    .reveal:nth-child(4) { transition-delay: 0.24s; }
}

/* When JS is disabled, everything stays visible */
.no-js .reveal,
.js .reveal {
    /* JS adds .revealed class; without JS, default state is visible via prefers-reduced-motion or no-animation */
}

/* ── Navbar ───────────────────────────────────────────── */
#site-header {
    background: transparent;
}

#site-header.scrolled {
    background: rgba(8, 14, 24, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-link {
    position: relative;
}

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

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

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

#mobile-menu.closed {
    opacity: 0;
    pointer-events: none;
}

.menu-line {
    display: block;
}

.menu-btn[aria-expanded="true"] .menu-line:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.menu-btn[aria-expanded="true"] .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-btn[aria-expanded="true"] .menu-line:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

.mobile-link {
    position: relative;
}

/* ── Scroll Indicator ─────────────────────────────────── */
.scroll-indicator {
    animation: fadeInUp 1s ease 1.5s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 16px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

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

/* ── Utility ──────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
