#main[data-screen="projects"] .quest-grid {
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: clamp(26px,4vw,56px);
  margin: 20px 0 16px;
}
#main[data-screen="projects"] .quest-card {
  --comic-angle: 0deg;
  min-width: 0;
  perspective: 1200px;
  isolation: auto;
}
#main .quest-card::after { content: none; }
#main .quest-card:hover, #main .quest-card:active { scale: 1; box-shadow: none; }
.quest-flipper {
  display: grid;
  transform-style: preserve-3d;
  transition: transform 440ms cubic-bezier(.68,.02,.21,1);
}
.quest-flipped .quest-flipper { transform: rotateY(180deg); }
.quest-face {
  grid-area: 1/1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 3px solid var(--black);
  background: var(--paper);
  box-shadow: 6px 7px 0 var(--red);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.quest-cover {
  position: relative;
  min-width: 0;
  aspect-ratio: 2 / 1;
  background: var(--black);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 3px solid var(--black);
}
.quest-cover > img, .quest-cover > svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.quest-cover.quest-cover-baixi img { object-position: 50% 0; }
.quest-rank {
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 1;
  padding: 5px 8px;
  background: var(--red);
  color: var(--paper);
  border: 2px solid var(--paper);
  box-shadow: 2px 3px var(--black);
  transform: skew(-9deg);
  font: 900 10px/1.4 monospace;
}
.quest-summary, .quest-back { padding: clamp(14px,2.5vw,26px); }
#main .quest-card h3 {
  margin: 8px 0 10px;
  font-size: clamp(18px,2.1vw,27px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
#main .quest-card p { margin: 0 0 10px; max-width: none; font-size: 14px; line-height: 1.7; }
.quest-meta { font: 900 10px/1.5 monospace; letter-spacing: .08em; color: var(--red); }
.quest-open, .quest-close, .quest-links a {
  background: var(--black);
  color: var(--paper);
  border: 1px solid var(--paper);
  font: 800 12px/1.4 system-ui,sans-serif;
  padding: 9px 13px;
}
.quest-open { margin: auto 0 0; align-self: stretch; text-align: left; min-height: 44px; }
#main .quest-open:hover, #main .quest-open:active { scale: none; transform: none; }
.quest-open span { float: right; color: var(--paper); }
.quest-open::after { position: absolute; inset: 0; content: ''; }
.quest-back { transform: rotateY(180deg); background: var(--black); color: var(--paper); }
.quest-back .quest-meta, #main .quest-card .quest-back :is(h3,p) { color: var(--paper); }
.quest-back-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quest-close { flex-shrink: 0; min-height: 40px; }
.quest-links { margin-top: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 7px 9px; }
.quest-links a { display: inline-block; background: var(--red); }
.quest-links small { font-size: 11px; color: var(--paper); opacity: .8; }
.quest-direct .quest-flipper, body.reduced .quest-flipper { transition: none; }
@media (prefers-reduced-motion: reduce) { .quest-flipper { transition: none; } }
@media (max-width: 680px) {
  #main[data-screen="projects"] .quest-grid { grid-template-columns: minmax(0,1fr); }
}

/* Extra material stays below the opened dossier so the original flip keeps its proportions. */
#main .quest-card { scroll-margin-block-start: 14px; }
#main .quest-extras {
  display: grid;
  gap: 16px;
  margin-top: 9px;
  padding: clamp(14px, 2.3vw, 24px);
  border: 3px solid var(--black);
  border-top: 5px solid var(--red);
  background: var(--paper);
  color: var(--black);
  box-shadow: 6px 7px 0 var(--red);
}
#main .quest-extras[hidden] { display: none; }
#main .quest-item-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  border: 2px solid var(--black);
  background: var(--red);
  color: var(--paper);
  font: 850 12px/1.4 system-ui,sans-serif;
}
#main .quest-item-link:disabled {
  background: var(--paper);
  color: var(--black);
  cursor: default;
  scale: none;
  box-shadow: none;
}
.quest-item-link span, .quest-process h4 span {
  padding: 3px 5px;
  background: var(--black);
  color: var(--paper);
  font: 750 10px/1 system-ui,sans-serif;
}
.quest-process { border-left: 4px solid var(--red); padding: 1px 0 1px 9px; }
#main .quest-extras h4 { margin: 0 0 6px; font: 900 14px/1.35 system-ui,sans-serif; }
.quest-process h4 span { margin-inline-start: 3px; }
#main .quest-extras .quest-process p { margin: 0; color: var(--black); font-size: 13px; }
.quest-shots { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.quest-shot { margin: 0; min-width: 0; border: 2px solid var(--black); }
.quest-shot-frame {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  min-width: 0;
  overflow: hidden;
  background: radial-gradient(circle at 2px 2px,#f5f1e845 1px,transparent 1.6px) 0 0 / 7px 7px,
    linear-gradient(155deg,var(--black) 0 66%,var(--red) 66% 84%,var(--black) 84% 100%);
  color: var(--paper);
}
.quest-shot-frame img { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--black); }
.quest-shot-frame span { font: 800 21px/1 monospace; }
.quest-shot figcaption { padding: 5px 6px; font: 800 10px/1.25 system-ui,sans-serif; border-top: 2px solid var(--black); }
