/* Executive Minimal - Corporate / MBB-ready */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Executive palette */
    --bg-page: #F5F5F3;
    --bg-card: #FFFFFF;
    --bg-elevated: #FAFAF9;

    --text-primary: #111111;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;

    --border-light: rgba(0, 0, 0, 0.08);
    --border-medium: rgba(0, 0, 0, 0.12);

    --accent: #111111;
    --accent-hover: #000000;

    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);

    --radius: 4px;
    --radius-sm: 2px;

    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 40px;
    --space-5: 64px;
    --space-6: 96px;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --dur: 0.18s;

    --max-width: 1160px;

    /* Legacy mapping */
    --text-0: var(--text-primary);
    --text-1: var(--text-secondary);
    --text-2: var(--text-muted);
    --bg-0: var(--bg-page);
    --bg-1: var(--bg-card);
    --bg-2: var(--bg-elevated);
    --border-0: var(--border-light);
    --border-1: var(--border-medium);
    --lines: var(--border-light);
    --radius-1: var(--radius);
    --radius-2: var(--radius);
    --radius-3: var(--radius);
    --shadow-1: var(--shadow-subtle);
    --shadow-2: var(--shadow-card);
    --spacing-xl: var(--space-6);
    --spacing-lg: var(--space-5);
    --spacing-md: var(--space-4);
    --spacing-sm: var(--space-3);
    --spacing-xl-mobile: 48px;
    --spacing-lg-mobile: 32px;
    --spacing-md-mobile: 20px;
    --spacing-sm-mobile: 16px;
    --dur-1: var(--dur);
    --dur-2: 0.2s;
    --ease-1: var(--ease);
    --transition-smooth: all var(--dur) var(--ease);
    --transition-fast: all var(--dur) var(--ease);
    --transition-text-color: color var(--dur) var(--ease);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    color-scheme: light;
}

/* Smooth scroll con offset per header fisso */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
    font-size: 14px;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    line-height: 1.2;
    font-weight: 700;
}

p {
    line-height: 1.7;
}

a,
button,
input,
textarea,
select {
    font: inherit;
}

:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 2px;
}

/* Desktop font size */
@media (min-width: 769px) {
    body {
        font-size: 16px;
        line-height: 1.7;
    }
}

/* Background image space theme - disabilitato per Executive Minimal */
/* body::before { background-image: url('/static/images/bgd.jpg'); ... } */

/* ========== Immagini corporate (hero + sezioni) ========== */
.hero-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    background: var(--bg-page);
    pointer-events: none;
}

.hero-bg-img picture,
.hero-bg-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.hero-bg-img img {
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    object-position: top center;
}

@media (max-width: 768px) {
    .hero-bg-img {
        width: 100vw;
        height: 100%;
        min-height: 100%;
    }
    .hero-bg-img img {
        width: 100%;
        height: 100%;
        min-height: 0;
        object-fit: contain;
        object-position: top center;
    }
}

.hero-video-overlay.hero-overlay,
.hero-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 245, 243, 0.72);
    z-index: 1;
    pointer-events: none;
    display: none;
}

/* Sfondo sezioni con immagine corporate */
.section-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: var(--bg-page);
}

.section-bg-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    min-width: 100%;
    min-height: 100%;
}

.section-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 245, 243, 0.88);
    z-index: 1;
    pointer-events: none;
    display: none;
}

/* Velo bianco su immagini corporate (tutte tranne Hero) */
.section-bg-img::after,
.project-page-bg-img::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(255, 255, 255, 0.58);
    pointer-events: none;
}

/* Fallback: se manca un'immagine corporate, usa bianco pieno */
.no-corporate-bg {
    background: #fff !important;
}

.no-corporate-bg .hero-bg-img,
.no-corporate-bg .section-bg-img,
.no-corporate-bg .project-page-bg-img {
    display: none !important;
}

.no-corporate-bg .hero-video-overlay,
.no-corporate-bg .section-overlay {
    display: none;
}

/* Desktop/Laptop: immagini corporate a tutta larghezza e altezza coerente tra sezioni */
@media (min-width: 769px) {
    :root {
        --corporate-section-min-height: 560px;
    }

    .hero-bg-img,
    .section-bg-img {
        width: 100vw;
        left: 50%;
        transform: translateX(-50%);
    }

    .hero,
    .pathway,
    .skills,
    .value-proposition,
    .projects,
    .contact {
        width: 100vw;
        max-width: none;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }

    .hero,
    .pathway,
    .skills,
    .value-proposition,
    .projects,
    .contact {
        min-height: var(--corporate-section-min-height);
    }

    .hero-content {
        max-width: var(--max-width);
        margin-left: auto;
        margin-right: auto;
    }

    .pathway h2,
    .pathway-container,
    .skills h2,
    .skills-grid,
    .value-proposition h2,
    .value-grid,
    .projects h2,
    .projects-grid,
    .contact h2,
    .contact .intro,
    .contact-buttons,
    .contact-form {
        max-width: var(--max-width);
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    .section-bg-img img {
        min-height: 100%;
        object-position: center;
    }
}

/* Header - Executive Minimal */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.20);
    border-bottom: 1px solid var(--border-light);
    padding: 14px 0;
    transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    box-shadow: var(--shadow-subtle);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

