/* TEXT ROLL REVEAL EFFECT - Case Study & Project Pages */

/* Hide overflow on hero titles/subtitles for roll effect */
.case-study-title,
.case-study-subtitle,
.project-title-hero,
.project-subtitle-hero {
    overflow: hidden;
}

/* Wrapper for each line of text */
.text-roll-line {
    display: block;
    overflow: hidden;
    height: auto;
}

/* Individual text element that will roll up */
.text-roll-inner {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1),
                opacity 0.8s ease;
}

/* Visible state after animation */
.text-roll-inner.visible {
    transform: translateY(0);
    opacity: 1;
}

/* Stagger delays for multiple lines */
.text-roll-line:nth-child(1) .text-roll-inner {
    transition-delay: 0.1s;
}

.text-roll-line:nth-child(2) .text-roll-inner {
    transition-delay: 0.2s;
}

.text-roll-line:nth-child(3) .text-roll-inner {
    transition-delay: 0.3s;
}

.text-roll-line:nth-child(4) .text-roll-inner {
    transition-delay: 0.4s;
}

.text-roll-line:nth-child(5) .text-roll-inner {
    transition-delay: 0.5s;
}

/* Alternative: Split text by words */
.text-roll-word {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    margin-right: 0.3em;
}

.text-roll-word:last-child {
    margin-right: 0;
}

.text-roll-word .text-roll-inner {
    display: inline-block;
}

/* Word stagger effect */
.text-roll-word:nth-child(1) .text-roll-inner {
    transition-delay: 0.05s;
}

.text-roll-word:nth-child(2) .text-roll-inner {
    transition-delay: 0.1s;
}

.text-roll-word:nth-child(3) .text-roll-inner {
    transition-delay: 0.15s;
}

.text-roll-word:nth-child(4) .text-roll-inner {
    transition-delay: 0.2s;
}

.text-roll-word:nth-child(5) .text-roll-inner {
    transition-delay: 0.25s;
}

.text-roll-word:nth-child(6) .text-roll-inner {
    transition-delay: 0.3s;
}

.text-roll-word:nth-child(7) .text-roll-inner {
    transition-delay: 0.35s;
}

.text-roll-word:nth-child(8) .text-roll-inner {
    transition-delay: 0.4s;
}

.text-roll-word:nth-child(9) .text-roll-inner {
    transition-delay: 0.45s;
}

.text-roll-word:nth-child(10) .text-roll-inner {
    transition-delay: 0.5s;
}

/* Faster variation for subtitles */
.text-roll-subtitle .text-roll-inner {
    transition-duration: 0.8s;
}

.text-roll-subtitle .text-roll-word:nth-child(1) .text-roll-inner {
    transition-delay: 0.3s;
}

.text-roll-subtitle .text-roll-word:nth-child(2) .text-roll-inner {
    transition-delay: 0.35s;
}

.text-roll-subtitle .text-roll-word:nth-child(3) .text-roll-inner {
    transition-delay: 0.4s;
}

.text-roll-subtitle .text-roll-word:nth-child(4) .text-roll-inner {
    transition-delay: 0.45s;
}

.text-roll-subtitle .text-roll-word:nth-child(5) .text-roll-inner {
    transition-delay: 0.5s;
}

.text-roll-subtitle .text-roll-word:nth-child(6) .text-roll-inner {
    transition-delay: 0.55s;
}

.text-roll-subtitle .text-roll-word:nth-child(7) .text-roll-inner {
    transition-delay: 0.6s;
}

.text-roll-subtitle .text-roll-word:nth-child(8) .text-roll-inner {
    transition-delay: 0.65s;
}

/* Enhanced animation with slight rotation (optional) */
.text-roll-enhanced .text-roll-inner {
    transform: translateY(120%) rotate(8deg);
}

.text-roll-enhanced .text-roll-inner.visible {
    transform: translateY(0) rotate(0deg);
}

/* Prevent text selection during animation */
.text-roll-animating {
    user-select: none;
}

/* Re-enable after animation */
.text-roll-complete {
    user-select: auto;
}
