:root {
  --header-color: #0f0f0f;
  --main-width: clamp(30vw, 40vw, 40vw);
}

@font-face {
  font-family: "TypeWriter";
  src: url(assets/fonts/typewriter.ttf) format("truetype");
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  max-height: 100vh;

  background-image: url(assets/images/bg-landscape.jpg);

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;

  overflow-y: auto;
}

#hero-text {
  margin-top: 2rem;
  font-size: 2.7rem;
  color: #47693f;
}

/* overlay */

#dark-overlay {
  width: 100vw;
  height: 100vh;
  z-index: 2;
  visibility: hidden;
  opacity: 0;
  background-color: black;
  transition: opacity 1.5s ease-in-out;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

#mould-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  visibility: hidden;

  transform: translate(-50%, -50%) rotate(0deg);
}

#video-container {
  position: absolute;
  top: 45%;
  left: 50%;

  transform: translate(-50%, -50%);

  width: 70vmin;
  display: flex;
  flex-direction: column;
  gap: 10px;

  max-height: 80vh;

  z-index: 4;
}

#video-buttons {
  display: flex;
  gap: 10px;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.5s ease-in-out;
  flex-wrap: nowrap;
  container-type: inline-size;
  container-name: button-container;
}

.video-button {
  flex: 1;

  padding: 1rem;
  border: 2px solid white;
  background: black;
  color: white;

  font-family: "TypeWriter";
  font-size: 1rem;

  cursor: pointer;

  text-align: center;
  background-color: #47693f;

  font-size: 1.5rem;

  pointer-events: auto;

  text-decoration: none;

  white-space: nowrap;

  font-size: clamp(0.8rem, 8cqi, 1.5rem);
}

#FKA-video {
  position: static;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.5s ease-in-out;
  border: 2px solid white;
}

#FKA-video:hover {
  cursor: pointer;
}

/* main */
main {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  padding-bottom: 5vh;
  padding: 0;
  flex: 1;
}

#content {
  max-height: 100vh;
  min-height: 600px;
  display: grid;
  grid-template-columns: minmax(0, clamp(35vw, 42vw, 60vw));
  grid-template-rows: auto auto auto auto auto;
  justify-content: center;
  justify-items: center;

  gap: 0.75rem;
  padding: 2rem;

  font-family: "TypeWriter";
  text-align: center;
}

#main-image {
  min-height: 0;
  max-height: 45vh;
  max-width: 90%;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

#password-wrapper {
  position: relative;
  width: 100%;
  outline: none;
  font-family: "TypeWriter";

  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;

  max-width: 35vw;

  container-type: inline-size;
}

#hidden-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

#password-wrapper div {
  width: 100%;
  aspect-ratio: 7 / 8;

  background-color: white;
  border: 2px solid black;
  transition: all 0.3s ease;

  display: grid;
  place-items: center;
  align-content: center;

  font-size: clamp(1.5rem, 12cqw, 4.5rem);
  line-height: 1;

  overflow: hidden;
  text-align: center;
  white-space: nowrap;
}

.active {
  box-shadow: 0 0 10px 5px rgba(71, 105, 63, 0.7);
  transform: translateY(-10px);
}

@media (orientation: landscape) {
  #mould-overlay {
    transform: translate(-50%, -50%) rotate(90deg);
    width: 100vh;
    height: 100vw;
  }
}

@media (max-width: 720px) {
  :root {
    --main-width: 90vw;
  }

  #content {
    grid-template-columns: minmax(0, 95vw);
    max-width: 100vw;
  }

  #password-wrapper {
    min-width: 85vw;
    max-width: 350px;
    gap: 8px;
  }

  #submit-button {
    min-width: 85vw;
    max-width: 400px;
    padding: 1.2rem 0;
    font-size: 1.8rem;
    margin-bottom: 2rem;
  }

  #main-image {
    max-height: 35vh; /* Gives the password/button combo more room */
  }

  body {
    background-image: url(assets/images/bg-portrait.jpg);
  }

  #video-container {
    width: 90vmin;
    max-width: 500px;
    gap: 15px;
  }
  #video-buttons {
    flex-direction: column-reverse;
  }
}

@media (max-height: 780px) {
  :root {
    --main-width: 80vw;
  }
}

/* iPad and Tablet Breakpoint */
@media (min-width: 721px) and (max-width: 1024px) {
  #content {
    grid-template-columns: minmax(0, 70vw);
  }

  #password-wrapper {
    max-width: 60vw;
  }

  #submit-button {
    min-width: 60vw;
  }

  #submit-button {
    width: 60vw;
    padding: 1.2rem 0;
  }

  #main-image {
    max-height: 40vh;
  }
}

@media (min-width: 575px) and (max-width: 720px) {
  #video-buttons {
    flex-direction: column;
  }

  .video-button {
    font-size: 1.2rem;
    padding: 0.8rem;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-5px);
  }

  40%,
  80% {
    transform: translateX(5px);
  }
}

.shake {
  animation: shake 0.4s ease-in-out;
}

.credits {
  position: relative;
  bottom: 0.75rem;
  left: 1rem;
  position: relative;
  text-align: center;
  flex-direction: column;
  display: flex;
  color: white;
  font-size: 0.75rem;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  z-index: 1;
  margin-top: auto;
  width: 100%;
  overflow-x: hidden;
  text-align: left;
}

.credit,
.credit:visited {
  opacity: 1;
  color: white;
  text-decoration: none;
  overflow-x: hidden;
}

.credit:hover {
  cursor: pointer;
  text-decoration: underline;
  color: white;
}

#submit-button {
  border: 2px solid white;
  justify-self: center;
  padding: 1rem;
  background-color: #47693f;
  color: white;
  font-family: "TypeWriter";
  padding: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  margin-bottom: 1rem;
  width: 35vw;
}