@media (max-width: 768px) {
    header {
        background: rgba(255, 255, 255, 0.86);
        box-shadow: var(--shadow-subtle);
    }
}

@media (min-width: 769px) {
    header {
        padding: var(--spacing-sm) 0;
    }
}

header::before {
    display: none;
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 16px;
    }
}

@media (min-width: 769px) {
    .header-container {
        padding: 0 var(--spacing-md);
    }
}

.logo {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: var(--transition-text-color);
    padding: 8px 0;
    display: inline-block;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 769px) {
    .logo {
        font-size: 16px;
    }
}

.logo:hover {
    color: var(--text-secondary);
}

nav {
    display: flex;
    gap: var(--spacing-md);
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.3px;
    transition: var(--transition-text-color), transform var(--dur-1) var(--ease-1);
    position: relative;
    padding: 8px 0;
    display: inline-block;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 769px) {
    nav a {
        padding: 0;
    }
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--dur) var(--ease);
}

nav a:hover {
    color: var(--text-primary);
}

nav a:hover::after {
    width: 100%;
}

/* Mobile Menu Toggle (Hamburger) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-smooth);
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

.mobile-menu-toggle:hover span,
.mobile-menu-toggle:focus span {
    background: var(--text-1);
}

/* Menu mobile aperto - previeni scroll body */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Main Container */
main {
    margin-top: 70px;
    position: relative;
    z-index: 1;
}

@media (min-width: 769px) {
    main {
        margin-top: 80px;
    }
}

/* Sezione HERO */
.hero {
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xl) var(--spacing-md);
    position: relative;
    width: 100%;
    margin: 0;
    padding-top: 0;
    overflow: hidden;
    background: var(--bg-page);
}

@media (max-width: 768px) {
    .hero {
        height: auto;
        min-height: calc(100vh - 70px);
        padding: 0;
        margin: 0;
        margin-top: 0;
        padding-top: 0;
        overflow: hidden;
        width: 100vw;
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: var(--max-width);
    padding: var(--spacing-lg) var(--spacing-md);
    background: transparent;
}

@media (max-width: 768px) {
    .hero-content {
        width: 100%;
        height: 100%;
        padding: 20px 16px;
        padding-top: 0;
        background: transparent;
    }
}


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

.hero-content h1 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: clamp(32px, 4.5vw, 56px);
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
    color: var(--text-primary);
    animation: fadeInUp 0.2s ease 0.05s both;
    max-width: 800px;
    position: relative;
    z-index: 3;
    padding: 0 var(--spacing-sm);
    margin-top: 0;
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: clamp(24px, 7vw, 32px);
        margin-bottom: 8px;
        padding: 0 12px;
    }
}

.hero-content .subtitle {
    font-size: clamp(13px, 1.2vw, 15px);
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.6;
    animation: fadeInUp 0.2s ease 0.1s both;
    max-width: 640px;
    margin-top: var(--spacing-sm);
    position: relative;
    z-index: 3;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    display: inline-block;
    box-shadow: none;
    transition: color var(--dur) var(--ease);
}

.hero-content .subtitle:hover {
    color: var(--text-primary);
}

.hero-cta {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    align-items: center;
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
    animation: fadeInUp 0.2s ease 0.15s both;
}

.primary-cta,
.secondary-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.primary-cta {
    background: var(--text-primary);
    color: var(--bg-card);
    border: 1px solid var(--text-primary);
}

.primary-cta:hover {
    background: var(--text-secondary);
    border-color: var(--text-secondary);
}

.secondary-cta {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.secondary-cta:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .hero-content .subtitle {
        font-size: clamp(11px, 2.5vw, 13px);
        letter-spacing: 0.06em;
        margin-top: 8px;
    }

    .hero-cta {
        gap: 10px;
        margin-top: 12px;
    }

    .primary-cta,
    .secondary-cta {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Sezione ABOUT - Executive Minimal */
.about {
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background: var(--bg-page);
}

@media (max-width: 768px) {
    .about {
        padding: var(--spacing-xl-mobile) var(--spacing-sm-mobile);
    }
}

.about::before {
    display: none;
}

.about-galaxy-bg {
    display: none;
}

@media (min-width: 769px) {
    /* About: sfondo full-bleed, contenuto invariato */
    .about::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 100vw;
        transform: translateX(-50%);
        background: var(--bg-page);
        z-index: -1;
        pointer-events: none;
    }
}

.about h2 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: clamp(24px, 2.5vw, 28px);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.02em;
    position: relative;
    z-index: 2;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .about h2 {
        font-size: 22px;
        margin-bottom: var(--spacing-lg-mobile);
    }
}

