/* Import fonts */
@import url("https://fonts.googleapis.com/css2?family=Bungee&family=Rubik&family=Work+Sans&display=swap");


/* Definitions */
:root {
  --loader-rgb: 255, 255, 255;

  --dark-color: #20215a;
  --dark-color-rgb: 32, 33, 90;

  --light-color: #e8e7ee;
  --light-color-rgb: 232, 231, 238;

  --main-brand: #545deb;
  --main-brand-rgb: 84, 93, 235;

  --light-accent: #7ca6de;
  --light-accent-rgb: 124, 166, 222;

  --dark-accent: #6c3179;
  --dark-accent-rgb: 108, 49, 121;

  --twitter-blue: #1d9bf0;
  --twitter-blue-rgb: 29, 155, 240;

  --mastodon-purple: #6364ff;
  --mastodon-purple-rgb: 99, 100, 255;

  --focus-glow-color: deepskyblue;

  --body-font-stack: "Work Sans", Helvetica, Arial, sans-serif;
  --system-font-stack: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
}


/* General styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;

  background-color: var(--light-color);
  color: var(--dark-color);

  font-family: var(--body-font-stack);
  font-size: 16px;

  min-height: 100dvh;

  margin: 0;
  padding: 8px;
}

body > * {
  width: 100%;
}


/* Main section */
main {
  flex: 1 1 auto;

  margin: 0 auto;
}

main > * {
  margin-left: auto;
  margin-right: auto;
}

main > :where(:not(.full-width)) {
  max-width: 900px;
}


/* Heading text */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: Rubik, Tahoma, sans-serif;
  line-height: 1.5;
}

@media screen and (max-width: 400px) {
  h1 {
    font-size: 1.75em;
  }

  h2 {
    font-size: 1.3125em;
  }

  h3 {
    font-size: 1.02083em;
  }

  h4 {
    font-size: 0.875em;
  }

  h5 {
    font-size: 0.72917em;
  }

  h6 {
    font-size: 0.583em;
  }
}


/* Link */
a {
  color: royalblue;
  font-weight: bold;
  transition: color 0.2s ease;
}

a:where(:visited) {
  color: darkviolet;
}

a:where(:hover) {
  color: #a0b4f0;
}

a:where(:visited:hover) {
  color: #d269ff;
}


/* Button or button-like object */
button,
:where(.button) {
  display: inline-flex;
  justify-content: center;
  align-items: center;

  background-color: rgba(255, 255, 255, 0.4);
  color: var(--dark-accent);

  font-family: var(--system-font-stack);
  font-size: 15px;
  font-weight: bold;

  min-width: 2.6em;
  min-height: 2.6em;
  line-height: 1;

  margin: 2px;
  padding: 0.25em 1em;

  border: 1px solid var(--dark-accent);
  border-radius: 1.6em;

  transition: background-color 0.2s ease,
              box-shadow 0.15s linear,
              color 0.2s ease;
}

button.solid,
:where(.button).solid {
  background-color: rgba(255, 255, 255, 0.8);
}

/* NOTE This only selects non-mobile browsers */
@media not all and (pointer: coarse) {
  button:hover,
  :where(.button):hover {
    background-color: rgba(var(--dark-accent-rgb), 0.1);

    cursor: pointer;
  }

  button.solid:hover,
  :where(.button).solid:hover {
    background-color: rgba(255, 255, 255, 0.6);

    cursor: pointer;
  }
}

button:active,
:where(.button):active {
  background-color: rgba(var(--dark-accent-rgb), 0.2);
}

button:disabled,
:where(.button.disabled) {
  background-color: lightgray;
  color: gray;

  border-color: darkgray;

  cursor: not-allowed;
}

/* NOTE This is used for buttons with both icons and text */
button span,
:where(.button) span {
  display: inline-block;

  margin-left: 0.333em;
}


/* Row of inputs */
.input-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;

  position: relative;

  height: min-content;

  margin: 2px auto;

  text-align: center;
}


/* Input and textarea */
:where(
  input:where(
    :not([type]), [type="email"], [type="tel"], [type="text"], [type="url"]
  ),
  textarea
) {
  flex: 1 1 auto;

  background-color: rgba(255, 255, 255, 0.5);
  color: var(--dark-color);

  font-family: var(--body-font-stack);
  font-size: 15px;

  min-height: 42px;

  margin: 2px;
  padding: 0.5em 1em;

  border: 1px solid var(--dark-color);
  border-radius: 22px;

  vertical-align: middle;
  transition: background-color 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.15s linear,
              color 0.2s ease;
}

