:root {
    /* Fonts */
    --font-main: 'Ramabhadra', sans-serif;
    --font-secondary: 'Inter', sans-serif;

    /* Colors */
    --color-primary: #9F0909;
    --color-background: #E5E8E8;
    --color-background-card: #F7E7CE;
    --color-text: #1A1A1A;
}

* {
    background-color: transparent;
}

.mywork-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 22px;
    background:
        radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.16), transparent 45%),
        radial-gradient(circle at 80% 85%, rgba(255, 255, 255, 0.12), transparent 40%),
        rgba(8, 12, 24, 0.58);
    backdrop-filter: blur(12px);
    z-index: 9999;
}

.mywork-popup {
    border-radius: 20px;
    padding: 44px 34px 28px;
    width: min(840px, 92vw) !important;
    max-height: calc(88vh - 70px);
    height: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 40px 120px rgb(255 255 255 / 40%), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mywork-close {
    position: fixed;
    top: max(28px, calc(6vh + 12px));
    right: max(16px, calc(50% - 420px + 16px));
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    line-height: 1;
    color: rgba(15, 23, 42, 0.86);
    cursor: pointer;
    z-index: 20;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}

.mywork-close:hover {
    background: rgba(255, 255, 255, 0.82);
    transform: translateY(-1px) scale(1.03);
}

.studio, .lavoro {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 24px;
}

.studio .subtitle, .lavoro .subtitle {
    font-family: var(--font-secondary);
    font-size: 20px;
    color: var(--color-primary);
    margin: 5px 0 12px;
    padding: 0;
    display: block;
    border: none;
    background: transparent;
    text-align: left;
}

.studio .uni {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: clamp(20px, 5vw, 70px);
    margin-left: 0;
    flex-wrap: wrap;
    align-items: center;
}

.studio .uni .uni_image {
    width: clamp(140px, 22vw, 200px);
    height: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: none;
}

.lavoro {
    display: flex;
    width: 100%;
    flex-direction: column;
}

.esperienze {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.esperienze + .esperienze {
    margin-top: 12px;
}

.exp{
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 14px 28px;
    align-items: center;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.exp .logo_azienda {
    width: clamp(180px, 40vw, 320px);
    height: auto;
}

.exp .google_maps {
    width: 50px !important;
    height: 50px !important;
    transform: rotate(-20deg);
}

.location {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.dove{
    margin: 0 !important;
    font-size: 14px;
    color: var(--color-text);
    font-weight: 600;
}

.ruolo{
    line-height: 20px;
    font-size: 12px;
    color: inherit;
    text-align: left;
}

.ruolo .quando{
    color: #656565;
}

/* Slider orizzontale per aziende e competenze */
.other_exp {
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 12px 22px;
}
.other_exp.slider {
    overflow: hidden;
    width: 100%;
    margin: 0 0 10px;
    position: relative;
    height: 74px;
    border-radius: 0;
    background: transparent;
    border: none;
}
.slider-track {
    display: flex;
    width: max-content;
    animation: scroll-horizontal 28s linear infinite;
    gap: 32px;
    align-items: center;
    will-change: transform;
    backface-visibility: hidden;
}
@keyframes scroll-horizontal {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(calc(-50% - 16px), 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .slider-track {
        animation: none;
    }
}

.other_exp img {
    margin-top: 0;
    height: 30px;
    width: auto;
}

.btn_mywork {
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: min(280px, 100%);
    min-height: 54px;
    padding: 0 20px;
    background: linear-gradient(135deg, #b10f0f 0%, #9f0909 52%, #7b0606 100%);
    color: white;
    font-family: var(--font-secondary);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    border-radius: 999px;
    box-shadow: 0 12px 28px rgba(159, 9, 9, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.24);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, background 180ms ease;
    line-height: 1;
    position: relative;
}

.btn_mywork:hover,
.btn_mywork:focus-visible {
    transform: translateY(-2px);
    filter: saturate(1.08);
    box-shadow: 0 16px 34px rgba(159, 9, 9, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    background: linear-gradient(135deg, #c81212 0%, #a50a0a 52%, #860707 100%);
}

.btn_mywork:active {
    transform: translateY(0) scale(0.98);
}

.btn-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}

.btn-text {
    display: block;
    width: 100%;
    text-align: center;
    padding-left: 0;
}

.btn-icon svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.curriculum.btn_mywork {
    display: inline-flex;
    position: relative;
    margin: 0 auto;
    z-index: 100;
    justify-content: center;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 0 54px;
    box-sizing: border-box;
    line-height: 1;
}

.competenze {
    display: none;
}

.slider-track img {
    height: 50px;
    width: auto;
}

.slider-track{
    position: relative;
    z-index: 100;
}

/* ===================== */
/* REDESIGN              */
/* ===================== */

.mywork-popup {
    width: min(860px, 94vw) !important;
    max-height: 88vh;
    padding: 32px 36px 0;
    scrollbar-width: thin;
}

.studio .subtitle,
.lavoro .subtitle {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.studio .subtitle::after,
.lavoro .subtitle::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(159, 9, 9, 0.25), transparent);
}

.esperienze .exp {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: transform 0.35s var(--ease-out, ease), box-shadow 0.35s ease;
}

.esperienze .exp:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(60, 20, 20, 0.08);
}

/* stesso riquadro per tutti i loghi: le card hanno la stessa altezza */
.exp .logo_azienda {
    width: 240px;
    height: 56px;
    object-fit: contain;
    object-position: left center;
}

.exp-meta {
    display: flex;
    align-items: center;
    gap: 14px 24px;
    flex-wrap: wrap;
}

.exp .google_maps {
    width: 34px !important;
    height: 34px !important;
}

.ruolo {
    font-size: 13px;
}

.ruolo .quando {
    color: #5f5a57;
}

.ruolo .cosa {
    font-weight: 600;
    color: var(--color-text);
}

/* Aziende con cui ho collaborato: logo + link al sito */
.other_exp.clients {
    gap: 12px;
}

.client-link {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 56px;
    padding: 10px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.client-link img {
    height: 30px;
    width: auto;
}

.client-url {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
}

.client-url svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (hover: hover) {
    .client-link:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 26px rgba(60, 20, 20, 0.1);
    }
}

.client-link:focus-visible {
    outline: 3px solid rgba(159, 9, 9, 0.45);
    outline-offset: 3px;
}

.other_exp.slider {
    -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}

.mywork-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: center;
    margin: 0 -36px;
    padding: 10px 36px 20px;
    /* sfumatura leggera: separa appena il bottone dal contenuto che scorre sotto */
    background: linear-gradient(to top, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.2) 55%, rgba(255, 255, 255, 0) 100%);
    z-index: 5;
}

@media (max-width: 768px) {
    .modal-overlay .mywork-popup.modal-surface {
        padding-bottom: 0 !important;
    }

    .studio .uni .uni_image {
        width: clamp(120px, 38vw, 180px);
    }

    .esperienze .exp {
        flex-direction: column;
        align-items: flex-start;
    }

    .exp .logo_azienda {
        width: min(220px, 70vw);
        height: 48px;
    }

    .client-link {
        width: 100%;
        justify-content: space-between;
    }

    .client-link img { height: 24px; }
    .slider-track img { height: 40px; }

    .mywork-actions {
        margin: 0 -20px;
        padding: 10px 20px calc(14px + env(safe-area-inset-bottom));
    }

    .curriculum.btn_mywork {
        width: 100%;
    }
}
