/*
 * ████████████████████████████████████████████████████████████████████████████
 * █                                                                          █
 * █  OPEN SOURCE CODE                                                        █
 * █  Generated with Claude Code (Anthropic)                                 █
 * █  https://claude.com/claude-code                                         █
 * █                                                                          █
 * █  This code is open and free to use, modify, and distribute.             █
 * █  Created through an AI-assisted development conversation.               █
 * █                                                                          █
 * ████████████████████████████████████████████████████████████████████████████
 */

/* ============================================================================
   CSS CUSTOM PROPERTIES (Variables)
   ============================================================================ */
:root {
    /* Colors - Tech Palette */
    --color-primary: #ff8c00;
    --color-primary-light: #ffa500;
    --color-primary-bright: #ffb84d;
    --color-secondary: #00d4ff;
    --color-accent-cyan: rgba(0, 212, 255, 0.6);

    /* Background Colors */
    --color-bg-dark: #000000;
    --color-bg-darker: rgba(10, 10, 15, 0.3);
    --color-bg-modal: rgba(15, 20, 35, 0.92);
    --color-bg-modal-mid: rgba(20, 25, 40, 0.95);

    /* Text Colors */
    --color-text-primary: #e0e0e0;
    --color-text-secondary: #e8e8e8;
    --color-text-muted: #d0d0d0;

    /* Spacing Scale */
    --space-xs: clamp(8px, 1vh, 12px);
    --space-sm: clamp(12px, 2vh, 16px);
    --space-md: clamp(20px, 3vh, 28px);
    --space-lg: clamp(32px, 5vh, 48px);
    --space-xl: clamp(60px, 8vh, 100px);

    /* Font Sizes */
    --font-size-xs: clamp(0.75rem, 1.5vw, 0.85rem);
    --font-size-sm: clamp(0.85rem, 1.8vw, 0.98rem);
    --font-size-md: clamp(1rem, 2vw, 1.15rem);
    --font-size-lg: clamp(1.2rem, 2.5vw, 1.6rem);
    --font-size-xl: clamp(2rem, 5vw, 2.8rem);
    --font-size-2xl: clamp(2.5rem, 6vw, 4.5rem);

    /* Timing Functions */
    --timing-fast: 0.2s;
    --timing-normal: 0.3s;
    --timing-slow: 0.5s;
    --easing-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --easing-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    /* Effects */
    --blur-light: 10px;
    --blur-medium: 20px;
    --blur-heavy: 60px;
    --glow-sm: 0 0 10px;
    --glow-md: 0 0 20px;
    --glow-lg: 0 0 40px;

    /* Border Radius */
    --radius-sm: 16px;
    --radius-md: 20px;
    --radius-lg: 24px;
    --radius-full: 50%;

    /* Z-Index Scale */
    --z-base: 1;
    --z-elevated: 10;
    --z-modal: 100;
    --z-modal-content: 99999;
    --z-scanline: 99998;
    --z-overlay: 100000;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

*:focus-visible {
    outline: 2px solid rgba(255, 140, 0, 0.5);
    outline-offset: 2px;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    background: var(--color-bg-dark);
    color: var(--color-text-primary);
    font-family: 'Raleway', sans-serif;
    height: 100vh;
    overflow: hidden;
    position: relative;
    line-height: 1.6;
}

/* Radial gradient overlay for depth */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(15, 15, 15, 0.6) 100%);
    pointer-events: none;
    z-index: var(--z-base);
}

/* ============================================================================
   LAYOUT - Main Container & Content
   ============================================================================ */
.container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.content {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 60px 80px 40px;
    background: var(--color-bg-darker);
    backdrop-filter: blur(var(--blur-medium));
    border-left: 1px solid rgba(255, 140, 0, 0.1);
    animation: slideInRight 1s ease-out;
    overflow-y: auto;
    pointer-events: auto;
    order: 2;
    position: relative;
}

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */
h1 {
    font-family: "Bitcount Prop Single", system-ui;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-optical-sizing: auto;
    font-weight: 500;
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 50%, var(--color-primary-bright) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    animation: shimmer 3s infinite;
    line-height: 1.1;
    text-align: left;
    text-shadow: var(--glow-sm) rgba(255, 140, 0, 0.3);
    filter: drop-shadow(var(--glow-sm) rgba(255, 140, 0, 0.3));
}

