@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #09090b;
    font-family: 'Outfit', sans-serif;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Header --- */
.project-header {
    text-align: center;
    padding: 60px 5% 30px;
    position: relative;
    animation: headerFadeIn 0.8s ease forwards;
}

@keyframes headerFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.project-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #22c55e, transparent);
    border-radius: 1px;
}

.project-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: #22c55e;
    margin-bottom: 12px;
    padding: 6px 16px;
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 20px;
    background: rgba(34, 197, 94, 0.06);
    backdrop-filter: blur(4px);
}

.project-name {
    font-family: 'Outfit', sans-serif;
    font-size: 2.8rem;
    font-weight: 600;
    line-height: 1.15;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.project-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
    margin-top: 8px;
    letter-spacing: 0.3px;
}

/* --- Photo Gallery Spread --- */
.gallery-section {
    margin-top: 80px;
    position: relative;
}

.gallery-section:first-of-type {
    margin-top: 100px;
}

/* Divider between sections */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 30px 5%;
    position: relative;
    z-index: 1;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    max-width: 120px;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.15), transparent);
}

.section-divider span {
    font-size: 0.65rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.2);
}

/* Grid pattern background */
.grid-bg {
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 300px;
    z-index: 0;
    opacity: 0.12;
    background-image:
        linear-gradient(rgba(168, 162, 158, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 162, 158, 0.3) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, #000 70%, transparent 110%);
    mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, #000 70%, transparent 110%);
}

.gallery-subtitle {
    font-size: 0.7rem;
    text-align: center;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.gallery-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    text-align: center;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #ffffff, #a0a0a0, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.gallery-title span {
    -webkit-text-fill-color: #22c55e;
    color: #22c55e;
    display: inline-block;
}

/* Photo spread container */
.spread-container {
    position: relative;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.spread-stack {
    position: relative;
    width: 300px;
    height: 420px;
}

/* Green glow behind spread */
.spread-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1000px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(34, 197, 94, 0.12) 0%, rgba(34, 197, 94, 0.04) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Each photo card */
.photo-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 300px;
    height: 420px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    cursor: grab;
    opacity: 0;
    animation: photoAppear 0.6s ease forwards, photoSpread 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    will-change: transform;
    image-orientation: from-image;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.photo-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(34, 197, 94, 0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.photo-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    z-index: 1;
}

.photo-card:active {
    cursor: grabbing;
}

.photo-card:hover {
    transform: translate(var(--target-x), var(--target-y)) scale(1.06) !important;
    box-shadow: 0 12px 40px rgba(34, 197, 94, 0.2), 0 0 0 1px rgba(34, 197, 94, 0.15);
    z-index: 9999 !important;
    border-color: rgba(34, 197, 94, 0.2);
}

.photo-card:hover img {
    filter: brightness(1.08);
}

.photo-card:hover::after {
    opacity: 1;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    image-orientation: from-image;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    transition: filter 0.3s ease;
}

/* Per-photo animation delays and positions */
.photo-card:nth-child(1) {
    --target-x: -850px;
    --target-y: 0px;
    z-index: 60;
    animation-delay: 0.1s, 0.4s;
}

.photo-card:nth-child(2) {
    --target-x: -510px;
    --target-y: 0px;
    z-index: 50;
    animation-delay: 0.2s, 0.5s;
}

.photo-card:nth-child(3) {
    --target-x: -170px;
    --target-y: 0px;
    z-index: 40;
    animation-delay: 0.3s, 0.6s;
}

.photo-card:nth-child(4) {
    --target-x: 170px;
    --target-y: 0px;
    z-index: 30;
    animation-delay: 0.4s, 0.7s;
}

.photo-card:nth-child(5) {
    --target-x: 510px;
    --target-y: 0px;
    z-index: 20;
    animation-delay: 0.5s, 0.8s;
}

.photo-card:nth-child(6) {
    --target-x: 850px;
    --target-y: 0px;
    z-index: 10;
    animation-delay: 0.6s, 0.9s;
}

@keyframes photoAppear {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes photoSpread {
    from {
        transform: translate(0px, 0px) scale(1);
    }
    to {
        transform: translate(var(--target-x), var(--target-y)) scale(1);
    }
}

/* --- Scroll Animation --- */
.gallery-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.gallery-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- View Button --- */
.btn-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    position: relative;
    z-index: 1;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.2);
}

.view-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 30px rgba(34, 197, 94, 0.35);
}

