@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;800&family=Noto+Sans+TC:wght@300;400;500;700&display=swap');

:root {
  --mainBgColor: rgb(249, 250, 251);
  --mainTextColor: #000;
  --secondaryTextColor: rgb(51 51 51);
  --Grayish-blue: hsl(233, 8%, 79%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: 0.2s linear;
}

html,
body {
  font-family: 'Inter', sans-serif;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 62.5%;
  line-height: 1.5;
  background-color: var(--mainBgColor);
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

i {
  font-size: 2.5rem;
}

.icons-big {
  font-size: 3.2rem;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  font-size: 1.8rem;
  color: var(--secondaryTextColor);
  display: inline-block;
}

p {
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--mainTextColor);
}

.logo {
  font-size: 2.2rem;
  font-weight: 700;
}

.container {
  max-width: 110rem;
  margin: 0 auto;
  padding: 2rem;
}

.btn {
  background-color: var(--mainTextColor);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  border: 1px solid var(--mainTextColor);
}

.btn:hover {
  color: var(--mainTextColor);
  background-color: #fff;
}

.margin-top-1 {
  margin-top: 1rem;
}

.margin-top-2 {
  margin-top: 2rem;
}

.margin-top-5 {
  margin-top: 5rem;
}

.sub-title {
  text-align: center;
  font-size: 3.8rem;
}

.sub-en-name {
  font-size: 2.4rem;
}

/* header section */
#header {
  border-bottom: 1px solid var(--Grayish-blue);
  position: fixed;
  top: 0;
  left: 0;
  background-color: var(--mainBgColor);
  width: 100%;
  z-index: 3;
}

.header-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.navbar {
  display: flex;
  gap: 1.5rem;
}

.navbar a {
  position: relative;
}

.navbar a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--mainTextColor);
  transform: scaleX(0);
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  transform-origin: right center;
}

.navbar a:hover::after {
  transform: scaleX(1);
  transform-origin: left center;
  transition-duration: 0.4s;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 10;
  cursor: pointer;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
}

.hamburger-top,
.hamburger-middle,
.hamburger-bottom {
  position: absolute;
  width: 20px;
  height: 2px;
  top: 0;
  left: 0;
  background: var(--mainTextColor);
}

.hamburger-middle {
  transform: translateY(5px);
}

.hamburger-bottom {
  transform: translateY(10px);
}

/* Transition hamburger to X when open */
.open {
  transform: rotate(90deg);
}

.open .hamburger-top {
  transform: rotate(45deg) translateY(6px) translateX(6px);
}

.open .hamburger-middle {
  display: none;
}

.open .hamburger-bottom {
  transform: rotate(-45deg) translateY(6px) translateX(-6px);
}

/* Overlay */
.overlay-show {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 3;
}

.stop-scrolling {
  overflow: hidden;
}

.mobile-main-menu {
  display: none;
}

/* main section */
#main {
  margin-top: 10rem;
}
.main-container {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: space-evenly;
  align-items: center;
  gap: 2rem;
  padding: 5rem 8rem;
  /* height: 60vh; */
}

.main-socials {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 2rem;
}

.main-content {
  flex: 1 1 40rem;
}

.main-content h2 {
  font-size: 4.2rem;
}

.main-content .en-name {
  font-size: 2.4rem;
}

.main-line-container {
  display: flex;
  justify-content: start;
  align-items: center;
}

.main-line-container .line {
  width: 5rem;
  height: 0.1rem;
  background-color: var(--Grayish-blue);
}

.main-line-container p {
  margin-left: 1rem;
}

