/* ============================================
   continua.st - Holographic Liturgy
   A digital palazzo of accumulated vision
   ============================================ */

/* ---------- Color Reference ---------- */
/* #1A0A12 - Black Garnet (Primary Dark)
   #5A1A2E - Claret Velvet (Primary Rich)
   #3A0E1E - Oxblood Depth (Secondary Dark)
   #F2E6D8 - Parchment Cream (Warm Light)
   #C4A35A - Tarnished Gold (Accent Metallic)
   #D4A055 - Candle Amber (Accent Warm)
   #E86CA4 - Prism Rose (Holographic 1)
   #FF6EC4 - Prism Hot Rose (Holographic accent)
   #7873F5 - Prism Violet (Holographic 2)
   #4ADEDE - Prism Teal (Holographic 3)
   #F7CE68 - Prism Gold (Holographic 4) */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #1A0A12;
    color: #F2E6D8;
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0.04em;
    color: #F2E6D8;
}

.item-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0.04em;
    margin-bottom: 0.6em;
}

.item-text {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    color: #F2E6D8;
    margin-bottom: 0.8em;
}

.item-caption {
    font-family: 'Spectral', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    color: rgba(196, 163, 90, 0.7);
    display: block;
    margin-top: 0.5em;
}

.drop-cap {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 4em;
    float: left;
    line-height: 0.8;
    margin-right: 8px;
    margin-top: 0.05em;
    color: #C4A35A;
    font-weight: 700;
}

/* ---------- Animations ---------- */
@keyframes candleFlicker {
    0% {
        transform: scale(1);
        opacity: 0.12;
    }
    50% {
        transform: scale(1.04);
        opacity: 0.15;
    }
    100% {
        transform: scale(0.97);
        opacity: 0.10;
    }
}

@keyframes holographicShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes scrollPulse {
    0%, 100% {
        opacity: 0.4;
        transform: scaleY(1);
    }
    50% {
        opacity: 0.8;
        transform: scaleY(1.15);
    }
}

@keyframes gentlePulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* ---------- THE VESTIBULE ---------- */
.vestibule {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #1A0A12;
    overflow: hidden;
}

.vestibule-glow {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 160, 85, 0.12) 0%, transparent 70%);
    animation: candleFlicker 4s ease-in-out infinite alternate;
    pointer-events: none;
}

.emblem {
    position: relative;
    z-index: 2;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.12;
    background: linear-gradient(135deg, #E86CA4, #7873F5, #4ADEDE, #F7CE68);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: holographicShift 8s linear infinite;
    text-align: center;
}

.scroll-indicator {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-line {
    display: block;
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, #E86CA4, #7873F5, #4ADEDE, #F7CE68);
    background-size: 100% 300%;
    animation: scrollPulse 3s ease-in-out infinite, holographicShift 8s linear infinite;
}

/* ---------- Corner Brackets ---------- */
.corner-bracket {
    position: absolute;
    width: 24px;
    height: 24px;
    pointer-events: none;
}

.corner-tl {
    top: 24px;
    left: 24px;
    border-top: 1px solid #C4A35A;
    border-left: 1px solid #C4A35A;
}

.corner-tr {
    top: 24px;
    right: 24px;
    border-top: 1px solid #C4A35A;
    border-right: 1px solid #C4A35A;
}

.corner-bl {
    bottom: 24px;
    left: 24px;
    border-bottom: 1px solid #C4A35A;
    border-left: 1px solid #C4A35A;
}

.corner-br {
    bottom: 24px;
    right: 24px;
    border-bottom: 1px solid #C4A35A;
    border-right: 1px solid #C4A35A;
}

/* ---------- GALLERIES ---------- */
.gallery {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.first-gallery {
    min-height: 250vh;
    padding: 80px 0;
}

.first-gallery .gallery-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, #1A0A12, #5A1A2E 15%, #5A1A2E 85%, #1A0A12);
    z-index: 0;
}

.central-salon {
    min-height: 300vh;
    padding: 80px 0;
}

.central-salon .gallery-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, #1A0A12, #3A0E1E 10%, #5A1A2E 30%, #5A1A2E 70%, #3A0E1E 90%, #1A0A12);
    z-index: 0;
}

.deep-gallery {
    min-height: 200vh;
    padding: 80px 0;
}

.deep-gallery .gallery-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, #1A0A12, #1A0A12 30%, #3A0E1E 50%, #1A0A12 80%, #1A0A12);
    z-index: 0;
}

/* ---------- Wax Drips ---------- */
.wax-drip {
    position: absolute;
    top: 10%;
    height: 80%;
    width: 8px;
    z-index: 1;
    pointer-events: none;
}

.wax-drip-left {
    left: calc(50% - 300px);
}

.wax-drip-right {
    right: calc(50% - 300px);
}

.wax-drip-center {
    left: 50%;
    transform: translateX(-50%);
}

