/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    background-color: #f5f2f4;
    background-image:
        radial-gradient(ellipse 100% 70% at 50% 0%, rgba(253, 240, 245, 0.55) 0%, transparent 52%),
        radial-gradient(ellipse 80% 50% at 100% 100%, rgba(248, 232, 238, 0.35) 0%, transparent 45%);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100%;
    font-family: 'EB Garamond', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    overflow-x: hidden;
    color: #1a1a1a;
    -webkit-font-smoothing: antialiased;
}

/* ==================== VARIABILI ==================== */
:root {
    --border-color: rgba(26, 26, 26, 0.42);
    --border-subtle: rgba(26, 26, 26, 0.2);
    --text-primary: #1a1a1a;

    --glass-bg: rgba(255, 252, 250, 0.38);
    --glass-bg-strong: rgba(255, 252, 250, 0.52);
    --glass-bg-hover: rgba(255, 255, 255, 0.58);
    --glass-blur: blur(16px) saturate(130%);

    --panel-max-width: 450px;
    --ui-left: clamp(16px, 2vw, 30px);
    --ui-top: clamp(16px, 2vw, 30px);
    --panel-top: clamp(82px, 9vh, 100px);
    --panel-bottom-gap: clamp(22px, 2.5vh, 30px);
    --panel-gap: 8px;

    /* questa è la larghezza MASTER di title + about + work + film */
    --ui-width: min(calc(100vw - (var(--ui-left) * 2)), var(--panel-max-width));

    /* installation resta separata */
    --installation-width: min(420px, calc(100vw - (var(--ui-left) * 2)));
}

/* ==================== HEADER ==================== */
.main-container {
    position: fixed;
    top: var(--ui-top);
    left: var(--ui-left);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    width: var(--ui-width);
}

.title-container {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 12px 28px;
    border: 1px solid var(--border-color);
    text-align: center;
    width: 100%;
}

.name {
    font-size: clamp(0.95rem, 1.35vw, 1.35rem);
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
    line-height: 1.2;
    white-space: normal;
    text-wrap: balance;
}

.info-container {
    text-align: center;
    transition: opacity 0.3s ease;
    width: 100%;
}

.info-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.info-text {
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    margin: 0;
    line-height: 1.45;
    text-transform: lowercase;
    opacity: 0.88;
}

.nav-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    transition: opacity 0.3s ease;
    width: 100%;
}

.nav-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.nav-item {
    border: 1px solid var(--border-color);
    padding: 8px 22px;
    text-align: center;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    flex: 1 1 auto;
    min-width: 100px;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: var(--text-primary);
    font-size: clamp(0.68rem, 0.85vw, 0.78rem);
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background: transparent;
}

.nav-item:hover {
    background: var(--glass-bg-hover);
}

.arrow {
    display: none;
}



/* ==================== VIDEO SIDEBAR (DESTRA) ==================== */
.Sidebar {
    height: 100vh;
    width: min(26.5vw, 380px);
    min-width: 280px;
    position: fixed;
    z-index: 1000;
    top: 0;
    right: -100%;
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: right 0.3s ease;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px 18px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-left: 1px solid var(--border-color);
}

.Sidebar.open {
    right: 0;
}

.Sidebar .closebtn {
    position: absolute;
    right: 14px;
    top: 14px;
    font-size: 1.35rem;
    line-height: 1;
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 400;
    opacity: 0.55;
    transition: opacity 0.15s ease;
}

.Sidebar .closebtn:hover {
    opacity: 1;
}

.movie-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    margin-bottom: 12px;
    min-height: 48px;
    padding: 10px 36px 10px 14px;
}

.Title {
    width: 100%;
    text-align: center;
    font-size: clamp(0.72rem, 1.05vw, 0.88rem);
    font-weight: 600;
    text-decoration: none;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.35;
}

.sidebar-nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 10px;
    margin: 0 0 14px;
}

