:root {
    --color-black: #000000;
    --color-white: #ffffff;
    --color-glass-dark: rgba(0, 0, 0, 0.08);
    --color-glass-light: rgba(255, 255, 255, 0.16);
    --color-border-subtle: rgba(0, 0, 0, 0.1);

    /* Light Theme Default */
    --bg-primary: var(--color-white);
    --text-primary: var(--color-black);
    --text-rgb: 0, 0, 0;
    --text-muted: rgba(0, 0, 0, 0.6);
    --border-color: var(--color-border-subtle);
    --glass-hover: rgba(0, 0, 0, 0.04);
    
    /* Elegant glow */
    --glow-color: rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: var(--color-black);
        --text-primary: var(--color-white);
        --text-rgb: 255, 255, 255;
        --text-muted: rgba(255, 255, 255, 0.6);
        --border-color: rgba(255, 255, 255, 0.15);
        --glass-hover: rgba(255, 255, 255, 0.1);
        --color-glass-dark: rgba(255, 255, 255, 0.12);
        
        /* Elegant glow for dark mode */
        --glow-color: rgba(255, 255, 255, 0.2);
    }
}

#main-content {
    opacity: 1;
}

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

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.45;
    font-feature-settings: "kern" 1;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.14px;
    font-weight: 300;
    overflow-x: hidden;
    
    /* Sticky Footer v8.22.0 */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

/* Typography */
.section-heading { font-size: clamp(32px, 4vw, 64px); font-weight: 400; line-height: 1.10; letter-spacing: -0.96px; margin-bottom: 16px; }
.sub-heading { font-size: 26px; font-weight: 540; line-height: 1.35; letter-spacing: -0.26px; margin-bottom: 24px; }
.feature-title { font-size: 24px; font-weight: 700; line-height: 1.45; letter-spacing: -0.5px; }
.body-large { font-size: 20px; line-height: 1.40; letter-spacing: -0.14px; }
.body-standard { font-size: 16px; line-height: 1.45; letter-spacing: -0.14px; font-weight: 340; }
.light-weight { font-weight: 320; }
.mono-label { font-family: 'Lato', sans-serif; font-size: 18px; font-weight: 700; line-height: 1.30; letter-spacing: 0.1em; text-transform: uppercase; }
.mono-small { font-family: 'Lato', sans-serif; font-size: 11px; font-weight: 400; line-height: 1.0; letter-spacing: 0.05em; text-transform: uppercase; display: block; margin-bottom: 12px; color: var(--text-muted); }

:focus-visible { outline: dashed 2px var(--text-primary); outline-offset: 4px; }
a { color: inherit; text-decoration: none; }
.logo-link { display: inline-flex; transition: opacity 0.3s; }
.logo-link:hover { opacity: 0.7; }

/* Navigation */
.navbar {
    display: flex; 
    align-items: center;
    justify-content: space-between;
    padding: 0 64px; 
    position: fixed; 
    top: 0; 
    left: 50%;
    transform: translateX(-50%);
    width: 100%; 
    height: 80px;
    z-index: 1000;
    background-color: var(--bg-primary); /* Initial state: Solid v7.2.0 */
    backdrop-filter: none; 
    -webkit-backdrop-filter: none;
    transition: width 0.8s cubic-bezier(0.23, 1, 0.32, 1), 
                top 0.8s cubic-bezier(0.23, 1, 0.32, 1), 
                height 0.8s cubic-bezier(0.23, 1, 0.32, 1), 
                border-radius 0.8s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.8s cubic-bezier(0.23, 1, 0.32, 1),
                background-color 0.5s ease,
                opacity 1.2s cubic-bezier(0.23, 1, 0.32, 1),
                transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);

    border-bottom: 1px solid rgba(var(--text-rgb), 0.05);
    overflow: hidden;

    /* Cinematic Intro State v7.12.0 */
    opacity: 0;
    transform: translate(-50%, -40px);
    pointer-events: none;
}

.navbar.intro-revealed {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

/* Kinetic Transformation: Elastic Pill State v6.8.0 */
.navbar.scrolled {
    top: 24px; 
    width: fit-content; 
    min-width: 680px; /* Increased to ensure AI Solutions + About + Contact fit comfortably v10.0.0 */
    max-width: 95vw;
    height: 56px;
    display: flex;
    justify-content: center; /* Symmetrical centering */
    gap: 0; /* Gaps handled by individual nav components */
    border-radius: 100px;
    background-color: rgba(255, 255, 255, 0.8) !important; /* Premium White Transparent v8.0.0 */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.4); /* Refined glass border */
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    padding: 0 32px;
}

/* Hide labels/filters when in capsule state v8.0.0 */
.navbar.scrolled .nav-sub-tabs {
    display: none !important;
}

