/* ============================================
   prototype.rs — Light-Academia Monochrome Gallery
   ============================================ */

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

:root {
    --monochrome-deep: #1A1814;
    --monochrome-mid: #4A4840;
    --monochrome-light: #8A8478;
    --monochrome-pale: #C0BAB0;
    --gallery-white: #FAF8F4;
    --specimen-card: #FFFFFF;
    --marble-vein: rgba(30, 28, 24, 0.03);
    --ripple-surface: rgba(30, 28, 24, 0.05);
    --border-color: #D8D4CE;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.85;
    color: var(--monochrome-mid);
    background-color: var(--gallery-white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Marble Background Texture --- */
#marble-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, var(--marble-vein), transparent),
        radial-gradient(ellipse 500px 350px at 70% 60%, var(--marble-vein), transparent),
        radial-gradient(ellipse 400px 500px at 50% 10%, var(--marble-vein), transparent),
        radial-gradient(ellipse 700px 300px at 80% 85%, var(--marble-vein), transparent),
        radial-gradient(ellipse 350px 600px at 15% 75%, var(--marble-vein), transparent),
        radial-gradient(ellipse 450px 250px at 40% 50%, var(--marble-vein), transparent),
        radial-gradient(ellipse 550px 380px at 60% 20%, var(--marble-vein), transparent),
        radial-gradient(ellipse 380px 480px at 90% 40%, var(--marble-vein), transparent);
}

/* --- Header --- */
#gallery-header {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
}

.header-inner {
    max-width: 720px;
}

.gallery-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2.2rem, 4.5vw, 3.5rem);
    color: var(--monochrome-deep);
    letter-spacing: 0.12em;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1.2s cubic-bezier(0.23, 1, 0.32, 1) 0.4s forwards;
}

.gallery-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.85;
    color: var(--monochrome-mid);
    max-width: 540px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(14px);
    animation: fadeInUp 1.2s cubic-bezier(0.23, 1, 0.32, 1) 0.7s forwards;
}

.header-rule {
    width: 48px;
    height: 1px;
    background-color: var(--monochrome-pale);
    margin: 32px auto 0;
    opacity: 0;
    animation: fadeIn 1s ease 1.2s forwards;
}

/* --- Catalog Numbers --- */
.catalog-number {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--monochrome-light);
    display: block;
    margin-bottom: 12px;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.15s forwards;
}

/* --- Gallery Grid --- */
#gallery-main {
    position: relative;
    z-index: 1;
    padding: 0 24px 80px;
    max-width: 1120px;
    margin: 0 auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    position: relative;
}

/* --- Organic Blobs --- */
.grid-blob {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    background-color: var(--monochrome-pale);
    opacity: 0.05;
}

.blob-1 {
    width: 320px;
    height: 280px;
    border-radius: 40% 60% 50% 50% / 60% 40% 55% 45%;
    top: -40px;
    left: -60px;
    animation: blobMorph1 12s ease-in-out infinite;
}

.blob-2 {
    width: 260px;
    height: 220px;
    border-radius: 55% 45% 60% 40% / 45% 55% 40% 60%;
    top: 40%;
    right: -40px;
    animation: blobMorph2 14s ease-in-out infinite;
}

.blob-3 {
    width: 300px;
    height: 260px;
    border-radius: 45% 55% 40% 60% / 55% 45% 60% 40%;
    bottom: 60px;
    left: 30%;
    animation: blobMorph3 16s ease-in-out infinite;
}

@keyframes blobMorph1 {
    0%, 100% { border-radius: 40% 60% 50% 50% / 60% 40% 55% 45%; }
    33% { border-radius: 55% 45% 60% 40% / 45% 55% 40% 60%; }
    66% { border-radius: 50% 50% 45% 55% / 55% 45% 50% 50%; }
}

@keyframes blobMorph2 {
    0%, 100% { border-radius: 55% 45% 60% 40% / 45% 55% 40% 60%; }
    33% { border-radius: 45% 55% 40% 60% / 55% 45% 60% 40%; }
    66% { border-radius: 60% 40% 55% 45% / 40% 60% 50% 50%; }
}

@keyframes blobMorph3 {
    0%, 100% { border-radius: 45% 55% 40% 60% / 55% 45% 60% 40%; }
    33% { border-radius: 40% 60% 50% 50% / 60% 40% 55% 45%; }
    66% { border-radius: 55% 45% 60% 40% / 45% 55% 40% 60%; }
}

/* --- Specimen Cards --- */
.specimen-card {
    position: relative;
    z-index: 1;
    background: var(--specimen-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 28px;
    overflow: hidden;
    cursor: default;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
    opacity: 0;
    transform: translateY(24px);
}

.specimen-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.7s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.4s ease;
}

.specimen-card:hover {
    box-shadow: 0 4px 16px rgba(30, 28, 24, 0.06);
}

.specimen-card.span-2 {
    grid-column: span 2;
}

/* --- Ripple Effect --- */
.ripple-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--ripple-surface) 0%, transparent 70%);
    width: 0;
    height: 0;
    transform: translate(-50%, -50%);
    animation: rippleExpand 600ms ease-out forwards;
    pointer-events: none;
}

@keyframes rippleExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
    }
}

/* --- Specimen Content --- */
.specimen-card .catalog-number {
    opacity: 1;
    animation: none;
    margin-bottom: 10px;
}

.specimen-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    color: var(--monochrome-deep);
    margin-bottom: 12px;
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

.specimen-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.88rem, 1vw, 0.98rem);
    line-height: 1.85;
    color: var(--monochrome-mid);
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.specimen-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.meta-tag {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--monochrome-light);
    background: var(--gallery-white);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 3px 10px;
}

.meta-date {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--monochrome-pale);
    margin-left: auto;
}

/* --- Footer --- */
#gallery-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 60px 24px 80px;
    border-top: 1px solid var(--border-color);
    max-width: 1120px;
    margin: 0 auto;
}

.footer-inner {
    max-width: 480px;
    margin: 0 auto;
}

#gallery-footer .catalog-number {
    opacity: 1;
    animation: none;
    margin-bottom: 16px;
}

.footer-note {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.88rem;
    line-height: 1.85;
    color: var(--monochrome-light);
}

/* --- Animations --- */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .specimen-card.span-2 {
        grid-column: span 2;
    }
}

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

    .specimen-card.span-2 {
        grid-column: span 1;
    }

    #gallery-header {
        min-height: 80vh;
        padding: 40px 20px;
    }

    .gallery-title {
        letter-spacing: 0.06em;
    }

    #gallery-main {
        padding: 0 16px 60px;
    }
}
