:root {
    --cyber-blue: #00f3ff;
    --cyber-blue-rgb: 0, 243, 255;
    --cyber-purple: #9d00ff;
    --cyber-purple-rgb: 157, 0, 255;
    --cyber-pink: #ff00c8;
    --cyber-green: #00ff9d;
    --dark-bg: #0a0a14;
    --darker-bg: #030308;
    --glass-bg: rgba(15, 15, 30, 0.6);
    --glass-border: rgba(0, 243, 255, 0.1);
    
    /* Mobile-first spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    
    /* Responsive font sizes */
    --fs-title: clamp(1.8rem, 5vw, 3rem);
    --fs-subtitle: clamp(1rem, 2.5vw, 1.2rem);
    --fs-body: clamp(0.9rem, 2vw, 1.1rem);
    --fs-small: clamp(0.75rem, 1.5vw, 0.9rem);
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Exo 2', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--darker-bg);
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    position: relative;
    cursor: default;
}

/* Canvas layers - Optimized for mobile */
#three-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    pointer-events: none;
}

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.06;
}

/* Main content wrapper */
.main-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Container - Mobile first */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-sm);
    }
}

/* Sections */
.section {
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--space-xl) 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.section.active {
    opacity: 1;
    transform: translateY(0);
}

/* Navigation - Bottom bar for mobile */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 243, 255, 0.2);
    z-index: 1000;
    padding: 0.5rem 0;
    padding-bottom: env(safe-area-inset-bottom, 0.5rem);
}

@media (max-width: 768px) {
    .mobile-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    
    .section {
        padding-bottom: calc(var(--space-xl) + 60px);
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: var(--fs-small);
    transition: all 0.3s ease;
    border-radius: 12px;
    min-width: 60px;
}

.mobile-nav-item i {
    font-size: 1.2rem;
}

.mobile-nav-item.active {
    color: var(--cyber-blue);
    background: rgba(0, 243, 255, 0.1);
}

/* Desktop navigation dots */
.nav-dots {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

@media (max-width: 768px) {
    .nav-dots {
        display: none;
    }
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

.nav-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.nav-dot.active {
    background: var(--cyber-blue);
    box-shadow: 0 0 15px rgba(var(--cyber-blue-rgb), 0.6);
    transform: scale(1.4);
}

.nav-dot.active::after {
    border-color: var(--cyber-blue);
    animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0; }
}

/* Profile Section - Mobile optimized */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

@media (max-width: 992px) {
    .profile-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
}

.profile-visual {
    position: relative;
}

.profile-image-wrapper {
    position: relative;
    width: min(300px, 70vw);
    height: min(300px, 70vw);
    margin: 0 auto;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    border: 2px solid rgba(var(--cyber-blue-rgb), 0.3);
    transition: all 0.4s ease;
}

.profile-image-glow {
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--cyber-blue-rgb), 0.3), transparent);
    animation: profilePulse 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes profilePulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.08); opacity: 0.8; }
}

.hologram-ring {
    position: absolute;
    inset: -30px;
    border-radius: 50%;
    border: 1.5px solid rgba(var(--cyber-blue-rgb), 0.15);
    animation: rotate 15s linear infinite;
    z-index: 0;
}

@media (max-width: 480px) {
    .hologram-ring {
        inset: -20px;
    }
}

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

/* Tech specs */
.tech-specs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.spec-item {
    background: rgba(15, 15, 30, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--cyber-blue-rgb), 0.2);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    text-align: center;
    min-width: 80px;
}

.spec-label {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.1em;
    margin-bottom: 2px;
}

.spec-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
}

.spec-value.online {
    color: var(--cyber-green);
    animation: statusBlink 2s infinite;
}

.spec-value.low {
    color: var(--cyber-green);
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Profile content */
.profile-content {
    animation: fadeInUp 0.8s ease-out;
}

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

.cyber-title {
    font-family: 'Orbitron', sans-serif;
    font-size: var(--fs-title);
    font-weight: 900;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    word-break: break-word;
}

@media (max-width: 480px) {
    .cyber-title {
        font-size: 1.8rem;
    }
}

/* Glitch text effect */
.glitch-text {
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, #fff 0%, var(--cyber-blue) 50%, var(--cyber-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 10px rgba(var(--cyber-blue-rgb), 0.3));
}

/* Typing effect */
.typing-container {
    font-family: 'Share Tech Mono', monospace;
    font-size: var(--fs-body);
    margin: 0.5rem 0 1rem;
    min-height: 1.5em;
    color: var(--cyber-green);
}

.cursor {
    animation: blink 1s step-end infinite;
}

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

/* Profile description */
.profile-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--fs-body);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Platform buttons */
.platform-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

@media (max-width: 992px) {
    .platform-buttons {
        justify-content: center;
    }
}

.cyber-button {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.5rem;
    background: rgba(10, 10, 25, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--cyber-blue-rgb), 0.2);
    border-radius: 50px;
    color: #fff;
    text-decoration: none;
    font-size: var(--fs-small);
    font-weight: 500;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.cyber-button:active {
    transform: scale(0.95);
}

.cyber-button.telegram {
    border-color: rgba(0, 136, 204, 0.3);
}

.cyber-button.whatsapp {
    border-color: rgba(37, 211, 102, 0.3);
}

.cyber-button i {
    font-size: 1.1rem;
}