.bio {
    width: 100%;
    margin-bottom: clamp(20px, 3vh, 32px);
    animation: fadeIn 1.5s ease-out 0.5s both;
}

.bio p {
    font-family: "Bitcount Prop Single", system-ui;
    font-optical-sizing: auto;
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    color: var(--color-text-primary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
    font-weight: 400;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.bio p .typewriter {
    display: inline;
    border-right: 2px solid var(--color-primary);
    animation: blink 0.7s step-end infinite;
}

.bio p:last-child {
    margin-bottom: 0;
}

.bio p strong {
    color: var(--color-primary-light);
    font-weight: 600;
    text-shadow: 0 0 15px rgba(255, 140, 0, 0.4);
}

/* ============================================================================
   VIEW SYSTEM - Bio & Skill Views Toggle
   ============================================================================ */
.bio-view,
.skill-view {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 80px 60px 80px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bio-view.active,
.skill-view.active {
    opacity: 1;
    visibility: visible;
}

.skill-view {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Back Button */
.back-to-bio {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-family: 'Bitcount Prop Single', monospace;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
    align-self: flex-start;
}

.back-to-bio:hover {
    background: var(--color-primary);
    color: #000;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.6);
    transform: translateX(-5px);
}

.back-to-bio svg {
    width: 16px;
    height: 16px;
}

/* Skill View Content */
.skill-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    filter: drop-shadow(0 0 20px var(--color-primary));
}

.skill-icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--color-primary);
}

.skill-title {
    font-family: 'Bitcount Prop Single', monospace;
    font-size: 2rem;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.8);
}

.skill-description {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    max-height: 40vh;
    overflow-y: auto;
}

.skill-tag {
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.2);
}

.skill-tag:hover {
    background: rgba(255, 107, 53, 0.2);
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.4);
}

/* Particles Container - Left Column */
.particles-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 1.5s ease-out 0.3s both;
    pointer-events: auto;
    order: 1;
}

#particles-canvas {
    width: 100%;
    height: 100%;
    cursor: grab;
}

#particles-canvas:active {
    cursor: grabbing;
}

