@font-face {
    font-family: 'OCRAEXT';
    src: url('./public/OCRAEXT.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'VCR EAS';
    src: url('./public/VcrEas-rX3K.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Custom styles for the brutalist, glitchy aesthetic */
body {
    font-family: 'OCRAEXT', 'VCR EAS', 'Roboto Mono', monospace;
    background-color: #000000;
    color: #FFFFFF;
    cursor: crosshair;
    overflow: hidden;
}

.video-background {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: -2;
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: -1;
}

/* --- INTRO ANIMATION STYLES --- */
#intro-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100;
    background-color: #000;
    animation: zoomOut 0.5s ease-in-out 2s forwards;
}

#intro-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, transparent 48%, rgba(255,0,65,0.1) 50%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(0,255,249,0.1) 50%, transparent 52%);
    z-index: 150;
    animation: intro-interference 0.8s steps(4, end) infinite;
    pointer-events: none;
}

#intro-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255,255,255,0.03) 2px,
        rgba(255,255,255,0.03) 4px
    );
    z-index: 140;
    animation: intro-scanlines 0.1s linear infinite;
    pointer-events: none;
}

.intro-word {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #000;
}

#intro-society {
    z-index: 30;
    animation: 
        intro-glitch-rgb 0.1s steps(2, end) infinite,
        slideOutLeft 0.25s ease-in-out 0.25s forwards;
}
#intro-society h1 {
    color: magenta!important;
}
#intro-is {
    z-index: 20;
    animation: 
        intro-glitch-rgb 0.15s steps(3, end) infinite,
        slideOutUp 0.5s ease-in-out 1s forwards;
}
#intro-is h1 {
    color: green!important;
}
#intro-broken {
    z-index: 10;
    animation: 
        intro-glitch-rgb 0.12s steps(4, end) infinite,
        intro-chaos-shake 0.3s ease-in-out infinite;
}
#intro-broken h1 {
    color: red !important;
}

#intro-broken::before {
    content: 'SYSTEM ERROR';
    position: absolute;
    top: 20%;
    right: 10%;
    font-family: 'OCRAEXT', monospace;
    font-size: 2vw;
    color: #ff0041;
    background: rgba(0,0,0,0.8);
    padding: 8px 12px;
    border: 2px solid #ff0041;
    opacity: 0;
    animation: intro-error-flash 3s steps(6, end) infinite;
    z-index: 200;
}

#intro-broken::after {
    content: '> SOCIETY.EXE HAS STOPPED WORKING';
    position: absolute;
    bottom: 15%;
    left: 5%;
    font-family: 'OCRAEXT', monospace;
    font-size: 1.5vw;
    color: #00fff9;
    background: rgba(0,0,0,0.9);
    padding: 6px 10px;
    border-left: 4px solid #00fff9;
    opacity: 0;
    animation: intro-console-text 4s steps(8, end) infinite 1s;
    z-index: 200;
}

.intro-word h1 {
    font-family: 'OCRAEXT', 'VCR EAS', 'Archivo Black', sans-serif;
    font-size: 15vw;
    color: white;
    z-index: 2;
    position: relative;
    animation: intro-text-corruption 1.5s steps(8, end) infinite;
}

.intro-word h1::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #ff0041;
    z-index: -1;
    animation: intro-text-glitch 2s steps(5, end) infinite;
}

.intro-word h1::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #00fff9;
    z-index: -2;
    animation: intro-text-chaos 1.2s steps(6, end) infinite;
}

.intro-word .video-background {
    z-index: 0;
}

.intro-word .video-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

@keyframes slideOutLeft {
    0% { transform: translateX(0); }
    15% { transform: translateX(-5px); }
    25% { transform: translateX(3px); }
    35% { transform: translateX(-10px); }
    45% { transform: translateX(2px); }
    55% { transform: translateX(-25px); }
    65% { transform: translateX(-20px); }
    75% { transform: translateX(-40px); }
    85% { transform: translateX(-60px); }
    95% { transform: translateX(-90%); }
    100% {
        transform: translateX(-100%);
        visibility: hidden;
    }
}

@keyframes slideOutUp {
    0% { transform: translateY(0); }
    12% { transform: translateY(2px); }
    24% { transform: translateY(-8px); }
    36% { transform: translateY(5px); }
    48% { transform: translateY(-15px); }
    60% { transform: translateY(-12px); }
    72% { transform: translateY(-30px); }
    84% { transform: translateY(-50px); }
    96% { transform: translateY(-85%); }
    100% {
        transform: translateY(-100%);
        visibility: hidden;
    }
}

@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(1.5);
        visibility: hidden;
    }
}