textarea {
  min-height: calc(71px + 1em + 2px);
  max-height: 25vh;

  resize: vertical;
}

:where(
  input:where(
    :not([type]), [type="email"], [type="tel"], [type="text"], [type="url"]
  ),
  textarea
):focus {
  background-color: white;

  border-color: var(--main-brand);
}

:where(
  input:where(
    :not([type]), [type="email"], [type="tel"], [type="text"], [type="url"]
  ),
  textarea
):disabled {
  background-color: lightgray;
  color: gray;

  border-color: darkgray;

  cursor: not-allowed;
}

:where(
  input:where(
    :not([type]), [type="email"], [type="tel"], [type="text"], [type="url"]
  ),
  textarea
)[readonly] {
  background-color: lightgray;
}

input[type="file"] {
  display: none;
}

/* Input field with integrated button */
.input-with-button {
  display: flex;
  align-items: stretch;

  flex: 1 1 auto;
}

.input-with-button input:where(
  :not([type]), [type="email"], [type="tel"], [type="text"], [type="url"]
) {
  margin-right: 0;

  border-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-with-button button {
  margin-left: 0;

  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}



/* Checkbox and radio */
input[type="checkbox"],
input[type="radio"] {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;

  width: 0;
  height: 0;

  margin: 0;
}

label.checkbox-label,
label.radio-label {
  display: flex;
  align-items: center;
  position: relative;

  font-size: 24px;

  min-height: 1em;

  margin: 0.2em 0.4em;
  padding-left: 1em;

  cursor: pointer;
}

label.file-input-checkbox-label {
  font-size: 48px;
}

label.checkbox-label .check-radio-text,
label.radio-label .check-radio-text {
  font-size: 0.75em;

  padding-left: 0.5em;
}

label.checkbox-label .checkbox-checkmark,
label.radio-label .radio-ball {
  position: absolute;
  top: 0;
  left: 0;

  background-color: white;

  width: 1em;
  height: 1em;

  border: 2px solid var(--dark-color);
  border-radius: 4px;

  transition: background-color 0.15s ease,
              border-color 0.15s ease,
              box-shadow 0.15s linear,
              outline-color 0.15s ease;
}

label.radio-label .radio-ball {
  border-radius: 100%;
}

label.checkbox-label input[type="checkbox"]:checked ~ .checkbox-checkmark,
label.radio-label input[type="radio"]:checked ~ .radio-ball {
  background-color: var(--main-brand);
  border-color: var(--main-brand);
}

label.checkbox-label .checkbox-checkmark::after {
  content: "";
  position: absolute;
  top: calc(0.166em - 2px);
  left: calc(0.333em - 2px);

  width: 0.35em;
  height: 0.55em;

  border: solid white;
  border-width: 0 0.15em 0.15em 0;
  border-radius: 0;

  transform: rotate(-180deg) scale(0);
  transition: transform 0.15s ease;
}

label.checkbox-label input[type="checkbox"]:checked ~ .checkbox-checkmark::after {
  transform: rotate(45deg) scale(1);
}

label.radio-label .radio-ball::after {
  content: "";
  position: absolute;
  top: calc(0.25em - 2px);
  left: calc(0.25em - 2px);

  background-color: white;

  width: 0.5em;
  height: 0.5em;

  border-radius: 100%;

  transform: scale(0);
  transition: transform 0.15s ease;
}

label.radio-label input[type="radio"]:checked ~ .radio-ball::after {
  transform: scale(1);
}

.check-radio-set {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;

  width: fit-content;

  margin: 2px auto;
}


/* Input focus glow */
button:focus,
:where(.button):focus,
input:not([type="checkbox"]):not([type="radio"]):focus,
label.checkbox-label input[type="checkbox"]:focus ~ .checkbox-checkmark,
label.radio-label input[type="radio"]:focus ~ .radio-ball,
textarea:focus {
  box-shadow: 0 0 6px 3px var(--focus-glow-color);
  outline: 3px solid var(--main-brand);
  outline-offset: -2px;
}

label.checkbox-label input[type="checkbox"]:checked:focus ~ .checkbox-checkmark,
label.radio-label input[type="radio"]:checked:focus ~ .radio-ball {
  outline-color: var(--dark-color);
}


/* Blockquotes */
blockquote {
  background: rgba(var(--dark-color-rgb), 0.05);

  padding: 0.5em 10px;

  border-left: 10px solid rgba(var(--dark-color-rgb), 0.4);

  text-align: left;
  quotes: "\201c" "\201d" "\2018" "\2019";
}

blockquote::before {
  content: open-quote;

  color: rgba(var(--dark-color-rgb), 0.4);

  font-size: 4em;
  line-height: 0.1em;

  margin-right: 0.1em;

  vertical-align: -0.4em;
}


/* Figure with image */
figure {
  max-width: 540px;

  margin: 0 auto;
}

figure .figure-img-container {
  width: fit-content;

  margin: 0 auto;

  box-shadow: 5px 5px 10px gray;
}

figure img {
  display: block;

  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 50vh;

  object-fit: contain;
}

figure figcaption {
  color: rgba(var(--dark-color-rgb), 0.6);

  margin: 1em 0;

  text-align: center;
}

figure figcaption.pre-wrap {
  white-space: pre-wrap;
}

figure figcaption blockquote,
figure figcaption ol {
  width: fit-content;

  margin-left: auto;
  margin-right: auto;

  text-align: center;
}

figure figcaption li {
  text-align: left;
}


/* Horizontal rule */
hr {
  border: 2px solid var(--main-brand);
}


/* Site header */
header {
  padding: 8px 0;

  text-align: center;
}

.header-title {
  font-family: Bungee;

  margin: 0;
}

.header-subtitle {
  font-size: 1em;

  margin: 0;
}

/*LINK ./index.html#vtuber-logo*/
body.uwu .header-title,
body.uwu .header-subtitle {
  display: none;
}

body:not(.uwu) .header-uwu {
  display: none;
}

body.uwu .header-uwu {
  display: block;

  width: 90%;
  max-width: 300px;

  margin: 0 auto;
}

.icon-pelican {
  content: url(images/pelicon.png);

  height: 1em;

  vertical-align: baseline;
}

@media screen and (max-width: 350px) {
  .header-title .icon-pelican {
    display: none;
  }
}


/* Navbar */
nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;

  width: fit-content;

  margin: 0 auto 8px auto;
}

