.catalog {
  padding-block: clamp(2.8rem, 6vw, 6.3rem);
}

.catalog-intro {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .8rem 2rem;
  flex-wrap: wrap;
  margin-block-end: 1.8rem;
}

.catalog-intro h2 {
  font-weight: 620;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  line-height: 1.35;
}

.catalog-intro p,
.catalog-record-panel p,
.catalog-protocol-copy > p:not(.catalog-record-label) {
  color: var(--muted);
}

.catalog-tools {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .7rem 1.25rem;
  border-block-end: 1px solid var(--line);
  padding-block-end: 1rem;
}

.catalog-filters { display: flex; flex-wrap: wrap; gap: .42rem; }

.catalog-filters button,
.catalog-dialog-nav button {
  color: var(--muted);
  padding: .45rem .9rem;
  background: var(--deep);
  border: 1px solid var(--line);
  min-height: 44px;
  font-size: .875rem;
  cursor: pointer;
  transition: color .2s, background .25s, border-color .25s;
}

.catalog-filters button:hover,
.catalog-dialog-nav button:hover {
  color: var(--gold);
  border-color: var(--gold-dark);
}

.catalog-filters button[aria-pressed="true"] {
  color: var(--deep);
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 600;
}

.catalog-search {
  color: var(--gold);
  background: var(--deep);
  border: 1px solid var(--line);
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-inline: .85rem;
  flex: 0 1 18rem;
}

.catalog-search:focus-within { border-color: var(--gold); }
.catalog-search input {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: .875rem;
}
.catalog-search input::placeholder { color: var(--subtle); opacity: 1; }
.catalog-search-icon {
  position: relative;
  display: block;
  width: 13px;
  height: 13px;
  flex: none;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.catalog-search-icon::after {
  content: "";
  position: absolute;
  top: 11px;
  right: 10px;
  width: 6px;
  background: currentColor;
  height: 1px;
  transform: rotate(-47deg);
}

.catalog-count { color: var(--subtle); font-size: .875rem; margin-block: .75rem 1rem; }

.catalog-accordion { display: grid; gap: .6rem; }
.catalog-record,
.catalog-protocol {
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color .3s, background .3s;
}

.catalog-record:hover,
.catalog-record[open],
.catalog-protocol:hover,
.catalog-protocol:focus-within { border-color: var(--gold-dark); }

.catalog-record > summary {
  display: grid;
  grid-template-columns: minmax(7.8rem, 23%) 1fr auto;
  align-items: center;
  gap: .5rem clamp(.8rem, 3vw, 1.8rem);
  padding: 1.15rem clamp(1rem, 3vw, 1.55rem);
  min-height: 76px;
  list-style: none;
  cursor: pointer;
}
.catalog-record > summary::-webkit-details-marker { display: none; }
.catalog-record > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; }
.catalog-record-label { color: var(--gold); font-size: .82rem; font-weight: 450; }
.catalog-record-title { color: var(--text); font-size: clamp(1.05rem, 2vw, 1.24rem); font-weight: 570; }
.catalog-record-title small { display: block; color: var(--muted); font-weight: 400; font-size: .875rem; }
.catalog-record-code {
  color: var(--subtle);
  font: .75rem Consolas, monospace;
  letter-spacing: .08em;
}
.catalog-plus {
  display: grid;
  place-items: center;
  width: 2.05rem;
  height: 2.05rem;
  flex: none;
  border: 1px solid var(--line);
  color: var(--gold);
  transition: color .25s, background .25s, border-color .25s;
}
.catalog-plus::before,
.catalog-plus::after { content: ""; grid-area: 1 / 1; width: 10px; height: 1px; background: currentColor; }
.catalog-plus::after { transform: rotate(90deg); transition: transform .3s var(--ease); }
.catalog-record[open] > summary .catalog-plus,
.catalog-record > summary:hover .catalog-plus,
.catalog-protocol:hover .catalog-plus {
  color: var(--deep);
  background: var(--gold);
  border-color: var(--gold);
}
.catalog-record[open] > summary .catalog-plus::after { transform: rotate(0); }
.catalog-record-panel {
  border-block-start: 1px solid var(--line);
  padding: 1.3rem clamp(1rem, 3vw, 1.55rem) 1.55rem;
}
.catalog-record-panel p { max-width: 62ch; }
.catalog-record-panel > p + p {
  margin-block-start: .8rem;
  border-inline-start: 1px solid var(--gold-dark);
  padding-inline-start: .85rem;
}
.catalog-record[open] > .catalog-record-panel { animation: catalog-content-in .35s var(--ease) both; }

