/* --- 變數設定 (維持不變) --- */
:root {
    --bg-color: #030305;
    --glass-bg: rgba(20, 20, 25, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-blue: #00d2ff;
    --accent-purple: #9d00ff;
    --discord-color: #5865F2;
    --yt-color: #FF0000;
    --ig-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --accent-chrome: linear-gradient(135deg, #e0e0e0 0%, #888 50%, #fff 100%);
    --font-head: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- 背景與游標特效 (維持不變) --- */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    animation: floatShape 10s infinite alternate ease-in-out;
    opacity: 0.6;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-blue), transparent 70%);
    top: -10%;
    left: -10%;
}

.shape-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-purple), transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

.chrome-sphere {
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 30% 30%, #fff, #ccc, #555, #222);
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset -10px -10px 20px rgba(0, 0, 0, 0.8);
    z-index: -1;
    opacity: 0.8;
    pointer-events: none;
}

.sphere-1 {
    top: 20%;
    right: 15%;
    width: 100px;
    height: 100px;
    animation: floatChrome 6s infinite ease-in-out;
}

.sphere-2 {
    bottom: 15%;
    left: 10%;
    width: 80px;
    height: 80px;
    animation: floatChrome 8s infinite ease-in-out reverse;
}

@keyframes floatShape {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

@keyframes floatChrome {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(10deg);
    }

    100% {
        transform: translateY(0) rotate(0deg);
    }
}

/* Cursor */
#cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-blue);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    transition: width 0.2s, height 0.2s, background-color 0.2s;
    mix-blend-mode: difference;
}

#cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background: var(--accent-blue);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
}

#cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.15), transparent 60%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9998;
}

body.hovering #cursor {
    width: 60px;
    height: 60px;
    background-color: rgba(0, 210, 255, 0.1);
    border-color: var(--accent-blue);
    backdrop-filter: invert(1);
}

.particle {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    animation: pop 0.6s ease-out forwards;
    z-index: 9999;
}

