/* Reset & base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
}
body {
  font-family: Arial, sans-serif;
}
/* Stage fills viewport */
.stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}
/* Background — clean starfield + moon surface */
.bg {
  position: absolute;
  inset: 0;
  background-image: url("image/contact-bg.jpg");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 0;
}
/* Moon (now a sibling element, not baked into bg) */
.moonmeteor {
  position: absolute;
  top: 8%;
  left: 42%;
  width: 11%;
  aspect-ratio: 1 / 1;
  background: url("image/meteor.png") no-repeat center center;
  background-size: contain;
  z-index: 3;
  transition: transform 0.7s ease-in-out;
  cursor: pointer;
}
.moonmeteor:hover,
.moonmeteor:active {
  transform: rotate(360deg);
}
/* Mailbox — sits on the moon's horizon, behind the letter */
.mailbox {
  position: absolute;
  top: 20%;
  left: 58%;
  width: 17.6%;
  z-index: 8;
  user-select: none;
  -webkit-user-drag: none;
}
/* CONTACT title (top-left) */
.title {
  position: absolute;
  top: 8%;
  left: 4%;
  width: 13.7%;
  z-index: 10;
  pointer-events: none;
  user-select: none;
}
/* Foreground letter — the hero element, overlapping the mailbox */
.letter {
  position: absolute;
  bottom: -4%;
  left: 14%;
  width: 40%;
  z-index: 15;
  user-select: none;
  -webkit-user-drag: none;
}
/* Social media (bottom-right corner on desktop) */
.social-media {
  position: absolute;
  bottom: 3%;
  right: 3%;
  display: flex;
  gap: 20px;
  z-index: 20;
}
.social-media img {
  width: 120px;
  height: 120px;
  cursor: pointer;
  transition: transform 0.3s;
}
.social-media img:hover,
.social-media img:active {
  transform: scale(1.1);
}
/* ================= MENU SYSTEM ================= */
#menu-toggle {
  display: none;
}
.toggle-button {
  position: fixed;
  top: 20px;
  right: 2%;
  width: 150px;
  height: 150px;
  cursor: pointer;
  z-index: 200;
}
.toggle-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s;
}
.toggle-button img:hover,
.toggle-button img:active {
  transform: rotate(40deg) scale(1.2);
}
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0);
  z-index: 190;
  pointer-events: none;
  transition: background-color 0.5s ease;
}
#menu-toggle:checked ~ .overlay {
  background-color: rgba(0, 0, 0, 0.5);
  pointer-events: all;
}
.menu-item {
  position: fixed;
  transform: scale(0);
  opacity: 0;
  transition:
    transform 0.5s ease,
    opacity 0.5s ease;
  z-index: 195;
}
.menu-item img {
  width: 380px;
  height: 380px;
  cursor: pointer;
  transition: transform 0.3s;
  display: block;
}
.menu-item img:hover,
.menu-item img:active {
  transform: rotate(10deg) scale(1.1);
}
#home {
  top: 50vh;
  left: 40vw;
}
#about {
  top: 30vh;
  left: 15vw;
}
#portfolio {
  top: 5vh;
  left: 35vw;
}
#contact {
  top: 20vh;
  left: 55vw;
}
#menu-toggle:checked ~ .menu-item {
  opacity: 1;
  transform: scale(1);
}
/* Volume button (bottom-left) */
#volumeButton {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 100px;
  height: auto;
  cursor: pointer;
  z-index: 100;
  transition: transform 0.3s;
}
#volumeButton:hover,
#volumeButton:active {
  transform: rotate(20deg) scale(1.2);
}

/* ================= MOBILE ================= */

@media (max-width: 768px) {
  /* Mobile-specific background */
  .bg {
    background-image: url("image/contact-bg-mobile.png");
  }

  /* CONTACT title — top-left, 108/390 = 27.69vw */
  .title {
    top: 4%;
    left: 5%;
    width: 27.69vw;
  }

  /* Moon — below the title on the left, 97/390 = 24.87vw */
  .moonmeteor {
    top: 13%;
    left: 13%;
    width: 24.87vw;
    aspect-ratio: 1 / 1;
  }

  /* Mailbox — middle-right, 169/390 = 43.33vw */
  .mailbox {
    top: 17%;
    left: 48%;
    width: 43.33vw;
  }

  /* Letter — HUGE, bleeds off both sides, 469/390 = 120.26vw */
  .letter {
    bottom: 0;
    left: 53%;
    transform: translateX(-50%);
    width: 120.26vw;
    aspect-ratio: 107 / 94;
    height: auto;
  }

  /* Social media — sitting ON the paper, below the email text */
  .social-media {
    bottom: 20%;
    left: 46%;
    right: auto;
    transform: translateX(-50%);
    gap: 14px;
  }
  .social-media img {
    width: 42px;
    height: 42px;
    transform: rotate(-20deg); /* matches the slanted letter text */
  }
  .social-media img:hover,
  .social-media img:active {
    transform: rotate(-20deg) scale(1.15);
  }

  /* Individual placement — upward slope from left to right */
  .social-media a:nth-child(1) {
    position: relative;
    top: 14px;
  } /* Instagram — lowest */
  .social-media a:nth-child(2) {
    position: relative;
    top: -3px;
  } /* Behance — middle */
  .social-media a:nth-child(3) {
    position: relative;
    top: -18px;
  } /* LinkedIn — highest */

  /* Menu — matched to aboutme.css mobile setup */
  .toggle-button {
    top: 3%;
    right: 4%;
    width: 20vw;
    height: 20vw;
    max-width: 120px;
    max-height: 120px;
    min-width: 70px;
    min-height: 70px;
  }

  .menu-item img {
    width: 53vw;
    aspect-ratio: 9 / 10;
    height: auto;
    max-width: 380px;
    max-height: 422px;
  }

  #portfolio {
    top: 10vh;
    left: 40vw;
  }
  #about {
    top: 26vh;
    left: 4vw;
  }
  #contact {
    top: 35vh;
    left: 43vw;
  }
  #home {
    top: 53vh;
    left: 20vw;
  }

  /* Volume button — bottom-left, shrunk for mobile */
  #volumeButton {
    bottom: 4%;
    left: 4%;
    width: 70px;
  }
}