/* ---------- Portfolio Grid ---------- */
.portfolio-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-flow: dense;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* First Gallery grid items */
.gi-1 { grid-column: span 7; grid-row: span 2; }
.gi-2 { grid-column: span 5; grid-row: span 2; }
.gi-3 { grid-column: span 4; grid-row: span 1; }
.gi-4 { grid-column: span 5; grid-row: span 2; }
.gi-5 { grid-column: span 3; grid-row: span 1; }
.gi-6 { grid-column: span 4; grid-row: span 1; }
.gi-7 { grid-column: span 5; grid-row: span 2; }
.gi-8 { grid-column: span 7; grid-row: span 1; }
.gi-9 { grid-column: span 3; grid-row: span 1; }
.gi-10 { grid-column: span 5; grid-row: span 1; }

/* Central Salon grid items (larger spans) */
.si-1 { grid-column: span 8; grid-row: span 3; }
.si-2 { grid-column: span 4; grid-row: span 2; }
.si-3 { grid-column: span 5; grid-row: span 2; }
.si-4 { grid-column: span 7; grid-row: span 2; }
.si-5 { grid-column: span 5; grid-row: span 1; }
.si-6 { grid-column: span 4; grid-row: span 1; }
.si-7 { grid-column: span 8; grid-row: span 1; }
.si-8 { grid-column: span 7; grid-row: span 2; }

/* Deep Gallery grid items (smaller, denser) */
.di-1 { grid-column: span 3; grid-row: span 1; }
.di-2 { grid-column: span 4; grid-row: span 1; }
.di-3 { grid-column: span 3; grid-row: span 1; }
.di-4 { grid-column: span 5; grid-row: span 1; }
.di-5 { grid-column: span 3; grid-row: span 1; }
.di-6 { grid-column: span 4; grid-row: span 1; }
.di-7 { grid-column: span 4; grid-row: span 1; }
.di-8 { grid-column: span 3; grid-row: span 1; }
.di-9 { grid-column: span 5; grid-row: span 1; }
.di-10 { grid-column: span 3; grid-row: span 1; }
.di-11 { grid-column: span 4; grid-row: span 1; }
.di-12 { grid-column: span 5; grid-row: span 1; }

/* ---------- Grid Items ---------- */
.grid-item {
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.grid-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Wick Lines ---------- */
.wick-line {
    position: absolute;
    top: -60px;
    left: 50%;
    width: 1px;
    height: 60px;
    background-color: rgba(212, 160, 85, 0.25);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 800ms ease-out;
}

.grid-item.visible .wick-line {
    transform: scaleY(1);
}

/* ---------- Item Frames ---------- */
.item-frame {
    position: relative;
    border: 1px solid #C4A35A;
    box-shadow: inset 0 0 8px rgba(196, 163, 90, 0.3);
    overflow: hidden;
    height: 100%;
    transition: border-color 300ms ease;
}

.grid-item:hover .item-frame {
    border-image: linear-gradient(135deg, #E86CA4, #7873F5, #4ADEDE, #F7CE68) 1;
}

.thin-frame {
    border-width: 0.5px;
    box-shadow: inset 0 0 4px rgba(196, 163, 90, 0.15);
}

/* Frame shimmer pseudo-element */
.item-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    opacity: 0;
    background: linear-gradient(135deg, #E86CA4, #7873F5, #4ADEDE, #F7CE68) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    transition: opacity 400ms ease;
    pointer-events: none;
}

.grid-item.shimmer .item-frame::after {
    opacity: 1;
    animation: shimmerFade 800ms ease forwards;
}

@keyframes shimmerFade {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* ---------- Collage Compositions ---------- */
.collage-composition {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.collage-layer {
    position: absolute;
    inset: 0;
}

.collage-layer.cl-foil {
    animation: holographicShift 8s linear infinite;
    background-size: 300% 300%;
}

/* ---------- Item Content ---------- */
.item-content {
    position: relative;
    z-index: 2;
    padding: clamp(24px, 4vw, 48px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 200px;
    height: 100%;
}

/* ---------- Divider Motifs ---------- */
.divider-motif {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px 0;
    background-color: #1A0A12;
}

.divider-line {
    display: block;
    width: 80px;
    height: 1px;
    background-color: #C4A35A;
    opacity: 0.5;
}

.divider-diamond {
    display: block;
    width: 8px;
    height: 8px;
    background-color: #C4A35A;
    transform: rotate(45deg);
    opacity: 0.6;
}

/* ---------- CANDLELIGHT INTERLUDES ---------- */
.candlelight-interlude {
    position: relative;
    width: 100%;
    height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1A0A12;
    overflow: hidden;
}

.candle-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.candle-glow-bright {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #D4A055 0%, transparent 70%);
    opacity: 0.20;
    animation: candleFlicker 4s ease-in-out infinite alternate;
    animation-delay: 0.5s;
}

.candle-glow-dim {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(212, 160, 85, 0.12) 0%, transparent 70%);
    animation: candleFlicker 4s ease-in-out infinite alternate;
    animation-delay: 1.2s;
}

.interlude-text {
    position: relative;
    z-index: 2;
    font-family: 'Spectral', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: #C4A35A;
    text-align: center;
    max-width: 600px;
    padding: 0 24px;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1200ms ease-out, transform 1200ms ease-out;
}

.interlude-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Salon Glow Fields ---------- */
.salon-glow-1 {
    top: 20%;
    left: 30%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(212, 160, 85, 0.10) 0%, transparent 70%);
    animation: candleFlicker 4s ease-in-out infinite alternate;
    animation-delay: 0s;
}

.salon-glow-2 {
    top: 50%;
    left: 60%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(212, 160, 85, 0.12) 0%, transparent 70%);
    animation: candleFlicker 4s ease-in-out infinite alternate;
    animation-delay: 1.5s;
}

.salon-glow-3 {
    top: 75%;
    left: 40%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(212, 160, 85, 0.08) 0%, transparent 70%);
    animation: candleFlicker 4s ease-in-out infinite alternate;
    animation-delay: 2.8s;
}

/* ---------- Deep Gallery Glow ---------- */
.deep-glow-1 {
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(212, 160, 85, 0.06) 0%, transparent 70%);
    animation: candleFlicker 4s ease-in-out infinite alternate;
    animation-delay: 0.8s;
}

