@font-face {
    font-family: 'Glow Better';
    src: url('fonts/GlowBetterSerif-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0a;
    --text: #f8f8f8;
    --text-dim: #d0d0d0;
    --accent: #d9b38c;
    --shadow: 0 16px 48px rgba(0,0,0,0.75);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ── Header / Nav ─────────────────────────────────────── */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(10,10,10,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav {
    display: flex;
    gap: 2.8rem;
}

.nav a {
    color: var(--text);
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    position: relative;
    transition: color 0.4s ease;
}

.nav a:hover {
    color: var(--accent);
}

.nav a.active {
    color: var(--accent);
    pointer-events: none;
}

.nav a.active::after,
.nav a:hover::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transition: width 0.4s ease;
}

main {
    padding-top: 80px;
}

/* ── Photography category tiles ──────────────────────────────── */
.categories {
    min-height: calc(100vh - 80px);
    padding: 4vw 3.5vw 7vw;
    display: flex;
    justify-content: center;
}

.tile-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    gap: 1.8rem;
    width: 100%;
    max-width: 1380px;
}

.tile {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #111;
    box-shadow: var(--shadow);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.tile:hover {
    transform: scale(1.04);
    box-shadow: 0 40px 100px rgba(0,0,0,0.9);
}

.tile-top {
    aspect-ratio: 4 / 3.2;
}

.tile-bottom {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9.2;
    max-width: 980px;
    margin: 0 auto;
    width: 100%;
}

.tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease;
}

.tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.tile-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text);
    z-index: 2;
    padding: 6%;
    transition: color 0.5s ease;
}

.tile h2 {
    font-family: 'Glow Better', 'Playfair Display', serif;
    font-weight: normal;
    font-size: clamp(1.8rem, 4.2vw, 3.6rem);
    margin-bottom: 0.35em;
    letter-spacing: 0.03em;
    line-height: 0.98;
    text-shadow: 0 4px 20px rgba(0,0,0,0.85);
}

.tile .meta {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    letter-spacing: 0.08em;
    opacity: 0;
    transform: translateY(26px);
    transition: all 0.52s ease-out 0.14s;
    color: #000;
}

.tile:hover::before       { opacity: 1; }
.tile:hover img           { opacity: 0; }
.tile:hover .tile-overlay { color: #000; }
.tile:hover .meta         { opacity: 1; transform: translateY(0); }

/* Bottom tile title – controlled size */
.tile-bottom h2 {
    font-size: clamp(2.8rem, 6.5vw, 5.2rem);
}

/* ── Gallery & Videography ────────────────────────────────────── */
.gallery-view {
    padding: 5vw 3.5vw 9vw;
    max-width: 1380px;
    margin: 0 auto;
}

.gallery-view h1 {
    font-family: 'Glow Better', 'Playfair Display', serif;
    font-weight: normal;
    font-size: clamp(4.2rem, 10vw, 8.5rem);
    text-align: center;
    margin: 0.7em 0 1.2em;
    letter-spacing: -0.01em;
    text-shadow: 0 8px 40px rgba(0,0,0,0.9);
}

.gallery-masonry,
.video-masonry {
    column-count: 4;
    column-gap: 1.6rem;
}

.gallery-masonry img,
.video-card {
    width: 100%;
    margin-bottom: 1.6rem;
    break-inside: avoid;
    display: block;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s ease, transform 0.9s ease;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.gallery-masonry img.loaded,
.video-card.appear {
    opacity: 1;
    transform: translateY(0);
}

.video-card video {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.45s ease, filter 0.45s ease;
}

.video-card:hover video {
    transform: scale(1.04);
    filter: brightness(1.1);
}

.video-card p {
    margin-top: 0.9rem;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    opacity: 0.88;
}

/* Back button – pill style matching homepage CTA */
.back-btn {
    position: fixed;
    bottom: 3.2rem;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: 2px solid var(--text);
    color: var(--text);
    padding: 0.9rem 2.4rem;
    border-radius: 999px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 1.08rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.45s ease;
    backdrop-filter: blur(8px);
    z-index: 60;
}

.back-btn:hover {
    background: var(--text);
    color: var(--bg);
    transform: translateX(-50%) translateY(-8px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .tile-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 2.6rem;
    }

    .tile-top,
    .tile-bottom {
        aspect-ratio: 3 / 2;
        max-width: none;
    }

    .gallery-masonry,
    .video-masonry {
        column-count: 3;
    }
}

@media (max-width: 720px) {
    .nav {
        gap: 2rem;
        font-size: 0.96rem;
    }

    .gallery-masonry,
    .video-masonry {
        column-count: 2;
    }

    .back-btn {
        bottom: 2.6rem;
        padding: 0.85rem 2.1rem;
        font-size: 1.02rem;
    }
}

@media (max-width: 480px) {
    .gallery-masonry,
    .video-masonry {
        column-count: 1;
    }

    .back-btn {
        bottom: 2.2rem;
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
}