﻿:root {
    --bg-color: #0a0a0a;
    --text-main: #e0e0e0;
    --text-muted: #888;
    --accent: #c5a059;
    /* Muted Gold */
    --font-serif: "Didot", "Bodoni MT", "Times New Roman", serif;
    --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    user-select: none;
    /* Prevent selection during drag */
}

/* Noise Texture */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1000;
    opacity: 0.4;
}

/* Subtle Gradient Background */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 30%, #1a1a1a 0%, #000000 90%);
    z-index: -1;
}

header {
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
    animation: fadeReveal 1.5s ease-out forwards;
    /* Full Screen Layout */
    min-height: 90vh;
    /* Leave a hint of content or use 100vh */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    font-family: var(--font-serif);
    font-size: 4rem;
    font-weight: 300;
    margin: 0 0 1.5rem 0;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    position: relative;
    display: inline-block;
}

h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: var(--accent);
    margin: 1.5rem auto 0;
}

.subtitle {
    font-family: var(--font-sans);
    color: var(--text-muted);
    letter-spacing: 0.6em;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-top: 1rem;
}

/* Gallery Grid */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 5rem 4rem;
    padding: 0 6rem 8rem;
    max-width: 1800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

@media (max-width: 1024px) {
    .gallery-container {
        padding: 0 3rem 6rem;
        gap: 3rem 2rem;
    }
}

@media (max-width: 600px) {
    .gallery-container {
        grid-template-columns: 1fr;
        padding: 0 1.5rem 4rem;
    }

    h1 {
        font-size: 2.5rem;
    }
}

.art-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
}

/* Realistic Framed Art CSS */
.art-image-wrapper {
    position: relative;
    width: 100%;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s;
    background-color: #0d0d0d;
    padding: 12px;
    border: 1px solid #222;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), 0 15px 35px rgba(0, 0, 0, 0.3);
}

.art-image-wrapper::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 2;
}

.art-image-wrapper:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 40px 80px rgba(0, 0, 0, 0.4);
    border-color: #333;
}

.art-image {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(0.98) contrast(1.02);
    transition: filter 0.4s;
}

.art-image-wrapper:hover .art-image {
    filter: brightness(1.05) contrast(1.05);
}

.art-info {
    margin-top: 1.5rem;
    text-align: center;
    width: 100%;
}

.art-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    font-weight: 400;
    color: #fff;
    margin: 0 0 0.4rem;
}

.art-meta {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.art-year {
    font-size: 0.75rem;
    color: var(--accent);
    margin-top: 0.3rem;
    font-family: var(--font-serif);
    font-style: italic;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(5px);
}

/* Lightbox Navigation */
.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #fff;
    font-size: 2rem;
    opacity: 0.6;
    transition: opacity 0.3s, background 0.3s;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2100;
    user-select: none;
}

.lb-nav:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.6);
}

.lb-prev {
    left: 2rem;
}

.lb-next {
    right: 2rem;
}

@media (max-width: 768px) {
    .lb-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .lb-prev {
        left: 1rem;
    }

    .lb-next {
        right: 1rem;
    }
}


/* Room Thumbnail Navigation */
.room-thumbs {
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 12px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    margin-right: 15px;
}

.room-thumb-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    /* overflow: hidden; Removed to allow tooltip to show */
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all 0.3s;
    position: relative;
}

.room-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    /* moved here */
}

.room-thumb-item:hover {
    opacity: 1;
    transform: scale(1.1);
}

.room-thumb-item.active {
    border-color: #fff;
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.room-thumb-tooltip {
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.room-thumb-item:hover .room-thumb-tooltip {
    opacity: 1;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 65vh;
    /* Reduced from 80vh to allow space for caption */
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    object-fit: contain;
}

.lightbox.active .lightbox-img {
    transform: scale(1);
}

.lightbox-caption {
    margin-top: 1.5rem;
    /* Reduced from 2rem */
    text-align: center;
    color: #fff;
    animation: fadeReveal 0.8s 0.3s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
    flex-shrink: 0;
    /* Prevent caption shrinking */
}

.lb-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    /* Slightly smaller */
    font-weight: 300;
    margin-bottom: 0.3rem;
    letter-spacing: 0.1em;
}

.lb-detail {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Updated to Center Button */
.lightbox-btn-group {
    margin-top: 1.5rem;
    /* Reduced from 2rem */
    display: flex;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    animation: fadeReveal 0.8s 0.5s ease-out forwards;
}

.btn {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-main);
    padding: 0.8em 1.5em;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 2px;
}

.btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(197, 160, 89, 0.1);
}

.close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: var(--text-muted);
    font-size: 3rem;
    font-weight: 100;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
    line-height: 0.5;
    font-family: var(--font-sans);
    z-index: 2001;
}

