/* ============================================
   INDEX.CSS - Homepage Specific Styles
   Yeyang Liu Portfolio
   ============================================ */

/* Body layout for homepage */
body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

body > * {
    width: 100%;
}

/* Add padding to main to prevent content hiding behind fixed footer */
main {
    padding-bottom: 5rem;
}

/* ===================== Hero Section ===================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 8rem;
}

.hero-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    width: 100%;
    max-width: 1000px;
}

.hero-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-text h1 span {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-text .tagline {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.hero-text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 500px;
    text-align: left;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

/* ===================== Avatar ===================== */
.avatar-container {
    position: relative;
    width: 180px;
    height: 180px;
    cursor: pointer;
}

.avatar-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    background: var(--gradient-1) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rotate 8s linear infinite;
}

.avatar-container:hover .avatar-ring {
    animation: rotate 0.5s linear infinite;
}

.avatar-inner {
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    box-shadow: var(--shadow), 0 0 40px var(--accent-dim), inset 0 0 20px rgba(255, 255, 255, 0.1);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.avatar-container:hover .avatar-inner {
    transform: rotate(360deg) scale(1.05);
}

.avatar-inner .emoji {
    transition: transform 0.3s ease;
}

.avatar-container:hover .emoji {
    animation: wave 0.5s ease-in-out;
}

/* ===================== About Section ===================== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.about-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow);
}

.about-card:hover {
    border-color: var(--accent);
    transform: translateY(-8px) rotateX(2deg);
    box-shadow: 0 20px 40px var(--accent-glow);
}

.about-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.about-card h3 .icon {
    font-size: 1.5rem;
}

.about-card p {
    color: var(--text-secondary);
}

.about-card .highlight {
    color: var(--accent);
    font-weight: 500;
}

/* ===================== Skills Section ===================== */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ===================== Projects Section ===================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    box-shadow: var(--shadow);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px var(--accent-glow);
}

.project-card:active {
    transform: translateY(-4px) scale(0.99);
}

.project-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tags span {
    background: var(--bg-secondary);
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
}

.view-more {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .view-more {
    opacity: 1;
}

.project-card .timeline-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.8;
}

/* ===================== Experience Section ===================== */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 3rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    transform: translateX(-5px);
    box-shadow: 0 0 20px var(--accent-glow);
}

.timeline-item h3 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.timeline-item .company {
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.timeline-item .date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.timeline-item ul {
    color: var(--text-secondary);
    padding-left: 1.2rem;
}

.timeline-item li {
    margin-bottom: 0.5rem;
}

/* ===================== Contact Section ===================== */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-content p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow);
}

.contact-link:hover {
    border-color: var(--accent);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 30px var(--accent-glow);
}

.contact-link:hover svg {
    animation: bounce 0.5s ease;
}

.contact-link svg {
    width: 20px;
    height: 20px;
}

/* ===================== Confetti Container ===================== */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

/* ===================== Weather Effects Container ===================== */
.weather-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

/* Rain */
.raindrop {
    position: absolute;
    width: 2px;
    height: 20px;
    background: linear-gradient(transparent, rgba(174, 194, 224, 0.8));
    animation: rain-fall 1s linear forwards;
}

@keyframes rain-fall {
    0% { transform: translateY(-20px); opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

/* Snow */
.snowflake {
    position: absolute;
    color: white;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    animation: snow-fall 3s linear forwards;
}

@keyframes snow-fall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Sun rays */
.sunray {
    position: absolute;
    width: 4px;
    height: 100px;
    background: linear-gradient(rgba(255, 215, 0, 0.8), transparent);
    transform-origin: top center;
    animation: sunray-burst 1.5s ease-out forwards;
}

@keyframes sunray-burst {
    0% { transform: scaleY(0); opacity: 1; }
    50% { transform: scaleY(1); opacity: 1; }
    100% { transform: scaleY(1); opacity: 0; }
}

/* Leaves */
.leaf {
    position: absolute;
    font-size: 20px;
    animation: leaf-fall 2.5s ease-in-out forwards;
}

@keyframes leaf-fall {
    0% { transform: translateY(-20px) rotate(0deg) translateX(0); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg) translateX(100px); opacity: 0; }
}

/* Stars */
.star {
    position: absolute;
    font-size: 16px;
    animation: star-twinkle 1.5s ease-out forwards;
}

@keyframes star-twinkle {
    0% { transform: scale(0) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.5) rotate(180deg); opacity: 1; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

/* Hearts */
.heart {
    position: absolute;
    font-size: 20px;
    animation: heart-float 2s ease-out forwards;
}

@keyframes heart-float {
    0% { transform: translateY(0) scale(0); opacity: 1; }
    50% { transform: translateY(-50px) scale(1.2); opacity: 1; }
    100% { transform: translateY(-100px) scale(0.8); opacity: 0; }
}

/* Lightning */
.lightning {
    position: absolute;
    font-size: 60px;
    animation: lightning-flash 0.5s ease-out forwards;
}

@keyframes lightning-flash {
    0%, 100% { opacity: 0; }
    10%, 30%, 50% { opacity: 1; }
    20%, 40% { opacity: 0; }
}

/* Bubbles */
.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(173, 216, 230, 0.4));
    animation: bubble-rise 2s ease-out forwards;
}

@keyframes bubble-rise {
    0% { transform: translateY(0) scale(0); opacity: 1; }
    100% { transform: translateY(-200px) scale(1); opacity: 0; }
}

/* Camera Flash */
@keyframes camera-flash {
    0% { opacity: 0; }
    20% { opacity: 0.9; }
    100% { opacity: 0; }
}

/* ===================== Responsive Design ===================== */
@media (max-width: 900px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

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

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

    .cta-buttons {
        justify-content: center;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .avatar-container {
        width: 140px;
        height: 140px;
    }

    .avatar-inner {
        font-size: 3rem;
        inset: 10px;
    }

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

    .skills-container {
        justify-content: center;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-text .tagline {
        font-size: 1.1rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .avatar-container {
        width: 120px;
        height: 120px;
    }

    .avatar-inner {
        font-size: 2.5rem;
    }
}
