/* XYLOS Animation Styles */

/* Cursor Animation */
@keyframes blink-cursor {
    0%, 50% { border-color: #d946ef; }
    51%, 100% { border-color: transparent; }
}

/* Matrix Fall Animation */
@keyframes matrix-fall {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Scroll Animations */
.scroll-animate {
    animation: slide-up-fade 0.8s ease-out forwards;
}

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

/* Glitch Effect */
.glitch-effect {
    position: relative;
    animation: glitch 0.3s ease-in-out infinite;
}

.glitch-effect::before,
.glitch-effect::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-effect::before {
    animation: glitch-1 0.5s ease-in-out infinite;
    color: #ff0080;
    z-index: -1;
}

.glitch-effect::after {
    animation: glitch-2 0.5s ease-in-out infinite;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-1 {
    0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
    20% { clip-path: inset(33% 0 0 0); transform: translate(-4px); }
    40% { clip-path: inset(0 0 33% 0); transform: translate(4px); }
    60% { clip-path: inset(0 0 0 33%); transform: translate(-4px); }
    80% { clip-path: inset(33% 0 0 0); transform: translate(4px); }
}

@keyframes glitch-2 {
    0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
    20% { clip-path: inset(0 0 66% 0); transform: translate(4px); }
    40% { clip-path: inset(66% 0 0 0); transform: translate(-4px); }
    60% { clip-path: inset(0 66% 0 0); transform: translate(4px); }
    80% { clip-path: inset(0 0 0 66%); transform: translate(-4px); }
}

/* Morph Animation */
@keyframes morph {
    0%, 100% {
        border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
        transform: rotate(0deg) scale(1);
    }
    14% {
        border-radius: 40% 60% 54% 46% / 49% 60% 40% 51%;
        transform: rotate(-30deg) scale(1.1);
    }
    28% {
        border-radius: 54% 46% 38% 62% / 49% 70% 30% 51%;
        transform: rotate(30deg) scale(0.9);
    }
    42% {
        border-radius: 61% 39% 55% 45% / 61% 38% 62% 39%;
        transform: rotate(-45deg) scale(1.15);
    }
    56% {
        border-radius: 61% 39% 67% 33% / 70% 50% 50% 30%;
        transform: rotate(45deg) scale(0.95);
    }
    70% {
        border-radius: 50% 50% 34% 66% / 56% 68% 32% 44%;
        transform: rotate(-60deg) scale(1.05);
    }
    84% {
        border-radius: 46% 54% 50% 50% / 35% 61% 39% 65%;
        transform: rotate(60deg) scale(1);
    }
}

/* Pulse Glow Animation */
@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.05);
        filter: brightness(1.2) drop-shadow(0 0 20px currentColor);
    }
}

/* Logo Pulse */
.logo-mystical {
    animation: logo-pulse 3s ease-in-out infinite;
}

@keyframes logo-pulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 20px rgba(217, 70, 239, 0.5));
    }
    25% {
        transform: scale(1.1) rotate(5deg);
        filter: drop-shadow(0 0 30px rgba(217, 70, 239, 0.8));
    }
    50% {
        transform: scale(1) rotate(-5deg);
        filter: drop-shadow(0 0 40px rgba(234, 179, 8, 0.8));
    }
    75% {
        transform: scale(1.1) rotate(5deg);
        filter: drop-shadow(0 0 30px rgba(234, 179, 8, 0.5));
    }
}