.view-btn:active {
    transform: translateY(0) scale(0.97);
}

/* --- Back Button --- */
.back-btn-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    padding-bottom: 60px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 25px;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    transition: all 0.3s ease;
}

.back-btn:hover {
    color: #ffffff;
    border-color: rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.06);
    gap: 12px;
    transform: translateY(-1px);
}

/* --- Modal / Lightbox --- */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox.active {
    display: flex;
}

.lightbox-media {
    position: relative;
    width: 92%;
    max-width: 1000px;
    max-height: 78vh;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lightbox-media img {
    width: 100%;
    height: 100%;
    max-height: 78vh;
    object-fit: contain;
    display: block;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.lightbox-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 20px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.lightbox-caption h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.lightbox-caption p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    transform: translateY(-50%) scale(1.08);
}

.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }

/* --- Lightbox Counter --- */
.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    padding: 6px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 10;
}

/* --- Loading Spinner --- */
.lightbox-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #22c55e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 5;
    display: none;
}

.lightbox-spinner.active {
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.lightbox-media img.loading {
    opacity: 0;
}

.lightbox-media img.loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* --- Thumbnail Dock --- */
.lightbox-dock {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dock-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    flex-shrink: 0;
    opacity: 0.5;
}

.dock-thumb.active {
    border-color: #22c55e;
    transform: scale(1.12);
    opacity: 1;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

.dock-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dock-thumb:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.15);
    opacity: 0.8;
}

/* --- Responsive --- */
/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 40px 5% 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: 40px;
    background: linear-gradient(to top, rgba(34, 197, 94, 0.02), transparent);
}

.site-footer p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 6px;
    letter-spacing: 0.5px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #22c55e;
}

.instagram-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #f77737);
    color: #fff;
    border-radius: 30px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(131, 58, 180, 0.2);
}

.instagram-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(131, 58, 180, 0.35);
}

/* --- Back to Top --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 100;
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.15);
}

/* --- Centered positions for 5 cards --- */
.spread-stack[data-count="5"] .photo-card:nth-child(1) { --target-x: -680px; }
.spread-stack[data-count="5"] .photo-card:nth-child(2) { --target-x: -340px; }
.spread-stack[data-count="5"] .photo-card:nth-child(3) { --target-x: 0px; }
.spread-stack[data-count="5"] .photo-card:nth-child(4) { --target-x: 340px; }
.spread-stack[data-count="5"] .photo-card:nth-child(5) { --target-x: 680px; }

/* --- Centered positions for 4 cards --- */
.spread-stack[data-count="4"] .photo-card:nth-child(1) { --target-x: -510px; }
.spread-stack[data-count="4"] .photo-card:nth-child(2) { --target-x: -170px; }
.spread-stack[data-count="4"] .photo-card:nth-child(3) { --target-x: 170px; }
.spread-stack[data-count="4"] .photo-card:nth-child(4) { --target-x: 510px; }

@media (max-width: 600px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
}

@media (max-width: 1100px) {
    .photo-card:nth-child(1) { --target-x: -600px; --target-y: 0px; }
    .photo-card:nth-child(2) { --target-x: -360px; --target-y: 0px; }
    .photo-card:nth-child(3) { --target-x: -120px; --target-y: 0px; }
    .photo-card:nth-child(4) { --target-x: 120px; --target-y: 0px; }
    .photo-card:nth-child(5) { --target-x: 360px; --target-y: 0px; }
    .photo-card:nth-child(6) { --target-x: 600px; --target-y: 0px; }

    .spread-stack[data-count="5"] .photo-card:nth-child(1) { --target-x: -480px; }
    .spread-stack[data-count="5"] .photo-card:nth-child(2) { --target-x: -240px; }
    .spread-stack[data-count="5"] .photo-card:nth-child(3) { --target-x: 0px; }
    .spread-stack[data-count="5"] .photo-card:nth-child(4) { --target-x: 240px; }
    .spread-stack[data-count="5"] .photo-card:nth-child(5) { --target-x: 480px; }

    .spread-stack[data-count="4"] .photo-card:nth-child(1) { --target-x: -360px; }
    .spread-stack[data-count="4"] .photo-card:nth-child(2) { --target-x: -120px; }
    .spread-stack[data-count="4"] .photo-card:nth-child(3) { --target-x: 120px; }
    .spread-stack[data-count="4"] .photo-card:nth-child(4) { --target-x: 360px; }

    .photo-card, .spread-stack { width: 180px; height: 260px; }
    .spread-container { height: 340px; }
    .gallery-title { font-size: 2rem; }
}

