/* hai-hub platform shell + shared hub components — mobile-first, on top of colors_and_type.css + site.css */

/* ===== Reveal: visible by default, hidden only once JS can drive it ==== */
.reveal { opacity: 1; transform: none; filter: none; }
.reveal-line > span { transform: none; opacity: 1; }
html.js-reveal .reveal:not(.is-in) { opacity: 0; transform: translateY(18px); }
html.js-reveal .reveal-line:not(.is-in) > span { transform: translateY(110%); opacity: 0; }

/* ===== Shell layout ================================================== */
body[data-hub-page] { background: var(--bg); }
.hub-main { min-height: 100vh; }
.hub-section { padding: 56px 0; }
.hub-container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Mobile topbar */
.hub-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  height: 60px; padding: 0 16px;
  background: rgba(247, 243, 238, 0.78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease-standard);
}
.hub-topbar.is-scrolled { border-bottom-color: var(--border); }
.hub-topbar__burger { width: 40px; height: 40px; padding: 8px; margin-left: -8px; border-radius: 10px; color: var(--fg); }
.hub-topbar__burger:hover { background: var(--hai-graphite-10); }
.hub-topbar__burger svg { width: 24px; height: 24px; }
.hub-topbar__logo { margin-right: auto; }
.hub-topbar__logo img { height: 22px; }
.hub-topbar__cta {
  padding: 9px 16px; border-radius: var(--radius-pill);
  background: var(--hai-graphite); color: var(--hai-off-white);
  font-size: 13px; font-weight: 500; text-decoration: none;
}

