@layer variabili {
  :root {
    --colore-dark-blue: #0f172a;
    --colore-blue: #1f3b4d;     /* Blu  - professionale, maschile */
    --colore-light-blue: #7CB7D9;
    --colore-red: #c8102e;   /* Rosso barbiere - energico e classico */
    --colore-white: #ffffff;      /* Bianco puro - pulizia e contrasto */
    --colore-black: #0d0d0d;         /* Nero profondo - eleganza */
    --colore-grey: #f3f3f3;       /* Grigio chiaro - sfondi neutri */
    --colore-gray: #cacaca;       /* Grigio scuro - sfondi neutri */
  }
}

@layer base {
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  img {
    max-width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
  }

  html {
    scroll-behavior: smooth;
  }

  body {
    font-family: "Noto Sans", sans-serif;
    font-optical-sizing: auto;
    font-weight: 200;
    font-style: normal;
    font-size: 18px;
    overflow-x: hidden;
  }

  .content {
    margin: 0 auto;
    width: min(900px, 95%);
  }
  
  .col-3 {
    width: 32.333333%;
  }
  .col-4 {
    width: 24%;
  }

  .divider {
    height: 2px;
    background-color: var(--colore-blue);
    margin: 20px 0;
  }
  .spacer {
    padding: 70px 0;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  a {
    color: var(--colore-black);
    text-decoration: none;
    word-wrap: break-word;
  }

  
  .grey {
    background-color: var(--colore-grey);
  }
  .white {
    background-color: var(--colore-white);
  }
}

@layer flex {
  .flex {
    position: relative;
    font-size: 20px;
    font-weight: 200;
    

    & .line {
      display: inline-block;
      height: 2px;
      width: 20px;
      margin-right: 12px;
      transform: translateY(-6px);
      background-color: var(--colore-red);
    }

    h3& {
      margin: 20px 0 70px 0;
      font-size: 32px;
      letter-spacing: 3px;

      &:not(:first-of-type) {
        margin-top: 140px;
      }
    }
  }
}

@layer header {
  header {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 20px var(--colore-blue);
  }
  header a {
    position: relative;
    letter-spacing: 1px;
    padding: 3px 2px;
    text-transform: capitalize;

    @media (max-height: 650px) {
      font-size: 14px;
    }

    &:not(.site a)::before {
      content: "";
      position: absolute;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      height: 1px;
      width: 0;
      background-color: var(--colore-blue);
      transition: width 0.34s ease-in-out;
    }

    &:not(.site a):hover::before {
      width: 60%;
    }
  }
  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;

    @media (max-height: 650px) {
      height: 56px;
    }
  }
  .site a {
    font-size: 24px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 400;
    padding: 0;
  }
  .menu, ul {
    list-style-type: none;
  }
  .menu li {
    display: inline-block;
    margin: 0 6px;
  }
  .navbar {
    display: none;
  }
  .icon-bar {
    display: block;
    width: 16px;
    height: 2px;
    background-color: var(--colore-black);
  }
  .mid-icon-bar {
    margin: 3px 0;
  }
}

@layer hero {
  .hero {
    position: relative;
    color: var(--colore-white);
  }
  .hero-medias {
    display: grid;
    grid-template-columns: 50% 50%;
    grid-template-rows: calc(100vh - 72px);
    position: relative;
    
    @media (max-height: 650px) {
      grid-template-rows: calc(100vh - 56px);;
    }

    &::after {
      content: "";
      position: absolute;
      inset: 0;
      height: 100%;
      background: rgba(0, 0, 0, 0.60);
    }
  }
  .hero-medias {
    & img {
      height: 100%;
      width: 100%;
      object-fit: cover;
      object-position: 0% 0%;
    }

    & figure:first-of-type img {
      object-position: 50%;
    }
  }

  .hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
  }
  h1 {
    font-size: clamp(46px, 7vw, 100px);
    font-weight: 100;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: currentColor;

    & span {
      display: block;
      font-size: clamp(14px, 2vw, 20px);
      letter-spacing: 2px;
      color: currentColor;
      text-transform: capitalize;
    }
  }
  .hero-content .social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;

    a {
      color: currentColor;
    }

    & a:hover {
      transform: translateY(-4px);
    }
  }
}

@layer aboutUs {
  .block-media-text {
    display: grid;
    gap: 24px;
  }
  .block-media {
    height: 400px;

    & img {
      margin-bottom: 24px;
      height: 100%;
      width: 100%;
      object-fit: cover;
      filter: grayscale(0.7);
    }
  }
  .block-media:has(.col-2) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .block-text h4 {
    font-size: 28px;
    letter-spacing: 2px;
    font-weight: 500;
  }
  .block-text p {
    line-height: 30px;
    margin: 16px 0;
  }
}