/* Chaotic Intro Effects */
@keyframes intro-glitch-rgb {
    0% { 
        filter: none; 
        transform: translate(0); 
    }
    20% { 
        filter: hue-rotate(90deg) saturate(1.5);
        transform: translate(-1px, 1px); 
    }
    40% { 
        filter: hue-rotate(180deg) contrast(1.2) brightness(1.1);
        transform: translate(1px, -1px); 
    }
    60% { 
        filter: hue-rotate(270deg) saturate(2) contrast(0.8);
        transform: translate(-2px, 0); 
    }
    80% { 
        filter: invert(0.1) hue-rotate(45deg);
        transform: translate(2px, 1px); 
    }
    100% { 
        filter: none; 
        transform: translate(0); 
    }
}

@keyframes intro-chaos-shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-2px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(2px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(2px, 2px) rotate(0deg); }
}

@keyframes intro-text-corruption {
    0% { opacity: 1; transform: scaleX(1) skewX(0deg); }
    12% { opacity: 0.8; transform: scaleX(0.95) skewX(2deg); }
    25% { opacity: 1; transform: scaleX(1.02) skewX(-1deg); }
    37% { opacity: 0.7; transform: scaleX(0.98) skewX(3deg); }
    50% { opacity: 1; transform: scaleX(1.05) skewX(0deg); }
    62% { opacity: 0.9; transform: scaleX(0.97) skewX(-2deg); }
    75% { opacity: 1; transform: scaleX(1.01) skewX(1deg); }
    87% { opacity: 0.6; transform: scaleX(0.99) skewX(-3deg); }
    100% { opacity: 1; transform: scaleX(1) skewX(0deg); }
}

@keyframes intro-text-glitch {
    0% { clip: rect(32px, 9999px, 64px, 0); transform: translate(-2px, 0); }
    20% { clip: rect(16px, 9999px, 48px, 0); transform: translate(2px, -1px); }
    40% { clip: rect(48px, 9999px, 80px, 0); transform: translate(-1px, 1px); }
    60% { clip: rect(24px, 9999px, 56px, 0); transform: translate(1px, -2px); }
    80% { clip: rect(40px, 9999px, 72px, 0); transform: translate(-2px, 1px); }
    100% { clip: rect(32px, 9999px, 64px, 0); transform: translate(0, 0); }
}

@keyframes intro-text-chaos {
    0% { clip: rect(64px, 9999px, 96px, 0); transform: translate(3px, 2px); }
    16% { clip: rect(80px, 9999px, 112px, 0); transform: translate(-2px, -1px); }
    33% { clip: rect(48px, 9999px, 80px, 0); transform: translate(1px, 3px); }
    50% { clip: rect(96px, 9999px, 128px, 0); transform: translate(-3px, 0px); }
    66% { clip: rect(72px, 9999px, 104px, 0); transform: translate(2px, -2px); }
    83% { clip: rect(56px, 9999px, 88px, 0); transform: translate(-1px, 2px); }
    100% { clip: rect(64px, 9999px, 96px, 0); transform: translate(0, 0); }
}

@keyframes intro-interference {
    0% { opacity: 0; transform: translate(0, 0) rotate(0deg); }
    25% { opacity: 0.3; transform: translate(5px, -3px) rotate(1deg); }
    50% { opacity: 0.1; transform: translate(-3px, 4px) rotate(-1deg); }
    75% { opacity: 0.4; transform: translate(2px, -2px) rotate(0.5deg); }
    100% { opacity: 0; transform: translate(0, 0) rotate(0deg); }
}

@keyframes intro-scanlines {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(4px); opacity: 0.7; }
}

@keyframes intro-error-flash {
    0%, 15% { opacity: 0; transform: scale(1); }
    16%, 25% { opacity: 0.9; transform: scale(1.05); }
    26%, 40% { opacity: 0; transform: scale(0.98); }
    41%, 50% { opacity: 0.8; transform: scale(1.02); }
    51%, 70% { opacity: 0; transform: scale(1); }
    71%, 85% { opacity: 0.95; transform: scale(1.08); }
    86%, 100% { opacity: 0; transform: scale(1); }
}

@keyframes intro-console-text {
    0%, 20% { opacity: 0; transform: translateX(-20px); }
    21%, 35% { opacity: 0.7; transform: translateX(0); }
    36%, 60% { opacity: 0; transform: translateX(2px); }
    61%, 80% { opacity: 0.8; transform: translateX(-1px); }
    81%, 100% { opacity: 0; transform: translateX(0); }
}

/* --- END INTRO ANIMATION STYLES --- */

/* Contract Address Prominence Effects */
#contract-section {
    animation: ca-pulse-glow 2s ease-in-out infinite;
}

#contract-address {
    position: relative;
    animation: 
        ca-border-flash 1.5s steps(6, end) infinite,
        ca-scale-pulse 3s ease-in-out infinite;
    box-shadow: 
        0 0 20px rgba(255, 0, 65, 0.3),
        inset 0 0 20px rgba(255, 0, 65, 0.1);
}

