/* ===== Base ===== */
:root{
  --bg:#0a0a0a;
  --fg:#eaeaea;
  --muted:#a5a5a5;
  --line:rgba(234,234,234,.15);
  --accent:#ffffff;
}


::selection {
    background: #1d6b37;
    color: black;
    text-shadow: none;
}

@font-face {
    font-family: "ThunderHC";
    src: url("Thunder-HC.ttf") format("truetype");
    font-weight: bold;
    font-style: bold;
}
@font-face {
    font-family: "ThunderLC";
    src: url("Thunder-BlackLC.ttf") format("truetype");
    font-weight: bold;
    font-style: bold;
}


*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  padding:0;
  color:var(--fg);
  background:var(--bg);
  font-family: 'Bigilla', sans-serif;
  font-weight: bold;
  /* noise animato in pure CSS */
  position:relative;
  overflow-x:hidden;
  overflow-y:hidden;
  height: 100dvh;
  width: 100dvw;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: auto;
}

.full-height {
    
  height: 100dvh;
}


  #loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0a0a0a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 1s ease;
    z-index: 99999;
  }

  #loader h1, #loader h2 {
    margin: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
  }

  #loader h1 {  font-size: 3vw; color: var(--fg);   font-family: "Bigilla";}
  #loader h2 { font-weight: 100; color:var(--muted); font-size: 2vw; transition-delay: 0.4s;    font-family: "manrope";}

  #loader.fade-out {
    opacity: 0;
    pointer-events: none;
  }

  #main-content {
    opacity: 0;
    transition: opacity 1s ease;
  }

  #main-content.visible {
    opacity: 1;
  }


  
.topbar{
  height:8dvh;
  display:flex;
  align-items:center;
  z-index:10;
  padding-inline:3vh;
  backdrop-filter:saturate(140%) blur(2px);
  justify-content: space-between;
}

.topnav{
  display:flex; 
  gap:1vh;
}

.topnav a{
  color:var(--fg);
  text-decoration:none;
  font-weight:400;
  position:relative;
  cursor:pointer;
  font-size: 2vh;
  font-family: 'Manrope', sans-serif;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.topnav a::after{
  content:"";
  position:absolute; 
  left:0; right:0; bottom:40%;
  height:2px; 
  background:#1d6b37;
  transform:scaleX(0); 
  transform-origin:left;
  transition:transform .45s cubic-bezier(.86,0,.5,1);
  opacity:.8;
}
.topnav a:hover::after{ transform:scaleX(1); }

/* Effetto opacità sugli altri link quando uno è in hover */
.topnav:hover a {
  opacity: 0.25;
}

.topnav a:hover {
  opacity: 1; /* link attivo sempre pieno */
}

.title-div {
  position: absolute;
  bottom: 0; 
  left: 2.6px;
  height: 20vw;
}

.title {
  font-size:15vw;
  line-height: 0.72;
  font-family: 'ThunderLC';
  user-select: none;
}



/* ===== Cornice ===== */
.frame{
  border:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0));
  height: 100%;
  position: relative;
}

.bigcontainer {
    margin:0 3vh 0 3vh;
    position: static;
    height: calc(100% - 12dvh);
}

/* Titolo */
.brand{
  display:flex;
  flex-direction:column;
  margin: 0;
}
.brand .name{
  font-size: 4vh;
  cursor:pointer;
  user-select: none;
}
.role{
  font-size:5vw;
  color: #1b4b2b;
  margin-left: 1vw;
  user-select: none;
}


/* Footer interno alla cornice */
.site-footer{
  font-size:1.5vh; 
  color:var(--fg);
  margin-left: 3vh;
  height: 4dvh;
  align-content: center;
  font-family: 'Manrope';
  font-weight: 400;
  user-select: none;
}


.glassy-overlay {
  position: fixed;
  height: calc(100% - 12dvh);
  width: calc(100% - 6dvh);
  backdrop-filter: blur(50px);
  pointer-events: none;
}

.container {
  position: absolute;
  z-index: 10000;
  height: calc(100% - 12dvh);
  width: calc(100% - 6dvh);
}

/* ----------------------------------------------*/

.works-div {
  position: absolute;
  bottom: 0; 
  width: 100%;
}


.work-sections{
  display: flex;
  flex-direction: column;
  margin: 0 3vw;
}

/* Riga */
.work-item{
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden !important;
  margin: 3.5vh 0;
  padding: 0;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              margin 0.7s cubic-bezier(.86,0,.5,1) 1s,
              padding 0.7s cubic-bezier(.86,0,.5,1) 1s; /* opacità sulla riga */
}

.work-item.show{
  margin: 0;
  padding: 3.5vh 0;
}