/* Sync Drawer/Expansion Sync v7.41.0: Removed Force Hide to allow Capsule expansion */
.navbar.scrolled .nav-sub-tabs { 
    margin-top: 0;
}

@media (prefers-color-scheme: dark) {
    .navbar.scrolled { 
        background-color: rgba(255, 255, 255, 0.1) !important; /* Frosted white glass for dark mode v8.0.0 */
        box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 20px rgba(255,255,255,0.05); /* Halo effect */
        border: 0.5px solid rgba(255,255,255,0.2); /* Thin translucent border */
    }
}

/* Mobile Navbar Lockdown v8.90.0 (Raised to 1024px for Tablet protection) */
@media (max-width: 1024px) {
    .navbar.scrolled {
        top: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 100% !important;
        min-width: 100% !important;
        height: 80px !important;
        border-radius: 0 !important;
        padding: 0 24px !important;
        background-color: var(--bg-primary) !important;
        border: none !important;
        border-bottom: 1px solid rgba(var(--text-rgb), 0.05) !important;
        box-shadow: none !important;
        backdrop-filter: blur(20px) !important;
    }
    .navbar.scrolled .nav-center {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        opacity: 1 !important;
    }
    .navbar.scrolled .nav-right {
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

.nav-left { 
    flex: 0 0 auto; /* Protect Logo space v8.80.0 */
    min-width: 120px;
    display: flex; 
    justify-content: flex-start; 
    z-index: 10; 
}
.nav-center { 
    position: absolute; 
    left: 50%; 
    transform: translateX(-50%); 
    display: flex; 
    justify-content: center; 
    transition: all 0.50s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 5; /* Lower than Logo v8.80.0 */
    max-width: 40%; /* Prevent stretching into Logo */
}

/* Intermediate RWD: Protect Logo from Tabs collision v8.80.0 */
@media (max-width: 1100px) {
    .nav-center {
        max-width: 30%;
        overflow: hidden;
    }
    .nav-tabs {
        gap: 16px; /* Tighten gaps */
    }
}

/* Transition to Flex-Balance in Pill state to prevent overlap v7.37.1 */
.navbar.scrolled .nav-center {
    position: relative;
    left: auto;
    transform: none;
    flex: 0 0 auto;
    max-width: 100%; /* Allow full expansion in capsule v10.0.0 */
    opacity: 1;
    /* Transition synchronization for Pill stretch v7.41.0 */
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}
/* Ensure side elements don't push content off-center in capsule */
.navbar.scrolled .nav-left, 
.navbar.scrolled .nav-right {
    flex: 0 0 auto;
    min-width: unset;
}
.nav-right { 
    flex: 1; 
    display: flex; 
    justify-content: flex-end; 
    z-index: 10; 
    min-width: 120px;
}

/* Hide elements or move them during scroll */
.navbar.scrolled .nav-left { flex: 0 0 auto; opacity: 1; margin-left: 0; min-width: 0; margin-right: 48px; }
.navbar.scrolled .nav-right { flex: 1; opacity: 0; pointer-events: none; min-width: 0; }

/* Kinetic Logo Movement */
.logo-link { 
    display: inline-flex; 
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.5s; 
    z-index: 10;
}
.navbar.scrolled .logo-link {
    transform: scale(1); /* Maintain full visual size v8.13.0 */
}

.logo { 
    font-size: 20px; 
    font-weight: 700; 
    letter-spacing: -0.4px; 
    white-space: nowrap; /* Prevent line breaks v6.8.0 */
}

/* Image Logo v8.11.0 */
.logo-image {
    height: 44px; /* Bigger logo v8.13.0 */
    width: auto;
    display: block;
    object-fit: contain;
    transition: filter 0.3s;
}

@media (prefers-color-scheme: dark) {
    .logo-image {
        filter: invert(1); /* Automagic dark mode white version */
    }
}
.nav-tabs {
    display: flex; 
    gap: 32px; /* Standardized uniform gap v7.2.0 */
    padding: 8px 12px; 
    border-radius: 100px;
    transition: all 0.5s ease;
}

/* Remove pill shapes from tabs as requested */
.nav-tab {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    color: var(--text-muted); /* Default Gray v6.6.0 */
}

/* Base button styles */
.nav-tab, .pill-tab, .tag-mono {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    background-color: transparent;
    color: var(--text-muted); /* Consistently gray by default v6.6.1 */
    transition: box-shadow 0.3s ease, background-color 0.2s, transform 0.25s cubic-bezier(0.2, 0, 0, 1), color 0.3s;
    z-index: 1; 
}

/* Detail Page Plain Tags v25.1.0 */
.tag-mono-plain {
    font-family: 'Lato', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.tag-separator {
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.3;
    margin: 0 6px;
    font-weight: 300;
}

/* Simplified Tag Interaction v6.5.0: No box/halo, text-only transition */
.nav-tab:hover, .pill-tab:hover { 
    transform: none;
    box-shadow: none !important;
    color: var(--text-primary) !important;
    font-weight: 700;
}

@media (prefers-color-scheme: dark) {
    .nav-tab:hover, .pill-tab:hover {
        box-shadow: none !important;
    }
}

.nav-tab {
    font-size: 19px; /* Increased by 3pt/4px v6.8.0 */
    font-weight: 550; 
    padding: 10px 24px; 
    border-radius: 100px;
    letter-spacing: -0.2px;
}

.nav-tab.active { 
    background-color: rgba(var(--text-rgb), 0.05); /* Subtle gray background */
    color: var(--text-primary); 
    font-weight: 700; /* Bold Black for light mode as requested */
    box-shadow: none;
}

@media (prefers-color-scheme: dark) {
    .nav-tab.active {
        background-color: transparent;
        color: #ffffff;
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.2); 
        font-weight: 700;
    }
}

.nav-tab.active:hover { transform: scale(1.02); }

/* Navigation Tab Resonance v7.29.0 */
@keyframes tab-resonance {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--text-rgb), 0.2); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px 0 rgba(var(--text-rgb), 0.1); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--text-rgb), 0); }
}

