:root {
    --bg-color: #f4f1ea; /* 米白紙張質感 */
    --text-color: #2b2b2b;
    --accent-pink: #d88c9a;
    --accent-teal: #81aeb3;
    --font-main: 'Cormorant Garamond', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow-x: hidden; /* 防止水平滾動條 */
}

/* 導航列 */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 20px 50px;
    z-index: 100;
    mix-blend-mode: multiply; /* 讓文字融入背景 */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* 滾動後的導航列樣式 */
nav.scrolled {
    background-color: rgba(255, 255, 255, 0.9); /* 半透明白底 */
    mix-blend-mode: normal; /* 恢復正常混合模式，讓白底蓋過內容 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 輕微陰影增加層次感 */
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 2px;
}

.logo a {
    text-decoration: none;
    color: inherit;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-pink);
}

/* 視差 Hero 區塊設定 */
.parallax-container {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: bottom center;
    pointer-events: none; /* 讓點擊穿透圖層 */
}

.bg {
    background-image: url('bg01.png'); 
    z-index: 1;
    opacity: 0.6;
}
.foreground {
    background-image: url('bg03.png'); 
    z-index: 1;
    opacity: 0.2;
}
.middle {
    background-image: url('bg02.png');
    z-index: 2;
}

.hero-text {
    z-index: 3;
    text-align: center;
    position: relative;
}

.hero-text h1 {
    font-size: 5rem;
    font-weight: 300;
    letter-spacing: 5px;
    margin-bottom: 10px;
}

.hero-text p {
    font-size: 1.5rem;
    font-style: italic;
    color: #2e2e2e;
}

/* 內容區塊 */
main {
    width: 100%;
    margin: 0 auto;
    position: relative;
    background: var(--bg-color);
    z-index: 5; /* 蓋過視差圖層的下半部 */
    padding: 50px 20px;
    margin-top: -1px; /* 修復與視差容器之間的滾動縫隙 */
}

.content-section {
    max-width: 1000px;
    margin: 100px auto;
    text-align: center;
}
h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    font-weight: 300;
    position: relative;
    display: inline-block;
}

/* GRIS 風格的細線裝飾 */
h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: var(--text-color);
    margin: 10px auto 0;
}

/* About Me Section */
.about-container {
    display: flex;
    align-items: center;
    gap: 2em;
}
.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
}

/* Favorites Section */
.favorites-container {
    display: flex;
    justify-content: space-between;
    gap: 2em;
    text-align: left;
}
.favorite-column ol {
    padding-left: 20px;
    font-size: 1.2em;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.card {
    height: 300px;
    background-color: #fff;
    background-size: cover;
    background-position: center;
    border: 1px solid #eee;
    position: relative; /* 為了讓偽元素正確定位 */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border-radius: 4px; /* 輕微圓角 */
    overflow: hidden; /* 確保偽元素不會超出圓角範圍 */
}

/* 卡片圖片遮罩 */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* 40% 透明黑色遮罩 */
    z-index: 0; /* 確保在內容下方，背景圖片上方 */
    transition: background-color 0.3s;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.card:hover::before {
    background-color: rgba(0, 0, 0, 0.2); /* 滑鼠懸停時讓遮罩變淡 */
}

.card-link {
    text-decoration: none;
    color: rgb(0, 0, 0); /* 讓卡片連結內的文字預設為白色 */
}

.card span {
    background-color: #78cae4;
    padding: 10px 50px;
    border-radius: 50px;
    position: relative; /* 或 z-index: 1; 確保文字在遮罩上方 */
    z-index: 1;
}

/* 作品卡片獨立樣式 */
#work-seeat {
    background-image: url('img/2C_1027_02_N.png');
}
#work-ctbc {
    background-image: url('img/Cover_CTBC.png');
}
#work-ctbc-edge {
    background-image: url('img/ctbc.jpeg');
}
#work-halo {
    background-image: url('img/Halo01.webp');
}
#work-leapware {
    background-image: url('img/LeapWare01.png');
}
#work-conceptd {
    background-image: url('img/ConceptD01.png');
}
#work-predatorquartermaster {
    background-image: url('img/QM_03.png');
}
#work-sym {
    background-image: url('img/sym_01.png');
}
.btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 30px;
    border: 1px solid var(--text-color);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
}

.btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

footer {
    text-align: center;
    padding: 50px;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* RWD 調整 */
@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 3rem;
    }
    
    nav {
        padding: 20px;
    }
    
    .nav-links {
        display: none; /* 手機版暫時隱藏，實際可做漢堡選單 */
    }

    .favorites-container {
        flex-direction: column;
        text-align: center;
    }
    .favorite-column ol {
        display: inline-block;
        text-align: left;
    }
}

/* --- 專案介紹頁樣式 --- */
.project-header {
    padding: 150px 50px 50px;
    text-align: center;
    background-color: var(--bg-color);
}

.project-header h1 {
    font-size: 4rem;
    font-weight: 300;
}

.project-header p {
    font-size: 1.3rem;
    color: #555;
    margin-top: 10px;
}

.project-image {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 50px;
    display: block;
}

.project-description {
    text-align: left;
    font-size: 1.2em;
    max-width: 800px;
    margin: 0 auto;
}

.project-gallery {
    max-width: 1000px;
    margin: 50px auto;
}

/* 專案頁面中的卡片背景圖 */
#project-img-1 {
    background-image: url('bg02.png');
    background-size: cover;
}

#project-img-2 {
    background-image: url('Untitled.png');
    background-size: cover;
}

/* --- 專案頁面特定樣式 --- */
.project-main {
    width: 100%;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.project-main .project-description {
    text-align: center !important;
}

/* --- 404 頁面特定樣式 --- */
body.error-page-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main.error-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 100px 20px;
    margin-top: 0;
}

.error-code {
    font-size: 8rem;
    font-weight: 300;
    color: var(--accent-teal);
    line-height: 1;
    margin-bottom: 10px;
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

.error-title {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.3s forwards;
}

.error-desc {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: #555;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.6s forwards;
}

.error-page .btn {
    opacity: 0;
    animation: fadeIn 1s ease-out 0.9s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}