.catalog-protocol-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.catalog-protocol { position: relative; min-width: 0; display: flex; flex-direction: column; }
.catalog-protocol-copy { padding: 1rem 1.12rem 1.2rem; flex: 1; display: flex; flex-direction: column; }
.catalog-protocol-copy h3 {
  margin-block: .2rem .34rem;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.4;
}
.catalog-protocol-copy > p:not(.catalog-record-label) { font-size: .93rem; margin-block-end: .95rem; }
.catalog-link {
  margin-block-start: auto;
  padding: .7rem 0 0;
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  border: 0;
  border-block-start: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: start;
  font-size: .87rem;
  cursor: pointer;
}
.catalog-link::after { content: ""; position: absolute; inset: 0; }
.catalog-link:focus-visible::after { outline: 2px solid var(--gold); outline-offset: -3px; }

.catalog-art {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 8rem;
  aspect-ratio: 1.6;
  display: grid;
  place-items: center;
  color: var(--gold);
  border-block-end: 1px solid var(--line);
  background:
    linear-gradient(#dbb27515 1px, transparent 1px),
    linear-gradient(90deg, #dbb27515 1px, transparent 1px),
    radial-gradient(ellipse at 48% 45%, #503924, #211a12 70%);
  background-size: 25px 25px, 25px 25px, auto;
}
.catalog-art::after {
  content: "";
  position: absolute;
  inset: 7%;
  pointer-events: none;
  opacity: .55;
  background:
    linear-gradient(currentColor, currentColor) top left / 11px 1px,
    linear-gradient(currentColor, currentColor) top left / 1px 11px,
    linear-gradient(currentColor, currentColor) bottom right / 11px 1px,
    linear-gradient(currentColor, currentColor) bottom right / 1px 11px;
  background-repeat: no-repeat;
}
.catalog-figure {
  position: absolute;
  width: 55%;
  height: 59%;
  transform: scale(.94);
  transition: transform .65s var(--ease);
}
.catalog-protocol:hover .catalog-figure,
.catalog-protocol:focus-within .catalog-figure { transform: scale(1.05); }
.catalog-figure i,
.catalog-figure b { position: absolute; display: block; }
.catalog-art--nodes .catalog-figure i {
  width: 28%;
  aspect-ratio: 1;
  top: 34%;
  border: 1px solid currentColor;
  box-shadow: inset 0 0 20px #e9b97218;
  background: #322417;
  z-index: 1;
}
.catalog-art--nodes .catalog-figure i:nth-child(2) { inset-inline: 36%; top: 16%; }
.catalog-art--nodes .catalog-figure i:nth-child(3) { inset-inline-end: 0; }
.catalog-art--nodes .catalog-figure b { width: 85%; top: 49%; left: 7%; border-block-start: 1px dashed currentColor; }
.catalog-art--layers .catalog-figure i {
  top: 12%;
  left: 23%;
  width: 54%;
  height: 54%;
  border: 1px solid currentColor;
  background: #2d2115;
  transform: skew(-22deg) rotate(-7deg);
}
.catalog-art--layers .catalog-figure i:nth-child(2) { top: 27%; z-index: -1; opacity: .72; }
.catalog-art--layers .catalog-figure i:nth-child(3) { top: 42%; z-index: -2; opacity: .42; }
.catalog-art--handover .catalog-figure i {
  top: 20%;
  width: 38%;
  height: 60%;
  border: 1px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 24px #e9b97228;
}
.catalog-art--handover .catalog-figure i:nth-child(2) { inset-inline-end: 0; }
.catalog-art--handover .catalog-figure i:nth-child(3) {
  width: 13%;
  height: 22%;
  top: 40%;
  inset-inline-start: 43%;
  background: currentColor;
  box-shadow: 0 0 18px #e9b9728c;
}
.catalog-art--handover .catalog-figure b { width: 100%; top: 50%; border-block-start: 1px dashed currentColor; }
.catalog-art--signal .catalog-figure {
  transform: rotate(-12deg);
  background: linear-gradient(0deg, transparent 49%, #e9b97269 49%, #e9b97269 50%, transparent 50%);
}
.catalog-art--signal .catalog-figure i {
  width: 22%;
  height: 29%;
  top: 36%;
  border: 1px solid currentColor;
  background: #e9b97230;
}
.catalog-art--signal .catalog-figure i:nth-child(2) { width: 23%; height: 50%; top: 25%; inset-inline-start: 38%; opacity: .83; }
.catalog-art--signal .catalog-figure i:nth-child(3) { width: 19%; height: 76%; top: 12%; inset-inline-end: 0; opacity: .63; }
.catalog-art--signal .catalog-figure b { display: none; }
.catalog-art--terrain img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; object-position: center 62%; }

.catalog-evidence > .catalog-record > summary { grid-template-columns: minmax(7.6rem, 20%) 1fr auto auto; }
.catalog-evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.catalog-evidence-entry {
  display: grid;
  grid-template-columns: minmax(6rem, 35%) 1fr;
  background: var(--deep);
  border: 1px solid var(--line);
}
.catalog-evidence-entry > div:last-child { padding: .8rem .95rem 1rem; }
.catalog-evidence-entry .catalog-art { aspect-ratio: unset; height: 100%; border-block-end: 0; border-inline-end: 1px solid var(--line); }
.catalog-evidence-entry .catalog-record-label { color: var(--gold); }
.catalog-evidence-entry h3 { font-size: 1.06rem; margin-block: .3rem .25rem; }
.catalog-evidence-entry p:last-child { font-size: .91rem; }
.catalog-empty { color: var(--muted); padding: 1.25rem; text-align: center; border: 1px dashed var(--line); }

.catalog-dialog {
  position: fixed;
  inset: 0;
  width: min(95vw, 48rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--gold-dark);
  background: var(--surface);
  color: var(--text);
}
.catalog-dialog::backdrop { background: #090805da; backdrop-filter: blur(7px); }
.catalog-dialog[open] { animation: catalog-content-in .45s var(--ease) both; }
.catalog-dialog .catalog-art { aspect-ratio: 3.45; min-height: 9.25rem; }
.catalog-dialog .catalog-figure { width: min(42%, 14rem); height: 78%; }
.catalog-dialog-close {
  position: absolute;
  z-index: 3;
  inset: .65rem auto auto .65rem;
  color: var(--gold);
  border: 1px solid var(--gold-dark);
  background: var(--deep);
  height: 44px;
  width: 44px;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
}
.catalog-dialog-copy { padding: clamp(1rem, 4vw, 1.7rem); }
.catalog-dialog-copy h2 { font-size: clamp(1.55rem, 4vw, 2.2rem); }
.catalog-dialog-copy > p:not(.catalog-record-label) { color: var(--muted); }
.catalog-steps { margin-block: 1rem 0; padding-inline-start: 1.45rem; }
.catalog-steps li { padding: .55rem .4rem; border-block-start: 1px solid var(--line); }
.catalog-steps li::marker { color: var(--gold); }
.catalog-steps strong,
.catalog-steps span { display: block; }
.catalog-steps span { color: var(--muted); font-size: .94rem; }
.catalog-dialog-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  padding: .7rem clamp(1rem, 4vw, 1.7rem);
  border-block-start: 1px solid var(--line);
  color: var(--subtle);
  font-size: .875rem;
}
.catalog-dialog-nav button:disabled { opacity: .42; cursor: default; }

@keyframes catalog-content-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1000px) {
  .catalog-protocol-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 690px) {
  .catalog-tools { flex-direction: column; align-items: stretch; }
  .catalog-search { flex: auto; }
  .catalog-record > summary { grid-template-columns: 1fr auto; }
  .catalog-record > summary .catalog-record-title { grid-area: 2 / 1; }
  .catalog-record > summary .catalog-plus { grid-area: 1 / 2 / span 2; }
  .catalog-evidence > .catalog-record > summary { grid-template-columns: 1fr auto auto; }
  .catalog-evidence .catalog-record-code { grid-area: 1 / 2; }
  .catalog-evidence > .catalog-record > summary .catalog-record-title { grid-column: 1 / span 2; }
  .catalog-evidence > .catalog-record > summary .catalog-plus { grid-area: 1 / 3 / span 2; }
  .catalog-evidence-grid { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .catalog-protocol-grid { grid-template-columns: 1fr; }
  .catalog-evidence-entry { grid-template-columns: 1fr; }
  .catalog-evidence-entry .catalog-art { aspect-ratio: 2.15; min-height: 0; border-inline-end: 0; border-block-end: 1px solid var(--line); }
}

.motion-off .catalog * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
@media (prefers-reduced-motion: reduce) {
  body:not(.motion-on) .catalog * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