.nav-tab.resonance {
    animation: tab-resonance 0.4s cubic-bezier(0.2, 0, 0, 1);
}

/* Text Crossfade Transition Effect (Universal Content Wrapper) v8.15.0 */
.nav-text-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Base states for smooth crossfade */
.nav-text-wrapper span {
    display: block;
    transition: opacity 0.3s ease;
}

.nav-tab .nav-text-wrapper .zh { display: none !important; } /* Main nav tabs stay English only */

.pill-tab .nav-text-wrapper .zh, 
.tag-mono .nav-text-wrapper .zh { 
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

.pill-tab .nav-text-wrapper .en, 
.tag-mono .nav-text-wrapper .en {
    opacity: 1;
}

/* Hover crossfade state */
.pill-tab:hover .nav-text-wrapper .en, 
.tag-mono:hover .nav-text-wrapper .en {
    opacity: 0;
}

.pill-tab:hover .nav-text-wrapper .zh, 
.tag-mono:hover .nav-text-wrapper .zh {
    opacity: 1;
}

/* Base button styles */
/* Global Utiltity: Absolute Visibility Lockdown v7.42.0 */
.hidden { display: none !important; }
#home.hidden, #works.hidden, #about.hidden, #contact.hidden, #work-detail.hidden { 
    display: none !important; 
}

.page-section { 
    position: relative; 
    width: 100%; 
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    /* Performance Optimization v8.50.0 */
    content-visibility: auto;
    contain-intrinsic-size: 1px 1000px;
}

.page-section.active {
    opacity: 1;
    pointer-events: auto;
}

.container { max-width: 1440px; margin: 0 auto; padding: 0 48px; }
#works .container { max-width: 1280px; } /* Keran-style width optimization v10.0.0 */
.container-top-padding { padding-top: 130px; }
@media (max-width: 1024px) { .container-top-padding { padding-top: 100px; } }
/* Reduced slightly to accommodate bubble hero v7.5.0 */
.page-section { display: none; min-height: calc(100vh - 150px); animation: fadeIn 0.4s ease-out forwards; }
.page-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Kinetic Bubble Hub v7.5.0 */
.bubble-hero-field {
    width: 100%;
    height: 65vh;
    position: relative;
    overflow: hidden;
    background: transparent;
    cursor: crosshair;
    margin-top: 100px;
}

/* Landing Hub v7.6.0 */
.bubble-hero-field.home-full {
    height: 100vh;
    margin-top: 0;
}

#bubble-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

@media (max-width: 1024px) {
    .bubble-hero-field { height: 50vh; }
}
.nav-sub-tabs {
    display: none; /* Removed from layout when closed to ensure uniform menu gaps v7.36.0 */
    align-items: center;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
    /* Faster Snappier Expansion v7.35.1 */
    transition: max-width 0.45s cubic-bezier(0.23, 1, 0.32, 1), 
                opacity 0.3s ease, 
                margin 0.45s cubic-bezier(0.23, 1, 0.32, 1),
                padding 0.45s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 5;
    pointer-events: none;
}

.nav-sub-tabs.drawer-open,
.nav-sub-tabs.visible {
    display: inline-flex; /* Re-enters layout only when active v7.37.0 */
    max-width: 1000px; 
    opacity: 1;
    margin-left: 12px;
    padding-left: 12px;
    pointer-events: auto;
}

