.header {
  padding: 1rem 1.4rem;
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 1001;
  min-height: 50px;

  &::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 1);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
  }
}

.logo {
  position: relative;
  z-index: 9;
  top: 7px;

  img {
    width: clamp(50px, -0.875rem + 8vw, 88px);
    height: auto;
    position: absolute;
    transition: all 0.3s ease;
  }
}

/* when scrolled */
.header.scrolled {
  transition: padding 0.4s ease;

  &::before {
    opacity: 1;
    top: 0;
    transition: top 0.4s ease;
  }

  &:not(:has(.side-menu.active)) .hamburger {
    transform: translateY(-15px) scale(0.6);
  }

  /* when scrolled → switch logos */

  & .logo img.light {
    opacity: 0;
  }

  & .logo img.dark {
    opacity: 1;
  }
}

.hamburger {
  display: none;
}

/* desktop menu */

.side-menu {
  display: flex;
  justify-content: space-between;
  position: relative;
}

.side-menu ul {
  list-style: none;
  display: flex;
  gap: 1.4rem;
  padding-block: 1rem;
}

.side-menu ul li {
  line-height: 1;
  text-transform: uppercase;
  font-weight: 500;
}

.side-menu ul li a {
  transition: 0.3s all;

  @media only screen and (min-width: 768.2px) {
    &:hover {
      color: var(--primary-color);
    }
  }
}

.side-menu .start_project {
  transition: 0.3s all;
  padding: 0.6rem 1.5rem;
  border: 1px solid #000;

  &:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: #fff;
  }
}

@media only screen and (max-width: 767px) {
  body {
    overflow-x: hidden;

    &.nav-open {
      overflow: hidden;
    }
  }

  .header {
    padding: 0.8rem 0.4rem;

    .logo {
      top: 4px;
    }

    /* Hamburger Icon */
    .hamburger {
      display: block;
      width: 40px;
      height: 24px;
      position: absolute;
      top: 28px;
      right: 20px;
      cursor: pointer;
      z-index: 1001;
      transition: transform 0.3s ease;
    }

    .hamburger span {
      position: absolute;
      left: 0;
      width: 100%;
      height: 5px; /* fixed thickness */
      background: #000;
      transition: all 0.3s ease;
    }

    /* top, middle, bottom bars */
    .hamburger span:nth-child(1) {
      top: 0;
    }

    .hamburger span:nth-child(2) {
      top: 50%;
      transform: translateY(-50%);
    }

    .hamburger span:nth-child(3) {
      bottom: 0;
    }

    /* active (X state) */
    .hamburger.active span {
      outline: none;
    }

    .hamburger.active span:nth-child(1) {
      top: 50%;
      transform: translateY(-50%) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
      opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
      top: 50%;
      transform: translateY(-50%) rotate(-45deg);
    }
  }

  /* Fullscreen Menu */
  .side-menu {
    position: fixed;
    top: 0;
    right: -105%;
    width: 100vw;
    height: 100vh;
    background: var(--primary-color);
    color: var(--text-color);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 60px 20px 20px;
    transition: right 0.5s ease;
    z-index: 1000;

    & .logo {
      position: initial;
    }
  }

  .side-menu.active {
    right: 0;
  }

  /* Menu Links */
  .side-menu ul {
    flex-direction: column;
    justify-content: center;
    gap: 0;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    text-transform: uppercase;
    text-align: right;
  }

  .side-menu ul li {
    line-height: 1;
  }

  .side-menu ul li a {
    color: var(--text-color);
    font-size: clamp(2rem, -0.875rem + 14vh, 4.5rem);
    letter-spacing: -4px;
    transition: all 0.3s;
    padding-right: 0;
    position: relative;
    overflow: hidden;
    display: block;
    text-shadow: none !important;

    &::after {
      content: "";
      display: block;
      height: 44px;
      width: 44px;
      background-image: url("../images/icons/black_arrow_left.png");
      background-position: right;
      background-size: 40px;
      background-repeat: no-repeat;
      right: -55px;
      top: calc(50% - 4px);
      transform: translateY(-50%);
      position: absolute;
      transition: all 0.3s ease;
    }
  }
  .side-menu ul li a:hover {
    padding-right: 3.4rem;

    &::after {
      right: 0;
    }
  }
}

@media only screen and (max-width: 576px) {
  .side-menu ul li a {
    font-size: clamp(2rem, -0.875rem + 10vh, 4rem);

    &::after {
      height: 38px;
      width: 38px;
      background-size: 34px;
    }

    &:hover {
      padding-right: 2.8rem;
    }
  }
}
