.catalog-body { align-items: start; }
.catalog-index { position: static; }
.catalog-pages { overflow: clip; overflow-clip-margin: 6px; }
.catalog-pages article { scroll-margin: 0; }

.catalog, .mod-detail, .macro-library {
  --catalog-inset: clamp(24px, 5vw, 72px);
  width: auto;
  margin-inline: var(--catalog-inset);
}
.catalog-pages article { max-width: 1600px; }
.lite-stage { width: 100%; max-width: 1600px; perspective: 1800px; }
.lite-menu {
  display: block;
  width: 100%;
  height: auto;
  mask: url("./jade-lite-windows.svg?v=a32237db") center / 100% 100% no-repeat;
}
.mod-detail {
  width: min(1120px, calc(100% - 40px));
  margin: clamp(20px, 4vw, 48px) auto clamp(52px, 7vw, 90px);
}
.back-to-mods {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
}
.back-to-mods:hover { text-decoration: underline; }
.product-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  margin: 12px 0 clamp(28px, 4vw, 50px);
}
.mod-detail h1 {
  font: 800 clamp(2.6rem, 6vw, 4.8rem)/1 "Inter Tight", system-ui, sans-serif;
  transform: none;
}
.product-intro .mod-links { justify-content: center; }
.product-intro p { margin: 12px 0 0; color: var(--muted); line-height: 1.55; }
.product-shot { display: block; width: 100%; height: auto; }
.mod-detail .installer-menu { max-width: 900px; margin: 0 auto; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .lite-menu {
    transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform 180ms ease-out;
  }
}
@media (max-width: 550px) {
  .catalog, .mod-detail, .macro-library { --catalog-inset: 12px; }
}

.mod-directory {
  width: min(1100px, calc(100% - 40px));
  margin: clamp(36px, 6vw, 72px) auto 72px;
}
.mod-directory h1 {
  margin: 0 0 30px;
  text-align: center;
  transform: none;
  font-size: clamp(2.7rem, 5vw, 3.5rem);
}
.mod-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mod-card {
  position: relative;
  isolation: isolate;
  display: flex; flex-direction: column;
  border: 1px solid #484641; background: #2b2a28;
}
@media (prefers-reduced-motion: no-preference) {
  .mod-card { transition: border-color 160ms ease-out; }
}
@media (hover: hover) {
  .mod-card:hover { border-color: var(--green); }
}
.mod-card:focus-within { border-color: var(--green); }
.mod-thumbnail {
  display: grid; place-items: center; aspect-ratio: 16 / 9;
  overflow: hidden; border-bottom: 1px solid #484641; background: #252623;
}
.mod-thumbnail > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mod-thumbnail-placeholder { width: 38px; color: #a39f94; }
.mod-info { display: flex; flex: 1; flex-direction: column; padding: 20px; }
.mod-info h2 { font: 700 1.35rem/1.15 "Inter Tight", system-ui, sans-serif; }
.mod-info p { margin: 8px 0 18px; color: var(--muted); line-height: 1.4; }
.card-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.card-links a { display: inline-flex; align-items: center; min-height: 44px; gap: 6px; }
.mod-open::after {
  content: "";
  position: absolute;
  inset: 0;
}
.card-links a:last-child { position: relative; z-index: 1; padding-inline: 14px; border: 1px solid #68665f; }
.card-links a:hover { text-decoration: underline; text-underline-offset: .18em; }
@media (max-width: 840px) { .mod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) {
  .mod-grid { grid-template-columns: 1fr; }
  .mod-directory { width: calc(100% - 28px); }
}

#installer.mod-card .mod-thumbnail > img { object-fit: contain; }

.mod-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
}
.mod-links .catalog-open {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding-block: 0;
}
.catalog-pages .mod-links { margin-top: 16px; }

.deco-menu-stage {
  position: relative;
  width: 100%;
  margin: 0 auto;
  perspective: 1200px;
}
.deco-menu-preview {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .deco-menu-preview {
    transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform 180ms ease-out;
  }
}
.mod-detail .deco-menu-stage { width: min(92%,820px); margin-inline: auto; }
.mod-links.stacked { flex-direction: column; gap: 2px; }
/* Keep the screenshot's aspect ratio so its title follows the game window at every card size. */
.level-list-screen { position: relative; width: 90%; container-type: inline-size; }
.level-list-screen img { display: block; width: 100%; height: auto; }
.level-list-screen span {
  position: absolute; inset: 5.2% 32% auto; height: 6.4%; display: grid; place-items: center;
  background: #a25f39; color: #ffce0b; font: 700 3.55cqw/1 Pusab, system-ui, sans-serif;
  -webkit-text-stroke: .35cqw #301b08; paint-order: stroke fill;
}
.mod-coming-soon { min-height: 48vh; display: grid; place-items: center; text-align: center; }

.jade-ai-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  margin: clamp(48px, 7vw, 88px) auto 0;
  max-width: 1020px;
}
.jade-ai-feature h2 { font: 800 clamp(1.8rem, 3.2vw, 2.75rem)/1.08 "Inter Tight", system-ui, sans-serif; letter-spacing: -.035em; }
.jade-ai-feature p { max-width: 34ch; margin: 12px 0 0; color: var(--muted); line-height: 1.55; }
.jade-ai-feature svg { display: block; width: 100%; height: auto; }
@media (max-width: 719px) {
  .jade-ai-feature { grid-template-columns: 1fr; gap: 18px; }
}
