:root {
  --paper: #ece9df;
  --ink: #11110f;
  --acid: #d7ff37;
  --pink: #ff6aa9;
  --blue: #7ec8ff;
  --line: 3px solid var(--ink);
  --display: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  --mono: "Courier New", Courier, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  background-image: radial-gradient(rgba(17, 17, 15, .1) .8px, transparent .8px);
  background-size: 7px 7px;
}
button, input, select { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

.masthead {
  min-height: 112px;
  padding: 18px 3vw;
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  align-items: center;
  gap: 28px;
  border-bottom: var(--line);
  background: var(--paper);
}
.brand { color: var(--ink); font: 900 clamp(1.5rem, 2.3vw, 2.1rem)/.77 var(--display); letter-spacing: -.04em; text-decoration: none; }
.stamp { width: max-content; padding: 8px 11px; border: 2px solid; background: var(--acid); font-size: .68rem; font-weight: 700; transform: rotate(-2deg); }
.follow-link { width: max-content; padding-bottom: 3px; border-bottom: 2px solid; color: var(--ink); font-size: .66rem; font-weight: 700; text-decoration: none; }
.follow-link:hover { background: var(--pink); }
.intro { justify-self: end; max-width: 510px; margin: 0; font-size: .78rem; line-height: 1.6; }

.hero { position: relative; min-height: 510px; padding: 64px 3vw 34px; overflow: hidden; border-bottom: var(--line); background: var(--acid); }
.hero::after { content: "RARE?"; position: absolute; right: -2vw; bottom: -8vw; color: transparent; font: 900 clamp(9rem, 26vw, 24rem)/.8 var(--display); letter-spacing: -.06em; -webkit-text-stroke: 3px rgba(17, 17, 15, .13); transform: rotate(-8deg); }
.eyebrow, .kicker { position: relative; z-index: 1; margin: 0 0 18px; font-size: .7rem; font-weight: 700; text-transform: uppercase; }
h1 { position: relative; z-index: 1; max-width: 1000px; margin: 0; font: 900 clamp(4rem, 11.2vw, 10rem)/.75 var(--display); letter-spacing: -.045em; }
.stats { position: absolute; z-index: 1; right: 3vw; bottom: 30px; display: flex; border: var(--line); background: var(--paper); box-shadow: 5px 5px 0 var(--ink); }
.stats span { padding: 12px 16px; font-size: .68rem; text-transform: uppercase; }
.stats span + span { border-left: var(--line); }
.stats strong { display: block; font: 900 1.45rem/1 var(--display); }

.browser { padding: 0 3vw 72px; }
.toolbar { display: grid; grid-template-columns: 2fr 1.15fr 1fr; border: var(--line); border-top: 0; background: var(--paper); }
.toolbar label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 15px; padding-left: 15px; border-right: var(--line); }
.toolbar label > span { font-size: .64rem; font-weight: 700; white-space: nowrap; }
.toolbar input, .toolbar select { width: 100%; min-height: 62px; padding: 0 15px; border: 0; border-left: 2px solid var(--ink); border-radius: 0; background: transparent; outline: none; }
.toolbar input:focus, .toolbar select:focus { background: white; }
.filter-toggle { min-height: 62px; border: 0; background: var(--pink); font-size: .75rem; font-weight: 700; }
.filter-toggle span { display: inline-block; min-width: 1ch; font-size: 1.25rem; vertical-align: -.1em; }

.filter-panel { margin: 18px 0 0; border: var(--line); background: var(--ink); color: var(--paper); box-shadow: 7px 7px 0 var(--pink); }
.filter-heading { display: flex; align-items: end; justify-content: space-between; padding: 22px; border-bottom: 1px solid rgba(255, 255, 255, .35); }
.filter-heading h2 { margin: 0; font: 900 clamp(2rem, 4vw, 3.8rem)/.8 var(--display); letter-spacing: -.02em; }
.filter-heading button { padding: 10px 12px; border: 2px solid var(--paper); background: transparent; color: var(--paper); font-size: .7rem; font-weight: 700; }
.filter-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.trait-filter { padding: 14px; border-right: 1px solid rgba(255, 255, 255, .25); border-bottom: 1px solid rgba(255, 255, 255, .25); }
.trait-filter > span { display: block; margin-bottom: 7px; color: var(--acid); font-size: .65rem; font-weight: 700; text-transform: uppercase; }
.trait-filter select { width: 100%; padding: 10px; border: 1px solid var(--paper); border-radius: 0; background: var(--ink); color: var(--paper); font-size: .73rem; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; }
.active-filters:empty { display: none; }
.filter-chip { padding: 8px 10px; border: 2px solid; background: var(--blue); font-size: .67rem; font-weight: 700; }

