/* Global */
:root {
  /* App Colors - 한 단계 더 추상화  */
  --color-primary: var(--color-black);
  --color-primary-variant: var(--color-gray);
  --color-accent: var(--color-blue);
  --color-accent-variant: var(--color-orange);
  --color-text: var(--color-white);

  /* Background */
  --home-bg-gradient: linear-gradient(
    180deg,
    rgba(8, 26, 60, 1) 0%,
    rgba(5, 10, 19, 1) 100%
  );

  --home-bg-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='715' height='715' viewBox='0 0 800 800'%3E%3Cg fill='none' stroke='%231B1E26' stroke-width='1'%3E%3Cpath d='M769 229L1037 260.9M927 880L731 737 520 660 309 538 40 599 295 764 126.5 879.5 40 599-197 493 102 382-31 229 126.5 79.5-69-63'/%3E%3Cpath d='M-31 229L237 261 390 382 603 493 308.5 537.5 101.5 381.5M370 905L295 764'/%3E%3Cpath d='M520 660L578 842 731 737 840 599 603 493 520 660 295 764 309 538 390 382 539 269 769 229 577.5 41.5 370 105 295 -36 126.5 79.5 237 261 102 382 40 599 -69 737 127 880'/%3E%3Cpath d='M520-140L578.5 42.5 731-63M603 493L539 269 237 261 370 105M902 382L539 269M390 382L102 382'/%3E%3Cpath d='M-222 42L126.5 79.5 370 105 539 269 577.5 41.5 927 80 769 229 902 382 603 493 731 737M295-36L577.5 41.5M578 842L295 764M40-201L127 80M102 382L-261 269'/%3E%3C/g%3E%3Cg fill='%2301373B'%3E%3Ccircle cx='769' cy='229' r='5'/%3E%3Ccircle cx='539' cy='269' r='5'/%3E%3Ccircle cx='603' cy='493' r='5'/%3E%3Ccircle cx='731' cy='737' r='5'/%3E%3Ccircle cx='520' cy='660' r='5'/%3E%3Ccircle cx='309' cy='538' r='5'/%3E%3Ccircle cx='295' cy='764' r='5'/%3E%3Ccircle cx='40' cy='599' r='5'/%3E%3Ccircle cx='102' cy='382' r='5'/%3E%3Ccircle cx='127' cy='80' r='5'/%3E%3Ccircle cx='370' cy='105' r='5'/%3E%3Ccircle cx='578' cy='42' r='5'/%3E%3Ccircle cx='237' cy='261' r='5'/%3E%3Ccircle cx='390' cy='382' r='5'/%3E%3C/g%3E%3C/svg%3E");

  /* Colors */
  --color-white: #ffffff;
  --color-black: #050a13;
  --color-blue: #03e8f9;
  --color-orange: #fd6413;
  --color-gray: #1b1e26;
  --color-green: #d5ff3e;
  --color-yellow: #ffbf3d;
  --color-pink: #ff6d7a;

  /* Size */
  --size-max-width: 1200px;

  /* Divider */
  --divider-single-wave: url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none" > <path d="M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z" ></path> </svg>');
  --divider-multi-wave: url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none" > <path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25" class="shape-fill" ></path> <path d="M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z" opacity=".5" ></path> <path d="M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z" class="shape-fill" ></path> </svg>');
  --divider-arrow: url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none" > <path d="M649.97 0L550.03 0 599.91 54.12 649.97 0z" ></path> </svg>');
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Open Sans', sans-serif;
  margin: 0;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  list-style: none;
  padding: 0;
}

a {
  text-decoration: none;
  color: var(--color-text);
}

button {
  background-color: transparent;
  outline: 0;
  border: 0;
}

button:focus {
  outline: 1px solid transparent;
}

/* Common */
.section {
  padding: 4rem;
  text-align: center;
}

.title {
  font-size: 2.5rem;
  margin: 1rem 0;
}

.description {
  font-size: 1.5rem;
  margin: 0.5rem 0;
}

.max-container {
  max-width: var(--size-max-width);
  margin: auto;
}

/* Header */
.header {
  background-color: transparent;
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
  transition: all 300ms ease;
}

