/* Color variables */
:root {
    --bg: #000;
    --white: #ffffff;
    --prompt-bg: rgba(0, 0, 0, 0.98);
    --suggestions-bg: rgba(0, 0, 0, 0.95);

    --boot-ok: #00ff66;
    --boot-stable: #00ccff;
    --boot-warning: #ffcc00;
    --boot-error: #ff4444;
}

:root.theme.classic {
    --bg-alt: #040804;
    --accent: #40ff4d;
    --accent-2: #4fff6c;
    --accent-contra: #1596aa;
    --text: #cccccc;
    --args: #666666;

    --input: #00ff00;
    --link: #5ec950;

    --shadow-1: rgba(0, 0, 0, 0.5);
    --shadow-2: rgba(0, 0, 0, 0.6);
    --suggestions-bg-hover: rgba(0, 255, 127, 0.1);
    --suggestions-bg-selected: rgba(0, 255, 127, 0.2);

    --selection-bg: #cccccc;
    --selection-fg: #3e006e;

    --crt-glow: rgba(100, 200, 100, 0.4);
    --crt-colour-scanlines1: rgba(0, 255, 0, 0.15);
    --crt-colour-scanlines2: rgba(0, 255, 0, 0.20);
}

:root.theme.sunset {
    --bg-alt: #150404;
    --accent: #ff4040;
    --accent-2: #ff7373;
    --accent-contra: #33d1ff;
    --text: #e6cccc;
    --args: #995c5c;

    --input: #ff3333;
    --link: #ff6666;

    --shadow-1: rgba(0, 0, 0, 0.52);
    --shadow-2: rgba(0, 0, 0, 0.64);

    --suggestions-bg-hover: rgba(255, 64, 64, 0.1);
    --suggestions-bg-selected: rgba(255, 64, 64, 0.2);

    --selection-bg: #ffd6d6;
    --selection-fg: #2a0018;

    --crt-glow: rgba(255, 80, 80, 0.36);
    --crt-colour-scanlines1: rgba(255, 64, 64, 0.12);
    --crt-colour-scanlines2: rgba(255, 64, 64, 0.20);
}

:root.theme.amber {
    --bg-alt: #0a0700;
    --accent: #ffbf00;
    --accent-2: #ffca61;
    --accent-contra: #00ff84;
    --text: #e0d6c8;
    --args: #7d6f5a;

    --input: #ff8800;
    --link: #ff9933;

    --shadow-1: rgba(0, 0, 0, 0.5);
    --shadow-2: rgba(0, 0, 0, 0.6);
    --suggestions-bg-hover: rgba(255, 191, 0, 0.1);
    --suggestions-bg-selected: rgba(255, 191, 0, 0.2);

    --selection-bg: #f2e5c1;
    --selection-fg: #00134b;

    --crt-glow: rgba(255, 180, 50, 0.35);
    --crt-colour-scanlines1: rgba(255, 191, 0, 0.15);
    --crt-colour-scanlines2: rgba(255, 191, 0, 0.20);
}

:root.theme.aequoris {
    --bg-alt: #001014;
    --accent: #50d0ff;
    --accent-2: #58dbff;
    --accent-contra: #fff200;
    --text: #80d0ff;
    --args: #336680;

    --input: #33ccff;
    --link: #66e0ff;

    --shadow-1: rgba(0,0,0,0.5);
    --shadow-2: rgba(0,0,0,0.62);
    --suggestions-bg-hover: rgba(0,191,255,0.1);
    --suggestions-bg-selected: rgba(0,191,255,0.2);

    --selection-bg: #80d0ff;
    --selection-fg: #3b0f00;

    --crt-glow: rgba(0,200,255,0.35);
    --crt-colour-scanlines1: rgba(0,191,255,0.12);
    --crt-colour-scanlines2: rgba(0,191,255,0.20);

}

