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

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

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(13, 148, 136, 0.2);
    color: #0f766e;
}

/* ─── Navbar ─── */
#navbar {
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

#navbar.scrolled {
    background: rgba(248, 250, 252, 0.95);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

.nav-link {
    position: relative;
}

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

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

#menu-btn.active .menu-line:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

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

#menu-btn.active .menu-line:nth-child(3) {
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
}

/* ─── Hero Animations ─── */
.hero-content > * {
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-content > *:nth-child(1) { transition-delay: 0.1s; }
.hero-content > *:nth-child(2) { transition-delay: 0.2s; }
.hero-content > *:nth-child(3) { transition-delay: 0.3s; }
.hero-content > *:nth-child(4) { transition-delay: 0.4s; }
.hero-content > *:nth-child(5) { transition-delay: 0.5s; }

.hero-content.visible > * {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.hero-image {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-image.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ─── Floating Card ─── */
.floating-card {
    animation: float 4s ease-in-out infinite;
}

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

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

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Image Hover ─── */
.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

/* ─── Custom Scrollbar ─── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0d9488;
}

/* ─── Focus Styles ─── */
input:focus, textarea:focus {
    outline: none;
}

/* ─── Form Input Focus Fix ─── */
input:focus, textarea:focus {
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
}

/* ─── Button Ripple ─── */
button, a {
    -webkit-tap-highlight-color: transparent;
}

/* ─── Responsive Tweaks ─── */
@media (max-width: 767px) {
    .hero-image {
        order: 0;
        margin-bottom: 2rem;
    }

    .floating-card {
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: 1rem;
        max-width: 100%;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hero-image {
        margin-top: 3rem;
    }
}

/* ─── Reduced Motion ─── */
@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;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .hero-content > * {
        opacity: 1 !important;
        transform: none !important;
    }

    .hero-image {
        opacity: 1;
        transform: none;
    }

    .floating-card {
        animation: none;
    }
}
