/* ======================================================
   HOMEPAGE
   Le parti condivise (variabili, navbar, pannello HUD,
   HUD di scroll, footer…) sono in common.css
   ====================================================== */

.pin-spacer {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* ======================================================
   UNICO CANVAS GLOBALE (SFONDO FISSO DIETRO A TUTTO)
   ====================================================== */
#global-canvas {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1; /* Abbassato per stare SEMPRE dietro ai testi e alle sezioni */
    pointer-events: none; 
    background-color: #000;
}

/* i testi della homepage si invertono sopra le particelle */
.animate-text, h1, h2, p {
    mix-blend-mode: difference;
}

/* ======================================================
   LAYOUT HERO
   ====================================================== */
.panel {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;     
    padding: 4rem 1.25rem;
    position: relative;
    text-align: center;      
}

#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: transparent;
    z-index: 10;
}

.hero-layout {
    justify-content: flex-start; 
    padding-top: 18.5rem;      
}

.hero-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#hero h1, #landingText {
    display: flex;
    justify-content: center;
    gap: 1.5rem; 
    width: 100%;
    white-space: nowrap;
    will-change: transform, opacity;
    font-family: var(--font-helvetica);
    color: #fff;
    font-size: 8rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.1rem; 
}

#hero h1 span {
    display: inline-block;
    will-change: transform, opacity;
}

.container {
    width: 100%;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    box-sizing: border-box;
}

.text-center-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    z-index: 2;
}

.hero-description {
    font-family: var(--font-helvetica);
    font-size: 1.1rem;
    color: #fff;
    font-weight: 300;
    line-height: 1.6;
    max-width: min(92rem, calc(100vw - 2 * var(--side-safe)));
    width: 100%;
    text-align: center;
    will-change: transform, opacity;
}

/* ======================================================
   SEZIONE STL (GEOMETRIA)
   ====================================================== */
#stl-section {
    min-height: 100vh;          
    height: 100vh;
    padding: 0 !important;     
    margin: 0 !important;      
    position: relative;
    overflow: hidden;
    background-color: transparent !important;
    z-index: 10;
}

#stl-container {
    width: 100%;
    height: 100%;              
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* ======================================================
   SEZIONE FEATURED WORK — indice in stile HUD
   Sfondo: .hud-panel (common.css), qui opaco perché copre le particelle
   ====================================================== */
#featured-section {
    --panel-scanline: transparent;   /* niente righe da monitor sopra le anteprime */
    position: relative;
    z-index: 99;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 10rem var(--side-safe);
}

/* ---------- Lista e linee ----------
   Le linee si "disegnano" all'ingresso: GSAP porta --line da 0 a 1 */
.featured-list {
    --line: 0;
    position: relative;
    width: 100%;
    max-width: 92rem;
}

.featured-item {
    --line: 0;
    position: relative;
}

.featured-item::before,   /* linea sopra ogni voce */
.featured-list::after {   /* linea di chiusura */
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--rule);
    transform: scaleX(var(--line));
    transform-origin: left center;
}

.featured-item::before { top: 0; }
.featured-list::after  { bottom: -1px; }

/* linea rossa luminosa che scorre sotto la voce attiva */
.featured-item::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    z-index: 1;
    height: 1px;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(255, 77, 50, 0.6);
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.7s var(--ease-out);
}

.featured-item.is-active::after {
    transform: scaleX(1);
    transform-origin: left center;
}

/* ---------- Riga ---------- */
.featured-link-wrapper {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 3.25rem 0;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.5s ease;
}

/* le altre voci si attenuano mentre una è attiva */
.featured-list.has-active .featured-item:not(.is-active) .featured-link-wrapper {
    opacity: 0.25;
}

/* tratteggio rosso che "scansiona" la riga da sinistra a destra */
.featured-link-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: repeating-linear-gradient(-45deg, rgba(255, 77, 50, 0.16) 0 1px, transparent 1px 7px);
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.7s var(--ease-out);
    pointer-events: none;
}

.featured-item.is-active .featured-link-wrapper::before {
    clip-path: inset(0 0 0 0);
}

/* fascio verticale che attraversa la riga, sul bordo del tratteggio */
.featured-link-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 1px;
    background: var(--accent);
    box-shadow: 0 0 10px 1px rgba(255, 77, 50, 0.6);
    opacity: 0;
    pointer-events: none;
}

