/* ============================================
   UCSD Stem Cell Processing Lab — Custom Styles
   ============================================ */

/* Base */
*, *::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 */
::selection {
    background-color: rgba(201, 118, 86, 0.15);
    color: #3a1a15;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #faf5ef;
}
::-webkit-scrollbar-thumb {
    background: #eacfc3;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #c97656;
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Hero animations — only for above-the-fold, using CSS animation directly */
.hero-eyebrow {
    animation: fadeInDown 0.8s 0.3s forwards;
}

.hero-headline {
    animation: fadeInUp 1s 0.5s forwards;
}

.hero-sub {
    animation: fadeInUp 1s 0.7s forwards;
}

.hero-cta {
    animation: fadeInUp 1s 0.9s forwards;
}

/* Scroll Reveal — below the fold only, progressive enhancement */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .hero-eyebrow,
    .hero-headline,
    .hero-sub,
    .hero-cta {
        animation: none;
        opacity: 1;
    }
}

/* Staggered reveal delays */
.reveal:nth-child(1) { transition-delay: 0.05s; }
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.15s; }
.reveal:nth-child(4) { transition-delay: 0.2s; }
.reveal:nth-child(5) { transition-delay: 0.25s; }
.reveal:nth-child(6) { transition-delay: 0.3s; }

/* Section Label */
.section-label {
    letter-spacing: 0.3em;
}

/* Navigation */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

#navbar.scrolled {
    background: rgba(253, 252, 250, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(201, 118, 86, 0.1);
}

#navbar.scrolled .nav-link {
    color: #3d3530;
}

#navbar.scrolled .menu-line {
    background: #3d3530;
}

/* Mobile Menu */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.closed {
    opacity: 0;
    pointer-events: none;
}

.mobile-link {
    opacity: 1;
}

/* Card hover effects */
.card {
    transition: background-color 0.5s ease;
}

.card:hover h3 {
    color: #c97656;
    transition: color 0.3s ease;
}

/* Quality card hover */
.quality-card {
    transition: background-color 0.5s ease, transform 0.3s ease;
}

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

/* Form inputs */
input:focus,
textarea:focus {
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: #c4b8a8;
}

/* Smooth image loading */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Print styles */
@media print {
    #navbar,
    #mobileMenu {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .reveal {
        opacity: 1;
    }
}