:root.theme.heliotrope {
    --bg-alt: #1a1215;
    --accent: #ff5c8d;
    --accent-2: #ffa3ba;
    --accent-contra: #ffae00;
    --text: #ffffff;
    --args: #c46f8f;
    
    --input: #ff55ff;
    --link: #ff55ff;

    --shadow-1: rgba(0, 0, 0, 0.5);
    --shadow-2: rgba(0, 0, 0, 0.6);

    --suggestions-bg-hover: rgba(255, 92, 141, 0.1);
    --suggestions-bg-selected: rgba(255, 92, 141, 0.2);
    --selection-bg: #ffc2e7;
    --selection-fg: #00281c;

    --crt-glow: rgba(255, 0, 255, 0.35);
    --crt-colour-scanlines1: rgba(255, 0, 255, 0.12);
    --crt-colour-scanlines2: rgba(255, 0, 255, 0.20);
}

:root.theme.high-contrast {
    --bg-alt: #111111;
    --accent: #00ffff;
    --accent-2: #58dbff;
    --accent-contra: #fff200;
    --text: #ffffff;
    --args: #cccccc;

    --input: #33ffff;
    --link: #00ffff;

    --shadow-1: rgba(0,0,0,0.5);
    --shadow-2: rgba(0,0,0,0.6);
    --suggestions-bg-hover: rgba(0,255,255,0.1);
    --suggestions-bg-selected: rgba(0,255,255,0.2);

    --selection-bg: #ffffff;
    --selection-fg: #000000;

    --crt-glow: rgba(0,255,255,0.35);
    --crt-colour-scanlines1: rgba(0,255,255,0.0);
    --crt-colour-scanlines2: rgba(0,255,255,0.0);
}



:root {
    --show-derailed: none;
    --show-not-derailed: inline;
}

.vikraman-derailed {
    display: var(--show-derailed);
}

.vikraman-not-derailed {
    display: var(--show-not-derailed);
}



/* Layout basics */
html, body {
    margin: 0;
    height: 100%;
    font-size: clamp(16px, 1vw, 24px);
}

/* Terminal container */
#terminal {
    position: relative;
    height: 100vh;
    height: 100dvh;
    min-height: 100dvh;
    font-family: monospace;
    background-color: var(--bg);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1.1;
}

/* Output area (single consolidated rule) */
#output {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 2.75rem;
    overflow-y: auto;
    padding: 1rem;
    white-space: pre-wrap;
    color: var(--text);
    font-family: monospace;
}

/* Bottom bar and its layering */
#bottom-bar {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    width: calc(100% - 2rem);
    display: flex;
    flex-direction: column-reverse;
    max-height: 12rem;
    overflow: hidden;
    z-index: 50;
    pointer-events: auto;
}

/* Prompt */
#prompt {
    display: flex;
    align-items: center;
    background: var(--prompt-bg);
    padding: 0;
    box-shadow: 0 4px 12px var(--shadow-1);
    z-index: 52;
    min-width: 0;
    visibility: hidden; /* Shown by login animation */
}

#prompt .input-text {
    flex: 1;
    min-width: 0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

#prompt .input, #cmd {
    background: transparent;
    border: none;
    color: inherit;
    outline: none;
    font: inherit;
    font-family: monospace;
    caret-shape: block;
    caret-color: var(--input);
    width: 100%;
}





/* Suggestions panel */
#suggestions {
    position: fixed;
    bottom: 2.25rem;
    left: 1rem;
    min-height: 1.2em;
    max-height: 12rem;
    overflow-y: auto;
    margin-bottom: 0.25rem;
    font-family: monospace;
    color: var(--input);

    background: var(--suggestions-bg);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    box-shadow: 0 6px 18px var(--shadow-2);
    z-index: 51;

    visibility: hidden; /* Shown by login animation */
    transition: opacity 160ms ease, transform 160ms ease;
    opacity: 1;
    transform: translateY(0);
}

/* applied while animating to visible */
#suggestions.anim-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* applied to start hide animation; element will be display:none after transitionend by JS */
#suggestions.anim-hidden {
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
}

#suggestions div {
    display: block;
    cursor: pointer;
    white-space: pre;
    padding-left: 0.5rem;
}

#suggestions div.selected {
    font-weight: bold;
    color: var(--input);
}

#suggestions div span.command {
    display: inline-block;
    padding: 0 0.25rem;
}

#suggestions div span.command:hover {
    color: var(--accent-2);
    background-color: var(--suggestions-bg-hover);
}

