/* ======================================
   rollup.quest - Victorian Ornate Blockchain Exhibition
   ====================================== */

/* --- CSS Custom Properties --- */
:root {
    --vault-black: #0A0A0A;
    --imperial-gold: #C8A050;
    --ornate-amber: #D4B870;
    --ledger-cream: #E8DFD0;
    --blob-dark-gold: rgba(200,160,80,0.08);
    --grid-line: rgba(200,160,80,0.1);
    --deep-bronze: #8B6B35;
    --scroll: 0;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--vault-black);
    color: var(--ledger-cream);
    font-family: 'Crimson Pro', Georgia, serif;
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Grid Ledger Overlay --- */
#grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 1;
}

#grid-svg {
    width: 100%;
    height: 100%;
}

/* --- Organic Blob Shapes --- */
#blob-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    background: var(--blob-dark-gold);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morph 12s ease-in-out infinite;
}

.blob-1 {
    width: 600px;
    height: 600px;
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    top: 30%;
    right: -10%;
    animation-delay: -3s;
    animation-direction: reverse;
}

.blob-3 {
    width: 700px;
    height: 700px;
    bottom: -15%;
    left: 20%;
    animation-delay: -6s;
}

.blob-4 {
    width: 400px;
    height: 400px;
    top: 50%;
    left: 60%;
    animation-delay: -2s;
    animation-direction: reverse;
}

.blob-5 {
    width: 550px;
    height: 550px;
    top: 70%;
    left: -15%;
    animation-delay: -8s;
}

@keyframes morph {
    0%, 100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 58% 42% 36% 64% / 53% 67% 33% 47%;
    }
    50% {
        border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
        transform: rotate(5deg) scale(1.05);
    }
    75% {
        border-radius: 42% 58% 64% 36% / 47% 33% 67% 53%;
    }
}

/* --- Parallax Layer Base --- */
.parallax-layer {
    will-change: transform;
    transform: translateY(calc(var(--scroll) * var(--speed, 0) * 1px));
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Abril Fatface', 'Georgia', serif;
    font-weight: 400;
    color: var(--ornate-amber);
}

h1 {
    font-size: clamp(36px, 6vw, 80px);
    letter-spacing: 0.04em;
}

h2 {
    font-size: clamp(28px, 4vw, 56px);
    letter-spacing: 0.03em;
    margin-bottom: 1em;
}

h3 {
    font-size: clamp(20px, 2.5vw, 32px);
    margin-bottom: 0.6em;
    color: var(--imperial-gold);
}

p {
    max-width: 680px;
    margin-bottom: 1.5em;
}

/* --- Chain Data (Monospace) --- */
.chain-data {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em 1.5em;
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 13px;
    font-weight: 400;
    margin-top: 1.5em;
    padding: 1em 0;
    border-top: 1px solid rgba(200,160,80,0.15);
}

.data-hash {
    color: var(--imperial-gold);
}

