@import "reset.css";

@font-face {
  font-family: "substitut";
  src: url("../fonts/substitut.ttf");
}

@font-face {
  font-family: 'OCR-75';
  src: url('../fonts/V6/OCR-75-Regular.otf');
}

@font-face {
  font-family: 'OCR-75-Bold';
  src: url('../fonts/V6/OCR-75-Bold.otf');
}

@font-face {
  font-family: 'notCourierReg-Bold';
  src: url('../fonts/notCourierSans/NotCourierSans-Bold.woff');
}

:root {
  --main-color: crimson;
  --bg-color: rgb(240, 240, 240);
  --nav-color: crimson;
}

::selection {
  background-color: var(--main-color);
  color: var(--bg-color);
}

/* global */

html {
  font-size: 14px;
}

body {
  color: var(--main-color);
  background: var(--bg-color);
  line-height: 1.5rem;
  font-family: 'OCR-75';
  overflow-x: hidden;
}

a {
  color: inherit;
}

a:hover {
  text-decoration: underline wavy;
}

h1,
h2 {
  font-family: 'OCR-75-Bold';
  font-weight: normal;
}

em {
  font-style: italic;
}

.hidden {
  display: none;
}

/*  nav */

nav {
  display: flex;
  position: fixed;
  background: var(--bg-color);
  color: var(--main-color);
  border-bottom: 1px solid;
  left: 0;
  right: 0;
  z-index: 1;
}

nav .title,
nav .filters div {
  flex: 1;
}

nav .title,
nav .filters div summary {
  padding: .5em;
}

nav .title {
  width: 25%;
  cursor: help;
}

nav .title h1 {
  font-family: 'OCR-75';
}

nav .title:hover,
nav .fonts summary:hover,
nav .designers summary:hover {
  text-decoration: underline;
}


#about {
  position: absolute;
  left: 0;
  right: 0;
  height: auto;
  padding: 1em;
  background-color: var(--bg-color);
  border-bottom: 1px solid;
  z-index: 10;
  max-height: 50vh;
  overflow-y: auto;
  margin-top: calc(.5em + 1px);
}

#about .close {
  position: fixed;
  right: 1em;
  font-size: 1em;
  cursor: pointer;
  border: 1px solid;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  border-radius: 50%;
  padding: 0rem;
  background-color: var(--bg-color);
  transition: .5s all;
}

#about .close:hover {
  background-color: var(--main-color);
  color: var(--bg-color);
  transition: .5s all;
}

#about > * {
  max-width: 800px;
}

#about h2 {
  padding: 1em 0 .5em 0;
  font-size: 1.5em;
  line-height: 1.75rem;
}


#about p:nth-of-type(1) {
  font-size: 1.5em;
  line-height: 1.75rem;
}

#about ul {
  margin-left: 1em;
  line-height: 1.5rem;
}

#about ul li {
  font-family: 'OCR-75-Bold';
}
#about ul li em{
  font-style: normal;
  font-family: 'OCR-75';
}

nav .filters {
  display: flex;
  width: 50%;
  z-index: 10;
}

nav .filters div {
  flex: 1;
  position: relative;
}


nav .filters div summary:hover {
  cursor: s-resize;
}

nav .filters div ul {
  display: none;
  position: absolute;
  background: var(--bg-color);
  width: 100%;
  max-height: 50vh;
  overflow-y: auto;
}

nav .filters div:hover ul {
  display: block;
  border-bottom: 1px solid;
}

nav .filters div ul li {
  border-bottom: 1px solid;
  padding: 0 0.5rem 0 0.5rem;
  border-left: 1px solid;
  border-right: 1px solid;
}

nav .filters div ul li:nth-last-of-type(1) {
  border-bottom: none;
}

nav .filters div ul li:hover {
  cursor: pointer;
}

nav .filters div ul li:before {
  content: "◯ ";
  font-size: 0.8rem;
  padding: 0 1rem 0 0;
}

nav .filters div ul li:hover:before,
nav .filters div ul li.selected:before {
  content: "◉ ";
}

nav #try-fonts {
  margin-left: 0;
  top: 0;
  right: 0;
  width: 10%;
  background: var(--main-color);
  color: var(--bg-color);
  cursor: pointer;
  border-left: 1px solid;
  text-align: center;
}

nav #try-fonts summary {
  padding: .5em;
}

nav #try-fonts:hover {
  background: var(--bg-color);
  color: var(--main-color);
}

/* font view */

#main-fonts {
  padding-top: 2.5em;
  column-gap: 1em;
  column-width: 30vw;
}

