@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,700;1,700&display=swap');

* {
    box-sizing: border-box;
}

:root {
    --schz-black: #030902;
    --schz-white: #f1f1f1;
    --schz-red: #af1d24;
    --schz-red-dark: #710303;
}

html {
    scrollbar-color: var(--schz-red-dark) transparent;
    scrollbar-width: auto;
}

::-webkit-scrollbar {
    width: 10px;
    background: transparent; 
}

::-webkit-scrollbar-track {
    background: transparent;
    border: none;
}

::-webkit-scrollbar-button {
    display: none; 
    background: transparent; 
}

::-webkit-scrollbar-thumb {
    background: var(--schz-red-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--schz-red);
}

.copyright-notice {
    position: fixed;
    bottom: 2vmin;
    left: 2vmin;
    color: var(--schz-red);
    text-align: center;
    font-size: 2vmin !important;

    z-index: 50;
}

.instagram-link {
    position: fixed;
    bottom: 2vmin;
    right: 2vmin;

    z-index: 50;
}

.instagram-link img {
    width: 4vmin; /* Scales with screen size */
    height: auto;

    transform: scale(1.0);
    filter: drop-shadow(0 0 8px color-mix(in srgb, var(--schz-red), transparent 100%));

    transition: all 0.2s ease-in-out;

    cursor: pointer;
}

.instagram-link img:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px color-mix(in srgb, var(--schz-red), transparent 70%)) brightness(0.9);
}

body {
    margin: 2%;
    padding: 0;

    background-image: url("https://ik.imagekit.io/schzstrg/tr:w-1200,q-100/plasterwall.jpg");
    background-repeat: repeat;

    background-size: 50% auto;
}

.header {
    position: relative;
    text-align: center;

    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;

    color: var(--schz-red);
}

.header-image {
    width: 50%;
    height: auto;
}

.header-title, .copyright-notice {
    font-size: 2.5em;
    margin-top: -0.5vh;

    font-family: Times, 'Times New Roman', serif;

    text-shadow: 2px 2px 4px rgba(113, 3, 3, 0.5);
}

.main {
    width: 60%; 
    
    margin: 0 auto; 

    padding: 3% 3% 3% 3%;
    
    min-height: 100vh; 
    
    position: relative;
}

.image-row {
    position: relative;
    display: flex;
    flex-wrap: nowrap;

    justify-content: space-between; 
    
    align-items: center; 
    width: 100%;
    height: auto;
    
    padding-bottom: 3%;
}

.image-row img {
    width: calc((100% - 6%) / 3); 
    height: auto;
    
    display: block;

    filter: drop-shadow(6px 6px 32px rgba(0, 0, 0, 0.3));

    cursor: pointer;
    transition: transform 0.2s ease-in-out, filter 0.2s ease-in-out;
}

.image-row img:hover {

    filter: drop-shadow(12px 12px 48px rgba(0, 0, 0, 0.5)) brightness(1.1);
    transform: scale(1.05);
    
}

.image-row img:active {
    filter: drop-shadow(0px 0px 0px rgba(0, 0, 0, 0.0)) brightness(0.8);
    transform: scale(0.8);
}

.custom-tooltip {
    position: fixed;
    
    pointer-events: none; 
    
    background-color: var(--schz-white);

    mix-blend-mode: difference;
    
    border: .275vmin solid var(--schz-red-dark);
    padding: 5px 10px;
    
    opacity: 0;

    filter: drop-shadow(.7vmin .7vmin .2vmin rgba(11, 11, 11, 1));

    transition: opacity 0.2s ease-in-out;

    transform: translate(-50%, -115%); 
}

.custom-tooltip span {

    color: var(--schz-red);

    text-shadow: .15vmin .15vmin .2vmin rgba(3, 58, 113, 0.5);
    font-family: 'Inter', "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 2vmin;
}

.viewer-body {
    overflow: hidden;
}

.has-alts {
    overflow-y: auto;
}

