:root {
    --bg-color: #ffffff;
    --text-dark: #1A1A1A;
    --text-muted: #888888;
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Inter', sans-serif;
    --hover-accent: #95d35f;
}

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

body { background-color: var(--bg-color); color: var(--text-dark); font-family: var(--font-sans); overflow-x: hidden; }

/* 导航栏 */
.top-nav { position: fixed; top: 0; left: 0; width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 30px 5vw; z-index: 100; mix-blend-mode: difference; color: white; }
.logo { font-family: var(--font-serif); font-size: 1.2rem; letter-spacing: 4px; font-weight: 300;}
.nav-links a { 
    font-family: var(--font-serif); /* Changed to your elegant Serif font */
    font-size: 0.9rem; /* Slightly larger for readability */
    letter-spacing: 2px; 
    text-transform: uppercase;
    color: white; 
    text-decoration: none; 
    margin-left: 40px; 
    transition: opacity 0.3s ease;
}

.nav-links a:hover {
    opacity: 0.4; /* Adds a subtle fade when hovered */
}
/* =========================================
   首页 Hero 
   ========================================= */
.hero { position: relative; width: 100vw; height: 85vh; display: flex; justify-content: center; align-items: center; overflow: hidden; background: transparent; /* let the canvas show through */
}

#inkCanvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

.hero-content { 
    position: relative; 
    z-index: 1; 
    text-align: center; 
    pointer-events: none; 
    /* 平滑过渡消失/出现 */
    transition: opacity 0.8s ease, transform 0.8s ease; 
}

/* 当用户往下滚动时触发此类名 */
.hero-content.scrolled-out {
    opacity: 0;
    transform: translateY(-20px);
}

.artist-name { 
    font-family: var(--font-serif); 
    font-size: 2.2rem; /* 变小 */
    font-weight: 300; 
    letter-spacing: 8px; /* 增加字间距，显得更精致 */
    text-transform: uppercase;
    margin-bottom: 1.2rem; 
    margin-top: 1.2rem; 
    color: #222;
}

.hero-quote { 
    font-family: var(--font-serif); 
    font-size: 1.1rem;
    font-style: italic;
    font-weight: 300;
    line-height: 2; 
    letter-spacing: 1.5px;
    color: #777; /* 颜色变淡，更有呼吸感 */
}

/* 优雅的向下滚动细线动画 */
.scroll-indicator {
    margin-top: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px; /* 控制线条总高度 */
}

.scroll-line {
    width: 1px;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1); /* 浅色轨道 */
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background-color: #78f00f; /* 深色流动线段 */
    animation: scrollLineLoop 2s infinite cubic-bezier(0.65, 0, 0.35, 1);
}

@keyframes scrollLineLoop {
    0% { top: -50%; }
    100% { top: 100%; }
}

/* =========================================
   空间画廊 - Horizontal 3D Scroll Gallery
   ========================================= */
.spatial-gallery-section { 
    position: relative; 
    width: 100vw; 
    height: 90vh; 
    background: rgb(255, 255, 255);
    overflow: hidden; 
    cursor: grab;
    perspective: 1200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 0;
    z-index: 1;
}
.spatial-gallery-section:active { cursor: grabbing; }
.gallery-instructions { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); z-index: 10; font-size: 0.55rem; letter-spacing: 1.5px; color: #777; pointer-events: none; text-transform: uppercase;}

.viewport { 
    width: 100%; 
    flex: 1;
    overflow: hidden;
    perspective: 1200px;
}

.world { 
    position: relative; 
    width: 100%; 
    height: 100%; 
    transform-style: preserve-3d; 
    transform-origin: center center; 
    display: flex;
    align-items: center;
    will-change: transform;
    z-index: 2;
}

.artwork { 
    position: relative;
    flex-shrink: 0;
    width: 30vw;
    height: 100%;
    display: flex; 
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    cursor: pointer; 
    will-change: transform;
    transform-style: preserve-3d;
    margin: 0 3vw;
    pointer-events: auto;
    z-index: 1;
}

.artwork img { 
    max-height: 60vh; 
    max-width: 100%; 
    object-fit: contain; 
    /*box-shadow: 0 20px 50px rgba(0,0,0,0.1); */
    transition: transform 0.4s ease, box-shadow 0.4s ease, filter 0.4s ease; 
    pointer-events: auto; 
}

.artwork:hover img { 
    transform: translateY(-15px) scale(1.03); 
    /*box-shadow: 0 30px 70px rgba(0,0,0,0.2);  */
    filter: brightness(1.05);
}

.artwork:hover { z-index: 5; }

.artwork .caption { 
    font-family: var(--font-serif); 
    font-size: 1.3rem; 
    font-style: italic; 
    opacity: 0; 
    transition: opacity 0.4s ease; 
    color: #444;
    text-align: center;
    pointer-events: none;
    will-change: opacity;
}

.artwork:hover .caption { 
    opacity: 1 !important; 
}

/* =========================================
   About 区域 (保持不变)
   ========================================= */
