/* ============================================
   JOHN MOORE DESIGN - UNIFIED DESIGN SYSTEM
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* Root Variables */
:root {
    --primary: #1b1a18;
    --secondary: #2a2724;
    --accent: #d9b978;
    --accent-strong: #b58a3d;
    --text: #26231f;
    --text-muted: #7e756c;
    --bg-neutral: #f7f2ec;
    --navy: #2a2622;
    --gold: #d9b978;
    --shadow: 0 18px 48px rgba(28, 24, 20, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-display: 'Space Grotesk', 'Helvetica Neue', sans-serif;
    --font-serif: 'Instrument Serif', 'Times New Roman', serif;
}

/* Dark Mode Variables */
.dark-mode {
    --primary: #f2ede6;
    --secondary: #d8d1c8;
    --accent: #d5b35a;
    --accent-strong: #e1b858;
    --text: #f4f2ee;
    --text-muted: #b7b0a7;
    --bg-neutral: #141312;
    --navy: #f2ede6;
    --gold: #d5b35a;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

/* Dark mode transition for smooth theme switching */
body,
.navbar,
.hero-section,
.gallery-card,
.modal-content,
footer {
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-display);
    background-color: var(--bg-neutral);
    color: var(--text);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    letter-spacing: -0.01em;
}

/* ============================================
   ACCESSIBILITY - Skip Navigation
   ============================================ */

/* ============================================
   ACCESSIBILITY - Skip Navigation (WCAG 2.2 Enhanced)
   ============================================ */

.skip-links {
    position: absolute;
    top: -100px;
    left: 0;
    width: 100%;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.skip-navigation {
    position: relative;
    top: 0;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 12px 20px;
    text-decoration: none;
    font-weight: 600;
    transition: top 0.3s ease;
    display: block;
    width: fit-content;
}

.skip-links:focus-within {
    top: 0;
}

.skip-navigation:hover {
    background: var(--accent-strong);
    transform: translateX(4px);
}

.skip-navigation:focus {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Visually hidden class for screen readers only */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Ensure visually-hidden content is visible when focused */
.visually-hidden:focus {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ============================================
   WCAG 2.2 FOCUS STYLES
   Enhanced focus indicators for accessibility
   ============================================ */

/* Global focus styles for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    box-shadow: 0 0 0 2px var(--bg-neutral), 0 0 0 5px var(--accent);
}

/* Remove default outline for mouse users while keeping keyboard focus */
:focus:not(:focus-visible) {
    outline: none;
}

/* Enhanced focus for interactive elements */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--bg-neutral), 0 0 0 5px var(--accent);
}

/* Gallery cards focus enhancement */
.gallery-card:focus-visible {
    outline: 4px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px var(--bg-neutral), 0 0 0 7px var(--accent), 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Modal and dialog focus */
.modal-content:focus-visible,
[role="dialog"]:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    box-shadow: 0 0 0 2px var(--bg-neutral), 0 0 0 5px var(--accent);
}

/* Filter buttons focus */
.category-btn:focus-visible,
.gallery-filter-toggle:focus-visible,
.btn-clear:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--bg-neutral), 0 0 0 5px var(--accent);
}

/* Dark mode focus enhancements */
.dark-mode :focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    box-shadow: 0 0 0 2px var(--bg-neutral), 0 0 0 5px var(--accent);
}

.dark-mode button:focus-visible,
.dark-mode a:focus-visible,
.dark-mode input:focus-visible,
.dark-mode textarea:focus-visible,
.dark-mode select:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #1a1a1a, 0 0 0 5px var(--accent);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :focus-visible {
        outline: 4px solid currentColor;
        outline-offset: 2px;
        box-shadow: none;
    }

    .gallery-card:focus-visible {
        outline: 5px solid currentColor;
        outline-offset: 2px;
        box-shadow: none;
    }
}

/* Reduced motion for focus transitions */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   BACKGROUND & ANIMATIONS
   ============================================ */

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(circle at 18% 18%, rgba(218, 199, 168, 0.12), transparent 55%),
        radial-gradient(circle at 85% 12%, rgba(217, 185, 120, 0.10), transparent 45%),
        linear-gradient(160deg, #f7f2ec 0%, #f1ebe4 50%, #ece4db 100%);
    transition: background 1.2s ease-out;
}

/* Subtle background shift when hero is dismissed */
body.hero-closed .background-container {
    background:
        radial-gradient(circle at 18% 18%, rgba(218, 199, 168, 0.08), transparent 55%),
        radial-gradient(circle at 85% 12%, rgba(217, 185, 120, 0.06), transparent 45%),
        linear-gradient(160deg, #f5f0e9 0%, #f0e9e1 50%, #ebe2d9 100%);
}

/* Dark mode variant for hero-closed state */
body.dark-mode.hero-closed .background-container {
    background:
        radial-gradient(circle at 18% 18%, rgba(218, 199, 168, 0.08), transparent 55%),
        radial-gradient(circle at 85% 12%, rgba(217, 185, 120, 0.06), transparent 45%),
        linear-gradient(160deg, #1a1918 0%, #161514 50%, #121110 100%);
}

#sparkle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* ============================================
   NAVIGATION
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3300; /* Keep nav + mobile menu above overlay panels */
    background: rgba(247, 242, 236, 0.7);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    backdrop-filter: blur(22px) saturate(160%);
    box-shadow: 0 12px 30px rgba(49, 44, 38, 0.08);
    border-bottom: 1px solid rgba(64, 58, 52, 0.08);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    line-height: 0;
}

.logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    height: 34px;
    width: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-end;
}

/* Hamburger Menu Button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 3200;
    position: relative;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background: var(--navy);
    border-radius: 3px;
    position: absolute;
    left: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

/* Position the 3 lines */
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 10.5px; }
.hamburger span:nth-child(3) { bottom: 0; }

