/* ============================================
   musical.quest - Vaporwave Academic
   Palette: Honeyed Neutral
   Typography: Playful Rounded (Baloo 2, Nunito, Caveat)
   Layout: Split Screen
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --warm-parchment: #f5ece0;
    --honeyed-cream: #faf3e8;
    --deep-walnut: #3d2e1f;
    --umber-dust: #7a6555;
    --amber-glow: #d4a574;
    --dusk-mauve: #b8879e;
    --honeyed-rose: #e8c4a8;
    --blush-fog: #dbb5c4;
    --twilight-lavender: #c4a8d4;
    --amber-string: #d4a574;
    --mauve-string: #c4a0b9;
    --burnt-sienna: #8b5e3c;
    --faded-mauve: #9b7e8e;
    --staff-line: #d4c4a8;

    --font-display: 'Baloo 2', cursive;
    --font-body: 'Nunito', sans-serif;
    --font-accent: 'Caveat', cursive;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--deep-walnut);
    background: var(--honeyed-cream);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Entry Screen --- */
#entry-screen {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--honeyed-cream);
    z-index: 100;
    overflow: hidden;
}

.entry-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.entry-line {
    position: absolute;
    top: 50%;
    height: 1px;
    background: var(--amber-glow);
    transform: scaleX(0);
    width: 50vw;
}

.entry-line-left {
    right: 50%;
    transform-origin: left;
}

.entry-line-right {
    left: 50%;
    transform-origin: right;
}

.entry-line.animate {
    animation: drawLine 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes drawLine {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.entry-wash {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 196, 168, 0.15) 0%, rgba(232, 196, 168, 0) 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
}

.entry-wash.animate {
    animation: bloomWash 1200ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes bloomWash {
    from {
        width: 0;
        height: 0;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    to {
        width: 600px;
        height: 600px;
        opacity: 1;
    }
}

.entry-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--deep-walnut);
    opacity: 0;
    transform: translateY(20px);
    letter-spacing: 0.03em;
    line-height: 1.15;
    text-align: center;
}

.entry-title.animate {
    animation: fadeUpIn 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.entry-subtitle {
    font-family: var(--font-accent);
    font-weight: 400;
    font-size: 1.1rem;
    color: var(--faded-mauve);
    opacity: 0;
    transform: translateY(10px);
    margin-top: 0.5rem;
    text-align: center;
}

.entry-subtitle.animate {
    animation: fadeUpIn 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

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

.entry-scroll-hint {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 600ms ease;
}

.entry-scroll-hint.visible {
    opacity: 1;
}

.scroll-hint-text {
    font-family: var(--font-accent);
    font-size: 0.9rem;
    color: var(--umber-dust);
    letter-spacing: 0.05em;
}

.scroll-hint-arrow {
    width: 12px;
    height: 12px;
    border-right: 1.5px solid var(--amber-glow);
    border-bottom: 1.5px solid var(--amber-glow);
    transform: rotate(45deg);
    animation: bounceArrow 1.5s ease-in-out infinite;
}

@keyframes bounceArrow {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(4px); }
}

/* --- Split Layout --- */
#split-layout {
    display: none;
    grid-template-columns: 2fr 2px 3fr;
    width: 100vw;
    height: 100vh;
    position: relative;
}

#split-layout.visible {
    display: grid;
}

/* --- Score Panel (Left) --- */
#score-panel {
    background: var(--warm-parchment);
    overflow-y: auto;
    position: relative;
    height: 100vh;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 47px,
        rgba(212, 196, 168, 0.2) 47px,
        rgba(212, 196, 168, 0.2) 48px
    );
}

/* Custom scrollbar for score panel */
#score-panel::-webkit-scrollbar {
    width: 3px;
}
#score-panel::-webkit-scrollbar-track {
    background: transparent;
}
#score-panel::-webkit-scrollbar-thumb {
    background: var(--amber-glow);
    border-radius: 2px;
}

.score-panel-inner {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1;
}

.score-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(212, 196, 168, 0.3);
}

.score-domain {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--deep-walnut);
    letter-spacing: 0.03em;
}

/* Navigation */
.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 200ms ease;
    position: relative;
}

