@font-face {
  font-family: "MissFajardose";
  src: url(../type/MissFajardose-Regular.ttf);
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "BeVietnam";
  src: url(../type/BeVietnamPro-Regular.ttf);
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "BeVietnam";
  src: url(../type/BeVietnamPro-Bold.ttf);
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: "BeVietnam";
  src: url(../type/BeVietnamPro-MediumItalic.ttf);
  font-weight: 400;
  font-style: italic;
}
html {
  color-scheme: light dark;
  --background-1: #c2c6de;
  --background-2: #f6f7f9;
  --text-color: #2d3153;
  --text-background: #ffdaff;
  --article-text: #2d3153;
  --hover-background: #2d3153;
  --hover-text: #ffafff;
  --hover-nav: #ffdaff;
  --hover-nav-shadow: #6a176a;
  --cookie: #2d2d2d;
  --arrow: #35374f;
  --arrow-background: #fbfbfb;
  --summary-open: #2d3153;
  --summary-open-text: #ffdaff;
  --backdrop: #ffffff50;

  --background-1: light-dark(#c2c6de, #bea5bd);
  --background-2: light-dark(#f6f7f9, #8e778d);
  --text-color: light-dark(#2d3153, #868686);
  --text-background: light-dark(#ffdaff, #35374f);
  --article-text: light-dark(#2d3153, #ffffff);
  --hover-background: light-dark(#2d3153, #131522);
  --hover-text: light-dark(#ffafff, #ffffff);
  --hover-nav: light-dark(#ffdaff, #fbfbfb);
  --hover-nav-shadow: light-dark(#6a176a, #fbfbfb);
  --summary-open: light-dark(#2d3153, #fbfbfb);
  --summary-open-text: light-dark(#ffdaff, #2d3153);
  --backdrop: light-dark(#ffffff50, #11111150);
}

body {
  font-family: "BeVietnam", Helvetica, sans-serif;
  font-style: normal;
  color: var(--text-color);
  background-image: repeating-linear-gradient(
    90deg,
    var(--background-1) 0 1em,
    var(--background-2) 0 2em
  );
  margin: 0;
  position: relative;
  background-repeat: repeat;
  opacity: 1em;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  color: #262535;
  transition: 0.5s ease-in-out;
  padding: 0 1em 0 1em;
  background-color: var(--background-1);
  position: sticky;
  top: 0;
  margin: 0;
  z-index: 100;
  @media (width<30em) {
    flex-direction: column;
    align-items: center;
    gap: 1em;
  }
  box-shadow: inset 0em 3em 5em #6a176a50;
}

header a {
  text-decoration: none;
  color: #262535;

  &:hover {
    cursor: pointer;
  }
  &:focus-visible {
    outline: 0.2em dashed #262535;
    outline-offset: 0.2em;
  }
}

header h1 {
  font-family: "MissFajardose";
  font-size: 3.5em;
  margin: 0;
  font-weight: bold;

  @media (width<30em) {
    font-size: 3em;
  }
  &:active {
    transform: scale(0.9);
    transition: 0.2s ease-in-out;
  }
}

nav {
  margin: 0;
  display: flex;
  flex-wrap: balance;
  gap: 2em;
  align-items: center;
  max-width: fit-content;
  padding: 1em;

  font-family: "BeVietnam", sans-serif;
  font-weight: 700;

  & a {
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s ease-in-out;
    text-transform: uppercase;
    &:hover {
      text-shadow: var(--hover-nav-shadow) 0px 0 7px;
      color: var(--hover-nav);
    }
    &:active {
      transform: scale(0.9);
      transition: 0.2s ease-in-out;
    }
  }
}

main {
  max-width: 70%;
  margin-inline: auto;
  & h2 {
    text-shadow: var(--hover-nav-shadow) 0px 0 7px;
  }
}

ol {
  list-style: none;
  padding: 1em;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10em, 1fr));
  gap: 1em;
}

ol button {
  width: 100%;
  height: 100%;
  padding: 0em 2em 2em 2em;
  cursor: pointer;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  background-color: var(--text-background);
  color: var(--article-text);
  box-shadow:
    0em 0em 3em #00000050,
    inset 0em 0em 5em #6a176a50;
  border-radius: 0.5em;
  transition: 0.3s ease-in-out;
  &:hover {
    background-color: var(--hover-background);
    color: var(--hover-text);
  }
  &:focus-visible {
    outline: 0.2em dashed #262535;
    outline-offset: 0.2em;
  }
}
main h2 {
  display: block;
  font-size: 2rem;
  color: #262535;
}

ol button h3 {
  font-family: "MissFajardose";
  font-size: 4em;
  font-weight: 700;
}
ol button p {
  font-family: "BeVietnam", Helvetica, sans-serif;
}

.diary-dialog {
  position: relative;
  border: none;
  border-radius: 1em;
  padding: 2em;

  width: 40em;
  background-color: var(--text-background);
  color: var(--article-text);
  box-sizing: border-box;
  box-shadow:
    0em 0em 3em #00000050,
    inset 0em 0em 5em #6a176a50;

  /*scrollbar settings*/
  scrollbar-width: thin;
  scrollbar-color: var(--article-text) transparent;

  &::-webkit-scrollbar-track {
    background: transparent;
  }

  &::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 20px;

    &:hover {
      opacity: 70%;
    }
  }

  scale: 0;
  transform-origin: center center;
  @media (prefers-reduced-motion: no-preference) {
    transition:
      scale 0.2s allow-discrete,
      display 0.2s allow-discrete,
      overlay 0.2s allow-discrete;
  }
}

.diary-dialog h3 {
  font-size: 2em;
}

.diary-dialog[open] {
  scale: 1;
}

@starting-style {
  .diary-dialog[open] {
    scale: 0;
  }
}

.diary-dialog::backdrop {
  background-color: var(--backdrop);
  backdrop-filter: blur(3px);
}

.diary-dialog::backdrop {
  transition:
    display 0.2 allow-discrete,
    overlay 0.2s allow-discrete,
    opacity 0.2s;
  opacity: 0;
}

.diary-dialog[open]::backdrop {
  opacity: 1;
}

@starting-style {
  .diary-dialog[open]::backdrop {
    opacity: 0;
  }
}
.diary-dialog img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 30em;
  border-radius: 0.5em;
  border-color: var(--background-1);
  border-width: 0.5em;
  border-style: solid;
}

.close {
  position: sticky;
  top: 1em;
  width: 2em;

  aspect-ratio: 1;
  display: block;
  margin-left: auto;
  z-index: 10;

  background: var(--article-text);
  border: 2px solid var(--text-background);
  border-radius: 2em;
  color: var(--text-background);
  font-size: 1.1rem;
  cursor: pointer;

  &:hover {
    opacity: 0.5;
    transition: 0.2s ease-in-out;
  }
  &:focus-visible {
    outline: 0.2em dashed black;
    outline-offset: 0.2em;
  }
  &:active {
    transform: scale(0.9);
    transition: 0.2s ease-in-out;
  }
}
