/* ============================================
   SendSignals – 3D & Heading Animations
   Professional, clean, responsive
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --font-display: 'Outfit', 'DM Sans', sans-serif;
    --font-body: 'DM Sans', 'Inter', sans-serif;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --perspective: 1200px;
    --card-3d-rotate-x: 8deg;
    --card-3d-rotate-y: 8deg;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Hero heading typography */
.hero-heading {
    font-family: var(--font-display);
}

/* ---- Animated headings ---- */
.heading-reveal {
    overflow: hidden;
    display: inline-block;
}

.heading-reveal .line {
    display: block;
    overflow: hidden;
}

.heading-reveal .line .word {
    display: inline-block;
    transform: translateY(1.2em);
    opacity: 0;
    transition: transform 0.6s var(--ease-out-expo), opacity 0.5s ease;
}

.heading-reveal.visible .line .word {
    transform: translateY(0);
    opacity: 1;
}

/* Hero: highlight only key phrase (1–2 words), no glow */
.hero-heading-reveal .line .word:nth-child(4),
.hero-heading-reveal .line .word:nth-child(5) {
    color: #CA8A04;
    font-weight: 700;
}

.heading-reveal .line .word:nth-child(1) { transition-delay: 0.05s; }
.heading-reveal .line .word:nth-child(2) { transition-delay: 0.12s; }
.heading-reveal .line .word:nth-child(3) { transition-delay: 0.19s; }
.heading-reveal .line .word:nth-child(4) { transition-delay: 0.26s; }
.heading-reveal .line .word:nth-child(5) { transition-delay: 0.33s; }
.heading-reveal .line .word:nth-child(6) { transition-delay: 0.4s; }
.heading-reveal .line .word:nth-child(7) { transition-delay: 0.47s; }
.heading-reveal .line .word:nth-child(8) { transition-delay: 0.54s; }
.heading-reveal .line .word:nth-child(9) { transition-delay: 0.61s; }
.heading-reveal .line .word:nth-child(10) { transition-delay: 0.68s; }

/* Letter-by-letter (for short titles) */
.title-letters {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.02em;
}

.title-letters .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.8em) scale(0.95);
    transition: transform 0.5s var(--ease-spring), opacity 0.4s ease;
}

.title-letters.visible .char {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Gradient text – static accent, no animation */
.gradient-text {
    background: linear-gradient(135deg, #FACC15 0%, #FDE68A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Underline draw animation */
.underline-draw {
    position: relative;
    display: inline-block;
}

.underline-draw::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 3px;
    background: #FACC15;
    transition: width 0.6s var(--ease-out-expo);
}

.underline-draw.visible::after,
.heading-reveal.visible ~ .underline-draw::after {
    width: 100%;
}

/* ---- 3D card container ---- */
.card-3d-wrapper {
    perspective: var(--perspective);
    transform-style: preserve-3d;
}

.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.4s var(--ease-spring), box-shadow 0.4s ease;
    will-change: transform;
}

.card-3d:hover {
    transform: rotateX(calc(var(--card-3d-rotate-x) * -1)) rotateY(var(--card-3d-rotate-y)) translateZ(12px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Section title: centered + color-changing animation for all section headings */
.section-title,
.section-title-animated,
.section-header .section-title,
.section-header h2,
.page-header h1,
h1, h2, h3 {
    text-align: center;
    width: 100%;
    display: block;
}

.section-title,
.section-title-animated,
.section-header h2,
.page-header h1 {
    color: var(--text-primary, #0F172A);
}

.section-title-animated {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.03em;
    position: relative;
    padding-bottom: 0;
}

/* Staggered children (for grids) */
.stagger-children > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.26s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.33s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.47s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.54s; }

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Stat counter appearance */
.stat-card-animate {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo),
                box-shadow 0.3s ease, border-color 0.3s ease;
}

.stat-card-animate.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.stat-card-animate:nth-child(1).visible { transition-delay: 0.1s; }
.stat-card-animate:nth-child(2).visible { transition-delay: 0.2s; }
.stat-card-animate:nth-child(3).visible { transition-delay: 0.3s; }

/* Navbar slide-in on load */
.navbar-animate {
    opacity: 0;
    transform: translateY(-12px);
    animation: navReveal 0.6s var(--ease-out-expo) forwards;
}

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

/* CTA buttons – minimal lift, no glow */
.btn-float {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-float:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Trust badges gentle scale-in */
.trust-badge-animate {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.5s ease, transform 0.5s var(--ease-spring),
                border-color 0.25s ease, color 0.25s ease;
}

.trust-badge-animate.visible {
    opacity: 1;
    transform: scale(1);
}

.trust-badge-animate:nth-child(1).visible { transition-delay: 0.15s; }
.trust-badge-animate:nth-child(2).visible { transition-delay: 0.25s; }
.trust-badge-animate:nth-child(3).visible { transition-delay: 0.35s; }

/* Page load: content fade up (only when no admin) */
body:not(.admin-layout) main {
    animation: contentSlideUp 0.7s var(--ease-out-expo) both;
}

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

/* Scroll-triggered fade (enhanced) */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-3d .service-icon,
.card-3d .stat-value {
    transition: transform 0.25s ease;
}

.card-3d:hover .service-icon {
    transform: scale(1.02);
}

.card-3d:hover .stat-value {
    transform: scale(1.02);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.nav-toggle:hover {
    border-color: var(--primary, #FACC15);
    background: rgba(250, 204, 21, 0.1);
}
.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary, #0F172A);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav and tone down 3D */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    .navbar .container {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .nav-menu {
        order: 3;
        width: 100%;
        flex-direction: column;
        background: var(--bg-gray-50, #F9FAFB);
        padding: 0.75rem 1rem;
        gap: 0.25rem;
        border-radius: 12px;
        border: 1px solid var(--border-color, #E2E8F0);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.3s ease;
    }
    .nav-menu.nav-menu-open {
        max-height: 80vh;
        opacity: 1;
        padding: 0.75rem 1rem;
    }
    .nav-actions {
        order: 4;
        width: 100%;
        justify-content: center;
    }
    .card-3d:hover {
        transform: translateY(-6px);
    }
    .heading-reveal .line .word {
        transition-duration: 0.4s;
    }
}