.about-content {
    text-align: center;
    position: relative;
    z-index: 2;
    display: block;
    gap: var(--spacing-sm);
    width: 100%;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
}

.about-image-wrapper {
    margin-bottom: var(--spacing-md);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

@media (max-width: 768px) {
    .about-image-wrapper {
        margin-bottom: var(--spacing-lg-mobile);
    }
}

.about-image {
    width: 240px;
    height: 240px;
    max-width: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--dur) var(--ease);
}

@media (max-width: 768px) {
    .about-image {
        width: 180px;
        height: 180px;
        max-width: min(180px, 100%);
    }
}

.about-image:hover {
    box-shadow: var(--shadow-subtle);
}

.about-content > p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .about-content > p {
        font-size: 13px;
        line-height: 1.55;
        margin-bottom: 0;
    }
}

.highlight-keyword {
    color: var(--text-primary);
    font-weight: 600;
    display: inline;
    white-space: normal;
    border-bottom: 1px solid var(--accent);
    transition: color var(--dur) var(--ease);
}

.highlight-keyword:hover {
    color: var(--accent-hover);
}

.about-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    margin-top: var(--spacing-md);
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
    align-items: center;
    text-align: center;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

@media (max-width: 768px) {
    .about-info {
        gap: var(--spacing-sm-mobile);
        margin-top: var(--spacing-md-mobile);
    }
}

.ai-agent-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: transparent;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius);
    border: 1px solid var(--border-medium);
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

@media (max-width: 768px) {
    .ai-agent-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

.ai-agent-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.ai-agent-subtext {
    color: var(--text-secondary);
    font-size: 13px;
    letter-spacing: 0.2px;
    line-height: 1.45;
    max-width: 520px;
    margin: 0;
    opacity: 0.85;
}

/* Sezione EDUCATION */
.education {
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    background: var(--bg-page);
}

.education::before {
    display: none;
}

.education h2 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: clamp(24px, 2.5vw, 28px);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.education-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    position: relative;
    z-index: 1;
}

/* Unified card system - Executive Minimal */
.education-item,
.experience-item,
.skills-category,
.value-card,
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-subtle);
    transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.education-item:hover,
.experience-item:hover,
.skills-category:hover,
.value-card:hover,
.project-card:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-card);
}

.education-item {
    padding: var(--spacing-sm);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.education-item h3 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.education-place {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.education-period {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.education-details {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
}

/* Sezione PERCORSO FORMATIVO */
.pathway {
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    background: var(--bg-page);
}

@media (max-width: 768px) {
    .pathway {
        padding: var(--spacing-xl-mobile) var(--spacing-sm-mobile);
    }
}

.pathway::before {
    display: none;
}

.pathway h2 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: clamp(24px, 2.5vw, 28px);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .pathway h2 {
        font-size: 22px;
        margin-bottom: var(--spacing-lg-mobile);
    }
}

.pathway-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .pathway-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg-mobile);
    }
}

.pathway-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

@media (max-width: 768px) {
    .pathway-column {
        gap: var(--spacing-sm-mobile);
    }
}

.pathway-column-title {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    text-align: center;
}

@media (max-width: 768px) {
    .pathway-column-title {
        font-size: 17px;
        margin-bottom: var(--spacing-sm-mobile);
    }
}

.pathway-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

@media (max-width: 768px) {
    .pathway-list {
        gap: var(--spacing-sm-mobile);
    }
}

/* Sezione EXPERIENCE */
.experience {
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    background: var(--bg-page);
}

.experience::before {
    display: none;
}

.experience h2 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: clamp(24px, 2.5vw, 28px);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.experience-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.experience-item {
    padding: var(--spacing-sm);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.experience-item h3 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.experience-place {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.experience-link {
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--accent);
    transition: color var(--dur) var(--ease);
}

.experience-link:hover {
    color: var(--accent-hover);
}

.experience-period {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.experience-details {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
}

/* Sezione SKILLS */
.skills {
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background: var(--bg-page);
}

@media (max-width: 768px) {
    .skills {
        padding: var(--spacing-xl-mobile) var(--spacing-sm-mobile);
    }
}

.skills-video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.skills-video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0.15;
    filter: grayscale(1);
}

.skills-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-page);
    z-index: 1;
    opacity: 0.92;
}

.skills::before {
    display: none;
}

.skills h2 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: clamp(24px, 2.5vw, 28px);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.02em;
    position: relative;
    z-index: 3;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .skills h2 {
        font-size: 22px;
        margin-bottom: var(--spacing-lg-mobile);
    }
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    position: relative;
    z-index: 3;
}

@media (max-width: 768px) {
    .skills-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md-mobile);
    }
}

.skills-category {
    padding: var(--spacing-md);
    position: relative;
}

@media (max-width: 768px) {
    .skills-category {
        padding: var(--spacing-md-mobile);
    }
}

.skills-category h3 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .skills-category h3 {
        font-size: 16px;
        margin-bottom: var(--spacing-sm-mobile);
    }
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-weight: 400;
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
    background: var(--bg-elevated);
}