/* Floating Animation */
@keyframes float-up-down {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Rainbow Text Animation */
.rainbow-text {
    background: linear-gradient(
        to right,
        #ff0080 0%,
        #ff8c00 14%,
        #ffd700 28%,
        #00ff00 42%,
        #00ffff 56%,
        #0080ff 70%,
        #8000ff 84%,
        #ff0080 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-shift 3s linear infinite;
}

@keyframes rainbow-shift {
    to { background-position: 200% center; }
}

/* Card Hover States */
.feature-card-mystical,
.investor-card,
.team-member {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.feature-card-mystical:hover,
.investor-card:hover,
.team-member:hover {
    animation: card-float 2s ease-in-out infinite;
}

@keyframes card-float {
    0%, 100% {
        transform: translateY(0) rotateX(0) rotateY(0);
    }
    25% {
        transform: translateY(-10px) rotateX(5deg) rotateY(5deg);
    }
    75% {
        transform: translateY(-10px) rotateX(-5deg) rotateY(-5deg);
    }
}

/* Text Shadow Animations */
.hero-title {
    animation: text-shadow-pop 5s ease-in-out infinite;
}

@keyframes text-shadow-pop {
    0%, 100% {
        text-shadow: 
            0 0 10px rgba(217, 70, 239, 0.5),
            0 0 20px rgba(217, 70, 239, 0.3),
            0 0 30px rgba(217, 70, 239, 0.1);
    }
    50% {
        text-shadow: 
            0 0 20px rgba(234, 179, 8, 0.8),
            0 0 40px rgba(234, 179, 8, 0.5),
            0 0 60px rgba(234, 179, 8, 0.3);
    }
}

/* Button Animations */
.btn-primary-mystical {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary-mystical::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transition: width 0.6s, height 0.6s;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.btn-primary-mystical:hover::before {
    width: 300px;
    height: 300px;
}

/* Stat Counter Animation */
.stat-value {
    display: inline-block;
    animation: bounce-in 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(100px);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Loading Bar Animation */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #d946ef 0%, #eab308 50%, #d946ef 100%);
    background-size: 200% 100%;
    animation: loading-slide 2s linear infinite;
    z-index: 9999;
}

@keyframes loading-slide {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(217, 70, 239, 0.3);
    transform: scale(0);
    animation: ripple-expand 0.6s ease-out;
}

@keyframes ripple-expand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Particle Burst */
.particle-burst {
    position: absolute;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #d946ef;
    border-radius: 50%;
    animation: particle-float 1s ease-out forwards;
}

@keyframes particle-float {
    to {
        transform: translate(var(--x), var(--y)) scale(0);
        opacity: 0;
    }
}

/* Enhanced Section Headers */
.section-title-mystical {
    position: relative;
    display: inline-block;
    animation: title-glow 3s ease-in-out infinite;
}

@keyframes title-glow {
    0%, 100% {
        filter: brightness(1) drop-shadow(0 0 20px rgba(217, 70, 239, 0.5));
    }
    50% {
        filter: brightness(1.2) drop-shadow(0 0 40px rgba(234, 179, 8, 0.8));
    }
}

/* Smooth Scroll Indicator */
.scroll-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid rgba(217, 70, 239, 0.5);
    border-radius: 25px;
    cursor: pointer;
    animation: scroll-bounce 2s ease-in-out infinite;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #d946ef;
    border-radius: 50%;
    transform: translateX(-50%);
    animation: scroll-wheel 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

@keyframes scroll-wheel {
    0% { top: 8px; opacity: 1; }
    100% { top: 30px; opacity: 0; }
}

/* NEW IGLOO-INSPIRED ANIMATIONS */

/* Character-by-Character Text Animation */
.char-animate {
    overflow: hidden;
}

.char-animate .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%) rotateX(-90deg);
    transform-origin: center bottom;
    animation: charReveal 0.6s var(--ease-out-expo) forwards;
}

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

/* Stagger delay for characters */
.char-animate .char:nth-child(1) { animation-delay: 0.02s; }
.char-animate .char:nth-child(2) { animation-delay: 0.04s; }
.char-animate .char:nth-child(3) { animation-delay: 0.06s; }
.char-animate .char:nth-child(4) { animation-delay: 0.08s; }
.char-animate .char:nth-child(5) { animation-delay: 0.10s; }
.char-animate .char:nth-child(6) { animation-delay: 0.12s; }
.char-animate .char:nth-child(7) { animation-delay: 0.14s; }
.char-animate .char:nth-child(8) { animation-delay: 0.16s; }
.char-animate .char:nth-child(9) { animation-delay: 0.18s; }
.char-animate .char:nth-child(10) { animation-delay: 0.20s; }

/* Holographic Card Effect */
.holographic {
    position: relative;
    background: linear-gradient(135deg, 
        rgba(217, 70, 239, 0.1) 0%, 
        rgba(234, 179, 8, 0.1) 50%, 
        rgba(217, 70, 239, 0.1) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(217, 70, 239, 0.3);
    overflow: hidden;
}

.holographic::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(45deg,
        transparent 30%,
        rgba(217, 70, 239, 0.3) 50%,
        transparent 70%);
    animation: holographicShine 3s linear infinite;
}

@keyframes holographicShine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Tokenomics Specific Styles */
.token-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 4rem 0;
}

.token-stat-card {
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    position: relative;
    transition: all 0.5s var(--ease-out-expo);
}

.token-stat-card:hover {
    transform: translateY(-10px) scale(1.02);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

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

.stat-change {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.stat-change.positive {
    color: #10b981;
}

.stat-rank, .stat-info {
    font-size: 0.875rem;
    color: var(--xylos-white-50);
    margin-top: 0.5rem;
}

/* Token Distribution Chart */
.tokenomics-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    margin-top: 5rem;
}

.distribution-chart {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.chart-visual {
    width: 300px;
    height: 300px;
    position: relative;
}

.pie-chart {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    animation: pieReveal 1.5s ease-out forwards;
}

@keyframes pieReveal {
    from {
        opacity: 0;
        transform: rotate(-90deg) scale(0.8);
    }
    to {
        opacity: 1;
        transform: rotate(-90deg) scale(1);
    }
}

.chart-legend {
    display: grid;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-value {
    margin-left: auto;
    font-weight: 600;
    color: var(--xylos-purple);
}

/* Utility Grid */
.utility-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.utility-item {
    text-align: center;
    padding: 2rem;
    background: var(--xylos-gray);
    border-radius: 16px;
    transition: all 0.3s var(--ease-out-expo);
}

.utility-item:hover {
    transform: translateY(-5px);
    background: var(--xylos-gray-light);
}

.utility-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.utility-item h4 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--xylos-white);
}

.utility-item p {
    font-size: 0.875rem;
    color: var(--xylos-white-70);
}

/* Enhanced Timeline */
.timeline-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, 
        transparent 0%,
        var(--xylos-purple) 10%,
        var(--xylos-gold) 50%,
        var(--xylos-purple) 90%,
        transparent 100%);
    transform: translateX(-50%);
}

