/* ============================================================
   MECHANIC.STREAM - GOBLINCORE WORKSHOP AESTHETIC
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Color Palette */
:root {
    --bg-earth: #1C1E18;
    --surface-bark: #2A2C22;
    --forest-primary: #3A5A3A;
    --forest-light: #5A8A5A;
    --earth-warm: #8B6F4A;
    --text-primary: #E2D9CC;
    --text-secondary: #C4B8A4;
    --text-muted: #A89B88;
    --status-text: #7A8A6A;
    --crystal-accent: #C4D4CC;
    --rust-accent: #A05A3A;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--bg-earth);
    color: var(--text-primary);
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: 0.9rem;
    line-height: 1.7;
    overflow-x: hidden;
    animation: bgFadeIn 800ms ease-out forwards;
}

@keyframes bgFadeIn {
    from {
        background-color: #000000;
    }
    to {
        background-color: var(--bg-earth);
    }
}

/* Main Grid Container */
.composition-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 60px;
    width: 100vw;
    gap: 0;
    padding: 0;
    margin: 0;
}

/* ============================================================
   ZONE A: WELCOME
   ============================================================ */

.zone-a {
    grid-column: 1 / 13;
    grid-row: 1 / 13;
    position: relative;
}

.site-title {
    grid-column: 2 / 8;
    grid-row: 2 / 5;
    font-family: 'Zilla Slab', serif;
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    line-height: 1.1;
    align-self: center;
    animation: titleSlideIn 600ms ease-out forwards;
    animation-delay: 200ms;
    opacity: 0;
}