/* linea solo tra le righe, non sopra/sotto */
.middle-line{
  border-bottom: 1px solid #9c9c9c;
  opacity: 1;
  transform: scaleX(0);    /* parte da zero */
  transform-origin: left;  /* si allunga da sinistra */
  transition: transform 1s cubic-bezier(.86,0,.5,1) 0.4s; /* easing personalizzato */
}

.works-div.show .middle-line,
.about-div.show .middle-line {
  transform: scaleX(1);
}



/* Link e numero: stessi comportamenti */
.work-item .work-text,
.work-item .line-number{
  color: var(--fg);
  font-size: 4vw;
  text-decoration: none;
  display: block;
  opacity: 1;
}



.work-text{
  position: relative;

  /* valori iniziali */
  --tx: 0px;   /* X base */
  --ty: 5vw;   /* Y parte dal basso */

  /* un solo transform composto dalle due variabili */
  transform: translateX(var(--tx, 0px)) translateY(var(--ty, 0px));

  line-height: 0.8;

  /* transizioni separate sulle variabili (e su opacity se ti serve) */
  transition:
    --ty 1.5s cubic-bezier(.86,0,.5,1),
    --tx 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 1s cubic-bezier(0.4, 0, 0.2, 1) 0.5s;
}

.works-div .work-text.show {
  --ty: 0;
}
/* 1) Traslazione (vibrazione "soft") quando passi sulla riga */
.work-item:hover .work-text {
  --tx: 8px;
}

/* underline animata del link */
.work-item .work-text{
  position: relative;
}

.work-item .work-text::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 1.12vw;
  height: 5px;
  background: #1d6b37;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(.86,0,.5,1);
  opacity: .8;
}

/* 3) Underline attiva anche passando sulla riga */
.work-item:hover .work-text::after{
  transform: scaleX(1);
}

/* 2) Opacità: tutta la lista si scurisce, la riga sotto hover resta a 1 */
.work-sections:hover .work-item{
  opacity: 0.25;
}
.work-sections:hover .work-item:hover{
  opacity: 1;
}

.works-div.show .line-number,
.about-div.show .line-number {
  opacity: 1;
}

.work-item .line-number{
  color: var(--accent);
  font-size: 2vh;
  font-family: "manrope";
  text-decoration: none;
  font-weight: 300;
  display: block;
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1)0.6s;
}

.work-item,
.work-item:visited,
.work-item:hover,
.work-item:active {
  text-decoration: none;
}

/* linea solo tra le righe, non sopra/sotto */
.middle-line{
  border-bottom: 1px solid #9c9c9c;
  opacity: 1;
  transform: scaleX(0);    /* parte da zero */
  transform-origin: left;  /* si allunga da sinistra */
  transition: transform 1s cubic-bezier(.86,0,.5,1) 0.4s; /* easing personalizzato */
}

.works-div.show .middle-line {
  transform: scaleX(1);
}


/* 1) Registra le custom properties come animabili */
@property --tx {
  syntax: "<length-percentage>";
  inherits: false;
  initial-value: 0px;
}
@property --ty {
  syntax: "<length-percentage>";
  inherits: false;
  initial-value: 0px;
}
.work-item { --tx: 0px; --ty: 5vw; }
.work-item2 { --tx: 0px; --ty: 5vw; }


@media (max-width: 720px){
    .title-div {
      height: 33.4vw;
    }
    
    .title {
      font-size:25vw;
      line-height: 0.72;
    }
    .work-text {
      font-size: 8vw !important;
    }

    .wrapper .line {
      height: 4.1vw !important;
    }

    .wrapper .line span {
        font-size: 3.8vw !important;
    }

    .wrapper {
        width: 59.3vw !important;
    }

    .work-item .work-text::after{
      bottom: 2.32vw !important;
      height: 4px !important;
    }

  .work-text{
    --ty: 12vw;
  }

  #loader h1 { font-size: 4vh; }
  #loader h2 { font-size: 3vh; }

}

/*---------------mouse----------------*/

#cursor {
  position: fixed;
  z-index: 99;
  left: 0;
  top: 0;
  pointer-events: none;
  will-change: transform;
  mix-blend-mode: difference;
}

@media (hover: hover) and (pointer: fine) {
  .cursor__circle {
    width: 14px;
    height: 14px;
    margin-top: -50%;
    margin-left: -50%;
    border-radius: 50%;
    background-color: #a4a4a4;
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1),
      background-color 0.4s cubic-bezier(0.25, 1, 0.5, 1),
      border-color 0.4s cubic-bezier(0.25, 1, 0.5, 1),
      width 0.4s cubic-bezier(0.25, 1, 0.5, 1),
      height 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  }
  
  #cursor.arrow .cursor__circle{
    width: 28px;
    height: 28px;
    background-color: #1d6b37;
  }
  
  
  #cursor.subtle .cursor__circle{
    opacity: 0.86;
  }
  
  #cursor.overlay .cursor__circle{
    width: 48px;
    height: 48px;
    background-color: #1d6b37;
    border-color: transparent;
  }
}

