/* =============================================
   DYNAMIC & ANIMATED PORTFOLIO STYLES
   ============================================= */

   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gold: #D4AF37;
    --secondary-copper: #B87333;
    --dark-metal: #1a1a2e;
    --light-metal: #393e46;
    --cyan-glow: #00fff0;
    --purple-glow: #9b59b6;
    --text-light: #e8e8e8;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    color: var(--text-light);
    overflow-x: hidden;
    position: relative;
}

/* Base Styles (Background, Gears, etc.) */
.bg-animation { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: -3; background: linear-gradient(135deg, #601f24, #402b63, #27344a); animation: gradientShift 20s ease infinite; }
@keyframes gradientShift { 0%, 100% { filter: hue-rotate(0deg); } 50% { filter: hue-rotate(20deg); } }
.bg-grid { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: -2; background-image: linear-gradient(rgba(0, 255, 240, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 255, 240, 0.03) 1px, transparent 1px); background-size: 50px 50px; }
.bg-orb { position: fixed; border-radius: 50%; filter: blur(50px); opacity: 0.2; z-index: -2; pointer-events: none; }
.bg-orb:nth-child(3) { width: 300px; height: 300px; background: radial-gradient(circle, var(--purple-glow), transparent); top: -150px; left: -150px; }
.bg-orb:nth-child(4) { width: 250px; height: 250px; background: radial-gradient(circle, var(--cyan-glow), transparent); bottom: -125px; right: -125px; }
.bg-orb:nth-child(5) { width: 280px; height: 280px; background: radial-gradient(circle, var(--primary-gold), transparent); top: 50%; left: 50%; transform: translate(-50%, -50%); }
.gears-container { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: -1; pointer-events: none; }
.gear { position: absolute; opacity: 0.06; }
.gear svg { width: 100%; height: 100%; animation: rotateGear 60s linear infinite; }
.gear:nth-child(1) { width: 150px; height: 150px; top: 10%; right: 10%; animation: rotateGearReverse 25s linear infinite; }
.gear:nth-child(2) { width: 120px; height: 120px; bottom: 15%; left: 5%; animation: rotateGearReverse 25s linear infinite; }
@keyframes rotateGear { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes rotateGearReverse { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }

/* --- 导航栏滚动效果 (Navbar Scroll Effect) --- */
header {
    background: transparent;
    padding: 1.5rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
}

header.scrolled {
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 0;
    border-bottom: 1px solid var(--primary-gold);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

nav { max-width: 1200px; margin: 0 auto; padding: 0 2rem; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.8rem; font-weight: bold; color: var(--primary-gold); text-shadow: 0 0 10px rgba(212, 175, 55, 0.5); cursor: pointer; }
.nav-logo { height: 50px; width: auto; margin-left: 1rem; }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { color: var(--text-light); text-decoration: none; transition: color 0.3s ease; position: relative; padding: 0.5rem 0; }
.nav-links a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--cyan-glow); transition: width 0.3s ease; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a:hover, .nav-links a.active { color: var(--cyan-glow); }

/* Hero Section */
.hero { margin-top: 0; height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; }
.hero-content { text-align: center; z-index: 2; }
.hero h1 { font-size: clamp(2.5rem, 8vw, 5rem); background: linear-gradient(45deg, var(--primary-gold), var(--cyan-glow)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 1rem; }
.hero p { font-size: 1.2rem; margin-bottom: 2rem; opacity: 0.9; }
.cta-button { display: inline-block; padding: 1rem 2rem; background: linear-gradient(45deg, var(--primary-gold), var(--secondary-copper)); color: var(--dark-metal); text-decoration: none; border-radius: 50px; font-weight: bold; transition: transform 0.3s ease, box-shadow 0.3s ease; box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3); transform: translateZ(0); }
.cta-button:hover { transform: translateY(-5px) scale(1.05); box-shadow: 0 6px 25px rgba(212, 175, 55, 0.5); }

/* General Section Styles */
.page-wrapper { padding-top: 0; }
.section { padding: 5rem 2rem; max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 3rem; position: relative; color: var(--primary-gold); }
.section-title::after { content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 100px; height: 3px; background: linear-gradient(90deg, transparent, var(--cyan-glow), transparent); }

/* Filter Buttons */
.filters { display: flex; justify-content: center; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }
.filter-btn { padding: 0.7rem 1.5rem; background: rgba(57, 62, 70, 0.8); border: 1px solid var(--primary-gold); color: var(--text-light); cursor: pointer; border-radius: 25px; transition: all 0.3s ease; }
.filter-btn:hover, .filter-btn.active { background: var(--primary-gold); color: var(--dark-metal); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3); }

/* --- 3D透视卡片效果 (3D Perspective Card Effect) --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    perspective: 1500px; /* 设定3D舞台的视距 */
}

.portfolio-item {
    background: rgba(57, 62, 70, 0.5);
    border: 1px solid var(--secondary-copper);
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d; /* 允许子元素有3D效果 */
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                box-shadow 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-item:hover {
    box-shadow: 0 20px 40px rgba(0, 255, 240, 0.3);
    border-color: var(--cyan-glow);
}

/* 卡片上的光晕效果 */
.portfolio-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 60%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none; /* 允许鼠标事件穿透 */
}

.portfolio-item:hover::before {
    opacity: 1;
}

.portfolio-item img {
    width: 100%; height: 200px; object-fit: cover; transition: transform 0.5s ease;
}
.portfolio-item:hover img {
    transform: scale(1.05) translateZ(20px); /* 悬停时图片轻微放大并前移 */
}

.portfolio-info { padding: 1.5rem; transform: translateZ(50px); /* 让文字内容在3D空间中更靠前 */}
.portfolio-info h3 { color: var(--primary-gold); margin-bottom: 0.5rem; }
.portfolio-info p { color: var(--text-light); opacity: 0.8; margin-bottom: 1rem; }
.tag { display: inline-block; padding: 0.3rem 0.8rem; background: rgba(155, 89, 182, 0.2); border: 1px solid var(--purple-glow); border-radius: 15px; font-size: 0.8rem; color: var(--purple-glow); margin-right: 0.5rem; }

/* --- 滚动时的卡片展开动画 (On-scroll Card Reveal) --- */
.portfolio-item {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.portfolio-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Experience & Contact Sections (and other elements for reveal animation) */
.experience-item, .contact-links a {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out 0.2s;
}
.experience-item.is-visible, .contact-links a.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: rgba(26, 26, 46, 0.98); flex-direction: column; padding: 1rem; border-bottom: 2px solid var(--primary-gold); }
    .nav-links.active { display: flex; }
    .mobile-menu-toggle { display: block; }
    .portfolio-grid { grid-template-columns: 1fr; }
    .gear, .particle { display: none; }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle { display: none; background: transparent; border: none; color: var(--primary-gold); font-size: 1.5rem; cursor: pointer; }

/* Particles */
.particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.particle { position: absolute; width: 2px; height: 2px; background: var(--cyan-glow); border-radius: 50%; opacity: 0; animation: floatUp 25s linear infinite; }
@keyframes floatUp { 0%, 100% { opacity: 0; } 10%, 90% { opacity: 0.4; } 0% { transform: translateY(100vh); } 100% { transform: translateY(-10vh); } }