/* The drawer and paper are one generated picture in each responsive state. */
.drawer-dialog {
  width: min(1160px, calc(94svh * 1.5), calc(100vw - 24px));
  max-height: 94svh;
  padding: 0;
  overflow: hidden;
  border: 2px solid #7a653b;
  border-radius: 0;
  background: #183a2b;
}
.drawer-dialog #story-content { padding: 0; }
.drawer-dialog .story-bottom { display: none; }
.research-drawer {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  container-type: inline-size;
  font-family: var(--sans, monospace);
  isolation: isolate;
}
.research-drawer [hidden] { display: none !important; }
.research-drawer-art {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}
.research-drawer-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  image-rendering: pixelated;
  user-select: none;
}
.research-drawer button {
  font-family: inherit;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.research-drawer-handle,
.research-folder,
.research-drawer-brick {
  position: absolute;
  z-index: 2;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: #f6dd9d;
}
.research-drawer-handle:focus-visible,
.research-folder:focus-visible,
.research-drawer-brick:focus-visible {
  outline: 2px solid #ffe7a9;
  outline-offset: 2px;
}
.research-drawer-handle {
  left: 23%;
  top: 52.5%;
  width: 15%;
  height: 12%;
}
.research-drawer[data-open="true"] .research-drawer-handle {
  top: 72.5%;
  height: 12%;
}
.research-drawer-handle span {
  position: absolute;
  left: 50%;
  bottom: -12%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 23cqw;
  font-size: clamp(10px, 1.35cqw, 15px);
  line-height: 1.2;
  text-shadow: 1px 1px #163426, -1px -1px #163426;
}
.research-drawer-handle:hover span { color: #fff5d2; }
.research-drawer-folders { position: absolute; inset: 0; pointer-events: none; }
.research-folder {
  top: 42.1%;
  height: 25.5%;
  pointer-events: auto;
  color: #405134;
}
.research-folder[data-folder="question"] { left: 7.3%; width: 7.7%; }
.research-folder[data-folder="data"] { left: 14.8%; width: 7%; }
.research-folder[data-folder="purpose"] { left: 21.5%; width: 7%; }
.research-folder span {
  position: absolute;
  left: 50%;
  bottom: 9%;
  transform: translateX(-50%);
  font-size: clamp(9px, 1.15cqw, 13px);
  line-height: 1;
  text-shadow: 1px 1px #f5d99e;
}
.research-folder[aria-pressed="true"] span,
.research-folder:hover span {
  color: #5b3420;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.research-drawer-brick {
  left: 49.3%;
  top: 43.6%;
  width: 6%;
  height: 8.5%;
}
.research-drawer-brick:hover { outline: 1px dashed #ffe7a9; outline-offset: 2px; }
.research-drawer-paper {
  position: absolute;
  z-index: 1;
  left: 64.4%;
  top: 23.2%;
  width: 24.4%;
  height: 48%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25cqw;
  padding: 0;
  margin: 0;
  overflow: auto;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #364631;
  scrollbar-width: thin;
  scrollbar-color: #b79a60 transparent;
}
.research-drawer .research-note-label {
  display: block;
  flex: 0 0 auto;
  color: #79633d;
  font-size: clamp(10px, 1.2cqw, 14px);
  line-height: 1.15;
  text-transform: uppercase;
}
.research-drawer .research-note-title {
  flex: 0 0 auto;
  margin: 0;
  max-width: none;
  color: #35482f;
  font-family: inherit;
  font-size: clamp(19px, 2.7cqw, 31px);
  font-weight: 500;
  line-height: 1.07;
  letter-spacing: 0;
}
.research-drawer .research-note-copy {
  flex: 0 0 auto;
  margin: 0;
  color: #4e5235;
  font-family: inherit;
  font-size: clamp(14px, 1.75cqw, 20px);
  line-height: 1.35;
}
.research-drawer .research-note-meta {
  flex: 0 0 auto;
  color: #826842;
  font-family: inherit;
  font-size: clamp(10px, 1.15cqw, 13px);
  line-height: 1.2;
}
.research-drawer .research-note-counter {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.research-drawer .research-paper-open,
.research-drawer .research-paper-next {
  flex: 0 0 auto;
  display: inline-block;
  min-height: 30px;
  margin: auto 0 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: #365032;
  font-size: clamp(12px, 1.45cqw, 17px);
  line-height: 1.2;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.research-paper-open:focus-visible,
.research-paper-next:focus-visible {
  outline: 2px solid #52663b;
  outline-offset: 3px;
}
@media (max-width: 760px) {
  .drawer-dialog {
    width: min(calc(100vw - 14px), calc(94svh * 2 / 3));
    max-height: 94svh;
  }
  .research-drawer { aspect-ratio: 2 / 3; }
  .research-drawer-handle {
    left: 38%;
    top: 21.6%;
    width: 24%;
    height: 7%;
  }
  .research-drawer[data-open="true"] .research-drawer-handle {
    top: 36.3%;
    height: 7%;
  }
  .research-drawer-handle span {
    max-width: 45cqw;
    bottom: -14%;
    font-size: clamp(10px, 3cqw, 13px);
  }
  .research-folder { top: 18.3%; height: 16.5%; }
  .research-folder[data-folder="question"] { left: 10.5%; width: 11.7%; }
  .research-folder[data-folder="data"] { left: 20.8%; width: 10%; }
  .research-folder[data-folder="purpose"] { left: 31%; width: 9.8%; }
  .research-folder span {
    left: 51%;
    top: 23%;
    bottom: auto;
    transform: translate(-50%, -50%) rotate(-90deg);
    font-size: clamp(10px, 3.2cqw, 13px);
    white-space: nowrap;
  }
  .research-drawer-brick { left: 79.5%; top: 19.5%; width: 9%; height: 6%; }
  .research-drawer-paper {
    left: 21%;
    top: 53.1%;
    width: 59%;
    height: 30.4%;
    gap: 2cqw;
  }
  .research-drawer .research-note-label,
  .research-drawer .research-note-meta { display: none; }
  .research-drawer .research-note-title {
    font-size: clamp(17px, 5.2cqw, 23px);
    line-height: 1.03;
  }
  .research-drawer .research-note-copy {
    font-size: clamp(15px, 4cqw, 17px);
    line-height: 1.22;
  }
  .research-drawer .research-paper-open,
  .research-drawer .research-paper-next {
    min-height: 24px;
    font-size: clamp(12px, 3.6cqw, 15px);
    line-height: 1.15;
    text-underline-offset: 3px;
  }
}