nav a {
  color: var(--dark-color);

  font-size: 14px;

  border-color: var(--dark-color);

  padding: 0.5em;

  text-decoration: none;

  transition: background-color 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.15s linear,
              color 0.2s ease;
}

nav a.navbar-current {
  color: var(--main-brand);

  border-color: var(--main-brand);
}

nav a:hover {
  background-color: rgba(var(--main-brand-rgb), 0.1);
  color: var(--main-brand);

  border-color: var(--main-brand);
}

nav a:active {
  background-color: rgba(var(--main-brand-rgb), 0.1);

  border-color: var(--main-brand);
}

nav a span {
  margin-right: 0.5em;
}

@media screen and (max-width: 680px) {
  nav a {
    font-size: 16px;
  }

  nav a span {
    display: none;
  }
}

@media screen and (max-width: 400px) {
  nav {
    gap: 0;
  }
}


/* Address in footer */
address {
  display: grid;
  grid-template-columns: min-content auto;
  grid-gap: 0.4em 0.5em;
  align-items: center;

  line-height: 1.5;
}

address a {
  font-family: Rubik, Tahoma, sans-serif;
  font-style: normal;
  font-weight: bold;

  width: fit-content;

  text-decoration: none;
}

address [class^="fa"] {
  font-size: 1.5em;

  justify-self: center;
}


/* Footer */
footer {
  display: flex;
  flex-direction: column;
  gap: 12px;

  max-width: 700px;

  margin: 0 auto;
}


/* Cookie notice */
.cookie-notice {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  position: fixed;
  left: 0;
  bottom: 0;

  background-color: var(--main-brand);
  color: var(--light-color);

  width: 100%;

  padding: 0.25em 1em;

  z-index: 2;
  opacity: 1;
  transform: translateY(0%);
  transition: opacity 0.5s ease,
              transform 0.5s ease;
}

