@import url("https://fonts.googleapis.com/css?family=VT323&display=swap");
@import url("https://fonts.googleapis.com/css?family=Share+Tech+Mono&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Permanent+Marker&display=swap");

@keyframes cursor {
	0% {
		opacity: 1;
	}
	25% {
		opacity: 0;
	}
	75% {
		opacity: 1;
	}
	100% {
		opacity: 1;
	}
}
@keyframes flicker {
	0% {
		opacity: 0.57861;
	}
	5% {
		opacity: 0.64769;
	}
	10% {
		opacity: 0.73604;
	}
	15% {
		opacity: 0.90626;
	}
	20% {
		opacity: 0.68128;
	}
	25% {
		opacity: 0.83891;
	}
	30% {
		opacity: 0.65583;
	}
	35% {
		opacity: 0.67807;
	}
	40% {
		opacity: 0.66559;
	}
	45% {
		opacity: 0.84693;
	}
	50% {
		opacity: 0.96019;
	}
	55% {
		opacity: 0.58594;
	}
	60% {
		opacity: 0.60313;
	}
	65% {
		opacity: 0.71988;
	}
	70% {
		opacity: 0.53455;
	}
	75% {
		opacity: 0.67288;
	}
	80% {
		opacity: 0.71428;
	}
	85% {
		opacity: 0.70419;
	}
	90% {
		opacity: 0.7003;
	}
	95% {
		opacity: 0.66108;
	}
	100% {
		opacity: 0.54387;
	}
}
@keyframes textShadow {
	0% {
		text-shadow: 0.4389924193300864px 0 1px rgba(0, 30, 255, 0.5),
			-0.4389924193300864px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	5% {
		text-shadow: 2.7928974010788217px 0 1px rgba(0, 30, 255, 0.5),
			-2.7928974010788217px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	10% {
		text-shadow: 0.02956275843481219px 0 1px rgba(0, 30, 255, 0.5),
			-0.02956275843481219px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	15% {
		text-shadow: 0.40218538552878136px 0 1px rgba(0, 30, 255, 0.5),
			-0.40218538552878136px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	20% {
		text-shadow: 3.4794037899852017px 0 1px rgba(0, 30, 255, 0.5),
			-3.4794037899852017px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	25% {
		text-shadow: 1.6125630401149584px 0 1px rgba(0, 30, 255, 0.5),
			-1.6125630401149584px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	30% {
		text-shadow: 0.7015590085143956px 0 1px rgba(0, 30, 255, 0.5),
			-0.7015590085143956px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	35% {
		text-shadow: 3.896914047650351px 0 1px rgba(0, 30, 255, 0.5),
			-3.896914047650351px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	40% {
		text-shadow: 3.870905614848819px 0 1px rgba(0, 30, 255, 0.5),
			-3.870905614848819px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	45% {
		text-shadow: 2.231056963361899px 0 1px rgba(0, 30, 255, 0.5),
			-2.231056963361899px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	50% {
		text-shadow: 0.08084290417898504px 0 1px rgba(0, 30, 255, 0.5),
			-0.08084290417898504px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	55% {
		text-shadow: 2.3758461067427543px 0 1px rgba(0, 30, 255, 0.5),
			-2.3758461067427543px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	60% {
		text-shadow: 2.202193051050636px 0 1px rgba(0, 30, 255, 0.5),
			-2.202193051050636px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	65% {
		text-shadow: 2.8638780614874975px 0 1px rgba(0, 30, 255, 0.5),
			-2.8638780614874975px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	70% {
		text-shadow: 0.48874025155497314px 0 1px rgba(0, 30, 255, 0.5),
			-0.48874025155497314px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	75% {
		text-shadow: 1.8948491305757957px 0 1px rgba(0, 30, 255, 0.5),
			-1.8948491305757957px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	80% {
		text-shadow: 0.0833037308038857px 0 1px rgba(0, 30, 255, 0.5),
			-0.0833037308038857px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	85% {
		text-shadow: 0.09769827255241735px 0 1px rgba(0, 30, 255, 0.5),
			-0.09769827255241735px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	90% {
		text-shadow: 3.443339761481782px 0 1px rgba(0, 30, 255, 0.5),
			-3.443339761481782px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	95% {
		text-shadow: 2.1841838852799786px 0 1px rgba(0, 30, 255, 0.5),
			-2.1841838852799786px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
	100% {
		text-shadow: 2.6208764473832513px 0 1px rgba(0, 30, 255, 0.5),
			-2.6208764473832513px 0 1px rgba(255, 0, 80, 0.3),
			0 0 3px;
	}
}

/** The classic 'minimize to the center' effect */
@keyframes turnOff {
	0% {
		background: #fff !important;
		transform: scale(1, 1.3) translate3d(0, 0, 0);
		-webkit-filter: brightness(1);
		filter: brightness(1);
		opacity: 1;
	}
	60% {
		background: #fff !important;
		transform: scale(1.3, 0.001) translate3d(0, 0, 0);
		-webkit-filter: brightness(10);
		filter: brightness(10);
	}
	100% {
		background: #fff !important;
		animation-timing-function: ease-out;
		transform: scale(0, 0.0001) translate3d(0, 0, 0);
		-webkit-filter: brightness(50);
		filter: brightness(50);
	}
}

@keyframes glow {
	0% {
		box-shadow: 0 0 -10px var(--color);
	}
	50% {
		box-shadow: 0 0 10px var(--color);
	}
	100% {
		box-shadow: 0 0 -10px var(--color);
	}
}

@keyframes scanline {
	0% {
		bottom: 100%;
	}
	80% {
		bottom: 100%;
	}
	100% {
		bottom: -20%;
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* Flash the typed letter, fade opaque to transparent */
@keyframes type {
	from {
		background-color: var(--color);
	}
	to {
		background-color: transparent;
	}
}

@keyframes marquee {
	0% {
		transform: translate(100%, 0);
	}
	100% {
		transform: translate(-100%, 0);
	}
}

/*
 * Credits for the terminal effects:
 * Scanlines/flicker: 	http://aleclownes.com/2017/02/01/crt-display.html
 * Screen turn-off:		https://codepen.io/lbebber/pen/XJRdrV
 * Post-It note:		https://mentormate.com/blog/css-postit-note/
 */

 
 /*********** VARIABLES *************/
 
 :root {
     --green-color: #5bf870;
     --green-bg: #05321e;
     --red-color: #c0100a;
     --red-bg: #1b0302;
     --blue-color: #a5a5ff;
     --blue-bg: #4242e7;
     --off: #050505;
     --dark: #111;
     --term: "> ";
 }
 
 /*********** THEMES  *************/
 /** Use --color and --bg in your CSS files to get the active text and bg colour. */
 /** One of these theme classes is applied to the <body>, so the whole document uses that theme */
 #zedterminal.theme-red {
     --color: var(--red-color);
     --bg: var(--red-bg);
     --term: "$ ";
 }
 #zedterminal.theme-green {
     --color: var(--green-color);
     --bg: var(--green-bg);
 }
 #zedterminal.theme-blue {
     --color: var(--blue-color);
     --bg: var(--blue-bg);
     --term: "";
 }
 
 /** Theme specific stuff from here */
 #zedterminal.theme-red .char {
     animation: type 0.5s linear 0s 1;
 }
 #zedterminal.theme-red #crt {
     font-family: "Share Tech Mono", monospace;
     font-size: max(1rem, 1.6vmin);
 }
 #zedterminal.theme-blue #crt {
     background-image: none;
     background-color: var(--color);
     box-shadow: none;
     border-radius: 1em;
     padding: 3rem;
 }
 #zedterminal.theme-blue #monitor:not(.off) #crt:before {
     background: none;
     background-color: var(--bg);
     top: 3rem;
     left: 3rem;
     bottom: 3rem;
     right: 3rem;
     z-index: 0;
 }
 #zedterminal.theme-blue .scanline {
     display: none;
 }
 #zedterminal.theme-blue .terminal {
     padding: 0;
 }
 
 /*********** GENERIC STUFF *************/
 
 #zedterminal a {
     outline: none;
 }
 /*********** INPUT / OUTPUT *************/
 
 #zedterminal #prompt {
     display: none;
 }
 #zedterminal [contenteditable] {
     caret-color: transparent; /** This hides the default browser caret */
     outline: none;
 }
 #zedterminal #input {
     position: relative;
     display: block;
     white-space: pre-wrap;
 }
 /* Inserts the > before terminal input */
 #zedterminal #input:before {
     content: var(--term);
 }
 /* Puts a blinking square after the content as replacement for caret */
 #zedterminal #input[contenteditable="true"]:after,
 #zedterminal .typer.active:after {
     content: "■";
     animation: cursor 1s infinite;
     animation-timing-function: step-end;
     margin-left: 1px;
     line-height: 1rem;
 }
 
 /* 
  * This makes the caret (:after) show correctly after the previously typed character.
  * Otherwise the caret is always on new line
  */
  #zedterminal [contenteditable="true"] br:last-child {
     display: none;
 }
 
 #zedterminal #input.password .char {
     display: none;
 }
 #zedterminal #input.password:after {
     color: var(--color);
 }
 #zedterminal #input.password:before {
     color: var(--color);
     content: var(--term) attr(data-pw);
 }
 
 #zedterminal .typer {
     word-break: break-all;
 }
 
 /*********** PARTS OF THE SCREEN *************/
 
 #zedterminal #monitor {
     margin: 3vmin auto;
     padding: 5.5vmin;
     width: min-content;
     display: flex;
     flex-direction: column;
     align-items: center;
     background: #3f3933;
     border-radius: 0.5rem;
 }
 #zedterminal #monitor:not(.off) {
     box-shadow: 0.6px 90px 110px -60px var(--bg); /* screen glow */
 }
 #zedterminal #screen {
     position: relative;
     border: 30px solid transparent;
     border-image-source: url(bezel_gray.png);
     border-image-slice: 30 fill;
     border-image-outset: 0;
     overflow: hidden;
 }
 /* The screen itself + border */
 #zedterminal #crt,
 #zedterminal pre {
     font-family: "VT323", monospace;
 }
 #zedterminal #crt {
     /*min-width: 80ch; /* This makes 80 monospace characters fit on the screen */
     height: calc(80ch * 0.8);
     font-size: max(
         1rem,
         2.2vmin
     ); /* Scale the font-size relative to the minimum screen dimension */
     position: relative;
     background: var(--bg);
     background-image: radial-gradient(
         ellipse,
         var(--bg) 0%,
         var(--off) 90%
     );
     animation: on 2s linear;
     transition: all 0.5s;
     overflow: hidden;
 }
 
 #zedterminal #crt:after {
     content: " ";
     opacity: 0;
     background: #fff;
     display: block;
     position: absolute;
     top: 0;
     left: 0;
     bottom: 0;
     right: 0;
     width: 100%;
     height: 100%;
     pointer-events: none;
     z-index: 3;
 }
 #zedterminal #monitor.turn-off #crt:after {
     animation: turnOff 0.4s ease-in-out;
     /* animation-fill-mode: forwards; */
 }
 
 /*#monitor:not(.off) */#zedterminal #crt:before {
     content: " ";
     display: block;
     position: absolute;
     top: 0;
     left: 0;
     bottom: 0;
     right: 0;
     background: linear-gradient(
         to bottom,
         rgba(18, 16, 16, 0.1) 50%,
         rgba(0, 0, 0, 0.25) 50%
     );
     background-size: 100% 8px;
     z-index: 2;
     pointer-events: none;
     animation: fadeIn 2s;
 }
 
 /* Screen turned off */
 #zedterminal #monitor.off #crt {
     background: var(--off);
 }
 #zedterminal #monitor.off #crt:before {
     background: none;
 }
 #zedterminal #monitor.off #crt * {
     display: none !important;
 }
 
 body.fullscreen #crt {
     font-size: 2.5rem;
     position: fixed;
     width: 100%;
     left: 0;
     top: 0;
     z-index: 999;
 }
 
 .fullscreen {
     position: absolute;
     top: 0;
     left: 0;
     right: 0;
     bottom: 0;
     width: 100%;
     height: 100%;
     overflow: hidden;
 }
 
 #zedterminal .terminal {
     position: relative;
     height: 100%;
     padding: 2rem;
     overflow-y: auto;
     overflow-x: hidden;
     word-break: break-word;
     text-transform: uppercase;
     animation: textShadow 4s infinite;
 }
 
 #zedterminal .terminal,
 .fullscreen {
     color: var(--color);
     text-shadow: 0 0 5px #c8c8c8;
 }
 
 #zedterminal ::selection {
     background: var(--color);
     color: var(--bg);
     text-shadow: none;
 }
 
 /* Scanline moving top to bottom over the screen */
 #zedterminal .scanline {
     width: 100%;
     height: 100px;
     z-index: 8;
     background: linear-gradient(
         0deg,
         rgba(0, 0, 0, 0) 0%,
         rgba(255, 255, 255, 0.2) 10%,
         rgba(0, 0, 0, 0.1) 100%
     );
     opacity: 0.1;
     position: absolute;
     bottom: 100%;
     pointer-events: none;
     animation: scanline 10s linear infinite;
 }
 
 /*********** CONTROLS *************/
 
 #zedterminal #fullscreen {
     border: 0.25rem solid var(--dark);
     padding: 1rem;
     background-color: rgb(186, 189, 182);
     transition: opacity 0.5s;
     font-weight: bold;
     line-height: 1rem;
 }
 
 body.fullscreen #fullscreen {
     position: fixed;
     top: 1rem;
     right: 1rem;
     z-index: 1001;
     transform: rotate(180deg);
     opacity: 0.5;
 }
 
 body.fullscreen #fullscreen:hover {
     opacity: 1;
 }
 
 
 /*********** RANDOM OTHER STUFF *************/
 
 #zedterminal .access-granted {
     animation: flicker 2s infinite;
     position: fixed;
     text-align: center;
     background: var(--bg);
     border: 2px solid var(--color);
     padding: 10px 30px;
     left: 50%;
     top: 40%;
     transform: translateX(-50%);
     z-index: 999;
 }
 
 .post-it {
     transform: rotate(3deg);
     line-height: 1;
     text-align: center;
     padding: 1rem;
     border: 1px solid #e8e8e8;
     font-family: "Permanent Marker", cursive;
     font-size: 1rem;
     color: #333;
     border-bottom-right-radius: 40px 14px;
     display: inline-block;
     background: #ffff88;
     background: linear-gradient(
         135deg,
         #ffff88 81%,
         #ffff88 82%,
         #ffff88 82%,
         #ffffc6 100%
     );
     transition-property: left top transform;
     transition-duration: 0.5s;
     transition-timing-function: ease-in-out;
     cursor: pointer;
 }
 .post-it:hover {
     border-bottom-left-radius: 20px 5px;
     border-bottom-right-radius: 40px 28px;
 }
 .post-it.fly {
     transform: translate(-5rem, 10rem) rotate(270deg);
 }
 
 
 /*********** MEDIA QUERIES *************/
 
 /* For really small screens, only show fullscreen mode */
 @media only screen and (max-width: 425px), (max-height: 425px) {
     /*#crt {
         position: fixed;
         left: 0;
         top: 0;
         width: 100%;
         height: 100%;
     }
    */
 }
 
 /* Some fixes for smaller screens */
  @media only screen and (min-width: 800px) {
     .post-it {
         font-size: 2rem;
     }
 }
 
 /**
 * Credits: 
 * https://codepen.io/marcusconnor/pen/QJNvMa
 */
:root {
	--dark: #111;
	--switch: rgb(90, 22, 10);
	--switch-accent: rgb(59, 14, 6);
	--switch-on: rgb(247, 37, 0);
	--text-on: #fff;
	--text-off: #ddd;
}
