/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS.CSS — Portfolio animation layer
   Safe to remove entirely to revert all visual enhancements.
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. CUSTOM CURSOR ───────────────────────────────────────── */
@media (hover: hover) and (pointer: fine) {
    * { cursor: none !important; }

    #cursor-dot {
        position: fixed;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--terra, #C2704E);
        pointer-events: none;
        z-index: 99999;
        transform: translate(-50%, -50%);
        transition: background 0.2s;
        will-change: transform;
    }

    #cursor-ring {
        position: fixed;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        border: 1.5px solid var(--terra, #C2704E);
        pointer-events: none;
        z-index: 99998;
        transform: translate(-50%, -50%);
        opacity: 0.65;
        transition: opacity 0.3s, border-color 0.3s;
        will-change: transform;
    }

    #cursor-ring.expanded {
        opacity: 0.4;
    }

    .cursor-trail {
        position: fixed;
        border-radius: 50%;
        background: var(--terra, #C2704E);
        pointer-events: none;
        z-index: 99997;
        transform: translate(-50%, -50%);
        will-change: transform;
    }
}

/* ── 2. SCROLL PROGRESS BAR ─────────────────────────────────── */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #185FA5, #EF9F27);
    z-index: 99999;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ── 3. DATA-REVEAL SCROLL STAGGER ─────────────────────────── */
[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

@media (prefers-reduced-motion: reduce) {
    [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ── 4. NAV ACTIVE HIGHLIGHT ────────────────────────────────── */
.nl a {
    position: relative;
}

.nl a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--terra, #C2704E);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.3s ease;
}

.nl a.nav-active::after {
    transform: scaleX(1);
}

/* ── 5. TYPEWRITER CURSOR ───────────────────────────────────── */
.tw-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--terra, #C2704E);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: tw-blink 0.8s step-end infinite;
}

@keyframes tw-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ── 6. 3D CARD TILT HIGHLIGHT ──────────────────────────────── */
.mi,
.ec,
.lc,
.ic,
.who-proof-item {
    position: relative;
    overflow: hidden;
}

.tilt-highlight {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        circle at 50% 50%,
        rgba(255, 255, 255, 0.13) 0%,
        transparent 65%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1;
}

/* ── 7. SKILL PIPELINE ──────────────────────────────────────── */
.skill-pipeline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 1rem;
    position: relative;
}

.sp-node {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    border: 1px solid rgba(240, 230, 221, 0.22);
    color: var(--dk-t2, #B89E8E);
    background: var(--dk-srf, rgba(255,245,235,0.06));
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: default;
    transition: transform 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    z-index: 2;
}

.sp-node:hover {
    transform: scale(1.1);
    border-color: rgba(212, 137, 107, 0.7);
    color: var(--terra-l, #D4896B);
    box-shadow: 0 0 12px rgba(212, 137, 107, 0.3);
}

.sp-node.sp-active {
    border-color: rgba(100, 160, 255, 0.6);
    box-shadow: 0 0 10px rgba(100, 160, 255, 0.35), 0 0 24px rgba(100, 160, 255, 0.12);
    color: #a8c8ff;
}

/* Tooltip */
.sp-node::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.85);
    white-space: nowrap;
    background: var(--dk, #2E1F18);
    color: var(--dk-t, #F0E6DD);
    font-size: 0.68rem;
    font-weight: 400;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    border: 1px solid var(--dk-bd, rgba(240,230,221,0.08));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

.sp-node:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.sp-connector {
    position: relative;
    display: flex;
    align-items: center;
    width: 22px;
    height: 2px;
    flex-shrink: 0;
    z-index: 1;
}

.sp-connector-line {
    width: 100%;
    height: 1px;
    background: rgba(240, 230, 221, 0.15);
    position: relative;
    overflow: hidden;
}

.sp-packet {
    position: absolute;
    top: 50%;
    left: -4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #7ab4ff;
    box-shadow: 0 0 6px rgba(100, 160, 255, 0.8);
    transform: translateY(-50%);
    animation: packet-travel 3s linear infinite;
}

@keyframes packet-travel {
    0%   { left: -4px; opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { left: calc(100% + 4px); opacity: 0; }
}

/* ── 8. STAT COUNTER FLASH ──────────────────────────────────── */
@keyframes stat-flash {
    0%   { color: var(--terra, #C2704E); }
    50%  { color: #EF9F27; }
    100% { color: var(--terra, #C2704E); }
}

.hs-num.flash {
    animation: stat-flash 0.3s ease forwards;
}

/* ── 9. HERO SCRAMBLE / TAGS ────────────────────────────────── */
.hero-scramble-wrap {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-tag-single {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    color: var(--t3);
}

/* ── 10. GRAIN CANVAS ───────────────────────────────────────── */
#grain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.035;
}

/* Ensure hero content sits above grain */
.hero-l > *:not(#grain):not(#particle-bg),
.hero-r > * {
    position: relative;
    z-index: 2;
}

/* ── 11. PARTICLE CANVAS ────────────────────────────────────── */
#particle-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ── 12. MAGNETIC BUTTON ────────────────────────────────────── */
/* Handled entirely in JS; no extra CSS needed beyond existing btn styles */