.timeline-block {
    position: relative;
    margin-bottom: 4rem;
    opacity: 0;
}

.timeline-block[data-side="left"] {
    padding-right: 52%;
    text-align: right;
}

.timeline-block[data-side="right"] {
    padding-left: 52%;
    text-align: left;
}

.timeline-marker {
    position: absolute;
    top: 0;
    left: 50%;
    width: 30px;
    height: 30px;
    background: var(--xylos-purple);
    border: 4px solid var(--xylos-black);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 20px rgba(217, 70, 239, 0.5);
    z-index: 2;
}

.timeline-marker.special {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--xylos-purple) 0%, var(--xylos-gold) 100%);
    animation: pulse 2s ease-in-out infinite;
}

.timeline-content {
    padding: 2.5rem;
    border-radius: 20px;
    display: inline-block;
    text-align: left;
}

.timeline-date {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--xylos-purple);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-display);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--xylos-purple) 0%, var(--xylos-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timeline-list {
    list-style: none;
    display: grid;
    gap: 0.75rem;
}

.timeline-list li {
    color: var(--xylos-white-70);
    padding-left: 1.5rem;
    position: relative;
}

/* Timeline Reveal Animation */
.timeline-block.active {
    animation: timelineReveal 0.8s var(--ease-out-expo) forwards;
}

.timeline-block[data-side="left"].active {
    animation: timelineRevealLeft 0.8s var(--ease-out-expo) forwards;
}

.timeline-block[data-side="right"].active {
    animation: timelineRevealRight 0.8s var(--ease-out-expo) forwards;
}

@keyframes timelineRevealLeft {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes timelineRevealRight {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Subsection Styles */
.subsection-title {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-display);
    margin-bottom: 2rem;
    color: var(--xylos-white);
}

/* Responsive Adjustments */
@media (max-width: 968px) {
    .tokenomics-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .distribution-chart {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .chart-visual {
        margin: 0 auto;
    }
    
    .timeline-block[data-side="left"],
    .timeline-block[data-side="right"] {
        padding: 0 0 0 60px;
        text-align: left;
    }
    
    .timeline-line {
        left: 20px;
    }
    
    .timeline-marker {
        left: 20px;
    }
}