.nav-item:hover {
    background: rgba(212, 196, 168, 0.2);
}

.nav-item.active {
    background: rgba(212, 165, 116, 0.12);
}

.nav-marker {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--amber-glow);
    background: transparent;
    transition: background 300ms ease, border-color 300ms ease;
    flex-shrink: 0;
}

.nav-item.active .nav-marker {
    background: var(--amber-glow);
}

.nav-item:hover .nav-marker {
    border-color: var(--dusk-mauve);
}

.nav-label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: clamp(0.85rem, 1.4vw, 0.95rem);
    color: var(--deep-walnut);
    line-height: 1.4;
}

/* Annotation bubble */
.score-annotations {
    min-height: 3rem;
    position: relative;
}

.annotation-bubble {
    opacity: 0;
    transform: rotate(-2deg);
    transition: opacity 200ms ease, transform 200ms ease;
    padding: 0.5rem 0.75rem;
    position: relative;
}

.annotation-bubble.visible {
    opacity: 1;
    transform: rotate(-2deg) translateY(0);
}

.annotation-text {
    font-family: var(--font-accent);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.6vw, 1.1rem);
    color: var(--faded-mauve);
    line-height: 1.5;
}

/* Score footer */
.score-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(212, 196, 168, 0.3);
}

.score-note {
    font-family: var(--font-accent);
    font-size: 0.9rem;
    color: var(--faded-mauve);
    font-style: italic;
}

/* Staff curve SVG */
.staff-curve-svg {
    position: absolute;
    bottom: 30%;
    left: 0;
    width: 100%;
    height: 60px;
    pointer-events: none;
    opacity: 0.5;
}

/* --- Divider (Vibrating String) --- */
#divider {
    position: relative;
    width: 2px;
    height: 100vh;
    cursor: pointer;
    z-index: 10;
}

.divider-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, var(--amber-string), var(--mauve-string));
    transition: width 300ms ease;
}

.divider-hit-area {
    position: absolute;
    top: 0;
    left: -20px;
    width: 42px;
    height: 100%;
    z-index: 11;
}

#divider.hover .divider-line {
    width: 6px;
    left: -2px;
    border-radius: 3px;
}

#divider.plucked .divider-line {
    background: var(--burnt-sienna);
    animation: pluckReturn 1.5s cubic-bezier(0.1, 0.7, 0.3, 1) forwards;
}

@keyframes pluckReturn {
    0% {
        width: 6px;
        left: -2px;
        background: var(--burnt-sienna);
    }
    30% {
        width: 4px;
        left: -1px;
    }
    100% {
        width: 2px;
        left: 0;
        background: linear-gradient(to bottom, var(--amber-string), var(--mauve-string));
    }
}

/* Sinusoidal wave effect via clip-path on hover */
#divider.hover .divider-line {
    animation: vibrateString 1s ease-in-out infinite alternate;
}

@keyframes vibrateString {
    0% {
        clip-path: polygon(
            0% 0%, 100% 0%,
            100% 10%, 80% 15%, 100% 20%, 80% 25%, 100% 30%,
            80% 35%, 100% 40%, 80% 45%, 100% 50%,
            80% 55%, 100% 60%, 80% 65%, 100% 70%,
            80% 75%, 100% 80%, 80% 85%, 100% 90%,
            80% 95%, 100% 100%, 0% 100%,
            20% 95%, 0% 90%, 20% 85%, 0% 80%,
            20% 75%, 0% 70%, 20% 65%, 0% 60%,
            20% 55%, 0% 50%, 20% 45%, 0% 40%,
            20% 35%, 0% 30%, 20% 25%, 0% 20%,
            20% 15%, 0% 10%
        );
    }
    100% {
        clip-path: polygon(
            0% 0%, 100% 0%,
            100% 10%, 100% 15%, 80% 20%, 100% 25%, 80% 30%,
            100% 35%, 80% 40%, 100% 45%, 80% 50%,
            100% 55%, 80% 60%, 100% 65%, 80% 70%,
            100% 75%, 80% 80%, 100% 85%, 80% 90%,
            100% 95%, 100% 100%, 0% 100%,
            0% 95%, 20% 90%, 0% 85%, 20% 80%,
            0% 75%, 20% 70%, 0% 65%, 20% 60%,
            0% 55%, 20% 50%, 0% 45%, 20% 40%,
            0% 35%, 20% 30%, 0% 25%, 20% 20%,
            0% 15%, 0% 10%
        );
    }
}

