:root {
    --bg-color: #050505;
    --term-green: #33ff33;
    --term-dim: #1a801a;
    --term-red: #ff3333;
    --term-white: #e0e0e0;
    --font-term: 'Courier New', Courier, monospace;
    --glow-green: 0 0 5px rgba(51, 255, 51, 0.4), 0 0 10px rgba(51, 255, 51, 0.2);
    --glow-red: 0 0 5px rgba(255, 51, 51, 0.6), 0 0 10px rgba(255, 51, 51, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--term-green);
    font-family: var(--font-term);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    text-shadow: var(--glow-green);
    position: relative;
}

/* CRT Effects */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        radial-gradient(circle, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.6) 100%);
    background-size: 100% 4px, 100% 100%;
    z-index: 9999;
    pointer-events: none;
}

body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 9999;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% {
        opacity: 0.02;
    }

    5% {
        opacity: 0.05;
    }

    10% {
        opacity: 0.02;
    }

    15% {
        opacity: 0.08;
    }

    20% {
        opacity: 0.02;
    }

    50% {
        opacity: 0.02;
    }

    55% {
        opacity: 0.06;
    }

    60% {
        opacity: 0.02;
    }

    100% {
        opacity: 0.02;
    }
}

/* Dust Particles */
.dust-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.dust {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    box-shadow:
        10vw 20vh 1px rgba(255, 255, 255, 0.1),
        30vw 50vh 1px rgba(255, 255, 255, 0.2),
        50vw 80vh 1px rgba(255, 255, 255, 0.1),
        70vw 10vh 1px rgba(255, 255, 255, 0.2),
        90vw 60vh 1px rgba(255, 255, 255, 0.1),
        20vw 90vh 1px rgba(255, 255, 255, 0.1),
        40vw 30vh 1px rgba(255, 255, 255, 0.2),
        60vw 70vh 1px rgba(255, 255, 255, 0.1),
        80vw 40vh 1px rgba(255, 255, 255, 0.2);
    animation: float-dust 20s linear infinite;
}

.dust:nth-child(2) {
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    animation: float-dust 25s linear infinite reverse;
    box-shadow:
        15vw 15vh 1px rgba(255, 255, 255, 0.1),
        35vw 45vh 1px rgba(255, 255, 255, 0.1),
        55vw 75vh 1px rgba(255, 255, 255, 0.1),
        75vw 25vh 1px rgba(255, 255, 255, 0.1),
        95vw 85vh 1px rgba(255, 255, 255, 0.1);
}

@keyframes float-dust {
    0% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(-5vh) translateX(2vw);
    }

    100% {
        transform: translateY(-10vh) translateX(-2vw);
    }
}

/* Custom Cursor */
.no-cursor {
    cursor: none !important;
}

.custom-cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--term-green);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--term-green);
    mix-blend-mode: screen;
}

.cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    background: rgba(51, 255, 51, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out;
    mix-blend-mode: screen;
}

/* Subliminal Flash */
.subliminal-flash {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: #fff;
    text-shadow: 2px 0 0 red, -2px 0 0 blue;
    z-index: 10001;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
}

/* Typography & Basic Elements */
.container {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 10;
}

h1,
h2,
h3 {
    text-transform: uppercase;
    font-weight: normal;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

p {
    margin-bottom: 1rem;
    line-height: 1.5;
}

a {
    color: var(--term-green);
    text-decoration: none;
    border-bottom: 1px solid var(--term-green);
    transition: all 0.2s;
    cursor: pointer;
}

a:hover {
    background-color: var(--term-green);
    color: var(--bg-color);
}

.hidden {
    display: none !important;
}

.invisible {
    opacity: 0;
    user-select: none;
}

.dim {
    color: var(--term-dim);
}

.red {
    color: var(--term-red);
    text-shadow: var(--glow-red);
}

.red-bg:hover {
    background-color: var(--term-red) !important;
    color: var(--bg-color) !important;
}

/* Interactive Elements */
input[type="text"],
input[type="password"] {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--term-green);
    color: var(--term-green);
    font-family: var(--font-term);
    font-size: 1rem;
    padding: 5px;
    outline: none;
    width: 200px;
    text-shadow: var(--glow-green);
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-bottom-width: 2px;
}