#suggestions div span.selected {
    font-weight: bold;
    color: var(--input);
    background-color: var(--suggestions-bg-selected);
}

/* Output typography and elements */
#output p {
    margin: 0 0 -0.5rem 0;
    line-height: 1.2;
}

#output h1, #output h2, #output h3, #output h4, #output h5, #output h6 {
    margin-top: 0;
    margin-bottom: -1rem;
    line-height: 1.2;
}

#output .user-dir {
    color: var(--input);
    font-weight: bold;
}

#output .command-output {
    color: var(--white);
}

#output .half {
    width: 50%;
    font-size: 0;
    max-width: 100%;
}

#output .gap {
    display: inline-block;
    width: 1%;
}

#output .oneline {
    display: flex;
}

.boot-layout {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 1rem;
    align-items: start;
    overflow-x: visible;
}

.boot-left,
.boot-right {
    min-width: 0;
}

.boot-right {
    font-size: 0.75em;
}

@media (min-width: 1450px) {
    .boot-layout {
        grid-template-columns: fit-content(70ch) fit-content(52ch);
        column-gap: 2rem;
        row-gap: 0;
        justify-content: start;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .boot-layout::-webkit-scrollbar {
        display: none;
    }
}

/* Scrollbar styling for WebKit browsers */
#output::-webkit-scrollbar {
    width: 8px;
}

#output::-webkit-scrollbar-track {
    background: var(--bg);
}

#output::-webkit-scrollbar-thumb {
    background-color: var(--input);
    border-radius: 4px;
    border: 2px solid var(--link);
}

#output::-webkit-scrollbar-thumb:hover {
    background-color: var(--link);
    border-radius: 4px;
    border: 2px solid var(--input);
}

/* Text selection */
::selection {
    background-color: var(--selection-bg);
    color: var(--selection-fg);
}

/* Boot / status classes */
.boot-tag { font-weight: bold; }
.boot-ok { color: var(--boot-ok); }
.boot-stable { color: var(--boot-stable); }
.boot-warning { color: var(--boot-warning); }
.boot-error { color: var(--boot-error); }

/* Fastfetch block */
.fastfetch {
    color: var(--text);
    line-height: 1.05;
    font-size: 0.85em;
    font-family: "Noto Sans Mono", "JetBrains Mono", "DejaVu Sans Mono", "Cascadia Mono", "Consolas", monospace;
    font-variant-ligatures: none;
    letter-spacing: 0;
    white-space: pre;
    text-rendering: optimizeSpeed;
    font-feature-settings: "liga" 0, "calt" 0;
}

.boot-right .fastfetch {
    font-size: 1em;
}

.fastfetch-title {
    color: var(--accent);
    font-weight: bold;
}

.fastfetch-key {
    color: var(--input);
    font-weight: bold;
}

.fastfetch-value {
    color: var(--text);
}

.fastfetch-swatch {
    display: inline-block;
    color: transparent;
}

