:root {
    /* Colors - Light Theme */
    --bg-color: #ffffff;
    --surface-color: #f5f5f7;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-color: #000000;
    --script-color: #e5e5e5;
    --border-color: #d2d2d7;

    /* Fonts */
    --font-display: 'Space Grotesk', sans-serif;
    --font-script: 'Cursive', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --container-padding: 4vw;
    --grid-gap: 2px;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* REMOVED: cursor: none - 使用系统原生光标以提升性能 */
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-color);
    color: var(--text-primary);
}

body {
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
}

/* REMOVED: 自定义光标样式 - 这是最大的性能杀手 */
/* 如果需要自定义光标，可以使用CSS cursor属性：
   cursor: url('custom-cursor.svg'), auto; 
*/
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
}

/* ===================================
   Navigation
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem var(--container-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    /* 添加硬件加速 */
    will-change: padding, background-color;
    transition: all 0.3s ease;
}

/* 优化navbar滚动状态 - 使用class而不是内联样式 */
.navbar.scrolled {
    padding: 1rem var(--container-padding);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--text-primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    gap: 3rem;
}

.nav-link {
    font-family: var(--font-display);
    color: var(--text-primary);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--accent-color);
}

.download-resume-btn {
    border: 1px solid var(--text-primary);
    padding: 0.8rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    transition: all 0.3s;
    border-radius: 50px;
    display: flex;
    align-items: center;
}

.download-resume-btn:hover {
    background: var(--text-primary);
    color: var(--bg-color);
    border-color: var(--text-primary);
}

/* ===================================
   Hero Section - 简化动画
   =================================== */
/* Hero Section - 黑色主题 */
.hero-scroll-container {
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Center vertically */
    padding: 10vh var(--container-padding) 0;
    /* Shift center down by adding top padding */
    position: relative;
    background-color: #000000;
}

/* Hero 区域内的文字颜色 */
.hero-scroll-container .greeting-main,
.hero-scroll-container .name-intro {
    color: #ffffff;
}

.hero-scroll-container .role-subtitle {
    color: rgba(255, 255, 255, 0.7);
}

.hero-scroll-container .greeting-script {
    color: rgba(255, 255, 255, 0.15);
}

/* Hero 区域内的 scroll indicator */
.hero-scroll-container .scroll-dot {
    border-color: rgba(255, 255, 255, 0.5);
}

.hero-scroll-container .scroll-dot::before {
    background: #ffffff;
}

/* 导航栏在 hero 区域的样式 */
body:has(.hero-scroll-container) .navbar:not(.scrolled) .logo,
body:has(.hero-scroll-container) .navbar:not(.scrolled) .nav-link {
    color: #ffffff;
}

body:has(.hero-scroll-container) .navbar:not(.scrolled) .download-resume-btn {
    border-color: #ffffff;
    color: #ffffff;
}

body:has(.hero-scroll-container) .navbar:not(.scrolled) .download-resume-btn:hover {
    background: #ffffff;
    color: #000000;
}

.hero-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.hero-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    position: relative;
    padding-top: 5rem;
    /* Shift text down relative to image */
}

.hero-image-container {
    height: 100%;
    width: 90%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.hero-profile-img {
    width: 100%;
    max-width: 100%;
    /* Allow it to fill container up to limit */
    height: auto;
    object-fit: contain;
    /* Ensure it scales nicely */
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    display: block;
}

.greeting-script {
    display: block !important;
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translate(-65%, -20%) rotate(-5deg);
    font-family: 'Brush Script MT', cursive;
    font-size: 15rem;
    color: var(--script-color);
    z-index: -1;
    white-space: nowrap;
    opacity: 0.6;
    pointer-events: none;
}

.greeting-main {
    font-family: var(--font-display);
    font-size: clamp(5rem, 12vw, 10rem);
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wave {
    display: inline-block;
    animation: wave-animation 2.5s infinite;
    transform-origin: 70% 70%;
}

@keyframes wave-animation {
    0% {
        transform: rotate(0.0deg)
    }

    10% {
        transform: rotate(14.0deg)
    }

    20% {
        transform: rotate(-8.0deg)
    }

    30% {
        transform: rotate(14.0deg)
    }

    40% {
        transform: rotate(-4.0deg)
    }

    50% {
        transform: rotate(10.0deg)
    }

    60% {
        transform: rotate(0.0deg)
    }

    100% {
        transform: rotate(0.0deg)
    }
}

.name-intro {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.role-subtitle {
    font-family: var(--font-body);
    color: var(--text-secondary);
    font-size: 1.5rem;
    margin-bottom: 4rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: capitalize;
}

.bio,
.profile-image {
    display: none;
}

/* Scroll Indicator - 隐藏原有指示器，使用 SELECTED WORKS 箭头 */
.scroll-indicator {
    display: none !important;
}

.scroll-dot {
    width: 30px;
    height: 50px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    position: relative;
    display: flex;
    justify-content: center;
}

.scroll-dot::before {
    content: '';
    width: 4px;
    height: 8px;
    background: var(--text-primary);
    border-radius: 2px;
    margin-top: 10px;
    animation: scroll-bounce 2s infinite;
}

@keyframes scroll-bounce {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(15px);
        opacity: 0;
    }
}

.hero-fixed {
    position: static;
    background: none;
    width: 100%;
}

/* bounce-arrow 动画 */
.bounce-arrow {
    display: block;
    animation: arrow-bounce 1.5s ease-in-out infinite;
}

@keyframes arrow-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(5px);
    }
}

