.whoami-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.whoami-popup {
    position: relative;
    width: min(760px, 92vw);
    max-height: 88vh;
    padding: 58px 26px 24px;
    background: #300A24;
    border-radius: 12px;
    overflow: hidden;
    text-align: left;
    box-shadow:
        0 40px 90px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.06);
}

.ubuntu_bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    background-color: #3B3B3B;
    color: white;
}

.ubuntu_bar .name {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Ubuntu Mono", monospace;
    font-size: clamp(14px, 2.6vw, 18px) !important;
    font-weight: 400;
    color: #FFF;
}

.ubuntu_bar .buttons {
    position: absolute;
    top: 0;
    right: 10px;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ubuntu_bar .button {
    display: inline-flex;
    opacity: 0.8;
}

.whoami-close {
    width: 22px;
    height: 22px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #E95420;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
}

.whoami-close:hover {
    transform: scale(1.12);
    filter: brightness(1.1);
}

/* ---------- Testo del terminale ---------- */

.code_lines {
    width: 100%;
    max-height: calc(88vh - 96px);
    overflow: auto;
    padding-right: 6px;
    color: #E9E9E9;
    font-family: "Ubuntu Mono", monospace;
    font-size: clamp(15px, 1.35vw, 20px);
    line-height: 1.35;
    text-align: left;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.code_lines::-webkit-scrollbar { width: 8px; }

.code_lines::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.code_lines .tl {
    display: block;
    margin: 0;
    white-space: pre-wrap;
}

.code_lines p.tl { margin-top: 0.9em; }
.code_lines .gap { margin-top: 1em; }
.code_lines .indent { padding-left: 1.6em; }
.code_lines .indent-lg { padding-left: 4.5em; }
.code_lines .rule { color: rgba(233, 233, 233, 0.55); overflow: hidden; white-space: nowrap; }

.p-user { color: #8AE234; }
.p-sep  { color: #FFF; }
.p-path { color: #729FCF; }
.ok     { color: #8AE234; }

.cursor-blink {
    display: inline-block;
    width: 0.55em;
    height: 1.05em;
    margin-left: 6px;
    vertical-align: text-bottom;
    background: #E9E9E9;
    animation: cursorBlink 1s steps(1) infinite;
}

@keyframes cursorBlink {
    50% { opacity: 0; }
}

.term-continue {
    width: 100%;
    margin-top: 18px;
    padding: 12px 10px;
    border: 1px dashed rgba(233, 233, 233, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: #E9E9E9;
    font: inherit;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.term-continue:hover,
.term-continue:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(233, 233, 233, 0.55);
}

/* righe che compaiono una dopo l'altra, come digitate */
.whoami-overlay .tl {
    opacity: 0;
}

.whoami-overlay.is-open .tl {
    animation: termLine 0.42s steps(14, end) both;
    animation-delay: calc(0.5s + var(--l, 0) * 0.09s);
}

.whoami-overlay.is-open #part2 .tl {
    animation-delay: calc(0.1s + var(--l, 0) * 0.08s);
}

.whoami-overlay.is-closing .tl {
    opacity: 1;
}

@keyframes termLine {
    from { opacity: 1; clip-path: inset(0 100% 0 0); }
    to   { opacity: 1; clip-path: inset(0 0 0 0); }
}

/* ---------- Layout: foto + social a sinistra, terminale a destra ---------- */

.whoami-layout {
    display: flex;
    gap: 20px;
    align-items: stretch;
    width: min(1060px, 94vw);
    max-height: 88vh;
}

.whoami-side {
    position: relative;
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    box-sizing: border-box;
    border-radius: 20px;
    font-family: var(--font-secondary);
    overflow-y: auto;
}

.whoami-side .whoami-side-close {
    display: none;
}

.whoami-photo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 58% 22%;
    border-radius: 14px;
    background: #e9e4de;
}

.whoami-name {
    margin: 0;
    font-family: var(--font-main);
    font-size: 26px;
    line-height: 1.1;
    color: var(--color-primary);
}

.whoami-role {
    margin: 6px 0 0;
    font-size: 14px;
    color: #5f5a57;
}

.whoami-social {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    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);
    color: var(--color-text, #1A1A1A);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.social-btn img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.social-arrow {
    width: 16px;
    height: 16px;
    margin-left: auto;
    fill: none;
    stroke: #8a8380;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (hover: hover) {
    .social-btn:hover {
        transform: translateX(3px);
        box-shadow: 0 8px 20px rgba(26, 26, 26, 0.08);
    }

    .social-btn:hover .social-arrow { stroke: var(--color-primary); }
}

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

.whoami-layout .whoami-popup {
    box-sizing: border-box;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-height: 88vh;
}

@media (max-width: 768px) {
    .whoami-layout {
        flex-direction: column;
        gap: 16px;
        width: 100%;
        max-height: 92dvh;
        padding: 30px 16px 0;
        overflow-y: auto;
        /* su mobile il pannello è il contenitore intero: stesso vetro delle altre popup */
        background:
            radial-gradient(120% 70% at 0% 0%, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 55%),
            linear-gradient(160deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.45) 100%);
        border: 1px solid rgba(255, 255, 255, 0.6);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 0 28px rgba(255, 255, 255, 0.25);
    }

    /* su mobile il vetro è già sul pannello: il banner non ha uno sfondo suo */
    .whoami-layout .whoami-side {
        flex: none;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 14px;
        padding: 0;
        border-radius: 0;
        background: none;
        border: 0;
        box-shadow: none;
        overflow: visible;
    }

    .whoami-side .whoami-side-close {
        display: flex;
        top: 0;
        right: 0;
    }

    .whoami-photo {
        width: 72px;
        height: 72px;
        aspect-ratio: 1;
        border-radius: 50%;
        object-position: 60% 20%;
    }

    .whoami-id {
        flex: 1;
        min-width: 0;
        padding-right: 52px;
    }

    .whoami-name { font-size: 22px; }
    .whoami-role { font-size: 13px; }

    .whoami-social {
        flex-direction: row;
        width: 100%;
        margin-top: 0;
    }

    .social-btn {
        flex: 1;
        justify-content: center;
        gap: 8px;
        padding: 0 8px;
        font-size: 13px;
    }

    .social-arrow { display: none; }

    .whoami-layout .whoami-popup {
        flex: none;
        max-height: none;
        padding: 56px 16px 20px;
        border-radius: 14px;
    }

    .ubuntu_bar {
        height: 44px;
        border-radius: 14px 14px 0 0;
    }

    .ubuntu_bar .name {
        justify-content: flex-start;
        padding-left: 16px;
    }

    .ubuntu_bar .buttons { display: none; }

    .code_lines {
        font-size: 14px;
        max-height: none;
        overflow: visible;
    }

    .code_lines .indent-lg { padding-left: 1.6em; }
}
