:root {
  --cream: #f4ead8;
  --night: #17130f;
  --ember: #d96c48;
  --moss: #88916b;
  --evening: #8293a7;
  --room-x: 0px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
html { background: var(--night); }
body {
  margin: 0;
  overflow: hidden;
  color: var(--cream);
  background: var(--night);
  font-family: "Segoe UI", Aptos, Arial, sans-serif;
}
button, input, textarea, select { font: inherit; }
button, a { color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.world-skip {
  position: fixed;
  left: 16px;
  top: 10px;
  z-index: 100;
  transform: translateY(-150%);
  padding: .45rem .7rem;
  color: var(--night);
  background: var(--cream);
}
.world-skip:focus { transform: none; }

.world-app,
.room-viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.room-viewport::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10,8,6,.28), transparent 14%, transparent 84%, rgba(10,8,6,.32)),
    linear-gradient(0deg, rgba(10,8,6,.82), transparent 35%, rgba(10,8,6,.18));
}

.room-world {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  width: max(2100px, 273.48vh);
  height: 100vh;
  transform: translate3d(var(--room-x), 0, 0);
  will-change: transform;
  touch-action: none;
  user-select: none;
}
.room-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.object-door {
  position: absolute;
  z-index: 4;
  border: 0;
  padding: 0;
  color: #fff7e7;
  background: transparent;
  font-size: clamp(13px, 1.3vw, 19px);
  font-weight: 800;
  letter-spacing: .08em;
  text-align: left;
  text-shadow: 0 2px 12px rgba(0,0,0,.9), 0 0 3px #000;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
}
.object-door::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 52%;
  width: 11px;
  height: 2px;
  background: currentColor;
  box-shadow: -4px -4px 0 -1px currentColor, -4px 4px 0 -1px currentColor;
}
.object-door span {
  display: block;
  margin-bottom: .18rem;
  color: var(--ember);
  font-size: .62em;
  letter-spacing: .12em;
}
.object-door:hover,
.object-door:focus-visible,
.object-door[aria-current="true"] {
  color: #ffd6bb;
  outline: none;
  transform: translate(-50%, -50%) scale(1.08);
}
.door-time { left: 5%; top: 13%; }
.door-cost { left: 13%; top: 79%; }
.door-device { left: 25%; top: 75%; }
.door-people { left: 48%; top: 39%; }
.door-access { left: 68%; top: 40%; }
.door-language { left: 91%; top: 34%; }

.world-signature {
  position: fixed;
  left: 18px;
  top: 50%;
  z-index: 7;
  margin: 0;
  color: rgba(255,247,231,.78);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: translateY(-50%) rotate(180deg);
  text-shadow: 0 1px 8px #000;
}
.world-signature b { color: white; }

.world-utterance {
  position: fixed;
  left: clamp(54px, 8vw, 130px);
  bottom: clamp(54px, 8vh, 105px);
  z-index: 8;
  width: min(660px, 62vw);
  text-shadow: 0 2px 14px #000, 0 1px 3px #000;
}
.world-utterance small {
  color: #ffd4b6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.world-utterance > p {
  margin: .45rem 0 1rem;
  font-size: clamp(22px, 2.7vw, 38px);
  font-weight: 500;
  line-height: 1.13;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.utterance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.4rem;
}
.utterance-actions button,
.world-exit,
.world-text,
.exit-world button,
.text-world > button,
.text-world button,
.text-world input[type="submit"] {
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  padding: .18rem 0;
  color: #fff0dd;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
}

.world-instruction {
  position: fixed;
  left: clamp(54px, 8vw, 130px);
  top: 22px;
  z-index: 7;
  margin: 0;
  color: rgba(255,247,231,.72);
  font-size: 10px;
  letter-spacing: .09em;
  text-shadow: 0 1px 7px #000;
  text-transform: uppercase;
}
.world-exit,
.world-text {
  position: fixed;
  top: 20px;
  z-index: 8;
  text-shadow: 0 1px 8px #000;
}
.world-exit { right: 24px; }
.world-text { right: 103px; }

.memory-flash {
  position: fixed;
  inset: 0;
  z-index: 15;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: #100e0c;
  transition: none;
}
.memory-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(11,9,7,.82), transparent 55%);
}
.memory-flash img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.72) contrast(1.06);
  transform: scale(1.025);
  transition: none;
}
.memory-flash p {
  position: absolute;
  left: clamp(26px, 8vw, 130px);
  bottom: clamp(38px, 8vh, 100px);
  z-index: 2;
  width: min(58ch, calc(100% - 52px));
  margin: 0;
  color: white;
  font-size: clamp(18px, 2vw, 29px);
  line-height: 1.25;
  text-shadow: 0 2px 12px #000;
}
.memory-flash.visible {
  opacity: 1;
  visibility: visible;
  transition: none;
}
.memory-flash.visible img { transform: scale(1); }

dialog {
  color: inherit;
}
.exit-world,
.text-world {
  border: 0;
  margin: 0;
  max-width: none;
  max-height: none;
}
.exit-world::backdrop,
.text-world::backdrop { background: rgba(10,8,6,.72); }

.exit-world {
  width: 100vw;
  height: 100vh;
  padding: clamp(25px, 6vw, 90px);
  color: var(--cream);
  background: rgba(24,19,15,.96);
}
.exit-world > button { float: right; }
.exit-world > p {
  width: min(42ch, 80vw);
  margin: 12vh 0 7vh 8vw;
  font-size: clamp(22px, 3vw, 39px);
  line-height: 1.2;
}
.exit-world nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: clamp(1.2rem, 4vw, 4.8rem);
  width: min(1100px, 90vw);
  margin: 0 auto;
}
.exit-world nav a {
  color: inherit;
  font-size: clamp(25px, 5vw, 70px);
  font-weight: 700;
  letter-spacing: -.045em;
  text-decoration: none;
}
.exit-world nav a:nth-child(even) { transform: translateY(2.3rem); color: var(--evening); }
.exit-world nav a:nth-child(3n) { color: var(--ember); }
.exit-world nav i { font-size: .3em; font-style: normal; vertical-align: super; }

