/* Custom Properties */
:root {
    --primary: #4A7BA7;
    --secondary: #2C5F8D;
    --accent: #FF6B6B;
    --dark: #1a202c;
    --light-bg: #f7fafc;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    line-height: 1.6;
    color: #2d3748;
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Utility Classes */
.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
}

/* Hidden by default for scroll animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Reduced motion support */
@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;
    }
}

/* Navigation Styles */
#navbar {
    background-color: transparent;
}

#navbar img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#navbar.scrolled img {
    opacity: 1;
}

#navbar.scrolled .nav-link {
    color: var(--primary) !important;
}

.nav-link {
    position: relative;
}

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

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

/* Responsive Refinements */
@media (max-width: 768px) {
    #hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    #hero p {
        font-size: 1.125rem;
    }

    .feature-card {
        margin-bottom: 1rem;
    }

    #about h2 {
        font-size: 2rem;
    }

    #contact h2 {
        font-size: 2rem;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .feature-card:nth-child(3) {
        grid-column: 1 / -1;
        max-width: 500px;
        margin: 0 auto;
    }
}

/* Enhanced hover states for desktop */
@media (hover: hover) {
    .feature-card:hover .w-16 {
        animation: pulse 1s infinite;
    }

    .btn-primary:hover {
        box-shadow: 0 20px 40px rgba(255, 107, 107, 0.4);
    }

    .social-icon:hover {
        box-shadow: 0 4px 12px rgba(74, 123, 167, 0.5);
    }
}

/* Print styles */
@media print {
    #navbar,
    #contact {
        display: none;
    }

    .scroll-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Screen Reader Only */
.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;
}

.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}