.skill-tag:hover {
    border-color: var(--border-medium);
    color: var(--text-primary);
}

/* Sezione VALUE PROPOSITION */
.value-proposition {
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    background: var(--bg-page);
}

@media (max-width: 768px) {
    .value-proposition {
        padding: var(--spacing-xl-mobile) var(--spacing-sm-mobile);
    }
}

.value-proposition::before {
    display: none;
}

.value-proposition h2 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: clamp(24px, 2.5vw, 28px);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .value-proposition h2 {
        font-size: 22px;
        margin-bottom: var(--spacing-lg-mobile);
    }
}

.value-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    position: relative;
    z-index: 1;
    max-width: 100%;
}

@media (max-width: 768px) {
    .value-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md-mobile);
        margin-top: var(--spacing-lg-mobile);
    }
}

.value-card {
    padding: var(--spacing-md);
    position: relative;
}

@media (max-width: 768px) {
    .value-card {
        padding: var(--spacing-md-mobile);
    }
}

.value-card h3 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.value-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 400;
}

/* Sezione PROJECTS */
.projects {
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    background: var(--bg-page);
}

@media (max-width: 768px) {
    .projects {
        padding: var(--spacing-xl-mobile) var(--spacing-sm-mobile);
        min-height: auto;
    }
}

.projects-video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.projects-video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0.12;
    filter: grayscale(1);
}

.projects-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-page);
    z-index: 1;
    opacity: 0.9;
}

.projects::before {
    display: none;
}

.projects h2 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: clamp(24px, 2.5vw, 28px);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.02em;
    position: relative;
    z-index: 2;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .projects h2 {
        font-size: 22px;
        margin-bottom: var(--spacing-lg-mobile);
    }
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    position: relative;
    z-index: 2;
    max-width: 100%;
}

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

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md-mobile);
        margin-top: var(--spacing-lg-mobile);
    }
}

.project-card {
    padding: var(--spacing-md);
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

@media (max-width: 768px) {
    .project-card {
        padding: var(--spacing-md-mobile);
    }
}

.project-card h3 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

@media (max-width: 768px) {
    .project-card h3 {
        font-size: 20px;
        margin-bottom: var(--spacing-sm-mobile);
    }
}

.project-card .description {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
    font-weight: 300;
}

.project-card .project-impact {
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

@media (max-width: 768px) {
    .project-card .description {
        font-size: 14px;
        margin-bottom: var(--spacing-sm-mobile);
    }

    .project-card .project-impact {
        font-size: 12px;
        margin-bottom: var(--spacing-sm-mobile);
    }
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: var(--spacing-sm);
}

.project-tag {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-weight: 400;
    background: var(--bg-elevated);
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.project-tag:hover {
    border-color: var(--border-medium);
    color: var(--text-primary);
}

/* Sezione CONTACT - Footer minimal */
.contact {
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
    position: relative;
    background: var(--bg-page);
}

@media (max-width: 768px) {
    .contact {
        padding: var(--spacing-xl-mobile) var(--spacing-sm-mobile);
    }
}

.contact::before {
    display: none;
}

.contact h2 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: clamp(24px, 2.5vw, 28px);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .contact h2 {
        font-size: 22px;
    }
}

/* Titoli sezione: box corporate rettangolare */
.about h2,
.pathway h2,
.skills h2,
.value-proposition h2,
.projects h2,
.contact h2 {
    display: inline-block;
    position: relative;
    z-index: 3;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 18px;
    border: 1px solid var(--border-medium);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* Contatti: evita doppio centraggio (text-align + left/transform) */
.contact h2 {
    left: auto;
    transform: none;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
}

@media (max-width: 768px) {
    .about h2,
    .pathway h2,
    .skills h2,
    .value-proposition h2,
    .projects h2,
    .contact h2 {
        padding: 8px 14px;
    }
}

.contact .intro {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.7;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .contact .intro {
        font-size: 15px;
        margin-bottom: var(--spacing-lg-mobile);
    }
}

.contact-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .contact-buttons {
        gap: var(--spacing-sm-mobile);
        margin-bottom: var(--spacing-lg-mobile);
    }
}

.contact-btn {
    padding: 14px;
    border: 1px solid var(--border-medium);
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
}

.contact-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.contact-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.contact-form {
    margin-top: var(--spacing-lg);
    margin-left: auto;
    margin-right: auto;
    max-width: 480px;
    text-align: left;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .contact-form {
        margin-top: var(--spacing-lg-mobile);
        max-width: 100%;
    }
}

.form-group {
    margin-bottom: var(--spacing-md);
}

@media (max-width: 768px) {
    .form-group {
        margin-bottom: var(--spacing-md-mobile);
    }
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 400;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    transition: border-color var(--dur) var(--ease);
    border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
    .form-group input,
    .form-group textarea {
        padding: 12px;
        font-size: 16px;
    }
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.15);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.submit-btn {
    padding: 12px 32px;
    border: 1px solid var(--text-primary);
    background: var(--text-primary);
    color: var(--bg-card);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
    font-family: 'Inter', sans-serif;
    border-radius: var(--radius);
}

@media (max-width: 768px) {
    .submit-btn {
        padding: 12px 24px;
        font-size: 13px;
        width: 100%;
    }
}

.submit-btn:hover {
    background: var(--text-secondary);
    border-color: var(--text-secondary);
    color: var(--bg-card);
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent);
    z-index: 10000;
    transition: width 0.15s ease-out;
}

/* Pagina Progetto Individuale */
.project-page {
    padding: calc(var(--spacing-xl) + 20px) var(--spacing-md) var(--spacing-xl);
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    scroll-behavior: smooth;
    background: var(--bg-page);
}

@media (max-width: 768px) {
    .project-page {
        padding: calc(var(--spacing-xl-mobile) + 20px) var(--spacing-sm-mobile) var(--spacing-xl-mobile);
    }
}

.project-page-bg-img {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
    background: var(--bg-page);
}

.project-page-bg-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    min-width: 100%;
    min-height: 100%;
    opacity: 0.15;
}

