/* Font Faces */
@font-face {
  font-family: 'AvenirLTStd-Book';
  src: url('AvenirLTStd-Book_0.otf') format('opentype'),
       url("AvenirLTStd-Book_0.eot"),
       url("AvenirLTStd-Book_0.woff") format("woff"),
       url("AvenirLTStd-Book_0.ttf") format("truetype"),
       url("AvenirLTStd-Book_0.svg") format("svg");
}

@font-face {
  font-family: 'AvenirLTStd-Medium';
  src: url('AvenirLTStd-Medium.eot?#iefix') format('embedded-opentype'),
       url('AvenirLTStd-Medium.otf') format('opentype'),
       url('AvenirLTStd-Medium.woff') format('woff'),
       url('AvenirLTStd-Medium.ttf') format('truetype'),
       url('AvenirLTStd-Medium.svg#AvenirLTStd-Medium') format('svg');
}

@font-face {
  font-family: 'AvenirLTStd-Black';
  src: url('AvenirLTStd-Black_0.otf') format('opentype'),
       url("AvenirLTStd-Black_0.eot"),
       url("AvenirLTStd-Black_0.woff") format("woff"),
       url("AvenirLTStd-Black_0.ttf") format("truetype"),
       url("AvenirLTStd-Black_0.svg") format("svg");
}

/* Design Tokens / CSS Variables */
:root {
  --primary-color: #000000;
  --accent-color: #AB004E;
  --bg-light: #f8f8f8;
  --bg-nav: rgba(255, 255, 255, 0.95);
  
  --font-book: 'AvenirLTStd-Book', sans-serif;
  --font-medium: 'AvenirLTStd-Medium', sans-serif;
  --font-black: 'AvenirLTStd-Black', sans-serif;
  
  --transition-default: all 0.3s ease-in-out;
  --transition-nav: all 600ms ease 0ms;
  --transition-link: all 300ms ease 0ms;
  --transition-toggle: all 225ms ease;
}

/* Cookie Law Banner */
#cookie-law {
  position: fixed;
  z-index: 2000;
  bottom: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 20px;
  background: black;
}

#cookie-law p {
  font-size: 12px;
  text-align: left;
  color: white;
  margin: 0;
  width: 85%;
  float: left;
}

#cookie-law p a {
  color: white;
}

.close-cookie-banner {
  float: right;
  text-align: right;
  color: white;
  height: 100%;
  font-size: 18px;
  font-weight: bold;
  text-decoration: none;
}

/* CSS Reset & Defaults */
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, ul, li, figure, footer, header, hgroup, menu, nav, section {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

html {
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-medium);
  color: var(--primary-color);
  letter-spacing: 0.02em;
  line-height: 1.4;
}

p {
  font-size: 16px;
}

h1 {
  font-family: var(--font-black);
  font-size: 40px;
}

h2 {
  font-family: var(--font-medium);
  font-size: 30px;
}

h4 {
  font-family: var(--font-medium);
  font-size: 13px;
  text-decoration: none;
  color: var(--primary-color);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition-default);
}

a:hover {
  color: var(--accent-color);
  text-decoration: none;
}

/* Layout - Header & Covers */
header {
  position: relative;
  height: 100vh;
  width: 100%;
  background: transparent;
  text-align: left;
  overflow: hidden;
  background-image: url("../images/header_background.jpg");
  background-size: cover;
  background-position: center right;
}

#cover {
  position: relative;
  height: 100vh;
  width: 100%;
  background: transparent;
  text-align: center;
  overflow: hidden;
}

#logobox {
  font-family: var(--font-black);
  position: absolute;
  text-align: left;
  left: 5%;
  font-size: 8vw;
  line-height: 100%;
  top: 10%;
}

#logoboxname {
  font-family: var(--font-medium);
  font-size: 3vw;
  line-height: auto;
}

.scrolldown a {
  position: absolute;
  height: 38px;
  width: 38px;
  background: url(../images/arrowdown.png);
  background-size: cover;
  bottom: 10%;
  left: 50%;
  margin-left: -24px;
  color: var(--primary-color);
  display: block;
  transition: var(--transition-default);
}

.scrolldown a:hover {
  background: url(../images/arrowdownhover.png);
  background-size: cover;
}

/* Navigation Menu */
#body-nav {
  z-index: 200;
  transition: var(--transition-nav);
  transform: translate3d(100%, 0, 0);
  background: var(--bg-nav);
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#body-nav a {
  color: var(--primary-color);
  text-decoration: none;
  font-family: var(--font-black);
  transition: var(--transition-link);
}

#body-nav a:hover {
  color: var(--accent-color);
  text-decoration: none;
}

#body-nav ul {
  list-style-type: none;
}

#body-nav ul li {
  font-size: 40px;
  text-align: left;
}

.show-nav #body-nav {
  transform: translate3d(0, 0, 0);
}

.toggle-nav {
  position: fixed;
  top: 10%;
  right: 5%;
  width: 40px;
  height: 40px;
  z-index: 600;
  transition: var(--transition-toggle);
}

.show-nav .toggle-nav {
  background: none;
}

.burger-x {
  position: absolute;
  z-index: 600;
  top: 20px;
  right: 0;
  display: block;
  width: 40px;
  height: 2px;
  background-color: var(--primary-color);
  font-size: 0px;
  user-select: none;
  transition: var(--transition-toggle);
  margin: 0 auto;
}

.burger-x:before, 
.burger-x:after {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
  content: '';
  transition: var(--transition-toggle);
}

