/* Builds board: filters, carousel, build cards. */

.builds {
  position: relative;
  z-index: 5;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding-block: clamp(64px,10vh,104px);
  padding-inline: var(--gutter);
  scroll-margin-top: 84px;
}

.builds .inner {
  max-width: 1180px;
  margin: 0 auto;
}

.b-head>div:first-child {
  flex: 1 1 420px;
}

.b-head .right {
  flex: none;
}

.b-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}

.b-head h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(38px,5vw,64px);
  line-height: 1.02;
  letter-spacing: -.025em;
  margin: 0;
}

.b-head .right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.b-count {
  color: var(--fg-muted);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.b-sub {
  color: var(--fg-muted);
  margin: 10px 0 0;
  max-width: 40em;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  align-items: center;
}

.search {
  position: relative;
  flex: 1 1 200px;
  max-width: 280px;
}

.search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--fg-muted);
  pointer-events: none;
}

.search .field-ctl {
  width: 100%;
  padding-left: 36px;
}

.clear {
  background: none;
  border: 0;
  color: var(--fg-muted);
  font: 500 14px var(--ui);
  cursor: pointer;
  padding: 8px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.ex-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px dashed color-mix(in srgb,var(--fg) 25%,var(--line));
  border-radius: 12px;
  color: var(--fg-muted);
  font-size: 14px;
}

.ex-note b {
  color: var(--fg);
  font-weight: 600;
}

.carousel {
  position: relative;
  margin-top: 22px;
}

.track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * 18px) / 3);
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 2px 10px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.track::-webkit-scrollbar {
  display: none;
}

.card {
  scroll-snap-align: start;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  cursor: pointer;
  transition: border-color .2s ease,transform .2s ease;
}

.card:hover {
  border-color: color-mix(in srgb,var(--fg) 20%,var(--line));
}

.card.example {
  border-style: dashed;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.num {
  font: 500 12px/1 var(--mono);
  color: var(--fg-muted);
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 7px;
  border-radius: 6px;
  background: var(--line);
  color: var(--fg-muted);
}

.acts {
  display: flex;
  gap: 6px;
}

.card h3 {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.25;
  margin: 16px 0 0;
  letter-spacing: -.01em;
}

.card h3 button {
  all: unset;
  cursor: pointer;
}

.card h3 button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card h3 button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.category-tag {
  display: inline-block;
  border-radius: 999px;
  padding: 6px 10px;
  font: 500 12px/1.35 var(--ui);
  background: #e9e3fb;
  color: #51327c;
}

.category-tag[data-category="Agent"] { background: #e9e3fb; color: #51327c; }
.category-tag[data-category="Learning"] { background: #dcecfb; color: #244e78; }
.category-tag[data-category="Planning"] { background: #fbe6cc; color: #78501e; }
.category-tag[data-category="Productivity"] { background: #daf0e2; color: #285e40; }
.category-tag[data-category="Writing"] { background: #f7dfe9; color: #823d59; }
.category-tag[data-category="Reasoning"] { background: #d9eeef; color: #285c62; }
.category-tag[data-category="Fun"] { background: #faedbe; color: #705516; }
.category-tag[data-category="Shopping"] { background: #f9ded5; color: #7d4232; }
.category-tag[data-category="Companionship"] { background: #e8e7fb; color: #474781; }

.by {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--fg-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}

.by b {
  color: var(--fg);
  font-weight: 600;
}

.by .em {
  color: var(--accent-ink);
  user-select: all;
  overflow-wrap: anywhere;
}

.li {
  display: inline-flex;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--line);
  align-items: center;
  justify-content: center;
  color: var(--fg);
}

.li svg {
  width: 13px;
  height: 13px;
}

.desc {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.chip {
  font: 500 12.5px/1 var(--ui);
  padding: 7px 10px;
  border-radius: 8px;
  background: color-mix(in srgb,var(--fg) 6%,var(--bg-raised));
  color: var(--fg);
}

.chip.other {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg-muted);
}

.card-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
}

.card .desc {
  display: block;
  max-height: 3.1em;
  transition: max-height .75s ease;
}

.card:focus-within .desc {
  max-height: 24em;
}

/* Ease extra information into view without requiring a title click. */
.card-reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows .75s ease, opacity .6s ease, visibility .75s;
}

.card-reveal-inner {
  min-height: 0;
  overflow: hidden;
}

.card-detail-label {
  margin: 18px 0 0;
  color: var(--fg-muted);
  font: 500 11px/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}


.card-how-preview {
  margin: 8px 0 0;
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}

.card:focus-within .card-reveal {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover .desc {
    max-height: 24em;
  }

  .card:hover .card-reveal {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
  }
}

@media (hover: none), (pointer: coarse) {
  .card .desc {
    max-height: none;
  }

  .card-reveal {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
  }
}

.nav-btns {
  display: flex;
  gap: 8px;
}

.arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--fg);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity .2s ease,border-color .2s ease;
}

.arrow:hover {
  border-color: color-mix(in srgb,var(--fg) 25%,var(--line));
}

.arrow[data-off="true"] {
  opacity: .35;
  cursor: default;
}

.arrow svg {
  width: 18px;
  height: 18px;
}

.b-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--fg-muted);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.empty {
  grid-column: 1/-1;
  border: 1px dashed color-mix(in srgb,var(--fg) 25%,var(--line));
  border-radius: 18px;
  padding: 40px 24px;
  text-align: center;
  color: var(--fg-muted);
}

.empty b {
  display: block;
  color: var(--fg);
  font-size: 17px;
  margin-bottom: 6px;
  font-weight: 600;
}

.empty .btn {
  margin-top: 16px;
}

@media (max-width:720px) {
  .builds {
    padding-block: 52px;
  }

  .b-sub {
    font-size: 15px;
  }

  .filters {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  }

  .filters .search {
    grid-column: auto;
  }

  .filters #fSort {
    width: 100%;
  }
}

@media (max-width:640px) {
  .filters {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  }

  .filters .search {
    grid-column: auto;
    max-width: none;
  }

  .filters .field-ctl {
    width: 100%;
  }

  .filters .clear {
    grid-column: 1/-1;
    justify-self: start;
  }

  .track {
    grid-auto-columns: 88%;
  }
}

@media (max-width:1000px) {
  .track {
    grid-auto-columns: calc((100% - 18px) / 2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card, .card-reveal, .card .desc {
    transition: none;
  }

  .track {
    scroll-behavior: auto;
  }
}
