:root {
  font-family: Georgia, "Times New Roman", serif;
  background: #f6efe5;
  color: #3f372d;
}

* { box-sizing: border-box; }

html, body, .experience { min-height: 100%; margin: 0; }

body { min-height: 100vh; overflow: hidden; }

.experience { position: relative; min-height: 100vh; background: #f6efe5; }

.screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  isolation: isolate;
  transition: opacity 700ms cubic-bezier(.3, .75, .3, 1);
}

.screen.is-active { opacity: 1; pointer-events: auto; }

.reference-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  user-select: none;
}

.enter-space, .home-hit, .share-hit {
  position: absolute;
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.enter-space { left: 41%; top: 58%; width: 18%; height: 7%; border-radius: 999px; }
.home-hit { left: 34.5%; top: 4%; width: 8%; height: 5.5%; border-radius: 999px; }
.share-hit { left: 53.5%; top: 76.5%; width: 7.7%; height: 4.5%; border-radius: 999px; }

.enter-space:focus-visible, .home-hit:focus-visible, .share-hit:focus-visible, .thought-input:focus-visible {
  outline: 3px solid #d6865e;
  outline-offset: 4px;
}

.thought-input {
  position: absolute;
  left: 37.1%;
  top: 72.1%;
  width: 23.5%;
  height: 4%;
  resize: none;
  border: 0;
  border-radius: 12px;
  padding: .7rem .85rem;
  background: rgb(255 255 255 / 12%);
  color: #3f372d;
  font: 500 1rem/1.2 system-ui, sans-serif;
}

.visit-response { position: absolute; left: 37%; top: 61.5%; width: 25%; padding: .8rem 1rem; border-radius: 18px; background: rgb(255 252 245 / 88%); box-shadow: 0 10px 28px rgb(71 53 35 / 12%); font-family: system-ui, sans-serif; }
.visit-response p { margin: 0; }
.visit-speaker { color: #7b8667; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.visit-dialogue { margin-top: .25rem !important; font-size: .9rem; line-height: 1.4; }
.visit-choices { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.visit-choices button { border: 1px solid rgb(104 121 85 / 32%); border-radius: 999px; background: #fffaf2; color: #526044; padding: .28rem .58rem; cursor: pointer; }

.ambient-light {
  position: absolute;
  inset: 14% 13% 8%;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, rgb(255 240 195 / 13%), transparent 46%);
  mix-blend-mode: screen;
  animation: light-drift 13s ease-in-out infinite alternate;
}

.ambient-field, .recognition-cue { position: absolute; inset: 0; pointer-events: none; z-index: 2; }

.mote {
  position: absolute;
  width: .38rem;
  height: .38rem;
  border-radius: 50%;
  background: rgb(255 245 207 / 65%);
  box-shadow: 0 0 14px rgb(255 238 183 / 50%);
}
.mote-a { left: 28%; top: 48%; animation: float-a 12s ease-in-out infinite; }
.mote-b { left: 66%; top: 39%; animation: float-b 16s ease-in-out infinite; }
.mote-c { left: 74%; top: 66%; animation: float-c 14s ease-in-out infinite; }
.mote-d { left: 17%; top: 70%; animation: float-b 18s ease-in-out -5s infinite; }

.recognition-cue {
  inset: auto;
  left: 35.5%;
  top: 37%;
  width: 10%;
  height: 20%;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(ellipse, rgb(255 241 195 / 32%) 0%, rgb(255 231 164 / 12%) 43%, transparent 70%);
  mix-blend-mode: screen;
  transition: opacity 280ms ease;
}

.scene-screen.is-noticing .recognition-cue { opacity: .38; }
.scene-screen.is-recognized .recognition-cue { opacity: .6; animation: recognition-settle 1.8s ease-out both; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes light-drift { from { opacity: .45; } to { opacity: .82; } }
@keyframes float-a { 0%, 100% { transform: translate(0, 0); opacity: .2; } 53% { transform: translate(2vw, -1.5vh); opacity: .7; } }
@keyframes float-b { 0%, 100% { transform: translate(0, 0); opacity: .18; } 48% { transform: translate(-1.4vw, -2vh); opacity: .58; } }
@keyframes float-c { 0%, 100% { transform: translate(0, 0); opacity: .15; } 62% { transform: translate(1vw, 1.2vh); opacity: .55; } }
@keyframes recognition-settle { 0% { opacity: .75; } 100% { opacity: .6; } }

@media (max-aspect-ratio: 4 / 3) {
  .reference-art { object-fit: cover; }
}

@media (prefers-reduced-motion: reduce) {
  .screen { transition-duration: 1ms; }
  .ambient-light, .ambient-field, .recognition-cue { display: none; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