.cookie-notice-content {
  flex: 0 1 auto;

  margin: -0.5em 0.5em;

  text-align: center;
}

.cookie-notice.closed {
  opacity: 0;

  transform: translateY(100%);
}

.cookie-notice:not(.no-cookies) > .no-cookies,
.cookie-notice.no-cookies > *:not(.no-cookies) {
  display: none;
}

@media screen and (max-width: 540px) {
  .cookie-notice {
    font-size: 14px;
    flex-direction: column;
  }
}

.cookie-close {
  flex: 0 0 auto;

  text-wrap: nowrap;
}


/* Modal with a message */
.modal-container {
  display: flex;
  justify-content: center;
  align-items: center;

  position: fixed;
  top: 0;
  left: 0;

  background-color: rgba(0, 0, 0, 0.4);

  width: 100%;
  height: 100%;

  z-index: 9999;
  overscroll-behavior-y: contain;
  backdrop-filter: blur(5px);
}

.modal {
  display: flex;
  flex-direction: column;

  background-color: var(--light-color);

  max-width: min(calc(100% - 32px), 720px);
  max-height: calc(100% - 32px);

  border: 2px solid black;
  border-radius: 12px;
}

.modal-header {
  display: flex;
  align-items: center;

  flex: 1 1 auto;
  gap: 1em;

  padding-left: 1.5em;
  padding-right: 0.5em;

  border-bottom: 1px solid black;
}

.modal-header .modal-header-text {
  flex: 1 1 100%;

  margin: 0.5em 0;
}

.modal-content {
  flex: 1 1 auto;

  max-width: 100%;

  padding: 0.5em 1.5em;

  overflow: auto;
}

.modal-footer {
  display: flex;
  align-items: center;

  flex: 1 1 auto;

  padding: 0.5em 1.5em;

  border-top: 1px solid black;
}

.modal-close {
  /* NOTE A lot of these styles are to cancel out the styles for buttons */
  display: inline-block;
  flex: 0 0 auto;

  background: none;
  color: var(--dark-color);

  font-size: 32px;
  font-weight: bold;

  min-width: auto;
  min-height: auto;

  margin: 0;
  padding: 0.1em;

  border: none;

  transition: box-shadow 0.15s linear,
              color 0.2s ease;
}

.modal-close:hover,
.modal-close:focus {
  background: none;
  color: var(--dark-accent);
}

@media screen and (max-width: 400px) {
  .modal-header {
    padding-left: 1em;
  }

  .modal-content,
  .modal-footer {
    padding-left: 1em;
    padding-right: 1em;
  }
}


/* Modal with loader */
.modal-loader {
  font-size: 10px;

  width: 80px;
  height: 80px;

  border: 10px solid rgba(255, 255, 255, 0.25);
  border-left-color: rgba(255, 255, 255, 1);
  border-radius: 9999px;

  animation: spin 0.955s infinite linear;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}


/* FontAwesome icons */
i[class^="fa"] {
  font-size: 1.25em;

  vertical-align: middle;
}

i.fa-envelope {
  color: #d44638;
}

i.fa-itch-io {
  color: #fa5c5c;
}

i.fa-mastodon {
  color: #6364ff;
}

i.fa-square-github {
  color: black;
}

i.fa-twitter,
i.fa-square-twitter {
  color: #1d9bf0;
}

/* Assorted stuff */
.display-none {
  display: none !important;
}

.text-align-center {
  text-align: center;
}

.nowrap {
  white-space: nowrap;
}

.background-color-white {
  background-color: white;
}

[data-remove-overflow-hidden] {
  overflow: visible !important;
}


/* Temporary stuff */
/* TODO Get rid of these styles */
nav a {
  position: relative;
}

nav a[tabindex="-1"] {
  pointer-events: none;
}

nav a[tabindex="-1"]::after {
  content: "Coming Soon...";

  position: absolute;
  top: 50%;
  left: 50%;

  background: var(--dark-accent);
  color: var(--light-color);

  width: min-content;

  padding: 0.25em 0.5em;

  border: 3px solid var(--dark-color);
  border-radius: 0.5em;

  text-align: center;
  font-variant: small-caps;
  z-index: 1;
  transform: translate(-50%, -50%) rotate(10deg);
}

@media screen and (max-width: 680px) {
  nav a[tabindex="-1"]::after {
    font-size: 0.6em;
  }
}