.close-btn:hover {
    color: #fff;
    transform: rotate(90deg);
}

/* 
   --- NEW ROOM VIEW LOGIC ---
*/
#room-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #111;
    z-index: 2500;
    display: none;
    overflow: hidden;
    /* Camera Viewport */
    cursor: grab;
    /* Pan View */
}

#room-view.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

/* The Virtual World Container */
#scene-world {
    position: absolute;
    top: 50%;
    left: 50%;
    will-change: transform, width, height;
    background-size: cover;
    background-position: center;
    transform-origin: center center;
    box-shadow: 0 0 200px rgba(0, 0, 0, 0.8);
    transition: width 0.5s ease, height 0.5s ease, background-image 0.5s ease;
}

/* Art Container on Wall */
#room-art-container {
    position: absolute;
    /* Size set by JS based on cm dimensions */
    transform: translate(-50%, -50%);
    cursor: move;
    /* Drag Art */
    /* Realistic Shadow for "Hanging" Art */
    box-shadow: 10px 20px 50px rgba(0, 0, 0, 0.6);
    /* REMOVED TRANSITION FOR INSTANT DRAG */
    will-change: top, left;
}

#room-art {
    width: 100%;
    height: 100%;
    /* Fill container */
    display: block;
    pointer-events: none;
    /* Default Frame - Will be set by JS */
    border: 1.5px solid #111;
    box-sizing: border-box;
}

.room-controls {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem 2rem;
    border-radius: 40px;
    backdrop-filter: blur(10px);
    z-index: 2600;
    pointer-events: auto;
    /* Ensure clickable over dragging area */
}

.room-controls input[type="file"] {
    display: none;
}

#room-guide {
    position: absolute;
    top: 2rem;
    left: 0;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    z-index: 2600;
}

/* NEW: INFO OVERLAY BOX */
.room-info-overlay {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    width: 250px;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(8px);
    padding: 1.5rem;
    border-left: 2px solid var(--accent);
    color: #fff;
    z-index: 2600;
    pointer-events: none;
    text-align: left;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.room-info-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #fff;
    line-height: 1.2;
}

.room-info-meta {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.room-dim-info {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    color: var(--accent);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Mobile Optimizations for Room View */
@media (max-width: 768px) {
    #room-guide {
        font-size: 0.7rem;
        top: 10px;
        padding: 0 50px;
        /* Avoid Close Button */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        opacity: 0.7;
    }

    /* Change text for mobile via ::after hack or just hide/simplify */
    #room-guide {
        content: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
        /* Clear text */
        height: 20px;
    }

    #room-guide::after {
        content: "Drag to Move · Pinch to Zoom";
        display: block;
        text-align: center;
        width: 100%;
    }

    .room-controls {
        width: 90%;
        padding: 1rem;
        flex-direction: column;
        gap: 10px;
        bottom: 1rem;
        align-items: center;
    }

    .room-thumbs {
        margin-right: 0;
        margin-bottom: 5px;
        justify-content: center;
        flex-wrap: wrap;
    }

    #frame-btn,
    .room-controls .btn {
        padding: 0.6em 1em;
        font-size: 0.75rem;
        flex: 1;
        width: 100%;
        text-align: center;
    }

    /* Make buttons distinct row */
    .room-controls button,
    .room-controls label {
        /* label for input[type=file] trigger if we had one, but button triggers it. */
        display: block;
    }

    /* Container for buttons to sit side-by-side */
    .room-controls-buttons {
        display: flex;
        gap: 8px;
        width: 100%;
        justify-content: center;
    }

    /* Wrap existing buttons in a flex container via JS? 
       Or just use flex-wrap on .room-controls with different order.
       Let's stick to flex-wrap on .room-controls and button sizing.
    */
    .room-controls {
        flex-direction: row;
        /* Keep row but wrap */
        flex-wrap: wrap;
        justify-content: center;
    }

    .room-thumbs {
        width: 100%;
        justify-content: center;
        order: -1;
        /* Thumbnails on top */
    }

    /* Info box smaller and top-left or hidden? */
    .room-info-overlay {
        top: 1rem;
        bottom: auto;
        left: 1rem;
        width: auto;
        max-width: 60%;
        padding: 1rem;
        background: rgba(0, 0, 0, 0.4);
    }

    .room-info-title {
        font-size: 1rem;
    }

    .room-info-meta {
        display: none;
    }

    /* Hide details on mobile to save space */
    .room-dim-info {
        display: none;
    }

    .close-btn {
        top: 1rem;
        right: 1rem;
        font-size: 2.5rem;
    }
}



/* 
   --- CUSTOM CURSOR --- 
*/
#cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border: 1px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: width 0.3s, height 0.3s, background-color 0.3s, transform 0.1s;
    will-change: top, left, width, height;
}

