/* 710HUB — shared chrome: top bar, menu, search, breadcrumb, footer, readability.
   Loaded after each page's own <style>, so these rules win where they overlap.
   Page content keeps its own styles; everything here is namespaced hub-* except
   the readability block, which only applies to pages marked <body class="hub">. */

:root{
  --yellow:#e8c33a;
  --ink:#0c0b08;
  --paper:#f4efdd;
  --muted:rgba(244,239,221,.7);
  --line:rgba(244,239,221,.16);
  --hub-top:58px;
}

html{scroll-padding-top:calc(var(--hub-top) + 16px);}

/* The old full-screen loader made every click wait ~1 s: the page now shows at once. */
.boot{display:none !important;}

:focus-visible{outline:2px solid var(--yellow);outline-offset:3px;}

.hub-skip{
  position:fixed;top:-60px;left:12px;z-index:200;
  padding:10px 14px;background:var(--yellow);color:var(--ink);
  font:800 .8rem 'JetBrains Mono',monospace;text-decoration:none;
}
.hub-skip:focus{top:12px;}

/* ---------- TOP BAR ---------- */

.hub-top{
  position:fixed;top:0;left:0;right:0;z-index:60;
  border-bottom:1px solid var(--line);
  background:rgba(12,11,8,.78);
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  font-family:'JetBrains Mono',monospace;
}

.hub-top-inner{
  width:min(1180px, calc(100% - 32px));margin:0 auto;
  min-height:var(--hub-top);
  display:flex;align-items:center;gap:18px;
}

.hub-brand{display:flex;align-items:center;gap:10px;min-width:0;color:var(--paper);text-decoration:none;}

.hub-badge{
  flex:none;display:inline-grid;place-items:center;width:30px;height:30px;
  background:var(--yellow);color:var(--ink);font-weight:900;font-size:.78rem;
  border-radius:2px;transform:rotate(-2deg);
}

.hub-crumb{
  display:flex;align-items:center;gap:6px;min-width:0;
  font-size:.78rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;
  white-space:nowrap;overflow:hidden;
}
.hub-crumb a{color:rgba(244,239,221,.7);text-decoration:none;}
.hub-crumb a:hover{color:var(--yellow);}
.hub-crumb .sep{color:rgba(244,239,221,.35);}
.hub-crumb [aria-current]{color:var(--paper);overflow:hidden;text-overflow:ellipsis;}

.hub-nav{display:flex;align-items:center;gap:2px;margin-left:auto;}
.hub-nav a{
  padding:8px 11px;color:rgba(244,239,221,.8);text-decoration:none;
  font-size:.78rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;
  transition:color .15s ease, box-shadow .15s ease;
}
.hub-nav a:hover{color:var(--yellow);}
.hub-nav a[aria-current="page"],
.hub-nav a.is-section{color:var(--yellow);box-shadow:inset 0 -2px 0 var(--yellow);}

.hub-actions{display:flex;align-items:center;gap:8px;}

.hub-btn{
  display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:0 12px;
  border:1px solid rgba(244,239,221,.24);background:rgba(244,239,221,.04);color:var(--paper);
  font:800 .74rem 'JetBrains Mono',monospace;letter-spacing:.08em;text-transform:uppercase;
  cursor:pointer;transition:border-color .15s ease, color .15s ease;
}
.hub-btn:hover{border-color:rgba(232,195,58,.7);color:var(--yellow);}
.hub-btn kbd{
  padding:1px 6px;border:1px solid rgba(244,239,221,.3);border-radius:3px;
  font:700 .7rem 'JetBrains Mono',monospace;color:rgba(244,239,221,.7);
}
.hub-btn .bars{display:inline-flex;flex-direction:column;gap:3px;}
.hub-btn .bars span{width:13px;height:1.5px;background:currentColor;}

@media (max-width: 900px){
  .hub-nav{display:none;}
  .hub-menu-btn{display:inline-flex;}
  .hub-actions{margin-left:auto;}
  .hub-search-btn .label,.hub-search-btn kbd{display:none;}
}

@media (max-width: 520px){
  .hub-crumb .hub-crumb-mid,.hub-crumb .sep-mid{display:none;}
}

/* ---------- DIALOGS (menu + search) ---------- */

.hub-dialog{
  border:none;padding:0;margin:0;max-width:none;max-height:none;
  background:transparent;color:var(--paper);font-family:'JetBrains Mono',monospace;
}
.hub-dialog::backdrop{background:rgba(6,6,4,.72);backdrop-filter:blur(4px);}