/* Sidebar (desktop) */
.hub-side {
  display: none;
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: 256px;
  flex-direction: column;
  background: var(--hai-off-white);
  border-right: 1px solid var(--border);
  padding: 28px 16px 20px;
  overflow-y: auto;
}
.hub-side__logo { display: block; padding: 0 12px; margin-bottom: 32px; }
.hub-side__logo img { height: 34px; }
.hub-side__nav { flex: 1; display: flex; flex-direction: column; gap: 26px; }
.hs-group__label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: var(--ls-wide); text-transform: uppercase;
  color: var(--fg-subtle);
  padding: 0 12px; margin-bottom: 8px;
}
.hs-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 12px;
  font-size: 14px; font-weight: 500; color: var(--fg-muted);
  text-decoration: none;
  transition: background 160ms var(--ease-hover), color 160ms var(--ease-hover);
}
.hs-link:hover { background: var(--hai-graphite-10); color: var(--fg); }
.hs-link.is-active { background: var(--hai-graphite); color: var(--hai-off-white); }
.hs-link.is-active .hs-link__icon { color: var(--hai-aqua-soft); }
.hs-link__icon { display: inline-flex; width: 19px; height: 19px; color: var(--fg-subtle); }
.hs-link:hover:not(.is-active) .hs-link__icon { color: var(--fg); }
.hs-link__icon svg { width: 19px; height: 19px; }
.hs-member {
  margin-top: 26px;
  background: var(--hai-ocean);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.hs-member__eyebrow {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: var(--ls-wide); text-transform: uppercase;
  color: var(--hai-aqua-soft); margin-bottom: 8px;
}
.hs-member p { font-size: 13px; line-height: 1.5; color: rgba(247,243,238,0.78); margin: 0 0 12px; }
.hs-member__cta {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--radius-pill);
  background: var(--hai-off-white); color: var(--hai-ocean);
  font-size: 13px; font-weight: 500; text-decoration: none;
  transition: background 160ms var(--ease-hover), transform 160ms var(--ease-hover);
}
.hs-member__cta:hover { background: #fff; transform: translateY(-1px); }
.hs-member__cta .arrow { font-family: var(--font-mono); }

/* Drawer (mobile) */
.hub-scrim {
  position: fixed; inset: 0; z-index: 58;
  background: rgba(17, 17, 17, 0.4);
  opacity: 0; pointer-events: none;
  transition: opacity 220ms var(--ease-standard);
}
.hub-scrim.is-open { opacity: 1; pointer-events: auto; }
.hub-drawer {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: min(310px, 86vw);
  background: var(--hai-off-white);
  padding: 20px 16px;
  transform: translateX(-102%);
  transition: transform 300ms var(--ease-standard);
  overflow-y: auto;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.hub-drawer.is-open { transform: translateX(0); }
.hub-drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.hub-drawer__head img { height: 22px; }
.hub-drawer__close { width: 38px; height: 38px; padding: 8px; border-radius: 10px; color: var(--fg); }
.hub-drawer__close:hover { background: var(--hai-graphite-10); }
.hub-drawer__close svg { width: 22px; height: 22px; }
.hub-drawer__nav { flex: 1; display: flex; flex-direction: column; gap: 24px; }

@media (min-width: 1080px) {
  .hub-topbar, .hub-scrim, .hub-drawer { display: none; }
  .hub-side { display: flex; }
  .hub-main { margin-left: 256px; }
  .hub-section { padding: 88px 0; }
  .hub-container { padding: 0 44px; }
}

/* ===== Header nav mode (alternative to sidebar) ======================= */
.hub-header { display: none; }
body[data-nav-mode="header"] .hub-side { display: none; }
body[data-nav-mode="header"] .hub-main { margin-left: 0; }
body[data-nav-mode="header"] .hub-topbar { display: none; }
body[data-nav-mode="header"] .hub-header {
  display: block;
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 243, 238, 0.78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease-standard);
}
body[data-nav-mode="header"] .hub-header.is-scrolled { border-bottom-color: var(--border); }
.hub-header__inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  height: 64px; padding: 0 20px;
}
.hub-header__logo { display: inline-flex; margin-right: auto; }
.hub-header__logo img { height: 23px; }
.hub-header__nav { display: none; gap: 4px; }
.hh-link {
  padding: 8px 13px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 500; color: var(--fg-muted);
  text-decoration: none; white-space: nowrap;
  transition: background 160ms var(--ease-hover), color 160ms var(--ease-hover);
}
.hh-link:hover { background: var(--hai-graphite-10); color: var(--fg); }
.hh-link.is-active { color: var(--fg); background: var(--hai-graphite-10); }
.hub-header__actions { display: none; align-items: center; gap: 10px; }
.hub-header__ghost {
  font-size: 14px; font-weight: 500; color: var(--fg); text-decoration: none;
  padding: 9px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  transition: border-color 160ms var(--ease-hover);
}
.hub-header__ghost:hover { border-color: var(--fg); }
.hub-header__cta {
  padding: 10px 18px; border-radius: var(--radius-pill);
  background: var(--hai-graphite); color: var(--hai-off-white);
  font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background 160ms var(--ease-hover);
}
.hub-header__cta:hover { background: var(--hai-graphite-80); }
.hub-header__burger { display: inline-flex; }
@media (min-width: 1080px) {
  body[data-nav-mode="header"] .hub-header__nav,
  body[data-nav-mode="header"] .hub-header__actions { display: flex; }
  body[data-nav-mode="header"] .hub-header__burger { display: none; }
  .hub-header__inner { height: 72px; padding: 0 32px; }
}

/* Layout switch (prototype control) */
.nav-switch {
  position: fixed; z-index: 70; right: 16px; bottom: 16px;
  display: flex; align-items: center; gap: 4px;
  background: var(--hai-off-white);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 5px 6px 5px 14px;
  box-shadow: var(--shadow-md);
}
.nav-switch__label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: var(--ls-wide); text-transform: uppercase;
  color: var(--fg-subtle); margin-right: 6px;
}
.nav-switch button {
  font: 500 12px/1 var(--font-sans);
  padding: 7px 12px; border-radius: var(--radius-pill);
  color: var(--fg-muted); cursor: pointer; background: transparent;
  transition: background 160ms var(--ease-hover), color 160ms var(--ease-hover);
}
.nav-switch button:hover { color: var(--fg); }
.nav-switch button.is-on { background: var(--hai-graphite); color: var(--hai-off-white); }
@media (max-width: 700px) { .nav-switch__label { display: none; } .nav-switch { padding-left: 6px; } }

/* ===== Page header ==================================================== */
.hub-head { padding: 44px 0 0; }
.hub-head h1 {
  font-family: var(--font-display, var(--font-sans));
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 700; font-stretch: 115%;
  letter-spacing: -0.035em; line-height: 1.0;
  margin: 14px 0 18px; text-wrap: balance;
}
.hub-head h1 .dot { color: var(--hai-coral); }
.hub-head__lede { font-size: 17px; line-height: 1.6; color: var(--fg-muted); max-width: 58ch; margin: 0; }
@media (min-width: 1080px) { .hub-head { padding-top: 72px; } }

