.fourth-fold {
    position: relative;
    min-height: 600vh; /* Increase from 300vh to 600vh for extremely slow channel changes */
    background-color: #000;  /* Changed to black */
    padding: 160px 0px 80px;
    color: rgba(255, 255, 255, 0.9);
    z-index: 2;
    opacity: 0; /* Start hidden */
    transition: opacity 0.6s ease;
    margin-top: 0; /* Remove the 100vh margin */
    overflow: hidden; /* For the grid pattern */
    /* Make the section a flex container to center its content */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fourth-fold.show {
    opacity: 1;
}

/* Add grid background */
.fourth-fold::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px) 0 0 / 40px 40px,
        linear-gradient(0deg, rgba(255,255,255,0.05) 1px, transparent 1px) 0 0 / 40px 40px;
    z-index: -1;
}

.fourth-fold-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    /* Add flex properties for vertical centering */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 240px); /* Account for padding */
}

/* Title above the TV */
.tv-title {
    font-family: 'VT323', monospace;
    font-size: 36px;
    color: #00C8FF;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(0, 200, 255, 0.5);
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease; /* Smooth transition when pinning/unpinning */
    width: 100%;
    text-align: center;
}

/* Title when pinned with TV */
.tv-title.pinned {
    margin-bottom: 0;
}