#contract-address::before {
    content: '⟫ COPY CONTRACT ⟪';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'OCRAEXT', monospace;
    font-size: 0.8rem;
    color: #ff0041;
    font-weight: bold;
    letter-spacing: 2px;
    animation: ca-text-flash 0.8s steps(4, end) infinite;
    z-index: 10;
}

#contract-address::after {
    content: '⟫ CLICK TO COPY ⟪';
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'OCRAEXT', monospace;
    font-size: 0.8rem;
    color: #00fff9;
    font-weight: bold;
    letter-spacing: 2px;
    animation: ca-text-flash 0.8s steps(4, end) infinite 0.4s;
    z-index: 10;
}

#contract-address:hover {
    animation: 
        ca-border-flash 0.3s steps(8, end) infinite,
        ca-hover-intense 0.2s ease-in-out infinite;
    box-shadow: 
        0 0 40px rgba(255, 0, 65, 0.8),
        inset 0 0 30px rgba(255, 0, 65, 0.2);
}

/* Contract Address Keyframes */
@keyframes ca-pulse-glow {
    0%, 100% { 
        filter: brightness(1) saturate(1);
        transform: scale(1);
    }
    50% { 
        filter: brightness(1.2) saturate(1.3);
        transform: scale(1.02);
    }
}

@keyframes ca-border-flash {
    0%, 20% { border-color: #888; background-color: transparent; }
    21%, 40% { border-color: #ff0041; background-color: rgba(255, 0, 65, 0.1); }
    41%, 60% { border-color: #00fff9; background-color: rgba(0, 255, 249, 0.1); }
    61%, 80% { border-color: #c3ff00; background-color: rgba(195, 255, 0, 0.1); }
    81%, 100% { border-color: #888; background-color: transparent; }
}

@keyframes ca-scale-pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.05) rotate(0.5deg); }
    50% { transform: scale(1.08) rotate(0deg); }
    75% { transform: scale(1.03) rotate(-0.5deg); }
}

@keyframes ca-text-flash {
    0%, 25% { opacity: 0; transform: translateX(-50%) scale(0.9); }
    26%, 75% { opacity: 1; transform: translateX(-50%) scale(1.1); }
    76%, 100% { opacity: 0; transform: translateX(-50%) scale(0.9); }
}

@keyframes ca-hover-intense {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.15) rotate(1deg); }
}

/* Emergency Alarm Effects */
.alarm-flasher {
    animation: alarm-flash 0.5s steps(2, end) infinite;
    box-shadow: 0 0 15px currentColor;
}

.alarm-spinner {
    animation: alarm-spin 1s linear infinite;
}

@keyframes alarm-flash {
    0%, 50% { 
        opacity: 0; 
        transform: scale(0.8); 
        box-shadow: 0 0 15px currentColor;
    }
    51%, 100% { 
        opacity: 1; 
        transform: scale(1.2); 
        box-shadow: 0 0 25px currentColor, 0 0 35px currentColor;
    }
}

@keyframes alarm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.font-archivo {
    font-family: 'OCRAEXT', 'VCR EAS', 'Archivo Black', sans-serif;
}