/*---------------mouse----------------*/


.wrapper {
  align-items: center;
  width: 28vw;
}

.wrapper .line {
    height: 1.7vw;
    position: relative;
    overflow: hidden;
}
.wrapper .line span {
    position: absolute;
    font-size: 1.3vw;
    font-family: "Manrope";
    font-weight: 200;
    text-transform: uppercase;
}

.wrapper2 {
  align-items: center;
  width: 28vw;
}

.wrapper2 .line {
    height: 1.7vw;
    position: relative;
    overflow: hidden;
}
.wrapper2 .line span {
    position: absolute;
    font-size: 1.52vw;
    font-family: "Manrope";
    font-weight: 200;
    text-transform: uppercase;
}

.about-div {
  padding: 0 0 3vh 10vw;
  height: 100%;
  width: 100%;
  position: relative;
  display: grid;
  align-content: flex-end;
  justify-content: end;
}

.sections-centered {
  gap: 2vw;
  display: grid;
}

.contacts-div {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}


@media (max-width: 720px){

    .wrapper2 .line {
      height: 4.1vw !important;
    }

    .wrapper2 .line span {
        font-size: 3.53vw !important;
    }

    .wrapper2 {
        width: 65.1vw !important;
    }

  .sections-centered {
    gap: 8vw;
  }
}

/* --------------------------------------------------- */
.work-sections2{
  display: flex;
  flex-direction: column;
}

.work-sections2:hover .work-item{
  opacity: 0.25;
}
.work-sections2:hover .work-item:hover{
  opacity: 1;
}



.work-item2 {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden !important;
  margin: 0vw 0 2vw 0;
  padding: 0;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              margin 0.7s cubic-bezier(.86,0,.5,1) 1s,
              padding 0.7s cubic-bezier(.86,0,.5,1) 1s; /* opacità sulla riga */
}

.work-item2.show{
  margin: 0;
  padding: 0vw 0 2vw 0;
}

.work-item2 .work-text2,
.work-item2 .line-number2{
  color: var(--fg);
  font-size: 3.31vw;
  text-decoration: none;
  display: block;
  opacity: 1;
}

.work-item2:hover .work-text2 {
  --tx: 8px;
}

.work-text2{
  position: relative;

  /* valori iniziali */
  --tx: 0px;   /* X base */
  --ty: 5vw;   /* Y parte dal basso */

  /* un solo transform composto dalle due variabili */
  transform: translateX(var(--tx, 0px)) translateY(var(--ty, 0px));

  line-height: 0.8;

  /* transizioni separate sulle variabili (e su opacity se ti serve) */
  transition:
    --ty 1.5s cubic-bezier(.86,0,.5,1),
    --tx 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 1s cubic-bezier(0.4, 0, 0.2, 1) 0.5s;
}

/* underline animata del link */
.work-item2 .work-text2{
  position: relative;
}

.work-item2 .work-text2::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.82vw;
  height: 5px;
  background: #1d6b37;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(.86,0,.5,1);
  opacity: .8;
}

/* 3) Underline attiva anche passando sulla riga */
.work-item2:hover .work-text2::after{
  transform: scaleX(1);
}

/* 2) Opacità: tutta la lista si scurisce, la riga sotto hover resta a 1 */
.work-sections2:hover .work-item2{
  opacity: 0.25;
}
.work-sections2:hover .work-item2:hover{
  opacity: 1;
}

.sections-centered .work-text2.show {
  --ty: 0;
}
/* 1) Traslazione (vibrazione "soft") quando passi sulla riga */
.work-item2:hover .work-text2 {
  --tx: 8px;
}

.work-item2 .line-number2 {
  color: var(--accent);
  font-size: 2vh;
  font-family: "manrope";
  text-decoration: none;
  font-weight: 300;
  display: block;
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1)0.6s;
}

.work-item2,
.work-item2:visited,
.work-item2:hover,
.work-item2:active {
  text-decoration: none;
}

@media (max-width: 720px){
    .work-text2 {
      font-size: 7.7vw !important;
    }
    .work-item2 .work-text2::after {
      bottom: 2.42vw !important;
      height: 4px !important;
    }
  .work-text2 {
    --ty: 12vw;
  }

  .work-item2 {
    margin: 0vw 0 8vw 0;
    padding: 0;
  }

  .work-item2.show{
    margin: 0;
    padding: 0vw 0 8vw 0;
  }

}

/* Assicurati che tutte le div abbiano transizione sull'opacità */
.works-div,
.about-div,
.contacts-div,
.title-div {
  opacity: 0;
  transition: opacity 0.5s ease; /* durata fade-out/fade-in */
}

.show {
  opacity: 1;
}