.nav-sub-tabs.visible {
    /* Auto-show on works page reveal v7.35.0 */
    padding-right: 12px;
}

.filter-container {
    display: flex; 
    gap: 16px;
    align-items: center;
}

.nav-sub-tabs .pill-tab {
    font-size: 14px;
    font-weight: 460;
    padding: 0 12px !important;
    letter-spacing: -0.01em;
    color: var(--text-muted);
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-sub-tabs.drawer-open .pill-tab,
.nav-sub-tabs.visible .pill-tab {
    opacity: 1;
    transform: translateX(0);
}

.nav-sub-tabs .pill-tab.active {
    color: var(--text-primary);
    font-weight: 600;
}

/* Mobile Navigation Elements v7.4.0 (Reverted) */
.nav-only { display: none; }

@media (max-width: 1024px) {
    .nav-sub-tabs { display: none; }
    .nav-only { display: flex; }
}

/* Works Grid (Optimized Spacing v6.4.0) */
.works-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); 
    column-gap: 20px; /* More compact horizontal gap v11.0.0 */
    row-gap: 40px;    /* Reduced to 2/3 of previous spacing v17.0.0 */
    margin-bottom: 120px; 
}

/* Frameless Work Cards: No Round Edges */
.work-card { background: transparent; border: none; overflow: visible; cursor: pointer; }
.work-image-container { 
    width: 100%; aspect-ratio: 1.46 / 1; overflow: hidden; border-radius: 0; margin-bottom: 12px; /* Fine-tuned for Keran feel */
    transition: box-shadow 0.4s ease, transform 0.4s ease;
    background-color: rgba(var(--text-rgb), 0.03); /* Base placeholder color */
    contain: paint; /* Isolate rendering */
}
.work-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}
.work-info-tags {
    font-family: 'Lato', sans-serif;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40%;
}
@media (max-width: 640px) {
    .work-info-tags { display: none; } /* Hide tags on mobile to prioritize title */
}
.work-image-container img {
    image-rendering: high-quality;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Skeleton Loading v8.20.0 */
.work-image-container.loading {
    background: linear-gradient(
        90deg, 
        rgba(var(--text-rgb), 0.03) 25%, 
        rgba(var(--text-rgb), 0.08) 50%, 
        rgba(var(--text-rgb), 0.03) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 2s infinite linear;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.work-image { 
    width: 100%; height: 100%; object-fit: cover; border-radius: 0; 
    transition: opacity 0.8s cubic-bezier(0.2, 0, 0, 1), transform 0.4s ease, filter 0.4s ease; 
    opacity: 0; /* Default hidden for fade-in */
}

.work-image.loaded {
    opacity: 1;
}
.work-card:hover .work-image { transform: scale(1.03); filter: brightness(0.9); }
.work-card:hover .work-image-container {
    box-shadow: 0 0 0 1px var(--border-color), 0 0 32px 4px var(--glow-color); 
    transform: translateY(-4px); 
}

@media (prefers-color-scheme: dark) {
    .work-card:hover .work-image-container {
        box-shadow: 0 0 0 1px rgba(255,255,255,0.2), 0 0 48px 6px rgba(255,255,255,0.2); /* Deeper glow in dark mode */
    }
}
.work-info { 
    padding: 0; 
    display: flex; 
    flex-direction: column; /* Ensure vertical stacking v14.0.0 */
    align-items: flex-start;
}
.work-card .feature-title { 
    margin: 0; 
    font-size: 18px; 
    font-weight: 400; 
    letter-spacing: 0.02em; 
    color: rgba(var(--text-rgb), 0.85); 
    transition: color 0.4s ease, text-shadow 0.4s ease;
    -webkit-font-smoothing: antialiased;
}
.work-card:hover .feature-title { 
    color: var(--text-primary); 
}

.work-info-tags {
    font-size: 11px;
    font-weight: 700; 
    letter-spacing: -0.02em; 
    text-transform: capitalize; 
    opacity: 0.75; 
    color: var(--text-muted);
    margin-top: -4px; /* Pulled up by half to overcome line-height v16.0.0 */
    line-height: 1.1;
}

/* Request: Border optimization v2 */
.border-subtle { border-color: rgba(var(--text-rgb), 0.1) !important; }
.border-current-20 { border: 1px solid rgba(var(--text-rgb), 0.2); }

/* Project Detail View V6.5.0: Enhanced Spacing & Minimalism */
.detail-hero-container { 
    display: none !important; /* Section removed as requested v8.25.0 */
}

/* Kinetic Scroll Affordance v7.31.0 */
.scroll-affordance {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    transition: opacity 0.6s cubic-bezier(0.2, 0, 0, 1), transform 0.6s cubic-bezier(0.2, 0, 0, 1);
    z-index: 10;
}

.scroll-affordance.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
    pointer-events: none;
}

.scroll-track {
    width: 1px;
    height: 48px;
    background: rgba(var(--text-rgb), 0.1);
    position: relative;
    overflow: hidden;
}

.scroll-dot {
    position: absolute;
    top: 0;
    left: -0.5px;
    width: 2px;
    height: 6px;
    background: var(--text-primary);
    animation: anchor-fall 2.5s cubic-bezier(0.23, 1, 0.32, 1) infinite;
}

@keyframes anchor-fall {
    0% { transform: translateY(-100%); opacity: 0; }
    20% { opacity: 1; }
    70% { opacity: 1; }
    100% { transform: translateY(48px); opacity: 0; }
}

.scroll-label {
    font-family: "Lato", sans-serif;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    text-transform: uppercase;
}
.detail-hero-container img { 
    width: 100%; height: 100%; object-fit: cover; 
    filter: blur(100px) brightness(1.1) saturate(1.2); /* Cinematic Atmospheric Glow v8.23.0 */
    transform: scale(1.5); /* Scale up to hide blurred edges */
    opacity: 0.85;
    
    /* Bottom Feathering Transition v8.24.0 */
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 75%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 75%, rgba(0,0,0,0) 100%);
}

.detail-narrative-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
    padding: clamp(16px, 3vw, 32px) 0; /* Responsive vertical padding v8.63.0 */
    width: 65%;
    margin: 0 auto;
}
@media (max-width: 1024px) {
    .detail-narrative-grid { width: 80%; }
}
@media (max-width: 1024px) {
    .detail-narrative-grid { width: 90%; grid-template-columns: 1fr; gap: 32px; padding-top: 40px; }
    .narrative-left { 
        grid-column: 1; border-right: none; 
        padding-right: 0; padding-bottom: 32px; 
        display: flex; flex-direction: column; gap: 16px; 
    }
    .narrative-right { grid-column: 1; }
    
    /* Flatten Spec Info at Mobile v6.4.0 */
    .narrative-left .spec-header { border-bottom: none; margin-bottom: 0 !important; padding-bottom: 0 !important; }
    .narrative-left .grid { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
    .spec-item { margin-bottom: 0; display: flex; align-items: center; gap: 8px; }
    .spec-item::after { content: '/'; margin-left: 8px; opacity: 0.3; }
    .spec-item:last-child::after { display: none; }
    .spec-item .mono-label { display: none; } /* Hide labels for ultra-compact look */
    .spec-item p { font-size: 11px; color: var(--text-muted); font-style: normal; opacity: 1; }
    
    .detail-tags { display: flex; flex-wrap: wrap; gap: 8px; }
    .detail-tags::after { content: '/'; margin-left: 8px; opacity: 0.3; display: block; }
}

.narrative-left { grid-column: span 4; border-right: none; padding-right: 32px; }
.narrative-right { grid-column: span 8; }

.spec-item { display: none !important; } /* Remove Date/Author metadata globally */

.narrative-text-box {
    position: relative;
    max-height: none; /* v6.2.0: No restriction on detail right side usually, but keep if preferred */
    overflow: visible;
}

.narrative-body {
    font-size: 14px; /* Reduced for more refined look v8.2.0 */
    font-weight: 380;
    line-height: 1.65;
    letter-spacing: -0.1px;
}

.narrative-mask { display: none; }

.read-more-btn {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: 100px; /* Pill shape as requested */
    padding: 12px 24px;
    height: auto;
    width: fit-content;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.3s ease, opacity 0.3s;
}

.read-more-btn:hover { transform: scale(1.05); opacity: 0.9; }

.read-more-btn .nav-text-wrapper { height: 24px; }
.read-more-btn .nav-text-wrapper span { line-height: 24px; }

.spec-header h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.spec-header { border-bottom: none; }

#work-detail.page-section {
    padding-top: clamp(40px, 6vw, 80px); /* Reduced top gap v8.63.0 */
}