#cursor.hover {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.2);
    border-color: transparent;
}

#cursor.hidden {
    opacity: 0;
}

/* Hide Default Cursor on Desktop when not touch */
@media (hover: hover) and (pointer: fine) {

    body,
    a,
    button,
    .art-image-wrapper,
    .room-thumb-item,
    .lb-nav,
    .close-btn {
        cursor: none !important;
    }
}

/* Hide Custom Cursor on Mobile */
@media (hover: none) {
    #cursor {
        display: none;
    }
}

/* Frame Style Indicator */
#frame-btn span {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border: 1px solid #666;
    vertical-align: middle;
}

/* 
   --- INTRO & LOADING --- 
*/
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    transition: opacity 1.5s ease-out, visibility 1.5s;
}

#intro-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-content {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.intro-content.show {
    opacity: 1;
    transform: translateY(0);
}

.intro-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1rem;
    letter-spacing: 0.2em;
}

.intro-subtitle {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.4em;
    font-size: 1rem;
    color: #888;
    margin-bottom: 2.5rem;
    letter-spacing: 2px;
}

.intro-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.enter-btn {
    padding: 15px 40px;
    background: transparent;
    border: 1px solid #c5a059;
    color: #c5a059;
    font-family: inherit;
    font-size: 1rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.5s ease;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 2s 1s ease-out forwards;
}

.secondary-btn {
    background: rgba(197, 160, 89, 0.1);
    /* Subtle fill for 3D button */
}

.enter-btn:hover {
    background: #c5a059;
    color: #000;
    box-shadow: 0 0 20px rgba(197, 160, 89, 0.3);
}

/* Animations Triggered Only When Active */
body.exhibition-active header {
    animation: fadeReveal 1.5s ease-out forwards;
}

.header-logo {
    width: 140px;
    height: 140px;
    display: block;
    margin: 0 auto 1.5rem;
    opacity: 0.9;

    /* Crop disabled */
    /* clip-path: circle(34% at 50% 50%); */

    /* No blend mode needed as image is transparent, but crop is needed */
    object-fit: contain;
}

.intro-logo {
    width: 220px;
    height: 220px;
    display: block;
    margin: 0 auto 2rem;
    opacity: 0;
    animation: fadeReveal 1s ease-out forwards;

    /* Crop disabled */
    /* clip-path: circle(34% at 50% 50%); */

    object-fit: contain;
}

/* Disable initial animations (moved control to JS adding class) */
header {
    opacity: 0;
}

/* Loading Spinner Text */
.loader-text {
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: pulse 2s infinite;
    position: absolute;
    bottom: 10%;
}

@keyframes fadeReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0.3;
    }
}

#ambient-light {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    /* Below controls (z-index usually higher) but above world */
    mix-blend-mode: overlay;
    background: radial-gradient(circle 800px at var(--lx, 50%) var(--ly, 50%),
            rgba(255, 255, 255, 0.15) 0%,
            rgba(0, 0, 0, 0) 40%,
            rgba(0, 0, 0, 0.4) 100%);
    transition: background 0.1s;
    opacity: 0.8;
}

/* Top Navigation Group */
.top-nav-group {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;
}

/* Social Icons */
.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c5a059;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.social-icon:hover {
    opacity: 1;
    transform: scale(1.1);
    color: #fff;
    filter: drop-shadow(0 0 5px rgba(197, 160, 89, 0.6));
}

/* New Header 3D Button */
.header-3d-btn {
    /* Removed absolute pos, now in group */
    /* top: 20px; right: 20px; */
    padding: 8px 20px;
    border: 1px solid #c5a059;
    color: #c5a059;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.1em;
}

.header-3d-btn:hover {
    background: #c5a059;
    color: #000;
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.4);
}

/* Scroll Navigation */
.scroll-nav {
    position: fixed;
    bottom: 30px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.scroll-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #c5a059;
    color: #c5a059;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

/* Only apply hover effects on mouse-capable devices */
@media (hover: hover) {
    .scroll-btn:hover {
        background: #c5a059;
        color: #000;
        transform: translateY(-2px);
        box-shadow: 0 0 15px rgba(197, 160, 89, 0.4);
    }
}

/* Dynamic feedback for touch devices */
.scroll-btn:active {
    background: #c5a059;
    color: #000;
    transform: scale(0.9);
    transition: all 0.1s;
}

/* Header Exhibition Info */
.header-info-divider {
    width: 40px;
    height: 1px;
    background: #c5a059;
    margin: 15px auto 10px;
    opacity: 0.6;
}

.header-info {
    font-family: var(--font-sans);
    color: #aeaeae;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    margin-top: 5px;
    opacity: 0.9;
}

/* Copyright Footer */
.copyright-footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--accent);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    opacity: 0.6;
    margin-top: 4rem;
}

