:root {
    --dark: #0d0d0f;
    --gray: #6c757d;
    --light: #f7f7f7;
    --line: #e8e8e8;
}

body {
    margin: 0;
    font-family: "Noto Sans TC","Microsoft JhengHei",Arial,sans-serif;
    color: #111;
}

/* ===== NAV ===== */
.site-header {
    background: #0d0d0f;
}

.nav-link {
    margin-left: 1rem;
}

/* ===== HERO FINAL ===== */

.hero-slider {
    position: relative;
    height: 90vh;
    min-height: 620px;
    overflow: hidden;
    background: #000;
}

/* 圖片 fallback：永遠在底層 */
.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1);
    transition: opacity 1.2s ease;
    z-index: 0;
}

.hero-slide.active {
    opacity: 1;
    animation: heroZoom 12s ease forwards;
}

/* Ken Burns */
@keyframes heroZoom {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.12);
    }
}

/* 影片：在圖片上層 */
.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    z-index: 1;
    transition: opacity 1s ease;
}

.hero-video.is-visible {
    opacity: 1;
}

.hero-video.is-hidden {
    display: none;
}

/* 遮罩 */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 2;
}

/* 內容 */
.hero-content {
    position: relative;
    z-index: 3;
    color: #fff;
    top: 50%;
    transform: translateY(-50%);
}

/* 文字 */
.hero-content h1 {
    font-size: clamp(2.8rem,6vw,5.5rem);
    font-weight: 900;
}

.hero-desc {
    color: rgba(255,255,255,.9);
}

/* 文字淡入 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s forwards;
}

.delay-1 {
    animation-delay: .25s;
}

.delay-2 {
    animation-delay: .5s;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== SECTION ===== */

.section-block {
    padding: 5rem 0;
}

.section-heading {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 3rem;
}

.section-heading h2 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.section-heading p {
    color: var(--gray);
}

.work-card {
    display: block;
    color: #111;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.1);
    transition: .3s;
}

.work-card:hover {
    transform: translateY(-5px);
    color: #111;
}

.work-image-wrap {
    aspect-ratio: 4 / 5;
    background: #eee;
    overflow: hidden;
}

.work-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-info {
    padding: 1rem;
}

.work-category {
    font-size: 12px;
    color: #999;
    letter-spacing: 1px;
}

.work-tags {
    margin-top: 6px;
}

.tag-link {
    display: inline-block;
    font-size: 13px;
    color: #777;
    text-decoration: none;
    margin-right: 6px;
    transition: all 0.2s ease;
}

.tag-link:hover {
    color: #000;
    transform: translateY(-1px);
}

.work-location {
    font-size: 13px;
    color: #aaa;
    margin-top: 4px;
}

.brand-section {
    background: #f5f5f5;
    padding: 5rem 0;
}

.brand-box {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    padding: 4rem;
    border-radius: 28px;
    text-align: center;
    box-shadow: 0 20px 70px rgba(0,0,0,.08);
}

.brand-box h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
}

.brand-box p {
    color: var(--gray);
    line-height: 1.9;
    margin-bottom: 2rem;
}

/* ===== PAGE HERO ===== */
.page-hero {
    background: #0d0d0f;
    color: #fff;
    padding: 5rem 0;
    text-align: center;
}

.page-hero h1 {
    font-size: 3rem;
    font-weight: 800;
}

.page-hero p {
    color: rgba(255,255,255,.75);
}

.portfolio-filter {
    background: #f8f8f8;
    padding: 1.25rem;
    border-radius: 18px;
}

.empty-box {
    padding: 4rem 2rem;
    border: 1px dashed var(--line);
    text-align: center;
    color: var(--gray);
    border-radius: 20px;
}

/* ===== DETAIL ===== */
.detail-section {
    padding: 5rem 0;
}

.detail-header {
    max-width: 850px;
    margin: 0 auto 2rem;
    text-align: center;
}

.detail-header h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.detail-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    color: var(--gray);
    flex-wrap: wrap;
}

.detail-image-wrap {
    max-width: 1100px;
    margin: 0 auto;
    border-radius: 28px;
    overflow: hidden;
    background: #eee;
    box-shadow: 0 22px 70px rgba(0,0,0,.16);
}