.nav-arrow-container {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-arrow {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    line-height: 1;
    user-select: none;
}

.nav-arrow:hover {
    opacity: 0.5;
}

.movie-content {
    padding: 0 2px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(26, 26, 26, 0.2) transparent;
}

.movie-video-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid rgba(26, 26, 26, 0.32);
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.movie-video-frame {
    width: 100%;
    background: #d4d1ce;
    border-bottom: 1px solid rgba(26, 26, 26, 0.22);
    line-height: 0;
}

.movie-video-frame video {
    width: 100%;
    max-width: 100%;
    max-height: 42vh;
    display: block;
    border: none;
    outline: none;
    background: #c9c6c3;
}

.movie-video-stack .InfoMovie {
    margin: 0;
    padding: 12px 12px 14px;
    text-align: center;
    border-top: none;
}

.InfoMovie {
    font-size: 0.82rem;
    line-height: 1.45;
    font-weight: 400;
    opacity: 0.92;
    color: var(--text-primary);
}

.movie-soundtrack-panel {
    width: 100%;
    flex-shrink: 0;
    margin-top: 2px;
    padding: 10px 10px 12px;
    background: #ffffff;
    border: 1px solid rgba(26, 26, 26, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1);
    text-align: left;
}

.bandcamp-embed {
    width: 100%;
    overflow: hidden;
    line-height: 0;
    background: #fff;
}

.bandcamp-embed iframe {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border: 0 !important;
    background: #fff;
}

/* ==================== PANNELLI PRINCIPALI ==================== */
.panel,
.film-sidebar {
    position: fixed;
    top: var(--panel-top);
    left: var(--ui-left);
    height: calc(100vh - var(--panel-top) - var(--panel-bottom-gap));
    width: var(--ui-width);
    min-width: 280px;
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    background-image: none;
    border: 1px solid var(--border-color);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(26, 26, 26, 0.2) transparent;
}

.panel {
    transform: translateX(-120%);
    transition: transform 0.3s ease;
}

.panel.visible {
    transform: translateX(0);
}

.panel .closebtn,
.film-sidebar .closebtn,
.installation-panel .closebtn {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-primary);
    opacity: 0.5;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.panel .closebtn:hover,
.film-sidebar .closebtn:hover,
.installation-panel .closebtn:hover {
    opacity: 1;
}
.bio-container a {
    color: var(--text-primary);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.bio-container a:hover {
    opacity: 1;
}
.film-sidebar {
    left: 0;
    transform: translateX(-200%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.film-sidebar.visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* ==================== INSTALLATION PANEL ==================== */
.installation-panel {
    position: fixed;
    left: var(--ui-left);
    top: var(--panel-top);
    width: var(--installation-width);
    min-width: 280px;
    height: clamp(340px, 50vh, 500px);
    max-height: calc(100vh - var(--panel-top) - var(--panel-bottom-gap));
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateX(-200%);
    transition: transform 0.3s ease, top 0.3s ease;
}

.installation-panel.visible {
    transform: translateX(0);
}

.installation-panel.overlay-on-film {
    z-index: 1015;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.10);
}

.installation-panel .section {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 24px 20px 20px;
    box-sizing: border-box;
}

/* ==================== FILM SIDEBAR CONTENT ==================== */
.film-container {
    flex: 1;
    min-height: 0;
    padding: 44px 20px 20px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.film-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 100%;
    padding-top: 6px;
}

.film-container:has(.film-content:only-child) {
    align-items: center;
}

.film-image-block {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0 14px;
}

.film-img {
    width: min(100%, 320px);
    height: auto;
    display: block;
    margin: 0 auto;
    border: 1px solid var(--border-subtle);
    background: #d8d6d2;
}

.film-img-order {
    width: 65%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.film-caption {
    width: min(100%, 320px);
    margin: 8px auto 0;
    font-size: 0.65rem;
    line-height: 1.45;
    text-align: center;
    font-style: italic;
    opacity: 0.6;
    letter-spacing: 0.01em;
}

.film-content h2 {
    font-size: clamp(0.9rem, 1vw, 1.1rem);
    margin: 8px 0 10px;
    color: var(--text-primary);
    letter-spacing: -0.05rem;
    font-weight: 600;
    line-height: 1.2;
}

.film-content p {
    margin: 4px 0;
    font-size: clamp(0.72rem, 0.8vw, 0.85rem);
    line-height: 1.4;
    color: var(--text-primary);
    opacity: 0.85;
}

.film-content a {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--text-primary);
    opacity: 0.55;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: opacity 0.2s;
}

.film-content a:hover {
    opacity: 1;
}

.film-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    width: 100%;
}

.film-video-trigger {
    border: 1px solid rgba(26, 26, 26, 0.22);
    background: transparent;
    padding: 8px 18px;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    color: rgba(26, 26, 26, 0.55);
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.film-video-trigger:hover,
.film-video-trigger.active {
    background: rgba(26, 26, 26, 0.06);
    color: var(--text-primary);
    border-color: rgba(26, 26, 26, 0.45);
}

/* ==================== ABOUT PANEL ==================== */
.about-panel {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(26, 26, 26, 0.2) transparent;
}

.about-panel::-webkit-scrollbar {
    width: 3px;
}

.about-panel::-webkit-scrollbar-thumb {
    background: rgba(26, 26, 26, 0.2);
    border-radius: 2px;
}

.about-sidebar-content {
    display: flex;
    flex-direction: column;
    min-height: max-content;
    overflow: visible;
}

.title-container-about {
    flex-shrink: 0;
    padding: 16px 44px 10px 20px;
    position: relative;
}

.panel-section-title {
    font-size: clamp(0.85rem, 1vw, 0.98rem);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.title-container-about .panel-section-title {
    margin: 0;
}

.line {
    flex-shrink: 0;
    width: calc(100% - 40px);
    height: 1px;
    background-color: var(--border-subtle);
    margin: 0 20px 14px;
}

.bio-container {
    flex-shrink: 0;
    padding: 0 20px 12px;
    overflow: visible;
}

.bio-container p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.bio-container a {
    color: var(--text-primary);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.bio-container a:hover {
    opacity: 1;
}
/*AUDIO*/

.audio-upload-input {
    display: none;
}

.audio-upload-label {
    border: 1px solid var(--border-color);
    background: transparent;
    padding: 8px 18px;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.55);
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.audio-upload-label:hover {
    background: rgba(26, 26, 26, 0.06);
    color: var(--text-primary);
    border-color: rgba(26, 26, 26, 0.45);
}

.about-audio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 10px 0;
    width: 100%;
}

.audio-generate-btn {
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    padding: 10px 22px;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.2s ease;
}

.audio-generate-btn:hover {
    background: var(--glass-bg-hover);
}

.audio-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 8px;
}

.audio-controls label {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.6;
}


.audio-controls input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 70%;
    height: 1px;
    margin-top: 8px;
    background: rgba(26, 26, 26, 0.18);
    border-radius: 0;
    outline: none;
}

.audio-controls input[type="range"]::-webkit-slider-runnable-track {
    height: 1px;
    background: rgba(26, 26, 26, 0.18);
    border: none;
}

.audio-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    margin-top: -4.5px;
    border-radius: 50%;
    background: rgba(26, 26, 26, 0.78);
    border: 1px solid rgba(255, 252, 250, 0.7);
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(26, 26, 26, 0.08);
}

.audio-controls input[type="range"]::-moz-range-track {
    height: 1px;
    background: rgba(26, 26, 26, 0.18);
    border: none;
}

.audio-controls input[type="range"]::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(26, 26, 26, 0.78);
    border: 1px solid rgba(255, 252, 250, 0.7);
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(26, 26, 26, 0.08);
}