.data-label {
    color: var(--deep-bronze);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Shake Error Animation --- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.shake-active {
    animation: shake 0.3s ease-in-out;
}

.deprecated {
    cursor: not-allowed;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.deprecated:hover {
    opacity: 1;
}

/* ============================
   SECTION: Exhibition Hall
   ============================ */
#exhibition-hall {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ornate-frame {
    position: relative;
    width: 90%;
    max-width: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.ornate-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* SVG draw-in animation */
.draw-line {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawLine 2s ease-out forwards;
}

.draw-dot {
    opacity: 0;
    animation: fadeIn 0.5s ease-out 1.8s forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

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

#hall-content {
    position: relative;
    text-align: center;
    padding: 4em 2em;
    z-index: 4;
    opacity: 0;
    animation: fadeInUp 1s ease-out 1.5s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wordmark {
    font-size: clamp(40px, 8vw, 100px);
    color: var(--ornate-amber);
    letter-spacing: 0.06em;
    text-shadow: 0 0 40px rgba(200,160,80,0.2);
    margin-bottom: 0.2em;
}

.tagline {
    font-family: 'Crimson Pro', serif;
    font-size: clamp(14px, 1.8vw, 20px);
    color: var(--deep-bronze);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 400;
}

/* ============================
   SECTIONS: Invention Sections
   ============================ */
.invention-section {
    position: relative;
    z-index: 2;
    padding: 6em 2em;
    max-width: 1100px;
    margin: 0 auto;
}

.section-ornate-header {
    margin-bottom: 3em;
    z-index: 3;
}

.section-border {
    width: 100%;
    max-width: 600px;
    height: 60px;
    display: block;
    margin: 0 auto;
}

.section-border .draw-line {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s ease-out;
}

.section-border.visible .draw-line {
    stroke-dashoffset: 0;
}

.invention-content {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.invention-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Two Column Layout --- */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4em;
}

.two-columns .column {
    position: relative;
}

.two-columns .column:first-child::after {
    content: '';
    position: absolute;
    right: -2em;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent,
        var(--deep-bronze) 20%,
        var(--imperial-gold) 50%,
        var(--deep-bronze) 80%,
        transparent
    );
}

/* ============================
   SECTION: The Gallery
   ============================ */
.gallery-section {
    padding-bottom: 8em;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3em;
    margin-top: 2em;
}

.gallery-item {
    position: relative;
    padding: 2em;
    border: 1px solid rgba(200,160,80,0.12);
    overflow: hidden;
    transition: border-color 0.4s ease;
}

.gallery-item:hover {
    border-color: var(--imperial-gold);
}

.gallery-blob {
    position: absolute;
    top: -30%;
    left: -30%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        ellipse at center,
        rgba(200,160,80,0.06) 0%,
        transparent 70%
    );
    border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%;
    animation: morph 15s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.gallery-item h3,
.gallery-item p,
.gallery-item .chain-data {
    position: relative;
    z-index: 1;
}

/* ============================
   FOOTER: The Vault
   ============================ */
#vault-footer {
    position: relative;
    z-index: 2;
    background: #050505;
    padding: 0 2em 3em;
    text-align: center;
}

.footer-ornate-crown {
    margin-bottom: 2em;
}

.footer-border {
    width: 100%;
    max-width: 800px;
    height: 80px;
    display: block;
    margin: 0 auto;
}

.footer-content {
    padding: 2em 0;
}

.footer-domain {
    font-family: 'Abril Fatface', serif;
    font-size: clamp(24px, 3vw, 40px);
    color: var(--ornate-amber);
    letter-spacing: 0.05em;
    margin-bottom: 0.3em;
}

.footer-inscription {
    font-family: 'Crimson Pro', serif;
    color: var(--deep-bronze);
    font-size: clamp(12px, 1.2vw, 15px);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1.5em;
}

.footer-content .chain-data {
    justify-content: center;
    border-top-color: rgba(200,160,80,0.1);
}

.footer-grid-accent {
    opacity: 0.5;
}

/* ============================
   Scroll-based visibility
   ============================ */
.invention-section .section-border .draw-line,
.invention-section .invention-content {
    /* Will be activated via JS intersection observer */
}

/* ============================
   Responsive Design
   ============================ */
@media (max-width: 900px) {
    .two-columns {
        grid-template-columns: 1fr;
        gap: 3em;
    }

    .two-columns .column:first-child::after {
        display: none;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 2em;
    }

    .invention-section {
        padding: 4em 1.5em;
    }

    .ornate-frame {
        width: 95%;
    }

    .blob-1 { width: 350px; height: 350px; }
    .blob-2 { width: 300px; height: 300px; }
    .blob-3 { width: 400px; height: 400px; }
    .blob-4 { width: 250px; height: 250px; }
    .blob-5 { width: 300px; height: 300px; }
}

@media (max-width: 600px) {
    .invention-section {
        padding: 3em 1em;
    }

    .chain-data {
        flex-direction: column;
        gap: 0.3em;
    }

    .wordmark {
        letter-spacing: 0.02em;
    }

    .tagline {
        letter-spacing: 0.08em;
    }

    .gallery-item {
        padding: 1.5em;
    }
}