.fastfetch-swatch-0 { background: #000000; }
.fastfetch-swatch-1 { background: #cc0000; }
.fastfetch-swatch-2 { background: #4e9a06; }
.fastfetch-swatch-3 { background: #c4a000; }
.fastfetch-swatch-4 { background: #3465a4; }
.fastfetch-swatch-5 { background: #75507b; }
.fastfetch-swatch-6 { background: #06989a; }
.fastfetch-swatch-7 { background: #d3d7cf; }
.fastfetch-swatch-8 { background: #555753; }
.fastfetch-swatch-9 { background: #ef2929; }
.fastfetch-swatch-10 { background: #8ae234; }
.fastfetch-swatch-11 { background: #fce94f; }
.fastfetch-swatch-12 { background: #729fcf; }
.fastfetch-swatch-13 { background: #ad7fa8; }
.fastfetch-swatch-14 { background: #34e2e2; }
.fastfetch-swatch-15 { background: #eeeeec; }

/* Responsive adjustments */
@media (max-width: 768px) {
    #terminal { font-size: 0.9rem; }

    #suggestions { font-size: 0.9rem; }

    #output .half { width: 100%; }

    #output h1, #output h2, #output h3, #output h4, #output h5, #output h6 {
        margin-top: 0;
        margin-bottom: -0.5rem;
        line-height: 1.2;
    }

    .boot { font-size: calc(2.6vw - 1px); }
    .boot-left { font-size: calc(2.6vw - 1px); }
    .boot-right { font-size: calc(2.6vw - 1px); }
}

@media (max-width: 384px) {
    #output { font-size: calc(2.6vw - 1px); }
}







/* Prompt and output user-dir/prefix styling */
#prompt .prefix {
    font-weight: bold;
    display: inline-flex;
    align-items: baseline;
    gap: 0.12ch;
}

#output .user-dir .time {
    color: var(--input);
    margin-right: 1ch;
}

#output .user-dir .user,
#prompt .prefix .user {
    color: var(--input);
}

#output .user-dir .sep,
#prompt .prefix .sep {
    color: var(--white);
}

#output .user-dir .path,
#prompt .prefix .path {
    color: var(--accent-contra);
}

#output .user-dir .dollar,
#prompt .prefix .dollar {
    color: var(--white);
}





















/* Generic table styling applied to all CV tables */
.cv div[class] table {
    width: min(60ch, 100%);
    table-layout: fixed;
    border-collapse: collapse;
    font-family: monospace;
    font-size: 1.25rem;
    line-height: 1.1;
    margin-bottom: 1em;
    margin-top: -1em;
}

.cv div[class] th,
.cv div[class] td {
    padding: 0.1em 0.3em;
    vertical-align: top;
    word-wrap: break-word;
}

.cv div[class] td br {
    margin-bottom: 0.15em;
}

.cv div[class] th:first-child,
.cv div[class] td:first-child {
    color: var(--accent-2);
}

/* .cv div[class] td { */
    /* background-color: rgba(0, 255, 127, 0.02); */
/* } */

/* .cv div[class] th:last-child, */
/* .cv div[class] td:last-child { */
    /* color: var(--boot-warning); */
/* } */


/* === Education table === */
.cv .education table {
    width: min(60ch, 100%);
}

.cv .education th:first-child,
.cv .education td:first-child {
    width: 10ch;
}

.cv .education th:last-child,
.cv .education td:last-child {
    width: calc(100% - 10ch);
}

.cv .education td em {
  font-style: normal;
  color: #aaaaaa;
}

.cv .education td b {
  font-style: normal;
  color: var(--accent-2);
}


/* === Talks / Presentations table === */
.cv .talks table {
    width: min(60ch, 100%);
}

.cv .talks th:first-child,
.cv .talks td:first-child {
    width: 10ch;
}

.cv .talks th:last-child,
.cv .talks td:last-child {
    width: calc(100% - 10ch);
}

.cv .talks td b {
  font-style: italic;
  color: var(--accent-2);
}


/* === Computer Skills table === */
.cv .computer-skills table {
    width: min(60ch, 100%);
}

.cv .computer-skills th:first-child,
.cv .computer-skills td:first-child {
    width: 12ch;
}

.cv .computer-skills th:last-child,
.cv .computer-skills td:last-child {
    width: calc(100% - 12ch);
}



/* === Other Skills table === */
.cv .other-skills table {
    width: min(60ch, 100%);
}

.cv .other-skills th:first-child,
.cv .other-skills td:first-child {
    width: 12ch;
}

.cv .other-skills th:last-child,
.cv .other-skills td:last-child {
    width: calc(100% - 12ch);
}



/* Responsive adjustments for narrow screens */
@media (max-width: 768px) {
    .cv div[class] table {
        width: 100%;
        font-size: 1rem;
    }

    .cv div[class] td:first-child {
        width: 12ch;
    }

    .cv div[class] td:last-child {
        width: auto;
    }
}




.cv .roles .role {
  line-height: 1.3;
}

.cv .roles .role-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-2);
}

.cv .roles b {
  font-weight: 600;
  font-style: italic;
  color: #888888;
  font-size: 1.25rem;
}

.cv .roles i {
  color: var(--accent-contra);
  font-style: italic;
}

.cv .roles em {
  font-style: italic;
}

.cv .roles a {
  color: var(--accent);
  text-decoration: underline;
}

.cv .c {
  color: var(--accent);
  text-decoration: underline;
}



/* Headings */
.cv h1 {
    color: var(--input);
    font-size: 2rem;
}
.cv h2 {
    color: var(--input);
    font-size: 1.75rem;
}
.cv h3 {
    color: var(--input);
    font-size: 1.50rem;
}
.cv h4 {
    color: var(--input);
    font-size: 1.25rem;
}






/* Link styling with hover effect */
#output a,
.clickable {
    color: var(--link);
    position: relative;
    cursor: pointer;
    text-decoration: underline;
}

#output a::before,
.clickable::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: var(--link);
    z-index: -1;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.1s linear;
}

#output a:hover::before,
.clickable:hover::before {
    transform: scaleY(1);
}

#output a:hover,
.clickable:hover {
    color: var(--bg);
    text-decoration: none;
}


/* Base styling for hoverable tooltip text */
.hover-info {
    position: relative;
    cursor: help;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    color: var(--fg);
}

/* Tooltip bubble */
.hover-info::after {
    content: attr(data-tip);
    position: absolute;
    left: 0;
    top: 120%;
    padding: 4px 8px;
    background: var(--bg-alt);
    color: var(--fg);
    border: 1px solid var(--input);
    font-size: 75%;
    opacity: 0;
    pointer-events: none;
    transform: translateY(2px);
    transition:
        /* opacity 0.12s ease-out; */
        transform 0.12s ease-out;

    /* Word wrapping and sizing */
    display: block;
    width: max-content;
    max-width: clamp(40ch, 50vw, 100ch);
    white-space: normal;
    word-wrap: break-word; 

    z-index: 9999;
}

.hover-info:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.hover-info:hover {
    text-decoration-style: solid;
}



























/* CRT effects */

#output {
    color: white;
    mix-blend-mode: lighten;

    animation-name: chromatic-fadeout;
    animation-duration: 3s;
    animation-delay: 1.5s;
    animation-fill-mode: forwards;

    filter: drop-shadow(0.3em 0 rgba(255,0,0,0.2))
            drop-shadow(0.15em 0.1em rgba(0,255,255,0.2))
            drop-shadow(-0.1em 0.15em rgba(0,0,255,0.2))
            drop-shadow(0 0.2em rgba(0,255,0,0.2));
}

#output.reset-chromatic {
    animation: none !important;
    filter: drop-shadow(0.3em 0 rgba(255,0,0,0.2))
            drop-shadow(0.15em 0.1em rgba(0,255,255,0.2))
            drop-shadow(-0.1em 0.15em rgba(0,0,255,0.2))
            drop-shadow(0 0.2em rgba(0,255,0,0.2));
}

#output.fadeout-chromatic {
    animation-name: chromatic-fadeout !important;
    animation-duration: 3s !important;
    animation-delay: 0s !important;
    animation-fill-mode: forwards !important;
}

@keyframes chromatic-fadeout {
    70% {
        filter: drop-shadow(0.3em 0 rgba(255,0,0,0.2))
                drop-shadow(0.15em 0.1em rgba(0,255,255,0.2))
                drop-shadow(-0.1em 0.15em rgba(0,0,255,0.2))
                drop-shadow(0 0.2em rgba(0,255,0,0.2));
    }
    85% {
        filter: drop-shadow(-0.1em 0.2em rgba(255,0,0,0.2))
                drop-shadow(0.15em 0.1em rgba(0,255,255,0.2))
                drop-shadow(-0.1em 0.15em rgba(0,0,255,0.2))
                drop-shadow(0.15em -0.1em rgba(0,255,0,0.2));
    }
    100% {
        filter: drop-shadow(0 0 rgba(255,0,0,0.1))
                drop-shadow(0 0 rgba(0,255,255,0.1))
                drop-shadow(0 0 rgba(0,0,255,0.1))
                drop-shadow(0 0 rgba(0,255,0,0.1));
    }
}

#output.light-chromatic {
    animation-name: chromatic-partial-fadeout !important;
    animation-duration: 1s !important;
    animation-delay: 1s !important;
    animation-fill-mode: forwards !important;
    filter: drop-shadow(0.3em 0 rgba(255,0,0,0.2))
            drop-shadow(0.15em 0.1em rgba(0,255,255,0.2))
            drop-shadow(-0.1em 0.15em rgba(0,0,255,0.2))
            drop-shadow(0 0.2em rgba(0,255,0,0.2));
}

@keyframes chromatic-partial-fadeout {
    0% {
        filter: drop-shadow(0.3em 0 rgba(255,0,0,0.2))
                drop-shadow(0.15em 0.1em rgba(0,255,255,0.2))
                drop-shadow(-0.1em 0.15em rgba(0,0,255,0.2))
                drop-shadow(0 0.2em rgba(0,255,0,0.2));
    }
    50% {
        filter: drop-shadow(-0.1em 0.2em rgba(255,0,0,0.2))
                drop-shadow(0.15em 0.1em rgba(0,255,255,0.2))
                drop-shadow(-0.1em 0.15em rgba(0,0,255,0.2))
                drop-shadow(0.15em -0.1em rgba(0,255,0,0.2));
    }
    100% {
        filter: drop-shadow(0.2em 0 rgba(255,0,0,0.2))
                drop-shadow(0.1em 0.1em rgba(0,255,255,0.2))
                drop-shadow(-0.1em 0.1em rgba(0,0,255,0.2))
                drop-shadow(0 0.2em rgba(0,255,0,0.05));
    }
}

#output.fast-chromatic-fadeout {
    animation-name: chromatic-immediate-fadeout !important;
    animation-duration: 1s !important;
    animation-delay: 0.5s !important;
    animation-fill-mode: forwards !important;
    filter: drop-shadow(0.3em 0 rgba(255,0,0,0.2))
            drop-shadow(0.15em 0.1em rgba(0,255,255,0.2))
            drop-shadow(-0.1em 0.15em rgba(0,0,255,0.2))
            drop-shadow(0 0.2em rgba(0,255,0,0.2));
}

@keyframes chromatic-immediate-fadeout {
    0% {
        filter: drop-shadow(0.3em 0 rgba(255,0,0,0.2))
                drop-shadow(0.15em 0.1em rgba(0,255,255,0.2))
                drop-shadow(-0.1em 0.15em rgba(0,0,255,0.2))
                drop-shadow(0 0.2em rgba(0,255,0,0.2));
    }
    50% {
        filter: drop-shadow(-0.1em 0.2em rgba(255,0,0,0.2))
                drop-shadow(0.15em 0.1em rgba(0,255,255,0.2))
                drop-shadow(-0.1em 0.15em rgba(0,0,255,0.2))
                drop-shadow(0.15em -0.1em rgba(0,255,0,0.2));
    }
    100% {
        filter: drop-shadow(0 0 rgba(255,0,0,0.1))
                drop-shadow(0 0 rgba(0,255,255,0.1))
                drop-shadow(0 0 rgba(0,0,255,0.1))
                drop-shadow(0 0 rgba(0,255,0,0.1));
    }
}














.grime {
    position: absolute;
    inset: 0;

    background-image: url(../images/grime_overlay.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;

    mix-blend-mode: overlay;
    z-index: 9910;
    opacity: 0.5;
    pointer-events: none;
}

.crt-vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    box-shadow: inset 0 0 15vmin var(--bg-alt);
    mix-blend-mode: multiply;
    opacity: 1;
}

.crt::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9909;

    background: repeating-linear-gradient(
        to bottom,
        var(--crt-colour-scanlines1)  0px,
        var(--crt-colour-scanlines2) 2px,
        rgba(0, 0, 0, 0) 4px
    );
}

