.hero--stays {
  --stays-background: url("../assets/hero-spontaneous-arrival-v3.png");
  --stays-ink: #11110f;
  --stays-paper: #f6f0e5;
  --stays-accent: #ff4e2f;
  min-height: 100dvh;
  background: var(--stays-paper);
  color: var(--stays-ink);
}

.stays-backdrop {
  position: absolute;
  z-index: -4;
  inset: 0;
  background-image: var(--stays-background);
  background-position: center 45%;
  background-size: cover;
  filter: saturate(1.08) brightness(1.08);
  animation: image-arrival 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero--stays .hero__wash {
  background:
    linear-gradient(
      90deg,
      rgba(246, 240, 229, 0.99) 0%,
      rgba(246, 240, 229, 0.96) 32%,
      rgba(246, 240, 229, 0.68) 49%,
      rgba(246, 240, 229, 0.18) 72%,
      rgba(255, 227, 146, 0.08) 100%
    ),
    linear-gradient(0deg, rgba(255, 244, 213, 0.28), rgba(255, 255, 255, 0.04));
}

.hero--stays .hero__grain {
  z-index: 12;
  opacity: 0.035;
}

.hero--stays .nav {
  color: var(--stays-ink);
  border-color: rgba(17, 17, 15, 0.24);
}

.hero--stays .wordmark__number {
  background: var(--stays-ink);
  color: var(--stays-paper);
}

.hero--stays .nav__cta::after {
  background: var(--stays-ink);
}

.hero--stays .nav__cta {
  padding: 10px 12px;
  background: rgba(246, 240, 229, 0.78);
  backdrop-filter: blur(10px);
}

.hero--stays .nav__cta::after {
  right: 12px;
  bottom: 7px;
  left: 12px;
}

.stays-layout {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(100% - 64px, 1480px);
  min-height: calc(100dvh - 76px);
  grid-template-columns: minmax(0, 0.9fr) minmax(520px, 1.1fr);
  align-items: center;
  margin: 0 auto;
}

.hero--stays .hero__content {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 1rem 0 4rem;
}

.hero--stays h1 {
  max-width: 11.6ch;
  color: var(--stays-ink);
  font-size: clamp(3.6rem, 5.25vw, 6.3rem);
  line-height: 0.88;
}

.hero--stays .hero__content p {
  max-width: 48ch;
  color: rgba(17, 17, 15, 0.67);
}

.hero--stays .hero__cta {
  background: var(--stays-accent);
  color: #fff;
}

.hero--stays .hero__cta:hover {
  background: #e93c20;
}

.stays-demo {
  position: relative;
  align-self: stretch;
  min-height: 620px;
}

.stays-demo__canvas {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 24%;
  width: clamp(1404px, 94vw, 1781px);
  aspect-ratio: 1672 / 941;
  transform: translate(-50%, -50%);
  animation: phone-arrival 1s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.demo-handset {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.demo-screen {
  position: absolute;
  z-index: 1;
  top: 11.9%;
  left: 51.98%;
  width: 17.52%;
  height: 69.62%;
  overflow: hidden;
  border-radius: 10.5% / 4.6%;
  background: #f6f3ed;
  box-shadow: 0 18px 42px rgba(52, 32, 19, 0.28);
  overscroll-behavior: contain;
  touch-action: none;
}

.demo-screen[data-demo-scrollable="true"] {
  cursor: grab;
}

.demo-screen[data-demo-scrollable="true"]:active {
  cursor: grabbing;
}

.demo-screen__image {
  position: absolute;
  top: -5.8%;
  left: -21.4%;
  width: 144.4%;
  height: 112.55%;
  max-width: none;
  object-fit: fill;
  opacity: 1;
  transform: translate3d(0, var(--demo-scroll-y, 0px), 0);
  transition: opacity 150ms ease, transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-screen[data-demo-scrollable="true"] .demo-screen__image {
  top: -5%;
  left: -22%;
  width: 150%;
  height: 120%;
  transition: opacity 150ms ease;
}

.demo-screen__image.is-changing {
  opacity: 0;
  transform: translate3d(4%, var(--demo-scroll-y, 0px), 0);
}

.demo-scroll-cue {
  position: absolute;
  z-index: 5;
  right: 50%;
  bottom: 3.5%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  background: rgba(17, 17, 15, 0.86);
  color: #fff;
  font-size: 0.52rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: translateX(50%);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.demo-scroll-cue i {
  font-size: 0.75rem;
  font-style: normal;
}

.demo-scroll-cue.is-used {
  opacity: 0;
  transform: translate(50%, 5px);
}

.demo-scroll-cue[hidden] { display: none; }

.demo-loading {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 13px;
  padding: 24px;
  background: rgba(246, 243, 237, 0.94);
  color: #11110f;
  opacity: 0;
  text-align: center;
  transition: opacity 180ms ease;
}

.demo-loading.is-visible { opacity: 1; }
.demo-loading[hidden] { display: none; }

.demo-loading > span {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(17, 17, 15, 0.14);
  border-top-color: #1248d8;
  border-radius: 50%;
  animation: demo-spin 720ms linear infinite;
}

.demo-loading p {
  max-width: 170px;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.25;
}

.demo-hotspot {
  position: absolute;
  z-index: 4;
  top: var(--top, 79.5%);
  left: var(--left, 8.2%);
  width: var(--width, 84.5%);
  height: var(--height, 6.4%);
  padding: 0;
  border: 3px solid rgba(255, 255, 255, 0.98);
  border-radius: 8px;
  background: rgba(29, 106, 255, 0.12);
  box-shadow:
    0 0 0 3px rgba(29, 106, 255, 0.96),
    0 0 0 7px rgba(255, 255, 255, 0.76),
    0 0 22px 9px rgba(29, 106, 255, 0.52);
  cursor: pointer;
  transform: translateY(var(--demo-scroll-y, 0px));
  animation: pulse 1.15s cubic-bezier(0.22, 0.75, 0.28, 1) infinite;
  will-change: box-shadow, border-color, background-color;
}

.demo-hotspot[hidden],
.demo-back-hotspot[hidden] { display: none; }

.demo-back-hotspot {
  position: absolute;
  z-index: 5;
  top: 6.2%;
  left: 2.8%;
  width: 12%;
  height: 7%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.demo-guide {
  position: absolute;
  z-index: 6;
  right: 0;
  bottom: clamp(24px, 5vh, 54px);
  display: grid;
  width: min(230px, 28vw);
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: end;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(17, 17, 15, 0.16);
  background: rgba(246, 240, 229, 0.88);
  color: var(--stays-ink);
  backdrop-filter: blur(12px);
}

.demo-guide__progress span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.demo-guide__progress > div {
  height: 2px;
  overflow: hidden;
  background: rgba(17, 17, 15, 0.16);
}

.demo-guide__progress i {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--stays-ink);
  transition: width 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-guide > p {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
}

.demo-guide > button {
  grid-column: 2;
  justify-self: start;
  padding: 7px 10px;
  border: 0;
  background: var(--stays-ink);
  color: #fff;
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 800;
}

.demo-guide > button[hidden] { display: none; }

.demo-hotspot:focus-visible,
.demo-back-hotspot:focus-visible,
.demo-guide button:focus-visible {
  outline: 3px solid var(--stays-accent);
  outline-offset: 3px;
}

@keyframes phone-arrival {
  from { opacity: 0; transform: translate(-47%, -44%) rotate(2deg); }
  to { opacity: 1; transform: translate(-50%, -50%) rotate(0); }
}

@keyframes demo-spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% {
    border-color: rgba(255, 255, 255, 0.98);
    background: rgba(29, 106, 255, 0.12);
    box-shadow:
      0 0 0 3px rgba(29, 106, 255, 0.96),
      0 0 0 7px rgba(255, 255, 255, 0.76),
      0 0 22px 9px rgba(29, 106, 255, 0.52);
  }
  55% {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    box-shadow:
      0 0 0 3px rgba(29, 106, 255, 0.96),
      0 0 0 15px rgba(29, 106, 255, 0),
      0 0 34px 16px rgba(29, 106, 255, 0.22);
  }
}

@media (max-width: 1100px) {
  .stays-layout {
    grid-template-columns: minmax(0, 0.9fr) minmax(430px, 1.1fr);
  }

  .stays-demo__canvas {
    left: 35%;
    width: 1120px;
  }
}

@media (max-width: 767px) {
  .hero--stays {
    min-height: 980px;
  }

  .hero--stays .hero__wash {
    background:
      linear-gradient(180deg, rgba(246, 240, 229, 0.99) 0%, rgba(246, 240, 229, 0.94) 43%, rgba(246, 240, 229, 0.48) 72%, rgba(246, 240, 229, 0.12) 100%),
      rgba(255, 238, 188, 0.12);
  }

  .stays-backdrop {
    background-position: 42% center;
  }

  .stays-layout {
    display: block;
    width: calc(100% - 40px);
    min-height: 912px;
  }

  .hero--stays .hero__content {
    position: relative;
    z-index: 7;
    display: block;
    min-height: 0;
    padding: 68px 0 0;
  }

  .hero--stays h1 {
    max-width: 12ch;
    font-size: clamp(2.65rem, 12vw, 4.3rem);
  }

  .hero--stays .hero__content p {
    max-width: 34ch;
    margin-top: 20px;
  }

  .hero--stays .hero__cta {
    width: auto;
    margin-top: 22px;
  }

  .stays-demo {
    height: 540px;
    min-height: 0;
    margin-top: -8px;
  }

  .stays-demo__canvas {
    top: 50%;
    left: 50%;
    width: 1000px;
    transform: translate(-58%, -50%);
  }

  .demo-guide {
    right: 0;
    bottom: 18px;
    width: 188px;
    grid-template-columns: 52px minmax(0, 1fr);
  }

  @keyframes phone-arrival {
    from { opacity: 0; transform: translate(-55%, -44%) rotate(2deg); }
    to { opacity: 1; transform: translate(-58%, -50%) rotate(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
