:root {
  color-scheme: light;
  --ink: #312720;
  --paper: #f2e8d6;
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: "Times New Roman", Times, serif;
}

.landing {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100vw, 208.333vh);
  height: max(48vw, 100vh);
  overflow: hidden;
  container-type: inline-size;
  background: var(--paper) url("assets/paper-base.png") center / 100% 100% no-repeat;
  transform: translate(-50%, -50%);
}

.headline,
.masterplan {
  position: absolute;
  display: block;
  max-width: none;
}

.headline {
  top: 2.604%;
  left: 21.05%;
  width: 21.35%;
  height: auto;
  animation: headline-cycle 20s ease-in-out infinite;
  transform-origin: left center;
  will-change: opacity, transform;
}

.masterplan {
  top: 15%;
  left: 21.05%;
  width: 76.3%;
  height: 81.667%;
  object-fit: fill;
  animation: masterplan-cycle 20s ease-in-out infinite;
  transform-origin: center center;
  will-change: opacity, transform, clip-path;
}

.amenities {
  position: absolute;
  z-index: 1;
  top: 15.1%;
  left: 3%;
  width: 14.6%;
  font-size: 0.84cqw;
  line-height: 1.34;
  animation: amenities-cycle 20s ease-in-out infinite;
  will-change: opacity, transform;
}

.amenities h2 {
  margin: 0 0 0.22em;
  font-size: 1.45em;
  font-weight: 400;
  line-height: 1.1;
}

.amenities h2:nth-of-type(2) {
  margin-top: 0.78em;
}

.amenities ol {
  margin: 0;
  padding-left: 2.08em;
}

.amenities li {
  padding-left: 0.35em;
  white-space: nowrap;
}

.amenities li span {
  display: block;
  margin-left: 0.08em;
  font-style: italic;
  text-transform: none;
}

/* 10 giây chuyển động + 10 giây đứng yên, tổng chu kỳ 20 giây. */
@keyframes headline-cycle {
  0% {
    opacity: 0;
    transform: translateY(-18%) scale(0.98);
  }
  8%,
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes amenities-cycle {
  0%,
  4% {
    opacity: 0;
    transform: translateX(-8%);
  }
  20%,
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes masterplan-cycle {
  0%,
  7% {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: scale(1.035);
  }
  27% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: scale(1.018);
  }
  50%,
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  html,
  body {
    height: auto;
    min-height: 100%;
  }

  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .landing {
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  .stage {
    position: relative;
    top: auto;
    left: auto;
    display: flex;
    width: 100%;
    height: auto;
    min-height: 100svh;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 0 2rem;
    overflow: visible;
    background-size: auto 100%;
    transform: none;
  }

  .headline,
  .masterplan,
  .amenities {
    position: relative;
    top: auto;
    left: auto;
  }

  .headline {
    order: 1;
    width: min(88%, 427px);
    margin: 0 auto 0.25rem;
  }

  .masterplan {
    order: 2;
    width: calc(100% - 1.5rem);
    height: auto;
    aspect-ratio: 1406 / 784;
    margin: 0 auto;
    object-fit: contain;
  }

  .amenities {
    order: 3;
    width: calc(100% - 3rem);
    margin: 0 auto;
    padding: 1.25rem 1.25rem 1.5rem;
    border: 1px solid rgb(49 39 32 / 18%);
    border-radius: 0.25rem;
    background: rgb(242 232 214 / 72%);
    box-shadow: 0 0.75rem 2.5rem rgb(72 50 32 / 8%);
    font-size: 1rem;
    line-height: 1.5;
    backdrop-filter: blur(3px);
  }

  .amenities h2 {
    font-size: 1.35rem;
  }

  .amenities ol {
    padding-left: 2rem;
  }

  .amenities li {
    padding-left: 0.2rem;
    white-space: normal;
  }
}

@media (max-width: 390px) {
  .stage {
    padding-top: 1rem;
  }

  .amenities {
    width: calc(100% - 2rem);
    padding: 1rem;
    font-size: 0.94rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .headline,
  .amenities,
  .masterplan {
    animation: none;
  }
}
