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

body {
    font-family: Arial, sans-serif;
    scroll-behavior: smooth;
}

#section1,
#section2,
#section3,
#section4 {
    min-height: 100vh;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 3rem;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

#section1 {
    /* 海洋淺藍 → 深海藍 */
    background: linear-gradient(to bottom, #4facfe, #1d3b8b, #0a1a2f);
}

#section2 {
    /* 深海 → 靛青夜空 */
    background: linear-gradient(to bottom, #0a1a2f, #1c2d50, #2c3e70);
}

#section3 {
    /* 夜空藍 → 紫藍 */
    background: linear-gradient(to bottom, #2c3e70, #3a3a80, #4a3c91);
    padding-bottom: 250px;
}

#section4 {
    /* 紫藍 → 星空深紫黑 */
    background: linear-gradient(to bottom, #4a3c91, #2c255d, #0a0a1a);
    padding: 150px 20px;
}

#section5 {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    padding-bottom: 40px;
    padding-left: 0;
    width: 100%;
    z-index: 2;
    color: #fff;
    font-size: 1rem;
    font-weight: normal;
}

canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* section1 */
.welcome-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    font-weight: bold;
    background: linear-gradient(90deg, #8ec5fc, #e0c3fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    animation: fadeZoom 2s ease forwards;
}

@keyframes fadeZoom {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3);
    }
}

#typewriter1 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, #8ec5fc, #e0c3fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border-right: 2px solid #e0c3fc;
    animation: blink 0.7s infinite;
}

@keyframes blink {

    0%,
    100% {
        border-color: transparent;
    }

    50% {
        border-color: #ffffff;
    }
}

/* section2 */
.section-title {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(90deg, #8ec5fc, #e0c3fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #ccc;
}

section>.content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.card-container {
    margin-top: 50px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
    max-width: 1400px;
    width: 100%;
}

.card {
    height: 400px;
    perspective: 1000px;
    background: transparent;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    cursor: pointer;
}

/* 點擊或 hover 翻轉 */
.card.flipped .card-inner,
.card:hover .card-inner {
    transform: rotateY(180deg);
}

/* 正反兩面 */
.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 7px;
    backface-visibility: hidden;
    background: #111;
    box-shadow: 0 0 10px #9dac5d, 0 0 10px #9dac5d;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    text-align: center;
}

.card-front {
    background: #0a0f2c;
    opacity: 0.9;
}

.card-back {
    background: linear-gradient(#0a0f2c, #4240be);
    color: #f0f0f0;
    transform: rotateY(180deg);
}

.card h3 {
    color: #0090f0;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.card p {
    font-size: 1rem;
    line-height: 1.6;
    color: #f0f0f0;
}

/* section3 */
.work-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 1800px;
    justify-content: center;
}

.work-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #0d0d0d;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.work-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 0 20px #ffffff, 0 0 40px #9dac5d;
}

.work-card img {
    width: 100%;
    height: 425px;
    object-fit: cover;
    display: block;
}

.work-content {
    padding: 15px;
}

.work-content h3 {
    margin-bottom: 10px;
    color: #6b95e2;
}

.work-content p {
    font-size: 0.9rem;
    color: #ccc;
}

.work-link {
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* footer */
footer {
    position: relative;
    display: flex;
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: #0a0a1a;
}

.background {
    position: absolute;
    z-index: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

svg {
    position: absolute;
    top: 120px;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scale(4);
    transform-origin: bottom;
    display: block;
    pointer-events: none;
}

ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.socials {
    gap: 20px;
}

.socials a {
    font-size: 35px;
    color: #3f73d4;
    transition: color 0.3s;
}

.socials a:hover {
    color: #fdfdfd;
}

.links {
    gap: 25px;
}

.links a {
    font-size: 18px;
    text-decoration: none;
    color: #9bb5e3;
    transition: color 0.3s;
}

.links a:hover {
    color: #fdfdfd;
}

.legal {
    font-size: 16px;
    margin-bottom: -30px;
    color: #fdfdfd;
}

@media (max-width: 768px) {
    .welcome-text {
        margin-top: 25px;
        font-size: 2.5rem;
       
    }
}

@media (max-width: 480px) {
    .welcome-text {
        font-size: 2.5rem;
      
    }
}

@media (width > 620px) {
    footer section {
        align-items: center;
        padding-left: 0;
        gap: 20px;
    }
}