/* TRANSMISSION ARCHIVE INTERFACE - ENHANCED v3.17 */

@keyframes scanline {
    0% { top: 0%; }
    100% { top: 100%; }
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; text-shadow: 0 0 10px #c33, 0 0 20px #c33; }
    50% { opacity: 1; text-shadow: 0 0 20px #f55, 0 0 30px #f55, 0 0 40px #c33; }
}

@keyframes symbolRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes flicker {
    0%, 100% { opacity: 1; }
    41%, 43% { opacity: 0.8; }
    45%, 47% { opacity: 0.6; }
    49% { opacity: 1; }
}

body {
    background: #000;
    color: #733;
    font-family: 'Courier New', monospace;
    padding: 40px 20px;
    line-height: 1.8;
    position: relative;
    overflow-x: hidden;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(50,0,0,0.05) 2px, rgba(50,0,0,0.05) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(50,0,0,0.05) 2px, rgba(50,0,0,0.05) 4px),
        radial-gradient(ellipse at center, rgba(30,0,0,0.2) 0%, rgba(0,0,0,1) 100%);
    animation: flicker 5s infinite;
}

/* CRT Scanline Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(100,20,20,0.3) 50%,
        transparent 100%);
    z-index: 9999;
    pointer-events: none;
    animation: scanline 6s linear infinite;
}

/* Glitch overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(100,0,0,0.03) 2px,
            rgba(100,0,0,0.03) 4px
        );
    pointer-events: none;
    z-index: 9998;
}

.transmission {
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #300;
    padding: 30px;
    background: rgba(10,0,0,0.9);
    box-shadow:
        inset 0 0 100px rgba(50,0,0,0.4),
        0 0 20px rgba(50,0,0,0.3),
        0 0 40px rgba(50,0,0,0.2),
        0 5px 15px rgba(0,0,0,0.5);
    position: relative;
    animation: textReveal 0.8s ease-out;
    backdrop-filter: blur(2px);
}

.transmission:hover {
    border-color: #500;
    box-shadow:
        inset 0 0 120px rgba(50,0,0,0.5),
        0 0 30px rgba(80,0,0,0.4),
        0 0 50px rgba(80,0,0,0.3),
        0 5px 20px rgba(0,0,0,0.6);
}

.header {
    text-align: center;
    border-bottom: 2px solid #400;
    padding-bottom: 20px;
    margin-bottom: 30px;
    color: #944;
    letter-spacing: 3px;
    animation: pulse 3s ease-in-out infinite;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        #c33 20%,
        #f55 50%,
        #c33 80%,
        transparent);
    animation: pulse 3s ease-in-out infinite;
}

.doctrine {
    margin: 20px 0;
    padding: 15px;
    border-left: 3px solid #500;
    background: rgba(30,0,0,0.6);
    color: #a55;
    position: relative;
    transition: all 0.3s ease;
    animation: textReveal 0.8s ease-out 0.2s both;
}

.doctrine::before {
    content: '▸';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    color: #c33;
    font-size: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.doctrine:hover {
    background: rgba(40,0,0,0.7);
    border-left-color: #700;
    padding-left: 20px;
    box-shadow: inset 0 0 20px rgba(100,0,0,0.3);
}

.coded {
    font-family: monospace;
    color: #655;
    font-size: 11px;
    letter-spacing: 1px;
    margin: 15px 0;
    padding: 10px;
    background: rgba(0,0,0,0.4);
    border: 1px solid #300;
    position: relative;
    overflow: hidden;
}

.coded::before {
    content: '> ';
    color: #c33;
}

.coded:hover {
    animation: glitch 0.3s ease-in-out;
    background: rgba(20,0,0,0.5);
}

.symbol {
    font-size: 24px;
    color: #733;
    display: inline-block;
    margin: 0 10px;
    transition: all 0.5s ease;
    text-shadow: 0 0 10px #c33;
}

.symbol:hover {
    color: #c55;
    transform: scale(1.2);
    animation: symbolRotate 2s linear infinite;
    text-shadow:
        0 0 20px #f55,
        0 0 30px #c33,
        0 0 40px #c33;
}

.ritual-img {
    width: 100%;
    max-width: 600px;
    margin: 30px auto;
    display: block;
    opacity: 0.7;
    filter: grayscale(80%) sepia(30%) hue-rotate(310deg) contrast(1.1);
    border: 1px solid #300;
    transition: all 0.4s ease;
    box-shadow: 0 0 20px rgba(50,0,0,0.5);
}

.ritual-img:hover {
    opacity: 0.9;
    filter: grayscale(60%) sepia(40%) hue-rotate(310deg) contrast(1.2);
    border-color: #500;
    box-shadow:
        0 0 30px rgba(100,0,0,0.6),
        0 0 50px rgba(100,0,0,0.4);
    transform: scale(1.02);
}

.ritual-video {
    width: 100%;
    max-width: 600px;
    margin: 30px auto;
    display: block;
    opacity: 0.6;
    filter: grayscale(90%) contrast(1.2) brightness(0.9);
    border: 1px solid #400;
    transition: all 0.4s ease;
    box-shadow: 0 0 20px rgba(50,0,0,0.5);
}

.ritual-video:hover {
    opacity: 0.8;
    filter: grayscale(80%) contrast(1.3) brightness(1);
    border-color: #600;
    box-shadow:
        0 0 30px rgba(100,0,0,0.6),
        0 0 50px rgba(100,0,0,0.4);
}

a {
    color: #a44;
    text-decoration: none;
    border-bottom: 1px solid #500;
    transition: all 0.3s ease;
    position: relative;
}

a::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: #f55;
    transition: width 0.3s ease;
}

a:hover {
    color: #c55;
    border-bottom-color: #700;
    text-shadow: 0 0 10px #c33;
}

a:hover::before {
    width: 100%;
}

.timestamp {
    color: #544;
    font-size: 10px;
    text-align: right;
    margin-top: 30px;
    font-family: monospace;
    letter-spacing: 2px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.timestamp:hover {
    opacity: 1;
    color: #755;
    text-shadow: 0 0 5px #c33;
}

/* Special class for important transmissions */
.transmission.critical {
    border-color: #c33;
    animation: pulse 3s ease-in-out infinite;
}

.transmission.critical .header {
    color: #c55;
    text-shadow: 0 0 20px #f55;
}

/* Glitch effect on specific elements */
.glitch {
    position: relative;
}

.glitch:hover {
    animation: glitch 0.5s ease-in-out infinite;
}

/* Screen distortion on scroll */
@media (prefers-reduced-motion: no-preference) {
    .transmission {
        transform: perspective(1000px) rotateX(0deg);
        transition: transform 0.3s ease;
    }

    .transmission:hover {
        transform: perspective(1000px) rotateX(1deg);
    }
}
