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

:root {
    --bg: #f7f7f5;
    --text: #0a0a0a;
    --text-secondary: #888;
    --border: #e8e8e8;
    --gap: 16px;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 24px;
    line-height: 1.5;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-content {
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.back-button {
    font-size: 1.04rem;
    font-weight: 500;
    color: #999999;
    text-decoration: none;
    transition: color 0.3s ease;
}
.back-button:hover { color: var(--text); }

.contact-info a {
    font-size: 1.04rem;
    font-weight: 500;
    color: #999999;
    text-decoration: none;
    transition: color 0.3s ease;
}
.contact-info a:hover { color: var(--text); }

/* ── 하단 블러 페이드 (고정) ── */
body::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: linear-gradient(to bottom, transparent 0%, rgba(247,247,245,0.85) 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 70%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 70%);
    pointer-events: none;
    z-index: 50;
}

/* ── Gallery Section ── */
.gallery-section {
    position: relative;
    padding: 0 36px;
    opacity: 0;
    transition: opacity 0.9s ease;
}

.gallery-section.ready {
    opacity: 1;
}

/* ── Zigzag Grid ── */
.zigzag-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    column-gap: var(--gap);
    height: 160vh;
    align-items: start;
}

.zigzag-col {
    overflow: hidden;
    height: 100%;
    position: relative;
}

/* ── Column Track (무한 스크롤 애니메이션) ── */
.col-track {
    display: flex;
    flex-direction: column;
    will-change: transform;
}

/* 컬럼 호버 시 일시정지 */
.zigzag-col:hover .col-track {
    animation-play-state: paused;
}

/* ── 무한 스크롤 키프레임 ── */
@keyframes scroll-up {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(0, -50%, 0); }
}

@keyframes scroll-down {
    from { transform: translate3d(0, -50%, 0); }
    to   { transform: translate3d(0, 0, 0); }
}

/* ── 이미지 카드 ── */
.masonry-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #e2e2df;
    cursor: pointer;
    flex-shrink: 0;
    margin-bottom: var(--gap);
}

.masonry-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    display: block;
    transition: transform 0.45s ease;
}

.masonry-item:hover img {
    transform: scale(1.04);
}

/* 호버 오버레이 캡션 */
.item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.42) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 18px;
    pointer-events: none;
}

.masonry-item:hover .item-overlay {
    opacity: 1;
}

.item-caption {
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.5;
}

/* ── Lightbox ── */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.open {
    pointer-events: all;
    opacity: 1;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.88);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.94);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox.open .lightbox-content {
    transform: scale(1);
}

.lightbox-img {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    object-fit: contain;
}

/* ── Footer ── */
footer { display: none; }

/* ── Responsive ── */
@media (max-width: 1280px) {
    .zigzag-grid { grid-template-columns: repeat(5, 1fr); }
    .zigzag-col:nth-child(6),
    .zigzag-col:nth-child(7) { display: none; }
}

@media (max-width: 900px) {
    :root { --gap: 10px; }
    .zigzag-grid { grid-template-columns: repeat(4, 1fr); }
    .zigzag-col:nth-child(5),
    .zigzag-col:nth-child(6),
    .zigzag-col:nth-child(7) { display: none; }
    .gallery-section { padding: 0 16px; }
}

@media (max-width: 768px) {
    header { padding: 12px 16px; }
    .header-content { flex-direction: column; align-items: flex-start; gap: 8px; }
    .contact-info { display: none; }
}

@media (max-width: 600px) {
    .zigzag-grid { grid-template-columns: repeat(3, 1fr); }
    .zigzag-col:nth-child(4),
    .zigzag-col:nth-child(5),
    .zigzag-col:nth-child(6),
    .zigzag-col:nth-child(7) { display: none; }
    .gallery-section { padding: 0 12px; }
}

@media (max-width: 400px) {
    .zigzag-grid { grid-template-columns: repeat(2, 1fr); }
    .zigzag-col:nth-child(3),
    .zigzag-col:nth-child(4),
    .zigzag-col:nth-child(5),
    .zigzag-col:nth-child(6),
    .zigzag-col:nth-child(7) { display: none; }
}