.header--dark {
  background-color: var(--color-primary);
  box-shadow: rgba(0, 0, 0, 0.15) 1.95px 1.95px 2.6px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header__logo__img {
  width: 36px;
  height: 36px;
}

.header__logo__title {
  font-size: 1.8rem;
}

.header__toggle {
  display: none;
  color: var(--color-white);
  font-size: 1.5rem;
  position: absolute;
  top: 1.3rem;
  right: 1rem;
}

.header__menu {
  display: flex;
  gap: 4px;
}

.header__menu__item {
  display: block;
  padding: 8px 16px;
  border-bottom: 1px solid transparent;
}

.header__menu__item:hover {
  border-bottom: 1px solid var(--color-accent);
}

.header__menu__item.active {
  border: 1px solid var(--color-accent);
  border-radius: 4px;
}

/* Home */
#home {
  position: relative;
  background-color: var(--color-primary);
  background-image: var(--home-bg-svg);
  color: var(--color-text);
  padding: 5rem 1rem;
  padding-top: 7rem;
  text-align: center;
}

#home::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: calc(100% + 1.3px);
  height: 61px;
  overflow: hidden;
  line-height: 0;
  transform: rotate(180deg);
  background-color: white;
  mask: var(--divider-single-wave);
  --webkit-mask: var(--divider-single-wave);
}

.home__avatar {
  width: 250px;
  height: 250px;
  object-fit: cover;
  border: 3px solid var(--color-accent);
  border-radius: 100%;
}

.home__title {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.home__title--strong {
  color: var(--color-accent);
}

.home__description {
  font-size: 1.3rem;
}

.home__contact {
  display: inline-block;
  /* a 태그가 한 줄을 차지하지만 실제 백그라운드은 컨텐츠 사이즈에 맞춤 */
  background-color: var(--color-accent);
  color: var(--color-black);
  margin: 2rem;
  padding: 0.5rem 1rem;
  font-weight: bold;
  border-radius: 4px;
}

.home__contact:hover {
  background-color: transparent;
  outline: 2px solid var(--color-accent);
  /* 컨텐츠 사이즈에 영향을 주지 않으면서 태두리를 적용할 수 있다. */
  color: var(--color-text);
}

/* About */
.majors {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0;
}

.major {
  background-color: var(--color-primary-variant);
  color: var(--color-text);
  padding: 2rem 1rem;
  border-radius: 1rem;
  cursor: default;
  box-shadow: 4px 8px 8px rgba(0, 0, 0, 0.38);
  width: 400px;
}

.major:hover .major__icon {
  transform: rotate(-15deg) scale(1.2);
}

.major__icon {
  font-size: 4rem;
  margin: 1rem 0;
  color: var(--color-accent);
  transition: all 300ms ease;
}

.major__title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.jobs {
  text-align: start;
}

.job {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1rem;
}

.job__name {
  color: var(--color-primary);
}

.job__period {
  color: var(--color-primary);
  font-size: 0.8rem;
}

/* Skills */
#skills {
  position: relative;
  background-color: var(--color-primary-variant);
  color: var(--color-text);
}

#skills::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: calc(118% + 1.3px);
  height: 61px;
  overflow: hidden;
  line-height: 0;
  transform: rotate(180deg);
  background-color: var(--color-primary);
  mask: var(--divider-multi-wave);
  -webkit-mask: var(--divider-multi-wave);
}

.skills {
  display: grid;
  grid-template-columns: 6fr 4fr;
  margin: 2rem 3rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2.8px 2.2px rgba(0, 0, 0, 0.034),
    0 6.7px 5.3px rgba(0, 0, 0, 0.048), 0 12.5px 10px rgba(0, 0, 0, 0.06),
    0 22.3px 17.9px rgba(0, 0, 0, 0.072), 0 41.8px 33.4px rgba(0, 0, 0, 0.086),
    0 100px 80px rgba(0, 0, 0, 0.12);
}

.skills__title {
  color: var(--color-accent);
  margin: 1rem 0;
  font-size: 1.2rem;
}

.skills__coding {
  grid-row: span 2;
  padding: 1rem;
  background-color: var(--color-primary);
}

.skills__tools {
  padding: 1rem;
}

.skills__etc {
  padding: 1rem;
  background-color: var(--color-primary);
  filter: brightness(150%);
}

.bar {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 0.5rem;
}

.bar__metadata {
  display: flex;
  justify-content: space-between;
}

