:root {
  --bg: #fafaf8;
  --fg: #171717;
  --muted: #737373;
  --line: #e7e5e0;
  --soft: #f0efeb;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --wide: 1360px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.site-head,
main,
.site-foot {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 24px;
}

.site-head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 28px;
  padding-bottom: 8px;
}

.brand {
  font: 400 28px/1 var(--serif);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.tagline {
  margin: 0;
  color: var(--muted);
}

/* search */

.search { margin: 40px 0 16px; }

.search input {
  width: 100%;
  padding: 18px 22px;
  font: 400 22px/1.3 var(--sans);
  color: var(--fg);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.search input:focus { border-color: #a3a3a3; }

.search input::placeholder { color: #a8a29e; }

.search input::-webkit-search-cancel-button { filter: grayscale(1); opacity: 0.5; }

/* filters: a left panel that can be hidden (a drawer on a phone), and pills above the results */

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px 16px;
  flex-wrap: wrap;
}

.filters-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  font: inherit;
  font-size: 13px;
  color: #404040;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

/* three lines of falling length: the filter icon */
.filters-btn::before {
  content: "";
  width: 12px;
  height: 9px;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 12px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) 2px 50% / 8px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) 4px 100% / 4px 1.5px no-repeat;
}

.filters-btn:hover { background: var(--soft); }
.filters-btn[aria-expanded="true"] { color: #fafaf8; background: #171717; border-color: #171717; }
.filters-btn .n:not(:empty) {
  min-width: 18px;
  padding: 0 5px;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  color: #fafaf8;
  background: #171717;
  border-radius: 999px;
}
.filters-btn[aria-expanded="true"] .n:not(:empty) { color: #171717; background: #fafaf8; }

.active {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.active:empty { display: none; }

.pill {
  padding: 4px 11px;
  font: inherit;
  font-size: 12px;
  color: #fafaf8;
  background: #171717;
  border: 1px solid #171717;
  border-radius: 999px;
  cursor: pointer;
}

.pill span { color: #bdbdbd; margin-left: 2px; }
.pill.clear { color: var(--muted); background: transparent; border-color: var(--line); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  margin-top: 24px;
}

.results {
  min-width: 0;
  container-type: inline-size;
}

.side { display: none; }

.home.with-side .layout { grid-template-columns: 230px minmax(0, 1fr); }

.home.with-side .side {
  display: block;
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding-right: 8px;
}

.side-head { display: none; }

.side details { border-top: 1px solid var(--line); }
.side .fam { border-top: 0; }

.side summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  font-size: 13px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}

.side summary::-webkit-details-marker { display: none; }

.side summary::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: auto;
  border: solid #a3a3a3;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.side details[open] > summary::after { transform: rotate(-135deg); }

.side .fam > summary {
  padding: 6px 0;
  color: var(--muted);
  font-size: 12px;
}

.side .sel:not(:empty) {
  padding: 0 6px;
  font-size: 11px;
  line-height: 17px;
  color: #fafaf8;
  background: #171717;
  border-radius: 999px;
}

.sec-body { padding-bottom: 12px; }
.fam .sec-body { padding: 0 0 6px; }

.opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 0;
  color: #404040;
  font-size: 13px;
  cursor: pointer;
}

.opt:hover .opt-l { color: var(--fg); }
.opt input { margin: 0; flex: none; accent-color: #171717; }
.opt-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt .n { margin-left: auto; color: #a8a29e; font-size: 12px; }
.opt.all { padding: 14px 0; border-top: 1px solid var(--line); }

.backdrop { display: none; }

@media (max-width: 900px) {
  .home.with-side .layout { grid-template-columns: minmax(0, 1fr); }
  .home.with-side .side {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    width: min(340px, 88vw);
    max-height: none;
    padding: 0 20px 32px;
    background: var(--bg);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
  }
  .home.with-side .backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 19;
    background: rgba(23, 23, 23, 0.25);
  }
  .side-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0 12px;
    background: var(--bg);
  }
  .side-head h2 { margin: 0; font: 400 22px/1 var(--serif); }
  .done {
    padding: 6px 14px;
    font: inherit;
    font-size: 13px;
    color: #fafaf8;
    background: #171717;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
  }
  .opt { padding: 7px 0; font-size: 14px; }
}

body.drawer-open { overflow: hidden; }

.count {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* grid and cards */

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 24px;
}

/* the columns follow the width of the results, which the filter panel changes */
@container (max-width: 1100px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 700px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 440px) { .grid { grid-template-columns: 1fr; } }

.card {
  display: block;
  text-decoration: none;
  min-width: 0;
  /* The browser skips the layout and paint of cards far off screen. */
  content-visibility: auto;
  contain-intrinsic-size: auto 260px;
}

.shot {
  position: relative;
  contain: layout paint;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--soft);
  border-radius: 8px;
  outline: 1px solid rgba(0, 0, 0, 0.05);
  outline-offset: -1px;
}

.shot iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 800px;
  border: 0;
  background: #fff;
  transform: scale(var(--scale, 0.25));
  transform-origin: 0 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.shot.loaded iframe { opacity: 1; }

.shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.shot.loaded img { opacity: 1; }

.shot.big iframe { pointer-events: auto; }

.shot.nosite { background: #f5f4f1; }

.ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: #a8a29e;
  font: 400 17px/1.3 var(--serif);
  text-align: center;
  overflow-wrap: anywhere;
}

.card-body {
  display: block;
  padding-top: 12px;
}

.card-name {
  display: block;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
}

.card-meta .handle {
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta > span { flex: none; }
.card-meta > .handle { flex: 0 1 auto; }

.more-wrap {
  display: flex;
  justify-content: center;
  margin: 48px 0;
}

.more {
  padding: 10px 22px;
  font: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.more:hover { background: var(--soft); }

.empty,
.loading {
  color: var(--muted);
  grid-column: 1 / -1;
  padding: 40px 0;
}

/* account */

.account { padding: 32px 0 64px; }

.back {
  display: inline-block;
  margin-bottom: 32px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.back:hover { color: var(--fg); }

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

@media (max-width: 860px) {
  .account-grid { grid-template-columns: 1fr; gap: 32px; }
}

.avatar {
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--soft);
}

.avatar.initial {
  display: flex;
  align-items: center;
  justify-content: center;
  font: 400 36px/1 var(--serif);
  color: var(--muted);
}

.account h1 {
  margin: 20px 0 2px;
  font: 400 34px/1.15 var(--serif);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.xlink {
  color: var(--muted);
  text-decoration: none;
}

.xlink:hover { color: var(--fg); text-decoration: underline; }

.bio {
  margin: 18px 0 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.tag {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 1px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
}

.shot.big { border-radius: 10px; }

.shot-link { display: block; }

.open-site {
  display: inline-flex;
  gap: 10px;
  align-items: baseline;
  margin-top: 14px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  text-decoration: none;
  font-weight: 500;
}

.open-site span {
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
}

.open-site:hover { background: var(--soft); }

.account h2 {
  margin: 40px 0 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.links {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.links li { border-bottom: 1px solid var(--line); }

.links a {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 12px 0;
  text-decoration: none;
  min-width: 0;
}

.links a:hover .link-label { text-decoration: underline; }

.link-label {
  flex: none;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-host {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.link-path { color: #a8a29e; }

.links .none { padding: 12px 0; color: var(--muted); }

.notfound { padding: 80px 0; }

.notfound h1 {
  font: 400 30px/1.2 var(--serif);
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}

.site-foot {
  padding-top: 24px;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 540px) {
  .site-head, main, .site-foot { padding-left: 16px; padding-right: 16px; }
  .search { margin-top: 24px; }
  .search input { font-size: 18px; padding: 15px 18px; }
  .account h1 { font-size: 28px; }
}
