/* ==========================================================
   musical.quest — anti-design mountain soundscape
   ========================================================== */

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

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

body {
    background: #FAF8FC;
    color: #3A3040;
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* --- Z-0: GRADIENT WASH LAYER --- */
.gradient-wash-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.gradient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    will-change: transform;
}

.blob-purple {
    width: 60vw;
    height: 60vw;
    max-width: 700px;
    max-height: 700px;
    background: #D0A0E0;
    top: -15%;
    left: -10%;
    animation: blobDrift1 18s ease-in-out infinite alternate;
}

.blob-blue {
    width: 50vw;
    height: 50vw;
    max-width: 600px;
    max-height: 600px;
    background: #A0D0E0;
    top: 30%;
    right: -15%;
    animation: blobDrift2 22s ease-in-out infinite alternate;
}

.blob-gold {
    width: 45vw;
    height: 45vw;
    max-width: 550px;
    max-height: 550px;
    background: #E0D0A0;
    bottom: -10%;
    left: 20%;
    animation: blobDrift3 20s ease-in-out infinite alternate;
}

@keyframes blobDrift1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(8vw, 12vh) scale(1.15); }
}

@keyframes blobDrift2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-10vw, -8vh) scale(1.1); }
}

@keyframes blobDrift3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(6vw, -10vh) scale(1.2); }
}

/* --- Z-1: MOUNTAIN SILHOUETTES (background) --- */
.mountain-range {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40vh;
    z-index: 1;
    pointer-events: none;
}

.mountain-range-back {
    z-index: 1;
    opacity: 0.6;
}

.mountain-range-mid {
    z-index: 2;
    opacity: 0.4;
}

/* --- Z-2: FLOATING ILLUSTRATIONS --- */
.floating-illustrations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    overflow: hidden;
}

.float-illust {
    position: absolute;
    opacity: 0.12;
    will-change: transform;
}

.illust-treble {
    width: 80px;
    top: 8%;
    left: 5%;
    animation: floatUp 14s ease-in-out infinite alternate;
}

.illust-guitar {
    width: 60px;
    top: 45%;
    right: 4%;
    animation: floatUp 18s ease-in-out infinite alternate-reverse;
}

.illust-vinyl {
    width: 120px;
    top: 70%;
    left: 8%;
    animation: vinylSpin 30s linear infinite;
}

.illust-wave {
    width: 160px;
    top: 25%;
    right: 12%;
    animation: floatUp 12s ease-in-out infinite alternate;
}

.illust-headphones {
    width: 90px;
    bottom: 15%;
    right: 20%;
    animation: floatUp 16s ease-in-out infinite alternate-reverse;
}

@keyframes floatUp {
    0% { transform: translateY(0); }
    100% { transform: translateY(-30px); }
}

@keyframes vinylSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Z-3: BOUNCING NOTES --- */
.bouncing-notes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
}

.note {
    position: absolute;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #3A2040;
    opacity: 0.1;
    will-change: transform;
}

.note-1 {
    top: 12%;
    left: 20%;
    animation: noteBounce1 5s ease-in-out infinite;
}

.note-2 {
    top: 35%;
    left: 75%;
    animation: noteBounce2 6s ease-in-out infinite;
}

.note-3 {
    top: 55%;
    left: 40%;
    animation: noteBounce1 7s ease-in-out infinite;
}

.note-4 {
    top: 80%;
    left: 60%;
    animation: noteBounce2 4.5s ease-in-out infinite;
}

.note-5 {
    top: 20%;
    left: 90%;
    animation: noteBounce1 5.5s ease-in-out infinite;
}

.note-6 {
    top: 65%;
    left: 10%;
    animation: noteBounce2 6.5s ease-in-out infinite;
}

.note-7 {
    top: 90%;
    left: 30%;
    animation: noteBounce1 4s ease-in-out infinite;
}

@keyframes noteBounce1 {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-25px); }
}

@keyframes noteBounce2 {
    0%, 100% { transform: translateY(0) translateX(0); }
    33% { transform: translateY(-15px) translateX(8px); }
    66% { transform: translateY(-20px) translateX(-5px); }
}

/* --- CONTENT LAYER --- */
.content-layer {
    position: relative;
    z-index: 10;
}

/* --- OPENING CHAOS --- */
.opening-chaos {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 6vw;
    position: relative;
}

.title-stack {
    display: flex;
    flex-direction: column;
    position: relative;
    line-height: 0.85;
}

.title-line {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    color: #1A1020;
    display: block;
}

.title-line-musical {
    font-size: clamp(4rem, 14vw, 12rem);
    letter-spacing: -0.03em;
    margin-left: -0.04em;
    transform: rotate(-2deg);
    transform-origin: left bottom;
}

