/* HIVE Runes gallery (/runes) — on top of assets/hive.css (tokens, header, footer, buttons).
   Moved out of the page's old <style> block (CSP style-src 'self'); same layout and cards.
   The card previews stay dark in both themes: they are little screens of the Runes. */

:root { --rv: #B388FF; --rv-deep: #7C3AED; --rc: #7EE8FB; --rc-deep: #00E5FF; --screen: #070914; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --rv: #6D28D9; --rv-deep: #5B21B6; --rc: #0E7490; --rc-deep: #0891B2; }
}
:root[data-theme="light"] { --rv: #6D28D9; --rv-deep: #5B21B6; --rc: #0E7490; --rc-deep: #0891B2; }

.runes-page .container { max-width: 1280px; }
.runes-page .hl { color: var(--gold-soft); font-weight: 500; }

/* Hero */
.runes-hero { position: relative; padding: 84px 0 48px; text-align: center; }
.runes-hero h1 { font-family: var(--sans); font-weight: 200; font-size: clamp(3rem, 9vw, 6.4rem); line-height: 0.95; letter-spacing: 0.04em; margin-bottom: 18px;
  background: linear-gradient(180deg, var(--ink-strong) 0%, var(--gold-soft) 60%, var(--gold) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--gold); }
.runes-hero .sub { font-family: var(--serif); font-style: italic; font-size: clamp(1.15rem, 2vw, 1.5rem); color: var(--muted); letter-spacing: 0.01em; margin-bottom: 18px; }
.runes-hero .tag { font-family: var(--mono); font-size: clamp(0.72rem, 1vw, 0.86rem); letter-spacing: 0.28em; color: var(--gold-soft); text-transform: uppercase; }
.runes-hero .lead { max-width: 680px; margin: 30px auto 0; font-size: 1.02rem; line-height: 1.8; color: var(--muted); font-weight: 400; }
.facts { list-style: none; margin: 34px auto 0; display: inline-flex; flex-wrap: wrap; justify-content: center; border: 1px solid var(--hair-strong); background: var(--surface); }
.facts li { display: flex; flex-direction: column; gap: 6px; padding: 12px 20px; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; text-align: left; }
.facts li + li { border-left: 1px solid var(--hair); }
.facts .k { color: var(--soft); }
.facts .v { color: var(--gold-soft); text-decoration: none; }
.facts a.v:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Gallery */
.gallery { padding: 48px 0 120px; }
.gallery-head { margin-bottom: 40px; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.gallery-head .se { margin-bottom: 10px; }
.gallery-head h2 { font-weight: 200; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.1; }
.gallery-head .legend { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.2em; color: var(--soft); text-transform: uppercase; }

/* Search and category filter: assets/runes-filter.js removes [hidden]; without it every card shows. */
.rune-tools { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; justify-content: space-between; margin: 0 0 22px; padding: 14px 16px; border: 1px solid var(--hair-strong); background: var(--surface); }
.rune-tools[hidden] { display: none; }
.rt-search { display: flex; align-items: center; gap: 12px; flex: 1 1 300px; max-width: 460px; }
.rt-search label { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--soft); }
.rt-search input { flex: 1; min-width: 0; appearance: none; border-radius: 0; background: var(--bg); border: 1px solid var(--hair-strong); color: var(--ink); font-family: var(--mono); font-size: 0.8rem; padding: 10px 12px; }
.rt-search input::placeholder { color: var(--soft); }
.rt-search input:focus { border-color: var(--gold); }
.rt-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.rt-cats button { appearance: none; border: 1px solid var(--hair-strong); background: transparent; color: var(--muted); font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; padding: 9px 12px; cursor: pointer; }
.rt-cats button .n { margin-left: 8px; color: var(--soft); }
.rt-cats button:hover:not([aria-pressed="true"]) { color: var(--ink); border-color: var(--gold); }
.rt-cats button[aria-pressed="true"] { background: var(--gold-fill); border-color: var(--gold-fill); color: var(--on-gold); font-weight: 600; }
.rt-cats button[aria-pressed="true"] .n { color: var(--on-gold); }
.rt-count { flex-basis: 100%; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--soft); }
.rt-empty { margin-top: 18px; padding: 28px 20px; text-align: center; border: 1px dashed var(--hair-strong); font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.rt-empty[hidden] { display: none; }
.rt-empty button { appearance: none; margin-left: 10px; border: 1px solid var(--gold); background: var(--tint); color: var(--gold); font: inherit; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.62rem; padding: 7px 12px; cursor: pointer; }

/* The grid is a list; each cell draws its own hairline, so a filtered list has no empty grey cells. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1px; list-style: none; margin: 1px; }
.grid > li { display: flex; box-shadow: 0 0 0 1px var(--hair); }
.grid > li[hidden] { display: none; }
.grid > li > .card { flex: 1; }
.card { background: var(--bg); padding: 32px 28px; position: relative; display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; cursor: pointer; transition: background 0.2s; overflow: hidden; min-height: 300px; }
.card::before { content: ""; position: absolute; top: 0; right: 0; width: 200px; height: 200px; background: radial-gradient(circle, var(--tint), transparent 65%); opacity: 0.8; pointer-events: none; }
.card:hover { background: var(--tint); }
.card:focus-visible { outline-offset: -3px; }
.card .num { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.3em; color: var(--gold); }
.card .preview { height: 96px; border: 1px solid var(--hair); background: var(--screen); position: relative; overflow: hidden; margin: 6px 0; }
.card .preview svg { width: 100%; height: 100%; display: block; }
.card h3 { font-weight: 300; font-size: 1.55rem; letter-spacing: 0.04em; line-height: 1.05; }
.card .desc { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.03em; line-height: 1.65; color: var(--muted); flex: 1; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.card .chip { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.18em; color: var(--gold-soft); padding: 3px 8px; border: 1px solid var(--hair); text-transform: uppercase; }
.card .chip.ext { color: var(--violet); border-color: rgba(124, 58, 237, 0.4); }
.card .open { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.24em; color: var(--gold); text-transform: uppercase; border-top: 1px solid var(--hair); padding-top: 14px; }
.card:hover .open { color: var(--gold-soft); }
.card .open .arrow { transition: transform 0.18s; }
.card:hover .open .arrow { transform: translateX(4px); }
.card kbd { font: inherit; font-family: var(--mono); font-size: 0.85em; border: 1px solid var(--hair); padding: 1px 6px; color: var(--gold-soft); }

/* Card headings with the Rune's own colour */
.card h3.h-gold, .card h3.h-violet, .card h3.h-cyan { -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.card h3.h-gold { background-image: linear-gradient(180deg, var(--ink-strong) 0%, var(--gold-soft) 60%, var(--gold) 100%); color: var(--gold); }
.card h3.h-violet { background-image: linear-gradient(180deg, var(--ink-strong) 0%, var(--rv) 60%, var(--rv-deep) 100%); color: var(--rv); }
.card h3.h-cyan { background-image: linear-gradient(180deg, var(--ink-strong) 0%, var(--rc) 60%, var(--rc-deep) 100%); color: var(--rc); }
.card.violet .num, .card.violet .open, .card.violet .chip.accent { color: var(--rv); }
.card.violet .chip.accent { border-color: rgba(124, 58, 237, 0.45); }
.card.cyan .num, .card.cyan .open, .card.cyan .chip.accent { color: var(--rc); }
.card.cyan .chip.accent { border-color: rgba(0, 229, 255, 0.45); }

/* How it fits */
.info { margin-top: 60px; border: 1px solid var(--hair-strong); background: var(--surface); padding: 28px 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.info .se { margin-bottom: 12px; }
.info p { font-size: 0.95rem; line-height: 1.75; color: var(--muted); }
.info p + p { margin-top: 14px; }
.info .right { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em; color: var(--soft); line-height: 1.9; }
.info .right .k { color: var(--soft); }
.info .right .v { color: var(--gold-soft); text-align: right; }
.info .right .row { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--hair); padding: 6px 0; }

@media (max-width: 700px) {
  .info { grid-template-columns: 1fr; padding: 24px 20px; }
  .facts { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .facts li + li { border-left: 0; }
  .facts li:nth-child(even) { border-left: 1px solid var(--hair); }
  .facts li:nth-child(n + 3) { border-top: 1px solid var(--hair); }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .runes-hero { padding: 56px 0 36px; }
  .card { padding: 26px 20px; min-height: 0; }
}