/* --- Performance Panel (Right) --- */
#performance-panel {
    position: relative;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    background: var(--honeyed-cream);
}

/* Morph shapes container */
.morph-shapes {
    position: fixed;
    top: 0;
    right: 0;
    width: 60%;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.morph-shape {
    position: absolute;
    width: 280px;
    height: 280px;
}

.morph-rhythm {
    top: 8%;
    right: 12%;
}

.morph-melody {
    top: 40%;
    right: 50%;
}

.morph-harmony {
    top: 68%;
    right: 8%;
}

/* Melodic lines SVG */
.melodic-lines-svg {
    position: fixed;
    top: 0;
    right: 0;
    width: 60%;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
}

.melodic-line {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 2s ease-out;
}

.melodic-line.revealed {
    stroke-dashoffset: 0;
}

/* --- Movements (Sections) --- */
.movement {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 3rem;
    scroll-snap-align: start;
    overflow: hidden;
}

/* Watercolor wash backgrounds per movement */
.movement-wash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    transition: opacity 800ms ease;
    pointer-events: none;
    z-index: 0;
}

.movement.in-view .movement-wash {
    opacity: 0.1;
}

#movement-0 .movement-wash {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(232, 196, 168, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(219, 181, 196, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 90%, rgba(196, 168, 212, 0.08) 0%, transparent 50%);
}