.hub-menu{
  position:fixed;inset:0 0 0 auto;width:min(440px, 100%);height:100%;
  background:#0c0b08;border-left:1px solid var(--line);
  overflow-y:auto;overscroll-behavior:contain;
}
.hub-menu-head{
  position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;
  min-height:var(--hub-top);padding:0 18px;background:#0c0b08;border-bottom:1px solid var(--line);
}
.hub-menu-head b{color:var(--yellow);font-size:.78rem;letter-spacing:.14em;text-transform:uppercase;}
.hub-menu-body{padding:10px 18px 40px;}
.hub-menu-group{padding:16px 0;border-bottom:1px solid var(--line);}
.hub-menu-group h3{
  margin:0 0 8px;color:var(--yellow);font-size:.72rem;font-weight:800;
  letter-spacing:.16em;text-transform:uppercase;
}
.hub-menu-group h4{margin:12px 0 4px;color:rgba(244,239,221,.55);font-size:.7rem;letter-spacing:.12em;text-transform:uppercase;font-weight:700;}
.hub-menu-group a{
  display:flex;justify-content:space-between;align-items:center;gap:10px;min-height:44px;padding:0 10px;margin:0 -10px;
  color:rgba(244,239,221,.86);text-decoration:none;font-size:.9rem;font-weight:700;
}
.hub-menu-group a:hover,.hub-menu-group a[aria-current="page"]{background:rgba(232,195,58,.08);color:var(--yellow);}
.hub-menu-group a small{color:rgba(244,239,221,.45);font-size:.72rem;font-weight:500;}
.hub-menu-status{margin-top:18px;color:rgba(244,239,221,.55);font-size:.74rem;}
.hub-menu-status a{color:var(--yellow);}

.hub-palette{
  position:fixed;top:min(12vh, 110px);left:50%;transform:translateX(-50%);
  width:min(640px, calc(100% - 24px));
  background:#0c0b08;border:1px solid rgba(232,195,58,.45);
  box-shadow:0 24px 80px rgba(0,0,0,.6);
}
.hub-palette-field{display:flex;align-items:center;gap:12px;padding:0 16px;border-bottom:1px solid var(--line);}
.hub-palette-field span{color:var(--yellow);font-weight:800;}
.hub-palette input{
  flex:1;min-width:0;height:56px;border:none;outline:none;background:transparent;color:var(--paper);
  font:500 1rem 'JetBrains Mono',monospace;
}
.hub-palette input::placeholder{color:rgba(244,239,221,.4);}
.hub-palette ul{list-style:none;margin:0;padding:6px;max-height:min(60vh, 460px);overflow-y:auto;}
.hub-palette li a{
  display:grid;grid-template-columns:1fr auto;gap:2px 12px;padding:10px 12px;
  color:var(--paper);text-decoration:none;
}
.hub-palette li a b{font-size:.92rem;}
.hub-palette li a small{grid-column:1;color:rgba(244,239,221,.55);font-size:.74rem;}
.hub-palette li a em{grid-row:1 / span 2;grid-column:2;align-self:center;font-style:normal;color:rgba(232,195,58,.8);font-size:.68rem;letter-spacing:.12em;text-transform:uppercase;}
.hub-palette li a.is-active,.hub-palette li a:hover{background:rgba(232,195,58,.1);}
.hub-palette li a.is-active b{color:var(--yellow);}
.hub-palette-empty{padding:18px 16px;color:rgba(244,239,221,.55);font-size:.85rem;}
.hub-palette-foot{display:flex;gap:16px;padding:10px 16px;border-top:1px solid var(--line);color:rgba(244,239,221,.45);font-size:.7rem;}

/* ---------- FOOTER ---------- */

.hub-foot{
  position:relative;z-index:3;border-top:1px solid var(--line);
  background:rgba(12,11,8,.94);font-family:'JetBrains Mono',monospace;
}
.hub-foot-grid{
  width:min(1180px, calc(100% - 32px));margin:0 auto;padding:46px 0 30px;
  display:grid;grid-template-columns:1.3fr repeat(4, minmax(0,1fr));gap:28px;
}
.hub-foot-brand p{margin:14px 0 0;max-width:260px;color:rgba(244,239,221,.6);font-size:.8rem;line-height:1.65;}
.hub-foot h3{margin:0 0 12px;color:var(--yellow);font-size:.72rem;font-weight:800;letter-spacing:.16em;text-transform:uppercase;}
.hub-foot ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;}
.hub-foot ul a{color:rgba(244,239,221,.75);text-decoration:none;font-size:.82rem;}
.hub-foot ul a:hover{color:var(--yellow);}
.hub-foot-bottom{
  width:min(1180px, calc(100% - 32px));margin:0 auto;padding:18px 0 26px;border-top:1px solid var(--line);
  display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;
  color:rgba(244,239,221,.5);font-size:.74rem;letter-spacing:.08em;text-transform:uppercase;
}
.hub-foot-bottom b{color:var(--yellow);}

