/* soning.stream -- horizontal-scroll spectrogram panorama */

:root {
    --bg-deep: #0D0B1F;
    --bg-mid: #1A1035;
    --accent-primary: #D4A0E8;
    --accent-secondary: #6B5B95;
    --accent-glow: #E8C8F8;
    --text-primary: #C8B8D8;
    --text-secondary: #7A6B8A;
}

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

html, body {
    height: 100%;
    width: 100%;
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Libre Baskerville', Georgia, serif;
    overflow: hidden;
}

body {
    position: relative;
}

/* Panorama container -- horizontal scroll */
.panorama {
    position: relative;
    width: 500vw;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    background:
        linear-gradient(
            to right,
            #1A1035 0%,
            #15102C 12%,
            #110D26 24%,
            #1A1238 40%,
            #221848 50%,
            #1A1238 60%,
            #110D26 76%,
            #0F0B22 88%,
            #0D0B1F 100%
        );
    scroll-behavior: smooth;
    scrollbar-width: none;
}

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

/* Subtle vignette + ambient noise via gradients */
.panorama::before {
    content: "";
    position: absolute;
    inset: 0;
    width: 500vw;
    height: 100vh;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(212, 160, 232, 0.04), transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(107, 91, 149, 0.05), transparent 60%);
    pointer-events: none;
    z-index: 1;
}

/* SVG overlay -- spectrogram lines and event circles */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 500vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
}

/* Bloom default state */
.bloom {
    opacity: 0;
    transition: opacity 600ms ease-out;
    transform-origin: 3500px 500px;
}

.bloom.visible {
    opacity: 1;
}

/* Fade-out class applied during decay */
.fadeable {
    transition: opacity 500ms ease-out;
}

.fadeable.dim {
    opacity: 0.2 !important;
}

.fadeable.gone {
    opacity: 0 !important;
}

/* Movement panel scaffold (positioned absolutely along the panorama) */
.movement-panel {
    position: absolute;
    top: 0;
    width: 100vw;
    height: 100vh;
    z-index: 3;
}

/* Movement 1: Silence -- domain name */
.silence-block {
    position: absolute;
    left: 40%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: left;
    max-width: 460px;
}

.silence-block .movement-label {
    display: block;
    margin-bottom: 28px;
    color: var(--text-secondary);
}

.domain-name {
    font-family: 'Playfair Display', 'Times New Roman', serif;
    font-weight: 300;
    font-size: clamp(48px, 5vw, 64px);
    color: var(--text-primary);
    letter-spacing: 0.01em;
    line-height: 1.1;
    margin-bottom: 18px;
    text-shadow: 0 0 32px rgba(212, 160, 232, 0.15);
}

.silence-block .tagline {
    display: block;
    color: var(--text-secondary);
    font-style: italic;
    letter-spacing: 0.06em;
}

/* Annotations -- inconsolata */
.annotation {
    font-family: 'Inconsolata', 'Courier New', monospace;
    font-weight: 300;
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    text-transform: lowercase;
}

/* Generic text block (max width 400, max height 200) */
.text-block {
    position: absolute;
    transform: translate(-50%, -50%) translateX(-20px);
    opacity: 0;
    max-width: 400px;
    max-height: 220px;
    transition: opacity 700ms ease-out, transform 700ms ease-out;
    z-index: 4;
}

.text-block.visible {
    transform: translate(-50%, -50%) translateX(0);
    opacity: 1;
}

.text-block .movement-label {
    display: block;
    margin-bottom: 18px;
    color: var(--text-secondary);
}

.meditation {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.85;
    color: var(--text-primary);
}

.meditation.single-line {
    font-style: italic;
    font-size: 19px;
    color: var(--accent-glow);
    text-shadow: 0 0 24px rgba(232, 200, 248, 0.25);
}

.meditation.final-word {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: 36px;
    color: var(--accent-glow);
    line-height: 1;
    letter-spacing: 0.02em;
    text-shadow: 0 0 18px rgba(232, 200, 248, 0.35);
}

/* Score line and event default styles -- subtle fade-in */
.score-line {
    transition: opacity 800ms ease-out, stroke-opacity 800ms ease-out;
}

.event {
    transition: opacity 600ms ease-out, fill-opacity 600ms ease-out;
}

/* Density toggling -- circles can be hidden until movements activate */
.movement.m2 .event,
.movement.m3 .event,
.movement.m4 .event {
    opacity: 0;
}

.movement.m2.active .event,
.movement.m3.active .event,
.movement.m4.active .event {
    opacity: 1;
    animation: pulse 5.5s ease-in-out infinite;
}

.movement.m3.active .event {
    animation-duration: 4.2s;
}

.movement.m4.active .event {
    animation-duration: 3.4s;
}

@keyframes pulse {
    0%, 100% { fill-opacity: 0.5; }
    50% { fill-opacity: 0.95; }
}

/* Threads (diagonal connector lines) */
.thread {
    transition: opacity 800ms ease-out;
}

/* Movement 2/3/4 line activation */
.movement.m2 .score-line,
.movement.m3 .score-line,
.movement.m4 .score-line {
    opacity: 0.2;
}

.movement.m2.active .score-line,
.movement.m3.active .score-line,
.movement.m4.active .score-line {
    opacity: 1;
}

/* UI Overlay -- fixed time markers and progress bar */
.ui-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.time-marker {
    position: fixed;
    top: 24px;
    color: var(--text-secondary);
}

.time-marker-left {
    left: 24px;
}

.time-marker-right {
    right: 24px;
}

.scroll-hint {
    position: fixed;
    right: 36px;
    bottom: 56px;
    color: var(--text-secondary);
    opacity: 0.7;
    transition: opacity 500ms ease-out;
    animation: hint-drift 2.6s ease-in-out infinite;
}

.scroll-hint.dimmed {
    opacity: 0;
}

@keyframes hint-drift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(8px); }
}

/* Progress track */
.progress-track {
    position: fixed;
    bottom: 16px;
    left: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

.progress-label {
    flex-shrink: 0;
    color: var(--text-secondary);
}

.progress-rail {
    flex-grow: 1;
    height: 1px;
    background: rgba(107, 91, 149, 0.3);
    position: relative;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(
        to right,
        var(--accent-secondary),
        var(--accent-primary),
        var(--accent-glow)
    );
    box-shadow: 0 0 8px rgba(212, 160, 232, 0.6);
    transition: width 120ms linear;
}

.progress-position {
    flex-shrink: 0;
    min-width: 48px;
    text-align: right;
    color: var(--accent-primary);
}

/* Subtle floating ambient drift on the bloom */
.bloom.visible {
    animation: bloom-breathe 7s ease-in-out infinite;
}

@keyframes bloom-breathe {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.04);
        filter: brightness(1.12);
    }
}

/* Score lines -- gentle drift animation for living spectrogram feel */
.movement.m3.active .score-line,
.movement.m4.active .score-line {
    animation: line-shimmer 6s ease-in-out infinite;
}

@keyframes line-shimmer {
    0%, 100% { stroke-opacity: var(--base-op, 0.4); }
    50% { stroke-opacity: calc(var(--base-op, 0.4) * 1.4); }
}

/* Reduced-motion fallback */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