.about-section { padding: 150px 10vw 120px 10vw; background-color: var(--bg-color); display: flex; justify-content: center; }
.about-container { max-width: 760px; text-align: center; }
.section-title { font-family: var(--font-serif); font-size: 2.2rem; margin-bottom: 3rem; font-style: italic; font-weight: 300;}
.about-container p { font-family: var(--font-serif); font-size: 1.25rem; line-height: 1.8; color: var(--text-dark); margin-bottom: 2rem; text-align: justify; font-weight: 300;}
.contact-info { margin-top: 100px; padding-top: 60px; border-top: 1px solid rgba(0, 0, 0, 0.05); }
.email-link { display: block; font-family: var(--font-serif); font-size: 2rem; font-style: italic; color: var(--text-dark); text-decoration: none; margin-bottom: 40px; transition: opacity 0.3s ease; }
.email-link:hover { color:var(--hover-accent); }
.social-links { display: flex; justify-content: center; gap: 40px; }
.social-links a { font-family: var(--font-sans); font-size: 0.75rem; letter-spacing: 2px; color: var(--text-muted); text-decoration: none; text-transform: uppercase; transition: color 0.3s ease; }
.social-links a:hover { color: var(--text-dark); }
.reveal-text { opacity: 0; transform: translateY(30px); transition: opacity 1s ease-out, transform 1s ease-out; }
.reveal-text.active { opacity: 1; transform: translateY(0); }

/* =========================================
   画作详情弹窗 (保持不变)
   ========================================= */