.audio-controls input[type="range"]:focus {
    outline: none;
}

.audio-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    padding: 14px 0;

    background: transparent;
    border: none;
    cursor: pointer;
}

/* wrapper */
.download-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* icona */
.download-icon {
    width: 28px;
    height: 28px;

    stroke: rgba(26, 26, 26, 0.7);
    stroke-width: 1.4;
    fill: none;

    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* testo nascosto */
.download-label {
    position: absolute;
    top: 38px;

    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;

    color: rgba(26, 26, 26, 0.6);

    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;

    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* hover */
.audio-download-btn:hover .download-icon {
    transform: translateY(3px);
}

.audio-download-btn:hover .download-label {
    opacity: 1;
    transform: translateY(0);
}

.audio-render-status {
    width: 100%;
    max-width: 180px;
    height: 1px;
    margin: 10px auto 0;
    background: rgba(26, 26, 26, 0.12);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.audio-render-status.visible {
    opacity: 1;
    transform: translateY(0);
}

.audio-render-bar {
    width: 40%;
    height: 100%;
    background: rgba(26, 26, 26, 0.75);
    transform: translateX(-120%);
}

.audio-render-status.visible .audio-render-bar {
    animation: audioRenderSlide 1s ease-in-out infinite;
}

@keyframes audioRenderSlide {
    0% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(320%);
    }
}

/* ==================== WORK PANEL ==================== */
.work-panel .container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 40px 20px 18px 22px;
    overflow: hidden;
    position: relative;
}

.work-panel-title {
    margin: 0 0 16px;
    padding-right: 32px;
    flex-shrink: 0;
}

.header-row {
    display: grid;
    grid-template-columns: 32px 1fr 70px;
    align-items: baseline;
    padding: 0 0 10px;
    margin-bottom: 0;
    flex-shrink: 0;
    column-gap: 10px;
}

.work-header-icon-cell {
    display: block;
    width: 32px;
    min-height: 1em;
}

.work-panel .container h4,
.work-panel .container h5 {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.5;
    margin: 0;
    font-family: inherit;
}

.work-panel .container h4 {
    text-align: left;
}

.work-panel .container h5 {
    text-align: right;
}

.line2 {
    width: 100%;
    height: 1px;
    background-color: var(--border-subtle);
    margin: 0 0 10px;
    flex-shrink: 0;
}

#works-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

#works-list::-webkit-scrollbar {
    width: 3px;
}