@keyframes pop {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* --- Nav (放大版) --- */
nav {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1400px;
    padding: 25px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 60px;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.logo {
    font-family: var(--font-head);
    font-weight: 900;
    font-size: 1.8rem;
    background: var(--accent-chrome);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 3px;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    position: relative;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--accent-blue);
}

/* --- Section Defaults --- */
section {
    padding: 140px 10%;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h2 {
    font-family: var(--font-head);
    font-size: 3.5rem;
    margin-bottom: 70px;
    background: linear-gradient(90deg, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    align-self: center;
}

/* --- Hero --- */
#hero {
    height: 100vh;
    text-align: center;
    align-items: center;
}

.hero-badge {
    padding: 10px 25px;
    border: 1px solid var(--accent-blue);
    border-radius: 50px;
    color: var(--accent-blue);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 25px;
    background: rgba(0, 210, 255, 0.1);
    display: inline-block;
}

.hero-title {
    font-family: var(--font-head);
    font-size: 6rem;
    line-height: 1.1;
    margin-bottom: 30px;
    font-weight: 900;
}

.hero-title span {
    display: block;
    background: linear-gradient(to right, #fff, #888, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: shine 3s linear infinite;
}

.accent-text {
    color: var(--accent-blue);
    -webkit-text-fill-color: var(--accent-blue) !important;
    text-shadow: 0 0 30px rgba(0, 210, 255, 0.4);
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.cta-button {
    padding: 20px 60px;
    border-radius: 50px;
    background: var(--text-main);
    color: #000;
    font-weight: 700;
    text-decoration: none;
    font-size: 1.2rem;
    display: inline-block;
    transition: transform 0.3s;
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

/* --- Portfolio (Grid & Cards Updated) --- */
.portfolio-grid {
    display: grid;
    /* Auto-fit 確保如果空間足夠，自動併排；空間不足，自動換行。minmax(380px) 確保卡片不會太小 */
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 50px;
    width: 100%;
}

.project-card {
    display: flex;
    flex-direction: column;
    /* 確保內容垂直排列 */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    position: relative;
    transform-style: preserve-3d;
    text-decoration: none;
    color: inherit;
    height: 100%;
    /* 讓同一列的卡片等高 */
}

/* 影片類型才有的互動 */
.project-card:not(.static-case):hover {
    transform: translateY(-12px) rotateX(2deg);
    border-color: var(--accent-blue);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

/* 平面類型 (static-case) 的互動：稍微浮起，但不發光 */
.project-card.static-case {
    cursor: default;
    /* 恢復預設游標 */
}

/* 如果平面設計有連結 (例如 Behance)，則加回手型游標 */
a.project-card.static-case {
    cursor: none;
    /* 保持自定義游標 */
}

a.project-card.static-case:hover {
    transform: translateY(-5px);
    border-color: var(--accent-purple);
    /* 平面設計改用紫色邊框 */
}

.media-container {
    width: 100%;
    /* 使用 aspect-ratio 鎖定 16:9 比例，避免圖片載入時跳動 */
    aspect-ratio: 16 / 9;
    background: #000;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}

.media-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 確保圖片填滿且不變形 */
    transition: transform 0.5s ease;
}

.project-card:hover .media-thumb {
    transform: scale(1.05);
    /* 滑鼠懸停時圖片微放大 */
}

/* 播放按鈕圖層 */
.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 70px;
    height: 70px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--accent-blue);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.4s;
    z-index: 10;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}

.play-icon-overlay::before {
    content: '▶';
    color: var(--accent-blue);
    font-size: 28px;
    margin-left: 5px;
}

/* 只有在 hover 時且不是平面設計類別時，才顯示播放按鈕 */
.project-card:not(.static-case):hover .play-icon-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 隱藏平面設計的播放按鈕 */
.static-case .play-icon-overlay {
    display: none;
}

.card-info {
    padding: 35px;
    flex-grow: 1;
    /* 確保內容撐開高度 */
}

.card-tags {
    font-size: 0.85rem;
    color: var(--accent-purple);
    text-transform: uppercase;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    font-family: var(--font-head);
}

.card-desc {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* --- Social Hub (維持不變) --- */
.social-hub {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.discord-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.2), rgba(88, 101, 242, 0.05));
    border: 2px solid rgba(88, 101, 242, 0.5);
    border-radius: 40px;
    padding: 50px;
    margin-bottom: 40px;
    transition: 0.4s;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.discord-card:hover {
    background: rgba(88, 101, 242, 0.8);
    border-color: #fff;
    transform: scale(1.02);
    box-shadow: 0 0 60px rgba(88, 101, 242, 0.4);
}

.discord-icon svg {
    width: 80px;
    height: 80px;
    fill: #fff;
    margin-bottom: 20px;
}

.discord-text {
    color: #fff;
    font-family: var(--font-head);
    font-size: 1.8rem;
    font-weight: 700;
}

.discord-sub {
    color: rgba(255, 255, 255, 0.7);
    margin-top: 10px;
    font-size: 1rem;
}

.social-grid {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.social-btn {
    flex: 1;
    min-width: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 25px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    font-size: 1.2rem;
    transition: 0.3s;
    backdrop-filter: blur(10px);
}

.social-btn svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.social-btn.ig:hover {
    background: var(--ig-gradient);
    transform: translateY(-5px);
}

.social-btn.yt:hover {
    background: #cc0000;
    transform: translateY(-5px);
}

/* --- Services (維持不變) --- */
.services-wrapper {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 60px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
}

.service-item {
    flex: 1 1 300px;
    padding: 30px;
    transition: 0.3s;
    border-radius: 20px;
}

.service-item:hover {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 25px;
    color: var(--accent-blue);
}

.tools-container {
    margin-top: 25px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tool-pill {
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    font-size: 0.9rem;
    border: 1px solid transparent;
    transition: 0.3s;
}

.tool-pill:hover {
    border-color: var(--accent-blue);
    background: rgba(0, 210, 255, 0.1);
    color: var(--accent-blue);
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 60px 20px;
    color: #d1d1d1;
    font-size: 1rem;
    font-weight: 600;
    position: relative;
    z-index: 10;
}

.footer a {
    color: #0fefff;            /* 藍色：科技感、明顯可點 */
    text-decoration: none;
    font-weight: 700;          /* Plew 再強調一些 */
    transition: 0.25s ease;
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 3.5rem;
    }

    nav {
        padding: 15px 30px;
        width: 90%;
        top: 20px;
    }

    .nav-links {
        display: none;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    /* 手機版單欄 */
    #cursor,
    #cursor-dot,
    #cursor-glow {
        display: none;
    }

    * {
        cursor: auto;
    }
}