@media (max-width: 900px){
  .hub-foot-grid{grid-template-columns:1fr 1fr;}
  .hub-foot-brand{grid-column:1 / -1;}
}

/* ---------- FILTER CHIPS (department pages) ---------- */

.hub-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:30px;}
.hub-chip{
  min-height:38px;padding:0 14px;border:1px solid rgba(244,239,221,.24);background:rgba(12,11,8,.5);color:rgba(244,239,221,.85);
  font:800 .76rem 'JetBrains Mono',monospace;letter-spacing:.08em;text-transform:uppercase;cursor:pointer;
}
.hub-chip:hover{border-color:rgba(232,195,58,.7);color:var(--yellow);}
.hub-chip[aria-pressed="true"]{background:var(--yellow);border-color:var(--yellow);color:var(--ink);}
.hub-chip small{margin-left:6px;opacity:.7;font-size:.7rem;}
[data-filter-hidden]{display:none !important;}

/* ---------- DEPARTMENT HERO ---------- */

/* "PROJETS/NODES" is twice as long as "710/HUB": it wraps after the slash and scales down. */
body.hub .hero h1.dept-title{font-size:clamp(2.6rem, 9vw, 7.5rem);line-height:.9;}
@media (max-width: 600px){
  body.hub .hero h1.dept-title{font-size:12.5vw;}
}

/* ---------- MODULE PAGES: sticky contents, progress, pager ---------- */

/* overflow-x:hidden on html/body turns them into scroll containers and breaks
   position:sticky; clip hides the same overflow without that side effect. */
html:has(> body.hub), body.hub{overflow-x:clip;}
/* Anchor jumps land below both sticky bars. */
html:has(.hub-modbar){scroll-padding-top:calc(var(--hub-top) + 64px);}
@media (max-width: 700px){ html:has(.hub-modbar){scroll-padding-top:calc(var(--hub-top) + 84px);} }

.hub-modbar{
  position:sticky;top:var(--hub-top);z-index:40;
  border-top:1px solid var(--line);border-bottom:1px solid var(--line);
  background:rgba(12,11,8,.86);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  font-family:'JetBrains Mono',monospace;
}
.hub-modbar-inner{
  width:min(1180px, calc(100% - 32px));margin:0 auto;min-height:48px;
  display:flex;align-items:center;gap:18px;
}
.hub-modbar-meta{flex:none;color:rgba(244,239,221,.6);font-size:.75rem;letter-spacing:.06em;text-transform:uppercase;}
.hub-modbar-meta b{color:var(--yellow);font-weight:800;}
.hub-modbar-links{
  display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;
  mask-image:linear-gradient(90deg, #000 92%, transparent);
}
.hub-modbar-links::-webkit-scrollbar{display:none;}
.hub-modbar-links a{
  flex:none;padding:7px 11px;color:rgba(244,239,221,.75);text-decoration:none;
  font-size:.75rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;
  border:1px solid transparent;transition:color .15s ease, border-color .15s ease;
}
.hub-modbar-links a:hover{color:var(--yellow);}
.hub-modbar-links a[aria-current="true"]{color:var(--ink);background:var(--yellow);}
.hub-progress{height:2px;background:transparent;}
.hub-progress span{display:block;height:100%;width:100%;background:var(--yellow);transform:scaleX(0);transform-origin:left;}

@media (max-width: 700px){
  .hub-modbar-inner{flex-direction:column;align-items:stretch;gap:2px;padding:6px 0;}
  .hub-modbar-meta{font-size:.7rem;}
}

.hub-pager{position:relative;z-index:2;border-top:1px solid var(--line);background:rgba(12,11,8,.8);}
.hub-pager-inner{
  width:min(1180px, calc(100% - 32px));margin:0 auto;padding:34px 0;
  display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:18px;
  font-family:'JetBrains Mono',monospace;
}
.hub-pager a{
  display:flex;flex-direction:column;gap:6px;padding:18px 20px;
  border:1px solid var(--line);background:rgba(12,11,8,.6);color:var(--paper);text-decoration:none;
  transition:border-color .2s ease, transform .2s ease;
}
.hub-pager a:hover{border-color:rgba(232,195,58,.6);transform:translateY(-2px);}
.hub-pager a.next{text-align:right;}
.hub-pager small{color:var(--yellow);font-size:.72rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;}
.hub-pager b{font-size:1.05rem;text-transform:uppercase;letter-spacing:-.01em;}
.hub-pager-count{color:rgba(244,239,221,.5);font-size:.75rem;letter-spacing:.12em;}

@media (max-width: 700px){
  .hub-pager-inner{grid-template-columns:1fr 1fr;}
  .hub-pager-count{display:none;}
}

/* ---------- HOMEPAGE DOORS ---------- */

@media (min-width: 981px){
  .doors-grid{grid-template-columns:repeat(2, minmax(0,1fr));}
}

/* ---------- RELATED PROJECTS (module pages) ---------- */

.hub-related{padding:70px 0;border-top:1px solid var(--line);background:rgba(12,11,8,.72);position:relative;z-index:2;}
.hub-related-inner{width:min(1180px, calc(100% - 32px));margin:0 auto;}
.hub-related h2{margin:0 0 6px;font:800 clamp(1.3rem,2.6vw,1.8rem) 'JetBrains Mono',monospace;text-transform:uppercase;letter-spacing:-.03em;}
.hub-related > div > p{margin:0 0 26px;color:rgba(244,239,221,.7);font-size:.9rem;}
.hub-related-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(240px, 1fr));gap:12px;}
.hub-related-grid a{
  display:flex;flex-direction:column;gap:8px;padding:18px;border:1px solid var(--line);background:rgba(12,11,8,.6);
  color:var(--paper);text-decoration:none;transition:border-color .2s ease, transform .2s ease;
}
.hub-related-grid a:hover{border-color:rgba(232,195,58,.6);transform:translateY(-2px);}
.hub-related-grid small{color:var(--yellow);font-size:.7rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;}
.hub-related-grid b{font-size:1.05rem;text-transform:uppercase;}
.hub-related-grid span{color:rgba(244,239,221,.7);font-size:.82rem;line-height:1.55;}