.artwork-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: #FAFAFA; z-index: 1000; display: flex; opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }
.artwork-modal.active { opacity: 1; pointer-events: auto; }
.close-modal-btn { position: absolute; top: 40px; right: 5vw; background: none; border: none; font-family: var(--font-serif); font-size: 1rem; letter-spacing: 2px; color: var(--text-dark); cursor: pointer; z-index: 1001; transition: opacity 0.3s ease; text-transform: uppercase;}
.close-modal-btn:hover { color: #95d35f }
.modal-split-container { display: flex; width: 100%; height: 100%; }
.modal-left { flex: 1.2; height: 100%; display: flex; justify-content: center; align-items: center; padding: 120px; background-color: #ffffff; }
.modal-left img { max-width: 100%; max-height: 85vh; object-fit: contain; }
.modal-right { flex: 0.8; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 60px 8vw 60px 4vw; }
.modal-title { font-family: var(--font-serif); font-size: 2.2rem; font-style: italic; font-weight: 300; margin-bottom: 60px; color: var(--text-dark); }
.info-table { width: 100%; border-top: 1px solid rgba(0,0,0,0.05); }
.info-row { display: flex; padding: 20px 0; border-bottom: 1px solid rgba(0,0,0,0.05); font-family: var(--font-sans); font-size: 0.85rem; letter-spacing: 1px;}
.info-label { flex: 1; color: var(--text-muted); text-transform: uppercase; font-size: 0.75rem;}
.info-value { flex: 2; color: var(--text-dark); }

@media (max-width: 900px) {
    .modal-split-container { flex-direction: column; overflow-y: auto; }
    .modal-left { padding: 80px 20px 40px 20px; flex: none; height: auto; }
    .modal-right { padding: 40px 20px 80px 20px; flex: none; }
    .close-modal-btn { background: rgba(255,255,255,0.9); padding: 10px 15px; border-radius: 50px; }
}

/* =========================================
   Fluid Cursor Overlay
   ========================================= */
#fluidCursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* Let clicks pass through to the website */
    z-index: 9999; /* Keep it above everything but the modal */
    mix-blend-mode: multiply; /* Gives it an inky, watercolor blend */
}
/* =========================================
   Structured Gallery Page Layout (Hybrid Layout)
   ========================================= */
body.gallery-page {
    display: block; /* Switched to block so sections stack vertically */
    background-color: #FFFFFF; 
    overflow-x: hidden;
}

/* 1. Top Section Wrapper */
.archive-top-section {
    display: flex;
    width: 100vw;
    border-bottom: 1px solid rgba(0,0,0,0.05); /* Divider before the grid starts */
}

/* 2. Sticky Sidebar */
.archive-sidebar {
    width: 30vw;
    height: 100vh;
    position: sticky; /* Keeps it on screen while the right side scrolls */
    top: 0;
    padding: 120px 4vw 60px 4vw; /* 120px top padding ensures it sits below the top nav */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid rgba(0,0,0,0.05);
    background-color: #FFFFFF;
}

/* Updated Typography to match 'About' section in index.html */
.artist-bio-short {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 40px;
    font-weight: 300;
}

/* 3. Featured Scrollable Column (First 3 Artworks) */
.archive-featured {
    width: 70vw;
    display: flex;
    flex-direction: column;
}

.featured-item {
    width: 100%;
    min-height: 100vh; /* Ensures each artwork gets full screen focus */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 120px 5vw;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.featured-item:last-child {
    border-bottom: none; /* Prevents double borders where the grid starts */
}

/* 4. The 2-Column Grid (Remaining Artworks) */
.gallery-grid-container {
    width: 100vw;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.grid-item {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    border-right: 1px solid rgba(0,0,0,0.05);
    padding: 100px; 
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1; 
}

.grid-item:nth-child(2n) {
    border-right: none;
}

/* 5. Shared Image Styling */
.image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-wrapper img {
    max-width: 70%;
    max-height: 60vh; /* Prevents extremely tall paintings from overflowing */
    object-fit: contain;
    /* box-shadow: 0 15px 40px rgba(0,0,0,0.06); */
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.image-wrapper:hover img {
    transform: scale(1.05); 
}

/* 6. Responsive Adjustments for Mobile */
@media (max-width: 900px) {
    .archive-top-section { flex-direction: column; }
    .archive-sidebar { 
        width: 100%; 
        height: auto; 
        position: relative; /* Turns off sticky on mobile */
        padding: 120px 5vw 60px 5vw; 
        border-right: none; 
        border-bottom: 1px solid rgba(0,0,0,0.05); 
    }
    .archive-featured { width: 100%; }
    .gallery-grid-container { grid-template-columns: 1fr; }
    .grid-item { 
        border-right: none; 
        aspect-ratio: auto; 
        min-height: 80vh; 
        padding: 60px 5vw; 
    }
}
/* =========================================
   Artwork Hover Captions
   ========================================= */
.featured-item, .grid-item {
    position: relative; /* This anchors the caption to the bottom-left of the cell */
}

.gallery-caption {
    position: absolute;
    bottom: 40px;
    left: 40px;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    opacity: 0;
    transform: translateX(-15px); /* Starts slightly to the left */
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: none; /* Prevents the text from interfering with the mouse hover */
    z-index: 10;
}

/* Trigger the caption to appear when hovering over the cell */
.featured-item:hover .gallery-caption,
.grid-item:hover .gallery-caption {
    opacity: 1;
    transform: translateX(0); /* Slides into place smoothly */
}
/* =========================================
   Organic Water Wave Cursor
   ========================================= */
a:hover, .artwork:hover, .artwork-trigger:hover, button:hover {
    cursor: none;
}

.ripple-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    /* CHANGED: Anchor the red to the right side (80% 50%) */
    background: radial-gradient(circle at 80% 50%, 
        rgba(235, 100, 80, 0.6) 0%,   
        rgba(240, 180, 100, 0.4) 30%, 
        rgba(140, 170, 100, 0.2) 60%, 
        rgba(200, 190, 180, 0) 100%); 
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 999999;
    mix-blend-mode: multiply;
    transition: opacity 0.3s ease;
}

/* The invisible layers waiting to become water waves */
.ripple-cursor span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
}

/* Applying your colors to the 4 wave layers */
.ripple-cursor.active span:nth-child(1) { border: 1px solid rgba(235, 100, 80, 0.4); animation: organicWave 2s infinite linear; animation-delay: 0s; }
.ripple-cursor.active span:nth-child(2) { border: 0.8px solid rgba(140, 170, 100, 0.4); animation: organicWave 2.2s infinite linear; animation-delay: 0.3s; }
.ripple-cursor.active span:nth-child(3) { border: 0.6px solid rgba(240, 180, 100, 0.4); animation: organicWave 1.9s infinite linear; animation-delay: 0.6s; }
.ripple-cursor.active span:nth-child(4) { border: 1px solid rgba(200, 190, 180, 0.3); animation: organicWave 2.4s infinite linear; animation-delay: 0.9s; }

/* Blob morphing animation for uneven, liquid edges */
@keyframes organicWave {
    0% { 
        width: 24px; height: 24px; opacity: 1;
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; /* Uneven shape */
        transform: translate(-50%, -50%) rotate(0deg);
    }
    50% {
        border-radius: 70% 30% 50% 50% / 30% 40% 60% 70%; /* Morphs into a different uneven shape */
    }
    100% { 
        width: 70px; height: 70px; opacity: 0;
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; /* Returns to original shape */
        transform: translate(-50%, -50%) rotate(360deg); /* Rotation makes it feel like flowing water */
    }
}

/* =========================================
   Page Transition Overlay
   ========================================= */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #FAFAFA; /* Matches your pure/warm white */
    z-index: 999999; /* Above absolutely everything */
    pointer-events: none; /* Allows clicking through when invisible */
    opacity: 0; /* Starts invisible to prevent flash on load */
    transition: opacity 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Removed .hidden class since overlay is now only created during transition */
/* =========================================
   Modal Carousel Arrows
   ========================================= */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 2rem;
    font-family: var(--font-sans);
    font-weight: 300;
    color: var(--text-dark);
    cursor: none; /* Uses your custom ripple cursor */
    z-index: 1001;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    padding: 20px;
}

.carousel-nav:hover {
    color: #95d35f;
}

.prev-btn {
    left: 2vw;
}

.prev-btn:hover {
    transform: translateY(-50%) translateX(-5px); /* Subtle shift left on hover */
}

.next-btn {
    right: 2vw;
}

.next-btn:hover {
    transform: translateY(-50%) translateX(5px); /* Subtle shift right on hover */
}

@media (max-width: 900px) {
    .carousel-nav { top: 35%; /* Adjusts for mobile layout where image is on top */ }
}


/* Hide the default system cursor everywhere */
* {
    cursor: none !important;
}