.crt-rgb::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9910;

    background: repeating-linear-gradient(
        to right,
        rgba(255,0,0,0.1) 0px,
        rgba(255,0,0,0.1) 1px,
        rgba(0,255,0,0.1) 1px,
        rgba(0,255,0,0.1) 2px,
        rgba(0,0,255,0.1) 2px,
        rgba(0,0,255,0.1) 3px
    );
    mix-blend-mode: overlay;
}

.crt-glow::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9905;

    mix-blend-mode: overlay;
    backdrop-filter: blur(1px) brightness(1.5);
    opacity: 0.4;
}

.crt-bloom::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9906;

    mix-blend-mode: screen;
    backdrop-filter: blur(2px) brightness(1.5);
    opacity: 1;
}

.crt-scanlines::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: overlay;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,0.8) 0px,
        rgba(255,255,255,1) 2px,
        rgba(0,0,0,0.2) 4px
    );
    z-index: 9908;
}

.crt::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;

    mix-blend-mode:overlay;
    background: radial-gradient(
        ellipse at center,
        var(--crt-glow) 20%,
        var(--crt-glow) 80%,
        rgba(0,0,0,0.1) 100%
    );
}

















.reset-grime {
    animation: none !important;
    opacity: 0.5 !important;
}

.grime {
    animation: grime-fadeout 3.5s 3s forwards;
}

