* {
  margin: 0;
  padding: 0;
  outline: none;
  text-decoration: none;
  box-sizing: border-box;
}

html,
body {
  scroll-behavior: smooth;
  font-family: "Poppins", sans-serif;
  background-color: var(--bg-color);
}

:root {
  --bg-color: #0e0e0e;
  --white-color: #eeffdb;

  --contrast-color: #e5d3b3;
  --main-color: #ef7b1d;
  --complementary-color: #5c3d2e;
}

.lang-wrapper {
  position: fixed;
  top: 0;
  right: 0;
  margin: 1rem 1rem 0 0;
  z-index: 1000;

  .lang-switch {
    width: 100%;
    white-space: nowrap;
    position: relative;

    button {
      width: 100%;
      padding: 8px 10px;
      text-align: center;
      font-size: 0.8rem;
      font-weight: bold;
      border-radius: 10px;
      background: var(--bg-color);
      color: #fff;
      border: none;
      cursor: pointer;
      transition:
        background-color 0.3s ease,
        transform 0.3s ease,
        opacity 0.3s ease;

      @media (hover: hover) and (pointer: fine) {
        &:hover {
          background-color: var(--main-color);
        }
      }
    }

    .lang-main {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 0.2rem;
    }

    .lang-options {
      position: absolute;
      top: 100%;
      left: 0;
      margin-top: 0.3rem;
      width: 100%;
      height: auto;
      display: flex;
      flex-direction: column;
      gap: 0.4rem;
      opacity: 0;
      transform: translateY(-5px);
      pointer-events: none;
      transition:
        opacity 0.3s ease,
        transform 0.3s ease;
    }

    .lang-option {
      background: var(--bg-color);
    }

    &.open {
      .lang-options {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
      }

      .arrow {
        transform: rotate(180deg);
        opacity: 1;
      }
    }

    .arrow {
      display: flex;
      align-items: center;
      font-size: 1rem;
      opacity: 0.7;
      transition: transform 0.3s ease;
    }
  }
}

nav#sidebar {
  font-family: "Englebert", sans-serif;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  left: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0.5rem;
  z-index: 2;
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  outline: 6px double var(--main-color);
  border-radius: 50px;
  box-shadow: 3px 3px 15px #b7794699;
  transition: transform 0.5s ease;

  .icon-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    background-color: #e5d3b3;
    color: black;
    border: 1px solid black;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition:
      background-color 0.5s ease,
      transform 0.5s ease;

    span.tooltip {
      position: absolute;
      left: 120%;
      top: 50%;
      transform: translateY(-50%) scaleX(0);
      transform-origin: left;
      background: var(--contrast-color);
      color: #000;
      padding: 6px 12px;
      border-radius: 0 10px 10px 10px;
      font-size: 1rem;
      opacity: 0;
      pointer-events: none;
      white-space: nowrap;
      border: 1px solid black;
      transition:
        opacity 0.5s ease,
        transform 0.5s ease;
    }

    @media (hover: hover) and (pointer: fine) {
      &:hover .tooltip {
        opacity: 1;
        transform: translateY(-50%) scaleX(1);
      }

      &:hover i {
        animation: shake 0.5s ease;
      }
    }
  }

  .icon-wrapper.selected {
    background-color: var(--main-color);
  }
}

.left-window {
  position: fixed;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: start;
  background-color: var(--bg-color);
  padding: clamp(1rem, 4vw, 2rem);
  height: 100vh;
  width: 20%;
  z-index: 1;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.2) 1px,
    transparent 1px
  );
  background-size: 25px 25px;

  &::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(
      to right,
      rgba(14, 14, 14, 0) 0%,
      var(--bg-color) 100%
    );
  }

  .bio {
    font-family: "Englebert", sans-serif;
    font-size: 1.5rem;
    color: var(--white-color);

    span {
      font-weight: bold;
      text-transform: uppercase;

      span {
        color: var(--main-color);
        font-weight: 900;
      }
    }

    p {
      font-weight: 300;
    }

    .status {
      font-family: "Poppins", sans-serif;
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 5px;
      color: #b2ffb2;
      font-size: 0.8rem;
      font-weight: 500;

      .dot {
        width: 8px;
        height: 8px;
        background: #00ff66;
        border-radius: 50%;
        box-shadow: 0 0 8px #00ff66;
        position: relative;

        &::after {
          content: "";
          position: absolute;
          inset: 0;
          border-radius: 50%;
          border: 2px solid #00ff66;
          animation: pulse 1.4s ease-out infinite;
          opacity: 0.5;
        }
      }
    }
  }
}