/* ---------- READABILITY (hub pages only) ----------
   The original labels went down to .6rem (~10px) in letter-spaced capitals over
   video. Nothing below 12px now, and body copy a notch larger. */

body.hub .section-kicker,
body.hub .os-status,
body.hub .os-tags span,
body.hub .tag,
body.hub .card-link,
body.hub .eyebrow,
body.hub .hero-side .label,
body.hub .project-status,
body.hub .project-meta span,
body.hub .project-link,
body.hub .post-meta,
body.hub .stat,
body.hub .count,
body.hub .console-titlebar .path,
body.hub .mode-head,
body.hub .sha span,
body.hub .dl-button,
body.hub .back-link,
body.hub .scrollhint,
body.hub .module-group-head span,
body.hub .project-note,
body.hub .log time,
body.hub .draft .status{font-size:.75rem;}

body.hub .intro,
body.hub .console-intro,
body.hub .hero-lead{font-size:max(1rem, 1em);}

body.hub .os-card p,
body.hub .protocol-card p,
body.hub .app-card p,
body.hub .project-card p,
body.hub .cat-card p,
body.hub .draft p,
body.hub .log p,
body.hub .console-line .desc,
body.hub .callout p,
body.hub .mode-row{font-size:.88rem;line-height:1.65;}

body.hub .intro,
body.hub .hero-lead,
body.hub .console-intro{max-width:72ch;}

/* The old inline top bars are replaced by .hub-top. */
body.hub > .page > header.topbar{display:none;}

@media (prefers-reduced-motion: reduce){
  .hub-top,.hub-related-grid a{transition:none;}
}

/* ---------- STRIP (projects with their own design) ---------- */

.hub-strip{
  position:fixed;top:0;left:0;right:0;z-index:9999;height:40px;box-sizing:border-box;
  display:flex;align-items:center;gap:12px;overflow:hidden;white-space:nowrap;
  padding:0 16px;background:#0c0b08;border-bottom:1px solid rgba(232,195,58,.35);
  font:800 .74rem/1.4 'JetBrains Mono',ui-monospace,monospace;letter-spacing:.08em;text-transform:uppercase;color:#f4efdd;
}
.hub-strip a{color:rgba(244,239,221,.75);text-decoration:none;}
.hub-strip a:hover{color:#e8c33a;}
.hub-strip .hub-badge{width:24px;height:24px;font-size:.66rem;}
.hub-strip .sep{color:rgba(244,239,221,.35);}
.hub-strip [aria-current]{color:#e8c33a;}
.hub-strip .hub-strip-right{margin-left:auto;display:flex;gap:14px;}
@media (max-width: 520px){ .hub-strip .hub-strip-right{display:none;} }
