/* ===== CYBER-LUXURY DESIGN SYSTEM ===== */
:root {
    /* Color Palette */
    --primary-bg: #0a0a0f;
    --secondary-bg: #1a1a2e;
    --accent-primary: #00ff88;
    --accent-secondary: #0088ff;
    --accent-tertiary: #8800ff;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #2a1a3e 100%);
    --gradient-accent: linear-gradient(45deg, #00ff88, #0088ff, #8800ff);
    --gradient-glow: radial-gradient(circle, rgba(0, 255, 136, 0.3) 0%, transparent 70%);
    
    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    
    /* Animations */
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ===== GLOBAL RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    background: var(--gradient-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    cursor: none;
}

/* ===== CUSTOM CURSOR ===== */
.cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.1s ease;
}

.cursor-follower {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transition: all 0.3s ease;
    opacity: 0.5;
}

/* ===== PARTICLE SYSTEM ===== */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0.6;
    animation: particleFloat 20s infinite linear;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

/* ===== FLOATING SHAPES ===== */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.shape {
    position: absolute;
    opacity: 0.1;
    animation: floatShape 15s infinite ease-in-out;
}

.shape-1 {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, var(--accent-primary), transparent);
    border-radius: 50%;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, var(--accent-secondary), transparent);
    transform: rotate(45deg);
    top: 60%;
    right: 15%;
    animation-delay: -5s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    border: 2px solid var(--accent-tertiary);
    border-radius: 50%;
    top: 40%;
    left: 80%;
    animation-delay: -10s;
}

.shape-4 {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--accent-tertiary), transparent);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    top: 80%;
    left: 20%;
    animation-delay: -7s;
}

.shape-5 {
    width: 70px;
    height: 70px;
    border: 2px solid var(--accent-primary);
    transform: rotate(45deg);
    top: 10%;
    right: 30%;
    animation-delay: -12s;
}

/* ===== ALIEN SHIP EASTER EGG ===== */
.alien-ship {
    position: fixed;
    width: 40px;
    height: 30px;
    top: 25%;
    right: 15%;
    opacity: 0.6;
    cursor: pointer;
    transition: var(--transition-smooth);
    animation: alienFloat 8s infinite ease-in-out;
    animation-delay: -3s;
    z-index: 5;
    pointer-events: auto;
}

.alien-ship:hover {
    opacity: 0.9;
    transform: scale(1.2) translateY(-5px);
    filter: drop-shadow(0 0 15px rgba(0, 255, 136, 0.6));
}

.alien-ship svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 5px rgba(0, 255, 136, 0.3));
}

@keyframes floatShape {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

@keyframes alienFloat {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    25% {
        transform: translateY(-15px) translateX(10px);
    }
    50% {
        transform: translateY(-5px) translateX(-5px);
    }
    75% {
        transform: translateY(-20px) translateX(15px);
    }
}

/* ===== CIRCUIT PATTERN ===== */
.circuit-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
}

.circuit-svg {
    width: 100%;
    height: 100%;
}

.circuit-path {
    stroke-dasharray: 5, 10;
    animation: circuitFlow 3s infinite linear;
}

.circuit-node {
    animation: nodePulse 2s infinite ease-in-out;
}

@keyframes circuitFlow {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: 15;
    }
}

@keyframes nodePulse {
    0%, 100% {
        opacity: 0.5;
        r: 4;
    }
    50% {
        opacity: 1;
        r: 6;
    }
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition-smooth);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

.theme-icon {
    font-size: 24px;
    transition: var(--transition-smooth);
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 1s ease, visibility 1s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 30px;
    animation: logoGlow 2s infinite ease-in-out;
}

.loading-progress {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-accent);
    width: 0%;
    animation: progressLoad 1.5s ease-in-out forwards;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    animation: textFade 1.5s infinite ease-in-out;
}

@keyframes logoGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.8));
    }
}

@keyframes progressLoad {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes textFade {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ===== HERO SECTION ===== */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 10;
    padding: 0 20px;
}

.holographic-container {
    position: relative;
    margin-bottom: 30px;
}

.holographic-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    position: relative;
    display: inline-block;
}

.title-layer {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    z-index: 2;
    animation: titleFloat 3s infinite ease-in-out;
}

.title-glitch {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    z-index: 1;
    animation: glitchEffect 4s infinite;
}

@keyframes titleFloat {
    0%, 100% {
        transform: translateY(0px);
        filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.5));
    }
    50% {
        transform: translateY(-10px);
        filter: drop-shadow(0 0 30px rgba(0, 255, 136, 0.8));
    }
}

@keyframes glitchEffect {
    0%, 90%, 100% {
        transform: translate(0);
        opacity: 0;
    }
    91% {
        transform: translate(2px, -2px);
        opacity: 0.8;
    }
    92% {
        transform: translate(-2px, 2px);
        opacity: 0.8;
    }
    93% {
        transform: translate(0);
        opacity: 0;
    }
}

.subtitle-enhanced {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-secondary);
    margin-bottom: 60px;
    max-width: 800px;
}