.grime.fadeout-grime {
    animation-name: grime-fadeout !important;
    animation-duration: 3.5s !important;
    animation-delay: 0s !important;
    animation-fill-mode: forwards !important;
}

.grime.light-grime {
    animation-name: grime-partial-fadeout !important;
    animation-duration: 1s !important;
    animation-delay: 1s !important;
    animation-fill-mode: forwards !important;
}

.grime.fast-grime-fadeout {
    animation-name: grime-fadeout !important;
    animation-duration: 1s !important;
    animation-delay: 0.5s !important;
    animation-fill-mode: forwards !important;
}

@keyframes grime-fadeout {
    from { opacity: 0.5; }
    to   { opacity: 0.15; }
}

@keyframes grime-partial-fadeout {
    from { opacity: 0.5; }
    to   { opacity: 0.3; }
}




/* Vignette */
.crt-vignette {
    animation: vignette-fadeout 3.5s 3s forwards;
}

.reset-vignette {
    animation: none !important;
    opacity: 1 !important;
}

.crt-vignette.fadeout-vignette {
    animation-name: vignette-fadeout !important;
    animation-duration: 3.5s !important;
    animation-delay: 0s !important;
    animation-fill-mode: forwards !important;
}

.crt-vignette.light-vignette {
    animation-name: vignette-partial-fadeout !important;
    animation-duration: 1s !important;
    animation-delay: 1s !important;
    animation-fill-mode: forwards !important;
}