.loading-overlay {

    --transition-time-ms: 450;
    position: fixed;

    display: flex;
    justify-content: center;
    align-items: center;

    top: 0%;
    left: 0%;
    
    width: 100%;
    height: 100%;

    z-index: 100;

    opacity: 1;
    background-color: var(--schz-black);
    color: var(--schz-white);

    transition: all calc(var(--transition-time-ms) * 1ms) ease-out;

    font-family: 'Inter', "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 2.5vw;
    letter-spacing: -0.05em;
    text-transform: uppercase;
    text-align: left;
}

.loading-overlay[style*="opacity: 0"] {
    pointer-events: none;
}

.loading-overlay.hide {
    display: none;
}

#return {
    font-family: 'Inter', "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: bold;
    font-size: 1.75vmin;
}

.main-container {
    position: relative;

    display: flex;
    flex-direction: row;
    align-items: center;

    gap: 7.5%;

    width: 100%;
    
    margin: 0 auto; 

    padding: 3% 3% 3% 3%;

    perspective: 1500px;
}

#image-frame {
    width: 45vw; 
    max-width: 80vh; 
    height: auto;
    
    --mouse-x: 0;
    --mouse-y: 0;
    --tilt-intensity: 4deg;
    
    transform: 
        rotateX(calc(var(--mouse-y) * var(--tilt-intensity))) 
        rotateY(calc(var(--mouse-x) * var(--tilt-intensity)));
    
    /* Keep it snappy while moving, but smooth */
    transition: transform 0.1s ease-out, filter 0.1s ease-out;
    transform-style: preserve-3d;
    
    /* BONUS: Dynamic lighting! The shadow moves opposite to the tilt, making it look real */
    filter: drop-shadow(
        calc(var(--mouse-x) * -15px + 6px) 
        calc(var(--mouse-y) * 15px + 6px) 
        32px rgba(0, 0, 0, 0.4)
    );

    position: relative;
    overflow: hidden;
}

/* The Shine / Glint Layer */
#image-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* The core light effect: a soft, radial white gradient */
    background: radial-gradient(
        circle at calc(var(--mouse-x) * 50% + 50%) calc(var(--mouse-y) * -50% + 50%),
        rgba(255, 255, 255, 0.4) 0%, /* Adjusted for softer light */
        rgba(255, 255, 255, 0) 60%
    );

    /* The Opacity: Light is off (0) by default, and goes up to 0.7 max when tilted */
    opacity: calc(var(--tilt-factor) * 0.7);
    
    /* Mix Mode: 'screen' or 'overlay' are perfect for "lighting up" effects */
    mix-blend-mode: screen;
    
    /* Smoothes out the light movement */
    transition: opacity 0.3s ease-out;
    pointer-events: none; /* VERY IMPORTANT: Let clicks pass through standard image */
}

/* 3. The resting state for when you take your hands off it */
#image-frame.resting {
    /* Slower transition so it smoothly floats back to dead center */
    transition: transform 0.25s ease-out, filter 0.5s ease-out;
}

#main-image {
    width: 100%;
    height: auto;
    display: block;
}

#museum-card {

    line-height: 1;

    font-family: 'Inter', "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: normal;
    color: var(--schz-black);

    background: url("https://ik.imagekit.io/schzstrg/tr:w-2000,q-100/cardstock.png");
    background-repeat: no-repeat;
    background-size: auto;

    width: 30vw;
    min-height: 30vmin;
    max-height: 80vh;
    height: auto;
    
    padding: 2vmin;
    
    filter: drop-shadow(.1vmin .275vmin .55vmin rgba(0, 0, 0, 0.175));
}

#museum-card h2 {

    font-weight: normal;
    font-size: 3vmin;
    margin: 0;
    
    padding-bottom: 1vmin;
}

#museum-card h3 {

    font-weight: normal;
    font-size: 2vmin;
    margin: 0;

    padding-bottom: 0.5vmin;
}

