@font-face {
    font-family: 'daemadsansfill-regular';
    src: url('fonts/daemadsansfill-regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* Variabili */
:root {
    --color-dark: #181818;
    --color-light: #eeede8;

    --font-mono: 'daemadsansfill-regular', monospace;
}

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

body {
    font-family: var(--font-mono);
    background-color: var(--color-dark);
    color: var(--color-light);

    cursor: url('data:image/svg+xml;utf8,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="white" /></svg>') 10 10, auto;
}

html {
    scroll-behavior: smooth;
}


a {
    text-decoration: none;
    color: inherit;
}

.res {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* HEADER */
.site-header {

    background-color: var(--color-dark);
    color: var(--color-light);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 200;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}



.menu-btn {
    background: none;
    border: none;
    color: var(--color-light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: opacity 0.3s;
    font-family: var(--font-mono);
}

.menu-btn:hover {
    opacity: 0.5;
}



.logo img {
    transition: filter 0.3s ease;
}

.logo a:hover img {
    filter: brightness(0) invert(1);
}






/* =========================================
   GRIGLIA - LOGICA DESKTOP FIRST
   ========================================= */

.main-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background-color: var(--color-light);
    gap: 1px;
    border-top: 1px solid var(--color-light);
    border-bottom: 1px solid var(--color-light);


}

.grid-cell {
    background-color: var(--color-dark);
    aspect-ratio: 1 / 1;
    position: relative;
}

/* =========================================
   project and hover
   ========================================= */

.project {
    cursor: pointer;
    z-index: 1;
}

.project:hover {
    z-index: 50;
}

.project-content {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: hidden;
    background-color: var(--color-dark);
}

.project-content img {
    transition: opacity 0.3s;
}

.expand-right .project-content {
    left: 0;
}

.expand-left .project-content {
    right: 0;
}

.project:hover .project-content {
    width: calc(200% + 1px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.project:hover img {
    opacity: 0.3;
}

.project-title {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s;
    color: var(--color-light);
    padding: 1rem;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
}

.project:hover .project-title {
    opacity: 1;
}


.site-footer {
    background-color: var(--color-dark);
    color: var(--color-light);
    padding: 1.2rem 2rem;
    font-size: 0.8rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    position: relative;
}

.footer-socials {
    display: flex;
    gap: 1.5rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.footer-socials a {
    transition: color 0.3s;
    font-size: 1.1rem;
}

.footer-socials a:hover {
    opacity: 0.5;
}


/* MEDIA QUERIES */


@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .project:hover .project-content {
        width: 100%;
        /* Disattiva l'espansione su smartphone piccoli per evitare bug visivi */
    }


    .project:hover .project-content,
    .project.span-col-2:hover .project-content {
        width: 100% !important;
    }

    .footer-content {
        flex-direction: column-reverse;
        gap: 1rem;
        text-align: center;
    }


    .footer-socials {
        position: static;
        transform: none;
    }

}




a,
button,
.project,
.menu-btn {
    /* Cursore: Pallino centrale pieno (r="5") + Anello esterno vuoto (r="14") */
    cursor: url('data:image/svg+xml;utf8,<svg width="48" height="48" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><circle cx="24" cy="24" r="7" fill="white" /><circle cx="24" cy="24" r="22" fill="none" stroke="white" stroke-width="4" /></svg>') 24 24, pointer !important;
}

/* Classe per far occupare a un riquadro 2 spazi orizzontali */
.span-col-2 {
    grid-column: span 2;
    /* Dice alla griglia di occupare 2 colonne */
    aspect-ratio: auto;
    /* Mantiene la proporzione corretta di due quadrati affiancati */
}

/* Espansione personalizzata per i riquadri larghi 2 colonne (da 2 a 3 riquadri) */
.project.span-col-2:hover .project-content {
    /* Il 150% di 2 colonne = 3 colonne. Aggiungiamo 0.5px per bilanciare il gap della griglia */
    width: calc(150% + 0.5px);
}




.fullscreen-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-dark);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out;
}

.fullscreen-menu.is-active {
    opacity: 1;
    pointer-events: auto;
}

.menu-links {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
}

.menu-links a {
    font-size: 3rem;
    color: var(--color-light);
    text-decoration: none;
    transition: opacity 0.3s;
}

.menu-links a:hover {
    opacity: 0.5;
}

/* =========================================
   PULSANTE SCROLL TO TOP
   ========================================= */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--color-light);
    /* Sfondo chiaro */
    color: var(--color-dark);
    /* Freccia scura */
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease-in-out;
}


.scroll-to-top.show {
    opacity: 1;
    pointer-events: auto;
}


.scroll-to-top:hover {
    opacity: 1;
    transform: scale(1.15);
    background-color: var(--color-dark);
    color: var(--color-light);
    border: 1px solid var(--color-light);
}




/* =========================================
   SCIA DEL CURSORE (TRAIL)
   ========================================= */
.cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 12px;
    /* Leggermente più piccoli del principale */
    height: 12px;
    border-radius: 50%;
    pointer-events: none;
    /* Non bloccano i click */
    z-index: 9998;
    /* Stanno sotto al cursore principale (9999) */
    transform: translate(-50%, -50%);
    /* Non usiamo transition qui perché il movimento lo gestisce JavaScript per la massima fluidità */
}