/* ===== Generic hub cards ============================================= */
.h-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.h-grid--2, .h-grid--3 { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .h-grid--2 { grid-template-columns: 1fr 1fr; }
  .h-grid--3 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1180px) { .h-grid--3 { grid-template-columns: 1fr 1fr 1fr; } }

.h-card {
  display: flex; flex-direction: column; gap: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  text-decoration: none; color: inherit;
  position: relative; overflow: hidden;
  transition: transform 220ms var(--ease-hover), box-shadow 220ms var(--ease-hover), border-color 220ms var(--ease-hover);
}
a.h-card:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.h-card__top {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: var(--ls-wide); text-transform: uppercase;
  color: var(--fg-subtle);
}
.h-card h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; margin: 0; }
.h-card p { font-size: 14px; line-height: 1.55; color: var(--fg-muted); margin: 0; }
.h-card__foot {
  margin-top: auto; padding-top: 14px;
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px dashed var(--border);
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: var(--ls-wide); text-transform: uppercase;
  color: var(--fg-muted);
}
.h-card__foot .arrow { color: var(--fg); transition: transform 200ms var(--ease-hover); }
a.h-card:hover .h-card__foot .arrow { transform: translateX(4px); }

/* Mono tag pill (matches .release__tag) */
.h-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: var(--ls-wide); text-transform: uppercase;
  color: var(--fg-muted);
}
.h-tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--hai-ocean); }
.h-tag--aqua { border-color: rgba(31,95,93,0.35); color: var(--hai-aqua-deep); }
.h-tag--aqua::before { background: var(--hai-aqua); }
.h-tag--ocean { border-color: rgba(18,59,82,0.3); color: var(--hai-ocean); }
.h-tag--ocean::before { background: var(--hai-ocean); }

/* Members badge */
.h-members {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--hai-ocean-wash);
  border: 1px solid rgba(18,59,82,0.24);
  color: var(--hai-ocean);
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: var(--ls-wide); text-transform: uppercase;
}
.h-members::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--hai-ocean); }

/* Section head (compact hub variant) */
.hub-sechead {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px; margin-bottom: 28px; flex-wrap: wrap;
}
.hub-sechead h2 {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700; font-stretch: 112%;
  letter-spacing: -0.025em; line-height: 1.06;
  margin: 10px 0 0;
}
.hub-sechead .btn-link { flex-shrink: 0; }

/* ===== Gated content (soft paywall blur) ============================= */
.gate { position: relative; border-radius: inherit; }
.gate__blur {
  filter: blur(7px);
  user-select: none; pointer-events: none;
  opacity: 0.75;
}
.gate__overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 24px;
  background: linear-gradient(180deg, rgba(247,243,238,0) 0%, rgba(247,243,238,0.82) 46%, rgba(247,243,238,0.95) 100%);
  border-radius: inherit;
}
.gate__overlay p { font-size: 14px; font-weight: 500; color: var(--fg); margin: 0; max-width: 34ch; }
.gate__cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-pill);
  background: var(--hai-graphite); color: var(--hai-off-white);
  font: 500 14px/1 var(--font-sans); text-decoration: none;
  transition: background 160ms var(--ease-hover), transform 160ms var(--ease-hover);
}
.gate__cta:hover { background: var(--hai-graphite-80); transform: translateY(-1px); }