#works-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

.work-panel [class^="aligned-text"] {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 70px;
    align-items: baseline;
    gap: 10px;
    padding: 12px 8px 12px 0;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.15s ease;
    color: var(--text-primary);
}

.work-panel [class^="aligned-text"]:last-child {
    border-bottom: none;
}

.work-panel [class^="aligned-text"]:hover {
    background: rgba(255, 255, 255, 0.42);
}

.work-panel .fas {
    width: 20px;
    text-align: center;
    font-size: 0.65rem;
    opacity: 0.35;
    transition: opacity 0.15s;
    font-weight: 300;
}

.work-panel [class^="aligned-text"]:hover .fas {
    opacity: 0.65;
}

.work-panel [class^="highlighted-text"] {
    font-size: clamp(0.75rem, 0.82vw, 0.85rem);
    text-align: left;
    line-height: 1.3;
}

.work-panel [class^="right-align"] {
    text-align: right;
    padding-right: 6px;
    font-size: clamp(0.7rem, 0.76vw, 0.78rem);
    opacity: 0.5;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ==================== INSTALLATION PANEL CONTENT ==================== */
.title-container-installation h2 {
    font-size: clamp(0.82rem, 0.95vw, 1.05rem);
    text-align: center;
    font-weight: 600;
    letter-spacing: -0.02rem;
    line-height: 1.3;
    margin-bottom: 0;
    padding-right: 24px;
}

.content-container-installation {
    flex: 1;
    overflow-y: auto;
    width: 100%;
    margin: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.content-container-installation::-webkit-scrollbar {
    width: 3px;
}

.content-container-installation::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

.content-container-installation p {
    font-size: clamp(0.75rem, 0.82vw, 0.85rem);
    line-height: 1.5;
    text-align: center;
    color: var(--text-primary);
}

.audio-container-installation {
    width: 100%;
    flex-shrink: 0;
}

.audio-container-installation audio {
    width: 100%;
    opacity: 0;
}

/* ==================== HOVER MESSAGE ==================== */
.hover-message {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    padding: 10px 22px;
    border: 1px solid var(--border-color);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 9999;
    max-width: min(90vw, 420px);
    text-align: center;
}

.hover-message.show {
    opacity: 1;
}

/* ==================== SCENE SYSTEM ==================== */
.hint {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    color: rgba(26, 26, 26, 0.35);
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 40;
    pointer-events: none;
    white-space: nowrap;
}

.hint.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(6px);
}

.scroll-intro {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    opacity: 0.04;
    pointer-events: none;
    font-weight: 700;
    transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 20;
    color: var(--text-primary);
}

.scroll-intro.hidden {
    opacity: 0;
    transform: translate(-50%, -58%);
}

.scene-meta {
    position: fixed;
    left: 50%;
    bottom: 36px;
    transform: translateX(-50%) translateY(8px);
    z-index: 35;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    width: min(72vw, 480px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}


.scene-meta.hidden {
    opacity: 0;
    pointer-events: none;
}

.scene-title h2 {
    font-size: clamp(0.82rem, 1.1vw, 1rem);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 0 0 3px;
    color: var(--text-primary);
    line-height: 1.1;
}

.scene-title p {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.45;
    margin: 0;
    font-weight: 400;
}

.scene-counter {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    opacity: 0.3;
    font-variant-numeric: tabular-nums;
}

.scene-button {
    border: 1px solid rgba(26, 26, 26, 0.22);
    background: transparent;
    padding: 8px 20px;
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    color: rgba(26, 26, 26, 0.55);
    font-family: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    pointer-events: auto;
}

.scene-button:hover {
    background: rgba(26, 26, 26, 0.06);
    color: var(--text-primary);
    border-color: rgba(26, 26, 26, 0.45);
}

/* ==================== INSTALLATION TRIGGER IN WORK ==================== */
.installation-trigger-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 10px 0 14px;
    cursor: pointer;
}

.installation-trigger-wrap .installation-trigger-image {
    width: min(100%, 320px);
    height: auto;
    display: block;
    margin: 0 auto;
    border: 1px solid var(--border-subtle);
    background: #d8d6d2;
    transition: opacity 0.25s ease, filter 0.25s ease;
}

.installation-trigger-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 252, 250, 0.08);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.installation-trigger-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    pointer-events: none;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
    background: rgba(255, 252, 250, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(26, 26, 26, 0.18);
    padding: 8px 12px;
    transition: opacity 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
}

