/* ============================================================
   musical.quest -- A Sonic Odyssey
   Vaporwave / Retro-Futuristic Synthwave
   ============================================================ */

:root {
    --c-violet:   #1a0a2e;
    --c-pink:     #ff71ce;
    --c-cyan:     #01cdfe;
    --c-mint:     #05ffa1;
    --c-lavender: #b967ff;
    --c-yellow:   #fffb96;
    --c-void:     #0d0221;

    --font-display: 'Syncopate', 'Inter', sans-serif;
    --font-body:    'Inter', system-ui, sans-serif;
    --font-mono:    'Share Tech Mono', 'Courier New', monospace;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--c-void);
    color: var(--c-pink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

body {
    position: relative;
}

/* ----------------------------------------------------------
   JOURNEY -- horizontal scroll container
   ---------------------------------------------------------- */
.journey {
    width: 100vw;
    height: 100vh;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.journey::-webkit-scrollbar { display: none; }

/* ----------------------------------------------------------
   MOVEMENT -- full-viewport scroll-snap section
   ---------------------------------------------------------- */
.movement {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 30% 40%,
            hsla(var(--movement-hue), 80%, 30%, 0.55) 0%,
            transparent 60%),
        radial-gradient(ellipse at 80% 70%,
            hsla(calc(var(--movement-hue) + 60), 90%, 40%, 0.45) 0%,
            transparent 55%),
        linear-gradient(135deg, var(--c-void) 0%, var(--c-violet) 100%);
}

.movement::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg,
            rgba(255, 255, 255, 0.012) 0 2px,
            transparent 2px 4px);
    pointer-events: none;
    z-index: 1;
}

.movement__inner {
    position: relative;
    z-index: 5;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    align-items: stretch;
    padding: 80px 64px 100px 64px;
    gap: 48px;
}

/* ----------------------------------------------------------
   GRID FLOOR -- perspective-transformed synthwave grid
   ---------------------------------------------------------- */
.grid-floor {
    position: absolute;
    left: 50%;
    bottom: -10%;
    width: 220%;
    height: 65%;
    transform: translateX(-50%) perspective(420px) rotateX(62deg);
    transform-origin: bottom center;
    background:
        repeating-linear-gradient(
            hsla(var(--movement-hue), 100%, 70%, 0.18) 0 1px,
            transparent 1px 44px),
        repeating-linear-gradient(90deg,
            hsla(var(--movement-hue), 100%, 70%, 0.18) 0 1px,
            transparent 1px 44px);
    mask-image: linear-gradient(to top, black 0%, black 30%, transparent 90%);
    -webkit-mask-image: linear-gradient(to top, black 0%, black 30%, transparent 90%);
    z-index: 2;
    animation: gridScroll 6s linear infinite;
}

@keyframes gridScroll {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 0 44px, 44px 0; }
}

/* Scanline -- subtle CRT */
.scanline {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 3px,
        rgba(0, 0, 0, 0.08) 3px,
        rgba(0, 0, 0, 0.08) 4px);
    pointer-events: none;
    z-index: 3;
}

/* ----------------------------------------------------------
   TEXTSTRIP -- left vertical column
   ---------------------------------------------------------- */
.textstrip {
    max-width: 320px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 24px;
    position: relative;
    z-index: 6;
}

.textstrip::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom,
        transparent,
        var(--c-pink) 20%,
        var(--c-cyan) 80%,
        transparent);
    opacity: 0.55;
}

.meta-row {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
}

.meta-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--c-cyan);
    border: 1px solid rgba(1, 205, 254, 0.4);
    padding: 4px 10px;
    background: rgba(1, 205, 254, 0.05);
}

.movement__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 3rem);
    line-height: 0.95;
    letter-spacing: 0.04em;
    color: var(--c-lavender);
    text-transform: uppercase;
    margin-bottom: 24px;
    text-shadow:
        0 0 10px rgba(185, 103, 255, 0.6),
        0 0 40px rgba(185, 103, 255, 0.3);
}

