/* ==============================================
   mujun.art - Expressive Abstract Painting Site
   ============================================== */

/* --- CSS Custom Properties --- */
:root {
    --deep-canvas: #1A0A20;
    --ruby-crimson: #C02040;
    --emerald-deep: #20A050;
    --sapphire-rich: #2040B0;
    --gold-pigment: #D0A030;
    --canvas-cream: #F0E8D0;
    --violet-shadow: #3A1A40;
}

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

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

body {
    background-color: var(--deep-canvas);
    color: var(--canvas-cream);
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(15px, 1.1vw, 18px);
    line-height: 1.75;
    overflow-x: hidden;
    cursor: crosshair;
}

/* --- Canvas Texture Overlay --- */
#canvas-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(240, 232, 208, 0.02) 2px,
        rgba(240, 232, 208, 0.02) 3px
    ),
    repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 2px,
        rgba(240, 232, 208, 0.02) 2px,
        rgba(240, 232, 208, 0.02) 3px
    );
    opacity: 1;
}

/* --- Splatter Container --- */
#splatter-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

#splatter-container svg {
    position: absolute;
    pointer-events: none;
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--deep-canvas);
}

#hero-painting {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-stroke {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    animation: drawStroke 2.5s ease-out forwards;
}

.stroke-ruby { animation-delay: 0s; }
.stroke-emerald { animation-delay: 0.3s; }
.stroke-sapphire { animation-delay: 0.6s; }
.stroke-gold { animation-delay: 0.9s; }
.stroke-ruby-accent { animation-delay: 1.4s; stroke-dasharray: 500; stroke-dashoffset: 500; }
.stroke-emerald-accent { animation-delay: 1.6s; stroke-dasharray: 500; stroke-dashoffset: 500; }
.stroke-sapphire-accent { animation-delay: 1.8s; stroke-dasharray: 500; stroke-dashoffset: 500; }

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

/* --- Hero Content --- */
#hero-content {
    position: relative;
    z-index: 10;
    text-align: left;
    padding-left: 8vw;
    padding-top: 5vh;
    width: 100%;
}

#logotype {
    font-family: 'Fraunces', serif;
    font-size: clamp(48px, 8vw, 120px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--canvas-cream);
    text-shadow: 0 0 60px rgba(192, 32, 64, 0.4), 0 0 120px rgba(32, 64, 176, 0.2);
    margin-bottom: 0.3em;
    display: inline-block;
}

#logotype .char {
    display: inline-block;
    font-variation-settings: 'wght' var(--wght, 200);
    opacity: 0;
    animation: charReveal 0.8s ease-out forwards;
    animation-delay: calc(1.5s + var(--i) * 0.1s);
    transition: font-variation-settings 0.3s ease;
}

#logotype .char.dot {
    color: var(--ruby-crimson);
}

@keyframes charReveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
        font-variation-settings: 'wght' 200;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

#hero-tagline {
    opacity: 0;
    animation: fadeInUp 1s ease-out 2.8s forwards;
    font-size: clamp(18px, 1.5vw, 26px);
    color: var(--gold-pigment);
    margin-top: 0.5em;
}

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

/* --- Hero Splatters --- */
.hero-splatter {
    position: absolute;
    width: 120px;
    height: 120px;
    z-index: 5;
    opacity: 0;
    transform: scale(0);
    animation: splatterBurst 0.5s ease-out forwards;
}

.splatter-1 {
    top: 20%;
    right: 15%;
    animation-delay: 2s;
}

.splatter-2 {
    bottom: 25%;
    right: 30%;
    animation-delay: 2.2s;
    width: 90px;
    height: 90px;
}

.splatter-3 {
    bottom: 15%;
    left: 25%;
    animation-delay: 2.4s;
    width: 100px;
    height: 100px;
}

@keyframes splatterBurst {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    60% {
        opacity: 1;
        transform: scale(1.2) rotate(15deg);
    }
    100% {
        opacity: 0.8;
        transform: scale(1) rotate(10deg);
    }
}

/* --- Caveat handwritten font --- */
.caveat-text {
    font-family: 'Caveat', cursive;
    font-weight: 400;
}

.label-text {
    display: block;
    font-size: clamp(16px, 1.2vw, 20px);
    color: var(--gold-pigment);
    margin-bottom: 0.5em;
    opacity: 0.9;
}

/* --- Organic Sections --- */
.organic-section {
    position: relative;
    min-height: 80vh;
    padding: 10vh 0;
    overflow: hidden;
}

