@font-face {
  font-family: 'EldBoyfriend';
  src: url('EldBoyfriend.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  position: relative;

  background-image: 
    url('images/heart_tile.webp'), 
    url('images/heart_tile.webp'), 
    linear-gradient(180deg, #702674, #1a0026);

  background-size: 
    384px 384px, 
    384px 384px, 
    cover;

  /* Shift the second layer by exactly half (250px and 125px) 
     to maintain the offset pattern alignment */
  background-position: 
    0 0, 
    192px 192px, 
    0 0;

  background-repeat: 
    repeat, 
    repeat, 
    no-repeat;

  background-blend-mode: overlay, overlay, normal;
  min-height: 100vh;
}

html,
body {
    margin: 0;
    padding:0;
}

h1 {
  font-family: 'EldBoyfriend', Arial, Helvetica, sans-serif;
}

.page-background {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);

  
  width: min(1100px, 92%);
  height: auto;

  pointer-events: none;
  z-index: 0;
}

.page-content {
  position: relative;
  z-index: 1;
}

main {
  position: relative;
  z-index: 1;
}

section {
  box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.6), 0 15px 25px -5px rgba(0, 0, 0, 0.4);
  background: rgba(10, 10, 15, 0.65);
  border-radius: 8px;
  padding: 20px;
  width: min(1100px, 92%);
  margin: 40px auto; 
}

section.logo {
  height: clamp(220px, 108px + 16.25vw, 420px);
  width: 100%;
  margin-top: 0;

  background-image: url('images/banner.webp');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: 50% 50%;

  border-radius: 0;
}

@keyframes floatLogo {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-6px) rotate(-1deg);
  }
  66% {
    transform: translateY(-3px) rotate(1.5deg);
  }
}

footer {
  width: min(1100px, 92%);
  margin: 0 auto; 
}

/* Headings */
h1,
h2,
h3 {
  color: #ffffff;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 1.5rem;
}

p {
  color: #ffffff;
}

a {
  color: #ffffff;
}

.banner {
  width: 100%;
}

