/* Custom styles for CDT Laboratory */

/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    letter-spacing: 0.01em;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #fafaf8;
}
::-webkit-scrollbar-thumb {
    background: #b91d43;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #7f1331;
}

/* Selection */
::selection {
    background: #fce7eb;
    color: #3b0712;
}

/* Navbar transitions */
.nav-line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu-btn.active .nav-line:first-child {
    transform: rotate(45deg) translate(3px, 3px);
}
#mobile-menu-btn.active .nav-line:last-child {
    transform: rotate(-45deg) translate(3px, -3px);
}

/* Mobile link hover */
.mobile-link {
    position: relative;
}
.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #b91d43;
    transition: width 0.3s ease;
}
.mobile-link:hover::after {
    width: 100%;
}

/* Service card underline animation */
.service-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #b91d43;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card {
    position: relative;
}

.service-card:hover::before {
    width: 100%;
}

/* Scroll reveal animations — progressive enhancement via JS */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .service-card::before {
        transition: none;
    }
    img {
        transition: none;
    }
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #b91d43;
    outline-offset: 2px;
}

/* Form inputs */
input::placeholder,
textarea::placeholder {
    color: #d6d3d1;
}

/* Subtle pattern overlay for sections */
.bg-pattern::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, #b91d43 0.5px, transparent 0.5px);
    background-size: 24px 24px;
    opacity: 0.03;
    pointer-events: none;
}