section#hero {
  width: 80%;
  margin-left: 20%;
  color: var(--white-color);

  .page {
    display: none;
    opacity: 0;
    animation: fadeIn 0.3s ease-out;
    margin-inline: clamp(1rem, 4vw, 3rem);

    .top-container {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-block: 5rem;

      h1 {
        font-size: 1.6rem;
      }

      h1 > span:not(span.wrapper) {
        color: var(--main-color);
      }
    }

    a.action-btn {
      display: flex;
      align-items: center;
      gap: 0.3rem;
      width: fit-content;
      color: #3366ff;
      cursor: pointer;
      transition: color 0.3s ease;

      @media (hover: hover) and (pointer: fine) {
        &:hover {
          color: var(--complementary-color);
        }
      }
    }

    &.active {
      display: block;
      opacity: 1;
    }
  }

  footer {
    background-color: var(--bg-color);
    margin-top: 3.5rem;
    padding: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;

    nav {
      display: flex;
      gap: 3rem;

      a {
        color: white;
        transition: color 0.3s ease;

        @media (hover: hover) and (pointer: fine) {
          &:hover {
            color: var(--main-color);
          }
        }
      }
    }
  }
}

section#hero .home {
  position: relative;
  z-index: 0;

  .top-container h1 span.wrapper {
    font-size: 1.6rem;

    span {
      font-size: 1.6rem;
      color: var(--main-color);
    }
  }

  .top-container h2 {
    font-size: 1.2rem;
  }

  .grid-layout {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;

    .deco-cpx {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: clamp(200px, 30vw, 350px);
      height: clamp(200px, 30vw, 350px);
      border-radius: 50%;
      filter: blur(60px);
      z-index: -1;
      background-color: var(--main-color);
    }

    .card {
      position: relative;
      background-color: #090909;
      border-radius: 10px;
      height: 100%;
      overflow: hidden;

      &::before {
        content: "";
        position: absolute;
        left: 50%;
        bottom: 0;
        transform: translateX(-50%);
        width: 0%;
        height: 2px;
        opacity: 0;
        background-color: var(--complementary-color);
        transition:
          width 0.3s ease,
          opacity 0.3s ease;
      }

      @media (hover: hover) and (pointer: fine) {
        &:hover::before {
          width: 100%;
          opacity: 1;
        }
      }
    }
    .col-left {
      display: flex;
      flex-direction: column;
    }

    .col-right {
      display: grid;
    }

    .col-left,
    .col-right {
      gap: 1.5rem;

      .data-wrapper {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        gap: 1.5rem;

        .data-01,
        .data-02 {
          width: 100%;
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-items: center;
          padding: 2.5rem 1rem;

          span {
            font-size: 3rem;
            display: flex;
            align-items: baseline;
          }

          p {
            text-align: center;
            font-size: 0.8rem;
            color: #a0a0a0;
          }

          .time {
            display: flex;
            align-items: baseline;

            span:last-child {
              font-size: 0.8rem;
            }
          }
        }
      }

      .about {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 2rem clamp(1rem, 4vw, 2rem);

        overflow: hidden;

        h2 {
          font-size: 1.6rem;
          font-weight: 500;
          margin-bottom: 0.5rem;
        }

        p {
          color: #a0a0a0;
          font-size: 0.9rem;

          span {
            color: var(--main-color);
          }
        }

        .cta-line {
          margin-top: 3rem;
          display: grid;
          grid-template-columns: 1fr auto 1fr;
          align-items: center;
          gap: 1rem;

          .line {
            height: 2px;
            background-color: var(--main-color);
            opacity: 0.5;
          }

          a.lets-talk-wrapper {
            position: relative;
            width: 100%;
            max-width: fit-content;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0.5rem;
            background-color: var(--main-color);
            border: 2px solid black;
            border-radius: 10px;
            padding: 10px 20px;
            box-shadow: 2px 2px 10px rgba(239, 123, 29, 0.5);
            transition:
              transform 0.3s ease,
              box-shadow 0.3s ease;

            i {
              color: black;
              font-size: 1.4rem;
            }

            @media (hover: hover) and (pointer: fine) {
              &:hover {
                transform: translateY(-3px);
                box-shadow:
                  0 6px 20px rgba(239, 123, 29, 0.6),
                  0 0 0 2px rgba(239, 123, 29, 0.4);
              }
            }

            span {
              color: black;
              font-weight: bold;
            }
          }
        }
      }

      .timeline {
        display: grid;
        place-content: center;
        padding-block: 2rem;

        .content {
          padding-inline: clamp(1rem, 4vw, 2rem);

          h2 {
            font-size: 1.6rem;
            font-weight: 500;
            margin-bottom: 1rem;

            span:first-child {
              color: var(--main-color);
            }
          }

          p {
            font-size: 0.9rem;
            color: #a0a0a0;
          }
        }
      }

      .projects-act {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        max-height: fit-content;

        .text {
          display: flex;
          flex-direction: column;
          align-items: center;
          padding: 3rem 1rem;

          h2 {
            text-align: center;
            font-size: 1.6rem;
            font-weight: 500;

            span {
              color: var(--main-color);
            }
          }
        }

        .project-preview {
          border-radius: 10px;
          border: 1px solid black;
          overflow: hidden;

          img {
            vertical-align: bottom;
            width: 100%;
            transition: transform 0.3s ease;

            @media (hover: hover) and (pointer: fine) {
              &:hover {
                transform: scale(1.05);
              }
            }
          }
        }
      }
    }
  }
}