@layer services {
  .block-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    row-gap: 120px;
  }
  .card {
    transform: translateY(70px);
    opacity: 0;
    transition: transform 1s ease-in-out, opacity 0.34s linear;
  }
  .card-media-text {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .card-media {
    height: 280px;
    overflow: hidden;
    display: flex;
  }
  .card-media img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    filter: grayscale(0.7);
  }
  .card-text h4 {
    font-size: 24px;
  }
  .card-text p {
    margin: 16px 0 8px 0;
  }
  .card-text span {
    font-weight: 400;
    margin-right: 12px;
  }
  .card-products {
    & img {
      width: 100%;
      max-height: 400px;
      object-fit: cover;
      filter: grayscale(0.7);
    }

    & p {
      margin: 48px 0;
      line-height: 32px;

      & span {
        font-weight: bold;
      }
    }
  }

  .logos {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;

    & img {
      max-width: 200px;
      object-fit: contain;
    }
  }
}

@layer portfolio {
  .block-column {
    display: flex;
    justify-content: center;
    gap: 24px;

    & .col-def {
      display: flex;
      flex-direction: column;
      gap: 24px;
    }

    & img {
      filter: brightness(0.7);

      &:hover {
        filter: brightness(1);
      }
    }
  }

  .col-def:first-of-type {
    width: 33%;
  }
  .col-def:nth-child(2) {
    width: 42%;
  }
  .col-def:last-of-type {
    width: 38%;
  }
}

@layer contact {
  #contact {
    position: relative;
  }
  #contact .content {
    width: min(1500px, 95%);
  }
  .block-contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: center;
    align-items: center;
    gap: 24px;

    & > * {
      & > *  {
        opacity: 0;
        transition: transform 1s ease-in-out, opacity 1s ease-in-out;
        transform: translateX(-100px);
      }

      & > * {
        background-color: var(--colore-white);
        color: var(--colore-blue);
        padding: 48px 24px;
        margin-bottom: 24px;
        opacity: 0;

        &.inverse {
          background-color: var(--colore-dark-blue);
          color: var(--colore-grey);

          & p {
            color: currentColor;
          }

          & a {
            background-color: var(--colore-grey);
            color: var(--colore-blue);
          }
        }
      }
      & .card-social a {
        clip-path: circle();
      }
      
      

      & h4 {
        font-size: 32px;
        color: currentColor;
      }

      & p {
        font-size: 20px;
        line-height: 40px;
        margin: 24px 0 48px 0;
      }

      & a {
        padding: 12px;
        background-color: var(--colore-blue);
        color: var(--colore-grey);
      }
    }
  }
  .card-email {
    margin-top: 210px;
  }
  .block-form {
    display: grid;
    grid-template-columns: 50% 1fr;
    padding: 48px 0;

    & h4 {
      font-size: 32px;
      color: var(--colore-blue);
      margin-bottom: 12px;
    }
  }

  .form {
    padding: 70px;

    & input:not([type="checkbox"]) {
      width: 100%;
      height: 40px;
      margin: 8px 0;
      padding: 8px 12px;
      border: none;
      outline: none;
      box-shadow: inset 3px 2px 5px var(--colore-grey);
      border: 1px solid var(--colore-grey);
    }

    & textarea {
      min-width: 100%;
      max-width: 100%;
      min-height: 400px;
      margin: 8px 0;
      border: none;
      outline: none;
      box-shadow: inset 3px 2px 5px var(--colore-grey);
      border: 1px solid var(--colore-grey);
      padding: 12px;
    }

    & a {
      color: var(--colore-red);
    }
    & form [type="submit"] {
      background-color: var(--colore-blue);
      box-shadow: none;
      color: var(--colore-white);
      font-weight: bold;
      letter-spacing: 2px;
      cursor: pointer;
    }
  }

  .hours {
    padding: 70px;

    & p {
      line-height: 32px;
      margin-bottom: 32px;
    }

    & span {
      font-weight: bold;
    }

    & img {
      filter: grayscale(0.7);
    }
  }
}

@layer staff {
  .swiper {
    margin-bottom: 16px;

    & + p {
      text-align: center;
      font-style: italic;
      font-weight: 400;
      letter-spacing: 2px;
    }
  }
  .swiper-slide {
    height: 800px;
    
    @media (min-width: 768px) {
      width: 49% !important;
    }

    background-color: var(--colore-grey);
    padding: 24px;
    border-radius: 12px;
  }
  .swiper-media {
    height: 600px;
    margin-bottom: 24px;

    @media (max-height: 650px) {
      height: 400px;
    }

    & img {
      height: 100%;
      width: 100%;
      object-fit: cover;
      border-radius: 12px;
    }

  
  }
  .swiper-text {
    & h4 {
      font-size: 1.5rem;
      text-align: center;
      margin: 6px 0;
    }
  }
}