.section-heading { display: flex; align-items: end; justify-content: space-between; padding: 54px 0 18px; }
.section-heading h2, .method h2 { margin: 0; font: 900 clamp(2.7rem, 5.5vw, 5.2rem)/.78 var(--display); letter-spacing: -.035em; }
.section-heading > span { font-size: .7rem; font-weight: 700; }
.cat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 15px; }
.cat-card { min-width: 0; border: var(--line); background: white; box-shadow: 5px 5px 0 var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
.cat-card:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--ink); }
.card-button { width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
.image-wrap { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; overflow: hidden; border-bottom: var(--line); background: #c9c5ba; }
.image-wrap img { display: block; width: 100%; height: 100%; object-fit: cover; }
.image-missing { background: repeating-linear-gradient(45deg, var(--paper), var(--paper) 10px, var(--pink) 10px, var(--pink) 20px); }
.missing-copy { max-width: 13ch; padding: 8px; background: var(--paper); border: 2px solid; font-size: .75rem; font-weight: 700; text-align: center; transform: rotate(-4deg); }
.rank { position: absolute; z-index: 1; top: 9px; left: 9px; padding: 7px 9px; border: 2px solid; background: var(--acid); font-size: .72rem; font-weight: 700; }
.card-copy { padding: 14px; }
.card-copy h3 { overflow: hidden; margin: 0 0 13px; font: 900 clamp(1.2rem, 2vw, 1.7rem)/1 var(--display); letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.trait-count-line { margin: 0; color: #56564e; font-size: .6rem; font-weight: 700; }
.show-more { display: block; width: min(440px, 100%); margin: 48px auto 0; padding: 18px; border: var(--line); background: var(--acid); box-shadow: 5px 5px 0 var(--ink); font-weight: 700; }
.empty-state { padding: 80px 20px; border: var(--line); background: white; text-align: center; box-shadow: 7px 7px 0 var(--ink); }
.empty-state strong { font: 900 clamp(3rem, 10vw, 8rem)/.8 var(--display); }
.empty-state button { padding: 12px 15px; border: var(--line); background: var(--acid); font-weight: 700; }

.method { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 8vw; padding: 65px 3vw; border-top: var(--line); border-bottom: var(--line); background: var(--blue); }
.method > p { max-width: 670px; margin: 0; font-size: .88rem; line-height: 1.75; }

.cat-dialog { width: min(1080px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; border: var(--line); background: var(--paper); color: var(--ink); box-shadow: 12px 12px 0 var(--ink); }
.cat-dialog::backdrop { background: rgba(17, 17, 15, .77); }
.dialog-close { position: fixed; z-index: 3; top: max(20px, calc((100vh - min(760px, 100vh - 28px)) / 2 + 12px)); right: max(20px, calc((100vw - min(1080px, 100vw - 28px)) / 2 + 12px)); width: 44px; height: 44px; border: 2px solid; background: var(--pink); font: 900 1.7rem/1 var(--display); }
.dialog-layout { display: grid; grid-template-columns: minmax(0, .92fr) minmax(380px, 1.08fr); }
.dialog-visual { min-height: 100%; border-right: var(--line); background: var(--acid); }
.dialog-visual img { position: sticky; top: 0; display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.dialog-details { padding: 28px; }
.dialog-rank { width: max-content; margin: 0 0 11px; padding: 7px 9px; border: 2px solid; background: var(--acid); font-size: .68rem; font-weight: 700; transform: rotate(-1deg); }
.dialog-details h2 { margin: 0 0 21px; font: 900 clamp(3rem, 7vw, 6.4rem)/.78 var(--display); letter-spacing: -.04em; }
.count-summary { display: flex; justify-content: space-between; align-items: end; gap: 18px; padding: 13px 0; border-top: var(--line); border-bottom: var(--line); }
.count-summary strong { font-size: .8rem; }
.count-summary span { max-width: 260px; color: #56564e; font-size: .62rem; line-height: 1.4; text-align: right; }
.trait-list { margin-top: 14px; }
.trait-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 11px 0; border-bottom: 1px solid rgba(17, 17, 15, .28); }
.trait-name span, .trait-frequency span { display: block; margin-bottom: 3px; color: #595950; font-size: .58rem; text-transform: uppercase; }
.trait-name strong { font-size: .76rem; }
.trait-frequency { text-align: right; }
.trait-frequency strong { color: #8a0073; font-size: .68rem; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px 3vw 38px; background: var(--ink); color: var(--paper); font-size: .62rem; font-weight: 700; }
.fatal { min-height: 100vh; display: grid; place-content: center; padding: 30px; text-align: center; }
.fatal strong { font: 900 clamp(3rem, 12vw, 9rem)/.8 var(--display); }

@media (max-width: 1200px) {
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filter-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .masthead { grid-template-columns: 1fr auto; gap: 14px; }
  .intro { display: none; }
  .follow-link { grid-column: 1 / -1; }
  .hero { min-height: 440px; padding-top: 48px; }
  h1 { font-size: clamp(4.4rem, 22vw, 7rem); }
  .stats { right: auto; left: 3vw; max-width: 94vw; }
  .stats span { padding: 10px; }
  .toolbar { grid-template-columns: 1fr; }
  .toolbar label { border-right: 0; border-bottom: var(--line); }
  .filter-toggle { min-height: 58px; }
  .filter-controls { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .cat-card { box-shadow: 4px 4px 0 var(--ink); }
  .card-copy { padding: 11px; }
  .method { grid-template-columns: 1fr; gap: 30px; }
  .dialog-layout { grid-template-columns: 1fr; }
  .dialog-visual { border-right: 0; border-bottom: var(--line); }
  .dialog-visual img { position: static; }
  .dialog-details { padding: 20px; }
  footer { display: grid; }
}