.movement__body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 28px;
}

.highlight {
    color: var(--c-yellow);
    background: linear-gradient(
        transparent 70%,
        rgba(255, 251, 150, 0.18) 70%);
    padding: 0 2px;
}

.freq-readout {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--c-mint);
    border-top: 1px dashed rgba(5, 255, 161, 0.3);
    padding-top: 14px;
}

.freq-label {
    color: var(--c-cyan);
    letter-spacing: 0.15em;
}

.freq-value {
    color: var(--c-mint);
    letter-spacing: 0.1em;
    text-shadow: 0 0 6px rgba(5, 255, 161, 0.55);
}

/* ----------------------------------------------------------
   STAGE -- right side visual area
   ---------------------------------------------------------- */
.stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* ============================================================
   MOVEMENT I -- WAVEFORM OSCILLOGRAPH HERO
   ============================================================ */
.stage--hero {
    flex-direction: column;
    gap: 32px;
}

.oscillograph {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 9vw, 7.5rem);
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--c-pink);
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    text-shadow:
        0 0 10px var(--c-pink),
        0 0 40px var(--c-pink),
        0 0 80px var(--c-lavender);
}

.osc-letter,
.osc-dot {
    display: inline-block;
    transform-origin: center;
    animation: wave 2.4s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * 0.1s);
}

.osc-dot {
    color: var(--c-cyan);
    text-shadow: 0 0 10px var(--c-cyan), 0 0 30px var(--c-cyan);
    margin: 0 0.05em;
    animation-delay: 0.7s;
}

@keyframes wave {
    0%   { transform: translateY(0)     scale(1); }
    25%  { transform: translateY(-22px) scale(1.04); }
    50%  { transform: translateY(0)     scale(1); }
    75%  { transform: translateY(22px)  scale(0.96); }
    100% { transform: translateY(0)     scale(1); }
}

.hero-tag {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.4em;
    color: var(--c-cyan);
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(1, 205, 254, 0.7);
}

.scroll-hint {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.scroll-hint__line {
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--c-mint));
    animation: hintPulse 1.6s ease-in-out infinite;
}

.scroll-hint__text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--c-mint);
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.4; transform: translateX(0); }
    50%      { opacity: 1;   transform: translateX(8px); }
}

/* ============================================================
   MOVEMENT II -- VISUALIZER BARS
   ============================================================ */
.stage--bars {
    flex-direction: column;
    gap: 16px;
    padding: 0 32px;
}

.visualizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 60%;
    max-height: 480px;
}

.bar {
    flex: 1 1 auto;
    max-width: 22px;
    min-width: 8px;
    height: 18%;
    background: linear-gradient(
        to top,
        var(--c-pink) 0%,
        var(--c-lavender) 40%,
        var(--c-cyan) 100%);
    border-radius: 2px 2px 0 0;
    transform-origin: bottom;
    box-shadow:
        0 0 12px rgba(255, 113, 206, 0.6),
        0 0 32px rgba(185, 103, 255, 0.3);
    animation: barOsc 1.2s ease-in-out infinite;
    animation-delay: calc(var(--i) * -0.08s);
}

@keyframes barOsc {
    0%   { transform: scaleY(0.18); }
    20%  { transform: scaleY(0.95); }
    40%  { transform: scaleY(0.42); }
    60%  { transform: scaleY(1.0); }
    80%  { transform: scaleY(0.6); }
    100% { transform: scaleY(0.18); }
}

.vis-axis {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--c-cyan);
    letter-spacing: 0.2em;
    border-top: 1px solid rgba(1, 205, 254, 0.3);
    padding-top: 10px;
    width: 100%;
    max-width: 100%;
}

/* ============================================================
   MOVEMENT III -- CHROMATIC GLOW / SUN
   ============================================================ */
.stage--glow {
    flex-direction: column;
    gap: 28px;
    position: relative;
}