.detail-text-container {
    padding-bottom: clamp(20px, 4vw, 40px); /* Reduced intermediate gap */
}

/* Gallery V6.4.0: Reduced top gap to guide reading */
.detail-gallery-section { 
    display: flex; 
    flex-direction: column; 
    gap: clamp(24px, 5vw, 48px); /* Responsive image gap v8.63.0 */
    padding: 0 0 clamp(60px, 10vw, 120px); /* Reduced bottom padding */
} 
.detail-hero-img, .detail-gallery-img, .project-card-img {
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    background-color: var(--color-glass-dark);
}

.detail-hero-img.loaded, .detail-gallery-img.loaded, .project-card-img.loaded, .loaded {
    opacity: 1 !important;
}

.detail-gallery-img { width: 65%; height: auto !important; margin: 0 auto; display: block; border-radius: 0; box-shadow: 0 20px 80px rgba(0,0,0,0.05); }

@media (max-width: 1024px) {
    .detail-gallery-img { width: 80%; }
}
@media (max-width: 1024px) {
    .detail-gallery-img { width: 90%; }
}
@media (prefers-color-scheme: dark) {
    .detail-gallery-img { box-shadow: 0 20px 80px rgba(0,0,0,0.3); }
}

/* About & Contact v6.8.0 Centering v7.37.0 */
#about.page-section {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 70vh; 
    padding-top: 80px; /* Reset to standard offset v8.22.0 */
}

