@import url("https://fonts.googleapis.com/css2?family=Schoolbell&display=swap");

:root {
  --content-width: 760px;
  --ink: #2a1610;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: url("images/texture.png") repeat;
  overflow-x: hidden;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Courier New", Courier, monospace;
  background: url("images/texture.png") repeat;
  overflow-x: hidden;
}

body::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  height: min(34vw, 310px);
  background:
    radial-gradient(ellipse at bottom, rgba(255, 111, 190, 0.82) 0%, rgba(255, 111, 190, 0.4) 42%, rgba(255, 111, 190, 0.12) 64%, rgba(255, 111, 190, 0) 82%);
  filter: blur(26px);
  mix-blend-mode: screen;
  pointer-events: none;
}

a {
  color: inherit;
}

.pixel {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  height: auto;
}

.corner {
  position: absolute;
  top: 0;
  z-index: 0;
  pointer-events: none;
}

.corner-left {
  left: 0;
  width: min(36vw, 519px);
}

.corner-right {
  right: 0;
  width: min(36vw, 515px);
}

.page {
  position: relative;
  z-index: 1;
  width: min(100%, var(--content-width));
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 18px 20px;
  text-align: center;
}

.hero,
.gallery,
.site-footer {
  display: flex;
  align-items: center;
  flex-direction: column;
}

.hero {
  width: 100%;
}

.center-art {
  width: min(100%, 564px);
}

.socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.4vw, 22px);
  margin: 4px 0 18px;
}

.social-link {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  transition: transform 120ms ease, filter 120ms ease;
}

.social-link:hover,
.social-link:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.social-link img {
  max-width: 100%;
  max-height: 100%;
}

.logo {
  width: min(100%, 350px);
  aspect-ratio: 350 / 200;
  margin-top: 2px;
  background-image: url("images/logo1.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  animation: logo-loop 420ms steps(1, end) infinite;
}

.contract {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 560px);
  gap: 10px;
  margin: 6px auto 2px;
  padding: 0 12px;
}

.contract-label {
  width: 47px;
  flex: 0 0 auto;
}

.contract p {
  min-width: 0;
  margin: 0;
  color: #fff;
  overflow-wrap: anywhere;
  font-family: "Schoolbell", "Comic Sans MS", cursive;
  font-size: clamp(18px, 3.1vw, 24px);
  font-weight: 700;
  line-height: 1.25;
}

.character-wrap {
  position: relative;
  width: min(100%, 281px);
  aspect-ratio: 562 / 877;
  margin: 0 auto 34px;
}

.spark-canvas {
  position: absolute;
  inset: -28% -52% -12%;
  z-index: -2;
  width: 204%;
  height: 140%;
  mix-blend-mode: screen;
  pointer-events: none;
}

.character {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 562 / 877;
  margin: 0;
  background-image: url("images/dick1.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  animation: character-loop 480ms steps(1, end) infinite;
}

.character-wrap::before {
  content: "";
  position: absolute;
  inset: -2% -58% -2%;
  z-index: -1;
  background:
    radial-gradient(circle, rgba(255, 118, 190, 0.82) 0%, rgba(255, 118, 190, 0.48) 34%, rgba(255, 118, 190, 0.16) 58%, rgba(255, 118, 190, 0) 78%);
  filter: blur(34px);
  mix-blend-mode: screen;
  pointer-events: none;
}

.gallery {
  width: min(100vw - 20px, 1360px);
  gap: 12px;
  margin: 0 0 20px 50%;
  transform: translateX(-50%);
}

.gallery-title {
  width: min(68vw, 230px);
}

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  gap: clamp(2px, 0.45vw, 8px);
  align-items: start;
  padding: 4px 0 12px;
}

.gallery-card {
  appearance: none;
  position: relative;
  flex: 0 1 330px;
  width: 100%;
  max-width: 330px;
  aspect-ratio: 486 / 536;
  background-image: url("images/image_holder.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border: 0;
  margin: 0;
  padding: 0;
  background-color: transparent;
  cursor: pointer;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.22));
  transform: rotate(var(--holder-rotate, 0deg));
  transform-origin: center;
  transition: filter 140ms ease, transform 140ms ease;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.28));
  outline: 0;
  transform: rotate(var(--holder-rotate, 0deg)) translateY(-3px);
}

.gallery-card img {
  position: absolute;
  top: 10.5%;
  left: 11.5%;
  width: 77%;
  height: 75%;
  object-fit: contain;
  transform: rotate(var(--image-rotate, 0deg));
}

.gallery-card.is-loading img {
  opacity: 0;
}