@media (max-width: 768px) {
    .project-page-bg-img img {
        min-height: 100vh;
        object-position: center;
    }
}

.project-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: auto 100%;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    transform: rotate(90deg);
    opacity: 0.4;
    z-index: -2;
    filter: blur(0.5px);
    display: none; /* Disabilitato, usiamo .project-page-bg invece */
}

.project-page::after {
    display: none;
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: calc(var(--spacing-xl) + 20px);
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(12px);
    animation: fadeInUp 0.2s ease 0.05s forwards;
    position: relative;
    z-index: 1;
    text-align: center;
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
}

.project-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex-shrink: 0;
}

.project-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1;
}

.project-logo {
    width: 280px;
    height: 280px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 24px;
    padding: 0;
    border: none;
    box-shadow: none;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.project-logo:hover {
    transform: translateY(-4px) scale(1.05);
}

.project-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 24px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}

.project-page h1 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    margin-bottom: 0;
    letter-spacing: -0.02em;
    flex: 1;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
    line-height: 1.2;
    text-align: center;
    width: 100%;
}

.project-title-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--border-medium);
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: var(--radius);
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
    margin-top: 0;
}

.project-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

@media (max-width: 768px) {
    .project-page::before {
        background-attachment: scroll;
        opacity: 0.3;
        transform: rotate(90deg);
        background-size: auto 100%;
    }
    
    .project-header {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .project-logo-wrapper {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .project-title-wrapper {
        width: 100%;
    }
    
    .project-logo {
        width: 220px;
        height: 220px;
        padding: 0;
        margin: 0 auto;
    }
    
    .project-page h1 {
        text-align: center;
        font-size: clamp(32px, 8vw, 48px);
        margin-bottom: var(--spacing-sm);
    }
    
    .project-link {
        font-size: 13px;
        padding: 8px 16px;
    }
    
    .project-section {
        padding: var(--spacing-md) var(--spacing-lg);
        margin-bottom: var(--spacing-md);
        border-radius: 16px;
    }
    
    .project-section:hover {
        transform: translateY(-2px);
    }
    
    .project-section h2 {
        font-size: clamp(22px, 6vw, 28px);
        margin-bottom: var(--spacing-md);
        padding-bottom: 12px;
    }
    
    .project-content {
        font-size: clamp(15px, 3vw, 17px);
        line-height: 1.8;
    }
    
    .project-tech {
        gap: 8px;
        margin-top: var(--spacing-sm);
        padding-top: var(--spacing-sm);
    }
    
    .project-tech .tag {
        font-size: 13px;
        padding: 10px 18px;
    }
    
    .project-page h1 {
        font-size: clamp(32px, 8vw, 48px);
    }
    
    .back-link {
        padding: 12px 20px;
        font-size: 14px;
        margin-bottom: var(--spacing-md);
    }
    
    .impact-item {
        padding: var(--spacing-md);
    }
}

.project-section {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg) var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-card);
    border-radius: var(--radius);
    position: relative;
    z-index: 1;
    transition: box-shadow var(--dur) var(--ease);
    opacity: 0;
    transform: translateY(12px);
    animation: fadeInUp 0.2s ease forwards;
    box-shadow: var(--shadow-subtle);
}

.project-section:nth-child(1) { animation-delay: 0.05s; }
.project-section:nth-child(2) { animation-delay: 0.1s; }
.project-section:nth-child(3) { animation-delay: 0.15s; }
.project-section:nth-child(4) { animation-delay: 0.2s; }
.project-section:nth-child(5) { animation-delay: 0.25s; }
.project-section:nth-child(6) { animation-delay: 0.3s; }

.project-section:hover {
    box-shadow: var(--shadow-card);
}

.project-section:last-child {
    border-bottom: none;
}

.project-section h2 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: clamp(20px, 2.5vw, 24px);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.3;
    position: relative;
    padding-bottom: 12px;
}

