/* --- Variables & Setup --- */
:root {
    /* Designer Typography Pairing */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
    --font-stats: Arial, Helvetica, sans-serif; /* Explicitly requested for stats */

    --color-dark: #0a0a0a;
    --color-dark-alt: #141414;
    --color-light: #fafafa;
    --color-white: #ffffff;
    --color-gray: #888888;
    --color-accent: #d4af37; /* Refined luxury gold */
    --transition-speed: 0.4s;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* Scroll Lock during intro */
body.locked { overflow: hidden; height: 100vh; }

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-dark);
    background-color: var(--color-light);
    overflow-x: hidden;
    width: 100%;
}

/* Global safety net: nothing should ever be able to force horizontal
   scroll/clipping on small screens. */
img, video {
    max-width: 100%;
    height: auto;
}

/* Apply Heading Font */
h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- Editorial White Fade Intro Screen ---
   Tightened so the forced wait never feels "stuck": total lock time is now
   under ~2.6s and the whole thing is skippable at any moment (click / tap /
   key / scroll) via script.js. */
#intro-loader {
    position: fixed;
    inset: 0;
    background-color: var(--color-white);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.9s cubic-bezier(0.65, 0, 0.35, 1), visibility 0.9s;
    cursor: pointer;
}

#intro-loader.fade-out { opacity: 0; visibility: hidden; }

.intro-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: min(90vw, 900px);
    height: clamp(5rem, 14vw, 9rem);
    /* How far V and R slide apart from center. Desktop default here;
       overridden with a larger minimum on small screens below so the
       word "PHOTOGRAPHY" always has room to sit between them without
       overlapping. */
    --intro-offset: clamp(50px, 9vw, 130px);
}

.intro-letter {
    position: absolute;
    top: 50%;
    left: 50%;
    font-family: var(--font-heading);
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 400;
    color: var(--color-dark);
    line-height: 1;
    opacity: 0;
    will-change: transform, opacity, filter;
    backface-visibility: hidden;
}

.intro-v {
    transform: translate(-100%, -50%) scale(1.08);
    animation: introSplitV 1.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.intro-r {
    transform: translate(0%, -50%) scale(1.08);
    animation: introSplitR 1.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes introSplitV {
    0%   { opacity: 0; filter: blur(6px); transform: translate(-100%, -50%) scale(1.08); }
    35%  { opacity: 1; filter: blur(0);   transform: translate(-100%, -50%) scale(1); }
    100% { opacity: 1; filter: blur(0);   transform: translate(calc(-100% - var(--intro-offset, 50px)), -50%) scale(1); }
}

@keyframes introSplitR {
    0%   { opacity: 0; filter: blur(6px); transform: translate(0%, -50%) scale(1.08); }
    35%  { opacity: 1; filter: blur(0);   transform: translate(0%, -50%) scale(1); }
    100% { opacity: 1; filter: blur(0);   transform: translate(var(--intro-offset, 50px), -50%) scale(1); }
}

.intro-word {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(10px);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: clamp(0.75rem, 2.2vw, 1.1rem);
    letter-spacing: clamp(4px, 2vw, 12px);
    color: var(--color-accent);
    white-space: nowrap;
    opacity: 0;
    will-change: transform, opacity;
    animation: introWordReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}

@keyframes introWordReveal {
    0%   { opacity: 0; transform: translate(-50%, -50%) translateY(10px); }
    100% { opacity: 1; transform: translate(-50%, -50%) translateY(0); }
}

.intro-skip {
    position: absolute;
    bottom: clamp(24px, 6vh, 48px);
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: none;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--color-gray);
    cursor: pointer;
    opacity: 0;
    animation: fadeInText 0.6s ease 1.3s forwards;
    padding: 8px 16px;
}
.intro-skip:hover,
.intro-skip:focus-visible { color: var(--color-dark); }

/* --- MOBILE FIX: intro V / R / "PHOTOGRAPHY" overlap ---
   On phones the split-letter gap (--intro-offset) shrank faster than
   the word's width, so "PHOTOGRAPHY" ended up wider than the space
   between V and R and overlapped both letters. This raises the
   minimum spread and shrinks the word's font-size/letter-spacing so
   there's always comfortable clearance, at every phone width. */
@media (max-width: 600px) {
    .intro-content {
        --intro-offset: clamp(78px, 24vw, 130px);
        height: clamp(4rem, 20vw, 6rem);
    }
    .intro-letter {
        font-size: clamp(2.6rem, 14vw, 4rem);
    }
    .intro-word {
        font-size: clamp(0.6rem, 2.6vw, 0.8rem);
        letter-spacing: clamp(2px, 1.3vw, 5px);
    }
}

/* --- Main Wrapper (Camera Focus Effect) --- */
#main-wrapper {
    opacity: 0;
    filter: blur(15px);
    transform: scale(1.03);
    transition: opacity 1.2s ease, filter 1.2s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s ease;
    width: 100%;
    overflow-x: hidden;
}

