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

body {
    font-family: "Raleway", sans-serif;
  font-optical-sizing: auto;
  font-style:normal;
    letter-spacing: 1px;
    padding: 0 96px;
    background-color: #1e1e1e;
}

header {
    height: 80px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: right;
}

header ul {
    display: flex;
    list-style: none;
}

header li {
    margin-right: 24px;
}

header a {
    color: rgb(255, 255, 255);
    text-decoration: none;
    display: flex;
    align-items: center;
    font-weight:normal;
}

.about-link {
    color: #ffffff;
    text-decoration: none;
    position: relative;
    display: inline-block;
}

.about-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -3px;
    width: 0;
    height: 2px;
    background-color: #ffffff;
    transition: width 0.3s ease-in-out, left 0.3s ease-in-out;
}

.about-link:hover::after {
    width: 100%;
    left: 0;
}

.active-link {
    color: #ffffff;
    font-weight: bolder;
    text-decoration: none;
    border-bottom: 2px solid currentColor;
}

#menu-button {
    display: none;
    background-color: #ffffff;
    color: rgb(255, 255, 255);
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

#menu-button:focus {
    outline: none;
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #101010;
    color: white;
    border: 1px  solid #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.back-to-top:hover {
    background-color: #4e4e4e;
}

.back-to-top.show {
    opacity: 1;
}

.banner {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.banner-text {
    flex: 1;
    padding-left: 2rem;
}

.banner h1 {
        white-space:nowrap;
        font-size:80px;
        color: #ffffff;
}

.banner p {
    font-size: 18px;
    color: #b8b8b8;
    margin-top: 20px;
}

.banner-image {
    flex: 1;
    text-align: right;
}

.banner-image img {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.portfolio {
  padding: 50px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.portfolio-item {
  display: flex;
  flex-direction: column;
  text-align: center;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

}

.image-wrapper {
  width: 100%;
  aspect-ratio: 808 / 632;
  overflow: hidden;
  position: relative;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.image-wrapper:hover img {
  transform: scale(1.1);
}

.portfolio-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 808 / 632;
  object-fit: cover;
  display: block;
}

.portfolio-item h2 {
  font-size: 16px;
  padding: 20px;
  text-align: left;
  color: #333;
}

.portfolio-item a {
    display: block;
    padding: 20px;
    text-align: right;
    color: #101010;
    font-size: 12px;
    text-decoration: none;
    background-color: #ffffff;
    position: relative;
    overflow: hidden;
    transition: color 0.3s ease;
    margin-top: auto;
}

.portfolio-item a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: #101010;
    color: #ffffff;
    transition: left 0.3s ease;
    z-index: 0;
}

.portfolio-item a:hover::before {
    left: 0;
}

.portfolio-item a:hover {
    color: #ffffff;
}

.portfolio-item a span {
    position: relative;
    z-index: 1;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #1e1e1e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    z-index: 9999;
}

.loading-gif {
    width: 30px;
    height: auto;
    margin-bottom: 8px;
}

.progress-bar {
    width: 150px;
    height: 3px;
    background: #1e1e1e;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress {
    height: 100%;
    width: 0%;
    background-color: #ffffff;
    transition: width 0.1s;
}

.percentage {
    font-size: 12px;
}

@media (max-width: 768px) {
    body {
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
   } 

    header {
        height: 40px;

    }

    header ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 45px;
        right: 0;
        background-color: rgba(0, 0, 0, 0.9);
        width: 100%;
        padding:10px;
        text-align: right;
        transition: max-height 0.5s ease-out;
        overflow: hidden;
        max-height: 0;
        z-index: 10000;
    }
    
    header ul.show {
        display: flex;
        max-height: 300px;
    }
    
    header li {
        display: flex;
        margin: 10px 0;
        padding-left: 15px;
        font-size: 12px;
        text-align: right;
    }

    header li :hover{
        background-color: rgba(100, 100, 100, 0.9);
    }

    .active-link {
        text-align: right;
        width: fit-content;
    }

    #menu-button {
        display: block;
        background-color: rgba(255, 255, 255, 0);
        color: rgb(255, 255, 255);
        border: none;
        font-size: 24px;
        cursor: pointer;
        padding: 10px;
        position: relative;
        border-radius: 100px;
    }

    #menu-button .bar {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        background-color: rgb(255, 255, 255);
        transition: all 0.3s;
        border-radius: 100px;
    }

    #menu-button.change .bar1 {
        transform: rotate(-45deg) translate(-5px, 6px);
        border-radius: 100px;
    }

    #menu-button.change .bar2 {
        opacity: 0;
        border-radius: 100px;
    }

    #menu-button.change .bar3 {
        transform: rotate(45deg) translate(-5px, -6px);
        border-radius: 100px;
    }

    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .banner {
        display: flex;
        flex-direction: column-reverse;
        align-items: center;
        padding: 0;
    }
    
    .banner-text, .banner-image {
        padding: 0;
    }
    
    .banner-image {
    text-align: center;
    margin-bottom: 24px;
    }
    
    .banner h1 {
        font-size: 28px;
    }
    
    .banner p {
        margin: 0;
        font-size: 16px;
    }
    
    .portfolio {
  padding: 0;
  margin: 48px 0;
}
    .portfolio-grid {
    grid-template-columns: 1fr;
  }

    .back-to-top:hover {
        background-color: #101010;
    }
}

.loading-page {
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(to right, #000000, #101010, #000000);
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    color: #191654;
    z-index: 1000;
    opacity: 1;
    transition: opacity 1.5s ease; /* 平滑過渡效果 */
}

#svg {
    height: 150px;
    width: 150px;
    stroke: white;
    fill-opacity: 0;
    stroke-width: 3px;
    stroke-dasharray: 4500;
    animation: draw 3s ease;
}

@keyframes draw {
    0% {
        stroke-dashoffset: 4500;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.name-container {
    height: 30px;
    overflow: hidden;
}

.logo-name {
    color: #fff;
    font-size: 20px;
    letter-spacing: 12px;
    text-transform: uppercase;
    margin-left: 20px;
    font-weight: bolder;
}

#loading-page, .logo-name {
    transition: none;
}