.project-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transition: width var(--dur) var(--ease);
}

.project-section:hover h2::after {
    width: 64px;
}

.project-section p {
    font-size: clamp(15px, 2vw, 18px);
    color: var(--text-secondary);
    line-height: 1.8;
    font-weight: 300;
    margin-bottom: var(--spacing-md);
}

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

.project-section p strong {
    color: var(--text-primary);
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    font-size: clamp(16px, 2.2vw, 19px);
}

.impact-item {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-elevated);
    border-radius: var(--radius);
    border-left: 3px solid var(--accent);
    transition: box-shadow var(--dur) var(--ease);
}

.impact-item:last-child {
    margin-bottom: 0;
}

.impact-item:hover {
    box-shadow: var(--shadow-subtle);
}

.impact-item strong {
    color: var(--text-primary);
    font-weight: 600;
    display: block;
    margin-bottom: 12px;
    font-size: clamp(16px, 2.2vw, 19px);
    letter-spacing: 0.2px;
}

.impact-item p,
.impact-item .project-content {
    margin-bottom: 0;
    color: var(--text-secondary);
    line-height: 1.8;
}

.project-content {
    white-space: pre-line;
    font-size: clamp(16px, 2.2vw, 19px);
    color: var(--text-secondary);
    line-height: 1.9;
    font-weight: 300;
    letter-spacing: 0.01em;
}

.project-content br {
    margin-bottom: 0.5em;
    display: block;
    content: "";
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid color-mix(in srgb, #D9D9E2 8%, transparent);
}

.project-tech .tag {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-weight: 500;
    background: var(--bg-elevated);
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.project-tech .tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.project-screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.project-screenshot {
    background: var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--dur) var(--ease);
    position: relative;
    cursor: pointer;
}

.project-screenshot:hover {
    box-shadow: var(--shadow-subtle);
}

.project-screenshot img {
    width: 100%;
    height: auto;
    display: block;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--spacing-lg);
    transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
    padding: 10px 0;
    border-radius: 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateX(-8px);
    animation: fadeInLeft 0.2s ease 0.05s forwards;
}

@keyframes fadeInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.back-link:hover {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --space-6: 80px;
        --space-5: 60px;
        --space-4: 24px;
        --space-3: 16px;
        --spacing-xl: var(--space-6);
        --spacing-lg: var(--space-5);
        --spacing-md: var(--space-4);
        --spacing-sm: var(--space-3);
    }

    /* Ottimizzazione hero e video su mobile */
    .hero {
        margin-top: 0;
        padding-top: 0;
        padding-bottom: var(--spacing-md);
        min-height: calc(100vh - 70px);
        overflow-x: hidden;
    }

    .hero-video-background {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 0;
        overflow: hidden;
        pointer-events: none;
    }

    .hero-video-background video {
        position: absolute;
        top: 50%;
        left: 50%;
        min-width: 100%;
        min-height: 100%;
        width: auto;
        height: auto;
        transform: translate(-50%, -50%);
        object-fit: cover;
        opacity: 1;
        max-width: none;
        max-height: none;
    }

    .hero-video-overlay {
        background: rgba(245, 245, 243, 0.82);
    }

    .hero-content h1 {
        font-size: clamp(28px, 8vw, 48px);
        margin-bottom: var(--spacing-sm);
        padding: 0 16px;
    }

    .hero-content .subtitle {
        font-size: clamp(11px, 2.5vw, 14px);
        letter-spacing: 0.06em;
        padding: 0;
        background: transparent;
        border: none;
    }

    .header-container {
        padding: 0 var(--spacing-sm);
        position: relative;
    }

    /* Mostra hamburger menu su mobile */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Header più compatto su mobile */
    header {
        padding: 10px 0;
    }

    /* Nav mobile - Executive Minimal */
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-card);
        flex-direction: column;
        padding: 100px var(--spacing-md) var(--spacing-md);
        gap: 0;
        transition: right 0.2s var(--ease);
        z-index: 1000;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
        border-left: 1px solid var(--border-light);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    nav.mobile-open {
        right: 0;
    }

    nav a {
        font-size: 15px;
        padding: 14px 0;
        min-height: 48px;
        border-bottom: 1px solid var(--border-light);
        width: 100%;
        display: flex;
        align-items: center;
        text-align: left;
        color: var(--text-primary);
    }

    nav a:last-child {
        border-bottom: none;
    }

    nav a:hover,
    nav a:focus {
        color: var(--accent);
    }

    nav.mobile-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.25);
        z-index: -1;
        opacity: 0;
        animation: fadeIn 0.2s ease forwards;
    }

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

    /* Logo già ottimizzato per mobile nel CSS base */

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .value-grid {
        grid-template-columns: 1fr;
    }

    .contact-buttons {
        flex-direction: row;
        justify-content: center;
    }

    .contact-btn {
        width: 48px;
        height: 48px;
        justify-content: center;
    }

    .contact-btn svg {
        width: 20px;
        height: 20px;
    }

    .about-image {
        width: 200px;
        height: 200px;
    }

    .about-info {
        justify-content: center;
        gap: var(--spacing-sm);
    }

    .ai-agent-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .pathway-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .pathway-column-title {
        font-size: 20px;
        margin-bottom: var(--spacing-sm);
    }

    .skills {
        overflow-x: visible;
    }

    .skills-grid {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: var(--spacing-sm);
        padding-bottom: var(--spacing-sm);
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .skills-grid::-webkit-scrollbar {
        height: 4px;
    }

    .skills-grid::-webkit-scrollbar-track {
        background: var(--border-light);
        border-radius: 2px;
    }

    .skills-grid::-webkit-scrollbar-thumb {
        background: var(--border-medium);
        border-radius: 2px;
    }

    .skills-grid::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }

    .skills-category {
        flex: 0 0 85%;
        min-width: 85%;
        max-width: 85%;
        scroll-snap-align: start;
    }

    .education-item,
    .experience-item {
        padding: var(--spacing-sm);
    }

    /* Ottimizzazione video Projects su mobile */
    .projects {
        min-height: auto;
    }

    .projects-video-background video {
        opacity: 0.75;
        filter: grayscale(15%) brightness(0.75) contrast(1.4) saturate(0.8);
    }

    .projects-video-overlay {
        background: linear-gradient(180deg, rgba(5, 5, 8, 0.7) 0%, rgba(5, 5, 8, 0.45) 55%, rgba(5, 5, 8, 0.75) 100%);
    }

    /* Ottimizzazione video Skills su mobile */
    .skills-video-background video {
        opacity: 0.75;
        filter: grayscale(15%) brightness(0.75) contrast(1.4) saturate(0.8);
    }

    .skills-video-overlay {
        background: linear-gradient(180deg, rgba(5, 5, 8, 0.7) 0%, rgba(5, 5, 8, 0.45) 55%, rgba(5, 5, 8, 0.75) 100%);
    }
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 100px;
    right: var(--spacing-md);
    z-index: 2000;
    max-width: 400px;
}