.featured-item.is-active .featured-link-wrapper::after {
    animation: featured-scan 0.7s var(--ease-out) forwards;
}

@keyframes featured-scan {
    0%   { left: 0;    opacity: 1; }
    85%  { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

/* angoli del mirino attorno alla riga attiva */
.featured-frame {
    position: absolute;
    inset: 8px -10px;
    pointer-events: none;
}

.featured-frame i {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 0 solid var(--accent);
    opacity: 0;
    transition: transform 0.5s var(--ease-out), opacity 0.2s ease;
}

.featured-frame i:nth-child(1) { top: 0;    left: 0;  border-top-width: 1px;    border-left-width: 1px;  transform: translate(12px, 12px); }
.featured-frame i:nth-child(2) { top: 0;    right: 0; border-top-width: 1px;    border-right-width: 1px; transform: translate(-12px, 12px); }
.featured-frame i:nth-child(3) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; transform: translate(-12px, -12px); }
.featured-frame i:nth-child(4) { bottom: 0; left: 0;  border-bottom-width: 1px; border-left-width: 1px;  transform: translate(12px, -12px); }

.featured-item.is-active .featured-frame i {
    opacity: 1;
    transform: translate(0, 0);
}

/* ---------- Titolo ---------- */
.featured-title {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(2.5rem, 9vw, 7rem);  /* gli em qui sotto sono relativi a questa misura */
}

.featured-text {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1em;
    font-weight: 100;
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
    color: var(--text);
    pointer-events: none;
    transition: color 0.3s ease;
}

.featured-item.is-active .featured-text {
    color: var(--accent);
}

/* ---------- Indice (sinistra) e "Explore" (destra) ---------- */
.featured-index,
.featured-cta {
    position: absolute;
    top: 50%;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    pointer-events: none;
    transition: color 0.3s ease;
}

.featured-index {
    left: 0;
    transform: translateY(-50%);
}

.featured-cta {
    right: 0;
    display: flex;
    align-items: center;
    gap: 0.5em;
    text-transform: uppercase;
    opacity: 0;
    transform: translate(-16px, -50%);
    transition: opacity 0.4s ease, transform 0.7s var(--ease-out), color 0.3s ease;
}

.featured-arrow {
    display: inline-block;
    transition: transform 0.7s var(--ease-out);
}

.featured-item.is-active .featured-index,
.featured-item.is-active .featured-cta {
    color: var(--accent);
}

.featured-item.is-active .featured-cta {
    opacity: 1;
    transform: translate(0, -50%);
}

.featured-item.is-active .featured-arrow {
    transform: translateX(4px);
}

/* ---------- Anteprima ---------- */
.hover-image-wrap {
    position: relative;
    display: inline-block;
    width: 0;
    height: 190px;
    overflow: hidden;
    vertical-align: middle;
    will-change: width;
    pointer-events: none;
    transition: margin 0.6s var(--ease-out);
}

.hover-image-wrap img {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 140px;
    height: 100%;
    object-fit: contain;
    transform: translate(-50%, -50%) scale(1.2);
    will-change: transform;
    background-color: transparent;
}

/* mentre le immagini "sfarfallano": separazione RGB */
.hover-image-wrap.is-glitching img {
    filter:
        drop-shadow(4px 0 0 rgba(255, 77, 50, 0.85))
        drop-shadow(-4px 0 0 rgba(0, 200, 255, 0.6));
}

/* targhetta "IMG 02/04" */
.featured-img-label {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 1;
    padding: 2px 5px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
    color: #fff;
    background: var(--accent);
}

.featured-img-label:empty {
    display: none;
}

/* tra due parole ("Set Design") l'anteprima fa anche da spazio */
.img-center .hover-image-wrap { margin: 0 0.28em; }

.featured-item.is-active .img-left  .hover-image-wrap { margin-right: 25px; }
.featured-item.is-active .img-right .hover-image-wrap { margin-left: 25px; }

@media (max-width: 768px) {
    #featured-section {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }

    .featured-link-wrapper {
        padding: 2.5rem 0 2rem;
    }

    .featured-index {
        top: 0.75rem;
        transform: none;
    }

    .featured-cta {
        display: none;
    }

    .hover-image-wrap {
        height: 110px;
    }

    .hover-image-wrap img {
        width: 90px;
    }
}


/* ======================================================
   CUSCINETTO SPAZIALE (STRUTTURA DI TRANSIZIONE)
   ====================================================== */
#void-space {
    width: 100%;
    height: 100vh;
    background: transparent !important;
    position: relative;
    z-index: 5;
    pointer-events: none;
}

