/* ============================================
   MAHL Photography Portfolio
   Modern, immersive, photo-first design
   ============================================ */

:root {
    --bg: #0a0a0a;
    --bg-subtle: #111;
    --surface: #1a1a1a;
    --border: rgba(255,255,255,0.08);
    --text: #f0f0f0;
    --text-muted: #888;
    --text-dim: #555;
    --accent: #c8a87c;
    --accent-light: #dfc5a0;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

/* ============ ADMIN LOCK ============ */

.admin-lock {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    color: rgba(255,255,255,0.15);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.3s, background 0.3s;
    text-decoration: none;
}

.admin-lock:hover {
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.05);
}

/* ============ HERO ============ */

.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.05);
    transition: transform 8s ease-out;
}

.hero-slide {
    opacity: 0;
    transition: opacity 1.5s ease, transform 8s ease-out;
}

.hero-slide.active {
    opacity: 1;
}

.hero-image.hero-gradient {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.hero.in-view .hero-image {
    transform: scale(1);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.3) 0%,
        rgba(0,0,0,0.1) 40%,
        rgba(0,0,0,0.4) 70%,
        rgba(10,10,10,1) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    animation: heroReveal 1.2s var(--ease-out) 0.3s forwards;
}

@keyframes heroReveal {
    to { opacity: 1; transform: translateY(0); }
}

.hero-title {
    font-family: var(--font-sans);
    font-weight: 200;
    font-size: clamp(3rem, 10vw, 7rem);
    letter-spacing: 0.3em;
    line-height: 1;
    margin-bottom: 0.2em;
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--accent);
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
}

.hero-divider {
    width: 60px;
    height: 1px;
    background: var(--accent);
    margin: 0 auto 1.5rem;
    opacity: 0;
    animation: dividerReveal 1s var(--ease) 1s forwards;
}

@keyframes dividerReveal {
    to { opacity: 1; width: 80px; }
}

.hero-tagline {
    font-weight: 300;
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0;
    animation: heroReveal 1s var(--ease) 1.5s forwards;
    transition: color 0.3s;
}

.hero-scroll:hover { color: var(--accent); }

.hero-scroll svg {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ============ FILTER BAR ============ */

.filter-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10,10,10,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s;
}

.filter-bar.scrolled {
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.filter-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-inner::-webkit-scrollbar { display: none; }

.filter-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 18px 16px;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: color 0.3s;
}

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s var(--ease);
}

.filter-btn:hover { color: var(--text); }

.filter-btn.active {
    color: var(--text);
    font-weight: 500;
}

.filter-btn.active::after {
    transform: scaleX(1);
}

.filter-count {
    display: inline-block;
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-left: 4px;
    font-weight: 400;
}

/* ============ GALLERY GRID ============ */

.gallery-section {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    min-height: 50vh;
}

.gallery-grid {
    columns: 4;
    column-gap: 12px;
}

.gallery-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 12px;
    break-inside: avoid;
    cursor: pointer;
    list-style: none;
}

.gallery-item.hidden {
    display: none;
}

.gallery-item-inner {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: var(--surface);
}

/* Blur-up loading effect */
.gallery-item-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--surface), #222);
    z-index: 1;
    transition: opacity 0.6s var(--ease);
}

.gallery-item-inner.loaded::before {
    opacity: 0;
    pointer-events: none;
}

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

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

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.7) 0%,
        rgba(0,0,0,0) 50%
    );
    opacity: 0;
    transition: opacity 0.4s var(--ease);
}

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

.gallery-item-info h3 {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 400;
    margin-bottom: 4px;
    transform: translateY(8px);
    transition: transform 0.4s var(--ease);
}

.gallery-item:hover .gallery-item-info h3 {
    transform: translateY(0);
}

.gallery-item-cat {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    transform: translateY(8px);
    opacity: 0;
    transition: all 0.4s var(--ease) 0.05s;
    display: inline-block;
}

.gallery-item:hover .gallery-item-cat {
    transform: translateY(0);
    opacity: 1;
}

.featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: var(--accent);
    color: #000;
    padding: 4px 10px;
    border-radius: 2px;
    font-weight: 600;
}

/* Scroll reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for initial load */
.gallery-item:nth-child(1) { transition-delay: 0s; }
.gallery-item:nth-child(2) { transition-delay: 0.05s; }
.gallery-item:nth-child(3) { transition-delay: 0.1s; }
.gallery-item:nth-child(4) { transition-delay: 0.15s; }
.gallery-item:nth-child(5) { transition-delay: 0.2s; }
.gallery-item:nth-child(6) { transition-delay: 0.25s; }
.gallery-item:nth-child(7) { transition-delay: 0.3s; }
.gallery-item:nth-child(8) { transition-delay: 0.35s; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 120px 20px;
    color: var(--text-dim);
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.1em;
}

/* ============ LIGHTBOX ============ */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease), visibility 0.4s;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.95);
}

.lightbox-content {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.lightbox.active .lightbox-content img {
    opacity: 1;
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.15);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-50%) scale(1.1);
}

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

.lightbox-info {
    position: absolute;
    bottom: 24px;
    left: 24px;
    z-index: 10;
    max-width: 500px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s var(--ease) 0.2s;
}

.lightbox.active .lightbox-info {
    opacity: 1;
    transform: translateY(0);
}

.lightbox-info h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 4px;
}

.lightbox-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.lightbox-counter {
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    margin-top: 8px;
    display: inline-block;
}

/* ============ FOOTER ============ */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 40px 24px;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 1200px) {
    .gallery-grid { columns: 3; }
}

@media (max-width: 768px) {
    .gallery-grid { columns: 2; column-gap: 8px; }
    .gallery-item { margin-bottom: 8px; }
    .gallery-section { padding: 24px 12px 60px; }

    .lightbox-nav { width: 40px; height: 40px; }
    .lightbox-prev { left: 12px; }
    .lightbox-next { right: 12px; }
    .lightbox-info { left: 16px; right: 16px; bottom: 16px; }
}

@media (max-width: 480px) {
    .gallery-grid { columns: 1; column-gap: 0; }
    .gallery-item { margin-bottom: 16px; }
    .gallery-item-inner { border-radius: 6px; }

    .hero-title { letter-spacing: 0.2em; }

    .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}

/* ============ CUSTOM SCROLLBAR ============ */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* Selection color */
::selection { background: var(--accent); color: #000; }