@media (max-width: 768px) {
    .photo-card:nth-child(1) { --target-x: -400px; --target-y: 0px; }
    .photo-card:nth-child(2) { --target-x: -240px; --target-y: 0px; }
    .photo-card:nth-child(3) { --target-x: -80px; --target-y: 0px; }
    .photo-card:nth-child(4) { --target-x: 80px; --target-y: 0px; }
    .photo-card:nth-child(5) { --target-x: 240px; --target-y: 0px; }
    .photo-card:nth-child(6) { --target-x: 400px; --target-y: 0px; }

    .spread-stack[data-count="5"] .photo-card:nth-child(1) { --target-x: -320px; }
    .spread-stack[data-count="5"] .photo-card:nth-child(2) { --target-x: -160px; }
    .spread-stack[data-count="5"] .photo-card:nth-child(3) { --target-x: 0px; }
    .spread-stack[data-count="5"] .photo-card:nth-child(4) { --target-x: 160px; }
    .spread-stack[data-count="5"] .photo-card:nth-child(5) { --target-x: 320px; }

    .spread-stack[data-count="4"] .photo-card:nth-child(1) { --target-x: -240px; }
    .spread-stack[data-count="4"] .photo-card:nth-child(2) { --target-x: -80px; }
    .spread-stack[data-count="4"] .photo-card:nth-child(3) { --target-x: 80px; }
    .spread-stack[data-count="4"] .photo-card:nth-child(4) { --target-x: 240px; }

    .photo-card, .spread-stack { width: 120px; height: 185px; }
    .spread-container { height: 270px; }
    .gallery-title { font-size: 1.6rem; }
}

@media (max-width: 600px) {
    .project-header { padding: 40px 4% 20px; }
    .project-name { font-size: 1.8rem; }
    .project-tag { font-size: 0.6rem; padding: 4px 10px; letter-spacing: 2px; }
    .project-desc { font-size: 0.8rem; }
    .gallery-section { margin-top: 60px; }
    .gallery-title { font-size: 1.5rem; }
    .gallery-subtitle { font-size: 0.65rem; }
    .section-divider { padding: 20px 4%; }
    .section-divider span { font-size: 0.55rem; letter-spacing: 3px; }

    /* Stack vertically on small screens */
    .spread-container { height: auto; padding: 40px 0; }
    .spread-stack { width: 320px; height: auto; position: static; display: flex; flex-direction: column; align-items: center; gap: 20px; }

    .photo-card {
        position: static !important;
        width: 220px !important;
        height: 310px !important;
        opacity: 1;
        animation: photoAppear 0.5s ease forwards;
        --target-x: 0px !important;
        --target-y: 0px !important;
    }

    .photo-card:nth-child(1) { animation-delay: 0.08s, 0s; }
    .photo-card:nth-child(2) { animation-delay: 0.16s, 0s; }
    .photo-card:nth-child(3) { animation-delay: 0.24s, 0s; }
    .photo-card:nth-child(4) { animation-delay: 0.32s, 0s; }
    .photo-card:nth-child(5) { animation-delay: 0.40s, 0s; }
    .photo-card:nth-child(6) { animation-delay: 0.48s, 0s; }

    .view-btn { padding: 12px 24px; font-size: 0.8rem; }
    .lightbox-nav { width: 36px; height: 36px; font-size: 1.2rem; }
    .lightbox-nav.prev { left: 8px; }
    .lightbox-nav.next { right: 8px; }
    .lightbox-dock { gap: 6px; padding: 8px 12px; }
    .dock-thumb { width: 40px; height: 40px; }
}

@media (max-width: 480px) {
    .spread-stack { gap: 14px; }
    .photo-card { width: 160px !important; height: 230px !important; }
}