#main-wrapper.visible {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}

/* --- Utilities --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }
.container-fluid { max-width: 1600px; margin: 0 auto; padding: 0 20px; width: 100%; }
.section { padding: 100px 0; }
.section-title {
    text-align: center;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 1px;
}
.works-subtitle {
    text-align: center;
    color: var(--color-gray);
    font-size: 0.95rem;
    font-weight: 300;
    margin-bottom: 50px;
}
.bg-light { background-color: var(--color-light); }
.bg-dark { background-color: var(--color-dark); color: var(--color-white); }
.bg-dark-alt { background-color: var(--color-dark-alt); color: var(--color-white); }
.text-center { text-align: center; }
.mt-5 { margin-top: 50px; }
.mt-auto { margin-top: auto; }

/* Animations */
.fade-in-up { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.fade-in-up.is-visible { opacity: 1; transform: translateY(0); }
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* --- Navigation (Glassmorphism) --- */
header {
    position: fixed; top: 0; width: 100%; padding: 25px 40px;
    display: flex; justify-content: space-between; align-items: center;
    background: transparent; color: var(--color-white);
    z-index: 1000; transition: all var(--transition-speed) ease;
}
header.scrolled {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 15px 40px;
}
.logo { display: flex; align-items: center; gap: 8px; z-index: 1001; }
.logo .vr { font-family: var(--font-body); font-size: clamp(1.4rem, 3.2vw, 1.7rem); font-style: normal; font-weight: 700; letter-spacing: 1px; }
.logo .text { font-family: var(--font-body); font-size: clamp(0.7rem, 2vw, 0.9rem); font-weight: 700; letter-spacing: 4px; opacity: 0; animation: fadeInText 1s ease 2.2s forwards; }

@keyframes fadeInText { to { opacity: 1; } }

.nav-links { display: flex; gap: 30px; transition: 0.4s ease-in-out; }
.nav-links a {
    text-transform: uppercase; font-size: 0.75rem; letter-spacing: 2px;
    font-weight: 600; transition: color var(--transition-speed);
}
.nav-links a:hover { color: var(--color-accent); }

/* Hamburger Menu */
.menu-toggle { display: none; flex-direction: column; cursor: pointer; z-index: 1001; gap: 5px; }
.bar { width: 25px; height: 2px; background-color: var(--color-white); transition: all 0.3s ease; }

/* --- Hero Section --- */
.hero { height: 100dvh; min-height: 500px; position: relative; display: flex; justify-content: center; align-items: center; text-align: center; color: var(--color-white); background-color: #000; overflow: hidden;}
.hero-slider { position: absolute; inset: 0; z-index: 0; }
.slide {
    position: absolute; inset: 0; background-repeat: no-repeat;
    background-position: center center; background-size: cover;
    opacity: 0; transform: scale(1.1); transition: opacity 1.5s ease-in-out;
}
.slide.active { opacity: 1; transform: scale(1); transition: opacity 1.5s ease-in-out, transform 10s linear; }
.overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.8) 100%); z-index: 1; }