@keyframes titleSlideIn {
    from {
        transform: translateX(-15px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.site-subtitle {
    grid-column: 3 / 9;
    grid-row: 5 / 6;
    font-family: 'Nunito', sans-serif;
    font-size: clamp(0.85rem, 2vw, 1.1rem);
    font-weight: 300;
    color: var(--text-muted);
    margin-top: 0.5rem;
    animation: fadeIn 800ms ease-out forwards;
    animation-delay: 500ms;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.wash-welcome {
    grid-column: 8 / 13;
    grid-row: 1 / 9;
    position: relative;
    overflow: visible;
    background: radial-gradient(circle at 30% 40%, rgba(90, 138, 90, 0.35) 0%, transparent 60%),
                radial-gradient(circle at 70% 60%, rgba(139, 111, 74, 0.25) 0%, transparent 65%),
                radial-gradient(circle at 50% 20%, rgba(90, 138, 90, 0.2) 0%, transparent 55%);
    clip-path: polygon(
        15% 5%, 28% 2%, 42% 3%, 58% 1%, 72% 4%, 85% 2%, 95% 8%,
        98% 22%, 99% 38%, 100% 55%, 98% 70%, 97% 85%, 95% 95%,
        78% 100%, 62% 98%, 45% 100%, 28% 97%, 12% 98%, 2% 95%,
        1% 78%, 0% 60%, 1% 42%, 0% 25%, 2% 10%
    );
    animation: washFadeIn 1500ms ease-out forwards;
    animation-delay: 400ms;
    opacity: 0;
}

@keyframes washFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================================
   ZONE B: STREAM BLOCKS
   ============================================================ */

.zone-b {
    grid-column: 1 / 13;
    grid-row: 10 / 30;
    position: relative;
}

.stream-block {
    position: relative;
    background-color: var(--surface-bark);
    border: 1px solid var(--forest-primary);
    padding: 16px;
    transform-origin: center;
}

.stream-block-1 {
    grid-column: 2 / 6;
    grid-row: 11 / 17;
    transform: rotate(-1.5deg);
    animation: blockFadeIn 500ms ease-out forwards;
    animation-delay: 300ms;
}

.stream-block-2 {
    grid-column: 7 / 11;
    grid-row: 13 / 19;
    transform: rotate(1.2deg);
    animation: blockFadeIn 500ms ease-out forwards;
    animation-delay: 400ms;
}

.stream-block-3 {
    grid-column: 3 / 8;
    grid-row: 18 / 24;
    transform: rotate(-0.8deg);
    animation: blockFadeIn 500ms ease-out forwards;
    animation-delay: 500ms;
}

.stream-block-4 {
    grid-column: 9 / 13;
    grid-row: 20 / 26;
    transform: rotate(1.5deg);
    animation: blockFadeIn 500ms ease-out forwards;
    animation-delay: 600ms;
}

.stream-block-5 {
    grid-column: 2 / 7;
    grid-row: 24 / 30;
    transform: rotate(0.9deg);
    animation: blockFadeIn 500ms ease-out forwards;
    animation-delay: 700ms;
}

@keyframes blockFadeIn {
    from {
        opacity: 0;
        transform: rotate(0deg) translateY(10px);
    }
    to {
        opacity: 1;
        transform: rotate(inherit);
    }
}

.stream-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stream-preview-image {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, var(--forest-primary) 0%, var(--surface-bark) 100%);
    clip-path: polygon(2% 4%, 15% 1%, 32% 3%, 48% 0%, 67% 2%, 82% 1%, 96% 3%, 100% 8%, 98% 25%, 100% 42%, 99% 58%, 100% 75%, 98% 92%, 96% 100%, 82% 98%, 65% 100%, 48% 97%, 33% 100%, 16% 98%, 2% 100%, 0% 85%, 1% 65%, 0% 45%, 1% 28%, 0% 12%);
}

.stream-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stream-title {
    font-family: 'Zilla Slab', serif;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0;
}

.stream-streamer {
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    margin: 0;
}

.stream-status {
    font-family: 'Inconsolata', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    align-self: flex-start;
    padding: 4px 8px;
    border-radius: 2px;
    background-color: rgba(58, 90, 58, 0.3);
    color: var(--status-text);
}

.stream-status-live {
    color: #A5FF7F;
    background-color: rgba(165, 255, 127, 0.1);
}

.stream-status-replay {
    color: var(--text-muted);
    background-color: rgba(168, 155, 136, 0.1);
}

.wash-stream {
    grid-column: 1 / 13;
    grid-row: 14 / 28;
    position: relative;
    overflow: visible;
    background: radial-gradient(circle at 25% 50%, rgba(90, 138, 90, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 75% 30%, rgba(139, 111, 74, 0.12) 0%, transparent 55%);
    pointer-events: none;
    z-index: -1;
    animation: washFadeIn 1500ms ease-out forwards;
    animation-delay: 800ms;
    opacity: 0;
}

/* ============================================================
   ZONE C: COLLECTION SHELF
   ============================================================ */

.zone-c {
    grid-column: 1 / 13;
    grid-row: 28 / 40;
    position: relative;
}

.collection-title {
    grid-column: 2 / 8;
    grid-row: 28 / 30;
    font-family: 'Zilla Slab', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    align-self: center;
    animation: fadeIn 800ms ease-out forwards;
    animation-delay: 1000ms;
    opacity: 0;
}

.collection-shelf {
    grid-column: 1 / 13;
    grid-row: 30 / 38;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    align-content: center;
    padding: 20px;
}

.collection-item {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    animation: itemSlideIn 400ms ease-out forwards;
}

.collection-item:nth-child(1) {
    animation-delay: 1100ms;
}

.collection-item:nth-child(2) {
    animation-delay: 1180ms;
    margin-left: 15px;
}

.collection-item:nth-child(3) {
    animation-delay: 1260ms;
    margin-left: -8px;
}

.collection-item:nth-child(4) {
    animation-delay: 1340ms;
    margin-left: 12px;
}

.collection-item:nth-child(5) {
    animation-delay: 1420ms;
    margin-left: -5px;
}

.collection-item:nth-child(6) {
    animation-delay: 1500ms;
    margin-left: 10px;
}

.collection-item:nth-child(7) {
    animation-delay: 1580ms;
    margin-left: -3px;
}

.collection-item:nth-child(8) {
    animation-delay: 1660ms;
    margin-left: 8px;
}

@keyframes itemSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px) translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

.item-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.crystal {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: var(--crystal-accent);
    transform: rotate(45deg);
    top: 50%;
    left: 50%;
    margin: -2px 0 0 -2px;
    animation: sparkle 800ms ease-in-out infinite;
}

.crystal-1 {
    animation-delay: 2000ms;
}

.crystal-2 {
    animation-delay: 3200ms;
}

.crystal-3 {
    animation-delay: 4100ms;
}

.crystal-4 {
    animation-delay: 2800ms;
}

.crystal-5 {
    animation-delay: 5200ms;
}

.crystal-6 {
    animation-delay: 3500ms;
}

.crystal-7 {
    animation-delay: 6000ms;
}

.crystal-8 {
    animation-delay: 4700ms;
}

@keyframes sparkle {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    20% {
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

.wash-collection {
    grid-column: 1 / 13;
    grid-row: 32 / 38;
    position: relative;
    overflow: visible;
    background: radial-gradient(circle at 40% 60%, rgba(196, 212, 204, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 45%, rgba(90, 138, 90, 0.1) 0%, transparent 55%);
    pointer-events: none;
    z-index: -1;
    animation: washFadeIn 1500ms ease-out forwards;
    animation-delay: 1200ms;
    opacity: 0;
}

/* ============================================================
   ZONE D: CLOSING
   ============================================================ */

.zone-d {
    grid-column: 1 / 13;
    grid-row: 38 / 48;
    position: relative;
}

.closing-text {
    grid-column: 3 / 8;
    grid-row: 39 / 42;
    font-family: 'Zilla Slab', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    align-self: center;
    animation: fadeIn 2000ms ease-out forwards;
    animation-delay: 1500ms;
    opacity: 0;
}

.wash-closing {
    grid-column: 1 / 13;
    grid-row: 42 / 48;
    position: relative;
    overflow: visible;
    background: linear-gradient(180deg, rgba(58, 90, 58, 0.15) 0%, transparent 100%),
                radial-gradient(circle at 50% 50%, rgba(139, 111, 74, 0.08) 0%, transparent 70%);
    animation: washFadeIn 2000ms ease-out forwards;
    animation-delay: 1800ms;
    opacity: 0;
}

/* ============================================================
   SCROLL INTERACTION
   ============================================================ */

.stream-block {
    transition: transform 400ms ease-out;
}

/* ============================================================
   RESPONSIVE: MOBILE
   ============================================================ */

@media (max-width: 768px) {
    .composition-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 50px;
    }

    .site-title {
        grid-column: 1 / 5;
        grid-row: 2 / 4;
        font-size: 2rem;
    }

    .site-subtitle {
        grid-column: 1 / 5;
        grid-row: 4 / 5;
        font-size: 0.85rem;
    }

    .wash-welcome {
        grid-column: 1 / 5;
        grid-row: 1 / 6;
        background: radial-gradient(circle at 30% 40%, rgba(90, 138, 90, 0.2) 0%, transparent 60%);
    }

    .stream-block-1 {
        grid-column: 1 / 5;
        grid-row: 11 / 16;
        transform: rotate(0deg);
    }

    .stream-block-2 {
        grid-column: 1 / 5;
        grid-row: 16 / 21;
        transform: rotate(0deg);
    }

    .stream-block-3 {
        grid-column: 1 / 5;
        grid-row: 21 / 26;
        transform: rotate(0deg);
    }

    .stream-block-4 {
        grid-column: 1 / 5;
        grid-row: 26 / 31;
        transform: rotate(0deg);
    }

    .stream-block-5 {
        grid-column: 1 / 5;
        grid-row: 31 / 36;
        transform: rotate(0deg);
    }

    .collection-shelf {
        grid-column: 1 / 5;
        grid-row: 37 / 42;
        flex-direction: row;
        overflow-x: auto;
        padding: 16px 8px;
    }

    .collection-item {
        width: 70px;
        height: 70px;
    }

    .closing-text {
        grid-column: 1 / 5;
        grid-row: 43 / 46;
        font-size: 1.4rem;
    }

    .wash-closing {
        grid-row: 45 / 52;
    }
}