/* ===== Ratings ======================================================== */
.score-badge {
  display: inline-flex; align-items: baseline; gap: 2px;
  font-family: var(--font-mono); font-weight: 500;
  font-size: 22px; letter-spacing: -0.02em;
  color: var(--fg);
}
.score-badge small { font-size: 12px; color: var(--fg-subtle); font-weight: 400; }
.score-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px; padding: 8px 10px;
  border-radius: 14px;
  background: var(--hai-graphite); color: var(--hai-off-white);
  font-family: var(--font-mono); font-size: 18px; font-weight: 500;
  letter-spacing: -0.02em;
}
.score-pill--aqua { background: var(--hai-ocean); color: #fff; }

.stars { display: inline-flex; gap: 2px; color: var(--hai-ocean); }
.stars svg { width: 14px; height: 14px; }
.stars .is-empty { color: var(--hai-graphite-20); }

.crit { display: flex; flex-direction: column; gap: 7px; }
.crit__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.crit__name { font-size: 14px; font-weight: 500; }
.crit__num { font-family: var(--font-mono); font-size: 14px; font-weight: 500; }
.crit__bar { height: 4px; background: var(--hai-graphite-10); border-radius: 2px; overflow: hidden; }
.crit__bar > div { height: 100%; width: var(--w, 0%); background: var(--hai-ocean); border-radius: 2px; transition: width 1s var(--ease-standard); }
.crit--high > div, .crit__bar.is-high > div { background: var(--hai-aqua); }

/* ===== Filter chips =================================================== */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.chip {
  font: 500 13px/1 var(--font-sans);
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent; color: var(--fg-muted);
  cursor: pointer;
  transition: all 180ms var(--ease-hover);
}
.chip:hover { color: var(--fg); border-color: var(--border-strong); }
.chip.is-active { background: var(--hai-graphite); color: var(--hai-off-white); border-color: var(--hai-graphite); }
.chip__count { font-family: var(--font-mono); font-size: 10px; margin-left: 7px; opacity: 0.55; }

/* ===== Search ========================================================= */
.hub-search {
  display: flex; align-items: center; gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 6px 6px 20px;
  max-width: 560px;
  transition: border-color 200ms var(--ease-hover), box-shadow 200ms var(--ease-hover);
}
.hub-search:focus-within { border-color: var(--hai-ocean); box-shadow: 0 0 0 3px rgba(18,59,82,0.08); }
.hub-search svg { width: 18px; height: 18px; color: var(--fg-subtle); flex-shrink: 0; }
.hub-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font: 500 15px/1 var(--font-sans); color: var(--fg);
  padding: 11px 0; min-width: 0;
}
.hub-search input::placeholder { color: var(--fg-subtle); font-weight: 400; }
.hub-search kbd {
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-subtle);
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 7px;
  margin-right: 8px;
}

/* ===== Footer (hub variant) ========================================== */
.hub-foot { border-top: 1px solid var(--border); padding: 56px 20px 32px; }
.hub-foot__top {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  padding-bottom: 40px;
}
.hub-foot__brand { grid-column: 1 / -1; }
.hub-foot__brand img { height: 24px; margin-bottom: 14px; }
.hub-foot__brand p { font-size: 14px; color: var(--fg-muted); line-height: 1.55; max-width: 38ch; margin: 0; }
.hub-foot h5 {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: var(--ls-wide); text-transform: uppercase;
  color: var(--fg-muted); margin: 0 0 16px; font-weight: 500;
}
.hub-foot ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.hub-foot a {
  color: var(--fg); text-decoration: none; font-size: 14px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 200ms var(--ease-hover);
}
.hub-foot a:hover { background-size: 100% 1px; }
.hub-foot__bottom {
  max-width: 1180px; margin: 0 auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-top: 22px; border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: var(--ls-wide); text-transform: uppercase;
  color: var(--fg-muted);
}
.hub-foot__bottom a { font: inherit; letter-spacing: inherit; }
/* Empty state for collections without published items. */
.hub-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  padding: 56px 24px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.5);
}
.hub-empty img { width: 44px; height: 44px; margin-bottom: 6px; }
.hub-empty h3 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; margin: 0; max-width: 24ch; text-wrap: balance; }
.hub-empty p { font-size: 15.5px; line-height: 1.6; color: var(--fg-muted); margin: 0 0 10px; max-width: 48ch; }
@media (min-width: 900px) {
  .hub-foot { padding: 64px 44px 36px; }
  .hub-foot__top { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .hub-foot__brand { grid-column: auto; }
}

/* ===== Misc =========================================================== */
.hub-band {
  background: var(--hai-graphite); color: var(--hai-off-white);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  position: relative; overflow: hidden;
}
.hub-band::before {
  content: ""; position: absolute;
  width: 320px; height: 320px; border-radius: 50%;
  background: rgba(217,233,232,0.13); filter: blur(60px);
  right: -100px; top: -120px;
}
.hub-band--stone,
.hub-band--sand { background: var(--hai-stone); color: var(--fg); }
.hub-band--stone::before,
.hub-band--sand::before { background: rgba(255,255,255,0.5); }
.hub-band--ocean { background: var(--hai-ocean); }
@media (min-width: 900px) { .hub-band { padding: 44px 48px; } }

.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--hai-stone);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  color: var(--hai-ocean); flex-shrink: 0;
}
