/* Adapted from home/web/src/components/file-cabinet.module.css. */
.fc-cabinet {
  --ink: #3a3732;
  --paper: #ebe6dc;
  --paper-2: #e1dbce;
  --doc: #f4f1ea;
  --muted: #8a857b;
  --accent: #a8644b;

  --lw: max(1px, .22cqw);
  --rad: 1.4cqw;
  position: relative;
  width: 100%;
  aspect-ratio: 100 / 96;
  overflow: clip;
  container-type: inline-size;
  color: var(--ink);
  font-family: var(--mono), ui-monospace, monospace;
}

.fc-box {
  position: absolute;
  top: 20cqw;
  right: 7.5cqw;
  bottom: 18cqw;
  left: 7.5cqw;
  border-inline: var(--lw) solid var(--ink);
}

.fc-folder {
  position: absolute;
  top: calc(var(--y) * 1cqw);
  right: 10cqw;
  left: 10cqw;
  height: calc((64 - var(--y)) * 1cqw);
  border: var(--lw) solid var(--ink);
  border-bottom: 0;
  border-radius: var(--rad) var(--rad) 0 0;
  background: var(--paper);
}

.fc-front {
  z-index: 20;
  right: 8.5cqw;
  left: 8.5cqw;
  height: calc((86 - var(--y)) * 1cqw);
}

.fc-folderTab {
  position: absolute;
  bottom: 100%;
  left: var(--x);
  display: flex;
  height: 3.4cqw;
  align-items: center;
  margin: 0 0 calc(var(--lw) * -1);
  padding: 0 2.6cqw;
  border: var(--lw) solid var(--ink);
  border-bottom: 0;
  border-radius: var(--rad) var(--rad) 0 0;
  color: var(--ink);
  background: var(--paper);
  font: 400 max(8px, 1.3cqw)/1 var(--mono), monospace;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}

button.fc-folderTab {
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}

button.fc-folderTab:hover { background: var(--paper-2); }

button.fc-folderTab.fc-isActive {
  color: var(--paper);
  background: var(--ink);
}

.fc-file {
  position: absolute;
  z-index: 10;
  top: 25cqw;
  right: 13cqw;
  left: 13cqw;
  height: 50cqw;
  border: var(--lw) solid var(--ink);
  border-bottom: 0;
  border-radius: var(--rad) var(--rad) 0 0;
  background: var(--doc);
  transform: translateY(46cqw);
  transition: transform .45s cubic-bezier(.5, 0, .75, 0);
}

.fc-file.fc-isActive {
  transform: translateY(-12cqw);
  transition: transform .8s cubic-bezier(.2, .7, .2, 1) .3s;
}

.fc-fileTab {
  position: absolute;
  bottom: 100%;
  left: var(--tab);
  display: flex;
  height: 3.4cqw;
  align-items: center;
  margin-bottom: calc(var(--lw) * -1);
  padding: 0 3cqw;
  border: var(--lw) solid var(--ink);
  border-bottom: 0;
  border-radius: var(--rad) var(--rad) 0 0;
  color: var(--paper);
  background: var(--ink);
  font: 500 max(8px, 1.3cqw)/1 var(--mono), monospace;
  letter-spacing: .2em;
}

.fc-doc {
  position: absolute;
  top: 2.6cqw;
  right: 2.6cqw;
  left: 2.6cqw;
  height: 40cqw;
  padding: 2.2cqw;
  border: var(--lw) solid var(--ink);
  background: var(--doc);
  box-shadow: 1cqw .6cqw 0 var(--ink);
}

.fc-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15cqw;
  gap: 1.6cqw;
  padding-bottom: 2.2cqw;
  border-bottom: var(--lw) dotted var(--ink);
}

.fc-titles {
  display: grid;
  gap: .8cqw;
}

.fc-bar {
  display: block;
  overflow: hidden;
  padding: .6cqw 1.2cqw;
  font: 500 3.2cqw/1 var(--mono), monospace;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.fc-solid {
  color: var(--paper);
  background: var(--ink);
}

.fc-outline {
  border: var(--lw) solid var(--ink);
  letter-spacing: .4em;
}

.fc-badge {
  display: grid;
  overflow: hidden;
  border: var(--lw) solid var(--ink);
  place-items: center;
}

.fc-badge img,
.fc-figbox img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.75);
}

.fc-stamp {
  display: grid;
  align-content: center;
  gap: .6cqw;
  text-align: center;
}

.fc-stamp b {
  font: 300 4.6cqw/1 var(--body), Georgia, serif;
  letter-spacing: -.03em;
}

.fc-body {
  display: grid;
  grid-template-columns: 17cqw minmax(0, 1fr);
  gap: 2cqw;
  padding-top: 2.2cqw;
}

