.tailor-room {
  --room-text-inset: 5%;
  max-width: 1320px;
  margin: 24px auto 0;
  color: #fff7e7;
  background: #23372f;
}
.room-view {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1672 / 941;
  background: #433023;
}
.room-world {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  aspect-ratio: 1672 / 941;
  transform: translateX(-50%);
}
.room-interior, .room-thread, .room-dust {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.room-view::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 68% 61% at 5% 4%, #1a140fe8, #21180e75 52%, transparent 89%);
}
.room-heading {
  position: absolute;
  z-index: 2;
  top: 7%;
  left: var(--room-text-inset);
  pointer-events: none;
  text-shadow: 0 2px 8px #1c100b99;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
}
.room-heading p {
  margin: 0 0 .65em;
  color: #f1dfbd;
  font-size: clamp(.82rem, 1.3vw, 1.1rem);
  letter-spacing: .12em;
}
.room-heading h2 {
  margin: 0;
  color: #fff8e9;
  font-size: clamp(1.5rem, 3.25vw, 2.95rem);
  line-height: 1.6;
  font-weight: 500;
  letter-spacing: .06em;
}

.room-item {
  position: absolute;
  display: block;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  appearance: none;
  color: #fff7e7;
  -webkit-tap-highlight-color: transparent;
}
.room-item:disabled { opacity: 1; }
.room-item:focus-visible {
  outline: 2px solid #fff0bd;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px #433320bb;
}
.room-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}
.room-label {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  padding: .18em .75em;
  border: 1px solid #b89b67;
  border-radius: 2px;
  background: #30281eea;
  color: #fff4da;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(.8rem, 1.4vw, 1rem);
  line-height: 1.5;
  white-space: nowrap;
}
.room-item:focus-visible .room-label,
.tailor-room[data-guides="on"] .room-label { opacity: 1; }
@media (hover: hover) {
  .room-item:hover:not(:disabled) .room-label { opacity: 1; }
}

