/* hub.css: the handoff's front page. Every value comes from the prototype's
   tokens (prototype/css/tokens.css, F3 on Brand 5); the few the hub needs of
   its own are defined once here. */
.hub {
  --hub-box-min: 18rem;
  --hub-box-pad: var(--space-4);
  --hub-title-size: var(--text-2xl);
  --hub-box-title-size: var(--text-lg);
  --hub-lede-measure: 60ch;
  --hub-rule: 1px;
  --hub-focus-ring: 2px;
  --hub-focus-offset: 3px;
  --hub-underline-offset: 3px;
  --hub-draft-pad: 2px var(--space-1);
  --hub-label-col: minmax(12rem, 16rem);
  --hub-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --hub-code-size: 0.875em;
  --hub-quote-rule: 3px;
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}
.hub *, .hub *::before, .hub *::after { box-sizing: border-box; }
.hub a { color: inherit; }
.hub a:focus-visible { outline: var(--hub-focus-ring) solid var(--focus); outline-offset: var(--hub-focus-offset); border-radius: var(--radius-sm); }

.hub__wrap { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.hub__bar { border-bottom: var(--hub-rule) solid var(--border); background: var(--raised); }
.hub__bar-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: var(--header-h); }
.hub__logo { display: block; height: var(--logo-h-footer); width: auto; }
.hub__version { margin: 0; font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-2); font-variant-numeric: tabular-nums; }
.hub__draft { display: inline-block; margin-left: var(--space-1); padding: var(--hub-draft-pad); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text); font-weight: var(--weight-medium); }

.hub__intro { padding-block: var(--space-12) var(--space-8); }
.hub__kicker, .hub-box__kicker {
  margin: 0 0 var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  color: var(--text-2);
}
.hub__title { margin: 0; font-family: var(--font-display); font-size: var(--hub-title-size); line-height: var(--leading-tight); font-weight: var(--weight-bold); text-wrap: balance; }
.hub__lede { margin: var(--space-3) 0 0; max-width: var(--hub-lede-measure); font-size: var(--text-md); color: var(--text-2); text-wrap: pretty; }

.hub__boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--hub-box-min), 1fr)); gap: var(--space-3); }
.hub-box {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--hub-box-pad);
  background: var(--raised);
  border: var(--hub-rule) solid var(--border);
  border-radius: var(--radius-card-lg);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--motion-quick) ease, border-color var(--motion-quick) ease;
}
.hub-box:hover { box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.hub-box:focus-within { border-color: var(--border-strong); }
.hub-box__title { margin: 0; font-family: var(--font-display); font-size: var(--hub-box-title-size); line-height: var(--leading-snug); font-weight: var(--weight-bold); }
/* The whole box is the link's target. */
.hub-box__link { text-decoration: none; }
.hub-box__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.hub-box__text { margin: var(--space-2) 0 0; color: var(--text-2); text-wrap: pretty; }
.hub-box__note { margin: var(--space-2) 0 0; font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-3); }
.hub-box__action {
  margin: auto 0 0;
  padding-top: var(--space-4);
  font-family: var(--font-ui);
  font-size: var(--text-ui);
  font-weight: var(--weight-bold);
  color: var(--accent-text);
}

.hub__h2 { margin: 0 0 var(--space-3); font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-bold); }
.hub__files, .hub__log { margin-top: var(--space-12); }
.hub__file-list { list-style: none; margin: 0; padding: 0; border-top: var(--hub-rule) solid var(--border); }
.hub__file-list li { display: grid; grid-template-columns: var(--hub-label-col) 1fr; gap: var(--space-3); align-items: baseline; padding-block: var(--space-2); border-bottom: var(--hub-rule) solid var(--border); }
.hub__file-list a { display: inline-flex; align-items: center; min-height: var(--target); font-family: var(--font-ui); font-weight: var(--weight-bold); color: var(--accent-text); text-underline-offset: var(--hub-underline-offset); }
.hub__file-list span { color: var(--text-2); }