/* Active state - refined classic X */
.hamburger.active span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* Dark Mode Toggle Button - Sun/Moon Morph */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--bg-neutral);
    border: 2px solid var(--navy);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.dark-mode-toggle::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--navy);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow:
        0 0 0 3px transparent,
        0 0 0 6px transparent;
}

.dark-mode-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dark-mode-toggle:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Dark mode - morph to moon */
.dark-mode .dark-mode-toggle {
    background: var(--text);
    border-color: var(--text);
}

.dark-mode .dark-mode-toggle::before {
    background: var(--bg-neutral);
    box-shadow:
        0 0 0 3px var(--text),
        inset -3px -3px 0 0 var(--navy);
    transform: translateX(2px);
}

/* Hide the old emoji icons */
.dark-mode-toggle .dark-mode-icon-sun,
.dark-mode-toggle .dark-mode-icon-moon {
    display: none;
}

/* Match reference: only show key pills on desktop */
.nav-link-secondary {
    display: none;
}

.nav-links a {
    text-decoration: none;
    color: rgba(42, 38, 34, 0.95);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    position: relative;
    transition: var(--transition);
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(64, 58, 52, 0.18);
    box-shadow: 0 6px 16px rgba(35, 30, 25, 0.08);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: var(--transition);
    display: none;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(64, 58, 52, 0.2);
    color: rgba(42, 38, 34, 0.98);
    box-shadow: 0 12px 22px rgba(35, 30, 25, 0.12);
}

.nav-links a.active {
    background: rgba(34, 30, 26, 0.95);
    color: #fdf9f2;
    border-color: rgba(34, 30, 26, 0.95);
    box-shadow: 0 12px 24px rgba(35, 30, 25, 0.18);
}

.nav-links a:active {
    transform: translateY(1px);
}

/* Lock background when the mobile nav is open */
body.nav-open {
    overflow: hidden;
}

body.nav-open .overlay-panel,
body.nav-open .page-transition-shim {
    filter: blur(6px);
    pointer-events: none;
}

body.nav-open .sticky-cta {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
}

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

.hero-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 38vh;
    background: radial-gradient(circle at 20% 18%, rgba(219, 203, 180, 0.45), transparent 60%),
        linear-gradient(180deg, rgba(248, 243, 237, 0.92) 0%, rgba(241, 234, 226, 0.92) 100%);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.8s ease;
    border-bottom: 1px solid rgba(64, 58, 52, 0.08);
}

.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.22'/%3E%3C/svg%3E");
    opacity: 0.18;
    pointer-events: none;
    mix-blend-mode: soft-light;
}

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

.hero-content {
    max-width: 800px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.25rem 2rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(34, 30, 26, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hero-title {
    font-size: clamp(2.2rem, 3.1vw, 3.4rem);
    font-weight: 650;
    color: #1e1b18;
    margin-bottom: 0.6rem;
    line-height: 1.15;
    text-transform: none;
    letter-spacing: -0.02em;
    text-shadow: 0 3px 16px rgba(255, 255, 255, 0.7);
}

.hero-tagline {
    font-size: 1.05rem;
    color: #4f4740;
    margin-bottom: 1.6rem;
    font-family: var(--font-serif);
    letter-spacing: 0.04em;
}

.hero-cta-group {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-cta-primary {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.9rem;
    background: rgba(34, 30, 26, 0.95);
    color: #fdf9f2;
    text-decoration: none;
    font-weight: 600;
    border-radius: 999px;
    transition: var(--transition);
    box-shadow: 0 12px 26px rgba(34, 30, 26, 0.25);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
    border: 1px solid rgba(34, 30, 26, 0.85);
}

.hero-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(34, 30, 26, 0.3);
    background: rgba(20, 17, 14, 0.98);
}

.hero-cta-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.9rem;
    background: rgba(255, 255, 255, 0.85);
    color: #2a241d;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid rgba(64, 58, 52, 0.4);
    border-radius: 999px;
    transition: var(--transition);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.85);
    color: #221e1a;
    transform: translateY(-2px);
}

.hero-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--navy);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-close:hover {
    background: var(--accent-strong);
    transform: scale(1.1) rotate(90deg);
}

/* Hero dismissed state */
body.hero-dismissed .hero-section {
    display: none;
}

body.hero-dismissed .gallery-container {
    margin-top: 180px;
    height: calc(100vh - 180px);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .hero-section {
        height: 42vh;
        padding: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-tagline {
        font-size: 1rem;
    }

    .hero-cta-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-cta-primary,
    .hero-cta-secondary {
        width: 100%;
        justify-content: center;
        padding: 16px 28px;
        font-size: 1rem;
        border-radius: 50px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .hero-cta-primary:active,
    .hero-cta-secondary:active {
        transform: scale(0.96);
    }

    .hero-cta-primary {
        letter-spacing: 0.02em;
        text-transform: none;
    }

    .hero-cta-secondary {
        letter-spacing: 0.02em;
        text-transform: none;
    }
}

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

.gallery-filter-bar {
    position: fixed;
    top: 35vh;
    left: 0;
    width: 100%;
    --filter-bar-collapsed-offset: 64px;
    background: rgba(248, 244, 238, 0.96);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid rgba(64, 58, 52, 0.1);
    z-index: 99;
    padding: 1.35rem 2rem 1.2rem;
    box-shadow: 0 16px 36px rgba(35, 30, 25, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: transform 0.3s ease;
    position: fixed;
    overflow: visible;
    min-height: 132px;
}

.gallery-filter-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.25'/%3E%3C/svg%3E");
    opacity: 0.18;
    pointer-events: none;
    mix-blend-mode: soft-light;
}

body.filter-collapsed .gallery-filter-bar {
    transform: none;
}

.gallery-filter-toggle {
    padding: 0 1.15rem;
    border-radius: 999px;
    border: 1.5px solid rgba(42, 38, 34, 0.4);
    background: rgba(255, 255, 255, 0.98);
    color: #221e1a;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: auto;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    height: 48px;
    display: inline-flex;
    align-items: center;
}

.gallery-filter-toggle:hover {
    background: rgba(42, 38, 34, 0.9);
    color: #f8f4ef;
}

body.hero-dismissed .gallery-filter-bar {
    top: 60px;
}


.filter-controls {
    max-width: 600px;
    margin: 0 auto 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    padding-top: 0.25rem;
}

.gallery-search {
    flex: 1;
    padding: 0.6rem 1.1rem;
    border: 1.5px solid rgba(42, 38, 34, 0.4);
    border-radius: 25px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.98);
    transition: var(--transition);
    color: #221e1a;
    height: 48px;
    line-height: 1.2;
}

.gallery-search:focus {
    outline: none;
    border-color: rgba(181, 138, 61, 0.7);
    box-shadow: 0 0 0 3px rgba(217, 185, 120, 0.16);
}

.btn-clear {
    padding: 0 1.15rem;
    height: 48px;
    background: rgba(42, 38, 34, 0.92);
    color: #f8f4ef;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.btn-clear:hover {
    background: rgba(217, 185, 120, 0.9);
    color: rgba(33, 29, 26, 0.95);
}

.category-filters {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    max-height: 200px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

body.filter-collapsed .category-filters {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
}

.category-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.98);
    border: 1.5px solid rgba(42, 38, 34, 0.45);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #2a241d;
    cursor: pointer;
    transition: var(--transition);
}