#museum-card a, #return a {
    color: var(--schz-red-dark);
    text-decoration: underline;
    font-weight: bold;

    transition: all 0.15s ease-in-out;
}

#museum-card a:hover, #museum-card a:visited:hover, #return a:hover, #return a:visited:hover {
    color: var(--schz-red);
    text-shadow: 0 0 .2vmin color-mix(in srgb, var(--schz-red), transparent 75%);
}

#museum-card a:visited, #return a:visited {
    color: color-mix(in srgb, var(--schz-red-dark), black 20%);
}

#museum-card a:active, #return a:active, #museum-card a:active:hover, #return a:active:hover {
    color: #eaeaea;
    background-color: var(--schz-red);
    text-shadow: 0 0 .2vmin #eaeaeac0;
    transform: translateY(1px);
}

#museum-card a:focus-visible, #return a:focus-visible {
    outline: transparent;
}

#artist-name {
    font-weight: bold;
}

#art-title {
    font-weight: bold;
    font-style: italic;
}

#art-details {
    font-size: 1.5vmin !important;
}

#art-description {
    margin-top: 1vmin;
    font-size: 1.75vmin;
    line-height: 1.25;
    text-wrap: balance;
}

#gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20.125vmin, 1fr));
    gap: 2vmin;
    
    padding: 0 3% 5vmin 3%; 
    
    width: calc(45vw + 7.5% + 30vw); 
    
    box-sizing: border-box; 
}

/* NEW: The wrapper takes over the grid cell positioning and enforces the square shape */
.alt-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1; 
}

/* THE VIGNETTE LAYER applied to the wrapper */
.alt-wrapper:has(img.swapped)::after {
    content: ""; /* Mandatory for pseudo-elements to render */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* Your dark edges fade */
    background: radial-gradient(circle, rgba(0,0,0,0) 50%, rgba(0,0,0,0.8) 150%);
    
    pointer-events: none; /* Clicks pass through to the image/X button */
    z-index: 5;
}

#gallery-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crops the weird aspect ratios into perfect squares for the grid */
    transition: transform 0.2s ease, filter 0.2s ease;
    cursor: pointer;
    display: block; /* Prevents tiny ghost spacing beneath images inside divs */
}

#gallery-grid img:hover {
    transform: scale(1.02);
    filter: brightness(1.1) contrast(1.1);
}

#gallery-grid img:active {
    transform: scale(0.98);
    filter: brightness(0.9) contrast(0.9);
}

#gallery-grid img.swapped {
    opacity: 0.5;
    filter: grayscale(100%) blur(.2vmin);
    pointer-events: none;
}

/* NEW: The Self-Destructing X */
.undo-x {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    background-color: transparent;
    color: var(--schz-red-dark);
    text-shadow: 2px 2px 16px color-mix(in srgb, var(--schz-black), transparent 75%);

    font-size: 12vmin;
    font-family: monospace;
    line-height: 2px;

    width: 5vmin;
    height: 5vmin;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    z-index: 10;
    transition: all 0.2s ease-in-out;

    /* make text unselectable to make X feel more button-y */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.undo-x:hover {
    color: var(--schz-red);
    transform: translate(-50%, -50%) scale(1.1); /* The -50% -50% must stay to keep it centered while scaling */
    text-shadow: 0px 0px 16px color-mix(in srgb, var(--schz-black), transparent 50%);
}

/* =========================================
             MOBILE OVERRIDES
========================================= */
@media (max-width: 768px) {
    
    .header-image {
        width: 90% !important;
        height: auto;
    }

    .header-title {
        font-size: 4vw !important;
    }

    .main {
        width: 100% !important;
        
        margin: 0 auto; 

        padding: 3% 3% 3% 3%;
        
        min-height: 100vh;
        
        position: relative;
    }

    .custom-tooltip {
        display: none !important;
    }

    #image-frame {
        touch-action: none; 
    }

    #museum-card h2 {
        font-size: 2.75vmin;
    }

    #museum-card h3 {
        font-size: 1.75vmin;
    }   
}