/* ===================================
   RESET E VARIABILI
   =================================== */

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

:root {
    /* Palette colori blu */
    --primary-blue: #0066ff;
    --secondary-blue: #0047ab;
    --light-blue: #4d94ff;
    --dark-blue: #002d72;
    --accent-blue: #00bfff;
    
    /* Colori aggiuntivi */
    --white: #ffffff;
    --light-gray: #f0f4f8;
    --text-light: rgba(255, 255, 255, 0.9);
    --text-muted: rgba(255, 255, 255, 0.7);
    
    /* Ombre */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 102, 255, 0.2);
    --shadow-glow: 0 0 40px rgba(0, 191, 255, 0.3);
    
    /* Transizioni */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Font */
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ===================================
   STILI GLOBALI
   =================================== */

body {
    font-family: var(--font-main);
    color: var(--text-light);
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
}

/* ===================================
   CANVAS ANIMATO SFONDO
   =================================== */

#backgroundCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0047ab 0%, #0066ff 50%, #00bfff 100%);
}

/* ===================================
   CONTAINER PRINCIPALE
   =================================== */

.container {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    z-index: 1;
}

/* ===================================
   HERO SECTION
   =================================== */

.hero {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.hero-content {
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

/* Animazione di entrata */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   CERCHIO PROFILO
   =================================== */

.profile-circle {
    width: 140px;
    height: 140px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--primary-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    position: relative;
    animation: float 3s ease-in-out infinite, rotateGlow 8s linear infinite;
}

.profile-circle::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--accent-blue), var(--primary-blue), var(--accent-blue));
    z-index: -1;
    opacity: 0.5;
    animation: rotateBorder 3s linear infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes rotateBorder {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes rotateGlow {
    0%, 100% {
        box-shadow: 0 0 40px rgba(0, 191, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 60px rgba(0, 191, 255, 0.5);
    }
}

.profile-initial {
    font-size: 4rem;
    font-weight: 700;
    color: var(--white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ===================================
   TITOLI E TESTI
   =================================== */

.main-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.highlight {
    background: linear-gradient(135deg, var(--accent-blue), var(--white));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
}

.subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    min-height: 2.5rem;
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

.typing-text {
    color: var(--white);
}

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--accent-blue);
    font-weight: 100;
}

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

.description {
    font-size: clamp(1rem, 2vw, 1.2rem);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    color: var(--text-muted);
    line-height: 1.8;
    animation: fadeInUp 1s ease-out 0.6s backwards;
}

/* ===================================
   SKILLS BADGES
   =================================== */

.skills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    animation: fadeInUp 1s ease-out 0.8s backwards;
}

.skill-badge {
    padding: 0.7rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-normal);
    animation: slideInScale 0.6s ease-out backwards;
    animation-delay: var(--delay, 0s);
    cursor: default;
}

.skill-badge:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-glow);
    border-color: var(--accent-blue);
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===================================
   PULSANTI CTA
   =================================== */

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    animation: fadeInUp 1s ease-out 1s backwards;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--white);
    color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--white);
    transform: translateY(-3px);
}

/* ===================================
   SOCIAL LINKS
   =================================== */

.social-links {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 100;
    animation: slideInRight 1s ease-out 1.2s backwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px) translateY(-50%);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(-50%);
    }
}

.social-link {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--white);
    transition: all var(--transition-normal);
}

.social-link svg {
    width: 24px;
    height: 24px;
}

.social-link:hover {
    background: var(--white);
    color: var(--primary-blue);
    transform: translateX(-10px) scale(1.1);
    box-shadow: var(--shadow-glow);
}

/* ===================================
   SCROLL INDICATOR
   =================================== */

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    animation: fadeInUp 1s ease-out 1.4s backwards;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    margin: 0 auto 1rem;
    position: relative;
}

.wheel {
    width: 4px;
    height: 10px;
    background: var(--white);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

.scroll-indicator p {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Tablet */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    
    .profile-circle {
        width: 120px;
        height: 120px;
    }
    
    .profile-initial {
        font-size: 3rem;
    }
    
    .skills {
        gap: 0.7rem;
    }
    
    .skill-badge {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .cta-buttons {
        gap: 1rem;
    }
    
    .btn {
        padding: 0.9rem 1.7rem;
        font-size: 1rem;
    }
    
    .social-links {
        right: 1.5rem;
    }
    
    .social-link {
        width: 45px;
        height: 45px;
    }
    
    .social-link svg {
        width: 22px;
        height: 22px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .profile-circle {
        width: 100px;
        height: 100px;
        margin-bottom: 1.5rem;
    }
    
    .profile-initial {
        font-size: 2.5rem;
    }
    
    .main-title {
        margin-bottom: 0.8rem;
    }
    
    .subtitle {
        margin-bottom: 1rem;
        min-height: 2rem;
    }
    
    .description {
        margin-bottom: 2rem;
        font-size: 1rem;
    }
    
    .skills {
        gap: 0.5rem;
        margin-bottom: 2rem;
    }
    
    .skill-badge {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.8rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: 0.85rem 1.5rem;
        font-size: 0.95rem;
    }
    
    /* Social links su mobile - spostati in basso */
    .social-links {
        position: fixed;
        right: auto;
        top: auto;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        gap: 1rem;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
    }
    
    .social-link svg {
        width: 20px;
        height: 20px;
    }
    
    .social-link:hover {
        transform: translateY(-5px) scale(1.1);
    }
    
    .scroll-indicator {
        bottom: 6rem;
    }
    
    .scroll-indicator p {
        font-size: 0.8rem;
    }
}

/* Mobile piccolo */
@media (max-width: 360px) {
    .profile-circle {
        width: 90px;
        height: 90px;
    }
    
    .profile-initial {
        font-size: 2rem;
    }
    
    .skill-badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.75rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Landscape mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .container {
        padding: 1rem;
        justify-content: flex-start;
        padding-top: 2rem;
    }
    
    .profile-circle {
        width: 80px;
        height: 80px;
        margin-bottom: 1rem;
    }
    
    .profile-initial {
        font-size: 2rem;
    }
    
    .main-title {
        margin-bottom: 0.5rem;
    }
    
    .subtitle {
        margin-bottom: 0.8rem;
        min-height: auto;
    }
    
    .description {
        margin-bottom: 1rem;
    }
    
    .skills {
        margin-bottom: 1rem;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    .social-links {
        position: absolute;
        bottom: 1rem;
    }
}

/* ===================================
   ACCESSIBILITÀ
   =================================== */

/* Focus visibile per navigazione keyboard */
.btn:focus-visible,
.social-link:focus-visible,
.skill-badge:focus-visible {
    outline: 3px solid var(--accent-blue);
    outline-offset: 3px;
}

/* Riduzione movimento per utenti con preferenze */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .profile-circle {
        animation: none;
    }
    
    .cursor {
        animation: none;
        opacity: 1;
    }
    
    .wheel {
        animation: none;
    }
}
