*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::selection {
    background-color: rgba(59, 130, 246, 0.3);
    color: #fff;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #020617;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #60a5fa, #a78bfa);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    overflow-x: hidden;
}

.cursor-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, rgba(139, 92, 246, 0.03) 30%, transparent 70%);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

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

.nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
    border-radius: 0.5rem;
}

.nav-link:hover {
    color: #ffffff;
}

.nav-link.active {
    color: #ffffff;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 1px;
    transition: transform 0.3s ease;
}

.nav-link.active::after,
.nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

#navbar.scrolled {
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.grid-bg {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero-gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3), transparent);
    top: 10%;
    right: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.25), transparent);
    bottom: 20%;
    left: 5%;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.2), transparent);
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(10px, -10px) scale(1.02);
    }
}

.hero-content .hero-badge {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.hero-content .hero-photo {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    animation: fadeInUpScale 0.8s ease forwards;
    animation-delay: 0.3s;
}

@keyframes fadeInUpScale {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.profile-ring {
    position: relative;
    padding: 3px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #22c55e, #f97316);
    background-size: 300% 300%;
    animation: gradientRotate 4s ease infinite;
}

@keyframes gradientRotate {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.profile-ring img {
    border-radius: 50%;
    border: 3px solid #020617;
}

.hero-content .hero-name {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.4s;
}

.hero-content .hero-surname {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.6s;
}

.hero-content .hero-title {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.8s;
}

.hero-content .hero-stats {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 1s;
}

.hero-content .hero-actions {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 1.2s;
}

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

.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.scroll-indicator {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 1.8s;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

.code-window {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.code-window:hover {
    box-shadow: 0 25px 60px -12px rgba(59, 130, 246, 0.15);
    transition: box-shadow 0.5s ease;
}

.skill-card {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.skill-card[data-color="primary"]:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.1);
}

.skill-card[data-color="royal"]:hover {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.1);
}

.skill-card[data-color="accent"]:hover {
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 20px 40px rgba(34, 197, 94, 0.1);
}

.skill-card[data-color="deeporange"]:hover {
    border-color: rgba(249, 115, 22, 0.3);
    box-shadow: 0 20px 40px rgba(249, 115, 22, 0.1);
}

.skill-card-inner {
    padding: 1.5rem;
}

.skill-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-card[data-color="primary"] .skill-fill {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.skill-card[data-color="royal"] .skill-fill {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.skill-card[data-color="accent"] .skill-fill {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.skill-card[data-color="deeporange"] .skill-fill {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.skill-card.animated .skill-fill {
    width: var(--target-width);
}

.timeline-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-dot {
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-dot {
    transform: translateX(-7px) scale(1.3) translateX(1px);
    box-shadow: 0 0 20px currentColor;
}

@media (min-width: 768px) {
    .timeline-item:hover .timeline-dot {
        transform: translateX(-50%) scale(1.3);
    }
}

.project-card {
    display: block;
    text-decoration: none;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-card-inner {
    padding: 1.5rem;
}

.education-card {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.education-card.visible {
    opacity: 1;
    transform: translateX(0);
}

.section-header {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-header.visible {
    opacity: 1;
    transform: translateY(0);
}

[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.contact-card {
    text-decoration: none;
    transition: all 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

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

@media (max-width: 767px) {
    .timeline-item {
        padding-left: 0;
    }

    .timeline-dot {
        left: 0 !important;
    }

    .hamburger-line:nth-child(1).open {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger-line:nth-child(2).open {
        opacity: 0;
        transform: translateX(20px);
    }

    .hamburger-line:nth-child(3).open {
        transform: translateY(-4px) rotate(-45deg);
        width: 1.5rem;
    }

    #mobile-menu.open {
        opacity: 1;
        pointer-events: auto;
    }

    .hero-gradient-orb {
        opacity: 0.2;
    }
}

.mobile-nav-link {
    position: relative;
    display: inline-block;
}

.mobile-nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

.mobile-nav-link:hover::after {
    width: 100%;
}