section#hero .projects {
  .top-container {
    padding-block: 5rem 0;
  }

  .info-carousel {
    p.info {
      margin-block: 3rem;
      text-align: center;
      white-space: normal;

      &:nth-child(2) {
        display: none;
      }

      span {
        margin-inline: 0.5rem;
        color: var(--main-color);

        &:nth-last-child(1) {
          display: none;
        }
      }
    }
  }

  .projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: stretch;
    gap: clamp(1.5rem, 5vw, 3.75rem);

    .project-card {
      background-color: #090909;
      color: white;
      border-radius: 15px;
      display: flex;
      flex-direction: column;
      min-height: 100%;
      transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;

      @media (hover: hover) and (pointer: fine) {
        &:hover {
          transform: translateY(-7px);
          box-shadow: 0 20px 40px rgba(59, 47, 47, 0.5);
        }
      }

      .img-container {
        width: 100%;
        height: auto;
        overflow: hidden;

        img {
          object-fit: cover;
          border-radius: 15px 15px 0 0;
          aspect-ratio: 16 / 9;
          width: 100%;
          height: auto;
        }
      }

      .content {
        padding: 1.5rem;

        h2 {
          font-weight: 300;
          margin-bottom: 0.5rem;
          display: flex;
          align-items: center;
          gap: 8px;

          span:nth-child(1) {
            font-weight: 500;
            color: var(--main-color);
          }

          i {
            color: #a0a0a0;
            transition: color 0.3 ease;
          }
        }

        p {
          color: #a0a0a0;
        }
      }
    }
  }
}

section#hero .skills {
  z-index: 0;
  position: relative;

  .skills-wrapper {
    position: relative;
    width: max-content;

    .deco-cpx {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 300px;
      height: 300px;
      border-radius: 50%;
      filter: blur(80px);
      z-index: -1;
      background-color: rgba(92, 61, 43, 0.6);
    }

    ol.skills-list {
      list-style: none;
      display: grid;
      grid-template-columns: repeat(2, auto);
      gap: 4rem 8rem;
      margin-inline: clamp(1rem, 6vw, 5rem);

      > li {
        @media (hover: hover) and (pointer: fine) {
          &:hover ul li {
            transform: translateX(15px);
          }
        }

        .title-wrapper {
          display: flex;
          align-items: baseline;
          gap: 0.5rem;

          p {
            display: flex;
            font-size: 3rem;
            font-weight: 200;

            span {
              color: var(--main-color);
            }
          }

          h2 {
            font-size: 1.6rem;
            font-weight: 500;
          }
        }

        ul li {
          list-style: disc;
          font-size: 0.9rem;
          color: #a0a0a0;
          transition: transform 0.5s ease-in-out;

          &:nth-child(1) {
            transition-delay: 0.1s;
          }
          &:nth-child(2) {
            transition-delay: 0.3s;
          }
          &:nth-child(3) {
            transition-delay: 0.5s;
          }
        }
      }
    }
  }
}