.sun {
    position: relative;
    width: clamp(220px, 30vw, 380px);
    height: clamp(220px, 30vw, 380px);
    border-radius: 50%;
    background: radial-gradient(circle at 50% 60%,
        var(--c-yellow) 0%,
        var(--c-pink) 35%,
        var(--c-lavender) 65%,
        transparent 75%);
    box-shadow:
        0 0 60px rgba(255, 113, 206, 0.5),
        0 0 120px rgba(185, 103, 255, 0.4),
        inset 0 -30px 60px rgba(255, 251, 150, 0.4);
    overflow: hidden;
    animation: sunFloat 8s ease-in-out infinite;
}

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

.sun__line {
    position: absolute;
    left: 0;
    right: 0;
    height: calc(8% + var(--i) * 1.5%);
    background: var(--c-void);
    bottom: calc(var(--i) * 9%);
    opacity: 0.85;
}

.sun__line:nth-child(1) { bottom: 4%;  height: 5%; }
.sun__line:nth-child(2) { bottom: 14%; height: 4%; }
.sun__line:nth-child(3) { bottom: 22%; height: 3%; }
.sun__line:nth-child(4) { bottom: 28%; height: 2.5%; }
.sun__line:nth-child(5) { bottom: 33%; height: 2%; }
.sun__line:nth-child(6) { bottom: 37%; height: 1.5%; }

.glow-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 7vw, 5rem);
    line-height: 0.95;
    letter-spacing: 0.06em;
    color: var(--c-pink);
    text-align: center;
    text-shadow:
        0 0 10px var(--c-pink),
        0 0 40px var(--c-pink),
        0 0 80px var(--c-lavender);
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        text-shadow:
            0 0 10px var(--c-pink),
            0 0 40px var(--c-pink),
            0 0 80px var(--c-lavender);
    }
    50% {
        text-shadow:
            0 0 14px var(--c-cyan),
            0 0 50px var(--c-pink),
            0 0 100px var(--c-lavender);
    }
}

.glow-sub {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    color: var(--c-cyan);
    text-align: center;
    opacity: 0.85;
}

/* ============================================================
   MOVEMENT IV -- ORBITAL RHYTHM
   ============================================================ */
.stage--orbit {
    position: relative;
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px dashed rgba(1, 205, 254, 0.35);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.orbit--1 { width: 18vmin; height: 18vmin; animation: orbitSpin 4s linear infinite; }
.orbit--2 { width: 32vmin; height: 32vmin; animation: orbitSpin 7s linear infinite reverse; border-color: rgba(255, 113, 206, 0.35); }
.orbit--3 { width: 48vmin; height: 48vmin; animation: orbitSpin 11s linear infinite; border-color: rgba(185, 103, 255, 0.35); }
.orbit--4 { width: 64vmin; height: 64vmin; animation: orbitSpin 17s linear infinite reverse; border-color: rgba(5, 255, 161, 0.3); }

.orbit__node {
    position: absolute;
    top: -7px;
    left: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translateX(-50%);
}

.orbit--1 .orbit__node {
    background: var(--c-mint);
    box-shadow: 0 0 14px var(--c-mint), 0 0 28px var(--c-mint);
}
.orbit--2 .orbit__node {
    background: var(--c-pink);
    box-shadow: 0 0 14px var(--c-pink), 0 0 28px var(--c-pink);
}
.orbit--3 .orbit__node {
    background: var(--c-cyan);
    box-shadow: 0 0 14px var(--c-cyan), 0 0 28px var(--c-cyan);
}
.orbit--4 .orbit__node {
    background: var(--c-yellow);
    box-shadow: 0 0 14px var(--c-yellow), 0 0 28px var(--c-yellow);
}

@keyframes orbitSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.orbit__core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--c-yellow);
    transform: translate(-50%, -50%);
    box-shadow:
        0 0 16px var(--c-yellow),
        0 0 40px var(--c-pink),
        0 0 80px var(--c-lavender);
    animation: corePulse 1.4s ease-in-out infinite;
}

