/* =====================================
   PROJECTS PAGE - WEB3 CYBER STYLING
===================================== */

/* Hero Section */
.hero {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.cyber-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.floating-particles::before,
.floating-particles::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.floating-particles::before {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.floating-particles::after {
    top: 80%;
    right: 30%;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); opacity: 0.7; }
    50% { transform: translateY(-20px) scale(1.1); opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--accent-cyan);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 3.5rem;
    font-family: var(--font-orbitron);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-glow {
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-family: var(--font-orbitron);
    font-weight: 700;
    color: var(--accent-cyan);
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Projects Cube */
#hero .projects-cube {
    width: 200px;
    height: 200px;
    position: relative;
    margin: 0 auto;
    transform-style: preserve-3d;

    /* Smooth continuous spinning */
    animation: rotateCube 18s infinite linear !important;
    will-change: transform;
    backface-visibility: hidden;
}


@media (max-width: 768px) {
    /* enforce cube spin speed on mobile */
    #hero .projects-cube {
        animation-duration: 22s !important;
        animation-name: rotateCube !important;
    }
}


@keyframes rotateCube {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

/* Accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
    /* enforce reduced motion */
    #hero .projects-cube {
        animation: none !important;
        transform: rotateX(18deg) rotateY(28deg) !important;
    }
}


/* Keep transforms composited */
.projects-cube,
.cube-face {
    transform-style: preserve-3d;
}


.cube-face {
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(0, 212, 255, 0.1);
    border: 2px solid var(--accent-cyan);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-orbitron);
    font-weight: 600;
    color: var(--accent-cyan);
    transition: all 0.3s ease;
}

.cube-face i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cube-face.front { transform: rotateY(0deg) translateZ(100px); }
.cube-face.back { transform: rotateY(180deg) translateZ(100px); }
.cube-face.right { transform: rotateY(90deg) translateZ(100px); }
.cube-face.left { transform: rotateY(-90deg) translateZ(100px); }
.cube-face.top { transform: rotateX(90deg) translateZ(100px); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(100px); }

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-arrow {
    width: 2px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, var(--accent-cyan));
    position: relative;
    animation: scrollBounce 2s infinite;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid var(--accent-cyan);
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(10px); opacity: 0.7; }
}

/* Projects Section */
.projects-section {
    padding: 6rem 0;
    background: var(--bg-secondary);
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 3rem;
    font-family: var(--font-orbitron);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Cyber Tabs */
.cyber-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.cyber-tab {
    position: relative;
    background: rgba(253, 250, 246, 0.85);
    border: 2px solid var(--border-cyber);
    color: var(--text-secondary);
    padding: 1rem 2rem;
    border-radius: 0;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    font-family: var(--font-orbitron);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(8px);
    will-change: background, border-color;
}

.cyber-tab:hover,
.cyber-tab.active {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.tab-icon {
    font-size: 1.2rem;
}

.tab-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, var(--accent-cyan), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.cyber-tab:hover .tab-glow,
.cyber-tab.active .tab-glow {
    opacity: 0.08;
}

/* Cyber Projects Grid */
.cyber-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.cyber-project-card {
    position: relative;
    background: rgba(253, 250, 246, 0.95);
    border: 1px solid rgba(204,103,65,0.12);
    backdrop-filter: blur(8px);
    overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    will-change: opacity, transform;
}

/* Show state - visible cards */
.cyber-project-card.show {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Hide state - hidden cards */
.cyber-project-card.hide {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.cyber-project-card:hover {
    transform: translateY(-8px) scale(1);
    border-color: rgba(204,103,65,0.25);
    box-shadow: 0 15px 35px rgba(204,103,65, 0.12);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(204,103,65,0.12), rgba(124,155,106,0.12), rgba(139,94,122,0.12));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.cyber-project-card:hover .card-glow {
    opacity: 0.12;
}

.project-featured {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-green);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.project-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cyber-project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 250, 246, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.cyber-project-card:hover .project-overlay {
    opacity: 1;
    pointer-events: auto;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    background: rgba(204,103,65,0.95);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.project-link:hover {
    background: #A3522F;
    transform: scale(1.05);
}

.project-content {
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-category {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-cyan);
    font-size: 0.9rem;
    font-weight: 600;
}

.project-status {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
}

.project-status.active {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-green);
}

.project-status.completed {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-green);
}

.project-status.development {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.project-title {
    font-size: 1.5rem;
    font-family: var(--font-orbitron);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    border-top: 1px solid var(--border-cyber);
    padding-top: 1.5rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-family: var(--font-orbitron);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent-cyan);
    display: block;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    /* extra protection against overflow on small screens */
    .hero-visual,
    .projects-cube,
    .cube-face {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .projects-cube {
        width: 150px;
        height: 150px;
    }
    
    .cube-face {
        width: 150px;
        height: 150px;
    }
    
    .cube-face.front { transform: rotateY(0deg) translateZ(75px); }
    .cube-face.back { transform: rotateY(180deg) translateZ(75px); }
    .cube-face.right { transform: rotateY(90deg) translateZ(75px); }
    .cube-face.left { transform: rotateY(-90deg) translateZ(75px); }
    .cube-face.top { transform: rotateX(90deg) translateZ(75px); }
    .cube-face.bottom { transform: rotateX(-90deg) translateZ(75px); }
    
    .cyber-projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .cyber-tab {
        padding: 0.8rem 1.5rem;
    }
    
    .tab-text {
        display: none;
    }
    
    .project-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .project-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .cyber-projects-grid {
        grid-template-columns: 1fr;
    }
    
    .project-content {
        padding: 1.5rem;
    }
}

/* Animation for stats counting */
.stat-number[data-target] {
    animation: countUp 2s ease-out forwards;
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Filter animation */
.cyber-project-card.fade-out {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.cyber-project-card.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

