/* ============================================
   mujun.art -- Inflated Sepia Contradiction
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #F5E6D0;
    color: #5D4037;
    font-family: 'Libre Baskerville', 'Georgia', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.85;
    overflow-x: hidden;
}

/* --- Scroll Container --- */
#scroll-container {
    scroll-snap-type: y proximity;
    overflow-y: auto;
    height: 100vh;
}

/* --- Sections --- */
.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
}

.section-inner {
    max-width: 680px;
    margin: 0 auto;
    padding: 4rem 2rem;
    position: relative;
    z-index: 2;
    width: 100%;
}

/* Serpentine sway */
.sway-right .section-inner {
    margin-left: auto;
    margin-right: 4%;
}

.sway-left .section-inner {
    margin-right: auto;
    margin-left: 4%;
}

/* Section backgrounds */
.section--dark {
    background: linear-gradient(180deg, #D4B896 0%, #A08060 100%);
}

.section--light {
    background: #F5E6D0;
}

.section--deep {
    background: linear-gradient(180deg, #A08060 0%, #2C1810 100%);
}

/* Vintage grain overlay */
.section::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            45deg,
            rgba(62, 39, 35, 0.03) 0px,
            rgba(62, 39, 35, 0.03) 1px,
            transparent 1px,
            transparent 4px
        ),
        repeating-linear-gradient(
            -45deg,
            rgba(141, 110, 99, 0.02) 0px,
            rgba(141, 110, 99, 0.02) 1px,
            transparent 1px,
            transparent 5px
        );
    mix-blend-mode: multiply;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

/* --- Typography --- */
h1 {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(2.4rem, 7vw, 5.5rem);
    letter-spacing: 0.05em;
    color: #3E2723;
    line-height: 1.1;
}

h2 {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 500;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    letter-spacing: 0.03em;
    color: #3E2723;
    line-height: 1.2;
}

h3 {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 500;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    letter-spacing: 0.03em;
    color: #3E2723;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.section-heading--light {
    color: #D4B896;
}

.accent-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8D6E63;
}

.accent-label--light {
    color: #C49A6C;
}

.body-text {
    color: #5D4037;
    max-width: 540px;
}

/* --- Spear & Shield Motif --- */
.spear-shield-motif {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.08;
}

.spear-shield-motif::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent, #C49A6C, transparent);
    transform: rotate(-30deg);
    transform-origin: center;
}

.spear-shield-motif::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #C49A6C, transparent);
}

/* --- Section I: Contradiction Gallery --- */
#contradiction-gallery {
    text-align: center;
}

.gallery-title {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.gallery-subtitle {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: #5D4037;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

#contradiction-gallery .body-text {
    margin: 0 auto;
}

/* Inflated Frame */
.inflated-frame {
    width: 280px;
    height: 200px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #EDE0D0 0%, #D4B896 50%, #C49A6C 100%);
    box-shadow:
        inset 0 -10px 30px rgba(160, 128, 96, 0.5),
        inset 0 10px 30px rgba(245, 230, 208, 0.8),
        0 20px 60px rgba(44, 24, 16, 0.3),
        0 8px 20px rgba(44, 24, 16, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    transform: perspective(800px) rotateX(3deg);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.6s ease;
}

.inflated-frame:hover {
    transform: perspective(800px) rotateX(5deg) scale(1.02);
    box-shadow:
        inset 0 -12px 35px rgba(160, 128, 96, 0.6),
        inset 0 12px 35px rgba(245, 230, 208, 0.9),
        0 30px 80px rgba(44, 24, 16, 0.35),
        0 12px 30px rgba(44, 24, 16, 0.2);
}

.inflated-frame__inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 80%;
}

/* --- Section II: Paradox Archive --- */
#paradox-archive {
    padding: 4rem 0;
}

.section-heading {
    margin-bottom: 0.25rem;
}

.paradox-cards {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.inflated-card {
    border-radius: 40px;
    background: linear-gradient(135deg, #EDE0D0 0%, #D4B896 60%, #C49A6C 100%);
    box-shadow:
        inset 0 -8px 20px rgba(160, 128, 96, 0.5),
        inset 0 8px 20px rgba(245, 230, 208, 0.8),
        0 20px 60px rgba(44, 24, 16, 0.25);
    transform: perspective(800px) rotateX(2deg);
    padding: 2rem 2.5rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s ease;
    position: relative;
    overflow: hidden;
}

.inflated-card:hover {
    transform: perspective(800px) rotateX(4deg) translateY(-4px);
    box-shadow:
        inset 0 -10px 25px rgba(160, 128, 96, 0.6),
        inset 0 10px 25px rgba(245, 230, 208, 0.9),
        0 30px 80px rgba(44, 24, 16, 0.3);
}

.inflated-card .accent-label {
    margin-bottom: 0.5rem;
    display: block;
}

.card-title {
    margin-bottom: 0.5rem;
}

.card-text {
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    color: #5D4037;
    line-height: 1.75;
}

/* --- Section III: Impossible Collection (Timeline) --- */
#impossible-collection {
    padding: 4rem 0;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-top: 2rem;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, #C49A6C, #C49A6C, transparent);
    opacity: 0.4;
}

.timeline-item {
    position: relative;
}

.timeline-item--left {
    transform: translateX(-20px);
}

.timeline-item--right {
    transform: translateX(20px);
}

.inflated-artifact {
    border-radius: 40px;
    background: linear-gradient(135deg, rgba(62, 39, 35, 0.8) 0%, rgba(44, 24, 16, 0.9) 100%);
    box-shadow:
        inset 0 -8px 20px rgba(160, 128, 96, 0.3),
        inset 0 8px 20px rgba(44, 24, 16, 0.5),
        0 20px 60px rgba(44, 24, 16, 0.4);
    padding: 2rem 2.5rem;
    transform: perspective(800px) rotateX(2deg);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s ease;
    position: relative;
    overflow: hidden;
}

.inflated-artifact:hover {
    transform: perspective(800px) rotateX(4deg) translateY(-4px);
    box-shadow:
        inset 0 -10px 25px rgba(160, 128, 96, 0.4),
        inset 0 10px 25px rgba(44, 24, 16, 0.6),
        0 30px 80px rgba(44, 24, 16, 0.5);
}

.artifact-texture {
    position: absolute;
    inset: 0;
    border-radius: 40px;
    background:
        repeating-linear-gradient(
            45deg,
            rgba(196, 154, 108, 0.05) 0px,
            rgba(196, 154, 108, 0.05) 1px,
            transparent 1px,
            transparent 3px
        );
    pointer-events: none;
}

.inflated-artifact .accent-label {
    margin-bottom: 0.5rem;
    display: block;
}

.artifact-text {
    color: #EDE0D0;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    line-height: 1.75;
}

/* --- Section IV: Final Paradox --- */
#final-paradox {
    text-align: center;
}