.crt-vignette.fast-vignette-fadeout {
    animation-name: vignette-fadeout !important;
    animation-duration: 1s !important;
    animation-delay: 0.5s !important;
    animation-fill-mode: forwards !important;
}

@keyframes vignette-fadeout {
    from { opacity: 1; }
    to   { opacity: 0.2; }
}

@keyframes vignette-partial-fadeout {
    from { opacity: 1; }
    to   { opacity: 0.75; }
}

/* Diffuse bloom */
.crt-bloom::before {
    animation: crt-fadeout 2s forwards;
}

/* Bright sharp glow */
.crt-glow::before {
    animation: crt-fadeout 1s forwards;
}

/* Chromatic aberration */
/* .crt::before {
    animation: crt-fadeout 7s forwards;
} */

@keyframes crt-fadeout {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* Vertical scanlines */
.crt-rgb::after {
    animation: crt-partial-fadeout 5s forwards;
}

/* Green scanlines */
.crt::after {
    animation: crt-partial-fadeout 5s forwards;
}

/* White scanlines */
/* .crt-scanlines::after {
    animation: crt-partial-fadeout 10s forwards;
} */

@keyframes crt-partial-fadeout {
    from { opacity: 1; }
    to   { opacity: 0.75; }
}





.js-crt.reset-glow .crt-glow::before {
    animation: none !important;
    opacity: 1 !important;
}

.js-crt.reset-bloom .crt-bloom::before {
    animation: none !important;
    opacity: 0.05 !important;
}

.js-crt.reset-scanlines .crt-scanlines::after {
    animation: none !important;
    opacity: 1 !important;
}

.js-crt.reset-rgb .crt-rgb::after {
    animation: none !important;
    opacity: 1 !important;
}

.js-crt.reset-vignette .crt-vignette {
    animation: none !important;
    opacity: 1 !important;
}