.fc-doc small {
  display: block;
  margin-bottom: .7cqw;
  color: var(--muted);
  font: 400 max(7px, 1.05cqw)/1 var(--mono), monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.fc-figbox {
  position: relative;
  display: flex;
  height: 13cqw;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: var(--lw) solid var(--ink);
}

.fc-status {
  margin-bottom: 1.4cqw;
  padding: 1.2cqw 1.6cqw;
  color: var(--paper);
  background: var(--ink);
  font: 500 2.5cqw/1.15 var(--mono), monospace;
  text-transform: uppercase;
}

.fc-lip {
  position: absolute;
  z-index: 30;
  top: 76cqw;
  right: 3cqw;
  left: 3cqw;
  height: 2.6cqw;
  border: var(--lw) solid var(--ink);
  background: var(--paper);
}

.fc-drawer {
  position: absolute;
  z-index: 30;
  top: 78.6cqw;
  right: 4.4cqw;
  bottom: 0;
  left: 4.4cqw;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2.4cqw;
  border: var(--lw) solid var(--ink);
  border-top: 0;
  background: var(--paper);
}

.fc-handle { display: grid; }

.fc-handle i {
  width: 16cqw;
  height: 2.6cqw;
  border: var(--lw) solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
}

.fc-handle i + i { margin-top: -1.3cqw; }

.fc-caption {
  font: 400 max(8px, 1.2cqw)/1 var(--mono), monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Figures */

.fc-bars {
  gap: 1.4cqw;
  align-items: flex-end;
  padding: 2cqw 2.4cqw 1.6cqw;
}

.fc-bars i {
  position: relative;
  flex: 1;
  height: calc(var(--v) * 100%);
  border: var(--lw) solid var(--ink);
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--ink) 50%, transparent) 0 1px, transparent 1px 4px), var(--paper);
}

.fc-bars i.fc-lead {
  border-color: var(--accent);
  background: var(--accent);
}

.fc-moon span {
  position: relative;
  z-index: 1;
  width: 7cqw;
  height: 7cqw;
  border: var(--lw) solid var(--ink);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(28, 27, 24, .16) 0 8%, transparent 9%),
    radial-gradient(circle at 62% 60%, rgba(28, 27, 24, .12) 0 12%, transparent 13%),
    radial-gradient(circle at 32% 28%, #f6f3ec, #d6d0c4 60%, #aaa497);
}

.fc-moon i {
  position: absolute;
  width: 14cqw;
  height: 3.6cqw;
  border: var(--lw) solid var(--ink);
  border-radius: 50%;
  transform: rotate(-12deg);
}

.fc-steps { padding-inline: 1.2cqw; }

.fc-steps b {
  display: grid;
  flex: none;
  width: 3.4cqw;
  height: 3.4cqw;
  place-items: center;
  border: var(--lw) solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font: 500 max(7px, 1.05cqw)/1 var(--mono), monospace;
  animation: step calc(var(--n) * 1.5s) infinite;
  animation-delay: calc(var(--i) * 1.5s);
}

.fc-steps i {
  flex: 1;
  height: var(--lw);
  background: repeating-linear-gradient(90deg, var(--ink) 0 .5cqw, transparent .5cqw 1cqw);
}

@keyframes step {
  0%, 34%, 100% { border-color: var(--ink); color: var(--ink); background: var(--paper); }
  8%, 26% { border-color: var(--accent); color: var(--paper); background: var(--accent); }
}

@media (prefers-reduced-motion: reduce) {
  .fc-file,
  .fc-file.fc-isActive { transition: none; }
  .fc-steps b { animation: none; }
}


.research-cabinet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 1.4em;
  padding: 1.4em 0;
  border-block: 1px solid var(--line);
}
.fc-cabinet { width: 100%; max-width: 360px; margin: 0 auto; }
.research-panel { min-width: 0; }
.research-dossiers { min-height: 13em; }
.research-dossier[hidden] { display: none; }
.research-dossier .research-file-code { margin: 0 0 1em; color: #888; font: .55em/1.5 var(--mono); }
.research-dossier h3 { margin: 0 0 .6em; font-size: 1.15em; line-height: 1.25; }
.research-dossier p { margin: 0 0 .9em; color: #666; font-size: .78em; line-height: 1.55; }
.research-dossier a { font-size: .7em; }
.research-file-index { margin-top: 1.4em; }
.research-file-index button {
  display: grid; width: 100%; grid-template-columns: 2.5em minmax(0,1fr) 1em; gap: .6em;
  align-items: baseline; min-height: 44px; padding: .8em 0;
  border: 0; border-top: 1px solid var(--line); background: transparent;
  color: #888; text-align: left; font: inherit; cursor: pointer;
}
.research-file-index span { font: .5em/1.5 var(--mono); }
.research-file-index b { font-size: .72em; line-height: 1.4; font-weight: normal; }
.research-file-index i { font: .7em/1 var(--mono); }
.research-file-index button[aria-pressed="true"] { color: var(--ink); }
.research-file-index button:hover { color: var(--ink); }
.research-file-index button:focus-visible { outline: 1px solid #999; outline-offset: 4px; }
@media(max-width:600px) {
  .research-cabinet { grid-template-columns: 1fr; gap: 1.5em; padding-top: 1em; }
  .fc-cabinet { max-width: 280px; }
  .research-dossiers { min-height: 0; }
  .research-panel { padding: 0 .25em; }
  .research-dossier h3 { max-width: 30ch; }
  .research-file-index { margin-top: 1.5em; }
}