.final-heading {
    font-style: italic;
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    line-height: 1.3;
    margin-bottom: 3rem;
}

.final-inflated {
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(212, 184, 150, 0.3) 0%, rgba(196, 154, 108, 0.2) 100%);
    box-shadow:
        inset 0 -10px 30px rgba(160, 128, 96, 0.3),
        inset 0 10px 20px rgba(245, 230, 208, 0.2),
        0 20px 60px rgba(44, 24, 16, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    gap: 10px;
}

.final-attribution {
    margin-top: 1rem;
}

/* --- Skeleton Loading Elements --- */
.skeleton {
    border-radius: 8px;
    background: linear-gradient(90deg, #EDE0D0 25%, #D4B896 50%, #EDE0D0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite linear;
    height: 14px;
}

.skeleton--wide {
    width: 100%;
}

.skeleton--narrow {
    width: 60%;
}

.skeleton--thin {
    width: 80%;
    height: 10px;
    margin-top: 0.75rem;
}

.skeleton--dark {
    background: linear-gradient(90deg, rgba(160, 128, 96, 0.3) 25%, rgba(196, 154, 108, 0.4) 50%, rgba(160, 128, 96, 0.3) 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* --- Tropical Fish --- */
.fish-transition {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    height: 40px;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

.fish {
    position: absolute;
    width: 40px;
    height: 20px;
    color: #C49A6C;
    opacity: 0.4;
}

.fish--1 {
    animation: swimRight 20s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    top: 0;
}

.fish--2 {
    animation: swimRight 25s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    animation-delay: -8s;
    top: 12px;
    opacity: 0.25;
}

.fish--3 {
    animation: swimLeft 22s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    animation-delay: -5s;
    top: 5px;
    opacity: 0.3;
    transform: scaleX(-1);
}

.fish--4 {
    animation: swimRight 18s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    animation-delay: -3s;
    top: 8px;
}

.fish--5 {
    animation: swimLeft 23s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    animation-delay: -12s;
    top: 2px;
    opacity: 0.3;
    transform: scaleX(-1);
}

.fish--6 {
    animation: swimRight 20s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    animation-delay: -7s;
    top: 10px;
}

@keyframes swimRight {
    0% {
        left: -60px;
    }
    100% {
        left: calc(100% + 60px);
    }
}

@keyframes swimLeft {
    0% {
        left: calc(100% + 60px);
    }
    100% {
        left: -60px;
    }
}

/* --- Reveal animations --- */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered card reveals */
.inflated-card.reveal-element {
    transition-delay: 0s;
}

.inflated-card.reveal-element:nth-child(2) {
    transition-delay: 0.1s;
}

.inflated-card.reveal-element:nth-child(3) {
    transition-delay: 0.2s;
}

.inflated-card.reveal-element:nth-child(4) {
    transition-delay: 0.3s;
}

.inflated-card.reveal-element:nth-child(5) {
    transition-delay: 0.4s;
}

.inflated-card.reveal-element:nth-child(6) {
    transition-delay: 0.5s;
}

/* Timeline stagger */
.timeline-item.reveal-element:nth-child(2) {
    transition-delay: 0.15s;
}

.timeline-item.reveal-element:nth-child(3) {
    transition-delay: 0.3s;
}

.timeline-item.reveal-element:nth-child(4) {
    transition-delay: 0.45s;
}

.timeline-item.reveal-element:nth-child(5) {
    transition-delay: 0.6s;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section-inner {
        padding: 3rem 1.5rem;
    }

    .sway-right .section-inner,
    .sway-left .section-inner {
        margin-left: auto;
        margin-right: auto;
    }

    .inflated-card {
        padding: 1.5rem 1.75rem;
        border-radius: 30px;
    }

    .inflated-artifact {
        padding: 1.5rem 1.75rem;
        border-radius: 30px;
    }

    .timeline-item--left {
        transform: translateX(-10px);
    }

    .timeline-item--right {
        transform: translateX(10px);
    }

    .inflated-frame {
        width: 220px;
        height: 160px;
    }

    .final-inflated {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 480px) {
    .section-inner {
        padding: 2rem 1rem;
    }

    .inflated-card {
        padding: 1.25rem 1.5rem;
        border-radius: 24px;
    }

    .inflated-artifact {
        padding: 1.25rem 1.5rem;
        border-radius: 24px;
    }

    .inflated-frame {
        width: 180px;
        height: 130px;
    }
}