#about .container-top-padding {
    padding-top: 80px; /* Balanced spacing v8.22.0 */
}

.about-grid { 
    display: grid; 
    grid-template-columns: 1fr 1.2fr; 
    gap: 80px; 
    align-items: center; 
}

/* Experience List v7.38.0 */
.experience-container { margin-top: 48px; border-top: 1px solid var(--border-color); padding-top: 32px; }
.exp-row { 
    display: flex; 
    align-items: baseline; 
    gap: 24px; 
    padding: 16px 0; 
    border-bottom: 0.5px solid rgba(var(--text-rgb), 0.05); 
}
.exp-row:last-child { border-bottom: none; }
.exp-year { flex: 0 0 100px; opacity: 0.5; letter-spacing: 0.05em; font-size: 11px; }
.exp-details { display: flex; flex-direction: column; gap: 4px; }
.exp-role { font-size: 15px; font-weight: 560; color: var(--text-primary); }
.exp-company { font-size: 13px; color: var(--text-muted); }
.about-visual { 
    background-color: transparent; 
    border-radius: 8px; 
    overflow: hidden; 
    width: 65%; /* Increased from 50% (+15%) v6.8.0 */
    margin: 0 auto; /* Centered */
}
.profile-img { 
    width: 100%; max-width: 100%; height: auto !important; border-radius: 8px; 
    display: block; 
}
.contact-container { 
    max-width: 800px; 
    margin: 80px auto 0; /* Added spacing to clear headers */
    padding-bottom: 120px; 
}
.contact-subtext { margin-bottom: 64px; }
.contact-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 48px; }
.contact-item { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; border-bottom: 1px solid var(--border-color); }
.contact-link { font-size: 20px; font-weight: 540; letter-spacing: -0.26px; }
.contact-item a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.social-bar { display: flex; justify-content: center; gap: 16px; }

/* Footer v7.37.0 Minimalist Re-scale */
.site-footer { border-top: 1px solid var(--border-color); padding: 16px 0; }
.footer-content { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    color: var(--text-muted); 
    font-size: 11px;
    letter-spacing: 0.02em;
    font-weight: 300;
}

/* Jzc Kinetic Loader v8.17.0 - Logo Sprite Animation */
.loader { 
    position: fixed; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    display: flex;
    gap: 8px; /* Slightly tighter gap for the logo font */
    z-index: 9999;
    align-items: center;
}

.loader span {
    display: inline-block;
    height: 80px;
    font-size: 0;
    color: transparent;
    background-image: url('../assets/logo.png');
    background-size: 180px auto;
    background-repeat: no-repeat;
    animation: jzc-kinetic-jump 1.4s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
    /* Respect theme colors */
    transition: filter 0.3s;
}

@media (prefers-color-scheme: dark) {
    .loader span {
        filter: invert(1);
    }
}

.loader .j { width: 50px; background-position: -2px 0px; }
.loader .z { width: 70px; background-position: -52px 0px; animation-delay: 0.1s; }
.loader .c { width: 60px; background-position: -122px 0px; animation-delay: 0.2s; }

@keyframes jzc-kinetic-jump {
    0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
    30% { transform: translateY(-35px) scale(1.05); opacity: 0.9; }
    60% { transform: translateY(5px) scale(0.98); opacity: 1; }
}

