:root {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --secondary-color: #06b6d4;
    --accent-color: #3b82f6;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --background: #020617;
    --surface: #0f172a;
    --surface-light: #1e293b;
    --border: #334155;
    --border-light: #475569;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.3);
    --gradient-bg: linear-gradient(135deg, #020617 0%, #0f172a 50%, #1e293b 100%);
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--background);
    background-attachment: fixed;
    background-image: 
        radial-gradient(at 40% 20%, rgba(16, 185, 129, 0.03) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(6, 182, 212, 0.03) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(59, 130, 246, 0.03) 0px, transparent 50%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.top-nav {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    background: transparent;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 60px;
    position: relative;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(16, 185, 129, 0.1);
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.nav-toggle:hover {
    color: var(--text-primary);
    background: rgba(16, 185, 129, 0.1);
}

.hero {
    background: var(--gradient-bg);
    color: var(--text-primary);
    text-align: center;
    padding: 8rem 0 6rem;
    padding-top: calc(8rem + 60px);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

.hero-avatar {
    margin-bottom: 2rem;
}

.avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--gradient-primary);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: var(--shadow-glow);
}

.avatar-placeholder .material-icons {
    font-size: 3rem;
    color: white;
}

.avatar-img {
    width: 95%;
    height: 95%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    align-self: flex-end;
}


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

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    position: relative;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    box-shadow: var(--shadow-glow);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

.cta-button .material-icons {
    font-size: 1.2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(-2px); }
}

.section {
    padding: 6rem 0;
    position: relative;
}

.section:nth-child(even) {
    background: rgba(15, 23, 42, 0.5);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--text-primary);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}


.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 4rem;
}

.project-card {
    background: var(--surface);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.4s ease;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-glow), var(--shadow-lg);
    border-color: var(--primary-color);
}

.project-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.project-icon .material-icons {
    font-size: 2rem;
    color: white;
}

.project-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1rem;
}

.project-icon img[alt="Colorino"] {
    object-fit: cover;
    padding: 0;
}

.project-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
    font-size: 1.1rem;
    flex-grow: 1;
}

.project-links {
    display: flex;
    justify-content: center;
    margin-top: auto;
}

.project-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    font-size: 1rem;
    background: var(--gradient-primary);
    box-shadow: var(--shadow);
}

.project-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.project-link .material-icons {
    font-size: 1.1rem;
}


@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 60px);
        background: var(--surface);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
        transition: right 0.3s ease;
        border: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 0.8rem 1.2rem;
        width: 100%;
        text-align: left;
        border-radius: 0.75rem;
    }
    
    .nav-link:hover {
        background: rgba(16, 185, 129, 0.15);
    }
    
    .hero {
        padding: 6rem 0 4rem;
        padding-top: calc(6rem + 60px);
        min-height: 90vh;
    }
    
    .avatar-placeholder {
        width: 100px;
        height: 100px;
    }
    
    .avatar-placeholder .material-icons {
        font-size: 2.5rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .section {
        padding: 4rem 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .project-card {
        padding: 2rem;
    }
    
    .contact-links {
        flex-direction: column;
        align-items: center;
    }
    
    .contact-link {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .nav-menu {
        width: 100vw;
        right: -100vw;
        padding: 1.5rem;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .cta-button {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    .project-card {
        padding: 1.5rem;
    }
    
    .project-title {
        font-size: 1.5rem;
    }
    
    .project-description {
        font-size: 1rem;
    }
}

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