@layer footer {
  footer {
    background-color: var(--colore-dark-blue);

    & .content {
      width: min(1500px, 95%);
    }
  }
  .footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    padding-bottom: 70px;
    border-bottom: 1px solid var(--colore-white);
  }
  .footer-content h5 {
    font-size: 20px;
    color: var(--colore-white);
    margin-bottom: 24px;
  }
  .footer-text h5 {
    color: var(--colore-light-blue);
  }
  .footer-text p {
    line-height: 28px;
    width: min(400px, 95%);
  }
  .footer-content :where(p, a, li)  {
    color: var(--colore-grey);
    font-size: 15px;
  }
  .footer-content li {
    margin: 16px 0;
  }
  .footer-nav li a:hover {
    color: var(--colore-light-blue);
  }
  .footer-contact i {
    margin-right: 6px;
    color: var(--colore-light-blue);
  }
  .credits {
    display: flex;
    align-items: center;
    padding: 20px 0 ;
    text-align: center;
  }
  .credits p {
    color: var(--colore-white);
    font-size: 16px;
  }
  .credits p a {
    color: var(--colore-light-blue);
  }
  .credits .social a {
    background-color: var(--colore-grey);
  }
}

@layer observer {
  /* --------- SERVICES --------- */
  .card.in-page {
    transform: translateY(0);
    opacity: 1;
  }

  /* --------- CONTACT --------- */
  #contact .col-2 > *.in-page {
    transform: translateX(0px);
    opacity: 1;
  }
}

@layer lightbox {
  #lightbox {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;

    &::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.378);
      backdrop-filter: blur(8px);
    }
  }
  #lightbox.open {
    display: flex;
  }

  .ctx-lightbox {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    z-index: 2;
    height: 100%;
    width: 70%;
    padding: 24px;
    margin: 0 auto;

    & img {
      max-width: 70%;
      max-height: 70vh;
      object-fit: cover;
    }

    & span {
      font-size: 32px;
      background-color: var(--colore-grey);
      padding: 24px;
      cursor: pointer;
    }
  }

  .arrow-left {
    clip-path: polygon(100% 0, 0 50%, 100% 100%);
  }
  .arrow-right {
    clip-path: polygon(0 0, 100% 50%, 0 100%);
  }
}

@media screen and (max-width: 1024px) {
  /* --------- ABOUT US --------- */

  .block-media-text{
    grid-template-columns: 1fr;

    &.inverse {
      & .block-text {
        grid-column: 1;
        grid-row: 2;
      }
      & .block-media {
        grid-column: 1;
        grid-row: 1;
      }
    }
  }

  /* --------- SERVICES --------- */

  .block-card {
    grid-template-columns: 1fr;
  }

  /* --------- CONTACT --------- */

  .block-contact {
    grid-template-columns: 1fr;
    transform: none;
  }

  .card-email {
    margin-top: 0;
  }

  .block-form {
    grid-template-columns: 100%;
  }

  /* --------- FOOTER --------- */

  .footer-content {
    text-align: center;
    grid-template-columns: 1fr;
    gap: 50px;

    & p {
      margin: auto;
    }
  }
}

@media screen and (max-width: 768px) {
  /* --------- BASE --------- */
  .col-2, .col-3, .col-4, .col-def {
    width: 95%;
    margin: auto;
  }

  /* --------- FLEX --------- */
  
  .flex {
    text-align: center;
  }


  /* --------- HERO --------- */
  .hero-medias {
    grid-template-columns: 1fr;
    grid-template-rows: 50vh 50vh;
  }


  /* --------- HEADER --------- */

  body:has(.menu.open) main::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.378);
    backdrop-filter: blur(6px);
    z-index: 2;
  }
  .menu {
    position: fixed;
    visibility: collapse;
    pointer-events: none;
    transform: translateX(100%);
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 50px;
    height: 100dvh;
    background-color: #252837;
    width: 45%;
    transition: transform 0.4s ease-in-out, visibility 0.4s ease-in-out;
    z-index: 1;

    & li {
      display: block;

      & a {
        color: var(--colore-white);
      }
    }
  }
  .navbar {
    position: relative;
    display: initial;
    z-index: 999999;
  }

  .menu.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: all;
  }
  .icon-bar {
    transition: transform 0.4s ease-in-out;

    &.rotate {
      position: absolute;
      right: 2.5%;
      background-color: var(--colore-white);
    }
  }
  .mid-icon-bar.rotate {
    display: none;
  }
  .icon-bar.rotate:first-of-type {
    transform: rotate(45deg);
  }
  .icon-bar.rotate:last-of-type {
    transform: rotate(-45deg);
  }

  /* --------- SERVICES --------- */

  .logos {
    flex-direction: column;
  }

  /* --------- PORTFOLIO --------- */

  .block-column {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: center;
  }

  /* --------- CONTACT --------- */

  .form {
    padding: 70px 24px;
  }

  .hours {
    padding: 70px 24px;
  }

}