.text-world {
  width: 100vw;
  height: 100vh;
  padding: 0;
  overflow-y: auto;
  color: #223035;
  background: #f0eadf;
}
.text-world > button {
  position: sticky;
  top: 17px;
  z-index: 4;
  float: right;
  margin: 17px 24px 0 0;
  color: #8d4b36;
  background: #f0eadf;
}
.text-world article {
  width: min(78ch, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(75px, 10vw, 150px) 0;
  font-family: "Segoe UI", Aptos, Arial, sans-serif;
  font-size: clamp(17px, 1.2vw, 20px);
  line-height: 1.72;
}
.text-world article > header {
  margin-bottom: 8rem;
}
.text-world article > header p:first-child,
.text-world article > p:first-child {
  color: #8d4b36;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.text-world h1,
.text-world h2,
.text-world h3 {
  max-width: 28ch;
  margin: 5rem 0 1.5rem;
  color: #1d2e33;
  font-family: inherit;
  font-size: clamp(25px, 3vw, 42px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.035em;
}
.text-world article > header h1 {
  margin-top: .6rem;
}
.text-world p,
.text-world li,
.text-world label {
  max-width: 76ch;
  text-wrap: pretty;
}
.text-world p { margin: 0 0 1.55rem; }
.text-world sup {
  display: inline-block;
  min-width: 2.6rem;
  color: #a85338;
  font-size: 11px;
}
.text-world a {
  color: #31566a;
  text-underline-offset: .18em;
}
.text-world figure {
  width: min(1000px, 86vw);
  margin: 7rem 50% 7rem;
  transform: translateX(-50%);
}
.text-world figure img {
  width: 100%;
  max-height: 76vh;
  object-fit: cover;
}
.text-world figcaption {
  max-width: 63ch;
  margin-top: .8rem;
  color: #687474;
  font-size: 13px;
}
.text-world ol,
.text-world ul {
  margin: 3rem 0 5rem;
  padding-left: 1.4rem;
}
.text-world li { margin: 0 0 2.4rem; }
.text-world li img { width: 100%; margin: 2rem 0; }
.text-world del,
.text-world ins,
.text-world .first-impression,
.text-world .lasting-impression {
  color: inherit;
  text-decoration: none;
  font-family: inherit;
  font-style: normal;
}
.text-world del::after,
.text-world .first-impression::after { content: " → "; color: #a85338; }
.text-world form {
  margin: 5rem 0;
}
.text-world label {
  display: block;
  margin: 2.2rem 0;
  color: #5f6e70;
  font-size: 14px;
  font-weight: 700;
}
.text-world input:not([type="checkbox"]),
.text-world textarea,
.text-world select {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 2px solid #45585d;
  border-radius: 0;
  padding: .75rem 0;
  color: #18292d;
  background: transparent;
  outline: 0;
}
.text-world textarea { resize: vertical; }
.text-world input:focus,
.text-world textarea:focus { border-color: #b15336; }
.text-world button {
  color: #8d4b36;
}
.text-world pre {
  white-space: pre-wrap;
  font: inherit;
}
.text-world article > section,
.text-world article > article,
.text-world article > nav,
.text-world article > div {
  margin: 4rem 0;
}
.text-world footer {
  width: min(78ch, calc(100% - 40px));
  margin: 4rem auto 0;
  padding: 3rem 0 5rem;
  color: #596668;
  font-size: 13px;
  line-height: 2;
}

.comparison-whisper {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 10;
  color: white;
  font-size: 12px;
  text-shadow: 0 1px 8px #000;
}

body[data-world-state="dialogue"] .object-door:not([aria-current="true"]) {
  opacity: .32;
}
body[data-world-state="transcript"] .comparison-whisper { display: none; }

@media (prefers-reduced-motion: reduce) {
  .memory-flash,
  .memory-flash img { transition: none; }
}

@media (max-width: 700px) {
  .room-world { width: max(2100px, 273.48vh); }
  .room-viewport::after {
    background:
      linear-gradient(90deg, rgba(10,8,6,.35), transparent 20%, transparent 82%, rgba(10,8,6,.35)),
      linear-gradient(0deg, rgba(10,8,6,.88), transparent 48%, rgba(10,8,6,.2));
  }
  .world-signature { left: 8px; font-size: 9px; }
  .world-instruction { left: 30px; top: 15px; font-size: 8px; }
  .world-exit { right: 15px; top: 14px; }
  .world-text { right: 83px; top: 14px; }
  .world-utterance {
    left: 30px;
    bottom: 48px;
    width: calc(100vw - 52px);
  }
  .world-utterance > p {
    font-size: clamp(20px, 7.2vw, 29px);
  }
  .object-door { font-size: 15px; }
  .memory-flash p { left: 24px; bottom: 48px; width: calc(100% - 48px); }
  .exit-world { padding: 22px; }
  .exit-world > p { margin: 14vh 0 8vh; width: 100%; }
  .exit-world nav { width: 100%; gap: 1rem 2rem; }
  .exit-world nav a { font-size: clamp(26px, 10vw, 45px); }
  .exit-world nav a:nth-child(even) { transform: none; }
  .text-world > button { margin-right: 15px; }
  .text-world article { width: calc(100% - 30px); font-size: 17px; }
  .text-world figure { width: calc(100vw - 30px); }
  .text-world footer { width: calc(100% - 30px); }
  .comparison-whisper { right: 15px; bottom: 12px; }
}
