/* hub.css - the public hub and the workshop. Load AFTER tokens.css (the console's own sheet,
   copied beside each page by hub/generate.py), so the hub and the console are one palette.

   A document, not an app shell: the page scrolls, there is no script, and every colour, size,
   radius and shadow below is a token. No literal belongs here; a new colour goes in tokens.css
   and through the contrast test first. */

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

body {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }
:focus { outline: none; }
:focus-visible { outline: var(--focus-w) solid var(--accent-h); outline-offset: var(--focus-gap); border-radius: var(--r-sm); }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 10;
  background: var(--accent); color: var(--on-accent);
  padding: 8px 14px; border-radius: var(--r-sm); font-weight: 600; text-decoration: none;
  transform: translateY(-250%);
}
.skip-link:focus { transform: none; }

.hub-header, .hub-main, .hub-foot, .hub-banner {
  width: 100%;
  padding-left: max(44px, var(--safe-l));
  padding-right: max(44px, var(--safe-r));
}

.hub-header { padding-top: 40px; padding-bottom: 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); }
.logo svg { display: block; flex: none; }
.mark-glyph { fill: var(--on-accent); }
.logo-name { font-size: var(--fs-3xl); font-weight: 650; letter-spacing: -0.012em; color: var(--text); line-height: var(--lh-tight); }
.hub-tag { margin-top: 8px; color: var(--muted); font-size: var(--fs-lg); }

.hub-banner {
  padding-top: 10px; padding-bottom: 10px;
  background: var(--info-bg); color: var(--info);
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  font-size: var(--fs-sm); font-weight: 600;
}

.hub-main { flex: 1; padding-top: 24px; padding-bottom: 40px; }

.hub-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 18px;
}

.hub-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  box-shadow: var(--elev-1);
  padding: 20px 22px;
}
.hub-card-hd { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hub-card h2 { font-size: var(--fs-lg); font-weight: 600; line-height: var(--lh-tight); }
.hub-tile {
  flex: none; width: 34px; height: 34px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-tint); color: var(--accent);
  font-size: var(--fs-lg); font-weight: 700;
}
.hub-pill {
  font-size: var(--fs-2xs); font-weight: 600; padding: 2px 9px; border-radius: var(--r-md);
  background: var(--warn-bg); color: var(--warn); white-space: nowrap;
}
.hub-desc { color: var(--text); flex: 1; }
.hub-host { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }

.hub-open {
  align-self: flex-start;
  display: inline-flex; align-items: center; min-height: 36px;
  padding: 6px 16px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent);
  font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
}
.hub-open:hover { background: var(--accent-h); border-color: var(--accent-h); }

.hub-empty { color: var(--muted); padding: 34px 0; }

.hub-foot {
  padding-top: 18px; padding-bottom: calc(24px + var(--safe-b));
  border-top: 1px solid var(--hairline);
  color: var(--muted); font-size: var(--fs-xs);
}
.hub-foot a { color: var(--muted); }
.hub-foot a:hover { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  .hub-open, .hub-foot a { transition: background-color var(--motion) var(--ease), color var(--motion) var(--ease); }
}

/* The phone: a 16px gutter, one column, and the open button the full width of the thumb. */
@media (max-width: 600px) {
  .hub-header, .hub-main, .hub-foot, .hub-banner {
    padding-left: max(16px, var(--safe-l));
    padding-right: max(16px, var(--safe-r));
  }
  .hub-header { padding-top: 24px; }
  .logo-name { font-size: var(--fs-2xl); }
  .hub-tag { font-size: var(--fs-md); }
  .hub-open { align-self: stretch; justify-content: center; min-height: 40px; }
}

@media print {
  .skip-link, .hub-open { display: none; }
  .hub-card { box-shadow: none; border-color: var(--border); break-inside: avoid; }
}
