/* trureturing books · the visualization hub of one book (<slug>/viz/index.html, written by tbook.viz.build).
   Adapted from trureturing-visualize/assets/hub.css (Apache-2.0, the-omega-institute); colours from the tokens via theme.css.
   Layout: header, a hero band over a live interference field, then the registry grid. The first live entry is
   featured across two columns when there is room. */
.hub {
  max-width: 1320px;
  margin: 0 auto;
  padding-block: 14px 28px;
  padding-inline: var(--gutter);
  display: flex; flex-direction: column; gap: 18px;
}

.hero { position: relative; overflow: hidden; min-height: 220px; display: flex; align-items: flex-end; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0.85; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--void) 94%, transparent) 0%, color-mix(in srgb, var(--void) 70%, transparent) 45%, color-mix(in srgb, var(--void) 15%, transparent) 100%),
    var(--tr-fx-scanlines);
}
.hero-text { position: relative; z-index: 2; padding: 24px 24px 20px; max-width: 680px; display: flex; flex-direction: column; gap: 10px; }
.hero h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(20px, 3vw, 28px); line-height: 1.25; letter-spacing: 0.02em; text-wrap: balance; }
.hero p { margin: 0; color: var(--dim); font-size: 13.5px; max-width: 62ch; }
.legend { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--dim); }
.legend li { display: flex; align-items: center; gap: 6px; }

.k {
  font-family: var(--font-data); font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em;
  border: 1px solid var(--line-hot); color: var(--cyan); padding: 1px 6px; white-space: nowrap;
}
.k.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.k.num { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 45%, transparent); }
.k.model { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }

.index-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.index-head h2 { margin: 0; font-family: var(--font-display); font-size: 12px; letter-spacing: 0.18em; color: var(--cyan); font-weight: 600; text-transform: uppercase; }
.index-head span { font-family: var(--font-data); font-size: 11px; color: var(--dim); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; }
.card .thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--stage-bg); border-bottom: 1px solid var(--panel-edge); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease, filter 0.6s ease; filter: saturate(1.05); }
.card .thumb::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--tr-fx-scanlines); }
.card .thumb .code {
  position: absolute; left: 12px; bottom: 10px; z-index: 1;
  font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.08em; color: var(--ink);
  text-shadow: 0 0 12px color-mix(in srgb, var(--cyan) 80%, transparent), 0 0 3px var(--tr-void-deep);
}
.card:hover .thumb img, .card:focus-within .thumb img { transform: scale(1.03); filter: saturate(1.25) brightness(1.08); }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.card h3 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.35; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--cyan); }
.card .alt-title { margin: -4px 0 0; font-family: var(--font-display); font-size: 11.5px; letter-spacing: 0.06em; color: var(--dim); }
.card .sum { margin: 0; color: var(--dim); font-size: 13px; max-width: 64ch; }
.card .tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.card .tags li { font-size: 11px; color: var(--ink); border: 1px solid var(--panel-edge); padding: 1px 7px; background: color-mix(in srgb, var(--panel-edge) 35%, transparent); }
.card .refs { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.card .refs div { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.card .refs a { color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--line-hot); overflow-wrap: anywhere; min-width: 0; }
.card .refs a:hover { color: var(--cyan); border-bottom-color: var(--cyan); }
.card .refs code { font-family: var(--font-data); font-size: 11px; }
.card .actions { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 4px; }
.card .actions .date { font-family: var(--font-data); font-size: 11px; color: var(--faint); }
.card .enter { border-color: var(--cyan); color: var(--cyan); }
.card .enter:hover { background: var(--cyan); color: var(--on-accent); }

/* the first card runs across the grid; its cover keeps (nearly) the 16:9 of the 1280×720 thumbnails */
@media (min-width: 900px) {
  .grid .card.featured { grid-column: 1 / -1; flex-direction: row; }
  .grid .card.featured .thumb { flex: 1.4 1 0; aspect-ratio: 16 / 9; align-self: stretch; min-height: 0; border-bottom: 0; border-right: 1px solid var(--panel-edge); }
  .grid .card.featured .body { flex: 1 1 0; padding: 16px 18px 16px; }
  .grid .card.featured h3 { font-size: 20px; }
}

.foot { display: flex; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; color: var(--faint); font-size: 12px; border-top: 1px solid var(--panel-edge); padding-top: 10px; }
.foot code { font-family: var(--font-data); color: var(--dim); font-size: 11.5px; }
.foot a { color: var(--dim); }

@media (prefers-reduced-motion: reduce) {
  .card .thumb img { transition: none; }
}