.hub__log-intro { margin: 0 0 var(--space-3); max-width: var(--hub-lede-measure); color: var(--text-2); }
.hub__versions { list-style: none; margin: 0; padding: 0; border-top: var(--hub-rule) solid var(--border); }
.hub-version { display: grid; grid-template-columns: var(--hub-label-col) 1fr; gap: var(--space-3); padding-block: var(--space-3); border-bottom: var(--hub-rule) solid var(--border); }
.hub-version__name { margin: 0; font-family: var(--font-ui); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.hub-version__date { display: block; font-weight: var(--weight-regular); color: var(--text-3); }
.hub-version__summary { margin: 0; }
.hub-version__group { margin: var(--space-2) 0 0; font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-2); }
.hub-version__group ul { margin: var(--space-half) 0 0; padding-left: var(--space-3); }
.hub-version__group li + li { margin-top: var(--space-half); }
.hub-version__group a { color: var(--accent-text); text-underline-offset: var(--hub-underline-offset); }
.hub-view { display: inline-block; margin-right: var(--space-1); padding: var(--hub-draft-pad); border: var(--hub-rule) solid var(--border); border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text); background: var(--raised); }
.hub-view[data-view="mobile"] { background: var(--accent-soft); border-color: transparent; }
.hub-tokens summary { display: inline-flex; align-items: center; min-height: var(--target); cursor: pointer; color: var(--text); font-weight: var(--weight-medium); }
.hub-tokens__scroll { overflow-x: auto; margin-top: var(--space-1); border: var(--hub-rule) solid var(--border); border-radius: var(--radius-sm); }
.hub-tokens table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hub-tokens th, .hub-tokens td { padding: var(--space-half) var(--space-1); border-bottom: var(--hub-rule) solid var(--border); text-align: left; vertical-align: top; font-weight: var(--weight-regular); }
.hub-tokens thead th { font-weight: var(--weight-medium); color: var(--text); background: var(--raised); }
.hub-tokens code { font-size: var(--text-xs); overflow-wrap: anywhere; }
.hub-tokens__none { color: var(--text-3); }

/* ---- A spec as a page (docs/*.html, written by handoff/build.mjs from
   handoff/*-SPEC.md): one reading column, tables that scroll inside
   their own frame. ---- */
.hub__home { display: inline-flex; align-items: center; min-height: var(--target); font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-2); text-underline-offset: var(--hub-underline-offset); }
.hub__home:hover { color: var(--text); }
.hub__version code, .hub-version__date code, .doc code { font-family: var(--hub-mono); font-size: var(--hub-code-size); background: var(--sunk); border-radius: var(--radius-sm); padding: 0 var(--space-half); overflow-wrap: anywhere; }
.doc { --doc-measure: 72ch; padding-block: var(--space-8) 0; }
.doc > * { max-width: var(--doc-measure); }
.doc h1 { margin: 0; font-family: var(--font-display); font-size: var(--hub-title-size); line-height: var(--leading-tight); font-weight: var(--weight-bold); text-wrap: balance; }
.doc h2 { margin: var(--space-8) 0 var(--space-2); font-family: var(--font-display); font-size: var(--text-xl); line-height: var(--leading-snug); font-weight: var(--weight-bold); scroll-margin-top: var(--space-3); }
.doc h3, .doc h4 { margin: var(--space-4) 0 var(--space-1); font-family: var(--font-ui); font-size: var(--text-md); font-weight: var(--weight-bold); scroll-margin-top: var(--space-3); }
.doc p, .doc ul, .doc ol, .doc blockquote, .doc pre { margin: var(--space-2) 0 0; }
.doc ul, .doc ol { padding-left: var(--space-3); }
.doc li + li, .doc li > ul, .doc li > ol { margin-top: var(--space-1); }
.doc a { color: var(--accent-text); text-underline-offset: var(--hub-underline-offset); }
.doc blockquote { padding-left: var(--space-2); border-left: var(--hub-quote-rule) solid var(--accent); color: var(--text-2); }
.doc pre { padding: var(--space-2); overflow-x: auto; background: var(--sunk); border-radius: var(--radius-sm); }
.doc pre code { padding: 0; background: none; }
.doc hr { margin: var(--space-6) 0; border: 0; border-top: var(--hub-rule) solid var(--border); }
.doc__meta { font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-2); }
.doc__toc { margin-top: var(--space-4); padding: var(--space-3); border: var(--hub-rule) solid var(--border); border-radius: var(--radius-card); background: var(--raised); }
.doc .doc__toc-h { margin: 0 0 var(--space-1); font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-2); }
.doc__toc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-6); margin: 0; padding-left: var(--space-3); }
.doc__toc li + li { margin-top: 0; }
.doc__toc a { display: inline-flex; align-items: center; min-height: var(--target); }
.doc .doc-table { max-width: none; margin-top: var(--space-2); overflow-x: auto; border: var(--hub-rule) solid var(--border); border-radius: var(--radius-sm); background: var(--raised); }
.doc table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.doc th, .doc td { padding: var(--space-1); border-bottom: var(--hub-rule) solid var(--border); text-align: left; vertical-align: top; }
.doc thead th { font-family: var(--font-ui); font-weight: var(--weight-medium); background: var(--sunk); }
.doc tbody tr:last-child td { border-bottom: 0; }

.hub__foot { margin-top: var(--space-16); padding-block: var(--space-6); border-top: var(--hub-rule) solid var(--border); font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-3); }
.hub__foot p { margin: 0; }

@media (width < 640px) {
  .hub { --hub-title-size: var(--text-xl); --hub-box-pad: var(--space-3); }
  .hub__intro { padding-block: var(--space-8) var(--space-6); }
  .hub__file-list li, .hub-version { grid-template-columns: 1fr; gap: var(--space-half); }
  .doc__toc ol { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .hub-box { transition: none; } }
