@font-face {
    font-family: 'NeueMachina-Ultrabold';
    src: url('PPNeueMachina-InktrapUltrabold.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

/* ZhuHei font removed as file is missing */



/* Reset & Base Variables */
:root {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --text-muted: #999999;
    --accent-color: #a6192e;
    /* dark red from reference */

    --font-heading: 'NeueMachina-Ultrabold', sans-serif;
    --font-body: 'NeueMachina-Ultrabold', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --border-color: rgba(255, 255, 255, 0.1);

    --gap-lg: 120px;
    --gap-md: 60px;
    --gap-sm: 24px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overscroll-behavior: none;
    cursor: none;
    /* Hide default cursor */
}

/* Custom Cursor Styles */
.cursor {
    width: 8px;
    height: 8px;
    background-color: #fff;
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99999;
    mix-blend-mode: difference;
}

.cursor-follower {
    width: 40px;
    height: 40px;
    background-color: #fff;
    /* Solid white for full inversion */
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99998;
    transition: background-color 0.3s, width 0.3s, height 0.3s, opacity 0.3s;
    mix-blend-mode: difference;
    opacity: 0.7;
    /* Adjust opacity if the inversion is too harsh, or keep at 1 for pure inversion */
}

/* Hover effects for cursor */
.cursor-hover .cursor {
    transform: scale(2);
}

.cursor-hover .cursor-follower {
    width: 80px;
    height: 80px;
    background-color: #fff;
    opacity: 1;
}

/* Make sure links and buttons also hide default cursor */
a,
button,
[role="button"],
.geo-tab,
.work-item,
.nav-btn,
.back-link {
    cursor: none !important;
}

/* Locomotive Scroll Recommended Base Styles */
html.has-scroll-smooth {
    overflow: hidden;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

[data-scroll-container] {
    min-height: 100vh;
}

/* Links */
a {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: color 0.3s ease;
}

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

/* Typography map */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: normal;
}

.mono {
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Utility */
.scramble-text {
    display: inline-block;
    opacity: 0;
    white-space: nowrap;
}

/* --- Layout --- */

/* Top bar (Navbar) */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: normal;
    color: #ffdf99;
    /* Matching the title color */
    background-color: transparent;
    transition: background-color 0.4s ease, height 0.4s ease;
    pointer-events: auto;
}

.topbar.is-scrolled {
    background-color: #000000;
    height: 70px;
    /* Slightly more compact on scroll */
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-logo-dot {
    width: 44px;
    height: 44px;
    background-image: url('https://personalwebsite-1258212294.cos.ap-guangzhou.myqcloud.com/indeximg/me.png');
    background-size: cover;
    background-position: center;
    border-radius: 50%;
}

.topbar-brand {
    font-size: 28px;
    font-weight: normal;
    letter-spacing: -0.01em;
}

.topbar-right {
    display: flex;
    gap: 40px;
    align-items: center;
}

.topbar-right a {
    text-transform: none;
    /* Matches "About me" etc from image */
    letter-spacing: normal;
    transition: opacity 0.3s ease;
}

.topbar-right a:hover {
    opacity: 0.7;
    color: inherit;
}

/* Hide divider line if it exists */
.topbar {
    border-bottom: none;
}

/* Subtle Marble Texture for Dark Sections */
.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Subtle black marble texture from Unsplash */
    background-image: url('https://images.unsplash.com/photo-1598818384697-623e1ca2891d?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.15;
    /* Very subtle */
    pointer-events: none;
    z-index: -1;
    mix-blend-mode: lighten;
}

.hero-section {
    position: relative;
    z-index: 10;
    /* Increased to allow overflow to stay on top */
}

.about-section {
    position: relative;
    z-index: 1;
}

/* About Section (New Resume Style) */
.about-section {
    background-color: #000000;
    padding: 160px 0;
    min-height: auto;
    border-top: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    /* Prevent body horizontal scroll */
}

.about-scroll-wrapper {
    width: 100vw;
    display: flex;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.about-scroll-wrapper::-webkit-scrollbar {
    display: none;
    /* Safari and Chrome */
}

.about-container {
    display: flex;
    padding: 0 60px;
    gap: 60px;
    width: 100%;
    align-items: flex-start;
    box-sizing: border-box;
}

.about-col {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

/* Column 1: Profile */
.profile-col {
    border-right: none;
}

.about-main-title {
    font-family: var(--font-heading);
    font-size: 3.5vw;
    line-height: 1;
    margin-bottom: 30px;
    font-weight: normal;
    color: #ffdf99;
}

.about-highlights {
    margin-bottom: 60px;
}

.about-highlights p {
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.about-edu {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.edu-item span {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #ffffff;
}

.edu-item p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Experience Columns */
.exp-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.exp-header h3 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #ffdf99;
}

.exp-meta {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-muted);
    font-family: var(--font-body);
}

.exp-content {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.exp-item h4 {
    font-size: 14px;
    font-weight: normal;
    margin-bottom: 12px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exp-item p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
}

.mt-lg {
    margin-top: 80px;
}

@media (max-width: 1024px) {
    .about-col {
        min-width: 350px;
    }
}

/* Light Section (Work Section) */
.light-section {
    background-color: #f8f8f8;
    color: #1a1a1a;
    padding: var(--gap-lg) 40px;
    min-height: 80vh;
}

.light-header {
    margin-bottom: var(--gap-lg);
}

.light-header h2 {
    font-family: var(--font-heading);
    font-size: 3.5vw;
    /* Synced with About me title */
    line-height: 1;
    font-weight: normal;
    letter-spacing: -0.01em;
}

/* Work Grid */
.work-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(80px, auto);
    gap: 20px;
}

.work-item {
    grid-column: span 6;
    margin-bottom: 6vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.work-item.offset-right {
    grid-column: 7 / span 6;
    margin-top: 8vh;
}

/* Response for large screens */
@media (min-width: 1600px) {
    .work-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }

    .work-item,
    .work-item.offset-right {
        grid-column: span 1 !important;
        margin-top: 0 !important;
        margin-bottom: 40px;
    }

    /* Staggered effect for 3-column layout */
    .work-item:nth-child(3n+2) {
        margin-top: 10vh !important;
    }

    .work-item:nth-child(3n) {
        margin-top: 5vh !important;
    }
}

.work-image-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: #ccc;
    margin-bottom: 15px;
}

.work-image-container img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.6s ease-out;
    transform: scale(1.05);
}

.work-item:hover .work-image-container img {
    transform: scale(1);
}

.work-info {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    padding-bottom: 10px;
}

.work-info h3 {
    font-family: var(--font-body);
    font-size: 24px;
    font-weight: bold;
    margin-left: 20px;
    color: #1a1a1a;
}

.work-num {
    opacity: 0.6;
}

/* Footer Section */
.footer-section {
    padding: var(--gap-lg) 40px 120px 40px;
    /* Increased bottom padding */
    background-color: #000000;
    color: var(--text-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    height: 60vh;
    /* Increased from 40vh */
    justify-content: center;
    align-items: center;
}

.footer-title {
    font-family: var(--font-heading);
    font-size: 8vw;
    line-height: 1;
    text-align: center;
    font-weight: normal;
    letter-spacing: -0.01em;
    color: #ffdf99;
    /* Added color */
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 60px;
}

.footer-links span {
    font-family: var(--font-body);
    font-size: 14px;
    /* Increased to 14px */
    text-transform: none;
    letter-spacing: 1px;
    color: #ffdf99;
    /* Added color */
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 320px;
    text-align: center;
}

.loader-top {
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 0.25em;
    color: #ffffff;
    opacity: 0.8;
}

.loader-bar-wrapper {
    width: 100%;
    height: 60px;
    background-color: #333333;
    /* Distinct gray box */
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.loader-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: #ffffff;
    /* Bright white progress bar */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

#home-view {
    transition: opacity 0.3s ease;
}

.detail-wrapper {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.detail-wrapper.active {
    opacity: 1;
}

/* Mobile Adaptation (width < 768px) */
@media (max-width: 768px) {

    /* 1. Hide custom mouse cursor on touch devices */
    .cursor,
    .cursor-follower {
        display: none !important;
    }

    html,
    body,
    a,
    button,
    .work-item,
    .geo-tab,
    .nav-btn,
    .back-link {
        cursor: auto !important;
    }

    /* 2. About me section: 3 columns to 1 column */
    .about-scroll-wrapper {
        overflow-x: visible;
        width: 100%;
    }

    .about-container {
        flex-direction: column;
        padding: 0 24px;
        gap: 60px;
        width: 100%;
    }

    .about-col {
        min-width: 100%;
        margin-bottom: 40px;
    }

    .about-main-title,
    .light-header h2 {
        font-size: 32px;
    }

    /* 3. Key work section: 1 column display */
    .work-grid {
        grid-template-columns: repeat(1, 1fr) !important;
        gap: 48px;
    }

    .work-item,
    .work-item.offset-right {
        grid-column: span 1 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .work-image-container {
        margin-bottom: 10px;
    }

    .work-info h3 {
        font-size: 14px;
        margin-left: 10px;
        white-space: normal;
    }

    /* 4. Footer section: Vertical stack display */
    .footer-links {
        flex-direction: column !important;
        gap: 20px !important;
        width: 100%;
        align-items: center;
        padding: 0;
    }

    .footer-links span {
        font-size: 13px !important;
        /* Slightly larger for easier tap/reading */
        letter-spacing: 0.5px;
        white-space: nowrap;
    }

    /* 5. Hide navigation links in topbar */
    .topbar-right {
        display: none !important;
    }
}