/* ============================================================
   FRIENDTECH · Animations & Motion
   ============================================================ */

/* --- Keyframes --- */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(0.85); }
}

@keyframes node-ring {
    0%        { transform: scale(1); opacity: 0.5; }
    60%       { transform: scale(2.2); opacity: 0; }
    100%      { transform: scale(2.2); opacity: 0; }
}

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@keyframes float-y {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}

@keyframes line-draw {
    from { stroke-dashoffset: 1000; }
    to   { stroke-dashoffset: 0; }
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 182, 197, 0.3); }
    50%       { box-shadow: 0 0 24px rgba(0, 182, 197, 0.6), 0 0 48px rgba(0, 112, 247, 0.2); }
}

/* --- Hero entrance animations --- */
.hero-eyebrow  { animation: fade-in-up 0.8s ease 0.2s both; }
.hero-headline { animation: fade-in-up 0.8s ease 0.35s both; }
.hero-body     { animation: fade-in-up 0.8s ease 0.5s both; }
.hero-actions  { animation: fade-in-up 0.8s ease 0.65s both; }
.hero-stats    { animation: fade-in-up 0.8s ease 0.8s both; }

/* --- Float animation on hero visual --- */
.hero-node-map { animation: float-y 6s ease-in-out infinite; }

/* --- Glow on nodes --- */
.ft-node { animation: glow-pulse 3s ease-in-out infinite; }

/* --- Gradient text shimmer effect --- */
.shimmer-text {
    background: linear-gradient(90deg,
        var(--blanco) 0%,
        var(--turquesa) 30%,
        var(--azul-ft) 50%,
        var(--turquesa) 70%,
        var(--blanco) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
}

/* --- Page transition overlay --- */
.page-transition {
    position: fixed;
    inset: 0;
    background: var(--azul-profundo);
    z-index: 9999;
    pointer-events: none;
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.page-transition.active { transform: translateY(0); }

/* --- Cursor glow (desktop) --- */
.cursor-glow {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(0,182,197,0.06) 0%, transparent 70%);
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: left 0.12s ease, top 0.12s ease;
}

/* --- Loading spinner --- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0,182,197,0.2);
    border-top-color: var(--turquesa);
    border-radius: 50%;
    animation: spin-slow 0.8s linear infinite;
}

/* --- Hover underline --- */
.hover-underline {
    position: relative;
    display: inline-block;
}
.hover-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1.5px;
    background: var(--turquesa);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.hover-underline:hover::after { transform: scaleX(1); }

/* --- Animated counter --- */
.counter-animated { animation: counter-up 0.6s ease both; }

/* --- Section divider line --- */
.section-line {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--azul-ft), var(--turquesa));
    border-radius: 3px;
    margin-bottom: 1.25rem;
}

/* --- Staggered card entrance --- */
.stagger-cards .card:nth-child(1) { animation-delay: 0.1s; }
.stagger-cards .card:nth-child(2) { animation-delay: 0.2s; }
.stagger-cards .card:nth-child(3) { animation-delay: 0.3s; }
.stagger-cards .card:nth-child(4) { animation-delay: 0.4s; }

/* --- Progress bar --- */
.progress-bar {
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.75rem;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--azul-ft), var(--turquesa));
    border-radius: 3px;
    width: 0;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-fill.animated { width: var(--fill-width, 75%); }

/* --- Tab indicator --- */
.tab-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--azul-ft), var(--turquesa));
    border-radius: 2px;
    transition: left 0.3s ease, width 0.3s ease;
}

/* --- Tooltip --- */
.tooltip-wrap { position: relative; }
.tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--carbon);
    color: var(--blanco);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateX(-50%) translateY(4px);
    z-index: 50;
    border: 1px solid var(--border-subtle);
}
.tooltip-wrap:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Skip to content (accessibility) --- */
.skip-link {
    position: fixed;
    top: -100%;
    left: 1rem;
    background: var(--azul-ft);
    color: var(--blanco);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    z-index: 9999;
    transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

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