/* ═══════════════════════════════════════════════════════════════
   shared/collection.css — subject pages (/human-body/ …) and the
   on top of site.css + page.css + home.css + stage.css. The hero is
   the library's stage playing this subject's scene (library/banner.js);
   then glass topic chips, wide tool cards that fill each row, and the
   article beside the FAQ (§5.14). Each page tints with --hub (inline).
   Every rule is scoped under .hub.
   ═══════════════════════════════════════════════════════════════ */

.hub { --hub: var(--accent); }
.hub .site-nav--hub { margin: 0 0 8px; }

/* ── Hero: the library's stage (shared/stage.css), its scene this subject's ── */
.hub { max-width: 1180px; padding-top: 64px; }
.hub-stage {
  min-height: 420px;
  background:
    radial-gradient(closest-side at 76% 50%, color-mix(in srgb, var(--hub) 12%, transparent), transparent),
    linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 60%), #0b1017;
}
.hub-head { position: relative; z-index: 1; max-width: 640px; padding: 18px 32px 96px; pointer-events: none; }
.hub-head a, .hub-head .site-nav { pointer-events: auto; }
.hub .hub-head .site-nav--hub { margin: 0 0 30px; }
.hub-kicker { margin: 0 0 10px; font-size: .95rem; font-weight: 600; line-height: 1.3; color: var(--hub); }
.hub-head h1 {
  max-width: 16ch;
  margin: 0 0 14px;
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.038em;
  text-wrap: balance;
}
.hub-head h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--hub) 0%, color-mix(in srgb, var(--hub) 45%, #e0f2fe) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hub-lede {
  max-width: 54ch;
  margin: 0;
  font-size: clamp(.98rem, 1.3vw, 1.08rem);
  line-height: 1.6;
  color: var(--home-ink);
  text-wrap: pretty;
}
.hub-stats { display: flex; flex-wrap: wrap; gap: 8px 30px; margin: 22px 0 0; padding: 0; list-style: none; }
.hub-stats li { display: flex; align-items: baseline; gap: 7px; }
.hub-stats b { font-size: 1.6rem; font-weight: 750; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.hub-stats span { font-size: .84rem; color: var(--home-dim); }

/* Topic jump bar under the stage */
.hub-jump { margin: 18px 0 44px; }
.hub-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hub-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: .86rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: var(--home-glass);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--home-line);
  transition: border-color .2s, transform .1s ease-out;
}
.hub-chips a::after { content: "\2193"; margin-left: 7px; color: var(--hub); }
.hub-chips a:hover { border-color: color-mix(in srgb, var(--hub) 55%, transparent); }
.hub-chips a:active { transform: scale(.97); }
.hub-chips a:focus-visible { outline: 2px solid var(--hub); outline-offset: 2px; }

/* ── Topic sections: wide cards that fill the row ───────────────
   Two per row, art beside the text; an odd last card takes the whole row,
   so a topic with one or three tools never leaves half the page empty. */
.hub-topic { margin: 0 0 48px; scroll-margin-top: 24px; }
.hub-topic-head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--home-line); }
.hub-topic-head h2 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 1.8rem); font-weight: 750; letter-spacing: -.028em; }
.hub-topic-head span { font-size: .86rem; font-weight: 600; color: var(--hub); font-variant-numeric: tabular-nums; }
@media (min-width: 768px) {
  .hub .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .hub .hub-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .hub .hub-grid .home-feature { display: grid; grid-template-columns: minmax(180px, 34%) minmax(0, 1fr); grid-template-rows: 1fr auto; }
  .hub .hub-grid .home-feature-art { grid-row: 1 / span 2; aspect-ratio: auto; min-height: 200px; border-bottom: 0; border-right: 1px solid var(--home-line); }
  .hub .hub-grid .home-feature-art img, .hub .hub-grid .home-feature-art svg { width: 112px; height: 112px; }
  .hub .hub-grid > :last-child:nth-child(odd) .home-feature-art img,
  .hub .hub-grid > :last-child:nth-child(odd) .home-feature-art svg { width: 136px; height: 136px; }
  .hub .hub-grid > :last-child:nth-child(odd) .home-feature-text { max-width: 64ch; }
  .hub .hub-grid .home-feature-body { padding-top: 22px; }
}
.hub-lib {
  margin: 0 0 56px;
  padding: 16px 20px;
  border-radius: 16px;
  font-size: .95rem;
  color: var(--home-dim);
  background: var(--home-glass);
  border: 1px solid var(--home-line);
}
.hub-lib a { font-weight: 600; color: var(--accent); text-decoration: none; }
.hub-lib a:hover { text-decoration: underline; }