.main-img {
  background: url(../images/Miao-1.jpeg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  width: 38rem;
  height: 38rem;
  box-shadow: inset 0 0 0 9px rgb(225 225 225 / 30%);
  order: 1;
  justify-self: center;
  animation: profile_animate 8s ease-in-out infinite 1s;
}

@keyframes profile_animate {
  0% {
    border-radius: 60% 40% 30% 70%/60% 30% 70% 40%;
  }

  50% {
    border-radius: 30% 60% 70% 40%/50% 60% 30% 60%;
  }

  100% {
    border-radius: 60% 40% 30% 70%/60% 30% 70% 40%;
  }
}

/* about section */

.about-container {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 5rem;
}

.about-img {
  flex: 1 1 30rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-img img {
  width: 28rem;
  height: 28rem;
  border-radius: 4rem;
}

.about-content {
  flex: 1 1 40rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
}

.about-cards {
  flex-grow: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.about-card-text {
  margin-top: 3.5rem;
}

.card {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 1.8rem 0.8rem;
  border: 1px solid var(--mainTextColor);
  border-radius: 5px;
  background-color: #fff;
}

.card i {
  font-size: 3rem;
}

.card-small {
  font-size: 1.4rem;
  font-weight: 300;
}

/* experience section */
#experience {
  margin-top: 10rem;
}

.experience-container {
  margin-top: 5rem;
}

.experience-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
}

.experience-icons .div {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
}

.experience-icons .div p {
  font-weight: 700;
}

.work-container {
  max-width: 530px;
  margin: 4rem auto 0 auto;
  display: grid;
  grid-template-columns: 1fr max-content 1fr;
  column-gap: 1.5rem;
}

.work-title {
  font-size: 2rem;
  font-weight: 500;
}

.work-date {
  margin-top: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.work-card-round {
  display: inline-block;
  width: 13px;
  height: 13px;
  background-color: var(--mainTextColor);
  border-radius: 50%;
}

.work-card-line {
  display: block;
  width: 1px;
  height: 100%;
  background-color: var(--mainTextColor);
  transform: translate(6px, -7px);
}

/* skills section */
#skills {
  margin-top: 10rem;
}

.skills-cards {
  display: flex;
  justify-content: space-evenly;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8rem;
  margin-top: 5rem;
}

.skills-card {
  flex: 1 1 32rem;
  padding: 3rem 5rem;
  border: 1px solid var(--mainTextColor);
  border-radius: 1rem;
}

.skills-card-title {
  text-align: center;
  font-size: 2.4rem;
  font-weight: 500;
}

.skill-card-content {
  margin-top: 2rem;
  display: flex;
  justify-content: space-evenly;
  align-items: flex-start;
  gap: 3rem;
}

.skill-card-inside {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.skill-card-inside:first-child {
  margin-top: 0;
}

.card-title {
  font-size: 2rem;
  font-weight: 500;
}

/* projects section */
#projects {
  margin-top: 10rem;
}

.projects-container {
  margin-top: 5rem;
}

.projects-category {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.projects-category p {
  font-weight: 700;
}

.projects-category div {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  cursor: pointer;
}

.projects-cards {
  margin-top: 3.5rem;
  display: flex;
  justify-content: space-evenly;
  align-items: flex-start;
  gap: 3rem;
  flex-wrap: wrap;
}

.project-card {
  width: 28rem;
  padding: 2rem;
  border: 1px solid var(--Grayish-blue);
  border-radius: 10px;
}

.project-card img {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.project-card-link {
  display: flex;
  align-items: center;
  color: var(--Grayish-blue);
}

.project-card-link:hover i {
  transform: translateX(5px);
}

.project-card-title {
  margin-top: 2rem;
  font-size: 2rem;
  font-weight: 500;
}

.project-card-link p {
  font-weight: 500;
  color: var(--Grayish-blue);
}

.no-show {
  display: none;
}

.active {
  border-bottom: 1px solid var(--mainTextColor);
}

/* footer section */
#footer {
  border-top: 1px solid var(--Grayish-blue);
  margin-top: 10rem;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4rem 2rem;
}

.footer-container .socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
}

.footer-container .socials i {
  font-size: 3rem;
}

/* Media Queries */
@media (max-width: 960px) {
  #about {
    margin-top: 5rem;
  }

  #skills {
    margin-top: 5rem;
  }

  #experience {
    margin-top: 5rem;
  }

  #projects {
    margin-top: 5rem;
  }

  #footer {
    margin-top: 5rem;
  }
}

@media (max-width: 600px) {
  html,
  body {
    scroll-padding-top: 4rem;
  }

  /* Hide desktop menu */
  .navbar {
    display: none;
  }

  .container {
    padding: 3rem;
  }

  .header-container {
    padding: 2rem;
  }

  /* Show main mobile items */
  .hamburger {
    top: 27px;
  }

  .mobile-main-menu {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    width: 75%;
    height: 100%;
    background-color: var(--mainBgColor);
    z-index: 4;
    padding: 5rem;
    transform: translateX(100%);

    display: flex;
    justify-content: center;
    align-items: center;
  }

  .show-mobile-menu {
    transform: translateX(0);
  }

  .mobile-only {
    display: flex;
    flex-direction: column;
    align-items: end;
    flex-grow: 1;
    gap: 2rem;
  }

  .mobile-only a {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--mainTextColor);
    font-size: 2.2rem;
  }

  .hamburger {
    display: block;
  }

  .main-content {
    flex: 1 1 28rem;
  }

  .about-container {
    margin-top: 2rem;
  }

  .skills-cards {
    margin-top: 2rem;
  }

  .footer-container {
    gap: 2rem;
    flex-direction: column-reverse;
  }
}

@media (max-width: 420px) {
  p {
    font-size: 1.6rem;
  }

  a {
    font-size: 1.6rem;
  }

  .logo {
    font-size: 1.8rem;
  }

  .main-container {
    padding: 2rem;
  }

  .main-content h2 {
    font-size: 3.6rem;
  }

  .sub-title {
    font-size: 3.6rem;
  }

  .main-img {
    width: 25rem;
    height: 25rem;
  }

  /* skills section */
  .card-title {
    font-size: 1.8rem;
  }

  .skills-cards {
    gap: 3rem;
  }

  .skills-card {
    padding: 2rem;
  }
}