#movement-1 .movement-wash {
    background:
        radial-gradient(ellipse at 60% 30%, rgba(219, 181, 196, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 70%, rgba(232, 196, 168, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 80%, rgba(196, 168, 212, 0.1) 0%, transparent 50%);
}

#movement-2 .movement-wash {
    background:
        radial-gradient(ellipse at 40% 40%, rgba(196, 168, 212, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 75% 20%, rgba(232, 196, 168, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse at 25% 85%, rgba(219, 181, 196, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 70%, rgba(232, 196, 168, 0.08) 0%, transparent 45%);
}

#movement-3 .movement-wash {
    background:
        radial-gradient(ellipse at 50% 25%, rgba(232, 196, 168, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 15% 60%, rgba(196, 168, 212, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 50%, rgba(219, 181, 196, 0.1) 0%, transparent 50%);
}

#movement-4 .movement-wash {
    background:
        radial-gradient(ellipse at 35% 35%, rgba(219, 181, 196, 0.14) 0%, transparent 60%),
        radial-gradient(ellipse at 65% 75%, rgba(196, 168, 212, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 15%, rgba(232, 196, 168, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 90%, rgba(196, 168, 212, 0.1) 0%, transparent 45%);
}

/* Pigment pooling accents */
.pigment-pool {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: pigmentBreathe 8s infinite alternate ease-in-out;
}

@keyframes pigmentBreathe {
    from { transform: scale(0.9); }
    to { transform: scale(1.1); }
}

.pigment-pool-1 {
    width: 100px;
    height: 100px;
    top: 15%;
    right: 10%;
    background: radial-gradient(circle, transparent 40%, rgba(232, 196, 168, 0.15) 100%);
}

.pigment-pool-2 {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 15%;
    background: radial-gradient(circle, transparent 40%, rgba(219, 181, 196, 0.12) 100%);
    animation-delay: 2s;
}

.pigment-pool-3 {
    width: 120px;
    height: 120px;
    top: 25%;
    left: 8%;
    background: radial-gradient(circle, transparent 40%, rgba(196, 168, 212, 0.12) 100%);
    animation-delay: 1s;
}

.pigment-pool-4 {
    width: 90px;
    height: 90px;
    top: 10%;
    right: 20%;
    background: radial-gradient(circle, transparent 40%, rgba(232, 196, 168, 0.14) 100%);
    animation-delay: 3s;
}

.pigment-pool-5 {
    width: 70px;
    height: 70px;
    bottom: 15%;
    right: 12%;
    background: radial-gradient(circle, transparent 40%, rgba(219, 181, 196, 0.1) 100%);
    animation-delay: 4.5s;
}

.pigment-pool-6 {
    width: 110px;
    height: 110px;
    bottom: 25%;
    left: 20%;
    background: radial-gradient(circle, transparent 40%, rgba(196, 168, 212, 0.13) 100%);
    animation-delay: 2.5s;
}

.pigment-pool-7 {
    width: 95px;
    height: 95px;
    top: 20%;
    left: 12%;
    background: radial-gradient(circle, transparent 40%, rgba(219, 181, 196, 0.12) 100%);
    animation-delay: 1.5s;
}

.pigment-pool-8 {
    width: 75px;
    height: 75px;
    bottom: 10%;
    right: 25%;
    background: radial-gradient(circle, transparent 40%, rgba(232, 196, 168, 0.1) 100%);
    animation-delay: 5s;
}

/* Movement content */
.movement-content {
    position: relative;
    z-index: 2;
    max-width: 58ch;
    width: 100%;
}

/* Stagger animations for content entering */
.movement-content > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.movement.in-view .movement-content > * {
    opacity: 1;
    transform: translateY(0);
}

.movement.in-view .movement-content > *:nth-child(1) { transition-delay: 0ms; }
.movement.in-view .movement-content > *:nth-child(2) { transition-delay: 80ms; }
.movement.in-view .movement-content > *:nth-child(3) { transition-delay: 160ms; }
.movement.in-view .movement-content > *:nth-child(4) { transition-delay: 240ms; }

/* Harmonic halos */
.harmonic-halos {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 200px;
    pointer-events: none;
    z-index: -1;
}

.halo-svg {
    width: 100%;
    height: 100%;
}

.halo-ring {
    animation: haloExpand 12s linear infinite;
    transform-origin: center;
}

.halo-ring-1 { animation-delay: 0s; }
.halo-ring-2 { animation-delay: 2.4s; }
.halo-ring-3 { animation-delay: 4.8s; }
.halo-ring-4 { animation-delay: 7.2s; }
.halo-ring-5 { animation-delay: 9.6s; }

@keyframes haloExpand {
    0% {
        transform: scale(0.95);
        opacity: 0.15;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.08;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.15;
    }
}

/* Movement number */
.movement-number {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--burnt-sienna);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

/* Movement title */
.movement-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.5rem, 3.5vw, 2.4rem);
    color: var(--deep-walnut);
    margin-bottom: 1.5rem;
    letter-spacing: 0.03em;
    line-height: 1.15;
    text-transform: none;
}

/* Movement body / watercolor blocks */
.watercolor-block {
    filter: url(#watercolor-edge-soft);
}

.movement-body p {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    color: var(--deep-walnut);
    max-width: 58ch;
    margin-bottom: 1.25rem;
}

.movement-body p:last-child {
    margin-bottom: 0;
}

.movement-body em {
    font-style: italic;
    color: var(--burnt-sienna);
}

/* --- Mobile Bar --- */
#mobile-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--warm-parchment);
    z-index: 200;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.mobile-bar-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--deep-walnut);
}

.mobile-bar-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mobile-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--amber-glow);
    background: transparent;
    cursor: pointer;
    transition: background 300ms ease;
}

.mobile-dot.active {
    background: var(--amber-glow);
}

.mobile-bar-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(212, 196, 168, 0.4);
}

/* --- Morph Shape Animations --- */
@keyframes morphRhythm {
    0%   { d: path("M100,30 C130,30 160,60 160,100 C160,140 130,170 100,170 C70,170 40,140 40,100 C40,60 70,30 100,30 Z"); }
    25%  { d: path("M100,25 C145,25 170,55 170,100 C170,145 145,175 100,175 C55,175 30,145 30,100 C30,55 55,25 100,25 Z"); }
    50%  { d: path("M100,35 C125,30 155,65 160,100 C165,135 135,165 100,165 C65,165 35,135 40,100 C45,65 75,35 100,35 Z"); }
    75%  { d: path("M100,28 C140,35 165,60 158,100 C150,140 125,168 100,172 C75,168 50,140 42,100 C35,60 60,35 100,28 Z"); }
    100% { d: path("M100,30 C130,30 160,60 160,100 C160,140 130,170 100,170 C70,170 40,140 40,100 C40,60 70,30 100,30 Z"); }
}