section#hero .contact {
  .contact-text {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    margin-bottom: 3rem;

    > span span {
      color: var(--main-color);
      font-weight: bold;
    }
  }

  .contact-links {
    display: flex;
    align-items: center;
    gap: 1rem;

    a.lets-talk-wrapper {
      display: flex;
      align-items: center;
      border-radius: 10px;
      border: 2px solid black;
      padding-left: 15px;
      background-color: var(--main-color);
      transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;

      @media (hover: hover) and (pointer: fine) {
        &:hover {
          transform: translateY(-3px);
          box-shadow:
            0 6px 20px rgba(239, 123, 29, 0.6),
            0 0 0 2px rgba(239, 123, 29, 0.4);
        }
      }

      span {
        color: black;
        font-weight: bold;
      }

      i {
        font-size: 1.6rem;
        color: black;
      }
    }

    a {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 1.2rem;
      color: white;
      border: 2px solid var(--main-color);
      border-radius: 10px;
      padding: 10px 15px;
      box-shadow: 2px 2px 10px rgba(239, 123, 29, 0.5);
      transition: transform 0.3s ease;

      @media (hover: hover) and (pointer: fine) {
        &:hover {
          transform: translateY(-3px);
        }
      }

      i {
        font-size: 1.6rem;
      }
    }
  }

  p.copyright {
    position: relative;
    max-width: 65%;
    width: fit-content;
    margin: 6rem auto;
    font-size: 0.9rem;
    letter-spacing: 0.8px;

    &::before {
      content: "";
      position: absolute;
      left: 0;
      bottom: 0;
      width: 100%;
      height: 2px;
      background-color: var(--main-color);
    }
  }
}

@media screen and (max-width: 1024px) {
  .lang-wrapper .lang-switch button:focus {
    background-color: var(--main-color);
  }

  .left-window {
    .bio {
      font-size: 1.2rem;
    }
  }

  section#hero .home {
    .grid-layout {
      .col-left,
      .col-right {
        .data-wrapper {
          .data-01,
          .data-02 {
            min-height: 125px;
            padding-block: 0rem;

            span {
              font-size: 2rem;
            }
          }
        }

        .about h2,
        .timeline .content h2,
        .projects-act .text h2 {
          font-size: 1.2rem;
        }

        .about p,
        .timeline .content p {
          font-size: 0.8rem;
        }

        .about {
          .cta-line {
            margin-top: 2rem;
            gap: 0.5rem;

            a.lets-talk-wrapper {
              font-size: 0.8rem;
              padding: 8px 15px;

              i {
                font-size: 1rem;
              }
            }
          }
        }
      }
    }
  }

  section#hero .projects {
    .content {
      h2 {
        font-size: 1.2rem;

        p {
          font-size: 0.9rem;
          color: #a0a0a0;
        }
      }
    }
  }

  section#hero .skills {
    .skills-wrapper {
      ol.skills-list {
        gap: 5rem;

        > li {
          .title-wrapper {
            p {
              font-size: 2.5rem;
            }

            h2 {
              font-size: 1.2rem;
            }
          }

          ul li {
            font-size: 0.9rem;
          }
        }
      }
    }
  }

  section#hero .contact {
    .contact-links {
      display: grid;
      grid-template-columns: repeat(2, 1fr);

      > span {
        display: none;
      }
    }
  }
}

