@font-face {
  font-family: "star3000";
  src: url(../Star3000.ttf);
}
@font-face {
  font-family: "star3000";
  src: url(../Star3000\ Heavy.ttf);
  font-weight: bold;
}

html {
  --back: #163413;
  --fore: #f9e5d7;
  --tv_main: #1b305a;
  --tv_back: #051431;
  font-family:
    "star3000", ui-monospace, "Cascadia Code", "Source Code Pro", Menlo,
    Consolas, "DejaVu Sans Mono", monospace;

  text-shadow: 2px 2px black;
  background-color: var(--back);
  min-height: 100%;
}

html::before {
  position: fixed;
  background: linear-gradient(to bottom, #2f2369, #fe7d32 80%);
  pointer-events: none;
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
}

body {
  color: var(--fore);
  font-size: 1.3rem;
  padding: 20px;
  padding-bottom: 0;

  width: 100vw;
  min-height: 100vh;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;

  width: min(1000px, 100%);
}

main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;

  width: min(1000px, 100%);
  margin: auto;
}

.report img {
  width: 200px;
}

button.tv {
  appearance: none;
  margin: 0;
  padding: 0;
  font: inherit;
}

div.init_tv,
button.tv {
  --height: calc(600px);
  --height_top: calc(var(--height) * 0.7);
  --height_bottom: calc(var(--height) * 0.3);

  width: min(700px, 90%);
  height: var(--height);
  font-size: clamp(15px, calc(1rem + 0.6vw), 23px);
  font-family:
    ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas,
    "DejaVu Sans Mono", monospace;

  color: var(--fore);

  background: var(--tv_back);
  display: grid;

  & * {
    cursor: pointer;
  }

  span div {
    padding: 20px;
  }
}

button.tv {
  width: 100%;
  height: max-content;
  position: relative;
  isolation: isolate;
}

button.tv.turn-on {
  animation: on ease-in forwards 0.6s;
}

button.tv.turn-off {
  animation: off ease-out forwards 0.6s;
}

@keyframes on {
  0% {
    transform: rotateX(80deg);
    opacity: 0;
  }
  100% {
    transform: rotateX(0deg);
    opacity: 1;
    /* prevents image from shifting to the right */
    z-index: 1;
  }
}

@keyframes off {
  0% {
    transform: rotateX(0deg);
    opacity: 1;
  }
  98% {
    transform: rotateX(80deg);
    opacity: 0;
  }
  /* this is so the tv is still clickable in its full height */
  100% {
    transform: rotateX(0deg);
    opacity: 0;
  }
}

div.tv_top {
  background-color: var(--tv_main);
  height: var(--height_top);
  position: relative;
}

div.tv_top::after {
  position: absolute;
  pointer-events: none;
  content: "";
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  box-shadow: inset 0px 0px 0.8vw 1vw #62b2d363;
}

div.tv__graphic {
  width: calc(200px + 5vw);
  max-width: 271px;
  aspect-ratio: 1/1;
  padding: 5%;
  position: absolute;
  right: 4%;
  top: 7%;
  background: #85a7a1;
  box-shadow:
    inset 9px 9px 21px #354340,
    inset -9px -9px 21px #d5ffff;

  img {
    max-width: revert;
    width: 100%;
    display: block;
    animation: float 3s ease-in-out infinite;
  }
}

@keyframes float {
  0% {
    transform: translatey(5px);
  }
  50% {
    transform: translatey(-5px);
  }
  100% {
    transform: translatey(5px);
  }
}

div.tv__reporter {
  width: min(330px, 50vw);
  background: transparent;
  position: absolute;
  bottom: 1%;
  left: 2%;
  display: grid;

  img {
    display: block;
    width: 100%;
  }
}

div.tv_bottom,
div.noscript {
  background: var(--tv_main);
  color: var(--fore);
  border-top: 2px solid whitesmoke;
  box-shadow: 0 -6px 0 var(--tv_main);
  height: var(--height_bottom);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  padding: 20px;
  overflow-y: scroll;
  z-index: 3;

  position: relative;

  p {
    animation: fade-in 0.6s cubic-bezier(0.39, 0.575, 0.565, 1) both;
    text-align: initial;
  }
  svg.next-arrow {
    margin-left: auto;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    fill: currentColor;
    animation: next-bob 1s ease-in infinite;
  }
}
@keyframes next-bob {
  0% {
    transform: translatey(-10px);
  }
  70% {
    transform: translatey(-6px);
  }
  80% {
    transform: translatey(-2px);
  }
  90% {
    transform: translatey(2px);
  }
  100% {
    transform: translatey(6px);
  }
}

@keyframes fade-in {
  0% {
    transform: translateY(-50px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@media screen and (max-width: 620px) {
  div.init_tv,
  button.tv {
    --height: 500px;
    --height_top: calc(var(--height) * 0.5);
    --height_bottom: calc(var(--height) * 0.5);
  }

  div.tv_bottom {
    padding: calc(10px + 2vw);
  }

  div.tv__graphic {
    width: calc(140px + 5vw);
    aspect-ratio: 1/1;
  }

  div.tv__reporter {
    width: min(330px, 35vw);
    left: 5%;
  }
}

@media screen and (max-width: 410px) {
  div.init_tv,
  button.tv {
    --height: 400px;
    --height_top: calc(var(--height) * 0.35);
    --height_bottom: calc(var(--height) * 0.65);
  }

  div.tv__graphic {
    width: calc(100px + 5vw);
    aspect-ratio: 1/1;
  }

  div.tv__reporter {
    width: min(330px, 30vw);
    left: 5%;
  }
}

footer {
  background-color: #2e4d84;
  width: 100vw;
  border-top: 2px solid whitesmoke;
  box-shadow: 0 -6px 0 #2e4d84;
  padding: 20px 10px;

  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: space-between;
}

/* ======= scanline styling ====== */

.scanlines:after {
  display: flex;
  pointer-events: none;
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  background: linear-gradient(
    to bottom,
    transparent 20%,
    rgba(101, 93, 5, 0.212) 51%
  );
  mix-blend-mode: multiply;
  background-size: 100% 4px;
  background-attachment: fixed;
  animation: scanlines 1s steps(60) infinite;
}

@keyframes scanlines {
  0% {
    background-position: 0 50%;
  }
}

/* ===== vignette filter ====== */

.filter {
  position: relative;
  filter: brightness(120%) contrast(80%) saturate(140%);
}

body:not(.scanlines) .filter {
  filter: brightness(100%) contrast(80%) saturate(140%);
}

.filter::before {
  content: "";
  display: block;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  position: absolute;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.7;
  z-index: 4;

  background: radial-gradient(circle closest-corner, #efe5e3 30%, #4f250481);
}

/* nosript styling */
/* Note: main stying shared with .tv_bottom */
div.noscript {
  font-size: clamp(15px, calc(1rem + 0.5vw), 20px);
  font-family:
    ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas,
    "DejaVu Sans Mono", monospace;
}

div.noscript_section {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;

  & > div:has(p),
  & > p {
    width: min(600px, 100%);
  }

}
