/* ============================================================================
   WEFT FEDERATION — hub site layout
   ----------------------------------------------------------------------------
   Layered on colors_and_type.css (the token + type source of truth). Faithful
   recreation of the weft-hub UI kit from the Weft Design System handoff:
   terminal-grade, dark-teal canonical, JetBrains Mono product face with
   Space Grotesk reserved for brand moments.
   ============================================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }
body {
  background: var(--surface-base);
  color: var(--text-primary);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga" 1, "calt" 1;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--surface-base); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }

.mark { display: block; flex: 0 0 auto; }

/* ---- links --------------------------------------------------------------- */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
/* external-link affordance */
.ext::after { content: " \2197"; font-size: 0.85em; color: var(--text-muted); }

/* ---- shared section width ------------------------------------------------ */
.hero, .roster, .composition, .weave, .hub-footer { max-width: 980px; margin: 0 auto; }

/* ============================ HEADER ============================ */
.hub-header {
  display: flex; align-items: center; gap: 22px;
  padding: 12px 30px;
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-raised);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand .mark { color: var(--text-primary); }
.wordmark {
  font-family: var(--font-display); font-size: 19px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--text-primary); white-space: nowrap;
}
.path-hint { font-size: 11px; color: var(--text-muted); margin-left: 2px; }

.hub-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.hub-nav a {
  font-size: 12px; color: var(--text-secondary); text-decoration: none;
  padding: 6px 11px; border-radius: var(--radius); white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.hub-nav a:hover, .hub-nav a:focus-visible {
  background: var(--surface-overlay); color: var(--text-primary); text-decoration: none;
}
.hub-nav a.ext::after { content: " \2197"; font-size: 0.8em; opacity: 0.6; }

/* ============================ HERO ============================ */
.hero { padding: 64px 30px 40px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-ready { background: var(--ready); }

.hero-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(38px, 7vw, 56px); letter-spacing: -0.03em; line-height: 1.02;
  margin: 0; color: var(--text-primary);
}
.hero-lede { font-size: 16px; max-width: 680px; margin-top: 22px; }
.hero-lede strong { color: var(--text-primary); font-weight: 600; }

.axiom {
  margin-top: 26px; padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--surface-raised);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.axiom-label { margin-bottom: 7px; }
.axiom-text { font-size: 15px; color: var(--text-primary); line-height: 1.5; }

.chips { display: flex; gap: 9px; margin-top: 24px; flex-wrap: wrap; }
.chip {
  font-size: 11px; color: var(--text-secondary);
  border: 1px solid var(--border-default); background: var(--surface-raised);
  border-radius: var(--radius-sm); padding: 3px 9px;
}
.chip-dim { color: var(--text-muted); }

/* ============================ ROSTER ============================ */
.roster { padding: 20px 30px 40px; }
.section-label { margin-bottom: 16px; }
.member-list { display: flex; flex-direction: column; gap: 10px; }

/* card = container; toggle = the clickable header; detail = revealed sibling */
.member-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--thread, var(--accent));
  border-radius: var(--radius);
  overflow: hidden;
}
.member-card.is-dim { opacity: 0.72; }