button {
    background: transparent;
    border: 1px solid var(--term-green);
    color: var(--term-green);
    font-family: var(--font-term);
    padding: 10px 20px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
    margin-right: 10px;
    margin-bottom: 10px;
}

button:hover {
    background: var(--term-green);
    color: var(--bg-color);
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: var(--term-green);
    animation: blink 1s step-end infinite;
    vertical-align: bottom;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Glitch Effect */
.glitch {
    position: relative;
    display: inline-block;
}

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

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 var(--term-red);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

.glitch-hover:hover {
    animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    color: var(--term-red);
    text-shadow: 2px 0 0 blue, -2px 0 0 red;
}

@keyframes glitch-anim {
    0% {
        clip: rect(10px, 9999px, 83px, 0);
    }

    20% {
        clip: rect(62px, 9999px, 14px, 0);
    }

    40% {
        clip: rect(14px, 9999px, 52px, 0);
    }

    60% {
        clip: rect(81px, 9999px, 2px, 0);
    }

    80% {
        clip: rect(32px, 9999px, 98px, 0);
    }

    100% {
        clip: rect(98px, 9999px, 34px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
    }

    20% {
        clip: rect(3px, 9999px, 80px, 0);
    }

    40% {
        clip: rect(44px, 9999px, 20px, 0);
    }

    60% {
        clip: rect(89px, 9999px, 55px, 0);
    }

    80% {
        clip: rect(12px, 9999px, 10px, 0);
    }

    100% {
        clip: rect(99px, 9999px, 76px, 0);
    }
}

@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }

    20% {
        transform: skew(-20deg);
    }

    40% {
        transform: skew(20deg);
    }

    60% {
        transform: skew(-10deg);
    }

    80% {
        transform: skew(10deg);
    }

    100% {
        transform: skew(0deg);
    }
}

.sys-msg {
    margin: 10px 0;
    padding: 10px;
    border-left: 3px solid var(--term-green);
    background: rgba(51, 255, 51, 0.05);
}

.sys-msg.error {
    border-left-color: var(--term-red);
    background: rgba(255, 51, 51, 0.05);
    color: var(--term-red);
    text-shadow: var(--glow-red);
}

.intranet-header {
    border-bottom: 2px solid var(--term-dim);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.employee-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.employee-table th,
.employee-table td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid var(--term-dim);
}

.redacted {
    background-color: var(--term-green);
    color: var(--term-green);
    user-select: all;
    transition: background-color 0.2s;
}

.redacted::selection {
    background-color: var(--term-dim);
    color: var(--bg-color);
}


.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.folder {
    border: 1px solid var(--term-dim);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.folder:hover {
    border-color: var(--term-green);
    background-color: rgba(51, 255, 51, 0.1);
}

.folder.corrupted {
    animation: glitch-skew 2s infinite alternate-reverse;
}

.file-list {
    margin-top: 1rem;
    list-style: none;
}

.file-list li {
    margin-bottom: 0.5rem;
}

.doc-header {
    text-align: center;
    border-bottom: 2px solid var(--term-white);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    color: var(--term-white);
    text-shadow: none;
}

.doc-body {
    background-color: #e0e0e0;
    color: #000;
    text-shadow: none;
    padding: 2rem;
    font-family: 'Times New Roman', Times, serif;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.doc-body.secret {
    background-color: #111;
    color: var(--term-white);
    font-family: var(--font-term);
}

.redacted-black {
    background-color: #000;
    color: #000;
    padding: 0 5px;
}

.bold-clue {
    font-weight: bold;
    color: #333;
}

.secret .bold-clue {
    color: #fff;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
    margin-top: 2rem;
    border: 1px solid var(--term-dim);
    background: #000;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vhs-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.2) 3px,
            rgba(0, 0, 0, 0.2) 4px);
    z-index: 5;
}

#console-output {
    height: 60vh;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding-right: 1rem;
}

#console-output::-webkit-scrollbar {
    width: 8px;
}

#console-output::-webkit-scrollbar-thumb {
    background-color: var(--term-dim);
}

.input-line {
    display: flex;
    align-items: center;
}

.input-line span {
    margin-right: 10px;
}

#cli-input {
    flex-grow: 1;
    border: none;
    border-bottom: none;
    width: auto;
}