.gallery-card.is-loaded img {
  opacity: 1;
  transition: opacity 180ms ease;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 28px;
  background: rgba(0, 0, 0, 0.76);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-card {
  position: relative;
  width: min(92vw, 760px);
  max-height: 92vh;
  aspect-ratio: 486 / 536;
  background-image: url("images/image_holder.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.45));
  transform: rotate(var(--lightbox-holder-rotate, -1deg));
}

.lightbox-image {
  position: absolute;
  top: 10.5%;
  left: 11.5%;
  width: 77%;
  height: 68%;
  object-fit: contain;
  transform: rotate(var(--lightbox-image-rotate, 0.8deg));
}

.lightbox-download {
  position: absolute;
  left: 50%;
  bottom: 8.5%;
  color: #050505;
  font-family: "Schoolbell", "Comic Sans MS", cursive;
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transform: translateX(-50%);
  transition: transform 160ms ease;
}

.lightbox-download:hover,
.lightbox-download:focus-visible {
  outline: 0;
  text-decoration: none;
  transform: translateX(-50%) scale(1.08);
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  cursor: pointer;
  font-family: "Schoolbell", "Comic Sans MS", cursive;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

body.has-lightbox {
  overflow: hidden;
  width: 100%;
}

.site-footer {
  position: relative;
  z-index: 1;
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 0 18px 14px;
  overflow: hidden;
}

.footer-art {
  width: min(100%, 871px);
  animation: footer-bob 4.8s ease-in-out infinite;
  mask-image: linear-gradient(to bottom, #000 0%, #000 76%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 76%, rgba(0, 0, 0, 0) 100%);
  transform: translateY(1px);
}

@media (max-width: 640px) {
  .corner-left {
    width: min(32vw, 166px);
  }

  .corner-right {
    width: min(32vw, 165px);
  }

  .page {
    padding-top: 0;
  }

  .center-art {
    width: min(72vw, 212px);
  }

  .contract {
    order: 2;
  }

  .socials {
    order: 1;
    gap: 18px;
    margin: 10px 0 24px;
  }

  .social-link {
    display: flex;
    width: auto;
    height: auto;
    overflow: visible;
  }

  .social-link img {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  .social-link:nth-child(1) img {
    width: 37px;
  }

  .social-link:nth-child(2) img {
    width: 62px;
  }

  .social-link:nth-child(3) img {
    width: 62px;
  }

  .social-link:nth-child(4) img {
    width: 38px;
  }

  .logo {
    width: min(100%, 175px);
  }

  .contract {
    width: min(100%, 350px);
    align-items: center;
    gap: 5px;
    margin: 0 auto 26px;
    padding: 0;
  }

  .contract-label {
    width: 21px;
  }

  .contract p {
    white-space: nowrap;
    overflow-wrap: normal;
    font-size: clamp(13px, 3.6vw, 15px);
  }

  .character {
    width: 100%;
  }

  .character-wrap {
    width: min(100%, 281px);
    margin: 0 auto 28px;
  }

  .gallery-title {
    width: min(60vw, 115px);
    margin-top: 16px;
  }

  .gallery-grid {
    width: min(100%, 460px);
    gap: 2px;
  }

  .gallery {
    width: 100%;
    margin: 0 auto 20px;
    transform: none;
  }

  .spark-canvas {
    inset: -24% 0 -10%;
    width: 100%;
  }

  .character-wrap::before {
    inset: 0;
    width: 100%;
    height: 100%;
    filter: blur(36px);
    transform: scaleX(1.42) scaleY(1.06);
  }

  .gallery-card {
    flex-basis: 225px;
    max-width: 225px;
  }

  .lightbox {
    padding: 12px;
  }

  .lightbox-card {
    width: min(86vw, calc((100vh - 48px) * 486 / 536));
    max-height: calc(100vh - 48px);
    transform: rotate(var(--lightbox-holder-rotate, -1deg)) translateZ(0);
  }

  .lightbox-download {
    bottom: 8%;
    font-size: clamp(22px, 8vw, 34px);
  }

  .lightbox-close {
    top: 8px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 30px;
  }

  .footer-art {
    width: min(100%, 436px);
  }

  body::after {
    height: 210px;
    filter: blur(22px);
  }
}

@keyframes character-loop {
  0%,
  32.99% {
    background-image: url("images/dick1.png");
  }

  33%,
  65.99% {
    background-image: url("images/dick2.png");
  }

  66%,
  100% {
    background-image: url("images/dick3.png");
  }
}

@keyframes footer-bob {
  0%,
  100% {
    transform: translateY(1px);
  }

  50% {
    transform: translateY(15px);
  }
}

@keyframes logo-loop {
  0%,
  32.99% {
    background-image: url("images/logo1.png");
  }

  33%,
  65.99% {
    background-image: url("images/logo2.png");
  }

  66%,
  100% {
    background-image: url("images/logo3.png");
  }
}