.category-btn:hover {
    background: rgba(42, 38, 34, 0.92);
    color: #f8f4ef;
}

.category-btn.active {
    background: rgba(42, 38, 34, 0.92);
    color: #f8f4ef;
    border-color: rgba(42, 38, 34, 0.92);
}

/* ============================================
   FORM STYLING
   ============================================ */

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: rgba(255, 255, 255, 0.9);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a2a4a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* Remove default arrow in IE */
select::-ms-expand {
    display: none;
}

/* Mobile responsive for filter bar */
@media (max-width: 768px) {
    body.hero-dismissed .gallery-filter-bar {
        top: 52px;
    }


    .gallery-filter-bar {
        padding: 1rem;
    }

    .gallery-filter-toggle {
        padding: 0.45rem 0.85rem;
        margin-left: 0;
    }

    .filter-controls {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .gallery-search {
        flex: 1 1 220px;
        width: auto;
    }

    .btn-clear {
        width: auto;
    }

    .category-filters {
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .category-btn {
        flex-shrink: 0;
    }
}

/* ============================================
   PAGE REVEAL + STICKY CTA
   ============================================ */

.reveal-on-load {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

body.page-loaded .reveal-on-load {
    opacity: 1;
    transform: translateY(0);
}

.sticky-cta {
    position: fixed;
    left: 2rem;
    bottom: 2rem;
    z-index: 1001;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.85rem 1.4rem;
    border-radius: 999px;
    background: var(--navy);
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(26, 42, 74, 0.25);
    opacity: 0;
    transform: translateY(12px);
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.4s ease;
}

body.page-loaded .sticky-cta {
    opacity: 1;
    transform: translateY(0);
}

.sticky-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(26, 42, 74, 0.3);
}

.sticky-cta:active {
    transform: translateY(0);
}

body.modal-active .sticky-cta,
body.full-viewer-active .sticky-cta {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
}

body.contact-page .sticky-cta {
    display: none;
}

@media (max-width: 640px) {
    .sticky-cta {
        left: 1rem;
        right: auto;
        bottom: 1rem;
        padding: 0.8rem 1.2rem;
        font-size: 0.85rem;
        transform: translateY(12px);
    }

    body.page-loaded .sticky-cta {
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal-on-load,
    .sticky-cta {
        transition: none;
    }
}

/* ============================================
   GALLERY CONTAINER
   ============================================ */

.gallery-container {
    margin-top: 80px;
    width: 100%;
    height: calc(100vh - 80px);
    overflow: hidden;
    position: relative;
    background: var(--bg-neutral);
}



.gallery-canvas {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    will-change: transform, filter, opacity;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-canvas.dragging {
    cursor: grabbing;
}

.gallery-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 3000px;
    height: 2000px;
    perspective: 1000px;
    will-change: transform;
}

#gallery-bg-logo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/jmlogo.svg');
    background-repeat: repeat;
    background-size: 200px auto;
    background-position: center;
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
    user-select: none;
    will-change: transform;
    filter: brightness(0);
}

/* ============================================
   OVERLAY PANELS (ABOUT / CONTACT / SERVICES)
   ============================================ */

.overlay-panel {
    position: fixed;
    top: 96px;
    right: 32px;
    width: min(560px, calc(100vw - 64px));
    max-height: calc(100vh - 140px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(255, 255, 255, 0.58);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.10);
    padding: 2.5rem;
    z-index: 1500;
}

.overlay-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.4);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;
    color: var(--navy);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.overlay-close:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.9);
    transform: rotate(90deg) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.overlay-close:active {
    transform: rotate(90deg) scale(0.95);
    background: rgba(255, 255, 255, 0.5);
}

.overlay-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 1.5rem;
    padding-right: 3rem;
}

.overlay-body {
    color: rgba(26, 42, 74, 0.8);
}

.overlay-body p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* Blur the gallery behind overlays on subpages */
body.subpage .gallery-canvas {
    filter: blur(6px);
    opacity: 0.95;
    z-index: 1;
    pointer-events: none;
}

body.subpage .gallery-canvas.dragging {
    cursor: grabbing;
}

/* Blur the gallery when modal is active */
body.modal-active .gallery-canvas {
    filter: blur(5px);
    opacity: 1; /* Keep gallery visible while modal animates; blur only */
    transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Recenter Gallery Button */
.recenter-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--navy);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
}

.recenter-btn.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.recenter-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.2);
}

.recenter-btn:active {
    transform: translateY(0) scale(0.98);
}

.recenter-btn svg {
    transition: transform 0.3s ease;
}