/* ======================================================
   4. SEZIONE MANIFESTO (COMPARE DOPO IL VUOTO)
   ====================================================== */
#bio-section {
    background-color: transparent !important;
    padding: 15rem var(--side-safe);
    margin-top: 0; /* <--- RESETTATO: Lo spazio è ora gestito dal div HTML #void-space */
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.grid-bio {
    display: block;
    width: 100%;
    max-width: 92rem;
}

.manifesto-text {
    font-family: 'IBM Plex Serif', Georgia, serif;
    font-size: 4rem;
    font-weight: 100;
    color: #FF4D32; 
    letter-spacing: -0.01em;
    text-align: center;
    margin: 0;
    mix-blend-mode: normal; /* Disattivato mix-blend per preservare il colore esatto del font */
}

/* ======================================================
   5. SEZIONE PARTICELLE + INTERESSI/FOTO (BLOCCATA)
   ====================================================== */
#particles-section {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: transparent !important; 
    overflow: hidden;
    z-index: 20; /* Più alto del manifesto, pronto per il pinning di GSAP */
}

.bio-photo-backstage {
    position: absolute;         
    top: 50%;                   
    left: 50%;                  
    transform: translate(-50%, -50%); 
    width: 100%;
    max-width: 440px; 
    height: 550px; /* Definita altezza fissa proporzionata per contenere l'immagine */
    z-index: 25;   /* Sopra lo sfondo */              
    overflow: hidden;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
}

.bio-photo-backstage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%); 
    display: block;
}

.interests-overlay-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 440px; 
    padding: 0 1.25rem;
    z-index: 30; /* Sempre in primissimo piano sopra la foto */
    pointer-events: none;       
    display: flex;
    flex-direction: column;
    align-items: flex-start;    
    text-align: left;           
    opacity: 0;
}

.interests-overlay-wrapper h2 {
    font-family: 'IBM Plex Serif', Georgia, serif;
    font-size: 4rem;
    font-weight: 100;
    color: #FF4D32;                      
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin: 0;
    mix-blend-mode: normal;
}

/* ---------- About: fascio di scansione sulla foto ---------- */

/* fascio di scansione (GSAP lo fa scendere) */
.about-scanline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 12px 2px rgba(255, 77, 50, 0.7);
    opacity: 0;
}

/* scia rossa che sfuma sopra il fascio */
.about-scanline::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 80px;
    background: linear-gradient(to top, rgba(255, 77, 50, 0.35), transparent);
}

/* ---------- About: cornice HUD ---------- */
.about-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 26;  /* sopra la foto, sotto il testo */
    width: 100%;
    max-width: 440px;
    height: 550px;
    transform: translate(-50%, -50%);
    color: #fff;
    font-family: 'IBM Plex Mono', monospace;
    pointer-events: none;
}

.about-corner {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 0 solid currentColor;
    opacity: 0;
}

.about-corner[data-sx="-1"] { left: -14px;   border-left-width: 1px; }
.about-corner[data-sx="1"]  { right: -14px;  border-right-width: 1px; }
.about-corner[data-sy="-1"] { top: -14px;    border-top-width: 1px; }
.about-corner[data-sy="1"]  { bottom: -14px; border-bottom-width: 1px; }

.about-label {
    position: absolute;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
}

.about-label--top    { left: -14px;  bottom: calc(100% + 24px); }
.about-label--bottom { right: -14px; top: calc(100% + 24px); }

/* ======================================================
   RESPONSIVE DESIGN ADATTIVO
   ====================================================== */
@media (max-width: 992px) {
    .interests-overlay-wrapper h2 {
        font-size: 2.5rem;      
    }
    .bio-photo-backstage,
    .about-frame {
        max-width: 300px;
        height: 400px;
    }
}

/* ======================================================
   SCROLL ELEMENTI FISSI & ELEMENTI ACCESSORI
   ====================================================== */
.scroll-arrow {
    position: absolute;
    bottom: 4rem;
    left: 50%;
    transform: translateX(-50%) scaleX(1.8); 
    font-family: 'IBM Plex Mono', monospace;
    font-size: 4rem;
    font-weight: 200;
    color: #fff;
    mix-blend-mode: difference;
    user-select: none;
    z-index: 10;
    will-change: transform, opacity;
}
