@font-face {
    font-family: Atteron;
    src: url(Atteron.otf) format("truetype");
}

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

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Cardo', serif;
    background-color: #E3D5C9;
    color: #2c2c2c;
    line-height: 1.8;
    font-weight: 400;
}

/* 載入動畫 */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #E3D5C9;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    /* 移除 transition，讓背景立即顯示 */
    opacity: 1;
    visibility: visible;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0s, visibility 0s; /* 立即隱藏 */
}

.loader.fade-out {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.2s ease, visibility 1.2s ease; /* 只有淡出時才有過渡 */
}

.loader-content {
    text-align: center;
}

.loader-text {
    font-family: 'Atteron', serif;
    font-size: 2.5rem;
    color: #8b7d6b;
    letter-spacing: 3px;
    margin-bottom: 2rem;
    opacity: 0;
    animation: gentleFadeIn 2s ease-out 0.3s forwards;
}

.loader-line {
    width: 60px;
    height: 1px;
    background: #8b7d6b;
    margin: 0 auto;
    transform: scaleX(0);
    animation: expandLine 1.5s ease-out 1s forwards;
}

@keyframes gentleFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes expandLine {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* 語言切換器 */
.language-switcher {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1001;
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: 30px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(215, 193, 173, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.language-switcher:hover {
    background: rgba(255, 255, 255, 0.98);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.lang-button {
    background: none;
    border: none;
    color: #6b5b4d;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.lang-button:hover {
    background: rgba(107, 91, 77, 0.1);
    color: #2c2c2c;
}

.lang-button.active {
    background: #6b5b4d;
    color: white;
    transform: scale(1.05);
}

/* 導航欄 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(241, 217, 195, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(215, 193, 173, 0.3);
    z-index: 1000;
    transition: all 0.6s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
}

.nav-logo {
    font-family: 'Atteron', serif;
    font-size: 18px;
    color: #6b5b4d;
    text-decoration: none;
    letter-spacing: 1px;
    transition: color 0.4s ease;
}

.nav-logo:hover {
    color: #2c2c2c;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 50px;
}

.nav-item a {
    text-decoration: none;
    color: #6b5b4d;
    font-size: 14px;
    letter-spacing: 1px;
    transition: color 0.4s ease;
    position: relative;
    padding: 10px 0;
}

.nav-item a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: #2c2c2c;
    transition: width 0.6s ease;
}

.nav-item a:hover {
    color: #2c2c2c;
}

.nav-item a:hover::after {
    width: 100%;
}

/* 漢堡選單 checkbox 和按鈕 */
.navbar-checkbox {
    display: none;
}

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

.mobile-menu-toggle label {
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.mobile-menu-toggle label:hover {
    background: rgba(107, 91, 77, 0.1);
}

.mobile-menu-toggle img {
    width: 28px;
    height: 28px;
    filter: brightness(0) saturate(100%) invert(45%) sepia(12%) saturate(1345%) hue-rotate(21deg) brightness(92%) contrast(90%);
    transition: all 0.3s ease;
}

.mobile-menu-toggle label:hover img {
    filter: brightness(0) saturate(100%) invert(18%) sepia(7%) saturate(1038%) hue-rotate(21deg) brightness(95%) contrast(95%);
}

/* 手機版選單 */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 320px;
    height: 100vh;
    background: rgba(241, 217, 195, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(215, 193, 173, 0.3);
    z-index: 999;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    padding: 100px 30px 30px;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 20px;
}

.mobile-menu-item {
    border-bottom: 1px solid rgba(215, 193, 173, 0.3);
}

.mobile-menu-item:last-child {
    border-bottom: none;
}

.mobile-menu-item a {
    display: block;
    text-decoration: none;
    color: #6b5b4d;
    font-size: 18px;
    letter-spacing: 1px;
    padding: 25px 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-weight: 500;
}

.mobile-menu-item a::before {
    content: '';
    position: absolute;
    left: -100%;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(107, 91, 77, 0.1);
    transition: left 0.3s ease;
    z-index: -1;
}

.mobile-menu-item a:hover,
.mobile-menu-item a:active {
    color: #2c2c2c;
    padding-left: 15px;
}

.mobile-menu-item a:hover::before,
.mobile-menu-item a:active::before {
    left: 0;
}

/* 遮罩層 */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* 主視覺 */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E3D5C9 0%, #f0e6db 100%);
    padding-top: 80px; /* 為固定導航欄留出空間 */
}

.hero-content {
    text-align: center;
    max-width: 800px;
    padding: 0 40px;
}

.hero-subtitle {
    font-size: 14px;
    color: #6b5b4d;
    letter-spacing: 2px;
    margin-bottom: 30px;
    opacity: 0;
    animation: heroFadeIn 1.2s ease-out 0.8s forwards;
}

.hero-title {
    font-family: 'Atteron', serif;
    font-size: clamp(3rem, 8vw, 5rem);
    color: #2c2c2c;
    line-height: 1.3;
    letter-spacing: 2px;
    margin-bottom: 40px;
    opacity: 0;
    animation: heroFadeIn 1.2s ease-out 1.2s forwards;
}

.hero-description {
    font-size: 16px;
    color: #6b5b4d;
    line-height: 1.8;
    margin-bottom: 60px;
    opacity: 0;
    animation: heroFadeIn 1.2s ease-out 1.6s forwards;
}

.hero-links {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
}

.social-link {
    text-decoration: none;
    color: #6b5b4d;
    transition: all 0.6s ease;
    opacity: 0;
}

.social-link:nth-child(1) { animation: heroFadeIn 1.2s ease-out 2.0s forwards; }
.social-link:nth-child(2) { animation: heroFadeIn 1.2s ease-out 2.2s forwards; }
.social-link:nth-child(3) { animation: heroFadeIn 1.2s ease-out 2.4s forwards; }
.social-link:nth-child(4) { animation: heroFadeIn 1.2s ease-out 2.6s forwards; }

.social-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    border-radius: 8px;
    transition: all 0.6s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.social-link:hover {
    transform: translateY(-8px);
    color: #2c2c2c;
}

.social-link:hover .social-icon {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.social-label {
    font-size: 12px;
    letter-spacing: 1px;
}

@keyframes heroFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

/* 通用區段樣式 */
.section {
    padding: 120px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 100px;
}

.section-subtitle {
    font-size: 12px;
    color: #6b5b4d;
    letter-spacing: 3px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.section-title {
    font-family: 'Atteron', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #2c2c2c;
    line-height: 1.4;
    letter-spacing: 1px;
    margin-bottom: 30px;
}

.section-description {
    font-size: 16px;
    color: #6b5b4d;
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

/* About 區塊 */
.about-section {
    background: #ffffff;
    transform: translateX(-100px);
    opacity: 0;
    transition: all 1.2s ease;
}

.about-section.visible {
    transform: translateX(0);
    opacity: 1;
}

.cards-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.cards-grid {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.ability-card {
    display: flex;
    align-items: flex-start;
    gap: 60px;
    background: rgba(241, 217, 195, 0.3);
    border-radius: 20px;
    padding: 60px 50px;
    transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(215, 193, 173, 0.2);
    opacity: 0;
    min-height: 320px;
}

.ability-card:nth-child(1) {
    transform: translateX(-200px);
}

.ability-card:nth-child(2) {
    flex-direction: row-reverse;
    background: rgba(215, 193, 173, 0.2);
    transform: translateX(200px);
}

.ability-card:nth-child(3) {
    transform: translateX(-200px);
}

.ability-card.visible {
    opacity: 1;
    transform: translateX(0);
}

.ability-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.card-image {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    border-radius: 15px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.ability-card:hover .card-image img {
    transform: scale(1.1) rotate(2deg);
}

.card-content {
    flex: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ability-card:nth-child(2) .card-content {
    text-align: right;
}

.content-group.id .ability-card:nth-child(2) .card-content {
    text-align: right;
}

.card-title {
    font-size: 24px;
    color: #2c2c2c;
    margin-bottom: 20px;
    font-weight: 500;
    font-family: 'Atteron', serif;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.card-description {
    font-size: 16px;
    color: #6b5b4d;
    line-height: 1.8;
    text-align: justify;
    word-wrap: break-word;
}

/* Portfolio 區塊 - 更新為橫向布局 */
.portfolio-section {
    background: linear-gradient(135deg, #d7c1ad 0%, #E3D5C9 100%);
    transform: scale(0.9) rotate(-2deg);
    opacity: 0;
    transition: all 1.4s ease;
}

.portfolio-section.visible {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

.portfolio-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.portfolio-showcase {
    display: flex;
    align-items: center;
    min-height: 80vh;
    gap: 60px; /* 內容和圖片之間的間距 */
}

.portfolio-content {
    flex: 1;
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.portfolio-content h3 {
    font-family: 'Atteron', serif;
    font-size: 28px;
    color: #2c2c2c;
    margin-bottom: 40px;
    letter-spacing: 1px;
}

.portfolio-images {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 20px;
}

.large-portfolio-image {
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transition: transform 0.8s ease;
    height: 300px; /* 固定高度 */
}

.large-portfolio-image:hover {
    transform: scale(1.05) rotate(1deg);
}

.large-portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

.portfolio-list {
    list-style: none;
    margin-top: 20px;
}

.portfolio-item {
    margin-bottom: 30px;
    padding: 25px 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.6s ease;
    opacity: 0;
    transform: translateX(-50px);
}

.portfolio-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.portfolio-item:hover {
    transform: translateX(20px);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.portfolio-item a {
    text-decoration: none;
    color: #2c2c2c;
    font-size: 18px;
    font-weight: 500;
    display: block;
    transition: color 0.4s ease;
    line-height: 1.4;
}

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

/* Contact 區塊 */
.contact-section {
    background: #f1d9c3;
    padding: 120px 0 150px;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.contact-section.visible {
    opacity: 1;
}

.info-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 40px;
}

.info-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 100px;
    margin-top: 80px;
    flex-wrap: wrap;
}

.info-item {
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: all 0.8s ease;
    border: 2px solid rgba(215, 193, 173, 0.3);
    opacity: 0;
    transform: scale(0) rotate(180deg);
    padding: 20px;
    box-sizing: border-box;
}

.info-item.visible {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.info-item:hover {
    transform: translateY(-20px) scale(1.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.6);
}

.info-label {
    font-size: 12px;
    color: #6b5b4d;
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.info-value {
    font-size: 14px;
    color: #2c2c2c;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    text-align: center;
    line-height: 1.4;
}

.info-value a {
    color: #2c2c2c;
    text-decoration: none;
    transition: color 0.4s ease;
}

.info-value a:hover {
    color: #6b5b4d;
}

/* 頁腳 */
.footer {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    padding: 60px 0;
    text-align: center;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.footer-text {
    font-size: 12px;
    color: #6b5b4d;
    letter-spacing: 1px;
}

/* 語言內容控制 */
.content-group {
    display: none;
    width: 100%;
}

.content-group.active {
    display: block;
}

/* 語言切換刷屏動畫 */
.language-wipe-overlay {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -100%;
    width: 100%;
    background: rgba(245, 245, 245, 0.85);
    z-index: 998; /* 在導航欄(1000)和語言切換器(1001)下方 */
    transition: transform 0.15s ease-out;
    backdrop-filter: blur(2px);
}

.language-wipe-overlay.wipe-in {
    transform: translateX(100%);
}

.language-wipe-overlay.wipe-out {
    transform: translateX(200%);
}

/* 響應式設計 */
@media (max-width: 768px) {
    /* 導航欄手機版調整 */
    .nav-container {
        padding: 15px 20px;
        display: block;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 20px;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(215, 193, 173, 0.3);
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-item a {
        display: block;
        padding: 20px 0;
        font-size: 16px;
        position: relative;
        overflow: hidden;
    }
    
    .nav-item a::before {
        content: '';
        position: absolute;
        left: -100%;
        top: 0;
        width: 100%;
        height: 100%;
        background: rgba(107, 91, 77, 0.1);
        transition: left 0.3s ease;
        z-index: -1;
    }
    
    .nav-item a:hover::before {
        left: 0;
    }
    
    .nav-item a::after {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
        position: absolute;
        right: 20px;
        top: 15px;
    }
    
    /* 當 checkbox 被勾選時顯示選單 */
    .navbar-checkbox:checked ~ .nav-menu {
        display: flex;
    }
    
    /* 調整選單項目大小 */
    .mobile-menu-item a {
        font-size: 18px;
        padding: 25px 0;
    }
    
    /* 語言切換器手機版調整 */
    .language-switcher {
        bottom: 20px;
        left: 20px;
        padding: 10px 14px;
        z-index: 1002;
    }

    .lang-button {
        font-size: 11px;
        padding: 6px 10px;
    }

    /* 主視覺區調整 */
    .hero-section {
        height: 100vh;
        padding-top: 60px; /* 導航欄空間 */
        padding-bottom: 80px; /* 語言切換器空間 */
    }

    .hero-content {
        padding: 0 20px;
        height: 100%; /* 占滿剩餘空間 */
        display: flex;
        flex-direction: column;
        justify-content: space-evenly; /* 平均分配空間 */
    }

    .hero-subtitle {
        margin-bottom: 0; /* 移除底部間距，讓 space-evenly 控制 */
        font-size: 12px;
    }

    .hero-title {
        margin-bottom: 0;
        font-size: clamp(2.5rem, 6vw, 3.5rem);
        line-height: 1.2;
    }

    .hero-description {
        margin-bottom: 0;
        font-size: 14px;
        line-height: 1.6;
    }

    .hero-links {
        gap: 25px;
        margin: 0; /* 移除外邊距 */
    }

    .social-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 8px;
    }

    .social-label {
        font-size: 10px;
        letter-spacing: 0.5px;
    }

    .hero-links {
        gap: 30px; /* 手機版縮小間距 */
    }

    .social-icon {
        width: 60px;
        height: 60px;
    }

    .social-label {
        font-size: 11px; /* 確保標籤文字顯示 */
        letter-spacing: 0.5px;
        margin-top: 8px; /* 給圖標和文字間留空間 */
    }

    /* 區段間距調整 */
    .section {
        padding: 80px 0;
    }

    .section-header {
        margin-bottom: 60px;
    }

    .cards-container,
    .info-container,
    .footer-content {
        padding: 0 20px;
    }

    /* 能力卡片手機版調整 - 解決文字堆疊問題 */
    .ability-card {
        flex-direction: column !important;
        text-align: center !important;
        gap: 30px;
        min-height: auto;
        align-items: center;
        padding: 40px 30px;
    }

    .card-content {
        text-align: center !important;
        width: 100%;
    }

    .card-title {
        font-size: 18px;
        line-height: 1.3;
        margin-bottom: 15px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .card-description {
        font-size: 14px;
        line-height: 1.6;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .card-image {
        width: 150px;
        height: 150px;
    }

    /* Portfolio 手機版調整 - 改為直向 */
    .portfolio-showcase {
        flex-direction: column; /* 手機版改為直向 */
        gap: 40px;
        min-height: auto;
    }

    .portfolio-content {
        padding: 40px 30px;
        order: 1; /* 內容在上方 */
    }

    .portfolio-content h3 {
        font-size: 22px;
        margin-bottom: 30px;
        text-align: center;
    }

    .portfolio-images {
        order: 2; /* 圖片在下方 */
        padding: 20px;
        gap: 20px;
    }

    .large-portfolio-image {
        height: 200px; /* 手機版降低高度 */
    }

    .portfolio-item {
        padding: 20px 25px;
        margin-bottom: 25px;
    }

    .portfolio-item a {
        font-size: 16px;
        text-align: center;
    }

    .portfolio-item:hover {
        transform: translateY(-5px); /* 手機版改為上下移動 */
    }

    /* 聯絡資訊手機版調整 */
    .info-grid {
        gap: 40px;
    }

    .info-item {
        width: 150px;
        height: 150px;
        padding: 15px;
    }

    .info-value {
        font-size: 12px;
        line-height: 1.3;
    }
}

/* 平板版調整 */
@media (max-width: 1024px) and (min-width: 769px) {
    .portfolio-showcase {
        gap: 40px;
    }

    .portfolio-content {
        padding: 50px 35px;
    }

    .portfolio-content h3 {
        font-size: 24px;
    }

    .large-portfolio-image {
        height: 250px;
    }
}