.title-line-quest {
    font-size: clamp(3.5rem, 12vw, 10rem);
    letter-spacing: 0.05em;
    margin-left: 15vw;
    transform: rotate(1.5deg);
    transform-origin: left top;
}

.title-dot {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(5rem, 16vw, 14rem);
    color: #D0A0E0;
    line-height: 0.5;
    margin-left: 8vw;
    display: block;
}

.opening-tagline {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.75rem, 1.2vw, 1rem);
    color: #7A6080;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 3rem;
    margin-left: 15vw;
}

.waveform-bar {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 60px;
    margin-top: 2rem;
    margin-left: 15vw;
}

.wf-bar {
    display: block;
    width: 3px;
    background: #3A2040;
    opacity: 0.3;
    border-radius: 2px;
    animation: wfPulse var(--wf-speed, 1s) ease-in-out infinite alternate;
    height: var(--wf-h, 20px);
}

.wf-bar:nth-child(1)  { --wf-h: 15px; --wf-speed: 0.8s; }
.wf-bar:nth-child(2)  { --wf-h: 30px; --wf-speed: 0.6s; }
.wf-bar:nth-child(3)  { --wf-h: 50px; --wf-speed: 0.9s; }
.wf-bar:nth-child(4)  { --wf-h: 35px; --wf-speed: 0.5s; }
.wf-bar:nth-child(5)  { --wf-h: 55px; --wf-speed: 1.1s; }
.wf-bar:nth-child(6)  { --wf-h: 25px; --wf-speed: 0.7s; }
.wf-bar:nth-child(7)  { --wf-h: 45px; --wf-speed: 0.85s; }
.wf-bar:nth-child(8)  { --wf-h: 60px; --wf-speed: 0.55s; }
.wf-bar:nth-child(9)  { --wf-h: 30px; --wf-speed: 1.0s; }
.wf-bar:nth-child(10) { --wf-h: 48px; --wf-speed: 0.65s; }
.wf-bar:nth-child(11) { --wf-h: 20px; --wf-speed: 0.95s; }
.wf-bar:nth-child(12) { --wf-h: 55px; --wf-speed: 0.5s; }
.wf-bar:nth-child(13) { --wf-h: 35px; --wf-speed: 0.75s; }
.wf-bar:nth-child(14) { --wf-h: 50px; --wf-speed: 1.2s; }
.wf-bar:nth-child(15) { --wf-h: 15px; --wf-speed: 0.6s; }
.wf-bar:nth-child(16) { --wf-h: 40px; --wf-speed: 0.85s; }
.wf-bar:nth-child(17) { --wf-h: 55px; --wf-speed: 0.5s; }
.wf-bar:nth-child(18) { --wf-h: 25px; --wf-speed: 1.0s; }
.wf-bar:nth-child(19) { --wf-h: 48px; --wf-speed: 0.7s; }
.wf-bar:nth-child(20) { --wf-h: 32px; --wf-speed: 0.9s; }
.wf-bar:nth-child(21) { --wf-h: 58px; --wf-speed: 0.55s; }
.wf-bar:nth-child(22) { --wf-h: 20px; --wf-speed: 0.8s; }
.wf-bar:nth-child(23) { --wf-h: 42px; --wf-speed: 1.1s; }
.wf-bar:nth-child(24) { --wf-h: 30px; --wf-speed: 0.65s; }

@keyframes wfPulse {
    0% { height: var(--wf-h); opacity: 0.3; }
    100% { height: calc(var(--wf-h) * 0.3); opacity: 0.15; }
}

/* --- MOUNTAIN DIVIDERS --- */
.mountain-divider {
    display: block;
    width: 100%;
    height: 80px;
    margin: -1px 0;
    position: relative;
    z-index: 10;
}

.mountain-divider-2 {
    height: 100px;
}

.mountain-divider-3 {
    height: 70px;
}

/* --- MONO LABEL --- */
.mono-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.65rem, 0.9vw, 0.8rem);
    color: #7A6080;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* --- QUEST MAP ZONE --- */
.quest-map-zone {
    padding: 8vh 6vw 12vh;
    position: relative;
}

.quest-label {
    margin-bottom: 4rem;
}

.quest-scatter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 0;
    position: relative;
}

.quest-card {
    padding: 2.5rem;
    position: relative;
    border: 1px solid rgba(58, 32, 64, 0.08);
    transition: background-color 0.4s ease;
}

.quest-card:hover {
    background-color: rgba(208, 160, 224, 0.06);
}

.quest-card-1 {
    grid-column: 1;
    grid-row: 1;
    padding-right: 15%;
}

