/* ==========================================================================
   recycle.auction - Neomorphic Ecclesiasticism
   ========================================================================== */

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

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

body {
    background-color: #4A1428;
    color: #D4A0A8;
    font-family: 'Crimson Pro', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Grid-Line Analytical Overlay --- */
#grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 1.5s ease;
}

#grid-overlay.visible {
    opacity: 1;
}

#grid-overlay-closing {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 1s ease;
}

#grid-overlay-closing.visible {
    opacity: 1;
}

/* --- Bubble Container --- */
#bubble-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(139, 74, 92, 0.3);
    background: radial-gradient(ellipse at 30% 20%, rgba(242, 215, 217, 0.12) 0%, rgba(74, 20, 40, 0.03) 50%, transparent 70%);
    pointer-events: none;
    animation: bubbleRise var(--rise-duration) linear forwards,
               bubbleDrift var(--drift-duration) ease-in-out infinite alternate;
    opacity: 0;
}

.bubble::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 25%;
    width: 30%;
    height: 20%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(242, 215, 217, 0.08) 0%, transparent 70%);
}

.bubble::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    backdrop-filter: blur(0.5px);
    -webkit-backdrop-filter: blur(0.5px);
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    5% {
        opacity: var(--bubble-opacity, 0.6);
    }
    85% {
        opacity: var(--bubble-opacity, 0.6);
    }
    100% {
        transform: translateY(calc(-100vh - 150px));
        opacity: 0;
    }
}

@keyframes bubbleDrift {
    0% {
        margin-left: calc(var(--drift-amount) * -1);
    }
    100% {
        margin-left: var(--drift-amount);
    }
}

/* --- Water Tint Overlay for deeper sections --- */
.water-tint {
    background-color: #3D1A2E;
}

/* --- Neomorphic highlight variant --- */
.neumorphic-alt {
    box-shadow: 8px 8px 16px #2E0A14, -8px -8px 16px #8B3A4A;
}

/* --- Section Common --- */
section {
    position: relative;
    z-index: 3;
}

/* --- HERO SECTION --- */
.section-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-frame {
    position: relative;
    padding: clamp(2rem, 5vw, 4rem) clamp(3rem, 8vw, 8rem);
}

.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 12vw, 9rem);
    color: #F2D7D9;
    letter-spacing: -0.02em;
    text-align: center;
    position: relative;
    opacity: 0;
    transition: opacity 0s;
    /* Neomorphic inset text effect */
    text-shadow:
        2px 2px 4px #2E0A14,
        -2px -2px 4px #6B2A40,
        0 0 40px rgba(232, 93, 117, 0.05);
}