/* ---------- THE COLOPHON ---------- */
.colophon {
    position: relative;
    width: 100%;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1A0A12;
    overflow: hidden;
}

.colophon-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 160, 85, 0.05) 0%, transparent 70%);
    animation: candleFlicker 4s ease-in-out infinite alternate;
    animation-delay: 2s;
    pointer-events: none;
}

.colophon-content {
    position: relative;
    z-index: 2;
    max-width: 480px;
    text-align: center;
    padding: 48px;
}

.colophon-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #C4A35A;
    margin-bottom: 1.5em;
}

.colophon-text {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    color: #C4A35A;
    line-height: 1.8;
    margin-bottom: 0.6em;
}

.colophon-text.small {
    font-family: 'Spectral', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(0.8rem, 0.9vw, 0.9rem);
    color: rgba(196, 163, 90, 0.6);
}

/* ---------- FLOATING RELIQUARY (Navigation) ---------- */
.reliquary {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 1000;
}

.reliquary-frame {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 10px;
    border: 1px solid #C4A35A;
    box-shadow: inset 0 0 6px rgba(196, 163, 90, 0.2), 0 4px 20px rgba(0, 0, 0, 0.5);
    background-color: rgba(26, 10, 18, 0.9);
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid #C4A35A;
    background-color: transparent;
    cursor: pointer;
    transition: background 300ms ease, border-color 300ms ease, transform 200ms ease;
    padding: 0;
}

.nav-dot:hover {
    background: linear-gradient(135deg, #FF6EC4, #E86CA4, #7873F5, #4ADEDE, #F7CE68);
    background-size: 300% 300%;
    animation: holographicShift 8s linear infinite;
    border-color: transparent;
    transform: scale(1.3);
}

.nav-dot.active {
    background-color: #C4A35A;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .portfolio-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 8px;
        padding: 0 16px;
    }

    .gi-1, .gi-2, .gi-4, .gi-7, .gi-8 { grid-column: span 6; grid-row: span 1; }
    .gi-3, .gi-5, .gi-6, .gi-9, .gi-10 { grid-column: span 3; grid-row: span 1; }

    .si-1, .si-4, .si-7, .si-8 { grid-column: span 6; grid-row: span 1; }
    .si-2, .si-3, .si-5, .si-6 { grid-column: span 3; grid-row: span 1; }

    .di-1, .di-2, .di-3, .di-4, .di-5, .di-6,
    .di-7, .di-8, .di-9, .di-10, .di-11, .di-12 {
        grid-column: span 3;
        grid-row: span 1;
    }

    .wax-drip-left { left: 8px; }
    .wax-drip-right { right: 8px; }
    .wax-drip-center { display: none; }

    .reliquary {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 600px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .gi-1, .gi-2, .gi-3, .gi-4, .gi-5, .gi-6, .gi-7, .gi-8, .gi-9, .gi-10,
    .si-1, .si-2, .si-3, .si-4, .si-5, .si-6, .si-7, .si-8,
    .di-1, .di-2, .di-3, .di-4, .di-5, .di-6,
    .di-7, .di-8, .di-9, .di-10, .di-11, .di-12 {
        grid-column: span 1;
        grid-row: span 1;
    }

    .item-content {
        min-height: 150px;
    }

    .wick-line {
        display: none;
    }

    .wax-drip {
        display: none;
    }

    .corner-bracket {
        width: 16px;
        height: 16px;
    }

    .corner-tl { top: 12px; left: 12px; }
    .corner-tr { top: 12px; right: 12px; }
    .corner-bl { bottom: 12px; left: 12px; }
    .corner-br { bottom: 12px; right: 12px; }
}