.detail-image {
    width: 100%;
    display: block;
}

.detail-description {
    max-width: 820px;
    margin: 3rem auto 0;
    font-size: 1.1rem;
    line-height: 2;
    color: #333;
}

.related-section {
    background: #f7f7f7;
}

/* ===== FOOTER ===== */
.site-footer {
    background: #0d0d0f;
    color: rgba(255,255,255,.8);
    padding: 2.5rem 0;
}

.site-footer p {
    font-weight: 700;
    letter-spacing: .12em;
}

/* ===== LIGHTBOX ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 92vw;
    max-height: 84vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 80px rgba(0,0,0,.5);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    background: none;
    border: none;
    color: #fff;
    font-size: 42px;
    cursor: pointer;
    z-index: 2;
}

.lightbox-title {
    position: absolute;
    bottom: 28px;
    color: #fff;
    font-size: 16px;
    letter-spacing: .05em;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 72px;
    border: none;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 54px;
    line-height: 1;
    cursor: pointer;
    border-radius: 12px;
    z-index: 2;
    transition: .2s;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,.24);
}

.lightbox-prev {
    left: 32px;
}

.lightbox-next {
    right: 32px;
}

.lightbox-trigger {
    cursor: zoom-in;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .hero-slider {
        height: 75vh;
        min-height: 520px;
    }

    .nav-link {
        margin-left: 0;
    }

    .brand-box {
        padding: 2rem;
    }

    .section-block {
        padding: 3.5rem 0;
    }

    .lightbox-nav {
        width: 44px;
        height: 60px;
        font-size: 44px;
    }

    .lightbox-prev {
        left: 12px;
    }

    .lightbox-next {
        right: 12px;
    }

    .lightbox-title {
        bottom: 18px;
    }
}
/* ===== 文章段落版 ===== */
.article-content {
    max-width: 820px;
    margin: 3rem auto 0;
    font-size: 1.1rem;
    line-height: 2;
    color: #333;
}

.article-content p {
    margin-bottom: 1.6rem;
    white-space: pre-line;
}
/* ===== PORTFOLIO MASONRY / HOVER ===== */

.masonry-grid {
    column-count: 3;
    column-gap: 24px;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 24px;
}

.portfolio-hover-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: #eee;
    box-shadow: 0 12px 36px rgba(0,0,0,.08);
}

.portfolio-hover-image {
    width: 100%;
    display: block;
    cursor: zoom-in;
    transition: transform .45s ease, filter .45s ease;
}

.portfolio-hover-card:hover .portfolio-hover-image {
    transform: scale(1.05);
    filter: brightness(.55);
}

.portfolio-hover-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 28px;
    color: #fff;
    opacity: 0;
    transition: opacity .35s ease;
    background: linear-gradient(
        to top,
        rgba(0,0,0,.82),
        rgba(0,0,0,.4),
        rgba(0,0,0,.05)
    );
}

.portfolio-hover-card:hover .portfolio-hover-overlay {
    opacity: 1;
}

.portfolio-hover-content h3 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: .75rem;
}

.portfolio-hover-content p {
    font-size: .95rem;
    line-height: 1.8;
    margin-bottom: .9rem;
    color: rgba(255,255,255,.88);
    white-space: pre-line;
}

.portfolio-hover-meta {
    font-size: .82rem;
    color: rgba(255,255,255,.75);
    margin-bottom: 1rem;
}

.portfolio-hover-meta span {
    margin-right: .35rem;
}

.portfolio-detail-link {
    display: inline-block;
    padding: .45rem .9rem;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 999px;
    color: #fff;
    font-size: .85rem;
    text-decoration: none;
    transition: .2s;
}

.portfolio-detail-link:hover {
    background: #fff;
    color: #111;
}

@media (max-width: 992px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 576px) {
    .masonry-grid {
        column-count: 1;
    }

    .portfolio-hover-overlay {
        opacity: 1;
        padding: 22px;
    }
}
.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease;
}

.hero-slide.active {
    opacity: 1;
}