.member-toggle {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; color: inherit; font: inherit;
  padding: 16px 18px; cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.member-toggle:hover { background: var(--surface-overlay); }
.member-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.member-row { display: flex; align-items: center; gap: 12px; }
.member-row .mark { color: var(--thread, var(--accent)); }
.member-main { flex: 1; min-width: 0; }
.member-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.member-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.member-lang { font-size: 11px; color: var(--text-muted); }
.member-domain { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.member-status {
  font-size: 10.5px; color: var(--thread, var(--accent));
  white-space: nowrap; margin-left: auto; padding-left: 8px;
}

.member-detail {
  display: none;
  margin: 0 18px; padding: 13px 0 16px;
  border-top: 1px solid var(--border-default);
}
.member-toggle[aria-expanded="true"] + .member-detail { display: block; }
.detail-label { margin-bottom: 6px; }
.detail-answer { display: block; font-size: 13px; color: var(--text-primary); line-height: 1.5; font-style: italic; }
.detail-repo { display: inline-block; margin-top: 11px; font-size: 11.5px; }
.detail-repo-none { color: var(--text-muted); }

/* ---- Lacuna — adjacent specimen (same world, set apart) ----------------- */
.lacuna-block { margin-top: 22px; }
.lacuna-label { margin-bottom: 10px; color: var(--lacuna-accent-dim); }
.lacuna-strip {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px;
  background: var(--lacuna-surface);
  border: 1.5px dashed var(--lacuna-border);
  border-radius: var(--radius);
  transition: border-color var(--dur-fast) var(--ease);
  text-decoration: none; color: inherit;
}
.lacuna-strip:hover { border-color: var(--lacuna-accent-dim); text-decoration: none; }
.lacuna-strip:focus-visible { outline: 2px solid var(--lacuna-accent); outline-offset: 2px; }
.lacuna-strip .mark { color: var(--lacuna-accent); }
.lacuna-body { flex: 1; min-width: 0; }
.lacuna-kind { font-size: 11px; color: var(--lacuna-accent-dim); }
.lacuna-loc { font-size: 11px; color: var(--lacuna-accent); white-space: nowrap; margin-left: auto; padding-left: 8px; }
.lacuna-strip.ext::after { content: ""; } /* suppress global ext arrow; loc text carries the cue */

/* ============================ PRODUCT DIRECTORY ============================ */
/* A no-JS directory of curated cheat-sheets — one anchor card per realized
   member, linking into its docs product page. Reuses the thread grammar
   (glyph colour + 4px left-rule), never a fill. */
.products { padding: 8px 30px 40px; max-width: 980px; margin: 0 auto; }
.products .section-label { margin-bottom: 6px; }
.products-lede { max-width: 660px; margin: 0 0 18px; }
.product-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.product-card {
  display: flex; flex-direction: column; gap: 9px;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--thread, var(--accent));
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  color: inherit; text-decoration: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.product-card:hover { background: var(--surface-overlay); text-decoration: none; }
.product-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.product-card .mark { color: var(--thread, var(--accent)); }
.product-top { display: flex; align-items: center; gap: 11px; }
.product-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; min-width: 0; }
.product-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.product-lang { font-size: 11px; color: var(--text-muted); }
.product-domain { font-size: 12px; color: var(--thread, var(--accent)); }
.product-what { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; flex: 1; }
.product-link {
  font-size: 11.5px; font-weight: 600; color: var(--accent);
  margin-top: 2px; align-self: flex-start;
}
.product-card:hover .product-link { text-decoration: underline; }
/* www cards are external (GitHub blobs) and carry .ext; suppress the global ↗
   after the whole card block — the "Cheat-sheet →" link text carries the cue. */
.product-card.ext::after { content: ""; }
.products-foot { margin-top: 16px; }

/* ====================== COMPOSITION LAW ====================== */
.composition { padding: 28px 30px 24px; }
.comp-title {
  font-family: var(--font-display); font-size: 26px; font-weight: 600;
  letter-spacing: -0.015em; color: var(--text-primary); margin: 0 0 4px;
}
.comp-lede { max-width: 660px; margin-bottom: 20px; }
.mode-toggle { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.mode-btn {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  padding: 8px 16px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface-overlay); color: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.mode-btn:hover { color: var(--text-primary); }
.mode-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mode-btn.is-active {
  border-color: var(--accent); background: var(--accent); color: #06222F;
}
.mode-panel {
  background: var(--surface-raised); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: 22px 24px; min-height: 64px;
}
.mode-panel .mode-text { font-size: 15px; color: var(--text-primary); line-height: 1.55; }

/* ====================== HOW THEY COMPOSE (weave) ====================== */
.weave { padding: 16px 30px 44px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 28px; }
.fact {
  background: var(--surface-raised); border: 1px solid var(--border-default);
  border-left: 3px solid var(--accent); border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.fact-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin: 7px 0 8px; }
.fact-body { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }

.bindings { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bindings li {
  font-size: 13px; color: var(--text-secondary); line-height: 1.5;
  padding: 11px 14px; background: var(--surface-raised);
  border: 1px solid var(--border-default); border-radius: var(--radius);
  display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
}
.b-name { font-weight: 600; color: var(--thread, var(--accent)); }
.b-arrow { color: var(--text-muted); }
.b-desc { color: var(--text-secondary); }
.weave-foot { margin-top: 16px; }

/* ---- small inline status tags (status-coloured, alpha fill) -------------- */
.tag {
  display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: var(--radius-sm); white-space: nowrap; margin-left: 2px;
}
.tag-ok   { color: var(--ready); background: color-mix(in oklab, var(--ready) 16%, transparent); }
.tag-warn { color: var(--aging); background: color-mix(in oklab, var(--aging) 16%, transparent); }
.tag-dim  { color: var(--text-muted); background: var(--surface-overlay); }

/* ============================ FOOTER ============================ */
.hub-footer {
  border-top: 1px solid var(--border-default);
  padding: 20px 30px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.hub-footer .mark { color: var(--text-muted); }
.foot-note { font-size: 11px; color: var(--text-muted); }
.foot-links { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.foot-links a { font-size: 11px; color: var(--text-secondary); }
.foot-links a:hover { color: var(--text-primary); }
.foot-meta { font-size: 11px; color: var(--text-muted); }
/* parent-org attribution: Foundryside (org) above Weft (federation) — neutral, never a thread color */
.foot-org { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); text-decoration: none; transition: color 0.15s var(--ease); }
.foot-org .mark { color: inherit; }
.foot-org:hover { color: var(--text-secondary); }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 720px) {
  .facts { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hub-header { gap: 12px; padding: 12px 18px; }
  .path-hint { display: none; }
  .hero { padding: 44px 18px 32px; }
  .roster, .products, .composition, .weave { padding-left: 18px; padding-right: 18px; }
  .hub-footer { padding: 18px; }
  .foot-links { margin-left: 0; flex-basis: 100%; }
  .member-status { margin-left: 0; flex-basis: 100%; padding-left: 0; margin-top: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