.hero-content { position: relative; z-index: 2; padding: 0 20px; width: 100%; display: flex; flex-direction: column; align-items: center; }
.hero h1 { font-family: var(--font-body); font-size: clamp(2.2rem, 7vw, 5rem); font-style: normal; font-weight: 700; margin-bottom: 15px; line-height: 1.15; letter-spacing: 1px; }
.hero p { font-size: clamp(0.9rem, 3vw, 1.1rem); margin-bottom: 30px; font-weight: 300; letter-spacing: clamp(2px, 1vw, 4px); color: #ccc; text-transform: uppercase; }

.scroll-cue {
    position: absolute;
    bottom: clamp(24px, 5vh, 44px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.7);
}
.scroll-cue-line {
    width: 1px;
    height: 34px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.9), transparent);
    animation: scrollCuePulse 1.8s ease-in-out infinite;
}
.scroll-cue-label {
    font-size: 0.65rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 600;
}
@keyframes scrollCuePulse {
    0%, 100% { transform: scaleY(1); opacity: 0.6; }
    50% { transform: scaleY(1.3); opacity: 1; }
}

/* --- Premium Buttons --- */
.btn {
    position: relative; display: inline-block; padding: 16px 35px;
    border: 1px solid rgba(255,255,255,0.3); color: var(--color-white);
    text-transform: uppercase; font-size: 0.75rem; letter-spacing: 3px;
    font-weight: 600; cursor: pointer; background: transparent;
    overflow: hidden; z-index: 1; transition: all 0.4s ease; text-align: center;
}
.btn::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: var(--color-white); z-index: -1; transition: left 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:hover { color: var(--color-dark); border-color: var(--color-white); }
.btn:hover::before { left: 0; }

.btn-solid { border-color: var(--color-accent); background: var(--color-accent); color: var(--color-dark); }
.btn-solid::before { background: var(--color-white); }
.btn-solid:hover { color: var(--color-dark); border-color: var(--color-white); }

/* --- Video Gallery Section ---
   display:flex with flex-wrap so it degrades gracefully; on mobile
   (see media query below) it's forced into a full-width flex COLUMN so
   the fixed min-width on .main-video-wrapper can never overflow. */
