/* ─── Base & Typography ─── */
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: #0f172a;
}

/* ─── Loader ─── */
#page-loader {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f766e;
    transition: opacity 0.5s ease;
}

#page-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* ─── Header ─── */
#main-header {
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease;
}

#main-header.scrolled {
    background-color: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ─── Mobile Menu ─── */
#mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-nav-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

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

#mobile-menu.active .mobile-nav-link:nth-child(1) { transition-delay: 0.1s; }
#mobile-menu.active .mobile-nav-link:nth-child(2) { transition-delay: 0.15s; }
#mobile-menu.active .mobile-nav-link:nth-child(3) { transition-delay: 0.2s; }
#mobile-menu.active .mobile-nav-link:nth-child(4) { transition-delay: 0.25s; }
#mobile-menu.active .mobile-nav-link:nth-child(5) { transition-delay: 0.3s; }

/* ─── Hero ─── */
.hero-title {
    opacity: 0;
    transform: translateY(40px);
    animation: heroReveal 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

.hero-badge {
    opacity: 0;
    animation: badgeReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.hero-title ~ p {
    opacity: 0;
    transform: translateY(30px);
    animation: heroReveal 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

.hero-title ~ * {
    opacity: 0;
    animation: heroReveal 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes badgeReveal {
    to {
        opacity: 1;
    }
}

.scroll-indicator {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ─── Services ─── */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0d9488, #14b8a6);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover .service-icon {
    transform: scale(1.15) rotate(-5deg);
}

.service-card-line {
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── About ─── */
.about-label {
    position: relative;
}

.about-label::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 32px;
    height: 2px;
    background: #0d9488;
}

/* ─── Gallery ─── */
.gallery-item {
    cursor: pointer;
}

/* ─── Testimonials ─── */
.testimonial-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
}

/* ─── Contact Form ─── */
.contact-label {
    position: relative;
}

.contact-label::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 32px;
    height: 2px;
    background: #0d9488;
}

#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

#contact-form button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.3);
}

#contact-form button[type="submit"]:active {
    transform: translateY(0);
}

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

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ─── 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;
    }
    .scroll-indicator { animation: none; }
}

/* ─── Responsive ─── */
@media (max-width: 767px) {
    .hero-title {
        font-size: 2.5rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hero-title {
        font-size: 3.5rem;
    }
}