.flash-message {
    padding: 14px 20px;
    margin-bottom: var(--spacing-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    animation: slideInRight 0.2s ease-out;
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
}

.flash-message.success {
    border-left-color: var(--accent);
}

.flash-message.error {
    border-left-color: #b91c1c;
}

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

/* Utility Classes */
.fade-in {
    opacity: 0;
    animation: fadeInUp 0.4s ease-out both;
}

.section-divider {
    height: 1px;
    background: var(--lines);
    margin: var(--spacing-xl) 0;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* Final override desktop/laptop: sezioni con background full-bleed */
@media (min-width: 769px) {
    .hero,
    .about,
    .pathway,
    .skills,
    .value-proposition,
    .projects,
    .contact {
        width: 100vw;
        max-width: none;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }

    .hero-bg-img,
    .section-bg-img {
        width: 100vw;
        left: 50%;
        transform: translateX(-50%);
    }

    /* Hero desktop: mostra l'immagine interamente (senza crop) */
    .hero-bg-img img {
        object-fit: contain;
        object-position: center;
    }
}

/* Hero image-driven sizing: la sezione segue esattamente il file immagine */
.hero {
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
}

.hero-bg-img {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    transform: none !important;
    left: auto !important;
}

.hero-bg-img picture,
.hero-bg-img img {
    position: relative !important;
    inset: auto !important;
    display: block;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    object-fit: contain !important;
    object-position: top center !important;
}

.hero-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .hero {
        width: 100% !important;
        min-height: 0 !important;
    }
}

/* Project Page Redesign: corporate / premium */
.scroll-progress {
    height: 2px;
    background: var(--accent);
    opacity: 1;
}

.project-page {
    position: relative;
    padding: 0;
    max-width: none;
    margin: 0;
    background: transparent;
}

.no-corporate-bg.project-page {
    background: linear-gradient(180deg, #ececea 0%, #f7f7f5 52%, #fbfbfa 100%);
}

.project-page-bg-img {
    position: fixed;
    inset: 0;
    z-index: -3;
    height: 100vh;
}

.project-page-bg-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.7;
}

.project-bg-overlay {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(245, 245, 243, 0.12) 0%, rgba(245, 245, 243, 0.24) 34%, rgba(245, 245, 243, 0.42) 68%, rgba(245, 245, 243, 0.58) 100%);
    backdrop-filter: blur(0.8px);
}

.project-shell {
    position: relative;
    z-index: 1;
    width: min(var(--max-width), calc(100% - 48px));
    margin: 0 auto;
    padding: 28px 0 84px;
}

.project-hero {
    min-height: clamp(260px, 46vh, 430px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 14px;
}

.back-link {
    position: sticky;
    top: 14px;
    z-index: 25;
    align-self: flex-start;
    margin-bottom: 18px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-medium);
    background: rgba(255, 255, 255, 0.76);
    color: var(--text-primary);
    backdrop-filter: blur(5px);
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.92);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.project-header {
    width: 100%;
    justify-content: center;
    gap: clamp(18px, 3vw, 28px);
    padding: clamp(22px, 3vw, 34px);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    text-align: center;
    margin-bottom: 26px;
}