.video-gallery-container { display: flex; flex-wrap: wrap; gap: 20px; background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 20px 40px rgba(0,0,0,0.05); }
.main-video-wrapper { flex: 1 1 60%; position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 4px; overflow: hidden; min-width: 300px;}
.main-video-wrapper video { width: 100%; height: 100%; object-fit: cover; }
.video-playlist { flex: 1 1 30%; display: flex; flex-direction: column; gap: 10px; max-height: 450px; overflow-y: auto; padding-right: 5px; min-width: 0; }
.vid-thumb { display: flex; gap: 15px; align-items: center; padding: 10px; cursor: pointer; transition: background 0.3s ease; border-left: 3px solid transparent; border-radius: 4px; }
.vid-thumb:hover { background: #f9f9f9; }
.vid-thumb.active { background: #f4f4f4; border-left-color: var(--color-accent); }
.vid-thumb img { width: 90px; height: 60px; object-fit: cover; border-radius: 4px; flex-shrink: 0;}
.vid-info { min-width: 0; }
.vid-info h5 { font-family: var(--font-body); font-size: 0.85rem; font-weight: 700; margin-bottom: 5px; color: var(--color-dark); line-height: 1.3; }
.vid-info span { font-size: 0.75rem; color: var(--color-gray); font-weight: 600; }

/* --- Portfolio Profile --- */
.portfolio-profile { background: #111; padding: clamp(40px, 8vw, 100px) 20px; text-align: center; border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); }
.portfolio-profile h3 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 400; margin-bottom: 10px; font-style: italic;}
.portfolio-profile .title { color: var(--color-accent); font-weight: 600; text-transform: uppercase; letter-spacing: clamp(2px, 1vw, 5px); margin-bottom: 60px; display: block; font-size: 0.8rem; }

.stats-grid { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: clamp(30px, 6vw, 100px); margin-bottom: 60px; }

.stat-box h4 { font-family: var(--font-stats) !important; font-size: clamp(3rem, 8vw, 4.5rem); color: var(--color-white); font-weight: 900; line-height: 1; }
.stat-box p { font-family: var(--font-stats) !important; color: var(--color-gray); text-transform: uppercase; font-size: 0.85rem; font-weight: 700; letter-spacing: 2px; margin-top: 10px; }

.services-wrapper { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 50px; }
.services-wrapper h4 { font-family: var(--font-body); font-size: 1rem; margin-bottom: 25px; font-weight: 600; text-transform: uppercase; letter-spacing: 3px; color: #aaa; }
.service-tags { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.service-tags span { border: 1px solid rgba(255,255,255,0.1); color: #ccc; padding: 10px 20px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; transition: all 0.3s ease; border-radius: 30px;}
.service-tags span:hover { border-color: var(--color-accent); color: var(--color-accent); background: rgba(212, 175, 55, 0.05);}

/* --- 4x4 Grid Works Gallery (static — hover reveals detail, click opens lightbox) --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    background: #000;
    border-radius: 4px;
    aspect-ratio: 4/5;
    cursor: pointer;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.gallery-item:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.8s ease;
    opacity: 0.92;
}

.gallery-item:hover img,
.gallery-item:focus-within img { transform: scale(1.06); opacity: 0.22; }

.gallery-caption {
    position: absolute; inset: 0; padding: 24px;
    display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
    z-index: 2; opacity: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.5) 55%, transparent 85%);
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.gallery-item:hover .gallery-caption,
.gallery-item:focus-within .gallery-caption { opacity: 1; }

.cap-category {
    color: var(--color-accent); font-family: var(--font-body); font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: 2px; font-weight: 700;
    transform: translateY(16px); transition: transform 0.4s ease 0.05s;
}
.cap-title {
    color: var(--color-white); font-size: 1.4rem; font-style: italic; font-weight: 400;
    margin-top: 6px;
    transform: translateY(16px); transition: transform 0.4s ease 0.1s;
}
.cap-rule {
    display: block; width: 0; height: 1px; background: var(--color-accent);
    margin: 12px 0; transition: width 0.5s ease 0.2s;
}
.cap-quote {
    font-family: var(--font-heading); font-style: italic; font-size: 0.85rem;
    color: #e8e8e8; margin-bottom: 10px; line-height: 1.4;
    opacity: 0; transform: translateY(12px); transition: opacity 0.4s ease 0.25s, transform 0.4s ease 0.25s;
}
.cap-features {
    font-size: 0.72rem; color: #ccc; line-height: 1.7;
    opacity: 0; transform: translateY(12px); transition: opacity 0.4s ease 0.3s, transform 0.4s ease 0.3s;
}
.cap-features li { position: relative; padding-left: 14px; }
.cap-features li::before { content: '\2022'; color: var(--color-accent); position: absolute; left: 0; }

.gallery-item:hover .cap-category,
.gallery-item:hover .cap-title,
.gallery-item:focus-within .cap-category,
.gallery-item:focus-within .cap-title { transform: translateY(0); }

.gallery-item:hover .cap-rule,
.gallery-item:focus-within .cap-rule { width: 40px; }

.gallery-item:hover .cap-quote,
.gallery-item:hover .cap-features,
.gallery-item:focus-within .cap-quote,
.gallery-item:focus-within .cap-features { opacity: 1; transform: translateY(0); }

/* --- Category Gallery Modal (Masonry Layout) --- */
.category-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(10, 10, 10, 0.98);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.category-modal.active {
    opacity: 1;
    visibility: visible;
}

.category-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.category-modal-header h3 {
    color: var(--color-accent);
    font-size: 1.5rem;
    font-style: italic;
    text-transform: capitalize;
}

.category-modal-close {
    background: transparent;
    border: none;
    color: var(--color-white);
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease;
}
.category-modal-close:hover {
    color: var(--color-accent);
}

.category-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    position: relative;
}

/* CSS Columns for flexible Masonry effect */
.category-gallery-grid {
    column-count: 3;
    column-gap: 20px;
}
.category-gallery-grid img {
    width: 100%;
    height: auto; /* Allows height to flex based on image aspect ratio */
    display: block;
    margin-bottom: 20px; /* Space beneath images */
    break-inside: avoid; /* Prevents an image from being split across columns */
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}
.category-gallery-grid img:hover {
    transform: scale(1.02);
}

.modal-loader {
    color: var(--color-white);
    text-align: center;
    font-size: 1.2rem;
    font-style: italic;
    margin-top: 50px;
}
.modal-empty-state {
    color: var(--color-gray);
    text-align: center;
    font-size: 1.1rem;
    margin-top: 50px;
}

/* --- Back to top --- */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--color-dark);
    color: var(--color-accent);
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, border-color 0.3s ease;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { border-color: var(--color-accent); }

/* --- Contact Layout --- */
.contact-wrapper { max-width: 800px; margin: 0 auto; padding: clamp(40px, 8vw, 80px) 20px; text-align: center; }
.contact-wrapper h3 { font-size: clamp(2.5rem, 6vw, 3.5rem); font-weight: 400; font-style: italic; margin-bottom: 15px;}
.contact-wrapper > p { color: var(--color-gray); margin-bottom: 50px; font-size: clamp(0.9rem, 2vw, 1rem); max-width: 600px; margin-inline: auto; font-weight: 300; line-height: 1.8;}
.contact-grid { display: flex; justify-content: center; flex-wrap: wrap; gap: clamp(30px, 5vw, 60px); margin-bottom: 60px; }
.contact-item { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1 1 200px; min-width: 0;}
.contact-item span { color: var(--color-accent); text-transform: uppercase; font-weight: 700; font-size: 0.75rem; letter-spacing: 3px; }
.contact-item a, .contact-item p { font-family: var(--font-heading); font-size: clamp(1.2rem, 3vw, 1.4rem); font-style: italic; transition: color 0.3s ease; color: var(--color-white); word-break: break-word; }
.contact-item a:hover { color: var(--color-accent); }

footer { background: #050505; color: #444; text-align: center; padding: 30px 20px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 1024px) {
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }

    /* Video block already gets tight below 60% flex-basis here; drop the
       fixed min-width a little early so it never fights the playlist. */
    .main-video-wrapper { min-width: 260px; }

    /* Masonry adjusts to 2 columns on tablets */
    .category-gallery-grid { column-count: 2; }
}

@media (max-width: 768px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 15px;}

    header { padding: 20px; }
    header.scrolled { padding: 15px 20px; }

    .menu-toggle { display: flex; }

    .nav-links { position: fixed; top: 0; right: -100%; height: 100dvh; width: 100%; background: rgba(10, 10, 10, 0.98); backdrop-filter: blur(10px); flex-direction: column; align-items: center; justify-content: center; transition: right 0.4s ease-in-out; }
    .nav-links.active { right: 0; }
    .nav-links a { color: var(--color-white); font-family: var(--font-heading); font-style: italic; font-size: 2rem; padding: 15px; display: block; text-transform: capitalize; letter-spacing: 1px;}

    .menu-toggle.active .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .menu-toggle.active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.active .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* --- MOBILE FIX: video gallery ---
       The desktop layout puts the player and playlist side-by-side using
       percentage flex-basis, and the player also carries a fixed
       min-width: 300px. On narrow phones that min-width no longer fits
       next to the playlist, so the row overflows and gets silently
       clipped by body{overflow-x:hidden}. Forcing a full-width flex
       COLUMN here removes the min-width conflict entirely — every child
       is simply 100% of the available width. */
    .video-gallery-container {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }
    .main-video-wrapper {
        width: 100%;
        min-width: 0;
        flex: 1 1 auto;
    }
    .video-playlist {
        width: 100%;
        min-width: 0;
        flex: 1 1 auto;
        max-height: none;
        flex-direction: row;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    .vid-thumb { flex: 0 0 auto; flex-direction: column; align-items: flex-start; width: 140px;}
    .vid-thumb img { width: 100%; height: 80px; }

    /* On touch devices hover can't reveal captions — show them permanently instead */
    .gallery-caption {
        opacity: 1;
        background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.15) 70%, transparent 100%);
    }
    .cap-category, .cap-title, .cap-quote, .cap-features { opacity: 1; transform: translateY(0); }
    .cap-rule { width: 32px; }
    .gallery-item:hover img, .gallery-item:focus-within img { opacity: 0.5; }

    .back-to-top { right: 16px; bottom: 16px; width: 42px; height: 42px; }

    /* Modal Mobile Overrides */
    .category-modal-header { padding: 15px 20px; }
    .category-modal-body { padding: 20px; }

    /* Masonry adjusts to 1 column on mobile */
    .category-gallery-grid { column-count: 1; }
}

@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: 1fr; }

    .logo .vr { font-size: 1.5rem; }
    .logo .text { font-size: 0.6rem; letter-spacing: 2px;}

    /* Extra breathing room removed on very small screens so nothing
       needs more width than it actually has. */
    .video-gallery-container { padding: 12px; }
    .vid-thumb { width: 120px; }
}