/* ═══════════════════════════════════════════════════════════
   NEW GROUNDS — Custom Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Base ── */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ── Navbar transition ── */
#navbar.scrolled {
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-link {
    position: relative;
}

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

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

/* ── Mobile menu ── */
#mobileMenu.open {
    opacity: 1 !important;
    pointer-events: all !important;
}

#mobileMenu.open .mobile-link {
    animation: slideIn 0.4s ease forwards;
    opacity: 0;
}

#mobileMenu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobileMenu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobileMenu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }

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

/* ── Hamburger animation ── */
.menu-line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#menuBtn.active .menu-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    width: 1.25rem;
}

/* ── Floating animations ── */
@keyframes float-slow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-16px) rotate(3deg); }
}

@keyframes float-medium {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

@keyframes float-fast {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-8px) scale(1.1); }
}

.float-slow {
    animation: float-slow 6s ease-in-out infinite;
}

.float-medium {
    animation: float-medium 4s ease-in-out infinite;
}

.float-fast {
    animation: float-fast 3s ease-in-out infinite;
}

/* ── Scroll reveal ── */
/* Default: all elements visible (progressive enhancement) */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When JS is enabled, add hidden state for below-fold elements */
@media (prefers-reduced-motion: no-preference) {
    .reveal.reveal-hidden {
        opacity: 0;
        transform: translateY(32px);
    }
}

/* ── Back to top ── */
#backToTop.visible {
    opacity: 1 !important;
    translate: 0 !important;
    pointer-events: all !important;
}

/* ── Form select arrow ── */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ── Focus visible outlines ── */
:focus-visible {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
}

/* ── Responsive tweaks ── */
@media (max-width: 767px) {
    .font-serif {
        line-height: 1.15;
    }
}
