button {
    all: unset;
    cursor: pointer;
    box-sizing: border-box;
}

/* GRID BACKGROUND ANIMATION */
html {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

body {
    position: relative;
    height: 100vh;
    margin: 0;
    padding: 30px;
    background: linear-gradient(
        #000000 25%,
        #ff3131 50%,
        #ff3131 50%,
        #000000 100%
    );
    background-attachment: fixed;
    font-family: "Orbitron", "Courier New", monospace;
    color: red;
}

.wrap {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    margin: 0 auto;
    perspective: 360px;
    perspective-origin: 50% 50%;
    pointer-events: none;
    z-index: 0;
}

.top-plane {
    width: 200%;
    height: 130%;
    position: absolute;
    bottom: -30%;
    left: -50%;
    background-image: 
        linear-gradient(#ff3131 2px, transparent 2px),
        linear-gradient(to right, #ff3131 2px, transparent 2px);
    background-size: 100px 100px, 100px 100px;
    background-position: -1px -1px, -1px -1px;
    transform: rotateX(85deg);
    animation: planeMoveTop 2s infinite linear;
}

.bottom-plane {
    width: 200%;
    height: 130%;
    position: absolute;
    top: -30%;
    left: -50%;
    background-image: 
        linear-gradient(#ff3131 2px, transparent 2px),
        linear-gradient(to right, #ff3131 2px, transparent 2px);
    background-size: 100px 100px, 100px 100px;
    background-position: -1px -1px, -1px -1px;
    transform: rotateX(-85deg);
    animation: planeMoveBot 2s infinite linear;
}

@keyframes planeMoveTop {
    from {
        background-position: 0px -100px, 0px 0px;
    }
    to {
        background-position: 0px 0px, 100px 0px;
    }
}

@keyframes planeMoveBot {
    from {
        background-position: 0px 0px, 0px 0px;
    }
    to {
        background-position: 0px -100px, 100px 0px;
    }
}

@media (max-height: 350px) {
    .wrap {
        perspective: 210px;
    }
}

/* OVERALL STYLE STUFFS */
body {
    background-attachment: fixed;
    font-family: "Orbitron", "Courier New", monospace;
    color: red;
    margin: 0;
    padding: 30px;
}

header h1 {
    font-family: "Audiowide", "Courier New", monospace;
    font-size: 2em;
    letter-spacing: 2px;
    margin-bottom: 5px;
}
h1, h2, h3, h4, h5 {font-family: "Audiowide", "Courier New", monospace;
    margin: 0;
    padding: 0;
}

 p {
    margin: 0;
    padding: 0;
     font-size: small;
}

/* MAINCONTAINER */
.maincontainer {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    background-color: black; 
    border: 10px double red;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 0 20px red;
    position: relative;
    z-index: 1;
}

/* HEADER STUFFS AND MARQUEES */
header {
    text-align: center;
}

header h1 {
    font-size: 2em;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

header marquee {
    display: block;
    border: 4px dotted red; 
    padding: 3px;
    margin-bottom: 10px;
    color: red;
    background: black;
    font-weight: bold;
}

footer marquee {
    display: block;
    border: 2px solid red; 
    padding: 3px;
    margin-top: 10px;
    color: red;
    background: black;
    font-size:10px;
    font-weight: bold;
}

/* NAV STUFFS */
nav {
    display: flex;
    justify-content: space-evenly;
    margin-bottom: 10px;
}

nav a {
    color: red !important;
    text-decoration: none;
    border: 2px solid red;
    background: black;
    padding: 5px 15px;
    font-weight: bold;
    font-family: "Audiowide", "Courier New", monospace;
    transition: all 0.2s ease-in-out;
    position: relative;
}

/* this might be unneeded now but i'm afraid to change it*/
@keyframes pulseGlow {
    0%, 100% {
        filter: drop-shadow(0 0 3px red) drop-shadow(0 0 6px red);
    }
    50% {
        filter: drop-shadow(0 0 6px red) drop-shadow(0 0 12px red);
    }
}

/* nav hover effects */
nav a:hover {
    background: black !important; 
    color: red !important; 
    transform: translateY(-3px);
    animation: pulseGlow 2s ease-in-out infinite alternate;
}

/* NAV ACTIVE TAB WITH SCREEN TEAR GLITCH */
nav a.active {
    background: black !important;
    color: red !important;
    transform: translateY(-2px);
    animation: pulseGlow 3s ease-in-out infinite alternate;
}

nav a.active::before,
nav a.active::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 5px 15px;
    pointer-events: none;
    opacity: 0;
    overflow: hidden;
    background: black;
}

nav a.active.glitch {
    animation: navShake 0.5s ease-in-out, pulseGlow 3s ease-in-out infinite alternate;
}

nav a.active.glitch::before {
    animation: navTearLeft 0.5s ease-in-out;
    color: #ff00ff;
    z-index: 1;
}

nav a.active.glitch::after {
    animation: navTearRight 0.5s ease-in-out;
    color: #00ffff;
    z-index: 2;
}

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

@keyframes navTearLeft {
    0%, 100% {
        opacity: 0;
        clip-path: inset(0 0 0 0);
        transform: translateX(0);
    }
    5% {
        opacity: 0.8;
        clip-path: inset(23% 0 67% 0);
        transform: translateX(-8px);
    }
    15% {
        opacity: 0.7;
        clip-path: inset(61% 0 12% 0);
        transform: translateX(-5px);
    }
    25% {
        opacity: 0.9;
        clip-path: inset(8% 0 88% 0);
        transform: translateX(-10px);
    }
    35% {
        opacity: 0.6;
        clip-path: inset(47% 0 31% 0);
        transform: translateX(-6px);
    }
    45% {
        opacity: 0.8;
        clip-path: inset(72% 0 15% 0);
        transform: translateX(-9px);
    }
    55% {
        opacity: 0.7;
        clip-path: inset(19% 0 73% 0);
        transform: translateX(-7px);
    }
    65% {
        opacity: 0.9;
        clip-path: inset(54% 0 28% 0);
        transform: translateX(-11px);
    }
    75% {
        opacity: 0.6;
        clip-path: inset(33% 0 59% 0);
        transform: translateX(-5px);
    }
    85% {
        opacity: 0.8;
        clip-path: inset(68% 0 7% 0);
        transform: translateX(-8px);
    }
    95% {
        opacity: 0.5;
        clip-path: inset(11% 0 81% 0);
        transform: translateX(-4px);
    }
}

@keyframes navTearRight {
    0%, 100% {
        opacity: 0;
        clip-path: inset(0 0 0 0);
        transform: translateX(0);
    }
    8% {
        opacity: 0.7;
        clip-path: inset(41% 0 48% 0);
        transform: translateX(7px);
    }
    18% {
        opacity: 0.9;
        clip-path: inset(77% 0 9% 0);
        transform: translateX(9px);
    }
    28% {
        opacity: 0.6;
        clip-path: inset(14% 0 79% 0);
        transform: translateX(5px);
    }
    38% {
        opacity: 0.8;
        clip-path: inset(52% 0 36% 0);
        transform: translateX(11px);
    }
    48% {
        opacity: 0.7;
        clip-path: inset(29% 0 64% 0);
        transform: translateX(6px);
    }
    58% {
        opacity: 0.9;
        clip-path: inset(66% 0 18% 0);
        transform: translateX(10px);
    }
    68% {
        opacity: 0.6;
        clip-path: inset(7% 0 86% 0);
        transform: translateX(8px);
    }
    78% {
        opacity: 0.8;
        clip-path: inset(44% 0 42% 0);
        transform: translateX(7px);
    }
    88% {
        opacity: 0.7;
        clip-path: inset(81% 0 3% 0);
        transform: translateX(9px);
    }
    98% {
        opacity: 0.5;
        clip-path: inset(26% 0 68% 0);
        transform: translateX(4px);
    }
}

/* nav current tab */
nav a:visited {
    color: red !important;
}

/* GLITCH EFFECT FOR ALL NON-NAV LINKS */
a:not(nav a) {
    position: relative;
    display: inline-block;
}

a:not(nav a):hover {
    animation: linkShake 0.3s ease-in-out;
}

@keyframes linkShake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-1px, 0); }
    50% { transform: translate(1px, 0); }
    75% { transform: translate(-1px, 0); }
}

/* GRID LAYOUT */
main {
    display: grid;
    grid-template-columns: 2fr 0.3fr;
    grid-template-rows:
        auto auto auto auto auto auto; 
    gap: 10px;
    
    grid-template-areas: 
    "multibox archivebox"
    "multibox linksbox"
    "multibox linksbox"
    "stampmarquee stampmarquee"
    "crtbox crtbox"
    "crtbox crtbox";
}

/* box=box */
.multibox {grid-area: multibox;}
.archivebox {grid-area: archivebox;}
.linksbox {grid-area: linksbox;}
.stampmarquee {grid-area: stampmarquee;}
.crtbox {grid-area: crtbox;}

/* multibox style */
.multibox {
   background-image: url(IMAGES/starspurple.gif);
    background-repeat: repeat;
    background-size: auto;
    padding: 15px;
    
    /* special firefox scrollbar */
    scrollbar-width: thin;
    scrollbar-color: red black;
}

/* gross chromium scrollbar */
.multibox::-webkit-scrollbar {
    width: 12px;
    background: black;
}

.multibox::-webkit-scrollbar-track {
    background: black !important;
    border: 1px solid red;
}

.multibox::-webkit-scrollbar-thumb {
    background: black !important;
    border: 2px solid red !important;
    transition: all 0.2s ease-in-out;
}

@keyframes scrollbarGlow {
    0%, 100% {
        box-shadow: 0 0 3px red, 0 0 6px red;
    }
    50% {
        box-shadow: 0 0 6px red, 0 0 12px red;
    }
}

.multibox::-webkit-scrollbar-thumb:hover {
    background: black !important;
    border: 2px solid red !important;
    animation: scrollbarGlow 2s ease-in-out infinite alternate;
}

/* MULTIBOX - SCROLLABLE CONTAINER */
.multibox {
    max-height: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* BLOG POST CARD */
.blog-post-card {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 20px;
    padding: 10px 20px;
    align-items: start;
}


/* PROFILE PIC COLUMN */
.profile-pic {
    width: 80px;  
    height: 80px; 
    border: 2px solid red;
    border-radius: 5px;
    background: rgba(255, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    text-align: center;
    overflow: hidden;
    margin-top: 14px;
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* BLOG CONTENT COLUMN */
.blog-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 2px solid red;
    border-radius: 15px;
    padding: 10px;
    background: black;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
    min-height: 150px;
}
.blog-content h4 {
    margin: 0;
    padding-bottom: 5px;
    font-size: 1.1em;
}

.blog-content-text {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: red black;
    flex: 1;
    font-family: "Space Mono", monospace;
}

.blog-content-text::-webkit-scrollbar {
    width: 8px;
    background: black;
}

.blog-content-text::-webkit-scrollbar-track {
    background: black;
    border: 1px solid red;
}

.blog-content-text::-webkit-scrollbar-thumb {
    background: red;
    border: 1px solid black;
}

/* BLOG POST WRAPPER */
.blog-post-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}
/* BLOG DATE */
.blog-date {
    font-size: 8px;
    color: red;
    margin-bottom: 2px;
    padding-right: 5px;
    text-align: right;
}

/* LINKED BLOG POST KEYFRAMES */
@keyframes highlightPost {
    0%, 100% {
        box-shadow: none;
    }
    50% {
        box-shadow: 0 0 20px red, 0 0 40px red;
    }
}

/* other box styles */
.archivebox,
.linksbox {
    border: 2px solid red;
    padding: 10px;
    background: transparent;
}

/* make empty boxes appear */
main > div {
    min-height: 50px;
}

/* LEFT COLUMN */
.multibox {
    padding: 5px;
    margin-bottom: 10px;
}
.stampmarquee {
    border: 2px dashed red;
    padding: 5px;
    margin-bottom:10px;
}
.crtbox {
    border: none;
    padding: 5px;
    margin-bottom: 10px;
    min-height: 150px;
    font-size: 5px;
}

/* RIGHT COLUMN */
.archivebox{
    text-align: center;
}
.linksbox{
    text-align: center;
}

/* FOOTER */
footer {
    margin-top: 10px
}

/* CSS GRID PLACEMENT */
.multibox{
    grid-column: 1;
    grid-row: 1/4;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.archivebox{
    grid-column: 2;
    grid-row: 1;
}
.linksbox{
    grid-column: 2;
    grid-row: 2/4;
}
.stampmarquee{
    grid-column: 1/3;
    grid-row: 4;
}
.crtbox{
    grid-column: 1;
    grid-row: 5/7;
}

/* CRT TV WINDOW BOX THING */

.crt-overlay {
    position: absolute;
    bottom: -273px; 
    right: -136px;  
    width: 800px;
    height: 650px;
    z-index: 1000;
    pointer-events: none;
}

.crt-overlay * {
    pointer-events: auto;
}

.crt-frame {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.crt-screen {
    position: absolute;
    /* Adjust these values to match where the screen is in your CRT image */
    top: 27%;
    left: 16%;
    width: 52%;
    height: 52%;
    overflow: hidden;
    z-index: 1;
}

.crt-screen iframe {
    width: 100%;
    height: 100%;
    border: none;
}