/* ===== Base & Reset ===== */
*, *::before, *::after {
    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;
}

/* ===== Scroll Reveal Animations ===== */
.scroll-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);
}

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

.scroll-reveal.revealed:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal.revealed:nth-child(3) { transition-delay: 0.2s; }
.scroll-reveal.revealed:nth-child(4) { transition-delay: 0.3s; }

/* ===== Hero Animations ===== */
.hero-eyebrow {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.hero-headline {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.hero-subhead {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

.hero-cta {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

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

/* ===== Spin Animations ===== */
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spin-slow-reverse {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

.animate-spin-slow {
    animation: spin-slow 30s linear infinite;
}

.animate-spin-slow-reverse {
    animation: spin-slow-reverse 25s linear infinite;
}

/* ===== Scroll Line ===== */
.scroll-line {
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ===== Section Labels ===== */
.section-label {
    display: inline-block;
}

/* ===== Nav States ===== */
.nav-text-color {
    transition: color 0.4s ease;
}

.nav-sub-text {
    transition: color 0.4s ease;
}

.nav-menu-btn {
    color: #0f172a;
    transition: color 0.4s ease;
}

#navbar.scrolled .nav-text-color {
    color: #0f172a;
}

#navbar.scrolled .nav-sub-text {
    color: #64748b;
}

#navbar.scrolled .nav-menu-btn {
    color: #0f172a;
}

#navbar.hero-transparent .nav-text-color {
    color: #ffffff;
}

#navbar.hero-transparent .nav-sub-text {
    color: rgba(248, 250, 252, 0.7);
}

#navbar.hero-transparent .nav-menu-btn {
    color: #ffffff;
}

/* ===== Service Cards ===== */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    border: 1px solid transparent;
    transition: border-color 0.5s ease;
    pointer-events: none;
}

.service-card:hover::before {
    border-color: rgba(13, 148, 136, 0.3);
}

/* ===== Form Inputs ===== */
.form-input,
.form-textarea,
.form-select {
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    transition: opacity 0.3s ease;
}

.form-input:focus::placeholder,
.form-textarea:focus::placeholder {
    opacity: 0.5;
}

.form-submit {
    position: relative;
    overflow: hidden;
}

.form-submit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.form-submit:active::after {
    width: 300px;
    height: 300px;
}

/* ===== Mobile Nav Links ===== */
.mobile-nav-link {
    position: relative;
}

.mobile-nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #14b8a6;
    transition: width 0.3s ease;
}

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

/* ===== Parallax-like subtle effect on hero image ===== */
#hero img {
    will-change: transform;
}

/* ===== Utility ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}