.bar__bg {
  width: 100%;
  height: 3px;
  background-color: var(--color-primary-variant);
}

.bar__value {
  background-color: var(--color-accent);
  height: 3px;
}

/* Work */
#work {
  background-color: var(--color-primary);
  color: var(--color-text);
}

.categories {
  display: flex;
  justify-content: center;
  margin: 2.5rem;
  gap: 1rem;
}

.category {
  position: relative;
  color: var(--color-text);
  font-size: 1.1rem;
  padding: 0.5rem 3rem;
  border-radius: 4px;
  border: 1px solid var(--color-accent);
  cursor: pointer;
  white-space: nowrap;
}

.category--selected {
  background-color: var(--color-accent);
  color: var(--color-primary);
}

.category__count {
  opacity: 0;
  position: absolute;
  top: -20px;
  right: 16px;
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 100%;
  background-color: var(--color-accent-variant);
  color: var(--color-text);
  transition: all 250ms ease-in;
}

.category--selected .category__count,
.category:hover .category__count {
  opacity: 1;
  top: 0;
}

.projects {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 2fr);
  gap: 1rem;
  transition: all 250ms ease-out;
}

.projects.anim-out {
  opacity: 0;
  transform: scale(0.96) translateY(20px);
}

.project {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.project__img {
  width: 100%;
}

.project__metadata {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-black);
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: all 300ms ease-in;
  transform: translateY(-10px);
}

.project__metadata:hover {
  opacity: 0.8;
  transform: translateY(0px);
}

.project__title::after {
  content: '';
  display: block;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin: 0.5rem 0;
  width: 50px;
  height: 2px;
  background-color: var(--color-accent);
}

/* Testimonial */
.testimonials {
  margin: 3rem;
}

.testimonial {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.testimonial:nth-child(even) .testimonial__img {
  order: 1;
}

.testimonial__img {
  width: 150px;
  height: 150px;
  border-radius: 100%;
  box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
}

.testimonial__bubble {
  padding: 1rem;
  box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
  border-radius: 8px;
}

.testimonial__bubble__name {
  color: var(--color-accent);
  font-weight: bold;
  filter: brightness(80%);
}

/* Arrow up */
.arrow-up {
  background-color: var(--color-primary);
  position: fixed;
  bottom: 3rem;
  right: 3rem;
  font-size: 3rem;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 100%;
  text-align: center;
  box-shadow: 5px 5px 0px 0px var(--color-accent);
  transition: opacity 200ms ease-in;
}

/* Footer */
#contact {
  position: relative;
  background-color: var(--color-primary);
  color: var(--color-text);
}

#contact::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% + 1.3px);
  height: 60px;
  overflow: hidden;
  line-height: 0;
  background-color: var(--color-white);
  mask: var(--divider-arrow);
  -webkit-mask: var(--divider-arrow);
}

.contact__links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  font-size: 2rem;
}

.contact__link {
  transition: color 250ms ease-in;
}

.contact__link:hover {
  color: var(--color-accent);
}

@media screen and (max-width: 768px) {
  .section {
    padding: 5rem 2rem;
  }

  .title {
    font-size: 2rem;
  }

  .description {
    font-size: 1rem;
  }

  .header {
    flex-direction: column;
    align-items: start;
    background-color: var(--color-primary);
  }

  .header__toggle {
    display: block;
  }

  .header__menu {
    display: none;
    flex-direction: column;
    text-align: center;
    margin: 1rem 4rem;
    gap: 1rem;
  }

  .header__menu.open {
    display: flex;
  }

  .header__nav {
    width: 100%;
  }

  #home {
    padding-bottom: 3rem;
  }

  .home__title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
  }

  .majors {
    flex-direction: column;
    align-items: center;
  }

  .major {
    max-width: 25rem;
  }

  .job {
    justify-content: center;
  }

  .skills {
    grid-template-columns: 1fr;
  }

  .categories {
    flex-direction: column;
  }

  .category {
    width: 100%;
  }

  .projects {
    grid-template-columns: repeat(2, 1fr);
  }

  .testimonial {
    flex-direction: column;
  }

  .testimonial:nth-child(even) .testimonial__img {
    order: 0;
  }

  .arrow-up {
    font-size: 2rem;
    width: 3rem;
    height: 3rem;
    bottom: 1.5rem;
    right: 1.5rem;
  }
}