.font {
  border-bottom: 1px solid;
  display: inline-block;
  hyphens: auto;
  margin-bottom: 1em;
  padding: 1em;
  width: calc(100% - 2em);
  position: relative;
}

.font.hidden {
  display: none;
}

.font .font-title {
  display: flex; 
  justify-content: space-between;
  padding-bottom: .5em;
  font-size: 1.5em;
  font-family: 'OCR-75-Bold';
}


.font .font-title a {
  font-size: 1.2rem; 
  text-decoration: none;
  border: 1px solid;
  border-radius: 50%;
  width: 1.5em;
  height: 1.5em;
  text-align: center;
}

.font .font-title a:hover {
  background-color: var(--main-color);
  color: var(--bg-color);
}

.head-font {
  display: flex;
  width: 100%;
}

.head-font>div {
  flex: 1;
}

.head-font div span {
  display: block;
}

.head-font div .title {
  text-decoration: underline;
}

.year {
  position: absolute;
  right: 1em;
  bottom: 1em;
}

.sample-text {
  font-size: 5rem;
  line-height: 5.5rem;
  padding: 0.25em 0.025em 0.25em 0.025em;
}

.sample-text[contenteditable="true"]:focus-visible {
  border: none;
  outline: 1px solid var(--main-color);
  box-shadow: inset var(--main-color) 0px -0px 4px;
}

.sample-text.try {
  display: none;
}

.sample-text.letter {
  line-height: 15rem;
  font-size: 20rem;
  word-break: break-all;
}

#main-fonts.try-mode {
  column-width: 100vw;
}


#main-fonts.try-mode .sample-text.preview {
  display: none;
}

#main-fonts.try-mode .sample-text.try {
  display: block;
  color: inherit;
  background: inherit;
  border: none;
  width: 100%;
  font-size: 10rem;
}

#main-fonts.try-mode .paragraph,
#main-fonts.try-mode .sentence,
#main-fonts.try-mode .sentence-large,
#main-fonts.try-mode .sentence-small,
#main-fonts.try-mode .sample-text.letter {
  font-size: 5rem;
  line-height: 1.15em;
  white-space: nowrap;
}

.paragraph,
.sentence,
.sentence-large,
.sentence-small,
.sample-text.letter {
  line-height: 1.25em;
  hyphens: auto;

}

.paragraph {
  font-size: 1.5rem;
}

.sentence-small {
  font-size: 3rem;
}

.sentence {
  font-size: 4rem;
}

.sentence-large {
  font-size: 6rem;
}

.sample-text.letter {
  line-height: 15rem;
  font-size: 20rem;
  word-break: break-all;
}

/* tools */

#tester {
  position: fixed;
  display: flex;
  bottom: 0.5rem;
  right: 10px;
  padding: 0.5rem 0 0.5rem 0.5rem;
  width: auto;
  text-align: right;
  align-items: end;
}

#tester input {
  padding: 0;
  margin: 0;
  width: 100%;
  border: none;
}

#tester>div {
  width: 100px;
}

#tester>div h5 {
  width: 100%;
}

#tester .size {
  padding: 0 0.5rem 0 0;
  display: none;
}

#tester .size.visible {
  display: block;
}

#tester .colors {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  width: 50px;
}

#tester .colors .color {
  width: 100%;
}

#tester .colors .color input {
  cursor: pointer;
}

#tester .colors .color:hover:before {
  position: absolute;
  right: 102%;
  width: 25vw;
}

#tester .colors .color:nth-of-type(1):hover:before {
  content: "Change text color ";
  line-height: 2;
}

#tester .colors .color:nth-of-type(2):hover:before {
  content: "Change background color ";
  line-height: 2;
}

@media screen and (max-width: 1280px) {
  #about {
    max-height: 100vh;
    padding-bottom: 6rem;
  }

  #about p:nth-of-type(1) {
    margin-top: 2rem;
  }

  #main-fonts {
    column-gap: 1em;
    column-width: 49vw;
  }

  .sample-text {
    overflow: hidden;
  }

}

@media screen and (max-width: 1000px) {

  #main-fonts {
    column-gap: 1em;
    column-width: 100vw;
  }

  #main-fonts .paragraph,
  #main-fonts .sentence,
  #main-fonts .sentence-large,
  #main-fonts .sentence-small,
  #main-fonts .sample-text.letter {
  font-size: 5rem;
  line-height: 1.15em;
}

}

@media screen and (max-width: 600px) {
  nav .filters {
    display: none;
  }

  #try-fonts {
    display: none;
  }
}