/* Core Reset & Accessibility Setup */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Remove awkward mobile tap highlights for native app feel */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Consistent Theme Highlighting */
::selection {
    background-color: #b2c8ea;
    color: #1E293B;
}

/* Perfect typography balance across devices */
.text-balance {
    text-wrap: balance;
}

/* Prevent iOS input zoom on mobile forms */
input, textarea {
    font-size: 16px !important;
}

/* Premium Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #FAFAFA; }
::-webkit-scrollbar-thumb { 
    background: #E2E8F0; 
    border-radius: 4px; 
}
::-webkit-scrollbar-thumb:hover { background: #b2c8ea; }

/* Enhanced Focus States for Keyboard Nav */
*:focus-visible {
    outline: 3px solid #b2c8ea;
    outline-offset: 4px;
}

/* Animated Navigation Underlines */
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -4px;
    left: 50%;
    background-color: #b2c8ea;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 2px;
}
.nav-link:hover::after,
.nav-link.nav-active::after {
    width: 100%;
}

/* Tasteful Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-100 { transition-delay: 100ms; }
.reveal-delay-200 { transition-delay: 200ms; }
.reveal-delay-300 { transition-delay: 300ms; }
.reveal-delay-400 { transition-delay: 400ms; }

/* Organic Background Blobs */
@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}
.animate-blob {
    animation: blob 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}
.animation-delay-1000 { animation-delay: 1s; }
.animation-delay-2000 { animation-delay: 2s; }

/* Custom organic shape class */
.blob-shape {
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Base Form Reset for Safari Autofill to preserve design system colors */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: #1E293B !important;
}