.recenter-btn:hover svg {
    transform: rotate(90deg);
}

.recenter-btn span {
    font-family: inherit;
}

/* Hide recenter button on mobile to avoid clutter */
@media (max-width: 768px) {
    .recenter-btn {
        bottom: 1rem;
        right: 1rem;
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .recenter-btn span {
        display: none;
    }
    
    .recenter-btn {
        width: 48px;
        height: 48px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}

/* ============================================
   GALLERY CARDS - POLAROID STYLE
   ============================================ */

.gallery-card {
    position: absolute;
    width: 280px;
    background: white;
    padding: 10px;
    border-radius: 2px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: box-shadow 0.3s ease-out;
    will-change: transform, opacity;
}

.gallery-card:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #fafafa;
    transition: var(--transition);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: flex-end;
    padding: 1.2rem;
    transition: var(--transition);
    pointer-events: none;
}

.gallery-card:hover .card-overlay {
    background: rgba(0, 0, 0, 0.1);
}

.card-title {
    color: var(--navy);
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(12px);
    transition: var(--transition);
    text-shadow: none;
    letter-spacing: 0.02em;
}

.gallery-card:hover .card-title {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   TWIRL ANIMATION
   ============================================ */

@keyframes twirl {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) rotate(720deg) scale(0.1);
        opacity: 0;
    }
}

@keyframes zoomIn {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(50%, 50%) scale(2);
        opacity: 0;
    }
}

.gallery-card.twirling {
    animation: twirl 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    pointer-events: none;
}