/* --- INDEX SPECIFIC STYLES --- */

/* One-Page Scroll Presentation Styles (Index Only) */
*,
*::before,
*::after {
    box-sizing: border-box;
    /* Prevent padding overflow */
}

body {
    overflow: hidden;
    background-color: #050505;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
}

/* Essential for full screen isolation */
.slide-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* Slides - Unified Selector for all full-screen slides */
header,
.art-item,
#poem-slide,
#poem-slide-2,
#poem-slide-3,
#poem-slide-4,
#poem-slide-5 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    margin: 0 !important;
    padding: 3rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease-in-out;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    overflow: hidden;
}

header.active,
.art-item.active,
#poem-slide.active,
#poem-slide-2.active,
#poem-slide-3.active,
#poem-slide-4.active,
#poem-slide-5.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 20;
}

/* Social Links - Keep them fixed and visible/accessible */
.top-nav-group {
    position: fixed !important;
    top: 1.5rem !important;
    right: 1.5rem !important;
    z-index: 1000;
    display: flex;
    gap: 1.2rem;
    opacity: 1 !important;
    /* Always visible or use JS to toggle */
    pointer-events: auto !important;
}

/* Gallery Container override */
.gallery-container {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* Artwork Presentation */
.art-image-wrapper {
    flex: 0 1 auto;
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 75vh;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
    margin-bottom: 2vh;
}

.art-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.art-info {
    flex: 0 0 auto;
    margin-top: 1rem;
    text-align: center;
    max-width: 800px;
    background: none !important;
    /* Cleaner look */
    backdrop-filter: none !important;
}

/* Fix Header items */
header .header-logo {
    margin-bottom: 1.5rem;
}

header hr,
header .header-info-divider {
    margin: 1.5rem auto !important;
}

/* Scroll Navigation */
.scroll-nav {
    display: flex !important;
    /* Restore Visibility */
    z-index: 1000;
}

/* Animation Reset */
header,
.art-item,
#poem-slide,
#poem-slide-2,
#poem-slide-3,
#poem-slide-4,
#poem-slide-5 {
    animation: none !important;
}

/* Golden Shine Animation */
header h1 {
    background: linear-gradient(90deg,
            #c5a059 0%,
            #c5a059 33%,
            #fff 50%,
            #c5a059 67%,
            #c5a059 100%);
    background-size: 300% 100%;
    background-repeat: repeat-x;
    color: transparent !important;
    -webkit-background-clip: text;
    background-clip: text;
    background-position: 100% center;
    transition: background-position 0s;
}

header.active h1 {
    animation: golden-shine 1.5s linear 1.2s forwards !important;
}

@keyframes golden-shine {
    from {
        background-position: 100% center;
    }

    to {
        background-position: 0% center;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
        letter-spacing: 0.2em;
    }

    .subtitle {
        font-size: 0.65rem;
        letter-spacing: 0.3em;
    }

    .header-info {
        font-size: 0.65rem;
        padding: 0 1rem;
        line-height: 1.8;
    }

    .mobile-br {
        display: block !important;
        height: 0.3rem;
    }

    .poem-wrap {
        font-size: 0.95rem;
        line-height: 2.4;
        padding: 1.5rem 0.5rem;
        /* Reduced horizontal padding */
        letter-spacing: 0.15em;
    }

    .art-item {
        padding: 1rem;
    }

    .art-image-wrapper {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 70vh !important;
        box-shadow: none;
        margin-bottom: 1rem;
    }

    .art-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .art-info {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }

    .top-nav-group {
        top: 1rem !important;
        right: 1rem !important;
        gap: 0.8rem;
    }

    .desktop-sep {
        display: none !important;
    }
}

/* Poem Specific */
.poem-wrap {
    font-family: var(--font-serif);
    color: var(--accent);
    text-align: center;
    line-height: 2.8;
    letter-spacing: 0.25em;
    font-size: 1.15rem;
    width: 100vw;
    padding: 2rem 1rem;
    /* Reduced horizontal padding */
    transform: translateY(-5vh);
    /* Shift everything up slightly */
}

.poem-row {
    margin-bottom: 1.2rem;
    width: 100%;
    display: block;
}

.poem-fading-group {
    opacity: 1;
    transition: opacity 0s 2s;
    /* Delay the return to visibility to prevent flash */
    display: block;
    width: 100%;
}

.active .poem-fading-group {
    opacity: 0;
    transition: opacity 1s ease-in-out 5s;
}

.poem-segment {
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    display: inline-block;
    white-space: pre-wrap;
}

.active .poem-segment {
    opacity: 1;
}