/* Responsive Actions v7.2.0 */
@media (max-width: 1024px) {
    .container { padding: 0 24px; }
    .container-top-padding { padding-top: 120px !important; } /* Balanced v8.97.0 */
    .navbar { 
        display: flex; 
        flex-direction: row; 
        justify-content: space-between;
        align-items: center;
        padding: 16px 24px; 
    }

    /* Mobile Works Filter Expansion v8.60.0 */
    .mobile-filter-toggle-wrapper {
        width: 100%;
        margin-bottom: 8px; /* Reduced to connect with dropdown v8.95.0 */
    }
    #mobile-filter-hook {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch;
        width: 100%;
        margin-top: 24px; /* Symmetrical Top Gap v8.97.0 */
        margin-bottom: 24px; /* Symmetrical Bottom Gap v8.97.0 */
    }
    .mobile-filter-trigger {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        background: rgba(var(--text-rgb), 0.05);
        border: 1px solid rgba(var(--text-rgb), 0.1);
        border-radius: 12px;
        color: var(--text-primary);
        font-weight: 500;
        cursor: pointer;
    }
    .mobile-filter-trigger .mobile-filter-label {
        width: 60px;
        font-size: 10px;
        flex-shrink: 0;
        opacity: 0.4;
        text-align: left;
        display: flex;
        align-items: center;
        letter-spacing: 0.05em;
        line-height: 1; /* Reset for precise centering v8.99.1 */
        transform: translateY(1.5px); /* Visual center correction v8.99.1 */
    }
    .mobile-filter-trigger .current-label { 
        flex: 1;
        text-align: left;
        font-size: 14px; 
        font-weight: 600; 
        line-height: 1; /* Match line height for shared axis v8.99.1 */
        padding-left: 20px;
    }
    .mobile-filter-trigger i { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
    .mobile-filter-trigger.active i { transform: rotate(180deg); }

    .works-grid + #pagination-container {
        margin-top: 32px;
    }

    #works #filter-container {
        display: flex;
        flex-direction: column;
        gap: 8px;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        padding: 0;
        margin: 0;
    }
    #works #filter-container.mobile-expanded {
        max-height: 800px; /* Increased to fit all tags v8.95.0 */
        opacity: 1;
        padding-top: 8px;
        padding-bottom: 24px;
        margin-bottom: 16px;
        border-bottom: 1px solid rgba(var(--text-rgb), 0.05);
    }
    #works #filter-container .pill-tab {
        justify-content: flex-start;
        padding: 10px 100px !important; /* Offset = Toggle Padding(20) + Label Width(80) = 100px v8.98.0 */
        font-size: 15px;
        border-radius: 8px;
        width: 100%;
        text-align: left;
    }
    #works #filter-container .pill-tab .nav-text-wrapper {
        align-items: flex-start;
        text-align: left;
    }
    #works #filter-container .pill-tab.active {
        background: rgba(var(--text-rgb), 0.1);
    }
    
    .logo { font-size: 16px; }
    .nav-tabs { display: none !important; } /* Hide tabs on mobile to prevent overflow v8.12.0 */
    .nav-center { display: none !important; }
    .nav-tab { padding: 8px 12px; font-size: 17px; } /* Slightly smaller for mobile fit */
    
    .about-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
    .about-visual { width: 85%; margin: 0 auto; }
    .about-info { text-align: left; }
    .works-grid { grid-template-columns: 1fr; gap: 48px; }
    .contact-item { flex-direction: column; align-items: flex-start; gap: 12px; padding: 32px 0; }

    /* --- Discovery Drawer v7.19.0 --- */
    .nav-right {
        display: flex !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        width: auto !important;
    }


    #integrated-filter-bar {
        position: fixed;
        top: 100px; /* Below standard navbar */
        left: 0;
        width: 100%;
        background: rgba(var(--text-rgb), 0.03);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        max-height: 0;
        overflow: hidden;
        /* High-end "Spring" Curve v7.29.0 */
        transition: max-height 0.7s cubic-bezier(0.34, 1.56, 0.64, 1), 
                    padding 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
        z-index: 900;
        padding: 0 24px;
        display: block !important; 
    }

    #integrated-filter-bar.drawer-open {
        max-height: 500px; /* Increased to accommodate bounce */
        padding: 40px 24px;
        box-shadow: 0 30px 60px rgba(0,0,0,0.15);
    }

    #integrated-filter-bar .filter-container {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        justify-content: flex-start;
    }

    /* Staggered Tag Entry v7.29.0 */
    #integrated-filter-bar .pill-tab {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.2, 0, 0, 1);
    }

    #integrated-filter-bar.drawer-open .pill-tab {
        opacity: 1;
        transform: translateY(0);
    }

    /* Snappier 15-Step Staggered Delay Table (Phase 35.1) */
    .nav-sub-tabs.drawer-open .pill-tab:nth-child(1), .nav-sub-tabs.visible .pill-tab:nth-child(1)  { transition-delay: 0.00s; }
    .nav-sub-tabs.drawer-open .pill-tab:nth-child(2), .nav-sub-tabs.visible .pill-tab:nth-child(2)  { transition-delay: 0.02s; }
    .nav-sub-tabs.drawer-open .pill-tab:nth-child(3), .nav-sub-tabs.visible .pill-tab:nth-child(3)  { transition-delay: 0.04s; }
    .nav-sub-tabs.drawer-open .pill-tab:nth-child(4), .nav-sub-tabs.visible .pill-tab:nth-child(4)  { transition-delay: 0.06s; }
    .nav-sub-tabs.drawer-open .pill-tab:nth-child(5), .nav-sub-tabs.visible .pill-tab:nth-child(5)  { transition-delay: 0.08s; }
    .nav-sub-tabs.drawer-open .pill-tab:nth-child(6), .nav-sub-tabs.visible .pill-tab:nth-child(6)  { transition-delay: 0.10s; }
    .nav-sub-tabs.drawer-open .pill-tab:nth-child(7), .nav-sub-tabs.visible .pill-tab:nth-child(7)  { transition-delay: 0.12s; }
    .nav-sub-tabs.drawer-open .pill-tab:nth-child(8), .nav-sub-tabs.visible .pill-tab:nth-child(8)  { transition-delay: 0.14s; }
    .nav-sub-tabs.drawer-open .pill-tab:nth-child(9), .nav-sub-tabs.visible .pill-tab:nth-child(9)  { transition-delay: 0.16s; }
    .nav-sub-tabs.drawer-open .pill-tab:nth-child(10), .nav-sub-tabs.visible .pill-tab:nth-child(10) { transition-delay: 0.18s; }
    #integrated-filter-bar.drawer-open .pill-tab:nth-child(11) { transition-delay: 0.50s; }
    #integrated-filter-bar.drawer-open .pill-tab:nth-child(12) { transition-delay: 0.54s; }
    #integrated-filter-bar.drawer-open .pill-tab:nth-child(13) { transition-delay: 0.58s; }
    #integrated-filter-bar.drawer-open .pill-tab:nth-child(14) { transition-delay: 0.62s; }
    #integrated-filter-bar.drawer-open .pill-tab:nth-child(15) { transition-delay: 0.66s; }
}/* Pagination Controls v7.18.0 */
.pagination-container {
    margin-top: -8px; /* Pulled up closer to the grid divider v13.0.0 */
    padding: 4px 0 40px 0; /* Compact verticality */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px; /* Tighter gap between numbers */
    border-top: none;
}