#hero-end {
    display: none;
}

/* Hero Background Layer - 简化动画 */
.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    /* 添加硬件加速 */
    will-change: opacity;
}

.hero-bg-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* REMOVED: transform: scale(1.1) - 减少不必要的缩放 */
    /* REMOVED: transition - 减少重绘 */
}

.hero-bg-image .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
}

/* ===================================
   Work Section (Bento Grid)
   =================================== */
.featured-projects-section {
    background-color: var(--bg-color);
    padding: 6rem var(--container-padding);
}

.container-wide {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    align-items: stretch;
}

.project-content.hero-image-container {
    border-radius: 12px;
}

.featured-project {
    border-radius: 12px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 0;
    margin-bottom: 0;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    /* 添加硬件加速 */
    will-change: transform;
}

.featured-project:hover {
    border-radius: 12px;
    transform: translateY(-10px);
    border-color: var(--accent-color);
}

.project-content {
    border-radius: 12px;
    display: flex;
    flex-direction: column-reverse;
    height: 100%;
}

.project-preview {
    border-radius: 12px;
    width: 100%;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    aspect-ratio: 16/9;
    position: relative;
    background-color: var(--surface-color);
}

.project-preview img {
    border-radius: 12px 12px 0 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
}

.featured-project:hover .project-preview img {
    border-radius: 12px 12px 0 0;
    transform: scale(1.05);
}

.project-info {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
    flex: 1;
}

.project-meta {
    margin-bottom: 2rem;
}

.meta-tag {
    display: inline-block;
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.project-link {
    display: inline-block;
    background: transparent;
    color: var(--accent-color);
    font-family: var(--font-display);
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 2px;
}

/* ===================================
   About & Experience
   =================================== */
.about-section,
.work-section {
    padding: 6rem var(--container-padding);
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-color);
}

h2 {
    font-family: var(--font-display);
    font-size: 3rem;
    margin-bottom: 4rem;
    text-transform: uppercase;
    color: var(--text-primary);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.skills-section {
    background: var(--surface-color);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.work-item {
    background: var(--surface-color);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: border-color 0.3s ease;
}

.work-item:hover {
    border-color: var(--accent-color);
}

.work-header h3 {
    font-family: var(--font-display);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.work-company {
    color: var(--accent-color);
    display: block;
    margin-bottom: 0.5rem;
}

.work-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===================================
   Contact
   =================================== */
.contact-section {
    padding: 6rem var(--container-padding);
    border-top: 1px solid var(--border-color);
    background-color: var(--surface-color);
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
}

.contact-item {
    background: var(--bg-color);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contact-item h4 {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-family: var(--font-display);
}

.contact-item a {
    color: var(--text-primary);
    font-size: 1.2rem;
    text-decoration: none;
    transition: color 0.3s;
}

.contact-item a:hover {
    color: var(--accent-color);
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 1024px) {
    .container-wide {
        grid-template-columns: 1fr;
    }

    .hero-content {
        grid-template-columns: 1fr;
    }

    .profile-image {
        display: none;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-text {
        align-items: center;
        text-align: center;
    }

    .hero-image-container {
        justify-content: center;
        order: -1;
        width: 100%;
        max-width: 300px;
        /* Limit container width on mobile */
        margin: 0 auto;
    }

    .hero-profile-img {
        max-width: 100%;
        /* Let it fill the restricted container */
    }

    .greeting-main {
        justify-content: center;
    }

    .greeting-script {
        left: 50%;
        transform: translate(-50%, 0) rotate(-5deg);
        top: -40%;
    }
}

@media (max-width: 768px) {
    .contact-info {
        grid-template-columns: 1fr;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        display: none;
    }
}

/* Utility */
.download-icon {
    display: none;
}

/* ===================================
   Reveal Animations - 使用CSS类优化性能
   =================================== */
.featured-project,
.work-item,
.contact-item {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.featured-project.revealed,
.work-item.revealed,
.contact-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   性能优化提示
   =================================== */
/* 
1. ✅ 为滚动动画的元素添加 will-change
2. ✅ 使用 transform 而不是 top/left
3. ✅ 减少同时运行的动画数量
4. ✅ 使用 requestAnimationFrame 节流滚动事件
5. ✅ 移除自定义光标以使用硬件加速
6. ✅ 使用CSS类而不是内联样式
*/