@media screen and (max-width: 768px) {
  .left-window {
    position: relative;
    display: flex;
    padding-block: 2rem 4rem;
    width: 100%;
    height: auto;

    &::after {
      content: "";
      position: absolute;
      top: auto;
      bottom: 0;
      left: 0;
      right: 0;
      width: 100%;
      height: 50%;
      background: linear-gradient(
        to bottom,
        rgba(14, 14, 14, 0) 0%,
        var(--bg-color) 100%
      );
    }

    .bio {
      font-size: 1.2rem;
    }
  }

  nav#sidebar {
    display: flex;
    flex-direction: row;
    top: auto;
    bottom: 1rem;
    left: 50%;
    gap: 1rem;
    height: fit-content;
    padding: 0.3rem;
    transform: translateX(-50%);

    .icon-wrapper {
      font-size: 1rem;

      span.tooltip {
        display: none;
      }
    }
  }

  section#hero {
    width: 100%;
    margin-left: 0;

    .page {
      .top-container {
        display: flex;
        flex-direction: column;
        align-items: start;
        padding: 0;
        margin-bottom: 3rem;

        h1 {
          font-size: 1.6rem;
        }

        a.action-btn {
          padding-top: 0.5rem;
          align-self: flex-end;
        }
      }

      footer {
        margin-bottom: 8rem;

        nav {
          gap: 2rem;
        }
      }
    }
  }

  section#hero .home {
    .top-container {
      .title {
        display: flex;
        flex-direction: column;

        h1 span.wrapper,
        h1 span.wrapper span {
          font-size: 1.6rem;
        }

        h1 > span.wrapper {
          display: block;
        }

        h2 {
          line-height: 30px;
          font-size: 1rem;
        }
      }
    }

    .grid-layout {
      display: flex;
      flex-direction: column-reverse;
      gap: 3rem;

      .deco-cpx {
        top: 60%;
        filter: blur(40px);
        opacity: 0.7;
      }

      .col-left,
      .col-right {
        gap: 3rem;

        .about h2,
        .timeline .content h2,
        .projects-act .text h2 {
          font-size: 1.2rem;
        }

        .about p,
        .timeline .content p {
          font-size: 0.8rem;
        }

        .projects-act .text h2 {
          margin-bottom: 0.3rem;
        }
      }
    }
  }

  section#hero .projects {
    .info-carousel {
      overflow: hidden;

      .track {
        display: flex;
        width: max-content;
        animation: info-loop 7s linear infinite;

        .info {
          margin: 0;
          white-space: nowrap;
          padding-right: 0.5rem;

          &:nth-child(2),
          span:nth-last-child(1) {
            display: inline;
          }
        }
      }
    }

    .projects-grid {
      margin-top: 4rem;
      display: flex;
      flex-direction: column;
      gap: 3rem;

      .content h2 {
        font-size: 1.2rem;
      }

      .content p {
        font-size: 0.9rem;
      }
    }
  }

  section#hero .skills {
    .skills-wrapper {
      width: auto;

      ol.skills-list {
        display: flex;
        flex-direction: column;
        margin-inline: 1rem 0;
        gap: 2rem;

        > li:nth-child(odd) {
          align-self: flex-start;
        }

        > li:nth-child(even) {
          align-self: flex-end;
        }
      }
    }
  }

  section#hero .contact {
    .text-wrapper {
      display: flex;
      justify-content: center;
      margin-inline: 2rem;

      h2.contact-text {
        font-size: 1.2rem;

        > span:nth-child(2) {
          margin-top: 0.5rem;
          font-size: 1rem;
          opacity: 0.8;
        }
      }
    }

    .contact-links {
      display: flex;
      flex-direction: row;
      justify-content: center;
      flex-wrap: wrap;
      gap: 0rem;
      margin: 0 auto;
      max-width: fit-content;

      a.lets-talk-wrapper {
        flex: 0 0 100%;
        font-size: 1rem;
        justify-content: center;
        margin-bottom: 1rem;
        transition: transform 0.3s ease;
        width: 100%;
      }

      a:not(a.lets-talk-wrapper) {
        border: none;
        box-shadow: none;
        font-size: 0.8rem;
      }
    }

    p.copyright {
      text-align: center;
      font-size: 0.8rem;
    }
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  70% {
    transform: scale(2);
    opacity: 0;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  50% {
    transform: translateX(3px);
  }
  75% {
    transform: translateX(-3px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    filter: blur(5px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes info-loop {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