/* Glitch effect for the main title */
.glitch {
    position: relative;
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    overflow: hidden;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff0041;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff0041;
    clip: rect(85px, 450px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

/* Side flickering text */
.flicker-text {
    font-family: 'OCRAEXT', 'VCR EAS', 'Archivo Black', sans-serif;
    font-size: 2.5vw;
    animation: flicker-visibility 8s infinite steps(1, end);
    white-space: nowrap;
    user-select: none;
    opacity: 0; /* Start invisible */
}

@keyframes flicker-visibility {
     0% { opacity: 0; }
     2% { opacity: 1; }
     4% { opacity: 0; }
     10% { opacity: 0; }
     11% { opacity: 1; }
     13% { opacity: 0; }
     25% { opacity: 0; }
     26% { opacity: 1; }
     30% { opacity: 0; }
     50% { opacity: 1; }
     52% { opacity: 0; }
     60% { opacity: 1; }
     61% { opacity: 0; }
     100% { opacity: 0; }
}

/* Add different animation delays and colors for each text */
aside:first-of-type .flicker-text:nth-child(1) { animation-delay: 0.5s; color: #ff0041; }
aside:first-of-type .flicker-text:nth-child(2) { animation-delay: 2.5s; color: #00fff9; }
aside:first-of-type .flicker-text:nth-child(3) { animation-delay: 4s; color: #c3ff00; }
aside:last-of-type .flicker-text:nth-child(1) { animation-delay: 1.5s; color: #00fff9; }
aside:last-of-type .flicker-text:nth-child(2) { animation-delay: 3.5s; color: rgba(255, 255, 255, 0.8); }
aside:last-of-type .flicker-text:nth-child(3) { animation-delay: 5s; color: #ff0041; }


/* Typewriter effect */
.typewriter-container {
    width: 100%;
    max-width: 48rem; /* 768px - matches max-w-3xl */
    min-height: 4rem; /* Prevent layout shift */
    margin: 0 auto;
}

.typewriter-text {
    display: inline-block;
    overflow: hidden; 
    white-space: pre-line; /* Allow line breaks but prevent word wrapping */
    word-break: keep-all; /* Prevent automatic word breaking */
}

.cursor-custom {
    color: #ff0041 !important;
    font-weight: bold;
    animation: blink 0.75s step-end infinite;
}

@keyframes blink {
    from, to { opacity: 0; }
    50% { opacity: 1; }
}

/* Keyframe animations for the glitch effect */
@keyframes glitch-anim {
    0% { clip: rect(42px, 9999px, 44px, 0); transform: skew(0.3deg); }
    5% { clip: rect(17px, 9999px, 94px, 0); }
    10% { clip: rect(40px, 9999px, 62px, 0); }
    15% { clip: rect(32px, 9999px, 16px, 0); }
    20% { clip: rect(62px, 9999px, 78px, 0); }
    25% { clip: rect(25px, 9999px, 53px, 0); }
    30% { clip: rect(13px, 9999px, 82px, 0); }
    35% { clip: rect(54px, 9999px, 43px, 0); }
    40% { clip: rect(63px, 9999px, 88px, 0); }
    45% { clip: rect(49px, 9999px, 12px, 0); }
    50% { clip: rect(48px, 9999px, 54px, 0); }
    55% { clip: rect(68px, 9999px, 13px, 0); }
    60% { clip: rect(52px, 9999px, 73px, 0); }
    65% { clip: rect(11px, 9999px, 60px, 0); }
    70% { clip: rect(88px, 9999px, 4px, 0); }
    75% { clip: rect(98px, 9999px, 43px, 0); }
    80% { clip: rect(45px, 9999px, 78px, 0); }
    85% { clip: rect(10px, 9999px, 99px, 0); }
    90% { clip: rect(23px, 9999px, 5px, 0); }
    95% { clip: rect(82px, 9999px, 97px, 0); }
    100% { clip: rect(2px, 9999px, 48px, 0); transform: skew(-0.2deg); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(65px, 9999px, 119px, 0); transform: skew(0.5deg); }
    5% { clip: rect(15px, 9999px, 83px, 0); }
    10% { clip: rect(88px, 9999px, 5px, 0); }
    15% { clip: rect(45px, 9999px, 78px, 0); }
    20% { clip: rect(10px, 9999px, 99px, 0); }
    25% { clip: rect(43px, 9999px, 32px, 0); }
    30% { clip: rect(82px, 9999px, 97px, 0); }
    35% { clip: rect(23px, 9999px, 5px, 0); }
    40% { clip: rect(11px, 9999px, 60px, 0); }
    45% { clip: rect(52px, 9999px, 73px, 0); }
    50% { clip: rect(88px, 9999px, 4px, 0); }
    55% { clip: rect(13px, 9999px, 82px, 0); }
    60% { clip: rect(62px, 9999px, 78px, 0); }
    65% { clip: rect(40px, 9999px, 62px, 0); }
    70% { clip: rect(17px, 9999px, 94px, 0); }
    75% { clip: rect(42px, 9999px, 44px, 0); }
    80% { clip: rect(62px, 9999px, 78px, 0); }
    85% { clip: rect(25px, 9999px, 53px, 0); }
    90% { clip: rect(54px, 9999px, 43px, 0); }
    95% { clip: rect(49px, 9999px, 12px, 0); }
    100% { clip: rect(48px, 9999px, 54px, 0); transform: skew(-0.3deg); }
}

@keyframes glitch-skew {
    0% { transform: skew(1deg); }
    10% { transform: skew(-0.5deg); }
    20% { transform: skew(0.2deg); }
    30% { transform: skew(0.8deg); }
    40% { transform: skew(-0.1deg); }
    50% { transform: skew(-0.9deg); }
    60% { transform: skew(0.4deg); }
    70% { transform: skew(0.7deg); }
    80% { transform: skew(-0.3deg); }
    90% { transform: skew(0.1deg); }
    100% { transform: skew(-0.6deg); }
}

/* Reuse existing glitch effect for emphasized text in typewriter */
.typewriter-text em {
    position: relative;
    display: inline-block;
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

.typewriter-text em::before,
.typewriter-text em::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    overflow: hidden;
}

.typewriter-text em::before {
    left: 2px;
    text-shadow: -2px 0 #ff0041;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.typewriter-text em::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff0041;
    clip: rect(85px, 450px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}