.core-bg {
    background-color: #1a0000;
    color: var(--term-red);
    text-shadow: var(--glow-red);
}

.core-bg input[type="text"] {
    border-bottom-color: var(--term-red);
    color: var(--term-red);
    text-shadow: var(--glow-red);
}

.core-bg button {
    border-color: var(--term-red);
    color: var(--term-red);
}

.core-bg button:hover {
    background: var(--term-red);
    color: #000;
}

.core-bg .sys-msg {
    border-left-color: var(--term-red);
    background: rgba(255, 0, 0, 0.05);
}

#countdown {
    font-size: 4rem;
    text-align: center;
    margin: 2rem 0;
    font-weight: bold;
    animation: glitch-skew 1s infinite alternate-reverse;
}

.blackout {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 2s ease-in;
}

.blackout.active {
    opacity: 1;
    pointer-events: all;
}

.reactivated-msg {
    font-size: 2rem;
    color: var(--term-green);
    text-shadow: var(--glow-green);
    opacity: 0;
    transition: opacity 2s ease-in;
}

.reactivated-msg.show {
    opacity: 1;
}

.operator-msg {
    font-size: 0.8rem;
    color: var(--term-dim);
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 2s ease-in;
}

.operator-msg.show {
    opacity: 1;
}

.footer-clue {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--term-dim);
    opacity: 0.3;
}

.dash-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    z-index: 10;
}

.dash-sidebar {
    width: 250px;
    background: rgba(10, 10, 10, 0.9);
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.dash-sidebar a {
    display: block;
    padding: 15px 20px;
    border: none;
    border-bottom: 1px solid #222;
    color: #555;
    transition: all 0.2s;
}

.dash-sidebar a:hover,
.dash-sidebar a.active {
    background: rgba(51, 255, 51, 0.1);
    color: var(--term-green);
    border-bottom: 1px solid var(--term-green);
}

.dash-sidebar a.stuck {
    animation: glitch-skew 1s infinite alternate-reverse;
    color: var(--term-red);
}

.dash-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.dash-topbar {
    height: 60px;
    background: rgba(10, 10, 10, 0.9);
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
}

.dash-clock {
    font-size: 1.2rem;
    color: var(--term-dim);
    font-family: monospace;
}

.profile-icon {
    width: 40px;
    height: 40px;
    background: #222;
    border: 1px solid var(--term-dim);
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.profile-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.profile-panel {
    position: absolute;
    top: 60px;
    right: -450px;
    width: 400px;
    height: calc(100vh - 60px);
    background: rgba(5, 5, 5, 0.95);
    border-left: 1px solid #333;
    padding: 30px;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 100;
}

.profile-panel.open {
    right: 0;
}

.voss-photo {
    width: 150px;
    height: 150px;
    background: #111;
    margin: 0 auto 20px;
    border: 1px solid #444;
    position: relative;
    overflow: hidden;
}

.voss-photo::after {
    content: "IT REMEMBERS";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #111;
    /* Very dark, only visible if brightened */
    font-size: 0.8rem;
    z-index: 1;
}

.voss-photo img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(150%) brightness(0.8);
    transition: filter 0.2s;
}

.voss-photo:hover img {
    filter: grayscale(100%) contrast(200%) brightness(0.3);
    animation: glitch-anim 0.2s infinite;
}

.dash-content {
    padding: 30px;
    flex-grow: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.dash-widget {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid #333;
    padding: 20px;
}

.dash-widget h3 {
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--term-white);
}

.chat-log {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.chat-log span.flicker {
    animation: blink 3s infinite;
}

.cal-entry {
    padding: 10px 5px;
    border-bottom: 1px solid #222;
    position: relative;
}

.cal-entry:hover {
    background: rgba(255, 51, 51, 0.1);
}

.cal-entry.corrupted:hover .cal-text {
    opacity: 0;
}

.cal-entry.corrupted:hover::after {
    content: "OPEN THE CORE";
    color: var(--term-red);
    position: absolute;
    left: 50px;
    top: 10px;
    background: #050505;
    font-weight: bold;
    animation: glitch-skew 0.2s infinite;
}

.ghost-file {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s;
    color: var(--term-red) !important;
}

.ghost-file.visible {
    opacity: 1;
    pointer-events: all;
}