/* ── Article and FAQ: quiet prose, side by side on wide screens ── */
.hub-more { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 56px; align-items: start; margin: 0 0 64px; }
.hub-article { max-width: 72ch; margin: 0; }
.hub-article h2 { margin: 36px 0 12px; font-size: 1.5rem; font-weight: 750; letter-spacing: -.025em; }
.hub-article h2:first-child { margin-top: 0; }
.hub-article p { margin: 0 0 14px; font-size: 1rem; line-height: 1.7; color: var(--home-ink); }
.hub-article a { color: var(--accent); }
.hub-table { width: 100%; margin: 6px 0 18px; border-collapse: collapse; font-size: .92rem; }
.hub-table th, .hub-table td { padding: 11px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--home-line); }
.hub-table th { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--home-dim); }
.hub-table td:first-child { color: var(--home-ink); }
.hub-table td a { font-weight: 600; text-decoration: none; }
.hub-table td a:hover { text-decoration: underline; }

.hub-faq { position: sticky; top: 24px; max-width: 72ch; margin: 0; }
.hub-faq > h2 { margin: 0 0 14px; font-size: 1.5rem; font-weight: 750; letter-spacing: -.025em; }
.hub-faq-item { border-top: 1px solid var(--home-line); }
.hub-faq-item:last-child { border-bottom: 1px solid var(--home-line); }
.hub-faq-item summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 0;
  list-style: none;
  cursor: pointer;
}
.hub-faq-item summary::-webkit-details-marker { display: none; }
.hub-faq-item summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; color: var(--hub); transition: transform .3s var(--home-ease); }
.hub-faq-item[open] summary::after { transform: rotate(45deg); }
.hub-faq-item summary:focus-visible { outline: 2px solid var(--hub); outline-offset: 2px; border-radius: 6px; }
.hub-faq-item h3 { margin: 0; font-size: 1.02rem; font-weight: 650; letter-spacing: -.01em; }
.hub-faq-item p { margin: 0 0 16px; font-size: .96rem; line-height: 1.65; color: var(--home-ink); }

/* ── Phone (< 768 px) ─────────────────────────────────────────── */
@media (max-width: 990px) {
  .hub-more { grid-template-columns: 1fr; gap: 40px; }
  .hub-faq { position: static; }
}
@media (max-width: 767px) {
  .hub { padding-top: 60px; }
  .hub-stage { min-height: 0; }
  .hub-head { padding: 14px 16px 84px; }
  .hub .hub-head .site-nav--hub { margin-bottom: 18px; }
  .hub-head h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
  .hub-lede { font-size: .95rem; line-height: 1.55; }
  .hub-stats { gap: 6px 20px; margin-top: 16px; }
  .hub-stats b { font-size: 1.35rem; }

  /* topic chips scroll sideways instead of wrapping into a wall */
  .hub-jump { margin: 14px 0 32px; }
  .hub-chips { flex-wrap: nowrap; margin: 0 -16px; padding: 0 16px 4px; overflow-x: auto; scrollbar-width: none; }
  .hub-chips::-webkit-scrollbar { display: none; }
  .hub-chips li { flex: none; }
  .hub-chips a { min-height: 40px; }
  .hub-topic { margin-bottom: 40px; }
  .hub-table th:first-child, .hub-table td:first-child { width: 48%; }
  .hub-table th, .hub-table td { padding: 10px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .hub-chips a, .hub-faq-item summary::after { transition: none; }
  .hub-chips a:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .hub-chips a { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .hub-chips a { border-color: rgba(255, 255, 255, .5); }
}
