/* ==========================================================================
   Reignance Studios — code hub (/code/): repo pages, file viewer, hub cards.
   Loaded after minimal.css + reading.css. Tokens come from those files.
   ========================================================================== */

.cv-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 2rem clamp(2rem, 4vw, 3.5rem); align-items: start; }
.cv-side { position: sticky; top: calc(73px + 1.5rem); max-height: calc(100vh - 73px - 3rem); overflow: auto; display: grid; gap: 1.5rem; font-size: var(--fs-small); }
.cv-side-block { border-top: 1px solid var(--ink); padding-top: 0.75rem; }
.cv-clone-label { margin: 0 0 0.5rem; font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

/* Versions */
.cv-tags { border-top: 1px solid var(--ink); padding-top: 0.75rem; }
.cv-tags > span { display: block; margin-bottom: 0.5rem; font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.cv-tags ul { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.cv-tags a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 0.7rem; border: 1px solid var(--line-2); border-radius: 999px; font: 500 var(--fs-label)/1 var(--mono); color: var(--ink-2); }
.cv-tags a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* Clone box */
.cv-clone { border-top: 1px solid var(--ink); padding-top: 0.75rem; }
.cv-clone-row { display: grid; gap: 0.5rem; }
.cv-clone code { display: block; padding: 0.6rem 0.7rem; border: 1px solid var(--line); background: var(--soft); font: 400 0.75rem/1.5 var(--mono); color: var(--ink); overflow-wrap: anywhere; }

/* Tree */
.cv-tree { margin: 0; padding: 0; list-style: none; font-family: var(--mono); font-size: 0.8125rem; }
.cv-tree .cv-tree { padding-left: 0.9rem; border-left: 1px solid var(--line); margin-left: 0.3rem; }
.cv-tree summary { display: flex; align-items: center; min-height: 32px; cursor: pointer; color: var(--ink); font-weight: 600; }
.cv-tree summary::marker { color: var(--muted); }
.cv-tree a { display: flex; align-items: center; min-height: 32px; color: var(--ink-2); text-decoration: none; overflow-wrap: anywhere; }
.cv-tree a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }
.cv-tree a[aria-current="page"] { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }

/* Buttons */
.cv-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 0.85rem;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); color: var(--ink);
  font: 600 var(--fs-label)/1 var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
.cv-btn:hover { border-color: var(--ink); }
.cv-btn[hidden] { display: none; }

/* File view */
.cv-head { padding-block: clamp(2rem, 4vw, 3rem) 1.5rem; }
.cv-title { font: 600 clamp(1.5rem, 3vw, 2.25rem)/1.15 var(--mono); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.cv-file-view { min-width: 0; }
.cv-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-bottom: 0; background: var(--soft); }
.cv-path { font: 500 var(--fs-label)/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.cv-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cv-hint { margin: 0; padding: 0.4rem 0.8rem; border: 1px solid var(--line); border-bottom: 0; font-size: var(--fs-label); color: var(--muted); }
.cv-code { border: 1px solid var(--line); overflow-x: auto; background: var(--paper); }
.cv-lines { width: 100%; border-collapse: collapse; font: 400 var(--fs-small)/1.6 var(--mono); tab-size: 4; }
.cv-ln { width: 1%; padding: 0 0.75rem; text-align: right; vertical-align: top; user-select: none; border-right: 1px solid var(--line); }
.cv-ln a { display: block; color: var(--muted); text-decoration: none; font-variant-numeric: tabular-nums; }
.cv-ln a:hover { color: var(--ink); }
.cv-lc { padding: 0 1rem; white-space: pre; color: var(--ink); }
.cv-lines tr.is-sel { background: var(--soft); }
.cv-lines tr.is-sel .cv-ln { border-right-color: var(--ink); }
.cv-status { min-height: 1.5em; margin: 0.5rem 0 0; font-size: var(--fs-label); color: var(--muted); }

/* Syntax: same restrained palette as .read-code */
.cv-lc .kw { font-weight: 600; color: var(--ink); }
.cv-lc .ty { color: var(--ink); }
.cv-lc .fn, .cv-lc .st { color: var(--ink-2); }
.cv-lc .cm { font-style: italic; color: var(--muted); }
.cv-lc .nu { font-variant-numeric: tabular-nums; }

/* Markdown code outside reading blocks (changelog) */
.md-pre { margin: 0; padding: 1rem; border: 1px solid var(--line); background: var(--soft); overflow-x: auto; font: 400 var(--fs-small)/1.6 var(--mono); }

/* README column */
.cv-readme > .read-code, .cv-readme > .read-table-wrap { max-width: none; }

/* Hub cards */
.cv-cards { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.cv-card { padding: 1.75rem 0; border-bottom: 1px solid var(--line); }
.cv-card h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; font-size: var(--fs-title-md); font-weight: 700; letter-spacing: -0.02em; }
.cv-card h2 a { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.cv-card > p { max-width: 68ch; margin-top: 0.6rem; color: var(--ink-2); }
.cv-card .byline { margin-top: 0.4rem; }
.cv-card .text-link + .text-link { margin-left: 1.25rem; }
.cv-tag { font: 500 var(--fs-label)/1 var(--mono); color: var(--muted); }
.cv-more { margin-top: 2rem; color: var(--muted); }
.cv-saves { color: var(--ink); }
.cv-value { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 2rem; max-width: 68rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.cv-value dt { font: 500 var(--fs-label)/1.2 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.cv-value dd { margin: 0.4rem 0 0; color: var(--ink-2); max-width: 60ch; }
@media (max-width: 700px) { .cv-value { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 900px) {
  .cv-layout { grid-template-columns: minmax(0, 1fr); }
  .cv-side { position: static; max-height: none; overflow: visible; }
}