/* Privacy Policy Footer */
.privacy-footer {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    animation: fadeIn 2s ease-out 1.2s both;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 0;
    pointer-events: auto;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.privacy-footer a,
.privacy-footer a.iubenda-black,
.privacy-footer a.iubenda-noiframe,
.privacy-footer a.iubenda-embed {
    font-family: "Bitcount Prop Single", system-ui !important;
    font-optical-sizing: auto !important;
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none !important;
    font-size: 0.85rem !important;
    font-weight: 300 !important;
    transition: all 0.3s ease !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    text-shadow: none !important;
}

.privacy-footer a:hover,
.privacy-footer a.iubenda-black:hover,
.privacy-footer a.iubenda-noiframe:hover,
.privacy-footer a.iubenda-embed:hover {
    color: rgba(255, 255, 255, 1) !important;
    background: none !important;
}

.privacy-footer .separator {
    font-family: "Bitcount Prop Single", system-ui;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    font-weight: 300;
    user-select: none;
}

.ai-badge {
    font-family: "Bitcount Prop Single", system-ui;
    font-optical-sizing: auto;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* Social Media Links */
.social-links {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    animation: fadeIn 2s ease-out 1.2s both;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(30, 30, 40, 0.8);
    border: 1px solid rgba(255, 140, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff8c00;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.social-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.social-icon:hover::before {
    opacity: 1;
}

.social-icon:hover {
    background: rgba(40, 40, 50, 0.9);
    border-color: rgba(255, 140, 0, 0.6);
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 8px 24px rgba(255, 140, 0, 0.4);
    color: #ffa500;
}

.social-icon svg {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.social-icon:hover svg {
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    .content {
        flex: none;
        width: 100%;
        padding: 80px 30px 40px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 140, 0, 0.1);
        min-height: auto;
    }

    .particles-container {
        flex: none;
        min-height: 60vh;
        height: auto;
    }

    h1 {
        font-size: clamp(1.5rem, 6vw, 2rem);
        letter-spacing: 0.5px;
        margin-bottom: clamp(24px, 3vh, 36px);
    }

    .bio {
        max-width: 100%;
        margin-bottom: clamp(36px, 5vh, 48px);
    }

    .bio p {
        font-size: clamp(0.95rem, 3vw, 1.05rem);
        margin-bottom: 14px;
    }

    .privacy-footer {
        bottom: 16px;
        left: 16px;
    }

    .privacy-footer a,
    .privacy-footer a.iubenda-black,
    .privacy-footer a.iubenda-noiframe,
    .privacy-footer a.iubenda-embed {
        font-size: 0.75rem !important;
    }

    .privacy-footer .separator {
        font-size: 0.75rem;
    }

    .ai-badge {
        font-size: 0.6rem;
    }

    .skill-tag {
        font-size: clamp(0.9rem, 1.8vw, 1rem);
        padding: clamp(6px, 1.3vw, 8px) clamp(12px, 2.2vw, 15px);
    }

    /* View System - Mobile */
    .bio-view,
    .skill-view {
        padding: 80px 30px 40px;
    }

    .skill-title {
        font-size: 1.5rem;
    }

    .skill-icon {
        width: 60px;
        height: 60px;
    }

    .back-to-bio {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        flex-direction: column;
        min-height: 100vh;
        overflow-y: auto;
    }

    .content {
        flex: none;
        width: 100%;
        padding: 70px 20px 30px;
        border-bottom: 1px solid rgba(255, 140, 0, 0.1);
    }

    .particles-container {
        flex: none;
        min-height: 50vh;
    }

    h1 {
        margin-bottom: clamp(20px, 2.5vh, 28px);
        font-size: clamp(1.3rem, 7vw, 1.8rem);
        letter-spacing: 0.5px;
    }

    .bio {
        margin-bottom: clamp(24px, 3vh, 36px);
    }

    .privacy-footer {
        bottom: 12px;
        left: 12px;
    }

    .privacy-footer a,
    .privacy-footer a.iubenda-black,
    .privacy-footer a.iubenda-noiframe,
    .privacy-footer a.iubenda-embed {
        font-size: 0.7rem !important;
    }

    .privacy-footer .separator {
        font-size: 0.7rem;
    }

    .ai-badge {
        font-size: 0.55rem;
    }

    .bio {
        margin-bottom: clamp(28px, 4vh, 36px);
    }

    .bio p {
        font-size: clamp(0.9rem, 3.5vw, 1rem);
        margin-bottom: 12px;
        line-height: 1.7;
    }

    .social-links {
        bottom: 16px;
        right: 16px;
        gap: 10px;
        flex-direction: row;
    }

    .social-icon {
        width: 44px;
        height: 44px;
    }

    .social-icon svg {
        width: 20px;
        height: 20px;
    }

    .privacy-footer {
        bottom: 12px;
        gap: 8px;
        padding: 0;
        flex-wrap: wrap;
        max-width: calc(100% - 32px);
    }

    .privacy-footer a,
    .privacy-footer a.iubenda-black,
    .privacy-footer a.iubenda-noiframe,
    .privacy-footer a.iubenda-embed {
        font-size: 0.7rem !important;
    }

    .privacy-footer .separator {
        font-size: 0.7rem;
    }
}

/* Extra small devices (iPhone SE, small phones) */
@media (max-width: 375px) {
    .container {
        padding: 0;
    }

    .content {
        padding: 60px 20px 40px;
        min-height: auto;
    }

    h1 {
        font-size: clamp(1.2rem, 8vw, 1.5rem);
        margin-bottom: clamp(16px, 2vh, 24px);
    }

    .bio {
        margin-bottom: clamp(20px, 3vh, 28px);
    }

    .bio p {
        font-size: clamp(0.85rem, 3.8vw, 0.95rem);
        line-height: 1.65;
    }

    .social-links {
        bottom: 12px;
        right: 12px;
        gap: 8px;
    }

    .social-icon {
        width: 40px;
        height: 40px;
    }

    .social-icon svg {
        width: 18px;
        height: 18px;
    }

    .privacy-footer {
        bottom: 8px;
        left: 8px;
        max-width: calc(100% - 100px);
    }

    .footer-links {
        gap: 8px;
        flex-wrap: wrap;
    }

    .privacy-footer a,
    .privacy-footer a.iubenda-black,
    .privacy-footer a.iubenda-noiframe,
    .privacy-footer a.iubenda-embed {
        font-size: 0.65rem !important;
    }

    .privacy-footer .separator {
        font-size: 0.65rem;
        display: none;
    }

    .ai-badge {
        font-size: 0.5rem;
        width: 100%;
    }

    .skill-tag {
        font-size: clamp(0.8rem, 2.2vw, 0.9rem);
        padding: clamp(6px, 1.2vw, 7px) clamp(12px, 2.2vw, 14px);
    }

    /* Responsive adjustments for skill view */
    .bio-view,
    .skill-view {
        padding: 60px 20px 40px;
    }

    .skill-icon {
        width: 50px;
        height: 50px;
    }

    .skill-title {
        font-size: 1.3rem;
    }

    .skill-description {
        font-size: 0.95rem;
    }
}

/* Landscape mode on mobile devices */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding: 20px 30px 20px;
        height: auto;
        min-height: 100vh;
    }

    .content {
        padding: 0 16px;
    }

    h1 {
        font-size: clamp(1.5rem, 4vh, 2rem);
        margin-bottom: 16px;
    }

    .bio {
        margin-bottom: 20px;
    }

    .bio p {
        font-size: clamp(0.9rem, 2.5vh, 1.05rem);
        line-height: 1.5;
        margin-bottom: 12px;
    }

    .particles-container {
        height: clamp(250px, 60vh, 400px);
        margin-bottom: 20px;
    }

    .social-links {
        bottom: 12px;
        right: 12px;
        flex-direction: row;
        gap: 12px;
    }

    .social-icon {
        width: 40px;
        height: 40px;
    }

    .privacy-footer {
        bottom: 12px;
        left: 12px;
    }

    .privacy-footer a,
    .privacy-footer a.iubenda-black,
    .privacy-footer a.iubenda-noiframe,
    .privacy-footer a.iubenda-embed {
        font-size: 0.7rem !important;
    }

    .ai-badge {
        font-size: 0.55rem;
    }

    .skill-tag {
        font-size: clamp(0.8rem, 2vh, 0.9rem);
        padding: 6px 12px;
    }

    /* Responsive adjustments for skill view */
    .bio-view,
    .skill-view {
        justify-content: flex-start;
        padding: 40px 16px 16px;
    }

    .back-to-bio {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }

    .skill-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 1rem;
    }

    .skill-title {
        font-size: 1.4rem;
    }

    .skill-tags {
        gap: 0.5rem;
        max-height: 35vh;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .social-icon:hover {
        transform: translateY(-2px) scale(1.05);
    }

    /* Disable hover effects on touch devices for skill tags */
    .skill-tag:hover {
        transform: none;
        box-shadow: none;
    }
}

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

/* Iubenda Cookie Banner & Badge Adjustments */
/* Banner principale */
#iubenda-cs-banner,
.iubenda-cs-container,
.iubenda-banner-content {
    z-index: 9999 !important;
    pointer-events: auto !important;
}

/* Tutti i badge/icone iubenda - selettori catch-all */
[id*="iubenda"],
[class*="iubenda"],
.iubenda-cs-opt-in-button,
.iubenda-cs-rat-btn,
.iubenda-ibadge,
div[style*="iubenda"] {
    pointer-events: auto !important;
}

/* Sposta badge in basso a destra sopra i social */
[id*="iubenda-cs-badge"],
[class*="iubenda"][class*="badge"],
.iubenda-cs-opt-in-button,
.iubenda-cs-rat-btn,
.iubenda-ibadge {
    bottom: 120px !important;
    right: 20px !important;
    opacity: 0.85 !important;
    transition: all 0.3s ease !important;
}

[id*="iubenda-cs-badge"]:hover,
[class*="iubenda"][class*="badge"]:hover,
.iubenda-cs-opt-in-button:hover,
.iubenda-cs-rat-btn:hover,
.iubenda-ibadge:hover {
    opacity: 1 !important;
    transform: scale(1.05) !important;
}

/* Mobile */
@media (max-width: 768px) {
    [id*="iubenda-cs-badge"],
    [class*="iubenda"][class*="badge"],
    .iubenda-cs-opt-in-button,
    .iubenda-cs-rat-btn,
    .iubenda-ibadge {
        bottom: 130px !important;
        right: 16px !important;
        transform: scale(0.9) !important;
    }
}

/* Mobile piccolo - sposta in alto */
@media (max-width: 480px) {
    [id*="iubenda-cs-badge"],
    [class*="iubenda"][class*="badge"],
    .iubenda-cs-opt-in-button,
    .iubenda-cs-rat-btn,
    .iubenda-ibadge {
        bottom: auto !important;
        top: 80px !important;
        right: 16px !important;
        left: auto !important;
        transform: scale(0.85) !important;
    }
}
