:root {
  --page-pad: clamp(8px, 2vmin, 24px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  display: grid;
  place-items: center;
  padding: var(--page-pad);
  overflow: hidden;
  background: #1f1c18;
}

.stage {
  position: relative;
  width: min(100%, calc((100dvh - 2 * var(--page-pad)) * 16 / 9));
  max-height: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  touch-action: none;
  container-type: size;
}

@supports not (height: 100dvh) {
  .stage {
    width: min(100%, calc((100vh - 2 * var(--page-pad)) * 16 / 9));
  }
}

.layer {
  position: absolute;
  display: block;
}

.layer--bg {
  left: -0.01%;
  top: 0.45%;
  width: 100%;
  height: 98.45%;
  object-fit: cover;
}

.layer--char {
  left: 5.7%;
  top: 7.77%;
  width: 92.28%;
  height: 92.28%;
  background-image: url("final/char-atlas.webp");
  background-repeat: no-repeat;
}

.layer--text {
  left: 2.33%;
  top: -16.87%;
  width: 99.69%;
  height: 100%;
  background-image: url("final/text-atlas.webp");
  background-repeat: no-repeat;
  transition: opacity 0.8s ease;
}

.layer--text.is-faded {
  opacity: 0;
}

.enter {
  position: absolute;
  left: 35.31%;
  top: 74.19%;
  width: 29.69%;
  height: 29.69%;
  transform-origin: center;
  cursor: pointer;
  transition: opacity 0.6s ease;
  animation: enterBreath 2.6s ease-in-out infinite;
}

.enter.is-faded {
  opacity: 0;
  pointer-events: none;
}

.enter__img {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.22s ease, filter 0.22s ease;
}

.enter:hover .enter__img {
  transform: scale(1.08);
  filter: brightness(1.06) drop-shadow(0 6px 16px rgba(0, 0, 0, 0.18));
}

.enter:active .enter__img {
  transform: scale(0.96);
  filter: brightness(0.96);
}

@keyframes enterBreath {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

.menu {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease 0.4s;
}

.menu.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.menu__btn {
  position: absolute;
  display: block;
  cursor: pointer;
  transform-origin: center;
  animation: menuBreath 2.6s ease-in-out infinite;
}

.menu__btn-img {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.22s ease, filter 0.22s ease;
}

.menu__btn:hover .menu__btn-img {
  transform: scale(1.08);
  filter: brightness(1.06) drop-shadow(0 6px 16px rgba(0, 0, 0, 0.18));
}

.menu__btn:active .menu__btn-img {
  transform: scale(0.96);
  filter: brightness(0.96);
}

@keyframes menuBreath {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.menu__btn--resume {
  left: 13.63%;
  top: 19.45%;
  width: 15.06%;
  height: 26.78%;
}

.menu__btn--demo {
  left: 17.85%;
  top: 58.17%;
  width: 15.25%;
  height: 27.11%;
}

.menu__btn--photography {
  left: 43.34%;
  top: 83.13%;
  width: 10.47%;
  height: 18.62%;
  animation-name: menuBreathPhoto;
}

@keyframes menuBreathPhoto {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

.menu__btn-caption {
  position: absolute;
  top: calc(100% + 0.5cqw);
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.25cqw;
  line-height: 1.2;
  color: #2b2921;
  white-space: nowrap;
  pointer-events: none;
}

.menu__btn-caption::after {
  content: "";
  display: block;
  width: 100%;
  margin-top: 0.2cqw;
  border-bottom: 1.5px dashed rgba(43, 41, 33, 0.55);
}

.menu__btn--photography .menu__btn-caption {
  top: auto;
  bottom: calc(100% + 0.45cqw);
}

.menu__btn--demo .menu__btn-caption {
  top: auto;
  bottom: calc(100% + 0.45cqw);
}

@keyframes menuBreathStrong {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

@keyframes menuBreathPhotoStrong {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.13);
  }
}

@media (pointer: coarse) {
  .menu__btn {
    animation-name: menuBreathStrong;
  }

  .menu__btn--photography {
    animation-name: menuBreathPhotoStrong;
  }
}

.target {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
}

.target.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.transition {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 21;
}

.transition.is-playing {
  opacity: 1;
  pointer-events: auto;
}

.transition__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  visibility: hidden;
  will-change: opacity;
}

.transition__video.is-active {
  visibility: visible;
}

.hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 14px;
  border-radius: 6px;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  font: 600 14px/1.2 "Segoe UI", system-ui, sans-serif;
  transition: opacity 0.4s ease;
  z-index: 10;
}

.hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.top-hints {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 20px);
  pointer-events: none;
}

.rotate-hint {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(20, 24, 22, 0.72);
  color: #f2f4ef;
  text-align: center;
  pointer-events: none;
}

.rotate-hint.is-visible {
  display: flex;
}

.rotate-hint__icon {
  font-size: 16px;
  line-height: 1;
  animation: rotateHintSpin 2.4s ease-in-out infinite;
}

.rotate-hint__text {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.03em;
}

@keyframes rotateHintSpin {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(90deg);
  }
}

.desktop-hint {
  position: relative;
  transform: rotate(-2deg);
  display: none;
  padding: 8px 18px;
  border: 2px solid #2b2921;
  border-radius: 2px;
  background: #fff8ea;
  color: #2b2921;
  font-size: clamp(15px, 4.2vw, 19px);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.24);
  pointer-events: none;
}

.desktop-hint::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 38px;
  height: 13px;
  transform: translateX(-50%) rotate(-4deg);
  background: rgba(226, 106, 44, 0.72);
}

.desktop-hint.is-visible {
  display: block;
}

.swipe-hint {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 9000;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(20, 24, 22, 0.72);
  color: #f2f4ef;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.swipe-hint.is-visible {
  display: flex;
}

.swipe-hint.is-faded {
  opacity: 0;
}

.swipe-hint__track {
  position: relative;
  width: 44px;
  height: 14px;
}

.swipe-hint__track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0;
  border-top: 1.5px dashed rgba(255, 255, 255, 0.55);
}

.swipe-hint__finger {
  position: absolute;
  top: -8px;
  left: 0;
  font-size: 16px;
  line-height: 1;
  animation: swipeFinger 1.7s ease-in-out infinite;
}

.swipe-hint__text {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.03em;
}

@keyframes swipeFinger {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(28px);
  }
}
