@keyframes soft-gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100dvh - 60px);
    padding: 2rem 1.5rem;
    background-color: var(--background-light, #f8fafc);
    position: relative;
    overflow: hidden;
}

.hero-background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0), rgba(79, 70, 229, 0.05));
    background-size: 400% 400%;
    animation: soft-gradient-animation 20s ease infinite;
    z-index: 0;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    max-width: 1200px;
    width: 100%;
    position: relative;
    z-index: 1;
    margin-top: -7rem; /* Move container slightly up */
}

.hero-text-content {
    flex: 1;
    text-align: left;
    max-width: 480px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary, #1e293b);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.05em;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary-color, #4f46e5);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.2);
}

.hero-cta:hover {
    background: var(--primary-dark, #4338ca);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.25);
}

.hero-portfolio-wrapper {
    flex: 1;
    position: relative;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1500px;
}
.portfolio-card {
    position: absolute;
    width: min(300px, 80vw); /* 响应式宽度 */
    height: min(200px, 25vh); /* 响应式高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background, #fff);
    border-radius: var(--radius-lg, 12px);
    border: 1px solid var(--border-color, #e5e7eb);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    cursor: pointer;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.portfolio-card span {
    font-size: clamp(2rem, 5vw, 3.5rem); /* 响应式字体大小 */
    color: var(--text-primary, #1e293b);
    will-change: auto;
    text-align: center;
    padding: 0 10px; /* 防止文字溢出 */
}

/* 桌面端布局 */
.portfolio-card.card-1 {
    transform: rotate(-10deg) translate(0px, -140px);
    z-index: 3;
    background: #fffaf0;
    border: 1px solid #d4af37;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.portfolio-card.card-1 span {
    font-family: "Alex Brush", cursive;
    color: #d4af37;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.portfolio-card.card-2 {
    transform: rotate(5deg) translate(60px, 40px);
    z-index: 2;
    background: #f0faff;
    border: 1px solid #0073e6;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.portfolio-card.card-2 span {
    font-family: "Sacramento", cursive;
    color: #0073e6;
    text-shadow: 0 0 8px rgba(0, 115, 230, 0.3);
}

.portfolio-card.card-3 {
    transform: rotate(15deg) translate(0px, 200px);
    z-index: 1;
    background: #f5f5f5;
    border: 1px solid #333;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.portfolio-card.card-3 span {
    font-family: "Yellowtail", cursive;
    color: #333;
    text-shadow: 1px 1px 0 #fff, 2px 2px 3px rgba(0,0,0,0.15);
}

/* Hover effects for portfolio cards */
.portfolio-card.card-1:hover {
    transform: rotate(-10deg) translate(0px, -150px) scale(1.05);
    box-shadow: 0 15px 35px rgba(212, 175, 55, 0.2);
}

.portfolio-card.card-2:hover {
    transform: rotate(5deg) translate(60px, 30px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 115, 230, 0.25);
}

.portfolio-card.card-3:hover {
    transform: rotate(15deg) translate(0px, 190px) scale(1.05);
    box-shadow: 0 15px 35px rgba(51, 51, 51, 0.2);
}





/* Original effect styles, now applied statically */
.portfolio-card.effect-golden {
    background: #fffaf0; /* Light golden background */
}
.portfolio-card.effect-golden span {
    color: #d4af37;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.portfolio-card.effect-neon {
    background: #f0faff; /* Light blue background */
}
.portfolio-card.effect-neon span {
    color: #0073e6;
    text-shadow: 0 0 8px rgba(0, 115, 230, 0.3);
}

.portfolio-card.effect-shadow {
    background: #f5f5f5; /* Light grey background */
}
.portfolio-card.effect-shadow span {
    color: #333;
    text-shadow: 1px 1px 0 #fff, 2px 2px 3px rgba(0,0,0,0.15);
}


/* Responsive Design */
@media (max-width: 992px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 4rem;
    }
    .hero-text-content {
        text-align: center;
        max-width: 600px;
    }
    .hero-portfolio-wrapper {
        width: 100%;
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding: 6rem 1rem 4rem;
    }
    .hero-title {
        font-size: 2.8rem;
    }
    .portfolio-card {
        width: 260px;
        height: 170px;
    }
    .portfolio-card span {
        font-size: 3rem;
    }
}


/* 平板端适配 */
@media screen and (max-width: 768px) {
    .portfolio-card {
        width: min(280px, 75vw);
        height: min(180px, 22vh);
    }
    
    .portfolio-card.card-1 {
        transform: rotate(-8deg) translate(0px, -100px);
    }
    
    .portfolio-card.card-2 {
        transform: rotate(4deg) translate(40px, 30px);
    }
    
    .portfolio-card.card-3 {
        transform: rotate(12deg) translate(0px, 150px);
    }
}

/* 移动端适配 */
@media screen and (max-width: 480px) {
    .portfolio-card {
        width: min(260px, 85vw);
        height: min(160px, 20vh);
        border-radius: 8px;
    }
    
    .portfolio-card span {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        padding: 0 15px;
    }
    
    /* 移动端重新调整卡片位置，减少重叠 */
    .portfolio-card.card-1 {
        transform: rotate(-6deg) translate(-10px, -80px);
    }
    
    .portfolio-card.card-2 {
        transform: rotate(3deg) translate(30px, 20px);
    }
    
    .portfolio-card.card-3 {
        transform: rotate(9deg) translate(-5px, 120px);
    }
}

/* 小屏幕移动端 */
@media screen and (max-width: 360px) {
    .portfolio-card {
        width: min(240px, 90vw);
        height: min(140px, 18vh);
    }
    
    .portfolio-card span {
        font-size: clamp(1.5rem, 7vw, 2rem);
        padding: 0 12px;
    }
    
    /* 进一步调整位置 */
    .portfolio-card.card-1 {
        transform: rotate(-5deg) translate(-15px, -60px);
    }
    
    .portfolio-card.card-2 {
        transform: rotate(2deg) translate(20px, 15px);
    }
    
    .portfolio-card.card-3 {
        transform: rotate(7deg) translate(-10px, 90px);
    }
}

/* 超小屏幕适配 */
@media screen and (max-width: 320px) {
    .portfolio-card {
        width: min(220px, 95vw);
        height: min(130px, 16vh);
    }
    
    .portfolio-card span {
        font-size: clamp(1.3rem, 8vw, 1.8rem);
        padding: 0 10px;
    }
    
    .portfolio-card.card-1 {
        transform: rotate(-4deg) translate(-20px, -50px);
    }
    
    .portfolio-card.card-2 {
        transform: rotate(2deg) translate(15px, 10px);
    }
    
    .portfolio-card.card-3 {
        transform: rotate(6deg) translate(-15px, 70px);
    }
}

/* 添加悬停效果的移动端优化 */
@media (hover: hover) {
    .portfolio-card:hover {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
        z-index: 10;
    }
    
    .portfolio-card.card-1:hover {
        transform: rotate(-10deg) translate(0px, -140px) scale(1.05);
    }
    
    .portfolio-card.card-2:hover {
        transform: rotate(5deg) translate(60px, 40px) scale(1.05);
    }
    
    .portfolio-card.card-3:hover {
        transform: rotate(15deg) translate(0px, 200px) scale(1.05);
    }
}

/* 触摸设备的点击效果 */
@media (hover: none) {
    .portfolio-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}