/* glyphfox universe: hero, filters, virtual grid, detail panel and the set table. */

.uv-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.uv-hero-in {
  position: relative;
  display: grid;
  gap: 18px;
  padding-top: clamp(40px, 7vw, 84px);
  padding-bottom: clamp(32px, 5vw, 56px);
}
.uv-hero .title {
  max-width: 18ch;
}
.uv-install {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.uv-install .install button svg {
  width: 16px;
  height: 16px;
}
.uv-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 10px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--line);
  overflow: hidden;
  list-style: none;
  max-width: 760px;
}
.uv-stats li {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  background: var(--panel);
}
.uv-stats b {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.uv-stats span {
  font-size: 12.5px;
  color: var(--text-3);
}

/* App layout */

.uv-app {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 360px;
  max-width: 1600px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}
.uv-side {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px 16px 20px;
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.uv-group {
  display: grid;
  gap: 8px;
}
.uv-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0;
  font: 600 11px var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.uv-label small {
  font: 500 11px var(--mono);
  letter-spacing: 0;
  text-transform: none;
}
.uv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.uv-chips .chip small {
  font: 500 11px var(--mono);
  color: var(--text-3);
}
.uv-chips .chip[aria-pressed='true'] small {
  color: inherit;
  opacity: 0.8;
}
.uv-sets-group {
  min-height: 0;
  flex: 1;
  grid-template-rows: auto auto minmax(0, 1fr);
}
.uv-set-filter {
  height: 34px;
  font-size: 13px;
}
.uv-set-list {
  list-style: none;
  margin: 0 -6px 0 0;
  padding: 0 6px 0 0;
  overflow: auto;
  min-height: 0;
  scrollbar-width: thin;
}
.uv-set-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 32px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.uv-set-list button:hover {
  background: var(--line);
  color: var(--text);
}
.uv-set-list button[aria-pressed='true'] {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.uv-set-list button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uv-set-list em {
  display: block;
  font: 500 10.5px var(--mono);
  font-style: normal;
  color: var(--text-3);
}
.uv-set-list small {
  font: 500 11px var(--mono);
  color: var(--text-3);
}

/* Center: search and the virtual grid */

.uv-center {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.uv-topbar {
  position: sticky;
  top: var(--header-h);
  z-index: 5;
  display: grid;
  gap: 8px;
  padding: 16px 20px 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.uv-topbar .search {
  position: relative;
}
.uv-topbar .search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.uv-topbar .search input {
  height: 46px;
  padding-left: 42px;
  padding-right: 44px;
  font-size: 15px;
  border-radius: 13px;
}
.uv-topbar .search kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}
.uv-result {
  margin: 0;
  font: 500 12.5px var(--mono);
  color: var(--text-3);
}
.uv-grid {
  position: relative;
  height: calc(100vh - var(--header-h) - 103px);
  min-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  outline: none;
  contain: strict;
}
.uv-grid:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.uv-spacer {
  width: 1px;
}
.uv-layer {
  position: absolute;
  inset: 0 0 auto 0;
}
.uv-cell {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: var(--cell, 72px);
  height: var(--cell, 72px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--icon-bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.uv-cell[hidden] {
  display: none;
}
.uv-cell:hover {
  border-color: var(--line-3);
}
.uv-cell[aria-selected='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.uv-cell svg {
  width: 28px;
  height: 28px;
}
.uv-cell .uv-skel {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--line);
}
.uv-note {
  margin: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text-2);
  font-size: 14px;
}
.uv-note[hidden] {
  display: none;
}

/* Detail panel */

.uv-detail {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  max-height: calc(100vh - var(--header-h));
  overflow: auto;
  display: grid;
  gap: 16px;
  padding: 20px;
  border-left: 1px solid var(--line);
  scrollbar-width: thin;
}
.uv-preview {
  position: relative;
  display: grid;
  place-items: center;
  height: 210px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--icon-bg);
  color: var(--text);
  overflow: hidden;
}
.uv-preview[data-bg='light'] {
  background: #f4f2ee;
  color: #121014;
}
.uv-preview[data-bg='grid'] {
  background-image: linear-gradient(var(--line-2) 1px, transparent 1px), linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: 16px 16px;
  background-position: center;
}
.uv-preview .seg {
  position: absolute;
  right: 10px;
  bottom: 10px;
}
.uv-preview .seg button {
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
}
.uv-preview-icon {
  display: grid;
  place-items: center;
  min-height: 140px;
}
.uv-preview-icon svg {
  max-width: 150px;
  max-height: 150px;
}
.uv-detail-head {
  display: grid;
  gap: 4px;
}
.uv-name {
  font: 600 16px/1.3 var(--mono);
  letter-spacing: -0.01em;
  word-break: break-all;
}
.uv-meta {
  margin: 0;
  font-size: 13px;
}
.uv-meta a {
  color: var(--text-2);
}
.uv-license {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}
.uv-license:empty {
  display: none;
}
.uv-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.uv-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font: 500 11.5px var(--mono);
  color: var(--text-2);
  text-decoration: none;
}
.uv-badge.warn {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent-text);
}
.uv-attrib {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--radius-xs);
  background: var(--accent-soft);
}
.uv-attrib p {
  margin: 0;
  color: var(--text);
}
.uv-attrib .btn {
  justify-self: start;
}
.uv-form {
  display: grid;
  gap: 12px;
}
.uv-form[hidden] {
  display: none;
}
.uv-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}
.field.off {
  opacity: 0.45;
}
.uv-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.uv-copy .code pre {
  max-height: 260px;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Set table */

.uv-sets .section-head {
  max-width: 820px;
}
.uv-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.uv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.uv-table th,
.uv-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.uv-table th {
  position: sticky;
  top: 0;
  background: var(--panel-2);
  font: 600 11px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.uv-table td.num,
.uv-table th.num {
  text-align: right;
  font-family: var(--mono);
}
.uv-table code {
  white-space: nowrap;
}
.uv-table a {
  color: var(--text-2);
}
.uv-table tr:last-child td {
  border-bottom: 0;
}
.uv-sub {
  margin: 48px 0 14px;
  font-size: 1.35rem;
}
.uv-credits {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow-wrap: anywhere;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 13.5px;
}
.uv-credits a {
  color: var(--text-2);
}
.uv-fine {
  color: var(--text-3);
  font-size: 13.5px;
  max-width: 80ch;
}

@media (max-width: 1180px) {
  .uv-app {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .uv-detail {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .uv-app {
    grid-template-columns: minmax(0, 1fr);
  }
  .uv-side {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .uv-set-list {
    max-height: 220px;
  }
  .uv-detail {
    grid-template-columns: minmax(0, 1fr);
  }
  .uv-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .uv-grid {
    height: 70vh;
  }
}

@media (max-width: 560px) {
  .uv-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* View tabs */

.uv-views {
  position: sticky;
  top: var(--header-h);
  z-index: 8;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.uv-views .wrap {
  display: flex;
  gap: 4px;
  max-width: 1600px;
  padding-top: 8px;
  padding-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.uv-views a {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.uv-views a:hover {
  color: var(--text);
  background: var(--line);
}
.uv-views a[aria-current='true'] {
  color: var(--accent-text);
  background: var(--accent-soft);
}
.uv-app[hidden],
.gx[hidden] {
  display: none;
}
.uv-app {
  --sticky: calc(var(--header-h) + 51px);
}
.uv-app .uv-side,
.uv-app .uv-detail,
.uv-app .uv-topbar {
  top: var(--sticky);
}
.uv-app .uv-side {
  height: calc(100vh - var(--sticky));
}
.uv-app .uv-detail {
  max-height: calc(100vh - var(--sticky));
}
.uv-app .uv-grid {
  height: calc(100vh - var(--sticky) - 103px);
}
/* One column on tablets and phones: the side and detail panels are static, not viewport high. */
@media (max-width: 1180px) {
  .uv-app .uv-detail {
    max-height: none;
  }
}
@media (max-width: 760px) {
  .uv-app .uv-side {
    height: auto;
  }
}

/* Sets gallery */

.gx {
  padding: 24px 0 64px;
  border-bottom: 1px solid var(--line);
}
.gx .wrap {
  max-width: 1600px;
}
.gx-head {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}
.gx-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gx-count {
  font: 500 14px var(--mono);
  color: var(--text-3);
  letter-spacing: 0;
}
.gx-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.gx-filter {
  width: min(320px, 100%);
}
.gx-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
}
.gx-sort select {
  width: auto;
}
.gx-chips {
  justify-content: flex-start;
  gap: 16px;
}
.gx-controls {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) minmax(140px, 1fr) auto auto auto;
  gap: 18px;
  align-items: end;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.gx-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 4px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.gx-switch i {
  position: relative;
  width: 36px;
  height: 24px;
  border-radius: 999px;
  background: var(--line-2);
  transition: background 0.2s;
}
.gx-switch i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s var(--spring);
}
.gx-switch[aria-checked='true'] {
  color: var(--accent-text);
  border-color: var(--accent);
}
.gx-switch[aria-checked='true'] i {
  background: var(--accent);
}
.gx-switch[aria-checked='true'] i::after {
  transform: translateX(12px);
}
.gx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.gx-card {
  position: relative;
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, white 3%), var(--panel));
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.25s;
}
.gx-card:hover {
  border-color: var(--line-3);
  box-shadow: var(--shadow);
}
.gx-card:focus-within {
  border-color: var(--accent);
}
.gx-card.picked {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), var(--panel));
}
.gx-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.gx-card h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
  line-height: 1.25;
  min-width: 0;
}
.gx-card h3 a {
  color: var(--text);
  text-decoration: none;
}
.gx-card h3 a:focus-visible {
  outline: none;
}
.gx-n {
  flex: none;
  font: 600 13px var(--mono);
  color: var(--text-2);
}
.gx-by {
  margin: -6px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gx-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.gx-badges .uv-badge {
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
}
.gx-badges .uv-badge.lic {
  color: var(--text);
  border-color: var(--line-3);
}
.gx-badges .uv-badge.draw {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent-text);
  background: var(--accent-soft);
}
.gx-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--icon-bg);
  border: 1px solid var(--line);
  min-height: 104px;
}
.gx-ic {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  color: var(--text);
}
.gx-ic svg {
  display: block;
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
}
.gx-ic.none {
  border: 1px dashed var(--line-2);
  border-radius: 8px;
}
.gx-pick {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.gx-pick[hidden] {
  display: none;
}
.gx-pick input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .gx-card:hover .gx-ic.s [pathLength] {
    stroke-dasharray: 1;
    animation: gx-draw 0.9s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 45ms);
  }
  .gx-card:hover .gx-ic.f svg {
    animation: gx-pop 0.5s var(--spring) both;
    animation-delay: calc(var(--i, 0) * 30ms);
  }
}
@keyframes gx-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes gx-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.16);
  }
  100% {
    transform: scale(1);
  }
}

/* Compare */

.gx-compare {
  margin-bottom: 18px;
}
.gx-compare[hidden] {
  display: none;
}
.gx-cmp {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--panel);
  overflow-x: auto;
}
.gx-cmp-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.gx-cmp-head p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}
.gx-cmp table {
  width: 100%;
  border-collapse: collapse;
}
.gx-cmp th,
.gx-cmp td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.gx-cmp thead th {
  font-size: 13.5px;
  color: var(--text);
}
.gx-cmp tbody th {
  text-align: left;
  font: 500 12.5px var(--mono);
  color: var(--text-3);
  white-space: nowrap;
}
.gx-cmp td .gx-ic {
  width: 52px;
  margin: 0 auto;
}
.gx-cmp td small {
  display: block;
  margin-top: 4px;
  font: 500 10.5px var(--mono);
  color: var(--text-3);
  word-break: break-all;
}
.gx-cmp tr:last-child th,
.gx-cmp tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 1100px) {
  .gx-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .gx-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gx-controls .field:has(.seg) {
    grid-column: 1 / -1;
  }
  .gx-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
