:root {
  --primary-color: #3d5a80;
  --primary-light: #98c1d9;
  --secondary-color: #ee6c4d;
  --background-color: #293241;
  --text-color: rgba(255, 255, 255, 0.6);
  --highlight-color: #f4f1de;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Nobile", sans-serif;
  font-weight: 400;
  font-style: normal;
  background: radial-gradient(
    circle at top left,
    var(--primary-color),
    var(--background-color)
  );
}

body {
  display: flex;
  min-height: 100vh;
}

html,
body,
.main {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.main::-webkit-scrollbar,
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Sidebar */
.sidebar {
  width: 33%;
  /* background-color: var(--primary-color); */
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  min-height: 100vh;
}

.sidebar img {
  width: 40%;
  height: auto;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.sidebar h1 {
  font-size: 34px;
  margin-bottom: 10px;
  text-align: left;
  width: 60%;
  color: var(--highlight-color);
}

.sidebar p {
  text-align: left;
  width: 60%;
  margin-bottom: 10px;
  font-size: 14px;
}

.sidebar a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 14px;
  display: block;
  margin-bottom: 5px;
}

/* Use Scroll-driven animations to highlight table of contents */
.table-of-contents {
  margin: 30px 0;
  width: 60%;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.table-of-contents a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 16px;
  transition: all 0.3s ease;
  align-self: start;
}

.table-of-contents a.active,
.table-of-contents a:hover {
  color: var(--highlight-color);
  transform: scale(1.2) translateX(10px);
}

.contact-bar {
  position: absolute;
  bottom: 20px;
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.contact-bar img {
  width: 30px;
  height: 30px;
  margin: 0 10px;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.contact-bar img:hover {
  transform: scale(1.3);
}

.contact-bar-mobile {
  display: none;
}

/* Main Content */
.main {
  flex: 1;
  padding: 40px 60px;
  padding-left: 20px;
  overflow-y: auto;
  height: 100vh;
  width: max-content;
}

section {
  margin: 20px 0px;
  padding: 15px;
  padding-bottom: 5px;
  padding-top: 20px;
  border-radius: 10px;
  transition: all 0.3s ease;
}

h2 {
  font-size: 28px;
  margin-bottom: 20px;
  color: var(--highlight-color);
  border-bottom: 2px solid var(--highlight-color);
  display: inline-block;
  padding-bottom: 5px;
}

section:target {
  scroll-margin-top: 100px;
}

.section-item {
  margin-bottom: 20px;
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.item-header h3 {
  font-size: 20px;
  color: var(--highlight-color);
  margin: 10px 0;
  flex: 1;
}

.item-date {
  color: var(--text-color);
  font-size: 14px;
  white-space: nowrap;
  margin-left: 20px;
}

section:hover {
  margin: 20px 0px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  padding: 20px;
  padding-bottom: 5px;
  padding-top: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.section-item h3 {
  font-size: 20px;
  color: var(--highlight-color);
  margin-bottom: 5px;
}

.section-item p {
  font-size: 14px;
  color: var(--text-color);
  margin: 10px 0;
}

.section-item ul {
  font-size: 14px;
  color: var(--text-color);
  margin: 0;
  margin-left: 15px;
}

ul li {
  margin-bottom: 5px;
}

.skills-section-item {
  color: var(--highlight-color);
  margin-bottom: 20px;
  overflow: hidden;
  width: 100%;
}

.scrolling-container {
  /* apply fading effect on both sides */
  mask: linear-gradient(
    to right,
    transparent,
    black 20%,
    black 80%,
    transparent
  );
}

@keyframes scrolling-left {
  to {
    transform: translate(-50%);
  }
}

@keyframes scrolling-right {
  to {
    transform: translate(0);
  }
}

.skills-section-item ul {
  display: grid;
  grid-auto-flow: column;
  width: max-content;
  overscroll-behavior-inline: contain;
}

.right-to-left {
  animation: scrolling-left 30s linear infinite;
}

.left-to-right {
  transform: translate(-50%);
  animation: scrolling-right 30s linear infinite;
}

.skills-section-item li {
  background-color: var(--text-color);
  color: var(--background-color);
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 500;
  list-style: none;
  width: max-content;
  margin: 10px;
  transition: all 0.3s ease;
  padding-top: 11px;
}

.skills-section-item li:hover {
  transform: scale(1.1);
  transition: all 0.3s ease;
}

.skills-section-item h3 {
  font-size: 20px;
  margin-bottom: 15px;
}

.project-item {
  margin-bottom: 30px;
  padding: 0;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.project-header h3 {
  font-size: 20px;
  color: var(--highlight-color);
  margin-bottom: 0;
  flex: 1;
}

.project-date {
  color: var(--text-color);
  font-size: 14px;
  white-space: nowrap;
  margin-left: 20px;
}

.project-content {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.project-image-wrapper {
  position: relative;
  width: 250px;
  flex-shrink: 0;
}

.project-image {
  width: 250px;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.project-github-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.project-image-wrapper:hover .project-github-link {
  opacity: 1;
}

.github-overlay {
  width: 50px;
  height: 50px;
  transition: transform 0.3s ease;
}

.project-github-link:hover .github-overlay {
  transform: scale(1.2);
}

.project-content p {
  color: var(--text-color);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 1250px) {
  .page-content {
    padding: 0 !important;
  }

  html,
  body {
    height: auto;
    background: radial-gradient(
      circle at top left,
      var(--primary-color),
      var(--background-color)
    );
    background-size: 160% 160%;
    background-repeat: no-repeat;
    background-position: top left;
    background-attachment: fixed;
  }

  body {
    background: radial-gradient(
      circle at top left,
      var(--primary-color),
      var(--background-color)
    );
    flex-direction: column;
    overflow-y: auto;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    order: -1;
  }

  .contact-bar {
    display: none;
  }

  .contact-bar-mobile {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    margin-top: 50px;
  }

  .contact-bar-mobile img {
    width: 50px;
    height: 50px;
    margin: 0 15px;
    opacity: 0.8;
    transition: all 0.3s ease;
    flex-shrink: 0;
    border-radius: 50%;
  }

  .contact-bar-mobile img:hover {
    transform: scale(1.3);
  }

  .main {
    width: 100%;
    height: auto;
    padding: 40px 20px;
    padding-top: 0px;
    padding-bottom: 40px;
    order: 1;
    overflow-y: auto;
  }

  .sidebar img {
    width: 50%;
    max-width: 200px;
    margin-bottom: 10px;
  }

  .sidebar h1 {
    width: 100%;
    text-align: center;
    font-size: 10vw;
    margin-bottom: 5px;
  }

  .sidebar p {
    width: 100%;
    text-align: center;
    font-size: 3vw;
    margin-bottom: 5px;
  }

  .table-of-contents {
    display: none;
    width: 100%;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    margin: 15px 0 0 0;
  }

  .table-of-contents a {
    align-self: center;
    font-size: 20px;
    transform: none;
  }

  .table-of-contents a.active,
  .table-of-contents a:hover {
    transform: scale(1.1);
  }

  .item-header {
    display: block;
    margin-top: 15px;
    margin-bottom: 15px;
  }

  .item-header h3 {
    font-size: 20px;
    color: var(--highlight-color);
    margin: 10px 0;
  }

  .item-date {
    color: var(--text-color);
    font-size: 15px;
    margin-left: 0;
  }

  .project-content {
    display: block;
    width: 100%;
  }

  .project-image-wrapper {
    width: 100%;
    display: block;
  }

  .project-image {
    width: 100%;
    margin-bottom: 15px;
  }

  .project-header {
    display: block;
    margin-bottom: 15px;
  }

  .project-header h3 {
    margin-bottom: 10px;
  }

  .project-date {
    margin: 0;
    font-size: 15px;
  }
}
