/* ==========================================================================
   CSS Variables & Design System
   ========================================================================== */
:root {
    /* Pure/Elegant Palette (白色系) */
    --pure-bg: #fdfdfd;
    --pure-text: #2c2c2c;
    --pure-accent: #e2e8f0;
    --pure-card-bg: rgba(255, 255, 255, 0.8);
    
    /* Vintage/Warm Palette (棕色系) */
    --vintage-bg: #f9f5f0;
    --vintage-text: #4a3b32;
    --vintage-accent: #d4a373;
    --vintage-card-bg: rgba(249, 245, 240, 0.8);

    /* Common Tokens */
    --hero-bg: #111;
    --hero-text: #ffffff;
    --font-primary: 'Noto Serif SC', serif;
    --font-secondary: 'Cormorant Garamond', serif;
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --border-radius-lg: 16px;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--pure-bg);
    color: var(--pure-text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 400;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--hero-bg);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%; /* Adjust focus slightly above center */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--hero-text);
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding-top: 25vh;
    padding-bottom: 5vh;
}

.hero-subtitle {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    text-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.hero-title .ampersand {
    font-family: var(--font-secondary);
    font-style: italic;
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

.hero-date {
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.scroll-indicator:hover {
    opacity: 1;
}

.scroll-indicator span {
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.scroll-indicator .line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
}

/* ==========================================================================
   Gallery Sections
   ========================================================================== */
.gallery-section {
    padding: 120px 5%;
    min-height: 100vh;
}

.theme-pure {
    background-color: var(--pure-bg);
    color: var(--pure-text);
}

.theme-vintage {
    background-color: var(--vintage-bg);
    color: var(--vintage-text);
}

.gallery-header {
    text-align: center;
    margin-bottom: 80px;
}

.gallery-title {
    font-family: var(--font-secondary);
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.gallery-desc {
    font-size: 1.1rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    opacity: 0.7;
}

.gallery-divider {
    width: 60px;
    height: 2px;
    background-color: currentColor;
    margin: 30px auto 0;
    opacity: 0.3;
}

/* CSS Grid / Masonry for Gallery */
.gallery-grid {
    column-count: 1; /* Mobile default */
    column-gap: 30px;
    padding: 0 20px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .gallery-grid {
        column-count: 2;
    }
}

@media (min-width: 1200px) {
    .gallery-grid {
        column-count: 3;
    }
}

.gallery-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    background-color: #ffffff;
    padding: 15px 15px 25px 15px; /* Polaroid frame */
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 30px;
    display: inline-block;
    width: 100%;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    
    /* Hardware Acceleration Fixes for Multi-column Rendering Bugs (Disappearing/Flickering) */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.theme-vintage .gallery-item {
    background-color: #fdfaf5; /* Slightly warmer white for vintage */
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.15);
}

.gallery-img-wrapper {
    overflow: hidden;
    width: 100%;
}

.gallery-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.05);
}

.gallery-caption {
    padding-top: 15px;
    text-align: center;
}

.caption-text {
    font-family: var(--font-secondary);
    font-size: 1.2rem;
    color: #555;
    font-style: italic;
    letter-spacing: 0.05em;
}

/* Hidden state for GSAP */
.gs-reveal, .gs-reveal-scroll {
    visibility: hidden;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    .hero-title .ampersand {
        font-size: 2rem;
    }
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .gallery-section {
        padding: 80px 5%;
    }
    
    .gallery-title {
        font-size: 2.5rem;
    }

    .gallery-grid {
        column-count: 1;
    }
}
