html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  margin: 0 auto;
  text-align: center;
  background-color: rgb(245, 245, 247);
}

.home-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100%;
}

.home-content {
  max-width: 700px;
}

main {
  margin: 120px auto;
  padding-bottom: 120px;
  text-align: center;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-style: normal;
  font-weight: 400;
  font-size: 24px;
  line-height: 37px;
  color: rgba(0, 0, 0, 0.75);
}

main section,
main ul,
main h1,
main h2,
main h3,
main h4,
hr {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
  list-style-type: none;
  margin-left: none;
}

main ul {
  padding-inline-start: 0px;
  list-style: none;
}

main h3,
h4 {
  margin-top: 0;
}

main h4 {
  margin-bottom: 0px;
}

main section {
  margin-bottom: 37px;
}

main section .highlight {
  font-weight: 600;
  text-decoration: none;
}

main section .highlight,
main h1,
main h2,
main h3,
main h4 {
  color: #111;
}

main section .highlight:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 3px;
  text-decoration-color: #000;
  text-decoration-skip-ink: none;
}

ul li .project-sub-header {
  display: block;
  color: rgba(0, 0, 0, 0.5);
  opacity: 0.7;
}

main ul li {
  font-size: 19px;
  line-height: 32px;
  color: rgba(0, 0, 0, 0.6);
}

main ul li a,
main section a {
  text-decoration: none;
  color: #000;
}

main ul li a:hover,
main section a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 3px;
  text-decoration-color: #000;
}

.frontlist li {
  margin-bottom: 24px;
}

main img,
main video,
main iframe {
  margin: 12px auto 37px;
  width: 94%;
  max-width: 800px;
  border-radius: 16px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.12);
}

main iframe {
  aspect-ratio: 16 / 9;
  height: auto;
  border: none;
}

main hr {
  margin-top: 37px;
  margin-bottom: 37px;
  opacity: 0.2;
}

/* Password Input Field */
.password-input-container {
  display: flex;
  align-items: center;
  max-width: 700px;
  margin: 0 auto;
  background: transparent;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 6px 6px 6px 16px;
  transition: border-color 0.2s ease;
}

.password-input-container:hover {
  border-color: rgba(0, 0, 0, 0.45);
}

.password-input-container:focus-within {
  border-color: #8e8e8f;
}

.password-input {
  flex: 1;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 18px;
  line-height: 24px;
  font-weight: 400;
  color: #5a5a5b;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  width: 100%;
}

.password-input::placeholder {
  color: #6e6e6f;
  opacity: 0.85;
}

.password-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.password-submit:hover {
  background-color: rgba(0, 0, 0, 0.15);
}

.password-submit:active {
  background-color: rgba(0, 0, 0, 0.2);
}

.password-submit svg {
  width: 20px;
  height: 20px;
  stroke: #5a5a5b;
}

/* Password Wrapper & Error */
.password-wrapper {
  position: relative;
  max-width: 700px;
  margin: 0 auto 37px;
}

.password-wrapper .password-input-container {
  margin: 0;
}

.password-error {
  color: #d93025;
  font-size: 14px;
  margin-top: 8px;
  text-align: left;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.password-error.visible {
  visibility: visible;
  opacity: 1;
}

.password-input-container.error {
  border-color: #d93025;
  border-width: 2px;
}

.password-input-container.loading .password-submit svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Navigation Section */
.nav-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Game Preview */
.game-preview {
  position: relative;
  cursor: pointer;
  margin: 12px auto 37px;
  width: 94%;
  max-width: 800px;
  border-radius: 16px;
  overflow: hidden;
  padding: 50px 0;
  background: linear-gradient(180deg, #331350 0%, #512a5a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.12);
}

.game-preview-title {
  color: white;
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 24px;
  transition: transform 0.2s ease;
}

.game-preview img {
  display: block;
  width: 100%;
  max-width: 600px;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  transition: transform 0.2s ease;
}

.game-preview:hover .game-preview-title,
.game-preview:hover img {
  transform: scale(1.05);
}

.game-preview-mobile {
  display: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  text-align: center;
  font-weight: 600;
}

/* Game Modal */
.game-modal {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    background 0.3s ease,
    visibility 0.3s;
}

.game-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.9);
}

.game-modal-content {
  position: relative;
  width: 96%;
  height: 95%;
  border-radius: 12px;
  overflow: hidden;
  cursor: default;
  transform: scale(0.95);
  opacity: 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.game-modal.is-open .game-modal-content {
  transform: scale(1);
  opacity: 1;
}

.game-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 10;
  opacity: 0.7;
  transition:
    opacity 0.2s ease,
    background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-modal-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.7);
}

.game-modal-content iframe {
  width: 100%;
  height: 100%;
  max-width: none;
  border: none;
  border-radius: 0;
  margin: 0;
  padding: 0;
  display: block;
  aspect-ratio: auto;
  box-shadow: none;
}

/* ==========================================================================
   Media Queries
   ========================================================================== */

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1c1c1e;
  }
  main {
    color: #9898a0;
  }
  main section .highlight,
  main h1,
  main h2,
  main h3,
  main h4 {
    color: #dfdfdf;
  }
  main ul li {
    color: #9898a0;
  }
  ul li .project-sub-header {
    color: #8e8e8f;
  }
  main ul li a,
  main section a {
    color: #dfdfdf;
  }
  main ul li a:hover,
  main section a:hover,
  main section .highlight:hover {
    text-decoration-color: #8e8e8f;
  }
  main img,
  main video,
  main iframe {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }

  /* Password Input - Dark */
  .password-input-container {
    border-color: rgba(255, 255, 255, 0.3);
  }
  .password-input-container:hover {
    border-color: rgba(255, 255, 255, 0.45);
  }
  .password-input-container:focus-within {
    border-color: #dfdfdf;
  }
  .password-input {
    color: #dfdfdf;
  }
  .password-input::placeholder {
    color: #a8a8b0;
    opacity: 0.85;
  }
  .password-submit {
    background-color: rgba(255, 255, 255, 0.15);
  }
  .password-submit:hover {
    background-color: rgba(255, 255, 255, 0.2);
  }
  .password-submit:active {
    background-color: rgba(255, 255, 255, 0.25);
  }
  .password-submit svg {
    stroke: #dfdfdf;
  }

  /* Password Error - Dark */
  .password-input-container.error {
    border-color: #f28b82;
  }
  .password-error {
    color: #f28b82;
  }

  /* Game Preview - Dark */
  .game-preview {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }
  .game-preview:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  }
}

/* Mobile (max-width: 720px) */
@media screen and (max-width: 720px) {
  main {
    margin: 48px 24px 64px 24px;
  }
  main img,
  main video,
  main iframe {
    width: 100%;
    margin: 12px auto 37px;
  }
  main section .highlight:hover {
    text-decoration: none;
    text-underline-offset: 0px;
    text-decoration-thickness: 0px;
  }

  /* Game Preview - Mobile */
  .game-preview {
    width: 100%;
    cursor: default;
    pointer-events: none;
    min-height: 200px;
    justify-content: center;
  }
  .game-preview-title,
  .game-preview img {
    display: none;
  }
  .game-preview-mobile {
    display: block;
  }
}