.dot-blue {
    background-color: rgb(83, 185, 199);
}

.dot-white {
    background-color: #ffffff;

}

.dot-red {
    background-color: rgb(216, 26, 25);
}






/* =========================================
   PAGINA ARCHIVIO (STILE TABELLA 4 COLONNE)
   ========================================= */
.archive-container {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

/* LA MAGIA: Una griglia perfetta per allineare le colonne in ogni riga */
.archive-header,
.archive-item {
    display: grid;
    /* Divide lo spazio: Nome(4) - Tipo(2) - Cliente(2) - Anno(1) */
    grid-template-columns: 4fr 2fr 2fr 1fr;
    align-items: center;
    gap: 1rem;
}

/* Stile dell'intestazione (i titoli delle colonne in alto) */
.archive-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-light);
    margin-bottom: 2rem;
    opacity: 0.4;
    /* Sbiadito ed elegante */
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.archive-list {
    list-style: none;
    display: flex;
    flex-direction: column;
}

/* Stile della singola riga cliccabile */
.archive-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(238, 237, 232, 0.15);
    /* Linea di separazione leggerissima */
    transition: opacity 0.3s ease, padding 0.3s ease;
    color: var(--color-light);
    text-decoration: none;
}

/* Effetto al passaggio del mouse sulla riga */
.archive-item:hover {
    opacity: 0.5;
    padding-left: 1rem;
    /* Piccolo scivolamento verso destra della riga */
}

/* --- ALLINEAMENTI DELLE SINGOLE COLONNE --- */
.col-name {
    text-align: left;
    font-size: 1.2rem;
}

.col-type {
    text-align: left;
    opacity: 0.8;
}

.col-client {
    text-align: left;
    opacity: 0.8;
}

.col-year {
    text-align: right;
    opacity: 0.8;
}

/* Riporta la grandezza del "Name" nell'intestazione uguale agli altri */
.archive-header .col-name {
    font-size: 0.85rem;
}

/* =========================================
   ADATTAMENTO PER SMARTPHONE (MOBILE)
   ========================================= */
@media (max-width: 768px) {
    .archive-header {
        display: none;
        /* Nasconde i titoli delle colonne sui telefoni piccoli */
    }

    /* Disattiva la griglia e impila il testo a cascata */
    .archive-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        padding: 1.5rem 0;
    }

    .archive-item:hover {
        padding-left: 0.5rem;
    }

    .col-name,
    .col-type,
    .col-client,
    .col-year {
        text-align: left;
        /* Su mobile è tutto allineato a sinistra */
    }

    .col-name {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    /* Aggiunge delle etichette (Type: , Client: , Year: ) in automatico solo su mobile */
    .col-type,
    .col-client,
    .col-year {
        font-size: 0.9rem;
        opacity: 0.6;
    }

    .col-type::before {
        content: "Type: ";
        opacity: 0.5;
    }

    .col-client::before {
        content: "Client: ";
        opacity: 0.5;
    }

    .col-year::before {
        content: "Year: ";
        opacity: 0.5;
    }
}









/* Nasconde il cursore personalizzato e i pallini della scia su dispositivi touch (smartphone/tablet) */
@media (pointer: coarse) {

    body,
    a,
    button,
    .project,
    .menu-btn {
        cursor: auto !important;
    }

    .custom-cursor,
    .cursor-trail {
        display: none !important;
    }
}