/* ========================================
   RESET E VARIABILI CSS
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colori base */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(42, 42, 42, 0.6);
    --bg-card-hover: rgba(53, 53, 53, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    
    /* Accent colors per categoria */
    --accent-blog: #ff7b00;
    --accent-git: #8b5cf6;
    --accent-mastodon: #6364ff;
    --accent-peertube: #f1680d;
    --accent-bluesky: #1185fe;
    --accent-keyoxide: #50c878;
    --accent-email: #10b981;
    
    /* Design tokens */
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.4);
}

/* ========================================
   BODY E BACKGROUND
======================================== */
body {
    /* System fonts stack - NO CDN */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 
                 "Helvetica Neue", Arial, "Noto Sans", sans-serif, 
                 "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
    background-size: 200% 200%;
    animation: gradientShift 20s ease infinite;
    
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Gradient background animation */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Background pattern sottile (dots) */
.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #ffffff 1px, transparent 1px);
    background-size: 30px 30px;
}

/* ========================================
   CONTAINER
======================================== */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 60px 20px;
    position: relative;
    z-index: 1;
}

/* ========================================
   HERO SECTION
======================================== */
.hero {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInUp 0.8s ease-out;
}

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

.avatar-container {
    margin-bottom: 24px;
    display: inline-block;
    animation: fadeInScale 1s ease-out 0.2s backwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-card);
    box-shadow: 0 0 30px rgba(99, 100, 255, 0.3),
                0 0 60px rgba(99, 100, 255, 0.1);
    animation: avatarGlow 3s ease-in-out infinite;
    transition: var(--transition);
}

@keyframes avatarGlow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(99, 100, 255, 0.3),
                    0 0 60px rgba(99, 100, 255, 0.1);
    }
    50% {
        box-shadow: 0 0 40px rgba(99, 100, 255, 0.5),
                    0 0 80px rgba(99, 100, 255, 0.2);
    }
}

.avatar:hover {
    transform: scale(1.05);
    border-color: rgba(99, 100, 255, 0.6);
}

.name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    animation: fadeInUp 0.8s ease-out 0.3s backwards;
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 16px;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.bio {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease-out 0.5s backwards;
}

/* ========================================
   LINKS SECTION
======================================== */
.links {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Glassmorphism card con backdrop filter */
.link-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 24px;
    
    text-decoration: none;
    color: var(--text-primary);
    
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    
    cursor: pointer;
    transition: var(--transition);
    
    box-shadow: var(--shadow-sm);
    
    /* Animazione stagger per ogni card */
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Stagger delay per ogni card */
.link-card:nth-child(1) { animation-delay: 0.6s; }
.link-card:nth-child(2) { animation-delay: 0.7s; }
.link-card:nth-child(3) { animation-delay: 0.8s; }
.link-card:nth-child(4) { animation-delay: 0.9s; }
.link-card:nth-child(5) { animation-delay: 1.0s; }
.link-card:nth-child(6) { animation-delay: 1.1s; }
.link-card:nth-child(7) { animation-delay: 1.2s; }

/* Hover effect avanzato */
.link-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Accent colors per categoria con glow effect */
.link-card[data-category="blog"]:hover {
    border-color: var(--accent-blog);
    box-shadow: 0 8px 24px rgba(255, 123, 0, 0.3);
}

.link-card[data-category="git"]:hover {
    border-color: var(--accent-git);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

.link-card[data-category="mastodon"]:hover {
    border-color: var(--accent-mastodon);
    box-shadow: 0 8px 24px rgba(99, 100, 255, 0.3);
}

.link-card[data-category="peertube"]:hover {
    border-color: var(--accent-peertube);
    box-shadow: 0 8px 24px rgba(241, 104, 13, 0.3);
}

.link-card[data-category="bluesky"]:hover {
    border-color: var(--accent-bluesky);
    box-shadow: 0 8px 24px rgba(17, 133, 254, 0.3);
}

.link-card[data-category="keyoxide"]:hover {
    border-color: var(--accent-keyoxide);
    box-shadow: 0 8px 24px rgba(80, 200, 120, 0.3);
}

.link-card[data-category="email"]:hover {
    border-color: var(--accent-email);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

/* ========================================
   ICONE
======================================== */
.link-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.link-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition);
}

/* Effetto hover su icona */
.link-card:hover .link-icon {
    transform: scale(1.1) rotate(5deg);
}

.link-card:hover .link-icon img {
    filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.3));
}

/* ========================================
   TESTO DELLE CARD
======================================== */
.link-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    transition: var(--transition);
}

.link-card:hover .link-name {
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.link-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    transition: var(--transition);
}

.link-card:hover .link-description {
    color: var(--text-primary);
}

/* ========================================
   FOOTER
======================================== */
.footer {
    text-align: center;
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.9rem;
    animation: fadeInUp 0.8s ease-out 1.3s backwards;
}

.footer-copyright {
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.footer-copyright strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.footer-details {
    margin-bottom: 12px;
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-details strong {
    color: var(--text-secondary);
}

.footer-details a {
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.footer-details a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.footer-links {
    font-size: 0.85rem;
    margin-top: 12px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
    padding: 0 8px;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 8px;
    right: 8px;
    height: 1px;
    background: var(--text-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-links a:hover::after {
    transform: scaleX(1);
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .container {
        padding: 40px 16px;
    }

    .name {
        font-size: 2rem;
    }

    .avatar {
        width: 100px;
        height: 100px;
    }

    .link-card {
        padding: 20px;
    }

    .link-icon {
        width: 56px;
        height: 56px;
    }

    .link-name {
        font-size: 1.3rem;
    }

    .link-description {
        font-size: 0.9rem;
    }

    .footer {
        font-size: 0.85rem;
        margin-top: 60px;
    }
    
    .footer-details {
        font-size: 0.8rem;
    }
    
    .footer-links {
        font-size: 0.8rem;
    }
    
    .footer-links a {
        padding: 0 4px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 600px;
    }
}

/* ========================================
   ACCESSIBILITY
======================================== */
/* Focus visible per tastiera */
.link-card:focus-visible {
    outline: 2px solid var(--accent-mastodon);
    outline-offset: 4px;
}

a:focus-visible {
    outline: 2px solid var(--accent-mastodon);
    outline-offset: 2px;
}

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

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .link-card {
        background: white;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .background-pattern {
        display: none;
    }
}