@keyframes corePulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
    50%      { transform: translate(-50%, -50%) scale(1.6); opacity: 0.7; }
}

.orbit__labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.orbit__label {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--c-cyan);
    text-shadow: 0 0 6px rgba(1, 205, 254, 0.6);
    background: rgba(13, 2, 33, 0.4);
    padding: 4px 8px;
    border-left: 1px solid var(--c-cyan);
}

/* ============================================================
   MOVEMENT V -- RESONANT ASCENT
   ============================================================ */
.stage--ascent {
    flex-direction: column;
    gap: 32px;
    position: relative;
}

.ascent-tower {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    height: 50%;
}

.ascent-bar {
    width: 18px;
    height: calc(40% + var(--i) * 6%);
    background: linear-gradient(
        to top,
        var(--c-pink) 0%,
        var(--c-yellow) 50%,
        var(--c-mint) 100%);
    border-radius: 2px;
    box-shadow:
        0 0 16px rgba(5, 255, 161, 0.6),
        0 0 36px rgba(255, 251, 150, 0.4);
    animation: ascentRise 3s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.15s);
    transform-origin: bottom;
}

@keyframes ascentRise {
    0%, 100% { transform: scaleY(1)   translateY(0); }
    50%      { transform: scaleY(1.2) translateY(-12px); }
}

.ascent-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.6rem);
    letter-spacing: 0.18em;
    color: var(--c-mint);
    text-align: center;
    text-shadow:
        0 0 12px var(--c-mint),
        0 0 40px var(--c-cyan),
        0 0 80px var(--c-lavender);
}

.ascent-sub {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.22em;
    color: var(--c-yellow);
    text-align: center;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    width: min(620px, 70vw);
    z-index: 50;
    user-select: none;
}

.progress__track {
    position: relative;
    height: 2px;
    background: rgba(185, 103, 255, 0.25);
    margin-bottom: 14px;
}

.progress__fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--c-pink), var(--c-cyan), var(--c-mint));
    box-shadow: 0 0 12px var(--c-pink);
    transition: width 0.35s cubic-bezier(.2,.9,.3,1);
}

.progress__dot {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--c-mint);
    transform: translate(-50%, -50%);
    box-shadow:
        0 0 12px var(--c-mint),
        0 0 28px var(--c-mint);
    transition: left 0.35s cubic-bezier(.2,.9,.3,1);
    animation: dotPulse 1.6s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 12px var(--c-mint), 0 0 28px var(--c-mint); }
    50%      { box-shadow: 0 0 18px var(--c-mint), 0 0 56px var(--c-mint); }
}

.progress__markers {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.marker {
    background: transparent;
    border: 1px solid rgba(185, 103, 255, 0.35);
    color: var(--c-cyan);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.marker:hover {
    border-color: var(--c-pink);
    color: var(--c-pink);
    transform: translateY(-2px);
}

.marker--active {
    border-color: var(--c-mint);
    color: var(--c-mint);
    background: rgba(5, 255, 161, 0.08);
    text-shadow: 0 0 6px var(--c-mint);
}

/* ============================================================
   HUD CORNERS
   ============================================================ */
.hud {
    position: fixed;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    pointer-events: none;
}

.hud--tl { top: 28px; left: 28px; }
.hud--tr { top: 28px; right: 28px; align-items: flex-end; }
.hud--bl { bottom: 28px; left: 28px; }

.hud__label {
    color: var(--c-lavender);
    opacity: 0.7;
}

.hud__val {
    color: var(--c-pink);
    text-shadow: 0 0 6px rgba(255, 113, 206, 0.6);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .movement__inner {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        padding: 60px 32px 120px 32px;
        gap: 24px;
    }
    .textstrip {
        max-width: 100%;
        justify-content: flex-start;
        padding-bottom: 0;
    }
    .textstrip::before { display: none; }
    .oscillograph { font-size: clamp(2.2rem, 14vw, 5rem); }
    .hud--tr { font-size: 0.6rem; }
}