@keyframes morphMelody {
    0%   { d: path("M100,20 C140,40 170,70 160,110 C150,150 120,175 100,180 C80,175 50,150 40,110 C30,70 60,40 100,20 Z"); }
    25%  { d: path("M100,30 C135,25 165,65 168,105 C170,145 140,170 100,175 C60,170 30,145 32,105 C35,65 65,25 100,30 Z"); }
    50%  { d: path("M100,15 C145,35 175,75 165,115 C155,155 125,180 100,185 C75,180 45,155 35,115 C25,75 55,35 100,15 Z"); }
    75%  { d: path("M100,25 C130,20 160,60 165,100 C170,140 145,175 100,178 C55,175 30,140 35,100 C40,60 70,20 100,25 Z"); }
    100% { d: path("M100,20 C140,40 170,70 160,110 C150,150 120,175 100,180 C80,175 50,150 40,110 C30,70 60,40 100,20 Z"); }
}

@keyframes morphHarmony {
    0%   { d: path("M100,35 C125,35 150,55 155,85 C160,115 145,145 120,155 C95,165 65,155 50,135 C35,115 35,80 50,60 C65,40 75,35 100,35 Z"); }
    25%  { d: path("M100,30 C130,30 155,50 160,80 C165,110 150,150 125,160 C100,170 60,160 45,140 C30,120 30,75 45,55 C60,35 70,30 100,30 Z"); }
    50%  { d: path("M100,40 C120,38 148,58 153,88 C158,118 142,142 118,152 C92,162 68,152 52,132 C38,112 38,82 52,62 C68,42 80,40 100,40 Z"); }
    75%  { d: path("M100,32 C128,32 152,52 158,82 C164,112 148,148 122,158 C98,168 62,158 48,138 C32,118 32,78 48,58 C62,38 72,32 100,32 Z"); }
    100% { d: path("M100,35 C125,35 150,55 155,85 C160,115 145,145 120,155 C95,165 65,155 50,135 C35,115 35,80 50,60 C65,40 75,35 100,35 Z"); }
}

.morph-path-rhythm {
    animation: morphRhythm 16s ease-in-out infinite;
}

.morph-path-melody {
    animation: morphMelody 16s ease-in-out infinite;
    animation-delay: -4s;
}

.morph-path-harmony {
    animation: morphHarmony 16s ease-in-out infinite;
    animation-delay: -8s;
}

/* Accelerated morph during transitions */
.morph-shapes.transitioning .morph-path-rhythm {
    animation-duration: 4s;
}
.morph-shapes.transitioning .morph-path-melody {
    animation-duration: 4s;
}
.morph-shapes.transitioning .morph-path-harmony {
    animation-duration: 4s;
}

/* --- Responsive: Below 768px --- */
@media (max-width: 768px) {
    #split-layout {
        display: none;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    #split-layout.visible {
        display: block;
    }

    #score-panel {
        display: none;
    }

    #divider {
        display: none;
    }

    #mobile-bar {
        display: flex;
    }

    #performance-panel {
        height: 100vh;
        padding-top: 60px;
    }

    .movement {
        padding: 3rem 1.5rem;
    }

    .movement-content {
        max-width: 100%;
    }

    .movement-body p {
        max-width: 100%;
    }

    .morph-shapes {
        width: 100%;
    }

    .melodic-lines-svg {
        width: 100%;
    }

    .harmonic-halos {
        width: 300px;
        height: 150px;
    }
}

/* --- General link styling --- */
a {
    color: var(--amber-glow);
    text-decoration: none;
    transition: color 200ms ease;
}

a:hover {
    color: var(--dusk-mauve);
}

/* --- Selection styling --- */
::selection {
    background: rgba(184, 135, 158, 0.25);
    color: var(--deep-walnut);
}

/* --- Transition bloom for section boundaries --- */
.transition-bloom {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 30%, rgba(219, 181, 196, 0.12) 100%);
    z-index: 1;
    pointer-events: none;
    transition: width 600ms ease, height 600ms ease;
}

.transition-bloom.active {
    width: 80px;
    height: 80px;
}
