/**
 * termynal.js
 *
 * @author Ines Montani <ines@ines.io>
 * @version 0.0.1
 * @license MIT
 */

@font-face {
  font-family: 'PxPlus IMB VGA8';
  src: url('PxPlus_IBM_VGA8.ttf') format('truetype');
}

html, body, * {
  font: 1.1rem 'PxPlus IMB VGA8', monospace;
  letter-spacing: 0.1rem;
  font-smooth: never;
}

html, body {
  height: 100%;
  width: 100%;
  background-image: radial-gradient(#110708, #0D0208);
  color: #fbc41f;
  text-shadow: 0 0 4px #F68A27;
  margin: 0;
  padding: 0;
  cursor: default;
}

body {
  background-color: black;
  background-image: radial-gradient(rgba(146, 99, 0, 0.75), black 120%);
  /*background-image: linear-gradient(90deg,
    #223 25%, #450 25%, #410 50%,
    #230 50%, #210 75%, #200 75%, #190);
  background-size:6px 6px;*/
  width: 100vw;
  height: 100vh;
  margin: 0;
  color: #fffdef;
  text-shadow: 0 0 5px #C8C8C8;
}

body::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15) 1px, transparent 1px, transparent 2px);
  pointer-events: none;
}

:root {
    --color-bg: #252a33;
    --color-text: #eee;
    --color-text-subtle: #a2a2a2;
}

[data-termynal] {
    width: 100%;
    max-width: 100%;
    color: var(--color-text);
    font-size: 18px;
    font-family: 'PxPlus IMB VGA8', Consolas, Menlo, Monaco, 'Courier New', Courier, monospace;
    border-radius: 4px;
    padding: 10px;
    position: relative;
    -webkit-box-sizing: border-box;
            box-sizing: border-box;
}

[data-ty] {
    display: block;
    line-height: 1.1em;
}

[data-ty]:before {
    /* Set up defaults and ensure empty lines are displayed. */
    content: '';
    display: inline-block;
    vertical-align: middle;
}

[data-ty="input"]:before,
[data-ty-prompt]:before {
    margin-right: 0.75em;
    color: var(--color-text-subtle);
}

[data-ty="input"]:before {
    content: '$';
}

[data-ty][data-ty-prompt]:before {
    content: attr(data-ty-prompt);
}

[data-ty-cursor]:after {
    content: attr(data-ty-cursor);
    font-family: monospace;
    margin-left: 0.5em;
    -webkit-animation: blink 1s infinite;
            animation: blink 1s infinite;
}

/* Cursor animation */

@-webkit-keyframes blink {
    50% {
        opacity: 0;
    }
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.crt::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: rgba(18, 16, 16, 0.1);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  animation: flicker 0.15s infinite;
}
.crt::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 2;
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
}
.crt {
  animation: textShadow 1.6s infinite;
}

.scanlines {
  overflow: hidden;
}

.scanlines::before {
  content: "";
  position: absolute;
  width:  100%;
  height: 200%;
  top:   -100%;
  left:     0;

  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15) 1px, transparent 1px, transparent 2px);

  animation-name: fudge;
  animation-duration: 7s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  // animation-direction: reverse;
  animation-timing-function: ease-in-out;
  animation-direction: alternate;
}

.scanlines::after {
  content: "";
  position: absolute;
  width:  100%;
  height: 200%;
  top:   -100%;
  left:     0;

  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15) 1px, transparent 1px, transparent 2px);

  animation-name: scanline;
  animation-duration: 20s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

@keyframes fudge {
  from { transform: translate(0px, 0px);  }
  to   { transform: translate(0px, 2%); }
}

@keyframes scanline {
  from { transform: translate(0px, 0px);  }
  to   { transform: translate(0px, 50%); }
}


::selection {
  background: #ffd400;
  text-shadow: none;
}


a {
  color: #ecff56;
}

.hl1 {
    color: #53ff53;
}

.hl2 {
    color: #53fff8;
}