
*, *::before, *::after {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;  /* 确保所有元素都使用 Inter */
}


html {
    scroll-behavior: smooth;  /* Smooth scrolling */
}

html, body {
    margin: 0;
    padding: 0;
}

/* Page transition animation */
@keyframes pageFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

body {
    background-color: #f7f7f7;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    animation: pageFadeIn 0.4s ease-in-out;
}


.section {
    padding-top: 80px;
    padding-bottom: 80px;
}

.section-nav {
    padding-top: 80px;
    padding-bottom: 0;
}

/* Set scroll-margin for sections with id to ensure correct anchor jump position */
#about,
#projects,
#contact {
    scroll-margin-top: 80px;  /* Compensate for section padding-top */
}

.section-last {
    padding-bottom: 0 !important;  /* Last section has no bottom padding */
    margin-bottom: 0 !important;   /* Ensure no margin */
}

.container {
    margin: 0 160px;  
    display: flex;
    justify-content: flex-start; 
}

.project-section-container {
    flex-direction: column;
}

.nav-container {
    display: flex;
    gap: 32px;
    justify-content: flex-start;
}

.nav-button {
    background-color: transparent;
    width: fit-content; 
    height: fit-content;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;  /* Remove link underline */
    color: inherit;  /* Inherit text color */
    cursor: pointer;  /* Pointer cursor style */
}

.nav-button:hover {
    text-decoration: underline;
}

.nav-font {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.04em;
}


.hero {
    display: flex;
    flex-direction: column;  
    gap: 20px;  
}

/* Project page: main title and right caption on same line, aligned */
.hero-title-row {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-title {
    font-size: 36px;
    font-weight: 550;  /* semi-bold */
    letter-spacing: -0.04em;
    margin: 0;  /* Remove default margin */
}

.hero-caption {
    font-size: 20px;
    font-weight: 400;
    color: #878787;
    letter-spacing: -0.04em;
    margin: 0;
    flex-shrink: 0;
}

.hero-subtitle {
    font-size: 20px;
    font-weight: 400;
    margin: 0;  /* Remove default margin */
    letter-spacing: -0.04em;
}

.hero-text {
    font-size: 16px;
    font-weight: 300;
    margin: 0;  /* Remove default margin */
    line-height: 1.5;
    letter-spacing: -0.04em;
}

.project-container {
    display: grid;
    gap: 16px;
    width: 100%; 
}

/* Container with featured and featured-secondary cards: 7:5 ratio */
.project-container:has(.project-card-featured) {
    grid-template-columns: 7fr 5fr;
}

/* Container with three normal cards: equal thirds */
.project-container:has(.project-card-normal):not(:has(.project-card-featured)) {
    grid-template-columns: repeat(3, 1fr);
}

.project-card-featured {
    display: flex;
    flex-direction: column;  
    height: 400px;
    border: 1px solid #E5E7EB;
    padding: 16px;
    border-radius: 16px;
    justify-content: flex-start;
    gap: 8px;
    text-decoration: none;  /* Remove link underline */
    color: inherit;  /* Inherit text color */
    cursor: pointer;  /* Pointer cursor style */
    transition: transform 0.3s ease, box-shadow 0.3s ease;  /* Add transition effect */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Use pseudo-element for smooth background image transition */
.project-card-featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--hover-bg-image, url('path/to/your/image.jpg'));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 16px;
    z-index: 0;
}

.project-card-featured:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

/*
.project-card-featured:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);  
    z-index: 0;
    border-radius: 16px;
}
*/

.project-card-featured .card-title,
.project-card-featured .card-subtitle {
    position: relative;
    z-index: 1;  /* Ensure text is above overlay */
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.project-card-featured:hover .card-title {
    transform: translateY(-2px);
}

.project-card-featured:hover .card-subtitle {
    opacity: 0.9;
}

.project-card-featured-secondary {
    display: flex;
    height: 400px;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 16px;
    border-radius: 16px;
    justify-content: flex-start;
    gap: 8px;
    flex-direction: column;
    text-decoration: none;  /* Remove link underline */
    color: inherit;  /* Inherit text color */
    cursor: pointer;  /* Pointer cursor style */
    transition: transform 0.3s ease, box-shadow 0.3s ease;  /* Add transition effect */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Use pseudo-element for smooth background image transition */
.project-card-featured-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--hover-bg-image, url('path/to/your/image.jpg'));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 16px;
    z-index: 0;
}

.project-card-featured-secondary:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

/*
.project-card-featured-secondary:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3); 
    z-index: 0;
    border-radius: 16px;
}
*/

.project-card-featured-secondary .card-title,
.project-card-featured-secondary .card-subtitle {
    position: relative;
    z-index: 1;  /* Ensure text is above overlay */
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.project-card-featured-secondary:hover .card-title {
    transform: translateY(-2px);
}

.project-card-featured-secondary:hover .card-subtitle {
    opacity: 0.9;
}


.project-card-normal {
    display: flex;
    height: 400px;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 16px;
    border-radius: 16px;
    justify-content: flex-start;
    gap: 8px;
    flex-direction: column;
    text-decoration: none;  /* Remove link underline */
    color: inherit;  /* Inherit text color */
    cursor: pointer;  /* Pointer cursor style */
    transition: transform 0.3s ease, box-shadow 0.3s ease;  /* Add transition effect */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Use pseudo-element for smooth background image transition */
.project-card-normal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--hover-bg-image, url('path/to/your/image.jpg'));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 16px;
    z-index: 0;
}