.pagination-btn {
    background: transparent;
    border: none; /* Removed all borders as requested v12.0.0 */
    padding: 8px 12px;
    border-radius: 4px; /* Minimalist angular look */
    font-family: 'Lato', sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn.number-btn {
    padding: 8px 12px;
    min-width: 32px;
}

.pagination-btn.arrow-btn {
    font-size: 14px;
    border: none; /* Clean arrows */
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(var(--text-rgb), 0.03);
    color: var(--text-primary);
}

.pagination-btn.active {
    color: var(--text-primary);
    font-weight: 600;
    border-color: rgba(var(--text-rgb), 0.2);
    background: rgba(var(--text-rgb), 0.02);
}

.pagination-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.page-info {
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* --- Mobile Nav Styles v8.12.0 --- */
.mobile-only { display: none; }
@media (max-width: 768px) {
    .mobile-only { display: flex; }
}

.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1000;
}

.hamburger-btn .line {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary); /* Automatically adapts properly */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.hamburger-btn.active .line:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}

.hamburger-btn.active .line:nth-child(2) {
    transform: translateY(-4px) rotate(-45deg);
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.92); /* More opaque v8.90.0 */
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-100%); /* Slide Down v8.90.0 */
    opacity: 1; /* Keep opaque but hidden by transform */
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

@media (prefers-color-scheme: dark) {
    .mobile-drawer {
        background: rgba(10, 10, 10, 0.95);
    }
}

.mobile-drawer.open {
    transform: translateY(0);
    pointer-events: auto;
}

.drawer-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
    text-align: center;
}

.drawer-link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    color: var(--text); /* Use text color variable */
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.5s;
}

.drawer-link .en {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
}

.drawer-link .zh {
    font-size: 14px;
    opacity: 0.5;
    font-weight: 500;
}

/* Kinetic Back-to-Top Button v8.30.0 */
.back-to-top-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(var(--text-rgb), 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(var(--text-rgb), 0.1);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.back-to-top-btn.hidden {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
}

.back-to-top-btn:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

/* Particle FX Canvas */
.scroll-fx-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    pointer-events: none;
    background: transparent;
}

@media (max-width: 1024px) {
    .back-to-top-btn {
        bottom: 24px;
        right: 24px;
        width: 48px;
        height: 48px;
    }
    /* Audit Fix: Ensure Detail Spacing is solid on small mobile v8.80.0 */
    .detail-narrative-grid { width: 90% !important; }
    .detail-gallery-img { width: 100% !important; }
}

.mobile-drawer.open .drawer-link {
    transform: translateY(0);
    opacity: 1;
}

.mobile-drawer.open .drawer-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-drawer.open .drawer-link:nth-child(2) { transition-delay: 0.2s; }
.mobile-drawer.open .drawer-link:nth-child(3) { transition-delay: 0.3s; }