.subtitle-word {
    display: inline-block;
    margin: 0 8px;
    animation: wordReveal 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

.subtitle-word:nth-child(1) { animation-delay: 0.1s; }
.subtitle-word:nth-child(2) { animation-delay: 0.2s; }
.subtitle-word:nth-child(3) { animation-delay: 0.3s; }
.subtitle-word:nth-child(4) { animation-delay: 0.4s; }
.subtitle-word:nth-child(5) { animation-delay: 0.5s; }
.subtitle-word:nth-child(6) { animation-delay: 0.6s; }

@keyframes wordReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    animation: scrollBounce 2s infinite;
    cursor: pointer;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--accent-primary);
    border-bottom: 2px solid var(--accent-primary);
    transform: rotate(45deg);
    margin-bottom: 10px;
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(10px);
    }
}

/* ===== SERVICE CARDS 3D ===== */
.services-constellation {
    padding: 100px 20px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.constellation-title {
    text-align: center;
    margin-bottom: 80px;
}

.constellation-title h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 20px;
}

.title-underline {
    width: 100px;
    height: 4px;
    background: var(--gradient-accent);
    margin: 0 auto;
    border-radius: 2px;
    animation: underlineGlow 2s infinite ease-in-out;
}

@keyframes underlineGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.8);
    }
}

.service-cards-3d {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    perspective: 1000px;
}

.service-card-3d {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    transition: var(--transition-smooth);
    transform-style: preserve-3d;
    cursor: pointer;
    overflow: hidden;
}

.service-card-3d:hover {
    transform: rotateY(5deg) rotateX(5deg) translateZ(20px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(0, 255, 136, 0.2);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: var(--gradient-glow);
    opacity: 0;
    transition: var(--transition-smooth);
    pointer-events: none;
}

.service-card-3d:hover .card-glow {
    opacity: 0.3;
}

.card-content {
    position: relative;
    z-index: 2;
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.service-card-3d h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 15px;
}

.service-card-3d p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    margin-top: 15px;
}

.card-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.card-link:hover::before {
    left: 100%;
}

.card-link:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.4);
    filter: brightness(1.1);
}

.card-link:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ===== SKILLS UNIVERSE ===== */
.skills-universe {
    padding: 100px 20px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.universe-title {
    text-align: center;
    margin-bottom: 80px;
}

.universe-title h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 20px;
}

.skills-container {
    position: relative;
    min-height: 400px;
}

.keywords-constellation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.keyword {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 12px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-primary);
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.keyword::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.keyword:hover::before {
    left: 100%;
}

.keyword:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
    border-color: var(--accent-primary);
}

.constellation-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ===== MODERN SKILLS GRID ===== */
.detailed-skills-modern {
    padding: 100px 20px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.skills-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.skill-category {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.category-header {
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
}

.category-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-accent);
    border-radius: 15px;
    color: white;
}

.category-header h3 {
    flex: 1;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.expand-indicator {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-primary);
    transition: var(--transition-smooth);
}

.skill-category.expanded .expand-indicator {
    transform: rotate(45deg);
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.skill-category.expanded .category-content {
    max-height: 1000px;
}

.skill-item {
    padding: 15px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    line-height: 1.6;
    transition: var(--transition-smooth);
}

.skill-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.skill-item:last-child {
    border-bottom: none;
}

.skill-item strong {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ===== CONTACT SECTION ===== */
.contact-section {
    padding: 100px 20px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.contact-container h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 50px;
}

.email-magnetic {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 20px 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 60px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.email-magnetic:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px rgba(0, 255, 136, 0.3);
}

.email-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-accent);
    border-radius: 50%;
    color: white;
}

.email-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-glow);
    opacity: 0;
    transition: var(--transition-smooth);
    pointer-events: none;
}

.email-magnetic:hover .email-glow {
    opacity: 0.3;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .service-cards-3d {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 30px;
    }
    
    .skills-grid-modern {
        grid-template-columns: 1fr;
    }
    
    .skill-category {
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 0 15px;
    }
    
    .services-constellation,
    .skills-universe,
    .detailed-skills-modern,
    .contact-section {
        padding: 60px 15px;
    }
    
    .service-cards-3d {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .service-card-3d {
        padding: 30px;
    }
    
    .skills-grid-modern {
        gap: 20px;
    }
    
    .category-header {
        padding: 20px;
    }
    
    .skill-item {
        padding: 12px 20px;
    }
    
    .theme-toggle {
        top: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .theme-icon {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .constellation-title h2,
    .universe-title h2 {
        font-size: 2rem;
    }
    
    .service-card-3d {
        padding: 20px;
    }
    
    .service-icon {
        font-size: 2.5rem;
    }
    
    .email-magnetic {
        padding: 15px 30px;
        font-size: 1rem;
    }
    
    .loading-logo {
        font-size: 2rem;
    }
    
    .loading-progress {
        width: 250px;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .cursor,
    .cursor-follower {
        display: none;
    }
    
    body {
        cursor: auto;
    }
}

/* Focus styles for accessibility */
.theme-toggle:focus,
.email-magnetic:focus,
.skill-category:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (forced-colors: active) {
    .service-card-3d,
    .skill-category,
    .email-magnetic {
        border: 2px solid currentColor;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.service-card-3d,
.skill-category,
.keyword {
    will-change: transform;
}

.particle,
.shape,
.circuit-path,
.circuit-node {
    will-change: transform, opacity;
}

/* GPU acceleration for smooth animations */
.holographic-title,
.title-layer,
.title-glitch,
.service-card-3d,
.keyword {
    transform: translateZ(0);
    backface-visibility: hidden;
}