.button-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.cyber-button:hover .button-glow {
    left: 100%;
}

@media (hover: hover) {
    .cyber-button:hover {
        transform: translateY(-3px);
    }
    
    .cyber-button.telegram:hover {
        border-color: #0088cc;
        box-shadow: 0 10px 25px rgba(0, 136, 204, 0.2);
    }
    
    .cyber-button.whatsapp:hover {
        border-color: #25D366;
        box-shadow: 0 10px 25px rgba(37, 211, 102, 0.2);
    }
}

/* Section titles */
.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: var(--fs-title);
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--cyber-blue), var(--cyber-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--fs-subtitle);
    margin-bottom: var(--space-xl);
}

/* Skills Grid - Mobile optimized */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 480px) {
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.skill-card {
    background: rgba(15, 15, 30, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(var(--cyber-blue-rgb), 0.1);
    border-radius: 20px;
    padding: clamp(1.5rem, 3vw, 2rem);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(30px);
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyber-blue), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.skill-card.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (hover: hover) {
    .skill-card:hover {
        transform: translateY(-8px);
        border-color: rgba(var(--cyber-purple-rgb), 0.4);
        box-shadow: 0 20px 40px rgba(var(--cyber-purple-rgb), 0.15);
    }
    
    .skill-card:hover::before {
        opacity: 1;
    }
}

.skill-card:active {
    transform: scale(0.98);
}

.skill-icon {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    color: var(--cyber-blue);
}

.skill-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.skill-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--fs-small);
    line-height: 1.6;
}

/* Contact section */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: var(--space-xl) 0;
}

@media (max-width: 480px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.contact-card {
    perspective: 1000px;
}

.card-inner {
    background: rgba(15, 15, 30, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(var(--cyber-blue-rgb), 0.1);
    border-radius: 20px;
    padding: clamp(1.5rem, 3vw, 2rem);
    text-align: center;
    transition: all 0.4s ease;
    transform-style: preserve-3d;
}

@media (hover: hover) {
    .contact-card:hover .card-inner {
        transform: rotateY(5deg) rotateX(3deg);
        border-color: rgba(var(--cyber-blue-rgb), 0.4);
        box-shadow: 0 20px 40px rgba(var(--cyber-blue-rgb), 0.1);
    }
}

.card-inner i {
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--cyber-blue);
    margin-bottom: 1rem;
    display: block;
}

.card-inner h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: 0.5rem;
}

.card-inner p {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--fs-small);
    word-break: break-all;
}

/* Hire button */
.hire-button {
    display: block;
    width: fit-content;
    margin: 2rem auto;
    padding: clamp(1rem, 3vw, 1.5rem) clamp(2rem, 5vw, 4rem);
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: 800;
    color: var(--cyber-blue);
    background: transparent;
    border: 2px solid var(--cyber-blue);
    border-radius: 50px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    letter-spacing: 0.05em;
    text-align: center;
}

.hire-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--cyber-blue-rgb), 0.2), transparent);
    transition: left 0.5s ease;
}

@media (hover: hover) {
    .hire-button:hover {
        background: var(--cyber-blue);
        color: #000;
        box-shadow: 0 0 50px rgba(var(--cyber-blue-rgb), 0.4);
        transform: translateY(-3px);
    }
    
    .hire-button:hover::before {
        left: 100%;
    }
}

.hire-button:active {
    transform: scale(0.95);
}

/* Footer */
.footer {
    padding: var(--space-lg) 0;
    border-top: 1px solid rgba(var(--cyber-blue-rgb), 0.1);
    text-align: center;
    margin-top: var(--space-xl);
}

@media (max-width: 768px) {
    .footer {
        padding-bottom: calc(var(--space-lg) + 70px); /* Space for mobile nav */
    }
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.social-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(15, 15, 30, 0.6);
    border: 1px solid rgba(var(--cyber-blue-rgb), 0.2);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

@media (hover: hover) {
    .social-icon:hover {
        background: rgba(var(--cyber-blue-rgb), 0.15);
        border-color: var(--cyber-blue);
        color: var(--cyber-blue);
        transform: translateY(-4px);
        box-shadow: 0 10px 20px rgba(var(--cyber-blue-rgb), 0.2);
    }
}

.copyright {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    line-height: 1.6;
}

.copyright p {
    margin: 0.2rem 0;
}

/* Status bar for mobile */
.status-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 25, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(var(--cyber-blue-rgb), 0.2);
    padding: 0.3rem 1rem;
    z-index: 1000;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 768px) {
    .status-bar {
        display: flex;
    }
    
    .section:first-child {
        padding-top: calc(var(--space-xl) + 30px);
    }
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cyber-green);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 5px var(--cyber-green); }
    50% { box-shadow: 0 0 15px var(--cyber-green); }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    .hologram-ring {
        animation-duration: 20s;
    }
    
    .profile-image-glow {
        animation-duration: 4s;
    }
}

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

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .cyber-button,
    .skill-card,
    .contact-card,
    .hire-button {
        cursor: pointer;
    }
}

/* Landscape mode adjustments */
@media (max-width: 992px) and (orientation: landscape) {
    .section {
        min-height: auto;
        padding: var(--space-lg) 0;
    }
    
    .profile-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .profile-image-wrapper {
        width: min(200px, 40vw);
        height: min(200px, 40vw);
    }
}