/* ============================================
   mujun.works - Neubrutalist Portfolio
   ============================================ */

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

html {
    scroll-behavior: auto;
}

body {
    background: #1A2040;
    color: #C0C8D0;
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
h1, h2 {
    font-family: 'Roboto Slab', serif;
    margin: 0;
}

h1 {
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 8rem);
    letter-spacing: -0.02em;
    color: #C0C8D0;
}

h2 {
    font-weight: 600;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    letter-spacing: 0em;
    color: #C0C8D0;
}

/* --- HERO --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #1A2040;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#hero-blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.blob {
    position: absolute;
    fill: #3A4A68;
    opacity: 0.4;
}

.blob-1 {
    width: 500px;
    height: 500px;
    top: -10%;
    left: -5%;
    animation: floatBlob1 20s ease-in-out infinite;
}

.blob-2 {
    width: 400px;
    height: 400px;
    bottom: -8%;
    right: -3%;
    animation: floatBlob2 25s ease-in-out infinite;
}

.blob-3 {
    width: 350px;
    height: 350px;
    top: 20%;
    right: 15%;
    animation: floatBlob3 22s ease-in-out infinite;
}

@keyframes floatBlob1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, 30px) scale(1.05); }
    50% { transform: translate(20px, -20px) scale(0.95); }
    75% { transform: translate(-30px, 15px) scale(1.02); }
}

@keyframes floatBlob2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-35px, -25px) scale(1.03); }
    50% { transform: translate(-15px, 30px) scale(0.97); }
    75% { transform: translate(25px, -10px) scale(1.04); }
}

@keyframes floatBlob3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -35px) scale(1.06); }
    66% { transform: translate(-25px, 20px) scale(0.94); }
}

/* --- Hero Title Characters --- */
#hero-title {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
}

.char {
    display: inline-block;
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 8rem);
    letter-spacing: -0.02em;
    color: #C0C8D0;
    border: 4px solid #C0C8D0;
    padding: 0.2em 0.3em;
    margin: 0.1em;
    transform: rotate(var(--char-rotate));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    background: rgba(26, 32, 64, 0.6);
    user-select: none;
}

.char:hover {
    box-shadow: 8px 8px 0 #0A1020;
    transform: rotate(var(--char-rotate)) translate(-2px, -2px);
}

.char-dot {
    border-color: #4A6090;
    color: #4A6090;
}

/* --- MANIFESTO STRIP --- */
#manifesto-strip {
    width: 100%;
    height: 80px;
    background: #C0C8D0;
    overflow: hidden;
    display: flex;
    align-items: center;
    border-top: 4px solid #1A2040;
    border-bottom: 4px solid #1A2040;
}

.manifesto-scroll {
    display: inline-flex;
    white-space: nowrap;
    animation: scrollText 20s linear infinite;
}

.manifesto-text {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: #1A2040;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 0 0.5em;
    flex-shrink: 0;
}

@keyframes scrollText {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes charPulse {
    0% {
        opacity: 0;
        transform: rotate(var(--char-rotate)) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: rotate(var(--char-rotate)) scale(1);
    }
}

@keyframes cardEnter {
    0% {
        opacity: 0;
        transform: translateY(30px) rotate(inherit);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(inherit);
    }
}

@keyframes blobOpacity {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.6; }
}

/* --- WORKS GRID --- */
#works-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    background: #1A2040;
}

/* --- CARD --- */
.card {
    perspective: 1200px;
    height: max(400px, 50vh);
    cursor: pointer;
    border: 4px solid #1A2040;
    position: relative;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    overflow: hidden;
}

/* --- Card Front --- */
.card-front {
    background: #F0F2F4;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem 2.5rem;
    box-shadow: 8px 8px 0 #0A1020;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card-front h2 {
    color: #1A2040;
    line-height: 1.1;
}

.card:hover .card-front {
    box-shadow: 4px 4px 0 #0A1020;
}

.card-label {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6A7080;
}

.card-label-bottom {
    align-self: flex-end;
}

/* --- Card Back --- */
.card-back {
    background: #2A3458;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2.5rem;
    text-align: center;
    position: relative;
}

.back-curves {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.back-curves path {
    fill: none;
    stroke: #C0C8D0;
    stroke-width: 1.5;
    opacity: 0.3;
}

.card-description {
    position: relative;
    z-index: 2;
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    line-height: 1.75;
    color: #E0E4E8;
    max-width: 340px;
    margin-bottom: 1.5rem;
}

.card-back .card-label {
    position: relative;
    z-index: 2;
    color: #8A90A0;
}

/* --- Card States & Interactions --- */
/* Odd cards rotate slightly */
.card:nth-child(odd) {
    transform: rotate(0.5deg);
}

.card:nth-child(even) {
    transform: rotate(-0.3deg);
}

/* Hard shadow press interaction on front face */
.card:not(.flipped):hover {
    z-index: 5;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #works-grid {
        grid-template-columns: 1fr;
    }

    .char {
        font-size: clamp(2rem, 8vw, 4rem);
        padding: 0.15em 0.2em;
        margin: 0.06em;
        border-width: 3px;
    }

    #hero-title {
        padding: 0 1rem;
    }

    .card {
        height: max(350px, 45vh);
    }

    .card-front {
        padding: 1.5rem 1.8rem;
    }

    .card-back {
        padding: 1.8rem;
    }

    .blob-1 {
        width: 300px;
        height: 300px;
    }

    .blob-2 {
        width: 250px;
        height: 250px;
    }

    .blob-3 {
        width: 200px;
        height: 200px;
    }
}

/* --- No scroll bar styling (keep raw) --- */
/* --- No footer, no closing. The page simply stops. --- */