.installation-trigger-wrap:hover::before {
    opacity: 1;
}

.installation-trigger-wrap:hover .installation-trigger-image {
    opacity: 0.92;
    filter: brightness(0.96);
}

.installation-trigger-wrap:hover .installation-trigger-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

@media screen and (max-width: 1440px) {
    .scene-meta {
        width: min(52vw, 400px);
        bottom: 30px;
    }

    .film-container:has(.film-content:only-child) {
        align-items: flex-start;
    }

}

@media screen and (max-width: 1440px) {
    :root {
        --panel-max-width: 400px;
    }
}

/* ==================== SMALLER SCREENS ==================== */
@media screen and (max-width: 1024px) {


    .film-img,
    .installation-trigger-wrap .installation-trigger-image,
    .film-caption {
        width: min(100%, 280px);
    }

    .film-image-block,
    .installation-trigger-wrap {
        margin: 8px 0 12px;
    }

    .film-content h2 {
        margin: 6px 0 8px;
    }

    .film-content p {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .name {
        font-size: clamp(0.8rem, 1vw, 1rem);
    }

    .title-container {
        padding: 11px 22px;
    }

    .nav-item {
        padding: 7px 16px;
        min-width: 92px;
    }

    .header-row {
        grid-template-columns: 28px 1fr 56px;
        column-gap: 8px;
    }

    .work-panel [class^="aligned-text"] {
        grid-template-columns: 28px minmax(0, 1fr) 56px;
        gap: 8px;
    }
        .project-reveal {
            display: block;
            position: relative;
            min-height: 100vh;
            padding: 96px 18px 32px;
            opacity: 0;
            pointer-events: none;
            transform: translateY(40px);
            transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
        }
    
        .project-reveal.visible {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0);
        }
    
        .project-reveal-inner {
            width: min(94vw, 860px);
            margin: 0 auto;
            display: grid;
            grid-template-columns: 1fr;
            gap: 18px;
            position: relative;
        }
    
        .project-reveal-close {
            position: absolute;
            top: -48px;
            right: 0;
            border: none;
            background: transparent;
            font-size: 1.4rem;
            line-height: 1;
            color: var(--text-primary);
            opacity: 0.5;
            cursor: pointer;
        }
    
        .project-reveal-media {
            width: 100%;
            border: 1px solid var(--border-color);
            background: rgba(255, 255, 255, 0.25);
            overflow: hidden;
        }
    
        .project-reveal-media img {
            width: 100%;
            height: auto;
            display: block;
        }
    
        .project-reveal-body {
            background: var(--glass-bg-strong);
            backdrop-filter: var(--glass-blur);
            -webkit-backdrop-filter: var(--glass-blur);
            border: 1px solid var(--border-color);
            padding: 20px 18px;
        }
    
        .project-reveal-body h2 {
            font-size: clamp(1rem, 2.2vw, 1.3rem);
            margin: 0 0 12px;
            line-height: 1.15;
            letter-spacing: -0.03em;
        }
    
        .project-reveal-info p {
            font-size: 0.82rem;
            line-height: 1.5;
            margin: 0 0 6px;
            opacity: 0.88;
        }
    
        .project-reveal-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            align-items: center;
            margin-top: 18px;
        }
    
        .project-reveal-actions a {
            font-size: 0.78rem;
            color: var(--text-primary);
            text-decoration: none;
            opacity: 0.65;
        }
    
        
        .Sidebar,
        .panel,
        .film-sidebar,
        .installation-panel {
            display: none !important;
        }

}

