@font-face {
  font-family: "Press Start 2P";
  src: url("/assets/PressStart2P-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #282828;
  --surface: #3c3836;
  --text: #ebdbb2;
  --muted: #a89984;
  --line: #16111a;
  --accent: #ff00ff;
  --switch-bg: #2d2230;
  --switch-border: #16111a;
  --switch-thumb-bg: #9a1a86;
  --switch-thumb-active-bg: #ff00ff;
  --switch-thumb-border: #440044;
  --switch-thumb-active-border: #cc00cc;
  --media-bg: #1d2021;
  --lightbox-bg: rgba(29, 32, 33, 0.94);
  --lightbox-button-bg: rgba(60, 56, 54, 0.9);
  --lightbox-button-text: #fbf1c7;
  --pixel-border: 4px;
  --pixel-shadow: 4px 4px 0 #120011;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 12px/1.6 "Press Start 2P", "Courier New", monospace;
  letter-spacing: 0.03em;
}

body.no-scroll {
  overflow: hidden;
}

h1,
h2,
p,
figure {
  margin: 0;
}

h1,
h2 {
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

h2 {
  font-size: 1.1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

body.home-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  display: grid;
  gap: 1rem;
}

main.home-page__main {
  width: fit-content;
  max-width: 100%;
  justify-items: center;
  gap: 5rem;
  text-align: center;
}

main.home-page__main > h1 {
  white-space: nowrap;
}

main > nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

main.home-page__main > nav {
  width: min(100%, 28rem);
  gap: 1.5rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header__actions {
  display: inline-flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 1rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.page-header h1,
.gallery h2,
.page-header__link,
main > nav a,
main > figure,
.details > *,
.gallery > figure {
  border: var(--pixel-border) solid var(--line);
  background: var(--surface);
  box-shadow: var(--pixel-shadow);
}

main > nav a,
main > figure,
.details > *,
.gallery > figure {
  overflow: hidden;
}

.page-header h1,
.gallery h2 {
  width: fit-content;
  padding: 0.6rem 0.85rem;
}

.page-header__link,
.nsfw-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.75rem 1rem;
}

.page-header__link {
  color: inherit;
  text-decoration: none;
}

main > nav a {
  display: block;
  padding: 1.25rem;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.page-header__link:hover,
.page-header__link:focus-visible {
  border-color: var(--accent);
  outline: none;
}

main > nav a:hover,
main > nav a:focus-visible {
  background: #f6d324;
  color: #000;
  outline: none;
}

.nsfw-toggle,
#lightboxClose {
  border: var(--pixel-border) solid var(--line);
  box-shadow: var(--pixel-shadow);
}

.nsfw-toggle {
  gap: 0.75rem;
  width: fit-content;
  background: #f6d324;
  color: #000;
  font-weight: 600;
  cursor: pointer;
}

.nsfw-toggle__label {
  line-height: 1;
}

.nsfw-toggle__control {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.nsfw-toggle input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.nsfw-toggle__track {
  width: 3.75rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  border: var(--pixel-border) solid var(--switch-border);
  background: var(--switch-bg);
  overflow: visible;
}

.nsfw-toggle__thumb {
  width: 1.75rem;
  height: 1.75rem;
  margin-left: calc(-1 * var(--pixel-border));
  border: var(--pixel-border) solid var(--switch-thumb-border);
  background: var(--switch-thumb-bg);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45);
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.nsfw-toggle input:checked + .nsfw-toggle__track .nsfw-toggle__thumb {
  transform: translateX(2rem);
  border-color: var(--switch-thumb-active-border);
  background: var(--switch-thumb-active-bg);
}

.nsfw-toggle input:focus-visible + .nsfw-toggle__track {
  outline: 4px solid var(--accent);
  outline-offset: 4px;
}

img,
video,
model-viewer {
  width: 100%;
  display: block;
  background: var(--media-bg);
}

img,
video {
  height: auto;
}

main model-viewer {
  height: min(70vh, 560px);
}

[data-lightbox] {
  cursor: zoom-in;
}

[data-lightbox]:focus-visible,
#lightboxClose:focus-visible {
  outline: 4px solid var(--accent);
  outline-offset: -4px;
}

figcaption {
  padding: 0.7rem;
  border-top: var(--pixel-border) solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 1rem;
  align-items: start;
}

.details > :only-child {
  grid-column: 1 / -1;
}

.details > section {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.details > figure {
  grid-column: 2;
}

.details ul {
  margin: 0;
  padding-left: 1.25rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  align-items: start;
  margin-top: 5rem;
}

.gallery h2 {
  grid-column: 1 / -1;
}

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: var(--lightbox-bg);
}

#lightboxClose {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2.2rem;
  height: 2.2rem;
  background: var(--lightbox-button-bg);
  color: var(--lightbox-button-text);
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}

#lightboxContent {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

#lightboxContent > * {
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  background: transparent;
}

#lightboxContent img,
#lightboxContent video {
  width: auto;
  height: auto;
  background: transparent;
}

#lightboxContent model-viewer {
  width: min(96vw, 1200px);
  height: min(96vh, 900px);
  background: transparent;
  --poster-color: transparent;
}

@media (max-width: 780px) {
  main.home-page__main > h1 {
    white-space: normal;
  }

  .page-header {
    align-items: stretch;
  }

  .page-header__actions {
    width: 100%;
  }

  .page-header__link,
  .nsfw-toggle {
    width: 100%;
  }

  .page-header__link {
    justify-content: center;
  }

  .nsfw-toggle {
    justify-content: space-between;
  }

  .details {
    grid-template-columns: 1fr;
  }

  .details > figure {
    grid-column: auto;
  }

  .gallery {
    grid-template-columns: 1fr;
  }
}