.quest-card-2 {
    grid-column: 2;
    grid-row: 1;
    margin-top: 6rem;
    padding-left: 10%;
}

.quest-card-3 {
    grid-column: 1;
    grid-row: 2;
    margin-top: -3rem;
    margin-left: 10%;
}

.quest-card-4 {
    grid-column: 2;
    grid-row: 2;
    margin-top: 2rem;
    margin-right: 5%;
}

.quest-number {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(3rem, 6vw, 5rem);
    color: #D0A0E0;
    opacity: 0.3;
    display: block;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.quest-title {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: #1A1020;
    margin-bottom: 0.8rem;
    line-height: 1.1;
}

.quest-desc {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    color: #3A3040;
    max-width: 360px;
}

/* --- SOUND ATLAS --- */
.sound-atlas {
    padding: 10vh 6vw 12vh;
    position: relative;
}

.atlas-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.atlas-title {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 7vw, 5rem);
    color: #1A1020;
    line-height: 0.9;
    transform: rotate(-3deg);
    transform-origin: left bottom;
}

.atlas-coord {
    padding-bottom: 0.5rem;
}

.atlas-terrain {
    display: grid;
    grid-template-columns: 1fr 0.8fr 1fr;
    gap: 3vw;
    align-items: start;
}

.terrain-block {
    background: rgba(208, 160, 224, 0.06);
    border: 1px solid rgba(58, 32, 64, 0.06);
    padding: 2rem;
    margin-bottom: 2rem;
}

.terrain-block-tall {
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.terrain-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #7A6080;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 1.5rem;
}

.terrain-vis {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 100px;
}