.gallery-card.zooming {
    animation: zoomIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

/* ============================================
   3D FLIP TO MODAL ANIMATION
   ============================================ */

.gallery-card.flipping-to-modal {
    position: fixed;
    z-index: 2001;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

@keyframes flipToModal {
    0% {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: rotateY(90deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: rotateY(180deg) scale(1);
        opacity: 1;
    }
}


/* ============================================
   MODAL
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 241, 237, 0);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    -webkit-backdrop-filter: blur(0px);
    backdrop-filter: blur(0px);
    transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                backdrop-filter 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                -webkit-backdrop-filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    /* Prevent any layout shifts during animation */
    overflow: hidden;
}

.modal.active {
    display: flex;
    background: rgba(245, 241, 237, 0.85);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.modal-content {
    position: relative;
    max-width: 600px;
    width: 100%;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 10px; /* Matches gallery card padding to keep the white border consistent during expansion */
    opacity: 0;
    transform: none;
    transition: opacity 0.35s ease-out;
    will-change: opacity;
}

.modal.active .modal-content {
    opacity: 1;
    transform: none;
}

.modal.closing .modal-content {
    opacity: 0;
    transform: none;
    transition: opacity 0.25s ease-out;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--navy);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

#modal-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.modal-info {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    /* Initial hidden state - starts below for slide-up reveal */
    opacity: 0;
    transform: translateY(20px);
    transition: none;
}

.modal-info h2 {
    color: var(--navy);
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.modal-info p {
    color: rgba(26, 42, 74, 0.75);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

@keyframes buttonPress {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.modal-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-btn:active {
    animation: buttonPress 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-btn-primary {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.85);
    color: var(--navy);
}

.modal-btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.modal-btn-secondary {
    background: transparent;
    border: 1px solid rgba(26, 42, 74, 0.2);
    color: var(--navy);
}

.modal-btn-secondary:hover {
    background: rgba(26, 42, 74, 0.05);
    border-color: rgba(26, 42, 74, 0.3);
}

#modal-description {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 0.95rem;
}

/* Modal reveal state */
.modal.revealed .modal-content {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3); /* Smoother shadow from snippet */
}

/* Text panel slide-up reveal with ease-out curve */
.modal.revealed .modal-info {
    opacity: 1;
    transform: translateY(0);
    transition: transform 0.4s ease-out 0.05s, opacity 0.35s ease-out 0.05s;
}

/* Text panel slide-down animation on close with ease-in curve */
.modal.closing .modal-info {
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.3s ease-in, opacity 0.25s ease-in;
}

/* ============================================
   DARK MODE – MODAL OVERRIDES
   ============================================ */

.dark-mode .modal-content {
    background: #1e1c1a;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.dark-mode .modal-info h2 {
    color: #f4f2ee;
}

.dark-mode .modal-info p,
.dark-mode #modal-description {
    color: rgba(244, 242, 238, 0.7);
}

.dark-mode .modal-close {
    background: rgba(30, 28, 26, 0.8);
    color: #f4f2ee;
}

.dark-mode .modal-close:hover {
    background: rgba(30, 28, 26, 1);
}

.dark-mode .modal-btn-primary {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f4f2ee;
}

.dark-mode .modal-btn-primary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.dark-mode .modal-btn-secondary {
    border-color: rgba(244, 242, 238, 0.25);
    color: #f4f2ee;
}

.dark-mode .modal-btn-secondary:hover {
    background: rgba(244, 242, 238, 0.08);
    border-color: rgba(244, 242, 238, 0.4);
}

/* ============================================
   DARK MODE – BACKGROUND & BODY
   ============================================ */

.dark-mode .background-container {
    background:
        radial-gradient(circle at 18% 18%, rgba(80, 65, 40, 0.2), transparent 55%),
        radial-gradient(circle at 85% 12%, rgba(100, 80, 45, 0.15), transparent 45%),
        linear-gradient(160deg, #141312 0%, #1a1918 50%, #1e1c1a 100%);
}

/* ============================================
   DARK MODE – NAVBAR
   ============================================ */

.dark-mode .navbar {
    background: rgba(20, 19, 18, 0.85);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dark-mode .logo-image {
    filter: invert(1) brightness(1.1);
}

.dark-mode .nav-links a {
    color: rgba(244, 242, 238, 0.9);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.dark-mode .nav-links a:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f4f2ee;
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.3);
}

.dark-mode .nav-links a.active {
    background: rgba(244, 242, 238, 0.92);
    color: #1a1918;
    border-color: rgba(244, 242, 238, 0.92);
}

.dark-mode .hamburger span {
    background: var(--text);
}

/* ============================================
   FILTER LOADER OVERLAY
   ============================================ */

.filter-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(247, 242, 236, 0.85);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.filter-loader-overlay.active {
    opacity: 1;
    visibility: visible;
}

.filter-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: loaderFadeIn 0.4s ease-out;
}

@keyframes loaderFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.filter-loader-logo {
    width: 80px;
    height: 80px;
    animation: logoPulse 1.5s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

.filter-loader-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--navy);
    letter-spacing: 0.05em;
    animation: textPulse 1.5s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Dark mode filter loader */
.dark-mode .filter-loader-overlay {
    background: rgba(20, 19, 18, 0.9);
}

.dark-mode .filter-loader-text {
    color: #f4f2ee;
}

.dark-mode .filter-loader-logo {
    filter: invert(1) brightness(1.1);
}

/* ============================================
   DARK MODE – HERO SECTION
   ============================================ */

.dark-mode .hero-section {
    background: radial-gradient(circle at 20% 18%, rgba(80, 65, 40, 0.25), transparent 60%),
        linear-gradient(180deg, rgba(20, 19, 18, 0.94) 0%, rgba(26, 25, 23, 0.94) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dark-mode .hero-content {
    background: rgba(30, 28, 26, 0.8);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

.dark-mode .hero-title {
    color: #f4f2ee;
    text-shadow: 0 3px 16px rgba(0, 0, 0, 0.4);
}

.dark-mode .hero-tagline {
    color: rgba(244, 242, 238, 0.65);
}

.dark-mode .hero-cta-primary {
    background: rgba(244, 242, 238, 0.92);
    color: #1a1918;
    border-color: rgba(244, 242, 238, 0.85);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
}

.dark-mode .hero-cta-primary:hover {
    background: #f4f2ee;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
}

.dark-mode .hero-cta-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #f4f2ee;
    border-color: rgba(255, 255, 255, 0.2);
}

.dark-mode .hero-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #f4f2ee;
}

.dark-mode .hero-close {
    background: rgba(255, 255, 255, 0.1);
    color: #f4f2ee;
}

.dark-mode .hero-close:hover {
    background: var(--accent-strong);
    transform: scale(1.1) rotate(90deg);
}

/* ============================================
   DARK MODE – FILTER BAR
   ============================================ */

.dark-mode .gallery-filter-bar {
    background: rgba(20, 19, 18, 0.96);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dark-mode .gallery-search {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #f4f2ee;
}

.dark-mode .gallery-search::placeholder {
    color: rgba(244, 242, 238, 0.4);
}

.dark-mode .gallery-search:focus {
    border-color: rgba(213, 179, 90, 0.6);
    box-shadow: 0 0 0 3px rgba(213, 179, 90, 0.12);
}

.dark-mode .btn-clear {
    background: rgba(244, 242, 238, 0.88);
    color: #1a1918;
}

.dark-mode .btn-clear:hover {
    background: rgba(213, 179, 90, 0.9);
    color: #1a1918;
}

.dark-mode .gallery-filter-toggle {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #f4f2ee;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.dark-mode .gallery-filter-toggle:hover {
    background: rgba(244, 242, 238, 0.88);
    color: #1a1918;
}

.dark-mode .category-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #f4f2ee;
}

.dark-mode .category-btn:hover {
    background: rgba(244, 242, 238, 0.88);
    color: #1a1918;
}

.dark-mode .category-btn.active {
    background: rgba(244, 242, 238, 0.92);
    color: #1a1918;
    border-color: rgba(244, 242, 238, 0.92);
}

/* ============================================
   DARK MODE – GALLERY CARDS
   ============================================ */

.dark-mode .gallery-card {
    background: #1e1c1a;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

.dark-mode .gallery-card:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.dark-mode .card-image {
    background: #2a2724;
}

/* ============================================
   DARK MODE – OVERLAY PANELS
   ============================================ */

.dark-mode .overlay-panel {
    background: rgba(26, 25, 23, 0.75);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.dark-mode .overlay-close {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f4f2ee;
}

.dark-mode .overlay-close:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.25);
}

.dark-mode .overlay-title {
    color: #f4f2ee;
}

.dark-mode .overlay-body {
    color: rgba(244, 242, 238, 0.75);
}

/* ============================================
   DARK MODE – CONTACT FORM
   ============================================ */

.dark-mode .contact-form {
    background: rgba(30, 28, 26, 0.92);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.dark-mode .form-group label {
    color: rgba(244, 242, 238, 0.8);
}

.dark-mode .form-group input,
.dark-mode .form-group textarea,
.dark-mode .form-group select {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
    color: #f4f2ee;
}

.dark-mode .form-group input::placeholder,
.dark-mode .form-group textarea::placeholder {
    color: rgba(244, 242, 238, 0.35);
}

.dark-mode .form-group input:focus,
.dark-mode .form-group textarea:focus,
.dark-mode .form-group select:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(213, 179, 90, 0.6);
    box-shadow: 0 0 0 3px rgba(213, 179, 90, 0.12);
}

.dark-mode .btn-submit {
    background: rgba(244, 242, 238, 0.92);
    color: #1a1918;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.dark-mode .btn-submit:hover {
    background: #f4f2ee;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.4);
}

.dark-mode select {
    background-color: rgba(255, 255, 255, 0.07);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23f4f2ee' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    color: #f4f2ee;
}

/* ============================================
   DARK MODE – RECENTER BUTTON
   ============================================ */

.dark-mode .recenter-btn {
    background: #1e1c1a;
    color: #f4f2ee;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.dark-mode .recenter-btn:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}

/* ============================================
   DARK MODE – MODAL BACKDROP
   ============================================ */

.dark-mode .modal.active {
    background: rgba(10, 9, 8, 0.88);
}

/* ============================================
   DARK MODE – STICKY CTA
   ============================================ */

.dark-mode .sticky-cta {
    background: #f4f2ee;
    color: #1a1918;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.dark-mode .sticky-cta:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */

@keyframes slideInFromRight {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutToLeft {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-100%);
    }
}

body.page-transition-enter {
    animation: none;
}

body.page-transition-exit {
    animation: none;
}

body.page-transition-enter .overlay-panel {
    animation: slideInFromRight 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

body.page-transition-exit .overlay-panel {
    animation: slideOutToLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

body.page-transition-exit .navbar {
    opacity: 0.99;
}

body.page-transition-exit .gallery-canvas {
    transform: translate3d(60px, 0, 0);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

body.page-transition-enter .gallery-canvas {
    transform: translate3d(0, 0, 0);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition-shim {
    position: fixed;
    top: 0;
    right: 0;
    width: min(560px, calc(100vw - 64px));
    height: 100vh;
    background: rgba(255, 255, 255, 0.58);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    border-left: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.10);
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2500;
    pointer-events: none;
}

body.page-transition-exit .page-transition-shim {
    transform: translateX(0);
}

@keyframes blurIn {
    from {
        -webkit-backdrop-filter: blur(0px);
        backdrop-filter: blur(0px);
    }
    to {
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }
}

@keyframes autoScroll {
    0% {
        transform: translate(calc(-50% + 0px), calc(-50% + 0px));
    }
    25% {
        transform: translate(calc(-50% - 100px), calc(-50% - 80px));
    }
    50% {
        transform: translate(calc(-50% - 150px), calc(-50% + 100px));
    }
    75% {
        transform: translate(calc(-50% + 80px), calc(-50% + 120px));
    }
    100% {
        transform: translate(calc(-50% + 0px), calc(-50% + 0px));
    }
}

.section {
    animation: slideInFromRight 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.gallery-grid.auto-scroll {
    animation: autoScroll 60s linear infinite;
}

.section.blur-active {
    position: relative;
    z-index: 100;
}

/* ============================================
   SECTIONS
   ============================================ */

.section {
    padding: 6rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-content {
    max-width: 800px;
}

.section h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--navy);
    position: relative;
    padding-bottom: 1rem;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gold);
}

.about-section {
    background: white;
}

.about-section p {
    font-size: 1.1rem;
    color: var(--navy);
    line-height: 1.8;
}

/* ============================================
   CONTACT FORM
   ============================================ */

.contact-section {
    background: var(--bg-neutral);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.contact-section h2 {
    display: none;
}

.contact-section h2::after {
    display: none;
}

.contact-heading {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.section-content {
    width: 100%;
    max-width: 500px;
}

.contact-form {
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(64, 58, 52, 0.18);
    padding: 4rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 2.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    color: #1e1b18;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.98);
    border: 1.5px solid rgba(42, 38, 34, 0.45);
    border-radius: 8px;
    color: var(--navy);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.form-group select::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    background: #fffaf2;
    border-color: rgba(181, 138, 61, 0.8);
    box-shadow: 0 0 0 3px rgba(217, 185, 120, 0.18);
}

.btn-submit {
    width: 100%;
    background: rgba(34, 30, 26, 0.95);
    color: #fdf9f2;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
    box-shadow: 0 10px 24px rgba(34, 30, 26, 0.2);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(34, 30, 26, 0.25);
    background: rgba(20, 17, 14, 0.98);
}

.btn-submit:active {
    transform: translateY(0);
}

/* ============================================
   SERVICES
   ============================================ */

.services-section {
    background: white;
}

.services-section h2 {
    color: var(--navy);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    padding: 2rem;
    background: var(--bg-neutral);
    border-radius: 8px;
    border-left: 4px solid var(--gold);
    transition: var(--transition);
    background-image: linear-gradient(rgba(15, 26, 40, 0.06) 1px, transparent 1px);
    background-size: 100% 32px;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.service-card h3 {
    color: var(--navy);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.service-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.service-card li {
    position: relative;
    padding-left: 2.1rem;
    color: var(--navy);
    line-height: 1.55;
    font-size: 0.96rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.service-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gold), rgba(212, 175, 55, 0.35));
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.service-card li::after {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0.78rem;
    width: 1.1rem;
    height: 1px;
    background: linear-gradient(90deg, rgba(15, 26, 40, 0.45), rgba(212, 175, 55, 0.25));
}

.service-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

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

@media (max-width: 768px) {
    .nav-container {
        padding: 0.9rem 1.25rem;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .nav-link-secondary {
        display: block;
    }

    /* Mobile button improvements - Pill shape with better touch targets */
    button,
    .category-btn,
    .btn-clear,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
        font-size: 1rem;
        border-radius: 50px;
        padding: 12px 24px;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    button:active,
    .category-btn:active,
    .btn-clear:active {
        transform: scale(0.96);
    }

    .sticky-cta {
        padding: 14px 28px;
        font-size: 1rem;
        border-radius: 50px;
        min-height: 48px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .modal-btn {
        min-height: 44px;
        border-radius: 50px;
        padding: 12px 24px;
        font-size: 1rem;
    }

    .gallery-filter-bar button {
        min-height: 44px;
        padding: 12px 20px;
        border-radius: 50px;
        font-size: 0.95rem;
    }

    .category-btn {
        padding: 12px 20px;
        border-radius: 50px;
        font-size: 0.95rem;
    }

    .recenter-btn {
        padding: 12px 20px;
        border-radius: 50px;
        min-height: 44px;
        font-size: 0.95rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    #gallery-bg-logo {
        display: none;
    }

    .section h2 {
        font-size: 2rem;
    }

    .modal {
        align-items: flex-start; /* Align to top on mobile */
        padding: 1rem;
        padding-top: 90px; /* Start below navbar */
    }

    .modal-content {
        max-width: 95vw;
        max-height: 85vh; /* Adjusted height for mobile */
        padding: 8px; /* Slightly reduced padding on mobile */
        margin-top: 0; /* Ensure no extra margin */
    }

    /* Only apply scrolling after modal is revealed */
    .modal.revealed .modal-content {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    #modal-image {
        height: 250px; /* Reduced height on mobile for better balance */
    }

    .modal-info {
        padding: 1.5rem; /* Reduced padding on mobile */
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    /* Overlay panel mobile adjustments */
    .overlay-panel {
        top: 80px;
        right: 16px;
        left: 16px;
        width: calc(100vw - 32px);
        max-height: calc(100vh - 120px);
        padding: 2rem 1.5rem;
    }

    .overlay-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }

    .overlay-title {
        font-size: 1.4rem;
        padding-right: 2.5rem;
    }
}

@media (max-width: 480px) {
    /* Show hamburger button */
    .hamburger {
        display: flex;
    }

    /* Mobile nav links */
    .nav-links {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100vh;
        flex-direction: column;
        gap: 0;
        background: rgba(255, 255, 255, 0.98);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        padding: 120px 2rem 2rem;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateX(100%);
        z-index: 2600;
        overflow-y: auto;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    /* Dark mode mobile menu background */
    .dark-mode .nav-links {
        background: rgba(26, 26, 26, 0.98);
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links li {
        width: auto;
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.3s ease;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateX(0);
    }

    /* Stagger animation for menu items */
    .nav-links.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-links.active li:nth-child(2) { transition-delay: 0.15s; }
    .nav-links.active li:nth-child(3) { transition-delay: 0.2s; }
    .nav-links.active li:nth-child(4) { transition-delay: 0.25s; }

    /* Mobile navigation links - text only with dotted separators */
    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links li:not(:last-child)::after {
        content: '';
        display: block;
        width: 100px;
        height: 1px;
        background-image: linear-gradient(to right, transparent 50%, var(--text-muted) 50%);
        background-size: 8px 1px;
        background-repeat: repeat-x;
        margin: 1.5rem auto 0;
        opacity: 0.4;
    }

    .dark-mode .nav-links li:not(:last-child)::after {
        background-image: linear-gradient(to right, transparent 50%, rgba(255, 255, 255, 0.4) 50%);
        opacity: 0.3;
    }

    .nav-links a {
        display: block;
        padding: 1rem 1.5rem;
        font-size: 1.3rem;
        font-weight: 400;
        color: var(--text);
        text-decoration: none;
        letter-spacing: -0.02em;
        transition: color 0.2s ease;
    }

    .nav-links a:hover {
        color: var(--accent);
    }

    .nav-links a::after {
        display: none;
    }

    /* Dark mode mobile menu */
    .dark-mode .nav-links a {
        color: var(--text);
        font-weight: 400;
    }

    .dark-mode .nav-links a:hover {
        color: var(--accent);
    }

    .nav-link-secondary {
        display: none;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 2rem 1rem;
    }

    .section h2 {
        font-size: 1.5rem;
    }
}

/* ============================================
   FULL IMAGE VIEWER
   ============================================ */

/* ============================================
   DARK MODE – VIEWER
   ============================================ */

.dark-mode .viewer-toolbar {
    background: rgba(20, 19, 18, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dark-mode .viewer-control-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f4f2ee;
}

.dark-mode .viewer-control-btn:hover {
    background: rgba(244, 242, 238, 0.15);
    border-color: rgba(244, 242, 238, 0.25);
    color: #f4f2ee;
}

.dark-mode .viewer-control-btn:active {
    background: rgba(244, 242, 238, 0.2);
}

.dark-mode .viewer-separator {
    background: rgba(255, 255, 255, 0.15);
}

.dark-mode .viewer-counter {
    color: #f4f2ee;
}

.dark-mode .viewer-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #f4f2ee;
}

.dark-mode .viewer-nav-btn:hover {
    background: rgba(244, 242, 238, 0.15);
    color: #f4f2ee;
}

.dark-mode .viewer-back-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #f4f2ee;
}

.dark-mode .viewer-back-btn:hover {
    background: rgba(244, 242, 238, 0.15);
    color: #f4f2ee;
}

.dark-mode .viewer-close-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #f4f2ee;
}

.dark-mode .viewer-close-btn:hover {
    background: rgba(244, 242, 238, 0.2);
    color: #f4f2ee;
}

.dark-mode .full-viewer-overlay {
    background: var(--bg-neutral);
}

.dark-mode .full-image-viewer {
    background: #1a1918;
}

.dark-mode .viewer-info {
    background: #1e1c1a;
    color: #f4f2ee;
}

.dark-mode .viewer-info h1,
.dark-mode .viewer-info h2,
.dark-mode .viewer-info p {
    color: #f4f2ee;
}

.dark-mode .viewer-info code {
    background: rgba(255, 255, 255, 0.1);
    color: #f4f2ee;
}

.full-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: var(--bg-neutral);
    display: none;
}

.full-viewer-overlay.active {
    display: block;
}

body.full-viewer-active {
    overflow: hidden;
}

.full-image-viewer {
    min-height: 100vh;
    background: var(--bg-neutral);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Viewer Toolbar */
.viewer-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 4000;
    transition: all 0.3s ease;
}

.viewer-toolbar-left,
.viewer-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Viewer Control Buttons */
.viewer-control-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--navy);
    transition: all 0.2s ease;
    min-width: 40px;
    min-height: 40px;
    font-size: 0.875rem;
}

.viewer-control-btn:hover {
    background: var(--navy);
    color: white;
    border-color: var(--navy);
}

.viewer-control-btn:active {
    transform: scale(0.95);
}

.viewer-control-btn svg {
    width: 20px;
    height: 20px;
}

/* Toolbar Separator */
.viewer-separator {
    width: 1px;
    height: 24px;
    background: rgba(0, 0, 0, 0.15);
    margin: 0 0.25rem;
}

/* Viewer Counter */
.viewer-counter {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    color: var(--navy);
}

.viewer-back-btn {
    position: fixed;
    top: 2rem;
    left: 2rem;
    background: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--navy);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
    z-index: 100;
}

.viewer-close-btn {
    position: fixed;
    top: 4.5rem; /* below nav */
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--navy);
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
    transition: all 0.2s ease;
    z-index: 4000;
    font-weight: 600;
}

.viewer-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
}

.viewer-close-label {
    display: none;
}

.viewer-back-btn:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.2);
}

.viewer-back-btn svg {
    transition: transform 0.3s ease;
}

.viewer-back-btn:hover svg {
    transform: translateX(-3px);
}

/* Navigation Arrows */
.viewer-nav-btn {
    position: fixed;
    top: 5rem; /* Position below navbar (navbar is ~66px tall) */
    background: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 4100;
    color: var(--navy);
}

.viewer-nav-btn:hover {
    background: var(--navy);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
}

.viewer-nav-btn:active {
    transform: scale(0.95);
}

.viewer-prev-btn {
    left: 2rem;
}

.viewer-next-btn {
    left: 5.5rem; /* Positioned next to prev button */
}

/* Zoom Controls */
.viewer-zoom-controls {
    position: fixed;
    right: 5.5rem; /* To the left of the close button */
    top: 4.5rem;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    z-index: 4001;
}

.zoom-btn {
    background: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
    color: var(--navy);
}

.zoom-btn:hover {
    background: var(--navy);
    color: white;
    transform: scale(1.1);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.viewer-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 8rem 4rem;
}

.viewer-image-container img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.viewer-info {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.viewer-counter {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    top: 1rem;
    right: 4.5rem;
}

.slideshow-play-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.slideshow-play-btn:hover {
    transform: scale(1.1);
}

.slideshow-play-btn svg .pause-icon {
    display: none;
}

.slideshow-play-btn.playing svg .play-icon {
    display: none;
}

.slideshow-play-btn.playing svg .pause-icon {
    display: inline;
}

.viewer-info h1 {
    font-size: 2rem;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.viewer-info p {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.viewer-info p strong {
    color: var(--navy);
    font-weight: 600;
}

.viewer-info p em {
    font-style: italic;
    color: #555;
}

.viewer-info p code {
    background: rgba(26, 54, 93, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .viewer-back-btn {
        top: 1rem;
        left: 1rem;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Larger tap targets for tablet/mobile */
    .viewer-nav-btn {
        width: 52px;
        height: 52px;
    }

    .viewer-prev-btn {
        left: 1rem;
    }

    .viewer-next-btn {
        right: 1rem;
    }

    /* Mobile-specific active state for nav buttons */
    .viewer-nav-btn:active {
        transform: scale(0.9);
        background: rgba(26, 54, 93, 0.95);
        color: white;
    }

    .viewer-close-btn {
        top: 5.5rem;
        right: 1rem;
    }

    .viewer-image-container {
        padding: 5rem 6rem 2rem;
    }

    .viewer-info {
        padding: 1.5rem;
    }

    .viewer-info h1 {
        font-size: 1.5rem;
    }

    .viewer-zoom-controls {
        right: 1rem;
        top: auto;
        bottom: 7rem;
        transform: none;
        flex-direction: row;
    }

    .zoom-btn {
        width: 40px;
        height: 40px;
    }

    /* Toolbar mobile adjustments */
    .viewer-toolbar {
        padding: 0.75rem 1rem;
        flex-wrap: nowrap;
    }

    .viewer-control-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }
}

@media (max-width: 600px) {
    .full-image-viewer {
        padding: 0;
        background: #000;
    }

    .viewer-image-container {
        padding: 0;
        height: 100vh;
    }

    .viewer-image-container img {
        width: 100vw;
        height: 100vh;
        object-fit: contain;
        border-radius: 0;
        box-shadow: none;
        background: #000;
    }

    .viewer-back-btn {
        display: none;
    }

    /* Extra large tap targets for small mobile phones */
    .viewer-nav-btn {
        width: 56px;
        height: 56px;
        background: rgba(255, 255, 255, 0.9);
        color: var(--navy);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    }

    .viewer-prev-btn {
        left: 0.75rem;
        top: 5.5rem;
        bottom: auto;
    }

    .viewer-next-btn {
        right: 0.75rem;
        top: 5.5rem;
        bottom: auto;
    }

    /* Enhanced active state for mobile touch */
    .viewer-nav-btn:active {
        transform: scale(0.85);
        background: rgba(255, 255, 255, 1);
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
    }

    .viewer-close-btn {
        display: flex;
        top: auto;
        bottom: 1.25rem;
        right: 1rem;
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
        padding: 0;
        width: 56px;
        height: 56px;
        border-radius: 999px;
        gap: 0;
        align-items: center;
    }

    .viewer-close-btn:active {
        transform: scale(0.9);
    }

    .viewer-close-btn svg {
        width: 24px;
        height: 24px;
    }

    .viewer-close-label {
        display: none;
    }

    /* Toolbar adjustments for small screens */
    .viewer-toolbar {
        padding: 0.6rem 0.75rem;
        top: 0;
        flex-wrap: nowrap;
        gap: 0.25rem;
    }

    .viewer-control-btn {
        min-width: 48px;
        min-height: 48px;
        padding: 0.4rem;
    }

    .viewer-control-btn:active {
        transform: scale(0.9);
        background: rgba(255, 255, 255, 1);
    }

    .viewer-separator {
        height: 20px;
        margin: 0 0.15rem;
    }

    .viewer-info {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        margin: 0;
        border-radius: 0;
        text-align: left;
        background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.3));
        color: #fff;
        box-shadow: none;
        padding: 1.5rem;
    }

    .viewer-info h1,
    .viewer-info p,
    .viewer-info strong,
    .viewer-info em,
    .viewer-counter {
        color: #fff;
    }

    .viewer-info code {
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
}
