/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Alimama FangYuanTi VF', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #111111;
    background-color: #F6F6F6;
    overflow-x: hidden;
    max-width: 100vw;
    margin: 0 auto;
}

/* Navigation Bar */
.nav-bar {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: min(309.41px, 90vw);
    height: 63.20px;
}

.nav-container {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.30);
    border-radius: 9.60px;
    backdrop-filter: blur(2.40px);
    display: flex;
    align-items: center;
    position: relative;
}

.nav-button {
    position: absolute;
    height: 51px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(12px, 2vw, 15.89px);
    font-weight: 400;
    color: #017AFF;
    cursor: pointer;
    transition: all 0.3s ease;
}

.about-btn {
    left: 6px;
    top: 6.09px;
    width: 79px;
    border-radius: 10px;
}

.work-btn {
    left: 90.53px;
    top: 6.09px;
    width: 69px;
    border-radius: 10px;
}

.connect-btn {
    left: 168.98px;
    top: 6px;
    width: 134.42px;
    height: 51.20px;
    border-radius: 8px;
    font-size: clamp(12px, 2vw, 15.75px);
}

.nav-button:hover {
    background: rgba(1, 122, 255, 0.1);
}

/* Hero Section */
.hero-section {
    width: 100vw;
    height: 100vh;
    min-height: 600px;
    position: relative;
    background-image: url('assets/CodeBubbyAssets/1_95/28.png');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

/* Pattern Elements */
.pattern-top {
    position: absolute;
    top: 60%;
    width: 100%;
    height: 15vh;
    overflow: hidden;
}

.pattern-bottom {
    position: absolute;
    top: 80%;
    width: 100%;
    height: 15vh;
    overflow: hidden;
}

.pattern-svg {
    position: absolute;
    transition: transform 0.3s ease;
    max-width: 100px;
    height: auto;
}

.pattern-svg:hover {
    transform: scale(1.1);
}

/* Portrait */
.portrait-container {
    position: absolute;
    right: 5%;
    top: 8%;
    width: min(45vw, 900px);
    height: min(90vh, 1100px);
}

.main-portrait {
    width: 100%;
    height: auto;
    max-height: 120vh;
    position: absolute;
    left: 0px;
    top: -10%;
    transition: transform 0.5s ease;
    object-fit: cover;
}

.main-portrait:hover {
    transform: scale(1.02);
}

/* Hero Title */
.hero-title {
    position: absolute;
    left: 5%;
    top: 25%;
    z-index: 10;
    max-width: 50%;
}

.title-line {
    font-size: clamp(3rem, 8vw, 7.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(50px);
    animation: slideUp 1s ease forwards;
}

.name-line {
    color: #017AFF;
    animation-delay: 0.2s;
}

.role-line {
    color: #111111;
    animation-delay: 0.4s;
}

/* Introduction Section */
.intro-section {
    width: 100%;
    min-height: 30vh;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.intro-content {
    max-width: min(1100px, 90%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.intro-text {
    font-size: clamp(1.2rem, 2.5vw, 1.75rem);
    font-weight: 400;
    line-height: 1.6;
    color: #111111;
    text-align: left;
}

.highlight {
    color: #017AFF;
    font-weight: 700;
}

/* Projects Section */
.projects-section {
    width: 100%;
    min-height: 100vh;
    background: white;
    position: relative;
    padding: 8rem 2rem 4rem;
}

/* Background Text */
.projects-bg-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50vh;
    overflow: hidden;
    z-index: 1;
}

.bg-text-line {
    position: absolute;
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 400;
    color: #F6F6F6;
    white-space: nowrap;
}

.bg-text-line:nth-child(1) {
    left: 20%;
    top: 25%;
}

.bg-text-line:nth-child(2) {
    left: 25%;
    top: 50%;
}

/* Projects Grid */
.projects-grid {
    position: relative;
    z-index: 2;
    max-width: min(1200px, 90%);
    margin: 0 auto;
    padding-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(450px, 100%), 1fr));
    gap: 0.5rem;
}

.projects-column {
    width: 100%;
}

.left-column {
    padding-top: 2rem;
}

/* Project Cards */
.project-card {
    width: 70%;
    margin: 0 auto 6rem auto;
    cursor: pointer;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(0px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    padding: 8px;
    background: white;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.project-image {
    width: 100%;
    aspect-ratio: 4/5;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    cursor: pointer;
    position: relative;
}

.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(1, 122, 255, 0.1), rgba(1, 122, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.project-card:hover .project-image::before {
    opacity: 1;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-image:hover img {
    transform: scale(1.08);
}

.project-info {
    padding: 0;
}

.project-tag {
    display: inline-block;
    background: #F6F6F6;
    border-radius: 64px;
    padding: 3.20px 12.80px;
    font-size: clamp(11px, 1.5vw, 13.75px);
    font-weight: 400;
    color: black;
    margin-bottom: 16px;
}

.project-description {
    font-size: clamp(1.2rem, 2.2vw, 1.65rem);
    font-weight: 400;
    line-height: 1.4;
    color: black;
    max-width: 100%;
}

/* Contact Section */
.contact-section {
    width: 100%;
    min-height: 30vh;
    background: #F6F6F6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.contact-content {
    max-width: min(1280px, 90%);
    width: 100%;
    position: relative;
}

.contact-title {
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 400;
    color: #444444;
    margin-bottom: 3rem;
}

.contact-email {
    font-size: clamp(1.8rem, 4.2vw, 3.5rem);
    font-weight: 400;
    color: black;
    opacity: 0.36;
    margin-bottom: 3rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    word-break: break-all;
    position: relative;
    display: inline-block;
}

.contact-email::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #017AFF, #0056b3);
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.contact-email:hover {
    opacity: 1;
    color: #017AFF;
    transform: translateY(-2px);
}

.contact-email:hover::after {
    width: 100%;
}

.contact-divider {
    width: 100%;
    height: 1px;
    background: black;
    margin-bottom: 2rem;
}

.contact-footer {
    font-size: clamp(10px, 1.2vw, 12.14px);
    font-weight: 400;
    color: #444444;
}

/* Animations */
@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Parallax Effects */
.parallax-element {
    transition: transform 0.1s ease-out;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        left: 5%;
        top: 20%;
        max-width: 90%;
    }
    
    .portrait-container {
        right: 5%;
        top: 50%;
        width: 90vw;
        height: 40vh;
    }
    
    .main-portrait {
        top: 0;
        object-position: center top;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .left-column {
        padding-top: 0;
    }
    
    .project-card {
        margin-bottom: 2rem;
        width: 85%;
        /* 移动端触摸优化 */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .project-card:active {
        transform: translateY(-2px) scale(0.98);
    }
    
    .nav-bar {
        width: 95vw;
        height: 50px;
    }
    
    .nav-button {
        height: 40px;
        font-size: 12px;
        /* 移动端触摸优化 */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .nav-button:active {
        transform: scale(0.95);
        background: rgba(1, 122, 255, 0.2);
    }
    
    .connect-btn {
        height: 40px;
    }
    
    .contact-email {
        /* 移动端触摸优化 */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* 移动端滚动优化 */
    body {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .hero-section {
        min-height: 500px;
    }
    
    .intro-section {
        padding: 2rem 1rem;
    }
    
    .projects-section {
        padding: 4rem 1rem 2rem;
    }
    
    .contact-section {
        padding: 2rem 1rem;
    }
    
    .pattern-svg {
        max-width: 60px;
    }
    
    /* 小屏幕专用交互优化 */
    .project-card {
        width: 90%;
        padding: 6px;
        border-radius: 16px;
    }
    
    .project-image {
        border-radius: 12px;
    }
    
    /* 减少动画复杂度以提升性能 */
    .project-card:hover {
        transform: translateY(-4px);
    }
    
    .project-image:hover img {
        transform: scale(1.03);
    }
}

/* Remove any potential cursor effects */
* {
    cursor: inherit !important;
}

/* Hide any dynamically created cursor elements */
div[style*="position: fixed"][style*="border-radius: 50%"],
div[style*="position: fixed"][style*="pointer-events: none"],
div[style*="mix-blend-mode"],
.cursor-follower,
.custom-cursor {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Tablet Responsive Design */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-title {
        max-width: 60%;
    }
    
    .portrait-container {
        width: 40vw;
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
