/* ============================================================
   Unki Studio — tools hub
   Search, category filters and the tool grid.
   ============================================================ */

/* Hero */
.hub-hero {
  padding-top: clamp(48px, 6vw, 72px);
  padding-bottom: clamp(32px, 4vw, 40px);
}
.hub-hero__title {
  max-width: 20ch;
  margin-top: var(--space-5);
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(36px, 5.6vw, 58px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.hub-hero__lead {
  max-width: 62ch;
  margin-top: var(--space-5);
  color: var(--text-muted);
  font-size: clamp(16.5px, 1.4vw, 18px);
  line-height: 1.65;
}
.hub-trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-6);
}
.hub-trust li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
}
.hub-trust i {
  color: var(--accent);
  font-size: 11px;
}

/* Index bar */
.hub-index { padding-top: 0; }
.hub-index__bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
@media (min-width: 768px) {
  .hub-index__bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
  }
}

/* Search */
.hub-search { width: 100%; max-width: 540px; }
.hub-search__field { position: relative; display: flex; align-items: center; }
.hub-search__field > i {
  position: absolute;
  left: 16px;
  color: var(--text-soft);
  font-size: 13px;
  pointer-events: none;
}
.hub-search input {
  width: 100%;
  height: 48px;
  padding: 0 56px 0 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  transition: border-color var(--t-fast) ease-out, box-shadow var(--t-fast) ease-out;
}
.hub-search input::placeholder { color: var(--text-faint); opacity: 1; }
.hub-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring-accent);
}
.hub-search input::-webkit-search-cancel-button { cursor: pointer; }
.hub-search__kbd {
  position: absolute;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
}
.hub-search input:focus ~ .hub-search__kbd { opacity: 0; }

.hub-count {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Category chips */
.hub-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.hub-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.hub-filters__label {
  margin-right: 2px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}
.hub-filter-bar__cue { display: none; }
.hub-chip {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color var(--t-fast) ease-out,
    border-color var(--t-fast) ease-out,
    color var(--t-fast) ease-out;
}
.hub-chip:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--text);
}
.hub-chip[aria-pressed="true"] {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Grid */
.hub-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}
@media (min-width: 640px) {
  .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
}
@media (min-width: 1024px) {
  .hub-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.hub-card { display: flex; }
.hub-card[hidden] { display: none; }
.hub-card__link {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition:
    background-color var(--t-fast) ease-out,
    border-color var(--t-fast) ease-out,
    transform var(--t-base) var(--ease);
}
.hub-card__link:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--text);
  text-decoration: none;
  transform: translateY(-2px);
}
.hub-card__link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
.hub-card__head {
  display: flex;
  align-items: center;
  gap: 11px;
}
.hub-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-sunken);
  color: var(--text-soft);
  font-size: 13px;
  transition:
    background-color var(--t-fast) ease-out,
    border-color var(--t-fast) ease-out,
    color var(--t-fast) ease-out;
}
.hub-card__link:hover .hub-card__icon {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}
.hub-card__name {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.005em;
}
.hub-card__desc {
  flex: 1;
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.6;
}
.hub-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: 2px;
}
.hub-card__cat {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  line-height: 1.4;
  text-transform: uppercase;
}
.hub-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
}
.hub-card__badge--local {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Empty state */
.hub-empty {
  padding: var(--space-7) var(--space-5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}
.hub-empty[hidden] { display: none; }
.hub-empty > i {
  color: var(--text-faint);
  font-size: 22px;
}
.hub-empty h3 {
  margin-top: var(--space-4);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.hub-empty p {
  max-width: 46ch;
  margin: var(--space-3) auto 0;
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.65;
}
.hub-empty p code {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
}
.hub-empty .us-btn { margin-top: var(--space-5); }

/* Notes */
.hub-notes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}
@media (min-width: 768px) {
  .hub-notes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
}
.hub-note {
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.hub-note i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
}
.hub-note h3 {
  margin-top: var(--space-4);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.35;
}
.hub-note p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* About section sits on the sunken band; lift the cards onto the canvas */
.hub-about .hub-note { background: var(--surface-sunken); }

/* Contact: clear the band above, and centre the single CTA in its column */
.hub-contact { padding-top: clamp(56px, 6vw, 80px); }
.hub-contact .us-contact { align-items: center; }
.hub-contact .us-contact__aside {
  display: flex;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .hub-card__link:hover { transform: none; }
}

/* Mobile: keep the category chips on one swipeable row */
@media (max-width: 640px) {
  .hub-filter-bar { flex-wrap: nowrap; }
  .hub-filters {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .hub-filters::-webkit-scrollbar { display: none; }
  .hub-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
  .hub-filter-bar.has-overflow .hub-filter-bar__cue {
    display: inline-block;
    flex: 0 0 auto;
    color: var(--text-faint);
    font-size: 10px;
    line-height: 1;
    transition: opacity var(--t-fast) ease-out;
  }
  .hub-filter-bar.is-scroll-end .hub-filter-bar__cue { opacity: 0; }
}