.hero-title.revealed {
    animation: heroReveal 2.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes heroReveal {
    0% {
        opacity: 0;
        text-shadow:
            0px 0px 0px #2E0A14,
            0px 0px 0px #6B2A40,
            0 0 0px rgba(232, 93, 117, 0);
    }
    100% {
        opacity: 1;
        text-shadow:
            3px 3px 6px #2E0A14,
            -3px -3px 6px #6B2A40,
            0 0 60px rgba(232, 93, 117, 0.08);
    }
}

.hero-subtitle-hint {
    position: absolute;
    bottom: clamp(2rem, 5vh, 4rem);
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeInDelayed 1s ease 3s forwards;
}

.scroll-indicator {
    font-family: 'Crimson Pro', serif;
    font-size: 1.5rem;
    color: #B87D86;
    animation: gentleBounce 2.5s ease-in-out infinite;
    display: inline-block;
}

@keyframes gentleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

@keyframes fadeInDelayed {
    from { opacity: 0; }
    to { opacity: 0.6; }
}

/* --- THESIS SECTION --- */
.section-thesis {
    min-height: 80vh;
    padding: clamp(6rem, 12vh, 10rem) clamp(1.5rem, 5vw, 4rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.thesis-container {
    max-width: 900px;
    width: 100%;
}

.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #E8C4C8;
    letter-spacing: -0.02em;
    margin-bottom: clamp(2rem, 4vh, 3rem);
    line-height: 1.2;
}

.thesis-body {
    position: relative;
}

.thesis-paragraph {
    margin-bottom: 1.8em;
    color: #D4A0A8;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.thesis-paragraph.visible {
    opacity: 1;
    transform: translateY(0);
}

.pull-quote {
    margin: clamp(2rem, 5vh, 4rem) clamp(-2rem, -3vw, -4rem);
    padding: clamp(1.5rem, 3vw, 2.5rem) clamp(2rem, 4vw, 3rem);
    box-shadow: inset 6px 6px 12px #2E0A14, inset -6px -6px 12px #6B2A40;
    border-radius: clamp(12px, 2vw, 24px);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.pull-quote.visible {
    opacity: 1;
    transform: translateY(0);
}

.pull-quote p {
    font-family: 'Crimson Pro', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: #E8C4C8;
    line-height: 1.6;
}

/* --- BORDER ANIMATE FRAME --- */
.border-animate-frame {
    position: relative;
    padding: clamp(1rem, 2vw, 1.5rem) clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: clamp(2rem, 4vh, 3rem);
}

.border-animate-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-radius: clamp(12px, 2vw, 24px);
    background: linear-gradient(#4A1428, #4A1428) padding-box,
                linear-gradient(var(--border-angle, 0deg), transparent 0%, transparent 42%, #E85D75 42%, #E85D75 58%, transparent 58%, transparent 100%) border-box;
    animation: borderTravel 8s linear infinite;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.border-animate-frame.active::before {
    opacity: 1;
}

.border-animate-frame:hover::before {
    background: linear-gradient(#4A1428, #4A1428) padding-box,
                linear-gradient(var(--border-angle, 0deg), transparent 0%, transparent 30%, #FF7A8F 30%, #FF7A8F 70%, transparent 70%, transparent 100%) border-box;
}

@property --border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes borderTravel {
    from { --border-angle: 0deg; }
    to { --border-angle: 360deg; }
}

/* --- CATALOG SECTION --- */
.section-catalog {
    min-height: 100vh;
    padding: clamp(4rem, 8vh, 8rem) clamp(1.5rem, 5vw, 4rem);
    position: relative;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(2rem, 4vw, 4rem);
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.catalog-card {
    background: #4A1428;
    border-radius: clamp(12px, 2vw, 24px);
    box-shadow: 0px 0px 0px #2E0A14, 0px 0px 0px #6B2A40;
    transition: box-shadow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    transform: translateY(30px);
}

.catalog-card.visible {
    opacity: 1;
    transform: translateY(0);
    box-shadow: 8px 8px 16px #2E0A14, -8px -8px 16px #6B2A40;
}

.catalog-card[data-offset="1"] { margin-top: 2rem; }
.catalog-card[data-offset="2"] { margin-top: 1rem; }
.catalog-card[data-offset="4"] { margin-top: 1.5rem; }
.catalog-card[data-offset="5"] { margin-top: 0.5rem; }

.catalog-card:hover {
    box-shadow: inset 6px 6px 12px #2E0A14, inset -6px -6px 12px #6B2A40;
    transform: translateY(-2px);
}

.card-inner {
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

.card-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.card-label {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #C49098;
    margin-bottom: 0.25rem;
}

.card-meta {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.06em;
    color: #A87078;
    margin-bottom: 1rem;
}

.card-desc {
    font-family: 'Crimson Pro', serif;
    font-size: clamp(0.85rem, 1.2vw, 0.95rem);
    color: #B87D86;
    line-height: 1.65;
    margin-bottom: 1.2rem;
}

.card-status {
    display: inline-block;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(0.65rem, 0.85vw, 0.78rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #E85D75;
    padding: 0.3em 0.8em;
    border: 1px solid rgba(232, 93, 117, 0.3);
    border-radius: 4px;
}

.card-connections-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.card-connections-svg line {
    stroke: #5A1A2A;
    stroke-width: 0.5;
    stroke-opacity: 0.15;
    stroke-dasharray: 4 4;
}

/* --- MATERIAL STUDIES --- */
.section-material-studies {
    padding: clamp(2rem, 4vh, 4rem) 0;
}

.material-panel {
    min-height: 60vh;
    padding: clamp(4rem, 8vh, 8rem) clamp(2rem, 6vw, 6rem);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
                filter 0.8s ease;
}

.material-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.material-panel-1 {
    background-color: #4A1428;
}

.material-panel-2 {
    background-color: #451325;
    filter: brightness(0.95);
}

.material-panel-3 {
    background-color: #401222;
    filter: brightness(0.90);
}

.material-frame {
    max-width: 900px;
    width: 100%;
}

.material-body {
    max-width: 900px;
    width: 100%;
}

.material-text {
    margin-bottom: 1.8em;
    color: #D4A0A8;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

/* --- ARCHIVE / BASIN SECTION --- */
.section-archive {
    min-height: 80vh;
    padding: clamp(4rem, 8vh, 8rem) clamp(2rem, 5vw, 4rem);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.archive-basin {
    max-width: 1000px;
    width: 100%;
    padding: clamp(3rem, 6vw, 5rem);
    box-shadow: inset 10px 10px 20px #2E0A14, inset -10px -10px 20px #6B2A40;
    border-radius: clamp(16px, 3vw, 32px);
    position: relative;
}

.archive-frame {
    text-align: center;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: clamp(1rem, 2vw, 2rem);
    padding: clamp(2rem, 4vh, 3rem) 0;
}

.archive-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.archive-bubble {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    border: 1px solid rgba(139, 74, 92, 0.4);
    background: radial-gradient(ellipse at 30% 25%, rgba(242, 215, 217, 0.15) 0%, rgba(74, 20, 40, 0.05) 50%, transparent 70%);
    animation: archivePulse 4s ease-in-out infinite;
    animation-delay: var(--pulse-delay, 0s);
}

.archive-item:nth-child(1) .archive-bubble { --pulse-delay: 0s; }
.archive-item:nth-child(2) .archive-bubble { --pulse-delay: 0.3s; }
.archive-item:nth-child(3) .archive-bubble { --pulse-delay: 0.6s; }
.archive-item:nth-child(4) .archive-bubble { --pulse-delay: 0.9s; }
.archive-item:nth-child(5) .archive-bubble { --pulse-delay: 1.2s; }
.archive-item:nth-child(6) .archive-bubble { --pulse-delay: 1.5s; }
.archive-item:nth-child(7) .archive-bubble { --pulse-delay: 1.8s; }
.archive-item:nth-child(8) .archive-bubble { --pulse-delay: 2.1s; }
.archive-item:nth-child(9) .archive-bubble { --pulse-delay: 0.15s; }
.archive-item:nth-child(10) .archive-bubble { --pulse-delay: 0.45s; }
.archive-item:nth-child(11) .archive-bubble { --pulse-delay: 0.75s; }
.archive-item:nth-child(12) .archive-bubble { --pulse-delay: 1.05s; }
.archive-item:nth-child(13) .archive-bubble { --pulse-delay: 1.35s; }
.archive-item:nth-child(14) .archive-bubble { --pulse-delay: 1.65s; }
.archive-item:nth-child(15) .archive-bubble { --pulse-delay: 1.95s; }
.archive-item:nth-child(16) .archive-bubble { --pulse-delay: 2.25s; }
.archive-item:nth-child(17) .archive-bubble { --pulse-delay: 0.2s; }
.archive-item:nth-child(18) .archive-bubble { --pulse-delay: 0.5s; }
.archive-item:nth-child(19) .archive-bubble { --pulse-delay: 0.8s; }
.archive-item:nth-child(20) .archive-bubble { --pulse-delay: 1.1s; }
.archive-item:nth-child(21) .archive-bubble { --pulse-delay: 1.4s; }
.archive-item:nth-child(22) .archive-bubble { --pulse-delay: 1.7s; }
.archive-item:nth-child(23) .archive-bubble { --pulse-delay: 2.0s; }
.archive-item:nth-child(24) .archive-bubble { --pulse-delay: 2.3s; }

@keyframes archivePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.85;
    }
}

.archive-note {
    text-align: center;
    font-family: 'Crimson Pro', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(0.85rem, 1.2vw, 0.95rem);
    color: #B87D86;
    margin-top: clamp(1rem, 2vh, 2rem);
}

/* --- Material Taxonomy Icon Animations --- */
.card-icon-metals svg {
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.catalog-card.visible .card-icon-metals svg {
    transform: rotate(60deg);
}

.card-icon-textiles svg path {
    transition: transform 0.6s ease;
}

.card-icon-ceramics svg circle {
    animation: none;
}

.catalog-card.visible .card-icon-ceramics svg circle {
    animation: ceramicPulse 3s ease-in-out infinite;
}

@keyframes ceramicPulse {
    0%, 100% { transform-origin: center; transform: scale(1); }
    50% { transform-origin: center; transform: scale(1.05); }
}

.card-icon-polymers svg circle {
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

    .catalog-card[data-offset="1"],
    .catalog-card[data-offset="2"],
    .catalog-card[data-offset="4"],
    .catalog-card[data-offset="5"] {
        margin-top: 0;
    }
}

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

    .pull-quote {
        margin-left: 0;
        margin-right: 0;
    }

    .hero-title {
        font-size: clamp(2.5rem, 10vw, 5rem);
    }
}

/* --- Selection Color --- */
::selection {
    background: rgba(232, 93, 117, 0.3);
    color: #F2D7D9;
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #2E0A14;
}

::-webkit-scrollbar-thumb {
    background: #6B2A40;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8B4A5C;
}
