/* Base styles and custom properties */
:root {
    --color-teal-50: #f0fdf9;
    --color-teal-100: #ccfbf1;
    --color-teal-600: #0d9488;
    --color-teal-700: #0f766e;
    --color-teal-900: #134e4a;
    --color-slate-50: #f8fafc;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-400: #94a3b8;
    --color-slate-500: #64748b;
    --color-slate-700: #334155;
    --color-slate-800: #1e293b;
    --color-slate-900: #0f172a;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background-color: rgba(13, 148, 136, 0.15);
    color: var(--color-slate-900);
}

/* Scroll reveal animations - progressive enhancement */
/* Default state: all elements visible (works without JS) */
.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);
}

/* When JS is enabled and user prefers motion, apply hidden initial state */
.animate-scroll-reveals .reveal {
    opacity: 0;
    transform: translateY(24px);
}

/* Hero content animation */
.hero-content {
    opacity: 1;
    transform: none;
    transition: opacity 1s ease, transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-image {
    opacity: 1;
    transform: none;
    transition: opacity 1s ease 0.2s, transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s;
}

/* When JS is enabled, animate hero on load */
.animate-scroll-reveals .hero-content {
    opacity: 0;
    transform: translateY(30px);
}

.animate-scroll-reveals .hero-image {
    opacity: 0;
    transform: translateX(20px);
}

/* Navbar transitions */
.nav-logo {
    transition: color 0.3s ease;
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: 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;
}

/* Mobile link animation */
.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

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

/* Menu toggle animation */
.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

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

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

#menu-toggle.active .menu-line:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
    width: 1.5rem;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-teal-600);
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .reveal,
    .hero-content,
    .hero-image {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .animate-scroll-reveals .reveal,
    .animate-scroll-reveals .hero-content,
    .animate-scroll-reveals .hero-image {
        opacity: 1;
        transform: none;
    }
    .nav-link::after {
        display: none;
    }
    .mobile-link {
        opacity: 1;
        transform: none;
        transition: color 0.3s ease;
    }
    #mobile-menu .mobile-link {
        transition-delay: 0s;
    }
    img,
    .hover\\:scale-105:hover {
        transition: none;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--color-slate-50);
}
::-webkit-scrollbar-thumb {
    background: var(--color-slate-200);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-teal-600);
}
