:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: #e9e2ce;
  background: #101613;
  --paper: #e9e2ce;
  --muted: #92a097;
  --dim: #6d7c73;
  --line: rgba(207, 193, 158, .17);
  --gold: #d5ad61;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 83% 5%, rgba(112, 142, 104, .13), transparent 29rem),
    linear-gradient(rgba(16, 22, 19, .94), rgba(16, 22, 19, .98)),
    url("atlas-materials/neutral-macro-terrain-v1.png") center top / 1000px auto fixed;
}
a { color: inherit; }
button, input, select { font: inherit; }

.masthead {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px 60px;
  align-items: end;
  min-height: 360px;
  padding: 70px clamp(22px, 6vw, 92px) 42px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.masthead::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 53%;
  opacity: .2;
  background: url("atlas-v2/terrain/forest/v1.png") center / cover;
  mask-image: linear-gradient(90deg, transparent, #000 55%);
}
.world-link {
  position: absolute;
  top: 24px;
  left: clamp(22px, 6vw, 92px);
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 10px;
  font-weight: 750;
}
.world-link:hover { color: var(--gold); }
.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .24em;
  font-size: 10px;
  font-weight: 800;
}
h1 {
  margin: 0;
  max-width: 780px;
  font: 500 clamp(48px, 7vw, 88px)/.85 Georgia, serif;
  letter-spacing: -.045em;
  color: #f1ead7;
}
h1 em { color: #c6a65f; font-weight: 400; }
.intro {
  max-width: 690px;
  margin: 24px 0 0;
  color: #aeb9b1;
  font: 17px/1.55 Georgia, serif;
}
.release-summary { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: 18px 0 0; color: #899990; font-size: 10px; }
.release-summary span { text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.release-summary a { color: #d5ad61; text-decoration: none; }
.release-summary a:hover { color: #f0d18b; }
.stats { display: flex; gap: 8px; }
.stats div {
  min-width: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(17, 25, 21, .8);
  backdrop-filter: blur(8px);
}
.stats strong, .stats span { display: block; }
.stats strong { color: #edca82; font: 600 25px/1 Georgia, serif; }
.stats span { margin-top: 6px; color: var(--dim); text-transform: uppercase; letter-spacing: .12em; font-size: 8px; }

main { padding: 0 clamp(22px, 6vw, 92px) 90px; }
.controls {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(200px, 1.5fr) repeat(4, minmax(135px, .8fr)) auto;
  gap: 10px;
  align-items: end;
  margin: 0 calc(clamp(22px, 6vw, 92px) * -1);
  padding: 18px clamp(22px, 6vw, 92px);
  border-bottom: 1px solid var(--line);
  background: rgba(16, 22, 19, .91);
  backdrop-filter: blur(15px);
}
label { display: grid; gap: 6px; }
label > span {
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 8px;
  font-weight: 800;
}
input, select, button {
  height: 43px;
  border: 1px solid rgba(216, 203, 169, .2);
  border-radius: 7px;
  outline: none;
  color: var(--paper);
  background: #18211d;
}
input, select { width: 100%; padding: 0 12px; }
input:focus, select:focus, button:focus-visible { border-color: #b9914c; box-shadow: 0 0 0 3px rgba(185, 145, 76, .12); }
button { padding: 0 16px; color: #bba978; cursor: pointer; }
button:hover { border-color: #8d7344; color: #f0d18b; }

.catalog-heading {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: end;
  padding: 34px 0 20px;
}
.result-count { margin: 0; color: #ddd3b9; font: 24px/1.2 Georgia, serif; }
.catalog-note { margin: 7px 0 0; color: var(--dim); font-size: 11px; }
.quick-links { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px 16px; }
.quick-links a { color: #9eaa9f; text-decoration: none; font-size: 10px; }
.quick-links a:hover { color: var(--gold); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 14px; }
.catalog-pagination { display: grid; justify-items: center; gap: 12px; padding: 30px 0 0; color: var(--dim); font-size: 11px; }
.catalog-pagination p { margin: 0; }
.catalog-pagination button { min-width: 220px; }
.catalog-pagination button[hidden] { display: none; }
.card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(28, 39, 33, .96), rgba(20, 29, 25, .96));
  box-shadow: 0 18px 38px rgba(0, 0, 0, .15);
  content-visibility: auto;
  contain-intrinsic-size: 340px;
}
.card.usage-pending { border-color: rgba(213, 173, 97, .45); }
.card.usage-pending .status-tag { color: #d5ad61; }
.card.usage-archive { border-color: rgba(160, 126, 116, .28); }
.card.usage-archive .status-tag { color: #a6857d; }
.card.usage-reference .status-tag { color: #92a8b0; }
.card-media {
  display: grid;
  grid-template-columns: repeat(var(--columns, 1), minmax(0, 1fr));
  min-height: 188px;
  padding: 9px;
  gap: 5px;
  background-color: #d8d3c5;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.42) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.42) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.42) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.42) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}
.card-media a { min-width: 0; display: grid; place-items: center; overflow: hidden; border-radius: 5px; }
.card-media img { display: block; width: 100%; height: 100%; max-height: 255px; object-fit: contain; transition: transform .18s ease; }
.card-media a:hover img { transform: scale(1.025); }
.card.compact .card-media { min-height: 145px; }
.card.compact .card-media img { max-height: 172px; }
.card.atlas .card-media img, .card.structure .card-media img { object-fit: cover; }
.card.atlas .card-media { min-height: 205px; }
.card-body { padding: 14px 15px 15px; }
.card-kicker { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.collection-tag, .status-tag {
  color: #c5a561;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 8px;
  font-weight: 800;
}
.status-tag { color: #73867b; text-align: right; }
.card h2 { margin: 0; color: #eee5cf; font: 600 19px/1.15 Georgia, serif; }
.card-meta { margin: 6px 0 0; color: #87978d; font-size: 10px; line-height: 1.45; }
.metadata-note { color: #a8b6ac; font-size: 13px; line-height: 1.6; max-width: 960px; margin: 0 0 20px; }
.entry-id { color: #a8b6ac; font: 10px/1.5 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.role-tag { display: inline-block; padding: 5px 8px; border-radius: 4px; background: #34453a; color: #cee0cf; font-size: 11px; }
.role-gameplay { background: #53472c; color: #f1dca8; }
.role-support { background: #2d4350; color: #c3dfeb; }
.role-reference { background: #433940; color: #dfcbd8; }
.asset-description, .asset-purpose { color: #d0d8cf; font-size: 12px; line-height: 1.55; margin: 10px 0; }
.asset-purpose strong { color: #e9dbb8; }
.gameplay-status { color: #b8c4b9; font-size: 11px; line-height: 1.5; }
.asset-records { margin-top: 12px; font-size: 11px; color: #c0cbbf; }
.asset-records summary { cursor: pointer; padding: 6px 0; color: #d1b77b; }
.asset-record { padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; line-height: 1.5; }
.asset-record code { display: block; color: #eee5cf; }
.asset-record a { display: block; margin-top: 5px; color: #a9c6b4; }
.advanced-filters { margin: 18px 0 0; color: #cbd6cb; font-size: 12px; }
.advanced-filters > summary { cursor: pointer; padding: 10px 0; color: #d1b77b; }
.metadata-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; padding: 12px 0; }
.metadata-filters label { display: grid; gap: 7px; }
.metadata-filters select { width: 100%; min-width: 0; }
.metadata-section { border-top: 1px solid var(--line); }
.metadata-section summary { line-height: 1.5; padding: 9px 0; }
.metadata-section dl { margin: 0 0 12px; }
.metadata-section dt { color: #eee5cf; margin-top: 10px; font-weight: 600; }
.metadata-section dd { margin: 3px 0 0; color: #bacaba; white-space: pre-wrap; overflow-wrap: anywhere; }
.card:has(.asset-records[open]) { grid-column: 1 / -1; }
.card:has(.asset-records[open]) .metadata-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 24px; }
.metadata-section[open] dl { display: grid; grid-template-columns: minmax(100px, .4fr) minmax(0, 1fr); gap: 10px 18px; font-size: 12px; }
.metadata-section[open] dt, .metadata-section[open] dd { margin: 0; }
.asset-path {
  display: block;
  overflow: hidden;
  margin-top: 12px;
  color: #66786e;
  font: 9px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-connector-preview .card-media { background-color: #cfd5c5; }
.more-art summary { padding: 12px 15px; color: #d1b77b; cursor: pointer; font-size: 12px; }
.more-art summary:hover, .more-art summary:focus-visible { background: #29372e; }
.more-art .card-media { max-height: 520px; overflow-y: auto; }
.empty, .error {
  grid-column: 1 / -1;
  min-height: 240px;
  display: grid;
  place-content: center;
  text-align: center;
  border: 1px dashed rgba(207, 193, 158, .24);
  border-radius: 11px;
  color: #9cab9f;
}
.empty span, .error strong { color: #e8dec4; font: 26px Georgia, serif; }
.empty p, .error p { margin: 8px 0 0; color: var(--dim); font-size: 11px; }

@media (max-width: 1120px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .search-field, .controls button { grid-column: 1 / -1; }
}
@media (max-width: 940px) {
  .masthead { grid-template-columns: 1fr; min-height: 0; }
  .stats { max-width: 480px; }
  .controls { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .controls button { grid-column: 1 / -1; height: 35px; }
}
@media (max-width: 680px) {
  .masthead { padding-top: 72px; }
  .masthead::after { inset: 0 0 0 22%; opacity: .12; }
  h1 { font-size: clamp(48px, 16vw, 68px); }
  .intro { font-size: 15px; }
  .stats { width: 100%; }
  .stats div { min-width: 0; flex: 1; padding: 12px 10px; }
  .controls { position: relative; grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .catalog-heading { display: block; }
  .quick-links { justify-content: start; margin-top: 18px; }
  .grid { grid-template-columns: 1fr; }
}
