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

:root {
    --bg: #F9F9F7;
    --fg: #1A1A1A;
    --card: #FFFFFF;
    --muted: #F0F0EE;
    --muted-fg: #666666;
    --border: #E2E2E0;
    --primary: #1A1A1A;
    --primary-fg: #F9F9F7;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(249, 249, 247, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 226, 224, 0.4);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .header {
        padding: 0 32px;
    }
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

@media (min-width: 768px) {
    .logo {
        font-size: 1.5rem;
    }
}

.logo-sub {
    display: none;
}

@media (min-width: 640px) {
    .logo-sub {
        display: inline;
    }
}

/* Toggle Group */
.toggle-group {
    display: inline-flex;
    background: var(--muted);
    padding: 4px;
    border-radius: 9999px;
    gap: 4px;
}

.toggle-btn {
    padding: 8px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease-out;
    color: var(--muted-fg);
    cursor: pointer;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (min-width: 768px) {
    .toggle-btn {
        padding: 8px 16px;
    }
}

.toggle-btn.active {
    background: white;
    color: var(--fg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-btn:hover:not(.active) {
    color: rgba(26, 26, 26, 0.7);
}

.toggle-text {
    display: none;
}

@media (min-width: 640px) {
    .toggle-text {
        display: inline;
    }
}

/* Main Content */
.main-content {
    padding: 16px;
}

@media (min-width: 768px) {
    .main-content {
        padding: 32px;
    }
}

@media (min-width: 1024px) {
    .main-content {
        padding: 48px;
    }
}

/* Section Header */
.section-header {
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .section-header {
        margin-bottom: 32px;
    }
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 500;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 2.5rem;
    }
}

.section-subtitle {
    color: var(--muted-fg);
    margin-top: 8px;
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--muted);
    color: var(--fg);
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    margin-bottom: 16px;
    transition: all 0.2s ease-out;
}

.back-btn:hover {
    background: var(--border);
}

/* Timeline View */
.timeline-section {
    position: relative;
    padding-left: 40px;
    margin-bottom: 48px;
}

@media (min-width: 768px) {
    .timeline-section {
        padding-left: 0;
        margin-bottom: 64px;
    }
}

.timeline-line {
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

@media (min-width: 768px) {
    .timeline-line {
        display: none;
    }
}

.year-marker {
    position: relative;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .year-marker {
        text-align: center;
        margin-bottom: 32px;
    }
}

.year-marker::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 50%;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    transform: translateY(-50%);
}

@media (min-width: 768px) {
    .year-marker::before {
        display: none;
    }
}

.year-label {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: var(--primary);
    color: var(--primary-fg);
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 500;
    border-radius: 4px;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

@media (min-width: 640px) {
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (min-width: 1024px) {
    .photo-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

/* Photo Card */
.photo-card {
    position: relative;
    overflow: hidden;
    background: var(--card);
    border: 1px solid rgba(226, 226, 224, 0.4);
    border-radius: 4px;
    cursor: zoom-in;
    aspect-ratio: 1 / 1;
    transition: all 0.3s ease-out;
    opacity: 0;
    animation: fadeIn 0.4s ease-out forwards;
}

.photo-card:hover {
    border-color: var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease-out;
}

.photo-card:hover img {
    transform: scale(1.05);
}

.photo-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--muted) 25%, var(--border) 50%, var(--muted) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Folder Grid */
.folder-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 640px) {
    .folder-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
}

@media (min-width: 1024px) {
    .folder-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Folder Card */
.folder-card {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: var(--card);
    border: 1px solid rgba(226, 226, 224, 0.4);
    cursor: pointer;
    transition: all 0.3s ease-out;
    opacity: 0;
    animation: fadeIn 0.4s ease-out forwards;
}

.folder-card:hover {
    border-color: var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

.folder-card-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.folder-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease-out;
}

.folder-card:hover img {
    transform: scale(1.05);
}

.folder-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

.folder-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    color: white;
}

.folder-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 4px;
}

@media (min-width: 768px) {
    .folder-card-title {
        font-size: 1.25rem;
    }
}

.folder-card-count {
    font-size: 0.875rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(249, 249, 247, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease-out;
    z-index: 10;
}

@media (min-width: 768px) {
    .lightbox-close {
        top: 24px;
        right: 24px;
        width: 48px;
        height: 48px;
    }
}

.lightbox-close:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease-out;
    z-index: 10;
}

@media (min-width: 768px) {
    .lightbox-nav {
        width: 48px;
        height: 48px;
    }
}

.lightbox-nav:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.lightbox-nav.prev {
    left: 8px;
}

@media (min-width: 768px) {
    .lightbox-nav.prev {
        left: 16px;
    }
}

.lightbox-nav.next {
    right: 8px;
}

@media (min-width: 768px) {
    .lightbox-nav.next {
        right: 16px;
    }
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px;
    max-width: 100%;
}

@media (min-width: 768px) {
    .lightbox-content {
        gap: 24px;
    }
}

.lightbox-image {
    max-width: 90vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@media (min-width: 768px) {
    .lightbox-image {
        max-height: 75vh;
    }
}

.lightbox-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

@media (min-width: 640px) {
    .lightbox-info {
        flex-direction: row;
        gap: 16px;
    }
}

.lightbox-caption {
    font-size: 0.875rem;
    color: var(--muted-fg);
    text-align: center;
}

@media (min-width: 768px) {
    .lightbox-caption {
        font-size: 1rem;
    }
}

.lightbox-counter {
    font-size: 0.875rem;
    color: var(--muted-fg);
}

/* Download Button */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: var(--primary-fg);
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease-out;
}

.download-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Staggered animation delays */
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.3s; }
.delay-7 { animation-delay: 0.35s; }
.delay-8 { animation-delay: 0.4s; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--muted);
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 102, 102, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 102, 102, 0.5);
}