/* Steam / main button */
.button {
  display: inline-block;
  margin-top: 20px;
  padding: 14px 28px;
  background-color: #ffffff;
  color: #26199a;
  text-decoration: none;
  font-weight: bold;
  border-radius: 6px;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.button:hover {
  background-color: #eeeeee;
  transform: translateY(-2px);
}

/* Responsive YouTube video */
.video {
  text-align: right;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
}

/* Special above-the fold steam widget for mobile only */
.steam-above {
  display: none;
  margin-top: 20px;
}

@media (max-width: 1550px) {
  /* Hide side decorations */
  .deco {
    display: none;
  }
}

/* Mobile */
@media (max-width: 600px) {
  section {
    margin: 20px auto;
    padding: 40px 0;
  }

  .about-game p {
    margin-top: 0 !important;
  }

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

  .testimg {
    display: none;
  }

  .steam {
    display: none;
  }

  .steam-above {
    display: block;
  }

  .trailer {
    margin-top: 20px !important;
  }
}

.page-background {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(100%, 1920px);
  height: 5000px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
}

.page-background .bg {
  position: absolute;
  top: 0;
  left: 50%;
  width: 100%;
  height: auto;
  transform: translateX(-50%);
}

.about-studio {
  background: none;
  box-shadow: none;
  display: flow-root;
  padding-top: 0;
  margin-bottom: 0;

  p {
    margin-top: 15%;
    font-weight: bold;
  }
}

.about-game { 
  position: relative; /* for carousel */
  padding-bottom: 0;
  box-shadow: none;
  background: none;
  margin-bottom: 0;
  padding-top: 0;

  display: flex;
  flex-direction: column;
  justify-content: flex-end;

  &::after {
    content: "";
    display: table;
    clear: both;
  }

  h1, h2, h3 {
    text-shadow: 2px 2px 4px #000000, 0 0 10px #9c27b0, 0 0 20px #4a0e4e;
    margin: 0;
  }

  p {
    width: 100%;
    overflow: visible;
  }
}

.about-section h1 {
  /* h1 spans the entire width of the section, oblivious to the float below it */
  width: 100%;
  margin-bottom: 0.5em;
  
  /* Lower z-index so it sits visually behind the floated image */
  position: relative;
  z-index: 1;
}

.about-section p {
  position: relative;
  z-index: 2;
  margin: 0;
}

.testimg {
  float: right;
  margin-left: 20px;
  margin-bottom: 0;
  
  /* Shape wrapping */
  shape-outside: url("images/cthulhu_happy.webp");
  shape-margin: 15px;
  shape-image-threshold: 0.1;
  
  width: 300px;
  height: auto;
  
  position: relative;
  z-index: 3;
}

.trailer {
  aspect-ratio: 16 / 9;
  background-image: url('images/play.svg'), url("images/cinema.webp");
  background-size: 128px 128px, cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #000;
  padding: 0; /* Video will take up the full area */
  margin-top: 0;
  cursor: pointer;
  position: relative; /* Keeps the overlay contained to the section */
  overflow: hidden;

  h1 {
    position: relative;
    left: 20px;
    top: 20px;
  }

  .video-player {
    width: 100%;
    height: 100%;
  }
}

.trailer::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    url('images/play.svg'), 
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
  background-size: 128px 128px, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Fades the overlay and play button in on hover */
.trailer:hover::after {
  opacity: 1;
}

/* Don't show background when trailer is active */
.trailer:has(iframe) {
  background: none;
  background-color: #000;
}

.trailer:has(iframe)::after {
  display: none; 
}

.penguin-side {
  float: left;
  width: 40%;
  max-width: 500px;
  margin-left: 30px;
  margin-bottom: 20px;
}

.penguin-side img {
  display: block;
  width: 100%;
  height: auto;
}

.about-game {
  p {
    margin-right: max(40%, 400px); 
    margin-top:30px;
    margin-bottom: 0;
  }
}

.cthulhu-carousel {
  position: absolute;
  bottom: 0;
  right: 0;
  width: max(40%, 400px);
  aspect-ratio: 4/5;

  img {
    width: 400px;
    height: 500px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.cthulhu-carousel img.happy {
  shape-outside: url("images/cthulhu_happy.webp");
  shape-margin: 20px;
}

.cthulhu-carousel img.bashful {
  shape-outside: url("images/cthulhu_bashful.webp");
  shape-margin: 20px;
}

.cthulhu-carousel img.upset {
  shape-outside: url("images/cthulhu_upset.webp");
  shape-margin: 20px;
}

.cthulhu-carousel .happy {
  animation: cthulhuHappy 15s ease-in-out infinite;
}

.cthulhu-carousel .bashful {
  animation: cthulhuBashful 15s ease-in-out infinite;
}

.cthulhu-carousel .upset {
  animation: cthulhuUpset 15s ease-in-out infinite;
}

@keyframes cthulhuHappy {
  0%, 27% {
    opacity: 1;
  }

  33%, 94% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes cthulhuBashful {
  0%, 27% {
    opacity: 0;
  }

  33%, 60% {
    opacity: 1;
  }

  67%, 100% {
    opacity: 0;
  }
}

@keyframes cthulhuUpset {
  0%, 60% {
    opacity: 0;
  }

  67%, 94% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* Make the steam widget fit in flow */
.about-game iframe {
  width: 100%;
  height: 190px;
  border: 0;
}

.steam {
  margin-bottom: 30px;
}

.effigy-margin {
  position: fixed;
  bottom: 0;
  width: 20vw;
  height: auto;
  pointer-events: none;
  z-index: -1;
  animation: eeriePulsate 4s ease-in-out infinite;
}

@keyframes eeriePulsate {
  0%, 100% {
    filter: 
      drop-shadow(0px -4px 8px rgba(0, 200, 0, 0.15)) 
      drop-shadow(0px 18px 25px rgba(0, 200, 0, 0.4));
  }
  50% {
    filter: 
      drop-shadow(0px -2px 4px rgba(0, 200, 0, 0.08)) 
      drop-shadow(0px 9px 12px rgba(0, 200, 0, 0.2));
  }
}

.left-effigy {
  left: 0;
}

.right-effigy {
  right: 0;
}

.car {
  position: absolute;
  top: 1250px;
  width: 20vw;
  height: auto;
  pointer-events: none;
  z-index: -1;

  animation: cartoonCarJiggle 0.6s ease-in-out infinite;
}

.shub {
  position: absolute;
  top: 800px;
  left: 5vw;
  width: 20vw;
  height: auto;
  pointer-events: none;
  z-index: -1;
}

.yog {
  position: absolute;
  top: 900px;
  right: -5vw;
  width: 20vw;
  height: auto;
  pointer-events: none;
  z-index: -1;
}

.mariko {
  position: fixed;
  bottom: 0px;
  right: 0vw;
  width: 20vw;
  height: auto;
  pointer-events: none;
  z-index: -1;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.9));
}

@keyframes cartoonCarJiggle {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  20% {
    transform: translateY(-1px) rotate(-0.2deg);
  }
  40% {
    transform: translateY(1px) rotate(0.4deg);
  }
  60% {
    transform: translateY(-1px) rotate(-0.1deg);
  }
  80% {
    transform: translateY(1px) rotate(0.1deg);
  }
}

/* For Shub and Yog images under the banner */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Target both images */
img.yog, 
img.shub,
img.car {
  /* Ensure they start hidden */
  opacity: 0; 
  
  /* Bind animation to page scroll */
  animation: fadeIn linear both;
  animation-timeline: scroll();
  
  /* Starts fading in at 400px scroll, finishes by 600px scroll */
  animation-range: 400px 600px;
}