.project-logo {
    width: clamp(94px, 11vw, 132px);
    height: clamp(94px, 11vw, 132px);
    border-radius: 999px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(17, 17, 17, 0.08);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.project-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    filter: none;
}

.project-page h1 {
    color: var(--text-primary);
    font-size: clamp(2rem, 3vw, 2.8rem);
    letter-spacing: -0.03em;
    line-height: 1.08;
}

.project-subtitle {
    color: var(--text-secondary);
    margin: 2px 0 0;
    font-size: clamp(1rem, 1.45vw, 1.18rem);
    max-width: 70ch;
}

.project-meta {
    margin-top: 8px;
}

.project-link {
    border: 1px solid #0f0f0f;
    background: #0f0f0f;
    color: #ffffff;
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 600;
}

.project-link:hover {
    background: #2a2a2a;
    border-color: #2a2a2a;
    color: #ffffff;
}

.project-link:focus-visible,
.back-link:focus-visible,
.project-toc a:focus-visible {
    outline: 2px solid #111111;
    outline-offset: 2px;
}

.project-toc {
    position: sticky;
    top: 72px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(6px);
}

.project-toc a {
    text-decoration: none;
    color: #2f2f2f;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.project-toc a:hover {
    background: #1a1a1a;
    color: #ffffff;
}

.project-content-flow {
    display: grid;
    gap: clamp(16px, 2.2vw, 26px);
}

.project-section {
    margin: 0;
    padding: clamp(22px, 2.6vw, 34px);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 2px 12px rgba(17, 17, 17, 0.06);
    backdrop-filter: blur(4px);
}

.project-section:hover {
    box-shadow: 0 6px 18px rgba(17, 17, 17, 0.1);
}

.project-section h2 {
    font-size: clamp(1.25rem, 2.1vw, 1.6rem);
    margin-bottom: 14px;
    color: #161616;
}

.project-section h2::after {
    background: #191919;
}

.project-content {
    color: var(--text-secondary);
    line-height: 1.72;
    font-size: clamp(1rem, 1.45vw, 1.12rem);
    font-weight: 400;
}

.project-section-summary {
    border: 1px solid var(--border-medium);
    background: rgba(255, 255, 255, 0.8);
}

.project-impact .impact-item {
    background: rgba(255, 255, 255, 0.82);
    border-left: 3px solid var(--text-primary);
}

.project-tech {
    border-top: 1px solid rgba(20, 20, 20, 0.1);
    gap: 10px;
}

.project-tech .tag {
    border-radius: 6px;
    border: 1px solid rgba(20, 20, 20, 0.15);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: none;
    padding: 8px 12px;
}

.project-tech .tag:hover {
    color: var(--text-primary);
    border-color: var(--border-medium);
    background: rgba(255, 255, 255, 0.95);
}

.project-section-stack .project-tech .tag {
    background: rgba(250, 250, 249, 0.9);
    color: var(--text-muted);
    border-color: var(--border-light);
}

.project-screenshots {
    grid-template-columns: 1fr;
    gap: clamp(12px, 2vw, 20px);
}

.project-screenshot {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
}

.project-screenshot:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.project-screenshot img {
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

#sintesi,
#problema,
#soluzione,
#risultati,
#learnings,
#stack,
#screenshots {
    scroll-margin-top: 140px;
}

@media (min-width: 740px) {
    .project-screenshots {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1080px) {
    .project-screenshots {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .project-shell {
        width: min(1080px, calc(100% - 28px));
        padding-top: 18px;
    }

    .project-hero {
        min-height: clamp(220px, 42vh, 360px);
    }

    .project-toc {
        top: 62px;
        overflow-x: auto;
        flex-wrap: nowrap;
        white-space: nowrap;
        padding: 8px;
    }

    .project-header {
        margin-bottom: 18px;
    }
}

@media (max-width: 640px) {
    .project-bg-overlay {
        background: linear-gradient(180deg, rgba(245, 245, 243, 0.14) 0%, rgba(245, 245, 243, 0.3) 32%, rgba(245, 245, 243, 0.52) 64%, rgba(245, 245, 243, 0.68) 100%);
    }

    .project-header {
        align-items: flex-start;
        text-align: left;
        border-radius: 10px;
        padding: 20px 18px;
    }

    .project-logo-wrapper,
    .project-title-wrapper {
        justify-content: flex-start;
        align-items: flex-start;
    }

    .project-page h1 {
        text-align: left;
        font-size: clamp(1.7rem, 7.4vw, 2.3rem);
    }

    .project-subtitle {
        text-align: left;
    }

    .back-link {
        top: 10px;
        font-size: 13px;
        padding: 8px 12px;
    }

    .project-section {
        border-radius: 8px;
        padding: 18px 16px;
    }
}