.project-card-normal:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

/*
.project-card-normal:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 0;
    border-radius: 16px;
}
*/


.project-card-normal .card-title,
.project-card-normal .card-subtitle {
    position: relative;
    z-index: 1;  /* Ensure text is above overlay */
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.project-card-normal:hover .card-title {
    transform: translateY(-2px);
}

.project-card-normal:hover .card-subtitle {
    opacity: 0.9;
}


.project-card-gap {
    height: 16px;
}

.project-title {
    font-size: 20px;
    font-weight: 400;
    margin: 0;  
    letter-spacing: -0.04em;
}

.card-title {
    font-size: 16px;
    font-weight: 400;
    margin: 0;   
}

.card-subtitle {
    font-size: 14px;
    font-weight: 300;
    margin: 0;
    color: #878787;
}

.connect-title {
    font-size: 20px;
    font-weight: 500;
    margin: 0;
}

.connect-logo {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    flex-shrink: 0;
}

.connect-logo svg {
    width: 100%;
    height: 100%;
}

.connnect-text {
    font-size: 16px;
    font-weight: 300px;
}

.connect-button {
    display: flex;
    gap: 16px;
    justify-content: flex-start;
    align-items: center;
    text-decoration: none;  /* Remove link underline */
    color: inherit;  /* Inherit text color */
    cursor: pointer;  /* Pointer cursor style */
}

.connect-container {
    display: flex;
    gap: 16px;
    flex-direction: column;
}

.footer-container {
    display: flex;
    justify-content: center;
}

.footer-text {
    font-size: 14px;
    font-weight: 300;
    margin: 0;
    color: #878787;
}

/* ========== Responsive: under 768px (tablet) ========== */
@media (max-width: 768px) {
    .container {
        margin: 0 24px;
    }

    .section {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    .section-nav {
        padding-top: 48px;
    }

    #about,
    #projects,
    #contact {
        scroll-margin-top: 48px;
    }

    .nav-container {
        gap: 24px;
    }

    .nav-button,
    .nav-font {
        font-size: 14px;
    }

    .hero {
        gap: 16px;
    }

    .hero-title-row {
        gap: 12px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-caption {
        font-size: 18px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .hero-text {
        font-size: 15px;
    }

    /* Featured + secondary: stack vertically on tablet */
    .project-container:has(.project-card-featured) {
        grid-template-columns: 1fr;
    }

    /* Three normal cards: 2 columns on tablet */
    .project-container:has(.project-card-normal):not(:has(.project-card-featured)) {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-card-featured,
    .project-card-featured-secondary,
    .project-card-normal {
        height: 320px;
        padding: 12px;
    }

    .project-title {
        font-size: 18px;
    }

    .card-title {
        font-size: 15px;
    }

    .card-subtitle {
        font-size: 13px;
    }

    .connect-title {
        font-size: 18px;
    }

    .connect-logo {
        width: 28px;
        height: 28px;
    }

    .connnect-text {
        font-size: 15px;
    }

    .footer-text {
        font-size: 13px;
    }
}

/* ========== Responsive: under 520px (mobile) ========== */
@media (max-width: 520px) {
    .container {
        margin: 0 16px;
    }

    .section {
        padding-top: 32px;
        padding-bottom: 32px;
    }

    .section-nav {
        padding-top: 32px;
    }

    #about,
    #projects,
    #contact {
        scroll-margin-top: 32px;
    }

    .nav-container {
        gap: 16px;
    }

    .nav-button,
    .nav-font {
        font-size: 13px;
    }

    .hero {
        gap: 12px;
    }

    .hero-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .hero-title {
        font-size: 24px;
    }

    .hero-caption {
        font-size: 16px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-text {
        font-size: 14px;
    }

    .project-container {
        gap: 12px;
    }

    /* All project grids: single column on mobile */
    .project-container:has(.project-card-featured) {
        grid-template-columns: 1fr;
    }

    .project-container:has(.project-card-normal):not(:has(.project-card-featured)) {
        grid-template-columns: 1fr;
    }

    .project-card-featured,
    .project-card-featured-secondary,
    .project-card-normal {
        height: 280px;
        padding: 12px;
        border-radius: 12px;
    }

    .project-card-featured::before,
    .project-card-featured-secondary::before,
    .project-card-normal::before {
        border-radius: 12px;
    }

    .project-title {
        font-size: 16px;
    }

    .card-title {
        font-size: 14px;
    }

    .card-subtitle {
        font-size: 12px;
    }

    .connect-title {
        font-size: 16px;
    }

    .connect-logo {
        width: 24px;
        height: 24px;
    }

    .connect-button {
        gap: 12px;
    }

    .connect-container {
        gap: 12px;
    }

    .connnect-text {
        font-size: 14px;
    }

    .footer-text {
        font-size: 12px;
    }
}

