.shader-canvas {
    position: fixed;
    inset: 0;
    z-index: 2;
    opacity: 0.26;
    pointer-events: none;
    mix-blend-mode: screen;
}

.grain-overlay {
    position: fixed;
    inset: -50%;
    z-index: 20;
    pointer-events: none;
    opacity: 0.032;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    animation: grain-shift 900ms steps(4) infinite;
}

@keyframes grain-shift {
    0% { transform: translate3d(0, 0, 0); }
    25% { transform: translate3d(-1.5%, 1%, 0); }
    50% { transform: translate3d(1%, -1.5%, 0); }
    75% { transform: translate3d(-1%, -0.5%, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

.vignette {
    position: fixed;
    inset: 0;
    z-index: 21;
    pointer-events: none;
    background:
        radial-gradient(circle at 68% 42%, transparent 0 20%, rgba(0, 0, 0, 0.34) 58%, rgba(0, 0, 0, 0.84) 100%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.42), transparent 44%);
}

.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-cursor);
    pointer-events: none;
    mix-blend-mode: difference;
}

.cursor-dot,
.cursor-ring,
.cursor-trail {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.cursor-dot {
    width: 5px;
    height: 5px;
    background: #fff;
}

.cursor-ring {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.54);
    transition: width var(--duration-fast), height var(--duration-fast), border-color var(--duration-fast);
}

.cursor-trail {
    width: 78px;
    height: 78px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.035), transparent 70%);
}

.custom-cursor.hover .cursor-ring {
    width: 58px;
    height: 58px;
    border-color: rgba(255, 255, 255, 0.9);
}

.ripple {
    position: fixed;
    z-index: 12;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.ripple-ring {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    animation: ripple-expand 1400ms var(--ease-out) forwards;
}

@keyframes ripple-expand {
    from {
        opacity: 0.8;
        transform: scale(0);
    }
    to {
        opacity: 0;
        transform: scale(4.5);
    }
}

.narration-container {
    position: fixed;
    right: var(--page-pad);
    bottom: calc(var(--rail-height) + var(--space-3));
    z-index: 42;
    width: min(36rem, 42vw);
    padding: var(--space-4);
    color: var(--color-muted);
    background: rgba(0, 0, 0, 0.72);
    border-top: 1px solid var(--color-line-soft);
    backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(1rem);
    transition: opacity var(--duration), transform var(--duration);
}

.narration-container.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.narration-text {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
    line-height: 1.65;
}

.narration-word.is-read {
    color: rgba(255, 255, 255, 0.74);
}

.narration-word.is-current {
    color: #fff;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.28);
}