/* TV section container */
.tv-section {
    margin: 0 auto;
    position: relative;
    width: 100%;
    max-width: 700px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Styles only for the fourth-fold h2 that don't use primary-title class */
.fourth-fold h2:not(.primary-title) {
    font-size: 48px;
    margin-bottom: 30px;
    font-family: 'VT323', monospace;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    opacity: 0;
}

.fourth-fold.show h2:not(.primary-title) {
    animation: textReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Add technical decoration to title */
.fourth-fold h2::after {
    content: 'fig. III';
    position: absolute;
    bottom: -20px;
    right: 0;
    font-size: 14px;
    opacity: 0.5;
    font-family: 'VT323', monospace;
}

/* The TV screen */
.tv-screen {
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    background: #000; /* Simple black background */
    border-radius: 6px;
    overflow: hidden;
}

/* TV static effect */
.tv-static {
    display: none; /* Hide the static effect */
}

@keyframes tv-static {
    0% { background-position: 0 0; }
    100% { background-position: 100% 100%; }
}

/* TV channels container - Holds all channels */
.tv-channels-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* TV channel content */
.tv-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
    padding: 20px;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease; /* Smooth fade transition */
    pointer-events: none;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

/* Active channel styling */
.tv-content.active {
    opacity: 1;
    visibility: visible; /* Make active channel visible */
    transform: scale(1);
    pointer-events: auto;
}

/* Styles for the channel "off" state - these are now handled in JS */
.tv-content.channel-change {
    opacity: 0;
    visibility: hidden;
    transform: scale(1); /* Remove scaling effect */
}

.tv-logo {
    font-family: 'VT323', monospace;
    font-size: 30px;
    color: #00C8FF;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(0, 200, 255, 0.5);
    letter-spacing: 2px;
}

.tv-tagline {
    font-family: 'VT323', monospace;
    font-size: 22px;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.tv-text {
    font-family: 'Rubik', sans-serif;
    font-size: 32px;
    line-height: 1.4;
    text-align: center;
    margin-bottom: 25px;
    max-width: 95%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-weight: 500;
    color: white;
}

.tv-channel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
    z-index: 4;
}

.channel-number {
    display: inline-block;
    min-width: 30px;
}

/* TV glitch */
.tv-glitch {
    display: none; /* Hide the glitch element */
}

.tv-glitch.active {
    animation: none; /* Disable the animation */
}

/* Special glitch animation for channel changes */
.tv-glitch.channel-change {
    animation: none; /* Disable the animation */
}

/* Scan lines */
.scan-lines {
    display: none; /* Hide the scan lines */
}

/* TV controls */
.tv-controls {
    display: none; /* Hide the controls instead of completely removing them from HTML */
}

.tv-knob {
    display: none; /* Hide the knobs */
}

/* Container for channel controls below the TV */
.channel-controls-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 25px;
}

/* Channel indicator - moved below the TV */
.channel-indicator {
    text-align: center;
    z-index: 5;
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.scroll-prompt {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    animation: pulse 2s infinite;
    margin-bottom: 10px;
}

@keyframes pulse {
    0% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.6; transform: scale(1); }
}

.technical-marker {
    position: absolute;
    font-family: 'VT323', monospace;
    font-size: 10px;
    opacity: 0.5;
    letter-spacing: 1px;
}

.technical-marker.top-right {
    top: 20px;
    right: 20px;
}

.technical-marker.bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Remove pinned special class since we're handling it with JS now */
.tv-section.pinned {
    /* All styles are now applied directly in JavaScript */
}

/* No need for pin-spacer styles either */
.pin-spacer {
    /* Handled in JavaScript */
}

.fourth-fold-content.pinned-active {
    display: none; /* Hide this class since we don't use it anymore */
}

/* Adjust overall fourth-fold padding for better vertical centering */
@media screen and (min-height: 900px) {
    .fourth-fold {
        padding: 0 20px; /* Remove vertical padding for taller screens to center better */
    }
}

/* Remove specific styles for the title when pinned since it no longer exists */
.tv-section.pinned h2 {
    display: none;
}

/* Hide fourth-fold completely on mobile devices */
@media screen and (max-width: 767px) {
    .fourth-fold {
        display: none !important;
    }
}

@media screen and (max-width: 900px) {
    .fourth-fold {
        padding: 120px 20px 60px;
    }
    
    .tv-screen {
        width: 600px;
        height: 400px;
    }
}

@media screen and (max-width: 650px) {
    .fourth-fold {
        padding: 100px 15px 50px;
    }
    
    .fourth-fold::before {
        background: 
            linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px) 0 0 / 20px 20px,
            linear-gradient(0deg, rgba(255,255,255,0.03) 1px, transparent 1px) 0 0 / 20px 20px;
    }
    
    .fourth-fold h2::after {
        font-size: 12px;
    }

    .technical-marker {
        font-size: 8px;
    }
    
    .tv-screen {
        top: 15px;
        left: 15px;
        right: 15px;
        bottom: 15px;
    }
    
    .tv-logo {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    .tv-text {
        font-size: 20px;
        max-width: 95%;
        line-height: 1.3;
    }
    
    .tv-tagline {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .channel-numbers {
        gap: 6px;
    }
    
    .tv-title {
        font-size: 28px;
        margin-bottom: 20px;
    }
}

@media screen and (max-width: 480px) {
    .fourth-fold {
        padding: 80px 10px 40px;
    }
    
    .tv-screen {
        width: 100%;
        max-width: 100%;
        height: 280px;
    }
    
    .tv-logo {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .tv-text {
        font-size: 18px;
        max-width: 95%;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    .tv-tagline {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .channel-indicator {
        width: 100%;
        display: flex;
        justify-content: center;
        margin: 0 auto;
    }
    
    .channel-numbers {
        width: 220px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        margin: 0 auto;
        gap: 8px;
        row-gap: 8px;
    }
    
    .channel-numbers a {
        width: 35px !important;
        height: 35px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        font-size: 18px !important;
        color: white !important;
        border-width: 1px !important;
        font-weight: bold !important;
        flex: 0 0 auto;
        margin-bottom: 0;
    }
    
    /* Force first 5 buttons to first row */
    .channel-numbers a:nth-child(-n+5) {
        order: 0;
    }
    
    /* Force last 5 buttons to second row */
    .channel-numbers a:nth-child(n+6) {
        order: 1;
    }
    
    .channel-controls-container {
        padding-bottom: 30px;
        margin-top: -20px; /* Move up by 20px in mobile */
    }
    
    .tv-title {
        font-size: 24px;
        margin-bottom: 30px;
        margin-top: 15px;
    }
}

@media screen and (max-width: 375px) {
    .tv-screen {
        height: 250px;
    }
    
    .tv-logo {
        font-size: 18px;
    }
    
    .tv-text {
        font-size: 13px;
        line-height: 1.2;
        margin-bottom: 10px;
    }
    
    .tv-tagline {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .channel-numbers {
        width: 200px;
        gap: 5px;
        row-gap: 5px;
    }
    
    .channel-numbers a {
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
    }
}

/* Channel numbers row */
.channel-numbers {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    position: relative;
    z-index: 200; /* Ensure the container is above other elements */
    pointer-events: auto !important; /* Force pointer events */
}

/* Individual channel number button */
.channel-number-btn {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-color: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(0, 200, 255, 0.4);
    border-radius: 3px;
    color: rgba(255, 255, 255, 0.8) !important;
    font-family: 'VT323', monospace;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 200; /* Ensure buttons are above other elements */
    pointer-events: auto !important; /* Force pointer events */
    text-decoration: none !important; /* Remove underline from links */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    outline: none; /* Remove outline */
    -webkit-appearance: none; /* Remove default appearance */
    -moz-appearance: none;
    appearance: none;
}

.channel-number-btn:hover {
    background-color: rgba(0, 200, 255, 0.3);
    border-color: rgba(0, 200, 255, 0.8);
    color: #fff;
}

.channel-number-btn:focus {
    outline: none;
    background-color: rgba(0, 200, 255, 0.3);
    border-color: rgba(0, 200, 255, 0.8);
    color: #fff;
}

.channel-number-btn:active {
    background-color: rgba(0, 200, 255, 0.6);
    border-color: #00C8FF;
    color: #fff;
    transform: scale(0.95); /* Slight scale effect when clicked */
}

.channel-number-btn.active {
    background-color: rgba(0, 200, 255, 0.6);
    border-color: #00C8FF;
    color: #fff;
    box-shadow: 0 0 8px rgba(0, 200, 255, 0.7);
}

/* Channel image container */
.channel-image-container {
    position: absolute;
    z-index: 10;
    pointer-events: none; /* Allow clicks to pass through */
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    opacity: 0; /* Hidden by default */
    display: none; /* Hide all by default */
    transform-origin: center center;
    transform: rotate(var(--rotation)); /* Apply rotation to container instead of image */
}

/* Show the image container when its corresponding channel is active */
.channel-image-container[data-channel="1"],
.channel-image-container[data-channel="2"],
.channel-image-container[data-channel="3"],
.channel-image-container[data-channel="4"],
.channel-image-container[data-channel="5"],
.channel-image-container[data-channel="6"],
.channel-image-container[data-channel="7"],
.channel-image-container[data-channel="8"],
.channel-image-container[data-channel="9"],
.channel-image-container[data-channel="10"] {
    display: block;
}

/* Position for channel 6 image (right side, like other right-hand images) */
.channel-image-container[data-channel="6"] {
    right: -85px; /* Try a much larger negative value */
    top: 55%;
    --rotation: 2deg;
    display: block;
}

/* Restore original positions for channel 7 and 8 */
.channel-image-container[data-channel="7"] {
    right: -210px;
    top: calc(45% - 130px);
    --rotation: -3deg;
}

.channel-image-container[data-channel="8"] {
    left: -180px;
    top: 65%;
    --rotation: 4deg;
}

/* Strategic placement for ACP (2025) visual */
.channel-image-container[data-channel="10"] {
    right: -120px;
    top: calc(32% - 3cm);
    --rotation: -2deg;
}

/* Randomly position channel images on left and right */
.channel-image-container[data-channel="1"] {
    left: -180px;
    top: 45%;
}

.channel-image-container[data-channel="2"] {
    right: -180px;
    top: 40%;
}

.channel-image-container[data-channel="3"] {
    left: -200px;
    top: 30%;
}

.channel-image-container[data-channel="4"] {
    right: -190px;
    top: 60%;
}

.channel-image-container[data-channel="5"] {
    left: -170px;
    top: 50%;
}

/* Hook channel 6 into the appear/disappear keyframes for right-hand images */
.channel-image-container[data-channel="2"].visible,
.channel-image-container[data-channel="4"].visible,
.channel-image-container[data-channel="6"].visible,
.channel-image-container[data-channel="7"].visible,
.channel-image-container[data-channel="9"].visible,
.channel-image-container[data-channel="10"].visible {
    animation: imageAppearRight 0.8s cubic-bezier(.2,.8,.2,1) forwards;
}

.channel-image-container[data-channel="2"]:not(.visible),
.channel-image-container[data-channel="4"]:not(.visible),
.channel-image-container[data-channel="6"]:not(.visible),
.channel-image-container[data-channel="7"]:not(.visible),
.channel-image-container[data-channel="9"]:not(.visible),
.channel-image-container[data-channel="10"]:not(.visible) {
    animation: imageFadeOutRight .6s cubic-bezier(.4,0,.2,1) forwards;
}

/* Channel images */
.channel-image {
    max-width: 240px; /* Slightly bigger */
    height: auto;
    border-radius: 8px;
    filter: drop-shadow(0 0 15px rgba(0, 200, 255, 0.4));
}

/* Make ACP logo clearly visible but not overpowering */
.channel-image-container[data-channel="10"] .channel-image {
    max-width: 182px; /* 30% smaller than 260px */
    opacity: 0.6; /* stronger presence for glow perception */
    filter: invert(1) saturate(0) brightness(1.25) contrast(1.1)
            drop-shadow(0 0 28px rgba(0, 200, 255, 0.35))
            drop-shadow(0 0 64px rgba(0, 200, 255, 0.25))
            drop-shadow(0 0 96px rgba(0, 200, 255, 0.18));
}

/* Soft aura behind ACP logo for a designerly glow */
.channel-image-container[data-channel="10"]::after {
    content: '';
    position: absolute;
    right: -30px;
    top: -30px;
    width: 260px;
    height: 260px;
    background: radial-gradient(50% 50% at 50% 50%, rgba(0, 200, 255, 0.18) 0%, rgba(0, 200, 255, 0.08) 50%, rgba(0, 200, 255, 0) 80%);
    filter: blur(16px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1; /* keep aura behind the logo */
}

.channel-image-container[data-channel="10"].visible::after {
    opacity: 1;
}

/* Add random rotation to images */
.channel-image-container[data-channel="1"] .channel-image {
    transform: none;
}

.channel-image-container[data-channel="2"] .channel-image {
    transform: none;
}

.channel-image-container[data-channel="3"] .channel-image {
    transform: none;
}

.channel-image-container[data-channel="4"] .channel-image {
    transform: none;
}

.channel-image-container[data-channel="5"] .channel-image {
    transform: none;
}

.channel-image-container[data-channel="6"] .channel-image {
    max-width: 127px; /* 110px * 1.15 ≈ 127px (15% bigger) */
    border-radius: 8px;
    filter: drop-shadow(0 0 15px rgba(0, 200, 255, 0.4));
    background: linear-gradient(120deg, rgba(0,200,255,0.08) 60%, rgba(0,200,255,0.18) 100%);
    border: 1.5px solid rgba(0,200,255,0.12);
}

.channel-image-container[data-channel="7"] .channel-image {
    transform: none;
}

.channel-image-container[data-channel="8"] .channel-image {
    transform: none;
}

.channel-image-container[data-channel="9"] .channel-image {
    transform: none;
}

/* Animation keyframes for image appearance */
@keyframes imageAppear {
    0% { 
        opacity: 0; 
        transform: translateX(-20px) scale(0.9);
    }
    100% { 
        opacity: 1; 
        transform: translateX(0) scale(1);
    }
}

@keyframes imageAppearRight {
    0% { 
        opacity: 0; 
        transform: translateX(20px) scale(0.9);
    }
    100% { 
        opacity: 1; 
        transform: translateX(0) scale(1);
    }
}

@keyframes imageFadeOut {
    0% { 
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% { 
        opacity: 0;
        transform: translateX(-15px) scale(0.95);
    }
}

@keyframes imageFadeOutRight {
    0% { 
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% { 
        opacity: 0;
        transform: translateX(15px) scale(0.95);
    }
}

/* Animations for left-side images */
.channel-image-container[data-channel="1"].visible,
.channel-image-container[data-channel="3"].visible,
.channel-image-container[data-channel="5"].visible,
.channel-image-container[data-channel="8"].visible {
    animation: imageAppear 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    transform: rotate(var(--rotation)); /* Maintain constant rotation */
}

/* Animations for right-side images */
.channel-image-container[data-channel="2"].visible,
.channel-image-container[data-channel="4"].visible,
.channel-image-container[data-channel="7"].visible,
.channel-image-container[data-channel="9"].visible {
    animation: imageAppearRight 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    transform: rotate(var(--rotation)); /* Maintain constant rotation */
}

/* Fade-out animations */
.channel-image-container[data-channel="1"]:not(.visible),
.channel-image-container[data-channel="3"]:not(.visible),
.channel-image-container[data-channel="5"]:not(.visible),
.channel-image-container[data-channel="8"]:not(.visible) {
    animation: imageFadeOut 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform: rotate(var(--rotation)); /* Maintain constant rotation */
}

.channel-image-container[data-channel="2"]:not(.visible),
.channel-image-container[data-channel="4"]:not(.visible),
.channel-image-container[data-channel="7"]:not(.visible),
.channel-image-container[data-channel="9"]:not(.visible) {
    animation: imageFadeOutRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform: rotate(var(--rotation)); /* Maintain constant rotation */
}

/* Add custom rotation variables with more subtle tilts */
.channel-image-container[data-channel="1"] {
    --rotation: -2deg;
}

.channel-image-container[data-channel="2"] {
    --rotation: 3deg;
}

.channel-image-container[data-channel="3"] {
    --rotation: -2deg;
}

.channel-image-container[data-channel="4"] {
    --rotation: -4deg;
}

.channel-image-container[data-channel="5"] {
    --rotation: 2deg;
}

.channel-image-container[data-channel="6"] {
    --rotation: 1deg;
}

.channel-image-container[data-channel="7"] {
    --rotation: -3deg;
}

.channel-image-container[data-channel="8"] {
    --rotation: 4deg;
}

.channel-image-container[data-channel="9"] {
    --rotation: -1deg;
}

/* Responsive adjustments for channel images */
@media screen and (max-width: 1200px) {
    .channel-image-container[data-channel="2"],
    .channel-image-container[data-channel="4"],
    .channel-image-container[data-channel="7"],
.channel-image-container[data-channel="9"],
.channel-image-container[data-channel="10"] {
        right: -150px;
    }
    
    .channel-image-container[data-channel="1"],
    .channel-image-container[data-channel="3"],
    .channel-image-container[data-channel="5"],
    .channel-image-container[data-channel="8"] {
        left: -150px;
    }
    
    .channel-image {
        max-width: 200px;
    }
}

@media screen and (max-width: 950px) {
    .channel-image-container[data-channel="2"],
    .channel-image-container[data-channel="4"],
    .channel-image-container[data-channel="7"],
.channel-image-container[data-channel="9"],
.channel-image-container[data-channel="10"] {
        right: -100px;
    }
    
    .channel-image-container[data-channel="1"],
    .channel-image-container[data-channel="3"],
    .channel-image-container[data-channel="5"],
    .channel-image-container[data-channel="8"] {
        left: -100px;
    }
    
    .channel-image {
        max-width: 170px;
    }
}

@media screen and (max-width: 800px) {
    .channel-image-container {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin-top: 30px;
        display: flex;
        justify-content: center;
        width: 100%;
    }
    
    .tv-content.active .channel-image-container {
        transform: none;
    }
    
    .channel-image {
        max-width: 120px;
        transform: rotate(0deg);
    }
} 