.room-bell {
  left: 60.5%;
  top: -1.2%;
  width: 6.4%;
  aspect-ratio: 260 / 547;
}
.room-bell-metal {
  transform-origin: 50% 4%;
  filter: drop-shadow(1px 2px 1px #29190f44);
}
.room-bird {
  left: 24.8%;
  bottom: 17%;
  width: 19.5%;
  aspect-ratio: 684 / 598;
}
.room-bird-shadow, .room-bobbin-shadow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.room-bird-shadow {
  bottom: -.5%;
  left: 26%;
  width: 73%;
  height: 9%;
  background: radial-gradient(ellipse, #29180bc9 4%, #311c0e75 40%, transparent 72%);
  transform: rotate(3deg);
}
.room-bird-hop, .room-bird-skin {
  position: absolute;
  inset: 0;
  display: block;
  transform-origin: 50% 97.7%;
}
.room-bird-skin {
  background: url("images/workroom/leon-poses.webp") 0 50% / 300% 100% no-repeat;
}
.room-bird[data-pose="listen"] .room-bird-skin { background-position-x: 50%; }
.room-bird[data-pose="inspect"] .room-bird-skin { background-position-x: 100%; }
.room-bird .room-label { top: 94%; }

.room-bobbin {
  left: 44.7%;
  bottom: 14.7%;
  width: 7.3%;
  aspect-ratio: 370 / 304;
}
.room-bobbin-shadow {
  left: 8%;
  bottom: -1%;
  width: 105%;
  height: 27%;
  background: radial-gradient(ellipse, #29180cd9, #301b0c66 46%, transparent 72%);
  transform: rotate(9deg);
}
.room-bobbin-wood { position: relative; transform-origin: 56% 88%; }
.room-thread {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.room-thread use { stroke-dasharray: 1; stroke-dashoffset: .52; }
.tailor-room[data-thread="out"] .room-bobbin { transform: translate(112%, -23%); }
.tailor-room[data-thread="out"] .room-bird { transform: translateX(17%); }
.tailor-room[data-thread="out"] .room-thread use { stroke-dashoffset: 0; }

.tailor-room[data-motion="on"] .room-bobbin,
.tailor-room[data-motion="on"] .room-thread use {
  transition: transform 980ms cubic-bezier(.32,.05,.24,1), stroke-dashoffset 980ms cubic-bezier(.32,.05,.24,1);
}
.tailor-room[data-motion="on"] .room-bird { transition: transform 560ms ease-in-out; }
.tailor-room[data-motion="on"] .room-bird-skin { animation: room-breathe 3.3s ease-in-out infinite; }
@keyframes room-breathe {
  0%, 100% { transform: scale(1, 1); }
  52% { transform: scale(1.006, 1.013) rotate(-.25deg); }
}
.room-dust i {
  position: absolute;
  left: 7%;
  top: 37%;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff1c6;
  opacity: 0;
}
.room-dust i:nth-child(2) { left: 18%; top: 45%; animation-delay: -4.6s; }
.room-dust i:nth-child(3) { left: 12%; top: 51%; animation-delay: -2.5s; }
.room-dust i:nth-child(4) { left: 24%; top: 40%; animation-delay: -6.7s; }
.tailor-room[data-motion="on"] .room-dust i {
  animation-name: room-drift;
  animation-duration: 8s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
@keyframes room-drift {
  0% { opacity: 0; transform: translate(-4px, 8px); }
  35% { opacity: .54; }
  100% { opacity: 0; transform: translate(16px, -19px); }
}

.room-rail:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.2rem;
  position: relative;
  isolation: isolate;
  font-size: clamp(.875rem, 1.4vw, 1rem);
  padding-block: calc(.8rem + .8em);
  padding-inline: var(--room-text-inset) clamp(2.5rem, 4.2vw, 4rem);
  background: var(--paper);
}
.room-rail::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  border-image: url("images/tailor-silk-ribbon-straight.webp") 10 85 fill / 3px clamp(22px, 2.6vw, 34px) / 0 round stretch;
}
.room-reply {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(.875rem, 1.4vw, 1rem);
  line-height: 1.6;
}
.room-tools { display: flex; align-items: center; flex-shrink: 0; gap: .6rem; }
.room-tools button {
  min-height: 44px;
  padding: .3rem .6rem;
  color: #f2e8cd;
  background: transparent;
  border: 0;
  font-size: .875rem;
  text-decoration: underline;
  text-decoration-color: #b8a57c88;
  text-underline-offset: .35em;
}
.room-tools button:is(:hover, :focus-visible), .room-tools button[aria-pressed="true"] {
  color: white;
  text-decoration-color: #efd19b;
}
.room-tools button:focus-visible { outline: 2px solid #e6cc92; }

@media (max-width: 700px) {
  .tailor-room { margin-top: 0; }
  .room-view { aspect-ratio: 1.23; }
  .room-heading { top: 6%; }
  .room-heading p { font-size: .81rem; margin-bottom: .35em; }
  .room-heading h2 { font-size: clamp(1.32rem, 4.7vw, 1.8rem); line-height: 1.48; }
  .room-rail:not([hidden]) { flex-wrap: wrap; gap: 0; padding-block: calc(.7rem + .8em); }
  .room-reply { flex: 1 1 100%; }
  .room-tools { margin-left: auto; }
}
@media (max-width: 450px) {
  .room-view { aspect-ratio: 1.05; }
  .room-world { left: 52%; }
  .room-heading h2 { font-size: clamp(1.13rem, 5.62vw, 1.32rem); }
  .room-bell { left: 66.8%; }
  .room-bell .room-label { margin-top: 1.9rem; }
  .room-bell .room-label::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 100%;
    height: 1.5rem;
    border-left: 1px solid #d5bd8b;
  }
}

/* Each object occupies its own place on the counter, including when the spool rolls. */
.room-item { cursor: pointer; text-decoration: none; }
.room-item:hover, .room-item:focus { z-index: 2; }
.room-camera { left: 7.7%; bottom: 23.8%; width: 15.2%; aspect-ratio: 580 / 629; }
.room-photos { left: 12.5%; bottom: 7.8%; width: 16%; aspect-ratio: 2.28; }
.room-ledger { left: 56.9%; bottom: 7.3%; width: 16.8%; aspect-ratio: 1.48; }
.room-wares { left: 66.5%; bottom: 28.2%; width: 23.5%; aspect-ratio: 689 / 506; }
.room-photos img, .room-ledger img { object-fit: fill; }
.room-photos .room-label, .room-ledger .room-label { top: 85%; }
.room-prop { --lamp-delay: -2s; }
.room-photos { --lamp-delay: -3.7s; }
.room-wares { --lamp-delay: -1s; }
.room-ledger { --lamp-delay: -5s; }
.room-prop img, .room-bird-hop {
  filter: drop-shadow(0 2px 2px #3a241784) drop-shadow(0 0 3px #ffe5a798);
}
.tailor-room[data-motion="on"] :is(.room-prop img, .room-bird-hop) {
  animation: room-light 5.8s ease-in-out var(--lamp-delay, -2.8s) infinite;
}
@keyframes room-light {
  0%, 100% { filter: drop-shadow(0 2px 2px #3a241784) drop-shadow(0 0 2px #ffe6a783); }
  52% { filter: drop-shadow(0 2px 2px #3a241784) drop-shadow(0 0 7px #ffe9bada) drop-shadow(0 0 3px #ffe19791); }
}
.room-bell-metal, .room-bobbin-wood { filter: drop-shadow(0 0 3px #ffe4a887); }
.tailor-room[data-motion="on"] :is(.room-bell-metal, .room-bobbin-wood) { animation: room-light 6.5s ease-in-out -1.6s infinite; }
.tailor-room[data-thread="out"] .room-bobbin { transform: translate(63%, -30%); }
.room-view::after { z-index: 0; }
.room-item { z-index: 1; }
.room-heading { z-index: 3; }
@media (max-width: 700px) {
  .room-view { aspect-ratio: 1.1; }
  .room-world { inset: 0; width: 100%; height: 100%; aspect-ratio: auto; transform: none; }
  .room-interior { object-fit: cover; object-position: 48% 65%; }
  .room-bell { left: 68%; width: 9%; }
  .room-bird { left: 26%; bottom: 23.5%; width: 27%; }
  .room-camera { left: 2.55%; bottom: 25.8%; width: 23.7%; }
  .room-photos { left: 9%; bottom: 8%; width: 26%; }
  .room-bobbin { left: 40.3%; bottom: 13%; width: 11.8%; }
  .room-ledger { left: 62.2%; bottom: 6.7%; width: 28.2%; }
  .room-wares { left: 61.9%; bottom: 30%; width: 33.2%; }
  .room-wares .room-label { left: auto; right: 0; transform: none; }
  .room-camera .room-label { left: 0; transform: none; }
  .room-photos .room-label, .room-ledger .room-label { top: 75%; }
  .room-label { font-size: .79rem; }
}
@media (max-width: 450px) {
  .room-view { aspect-ratio: .99; }
  .room-heading { top: 7%; }
}
@media (prefers-reduced-motion: reduce) {
  .tailor-room:not([data-motion="on"]) .room-item * { animation: none; }
}