@media screen and (max-width: 768px) {
    :root {
        --ui-left: 15px;
        --ui-top: 15px;
        --panel-top: 78px;
        --panel-bottom-gap: 24px;
        --ui-width: calc(100vw - 30px);
        --installation-width: calc(100vw - 30px);
    }
        .project-reveal {
            padding: 88px 15px 28px;
        }
    
        .project-reveal-inner {
            width: 100%;
        }
    
        .project-reveal-body {
            padding: 18px 16px;
        }
    
        .project-reveal-actions {
            flex-direction: column;
            align-items: flex-start;
        }
    .main-container {
        gap: 10px;
    }

    .title-container {
        padding: 10px 16px;
    }

    .nav-container {
        gap: 8px;
    }

    .nav-item {
        min-width: 0;
        padding: 8px 12px;
    }

    .panel,
    .film-sidebar {
        min-width: 0;
    }

    .installation-panel {
        min-width: 0;
        height: clamp(300px, 46vh, 420px);
    }


    .scene-meta {
        bottom: 24px;
        width: min(86vw, 480px);
    }

    .scroll-intro {
        font-size: clamp(2.5rem, 8vw, 6rem);
    }
}

/* ==================== ABOUT PORTRAIT + FADER OVERLAY ==================== */

.about-portrait-wrap {
    position: relative;
    overflow: hidden;
}

.about-portrait-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(240, 137, 69, 0.12);
    pointer-events: none;
    z-index: 1;
}

/* Canvas WebGL  */
.portrait-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
        z-index: 0;
    z-index: 0;
    /* Nessun pointer-event: il mouse passa ai fader */
    pointer-events: none;
}

.about-portrait-wrap .about-audio {
    position: relative;
    z-index: 2;
    /* sfondo semitrasparente solo sul pannello dei fader */
    background: rgba(240, 137, 69, 0.12);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding-top: 14px;
    padding-bottom: 14px;
    
}