.burger-x:before {
  transform: translateY(-500%);
}

.burger-x:after {
  transform: translateY(500%);
}

.show-nav .burger-x {
  background: none;
}

.show-nav .burger-x:before {
  background: var(--accent-color);
  transform: rotate(45deg);
}

.show-nav .burger-x:after {
  background: var(--accent-color);
  transform: rotate(-45deg);
}

.backbtn a {
  position: fixed;
  top: 10%;
  left: 5%;
  width: 35px;
  height: 35px;
  z-index: 600;
  background-image: url(../images/arrowleft.png);
  background-position: center;
  background-size: cover;
  transition: var(--transition-toggle);
}

.backbtn a:hover {
  background-image: url(../images/arrowlefthover.png);
}

#socialmenu {
  position: absolute;
  bottom: 10%;
  left: 5%;
}

#socialmenu i {
  margin-right: 20px;
}

/* Sections & Typography */
.section {
  padding-top: 100px;
  padding-bottom: 50px;
  padding-right: 10%;
  padding-left: 10%;
  float: left;
  width: 100%;
  box-sizing: border-box;
}

section#servizi {
  padding-bottom: 150px;
}

section#contatti {
  background-color: var(--bg-light);
}

.paragrafo {
  margin: 0 20%;
}

.descriptionworks {
  float: left;
  width: 50%;
  box-sizing: border-box;
  padding: 100px 10%;
}

.box {
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  float: left;
}

.box img {
  display: block;
  box-sizing: border-box;
  width: 50%;
  max-width: 100%;
  float: left;
}

.box video {
  width: 50%;
  float: left;
  box-sizing: border-box;
}

.titolobox {
  margin-bottom: 40px;
}

/* Portfolio Grid */
.grid {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  max-width: 1500px;
}

.grid li {
  display: block;
  width: 25%;
  padding: 2%;
  position: relative;
  float: left;
  height: auto;
  box-sizing: border-box;
}

.grid figure {
  margin: 0;
  position: relative;
  overflow: hidden;
}

.grid figure img {
  width: 100%;
  display: block;
  position: relative;
}

.grid figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  color: white;
  text-transform: lowercase;
  box-sizing: border-box;
  height: 100%;
  width: 100%;
  background: white;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.grid figcaption h3 {
  text-align: left;
  font-family: var(--font-black);
  font-size: 25px;
  line-height: 25px;
  margin: 0;
  color: var(--primary-color);
  text-transform: lowercase;
  position: absolute;
  top: 50%;
  left: 10px;
}

.grid figcaption:hover {
  opacity: 0.9;
}

section a, 
section a:visited {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition-default);
}

section a:hover, 
section a:focus {
  color: var(--accent-color);
  text-decoration: none;
}

.credits {
  width: 100%;
  float: left;
  padding-top: 50px;
  padding-bottom: 50px;
  font-size: 12px;
}

ul#lista {
  list-style-type: square;
}

ul#lista li {
  margin-left: 40px;
  margin-bottom: 5px;
}

/* Media Queries */
@media only screen and (max-width: 1250px) {
  .grid li {
    width: calc(100% / 3);
  }
}

@media only screen and (max-width: 900px) and (orientation: portrait) {
  h1 {
    font-family: var(--font-black);
    font-size: 30px;
  }
  
  h2 {
    font-family: var(--font-medium);
    font-size: 25px;
  }
  
  .box img, 
  .box video {
    width: 100%;
  }
  
  header .scrolldown a {
    bottom: 20px;
  }
  
  .toggle-nav {
    top: 20px;
    right: 5%;
  }
  
  #socialmenu {
    bottom: 20px;
    left: 20px;
  }
  
  .backbtn a {
    top: 20px;
    left: 20px;
  }
  
  .section {
    padding-top: 48px;
    padding-bottom: 48px;
    overflow: hidden;
    padding-right: 10%;
    padding-left: 10%;
  }
  
  /* Corretto errore di battitura section#services -> section#servizi */
  section#servizi {
    padding-bottom: 48px;
  }
  
  .descriptionworks {
    width: 100%;
    padding-top: 48px;
    padding-bottom: 48px;
    overflow: hidden;
    padding-right: 10%;
    padding-left: 10%;
  }
  
  #rightdesc {
    padding-top: 22px;
  }
  
  .paragrafo {
    margin: 0;
    font-size: 16px;
  }
  
  #logobox {
    font-size: 43px;
    top: 20px;
    width: 100%;
    left: 20px;
    line-height: auto;
  }
  
  #logoboxname {
    font-size: 22px;
    line-height: auto;
  }
  
  #footerbottom {
    padding: 20px 0 40px 0;
  }
  
  .credits {
    font-size: 11px;
    padding-bottom: 0;
  }
  
  header {
    background-image: url("../images/header_background_mob.jpg");
    background-position: bottom;
  }
}

@media only screen and (max-width: 820px) {
  .grid li {
    width: 50%;
  }
}

@media only screen and (max-width: 500px) {
  .section {
    padding-top: 48px;
    padding-bottom: 48px;
    overflow: hidden;
    padding-right: 20px;
    padding-left: 20px;
  }
}

/* One-Page Project Modal & Loader */
.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  background-color: #ffffff;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.project-modal.is-open {
  opacity: 1;
  visibility: visible;
}

/* Loader di caricamento */
.project-loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100000;
  display: none;
}

.project-loader .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Blocchiamo lo scroll della pagina principale quando la modale è aperta */
body.modal-open {
  overflow: hidden;
}