.section-bg-painting {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.organic-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    padding: 4vh 5vw;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.content-left {
    margin-left: 8vw;
    clip-path: polygon(5% 0%, 98% 3%, 100% 92%, 2% 100%);
    background: rgba(58, 26, 64, 0.4);
    padding: 6vh 5vw;
}

.content-right {
    margin-left: auto;
    margin-right: 8vw;
    clip-path: polygon(2% 4%, 95% 0%, 100% 95%, 0% 100%);
    background: rgba(58, 26, 64, 0.4);
    padding: 6vh 5vw;
}

.content-center {
    margin-left: auto;
    margin-right: auto;
    max-width: 800px;
    clip-path: polygon(3% 0%, 100% 2%, 97% 98%, 0% 100%);
    background: rgba(58, 26, 64, 0.4);
    padding: 6vh 5vw;
}

/* --- Section Titles --- */
.section-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(36px, 6vw, 80px);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1em;
    color: var(--canvas-cream);
}

/* --- Body Text --- */
.body-text {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(15px, 1.1vw, 18px);
    line-height: 1.75;
    color: var(--canvas-cream);
    margin-bottom: 1.2em;
    opacity: 0.92;
}

/* --- Color Swatches --- */
#color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
    margin: 2em 0 2.5em;
    justify-content: center;
}

.swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.swatch:hover {
    transform: scale(1.15) rotate(-3deg);
}

.swatch-blob {
    width: 60px;
    height: 60px;
    border-radius: 50% 45% 55% 40% / 45% 55% 40% 50%;
    background-color: var(--swatch-color);
    box-shadow: 0 4px 30px color-mix(in srgb, var(--swatch-color) 50%, transparent);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.swatch:hover .swatch-blob {
    transform: scale(1.1);
    box-shadow: 0 8px 50px color-mix(in srgb, var(--swatch-color) 70%, transparent);
}

.swatch span {
    font-size: clamp(14px, 1vw, 18px);
    color: var(--canvas-cream);
    opacity: 0.8;
}

/* --- Signature --- */
.signature-text {
    font-size: clamp(28px, 3vw, 48px);
    color: var(--ruby-crimson);
    text-align: center;
    margin-top: 1em;
    display: block;
}

/* --- Interactive Splatter Animation --- */
@keyframes interactiveSplatter {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3) rotate(20deg);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(15deg);
        opacity: 0;
    }
}

.interactive-splatter {
    animation: interactiveSplatter 0.8s ease-out forwards;
}

/* --- Gestural flow for sections --- */
#studio {
    margin-top: -5vh;
}

#process .organic-content {
    transition-delay: 0.1s;
}

#palette .organic-content {
    transition-delay: 0.15s;
}

#work .organic-content {
    transition-delay: 0.1s;
}

#invitation .organic-content {
    transition-delay: 0.15s;
}

/* --- Section-specific stroke accents --- */
#studio::before,
#process::before,
#palette::before,
#work::before,
#invitation::before {
    content: '';
    position: absolute;
    width: 120%;
    height: 3px;
    top: 0;
    left: -10%;
    z-index: 1;
    opacity: 0.3;
}

#studio::before { background: linear-gradient(90deg, transparent, var(--ruby-crimson), transparent); }
#process::before { background: linear-gradient(90deg, transparent, var(--emerald-deep), transparent); }
#palette::before { background: linear-gradient(90deg, transparent, var(--sapphire-rich), transparent); }
#work::before { background: linear-gradient(90deg, transparent, var(--gold-pigment), transparent); }
#invitation::before { background: linear-gradient(90deg, transparent, var(--ruby-crimson), transparent); }

/* --- Responsive --- */
@media (max-width: 768px) {
    #hero-content {
        padding-left: 5vw;
        text-align: center;
        padding-top: 0;
    }

    .content-left,
    .content-right,
    .content-center {
        margin-left: 5vw;
        margin-right: 5vw;
        max-width: 100%;
        clip-path: polygon(2% 0%, 100% 1%, 98% 99%, 0% 100%);
    }

    .section-title {
        font-size: clamp(28px, 8vw, 50px);
    }

    #color-swatches {
        gap: 1.2em;
    }

    .swatch-blob {
        width: 45px;
        height: 45px;
    }

    .hero-splatter {
        width: 80px;
        height: 80px;
    }

    .splatter-2, .splatter-3 {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    #logotype {
        font-size: clamp(36px, 12vw, 70px);
    }

    .organic-section {
        min-height: 60vh;
        padding: 6vh 0;
    }
}