.amp-bar {
    width: 12px;
    background: linear-gradient(to top, #D0A0E0, #A0D0E0);
    border-radius: 2px 2px 0 0;
    transition: height 0.5s ease;
    animation: ampPulse 2s ease-in-out infinite alternate;
}

.amp-bar:nth-child(odd) {
    animation-delay: 0.3s;
}

.amp-bar:nth-child(3n) {
    animation-delay: 0.7s;
}

@keyframes ampPulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

.timbre-svg {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    display: block;
    flex-grow: 1;
}

.terrain-text {
    font-weight: 300;
    color: #3A3040;
    line-height: 1.8;
}

.terrain-text-offset {
    margin-top: 4rem;
    margin-bottom: 2rem;
}

.terrain-col-2 {
    margin-top: 3rem;
}

.decay-visual {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.decay-line {
    height: 2px;
    background: linear-gradient(to right, #3A2040, transparent);
    border-radius: 1px;
}

.decay-line:nth-child(1) { width: 100%; opacity: 0.8; }
.decay-line:nth-child(2) { width: 80%; opacity: 0.6; }
.decay-line:nth-child(3) { width: 55%; opacity: 0.4; }
.decay-line:nth-child(4) { width: 30%; opacity: 0.25; }
.decay-line:nth-child(5) { width: 12%; opacity: 0.12; }

/* --- POSTER WALL --- */
.poster-wall {
    padding: 8vh 4vw 10vh;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 1fr 0.9fr;
    grid-template-rows: auto;
    gap: 2vw;
    align-items: start;
    position: relative;
}

.poster {
    border: 2px solid #3A2040;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.poster:hover {
    box-shadow: 8px 8px 0 rgba(58, 32, 64, 0.1);
}

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

.poster-1 {
    background: linear-gradient(135deg, #D0A0E0 0%, #FAF8FC 100%);
    margin-top: 0;
}

.poster-2 {
    background: linear-gradient(180deg, #E0D0A0 0%, #FAF8FC 100%);
    margin-top: 8rem;
}

.poster-3 {
    background: linear-gradient(225deg, #A0D0E0 0%, #FAF8FC 100%);
    margin-top: 3rem;
}

.poster-4 {
    background: linear-gradient(160deg, #D0A0E0 0%, #E0D0A0 50%, #FAF8FC 100%);
    margin-top: 12rem;
}

.poster-date {
    display: block;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(58, 32, 64, 0.15);
    padding-bottom: 0.75rem;
}

.poster-headline {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    color: #1A1020;
    line-height: 0.95;
    margin-bottom: 1.2rem;
}

.poster-sub {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    color: #3A3040;
    line-height: 1.6;
}

/* --- EXPEDITION LOG --- */
.expedition-log {
    padding: 10vh 6vw 12vh;
    position: relative;
}

.exp-header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.exp-title {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 7vw, 5rem);
    color: #1A1020;
    line-height: 0.9;
}

.exp-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
}

.exp-entries {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 900px;
    margin-left: 10vw;
}

.exp-entry {
    padding: 2.5rem 0;
    border-top: 1px solid rgba(58, 32, 64, 0.08);
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 2rem;
    align-items: start;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.exp-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

.exp-time {
    padding-top: 0.3rem;
}

.exp-text {
    font-weight: 300;
    color: #3A3040;
}

.exp-entry-1 { margin-left: 0; }
.exp-entry-2 { margin-left: 3vw; }
.exp-entry-3 { margin-left: 1vw; }
.exp-entry-4 { margin-left: 5vw; }

/* --- RESONANCE END --- */
.resonance-end {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10vh 6vw;
    position: relative;
}

.resonance-content {
    max-width: 700px;
}

.resonance-title {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 6vw, 4.5rem);
    color: #1A1020;
    line-height: 0.95;
    margin: 2rem 0;
}

.resonance-sub {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    color: #7A6080;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
}

.resonance-waveform {
    width: 80%;
    max-width: 600px;
    margin-top: 4rem;
    opacity: 0.4;
}

.resonance-waveform svg {
    width: 100%;
    height: 60px;
}

.res-wave-path {
    animation: waveShift 4s ease-in-out infinite alternate;
}

.res-wave-2 {
    animation-delay: 1s;
    animation-duration: 5s;
}

@keyframes waveShift {
    0% { stroke-dashoffset: 0; opacity: 0.6; }
    100% { stroke-dashoffset: 50; opacity: 1; }
}

/* --- SCROLL-TRIGGERED REVEAL --- */
.quest-card,
.terrain-column,
.poster {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.quest-card.visible,
.terrain-column.visible,
.poster.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Re-apply offset transforms after reveal */
.quest-card-2.visible { transform: translateY(0); margin-top: 6rem; }
.quest-card-3.visible { transform: translateY(0); margin-top: -3rem; }
.quest-card-4.visible { transform: translateY(0); margin-top: 2rem; }

.poster-2.visible { margin-top: 8rem; }
.poster-3.visible { margin-top: 3rem; }
.poster-4.visible { margin-top: 12rem; }

.terrain-col-2.visible { margin-top: 3rem; }

/* Stagger delays */
.quest-card-1 { transition-delay: 0s; }
.quest-card-2 { transition-delay: 0.15s; }
.quest-card-3 { transition-delay: 0.3s; }
.quest-card-4 { transition-delay: 0.45s; }

.terrain-col-1 { transition-delay: 0s; }
.terrain-col-2 { transition-delay: 0.2s; }
.terrain-col-3 { transition-delay: 0.4s; }

.poster-1 { transition-delay: 0s; }
.poster-2 { transition-delay: 0.12s; }
.poster-3 { transition-delay: 0.24s; }
.poster-4 { transition-delay: 0.36s; }

.exp-entry-1 { transition-delay: 0s; }
.exp-entry-2 { transition-delay: 0.15s; }
.exp-entry-3 { transition-delay: 0.3s; }
.exp-entry-4 { transition-delay: 0.45s; }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .quest-scatter {
        grid-template-columns: 1fr;
    }

    .quest-card-1,
    .quest-card-2,
    .quest-card-3,
    .quest-card-4 {
        grid-column: 1;
        margin-left: 0;
        margin-right: 0;
        margin-top: 0;
        padding: 2rem;
    }

    .quest-card-2 { margin-top: 0; }
    .quest-card-3 { margin-top: 0; margin-left: 0; }
    .quest-card-4 { margin-top: 0; }

    .atlas-terrain {
        grid-template-columns: 1fr;
    }

    .terrain-col-2 { margin-top: 0; }
    .terrain-text-offset { margin-top: 0; }

    .poster-wall {
        grid-template-columns: 1fr 1fr;
    }

    .poster-2 { margin-top: 4rem; }
    .poster-3 { margin-top: 0; }
    .poster-4 { margin-top: 4rem; }

    .exp-entry {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .exp-entries {
        margin-left: 0;
    }

    .exp-entry-1,
    .exp-entry-2,
    .exp-entry-3,
    .exp-entry-4 {
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    .title-line-musical {
        font-size: clamp(3rem, 16vw, 5rem);
    }

    .title-line-quest {
        font-size: clamp(2.5rem, 14vw, 4rem);
        margin-left: 8vw;
    }

    .title-dot {
        font-size: clamp(4rem, 18vw, 6rem);
        margin-left: 4vw;
    }

    .opening-tagline {
        margin-left: 0;
    }

    .waveform-bar {
        margin-left: 0;
    }

    .poster-wall {
        grid-template-columns: 1fr;
    }

    .poster-1,
    .poster-2,
    .poster-3,
    .poster-4 {
        margin-top: 0;
    }

    .poster-2.visible,
    .poster-3.visible,
    .poster-4.visible {
        margin-top: 0;
    }
}
