:root {
    --bg-color: #0c0c0e;
    --bg-color-alt: #131316;
    --text-primary: #f2f2f2;
    --text-secondary: #a0a0a0;
    --accent-color: #e52836;
    --border-soft: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.15);
    --font-main: 'Inter', sans-serif;
    --font-serif: 'Playfair Display', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1,
h2,
h3,
p,
a {
    text-rendering: optimizeLegibility;
}

/* Background Texture and Dynamic Ambient Light */
.gallery-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
    background-color: var(--bg-color);
}

.noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 10;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: drift 25s infinite alternate ease-in-out;
}

.ambient-orb.light-red {
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background-color: var(--accent-color);
    animation-delay: 0s;
}

.ambient-orb.dark-red {
    bottom: -20%;
    right: -10%;
    width: 70vw;
    height: 70vw;
    background-color: #550a10;
    animation-delay: -10s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(5%, 10%) scale(1.1);
    }
}

/* Base Loader */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    z-index: 9999;
    transition: opacity 1s ease;
    pointer-events: none;
}

.loader-overlay.hidden {
    opacity: 0;
}

/* Hero Section */
.hero {
    height: 150px;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    text-align: center;
    border-bottom: 1px solid var(--border-soft);
    z-index: 1000;
    background: rgba(12, 12, 14, 0.85);
    /* Semitransparente grafite */
    backdrop-filter: blur(12px);
    transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero.scrolled {
    height: 100px;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    opacity: 1;
    /* Retirado o fadeUp para não ocultar o header fixo no início */
}

.hero-exhibit-label {
    font-size: 0.65rem;
    letter-spacing: 4px;
    color: var(--accent-color);
    margin-bottom: 0px;
    font-weight: 500;
    transition: margin-bottom 0.5s ease, font-size 0.5s ease;
}

.hero.scrolled .hero-exhibit-label {
    margin-bottom: 0.2rem;
    font-size: 0.55rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -1px;
    margin-bottom: 0px;
    font-weight: 300;
    transition: font-size 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero.scrolled .hero-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.accent {
    color: var(--accent-color);
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--text-secondary);
    font-style: italic;
    letter-spacing: 1px;
    transition: font-size 0.5s ease;
}

.hero.scrolled .hero-subtitle {
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
}

/* Ocultar elementos desnecessários no header fixo compacto */
.hero-line,
.scroll-indicator {
    display: none;
}

/* Masonry Gallery */
.gallery-section {
    padding: 180px 5vw 8vw 5vw;
    /* Acomoda o header fixo no topo */
    min-height: 100vh;
    perspective: 1500px;
    /* Cria profundidade para as imagens caindo */
}

.masonry-grid {
    column-count: 4;
    /* Atualizado para pelo menos 4 colunas */
    column-gap: 2rem;
}

@media (max-width: 1400px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 900px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .masonry-grid {
        column-count: 1;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 2.5rem;
    position: relative;
    cursor: pointer;
    opacity: 0;

    transform: scale(1.1) translateY(20px);
    transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 1.2s ease;
}

.masonry-item.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Espaçamento elegante de Frases injetadas dinamicamente na Galeria */
.phrase-item {
    padding: 4rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: transparent;
    border: none;
    box-shadow: none;
    position: relative;
    cursor: default;
}

.phrase-item::before {
    content: '“';
    position: absolute;
    top: 5px;
    left: 20px;
    font-size: 5rem;
    color: var(--accent-color);
    font-family: var(--font-serif);
    opacity: 0.15;
    line-height: 1;
    pointer-events: none;
}

.phrase-content {
    font-family: var(--font-serif);
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--text-primary);
    font-style: italic;
    line-height: 1.6;
    z-index: 1;
    position: relative;
}

/* Elegant Picture Frame */
.gallery-frame {
    position: relative;
    padding: 12px;
    background-color: var(--bg-color-alt);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: border-color 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.masonry-item:hover .gallery-frame {
    border-color: var(--border-highlight);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.masonry-item img {
    width: 100%;
    display: block;
    border-radius: 2px;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease;
    filter: grayscale(20%) brightness(0.9) contrast(1.1);
}

.masonry-item:hover img {
    transform: scale(1.02);
    filter: grayscale(0%) brightness(1) contrast(1);
}

.overlay {
    position: absolute;
    inset: 12px;
    /* Matches frame padding */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 2rem;
    pointer-events: none;
    z-index: 2;
}

.masonry-item:hover .overlay {
    opacity: 1;
}

.overlay-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
}

.masonry-item:hover .overlay-icon {
    transform: translateY(0);
}

/* Subtitles like a museum plaque */
.gallery-caption {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
}

.plaque-title {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
}

.plaque-number {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--accent-color);
    font-weight: 500;
}

/* Footer Section */
.footer {
    padding: 8vw 5vw 4vw;
    text-align: center;
    border-top: 1px solid var(--border-soft);
    position: relative;
}

.footer-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--border-highlight), transparent);
}

.footer h2 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 4rem;
    font-style: italic;
    font-weight: 300;
    color: var(--text-primary);
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem;
    align-items: center;
    margin-bottom: 5rem;
}

.contact-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    transition: color 0.3s ease;
}

.link-label {
    font-size: 0.75rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.link-value {
    color: var(--text-secondary);
    font-weight: 300;
    transition: color 0.3s ease;
}

.contact-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background: var(--border-highlight);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-link:hover .link-value {
    color: #fff;
}

.contact-link:hover::after {
    width: 100%;
}

.copyright {
    color: #444;
    font-size: 0.85rem;
}

/* Navegação Principal */
.main-nav {
    display: flex;
    gap: 3rem;
    margin-top: 0.5rem;
    position: relative;
    z-index: 10;
}

.nav-link {
    font-family: var(--font-main);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: color 0.3s ease;
    padding-bottom: 6px;
    position: relative;
}

.nav-link.active,
.nav-link:hover {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-link.active::after,
.nav-link:hover::after {
    width: 100%;
}

.hero.scrolled .main-nav {
    margin-top: 1rem;
    transform: scale(0.9);
    transition: transform 0.5s ease;
}

/* Lightbox Elegante */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(6, 6, 8, 0.95);
    /* Fundo bem escuro e liso */
    backdrop-filter: blur(10px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    cursor: pointer;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-overlay.active .lightbox-content {
    transform: scale(1);
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border: 5px solid #fff;
    /* Borda solicitada */
    border-radius: 2px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    cursor: default;
}

/* Artistas Atendidos no Rodapé */
.artists-section {
    margin-top: -1rem;
    margin-bottom: 6rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.artists-title {
    font-family: var(--font-main);
    font-size: 0.85rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 3.5rem;
}

.artists-grid {
    display: grid;
    /* Grid de alinhamento perfeito para logos */
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 3.5rem 2rem;
    max-width: 1000px;
    width: 100%;
    align-items: center;
    justify-items: center;
}

.artist-logo {
    max-width: 100px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.5;
    /* Translucidez elegante */
    transition: opacity 0.4s ease, transform 0.4s ease;
    filter: grayscale(100%);
    cursor: default;
}

.artist-logo:hover {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.05);
}