/* === Base Reset & Typography === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    overflow-x: hidden;
}

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

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #020617;
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* === Animation Keyframes === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === Hero Animations (Above the fold — always visible) === */
.hero-eyebrow {
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero-title {
    animation: fadeInUp 0.8s ease-out 0.15s forwards;
    opacity: 0;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

.hero-cta {
    animation: fadeInUp 0.8s ease-out 0.45s forwards;
    opacity: 0;
}

.hero-stat {
    animation: fadeInLeft 0.8s ease-out forwards;
    opacity: 0;
}

.hero-stat:nth-child(1) {
    animation-delay: 0.6s;
}

.hero-stat:nth-child(2) {
    animation-delay: 0.75s;
}

/* === Scroll Reveal Animations (Below the fold only) === */
/* Progressive enhancement: content is visible by default, JS adds animation */
.section-eyebrow,
.section-title,
.menu-item,
.gallery-item,
.form-group {
    /* Default: visible, no animation */
    opacity: 1;
    transform: none;
}

/* When JS adds the 'revealed' class, animate in */
.reveal-active .section-eyebrow {
    animation: fadeInUp 0.6s ease-out forwards;
}

.reveal-active .section-title {
    animation: fadeInUp 0.6s ease-out 0.1s forwards;
}

.reveal-active .menu-item:nth-child(1) { animation: fadeInUp 0.6s ease-out 0.05s forwards; }
.reveal-active .menu-item:nth-child(2) { animation: fadeInUp 0.6s ease-out 0.15s forwards; }
.reveal-active .menu-item:nth-child(3) { animation: fadeInUp 0.6s ease-out 0.25s forwards; }
.reveal-active .menu-item:nth-child(4) { animation: fadeInUp 0.6s ease-out 0.35s forwards; }

.reveal-active .gallery-item:nth-child(1) { animation: scaleIn 0.6s ease-out 0.05s forwards; }
.reveal-active .gallery-item:nth-child(2) { animation: scaleIn 0.6s ease-out 0.1s forwards; }
.reveal-active .gallery-item:nth-child(3) { animation: scaleIn 0.6s ease-out 0.15s forwards; }
.reveal-active .gallery-item:nth-child(4) { animation: scaleIn 0.6s ease-out 0.2s forwards; }
.reveal-active .gallery-item:nth-child(5) { animation: scaleIn 0.6s ease-out 0.25s forwards; }
.reveal-active .gallery-item:nth-child(6) { animation: scaleIn 0.6s ease-out 0.3s forwards; }

/* Reduced motion: disable all animations */
@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;
    }
}

/* === Navbar === */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(2, 6, 23, 0.9);
    backdrop-blur-xl;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.nav-link {
    position: relative;
}

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

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

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

.mobile-menu-open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

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

.mobile-menu-link {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.mobile-menu-open .mobile-menu-link:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.mobile-menu-open .mobile-menu-link:nth-child(2) { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.mobile-menu-open .mobile-menu-link:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.mobile-menu-open .mobile-menu-link:nth-child(4) { transition-delay: 0.25s; opacity: 1; transform: translateY(0); }
.mobile-menu-open .mobile-menu-link:nth-child(5) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }

/* === Menu Items === */
.menu-item {
    opacity: 0;
}

/* === Gallery Items === */
.gallery-item {
    opacity: 0;
}

/* === Image Hover Effects === */
img {
    will-change: transform;
}

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

/* === Smooth image loading === */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
