/* site.css — the kit's one stylesheet (build-free vanilla MPA, S-16: no inline styles anywhere).
 *
 * HEADER = PIXEL-FIDELITY PORT (owner ruling 2026-08-25): the design DATA below — palette,
 * logo, bar shadow/padding, search-pill geometry, breakpoints — is measured out of the old
 * tree's COLOR_GUIDE.md + style.css nav rules. The MARKUP is fresh (templates/header.tmpl);
 * nothing was lifted. Everything outside the header takes palette/type/feel only.
 *
 * THEMING SEAM: the :root tokens + /static/brand/* are the instance theming layer. How much
 * structure the white-label seam gets (tokens-only vs theme package) is an owner think-through
 * due before the OSS split — not baked here.
 */

:root {
  /* Hyperdope palette (COLOR_GUIDE.md) */
  --blue-light: #9bd9fb;   /* primary background accents, brand identity */
  --blue-mid: #469adc;     /* secondary actions, hover states */
  --blue-bright: #4288fa;  /* active states */
  --lightning: #fcf136;    /* Lightning payments, tips */
  --bitcoin: #ff6600;      /* on-chain (distinguish from lightning) */
  --success: #6bff71;      /* confirmations */
  --purple-light: #ba6ff8; /* tertiary, sparingly */
  --purple-dark: #9942f9;
  /* grayscale (old guide) */
  --ink: #111827;
  --ink-soft: #6b7280;
  --line: #e5e7eb;
  --paper: #f9fafb;
  --link: #5a5a5a;         /* old base link color */
}

/* base (ported: the old tree's global reset + link/type defaults) */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: sans-serif; }
a { text-decoration: none; color: var(--link); }
body { background: #fff; color: var(--ink); }
img { max-width: 100%; }

/* ── header — the ported brand shell ─────────────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1px 2%;
  background: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .brand { display: flex; align-items: center; }
.site-header .brand img {
  width: 130px;
  height: auto;
  display: block;
  margin-left: 10px;
  margin-right: 25px;
}
.site-header .search {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 25px;
  padding: 8px 12px;
  margin-right: 15px;
  background: #fff;
}
.site-header .search input {
  width: 400px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 1rem;
}
.site-header .search button {
  border: 0;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.site-header .search button img { width: 15px; height: 15px; }
.site-header .nav-right { display: flex; align-items: center; }
.site-header .nav-right a { margin-right: 25px; color: var(--link); }

@media (max-width: 900px) {
  .site-header { padding: 1px 10px; }
  .site-header .brand img { width: 110px; margin-left: 5px; }
  .site-header .search input { width: 100px; }
  .site-header .nav-right a { margin-right: 15px; }
}
@media (max-width: 450px) {
  .site-header { padding: 1px 5px; }
  .site-header .brand img { width: 100px; margin-left: 3px; margin-right: 4px; }
  .site-header .search input { width: 70px; }
  .site-header .nav-right a { margin-right: 5px; }
}

/* ── page scaffold ───────────────────────────────────────────────────────────────────────── */
main.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 2% 64px;
}
@media (max-width: 900px) { main.page { padding-left: 5%; padding-right: 5%; } }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 16px 2%;
  margin-top: 48px;
}

/* ── museum home: curated sections ───────────────────────────────────────────────────────── */
.museum-intro { margin: 8px 0 28px; color: var(--ink-soft); max-width: 70ch; }
.museum-section { margin-bottom: 40px; }
.museum-section > h2 {
  font-size: 1.25rem;
  border-left: 4px solid var(--blue-light);
  padding-left: 10px;
  margin-bottom: 6px;
}
.museum-section .commentary {
  color: var(--ink-soft);
  margin: 0 0 14px 14px;
  max-width: 75ch;
}
.museum-section .item-note {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* card grid (home sections, search results, channel pages) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.card {
  background: #fff;
  border: 1px solid var(--blue-light);   /* COLOR_GUIDE: video cards border light blue */
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s ease;
  display: block;
  color: var(--ink);
}
.card:hover { border-color: var(--blue-mid); }  /* hover: medium blue */
.card .thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--paper), var(--blue-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-mid);
  font-size: 1.6rem;
  position: relative;
  overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .badges { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; }
.badge {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(17, 24, 39, 0.8);
  color: #fff;
}
.badge.lock { background: var(--lightning); color: var(--ink); }   /* lightning yellow = pay */
.badge.file { background: var(--purple-light); color: var(--ink); }
.card .card-body { padding: 10px 12px 12px; }
.card .card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .card-meta { color: var(--ink-soft); font-size: 0.8rem; margin-top: 6px; }

/* ── watch / item page ───────────────────────────────────────────────────────────────────── */
.watch-layout { max-width: 1080px; margin: 0 auto; }
.watch-layout video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  display: block;
}
.watch-title { font-size: 1.35rem; margin: 14px 0 4px; }
.watch-byline { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 12px; }
.watch-byline a { color: var(--blue-mid); }
.watch-desc { margin: 12px 0; max-width: 85ch; white-space: pre-line; color: var(--ink); }
.watch-actions { display: flex; gap: 10px; align-items: center; margin: 14px 0; flex-wrap: wrap; }

button.btn {
  border: 0;
  border-radius: 25px;
  padding: 10px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--blue-mid);
  color: #fff;
}
button.btn:hover { background: var(--blue-bright); }
button.btn.pay { background: var(--lightning); color: var(--ink); }  /* lightning payments = yellow */
button.btn.pay:hover { filter: brightness(0.95); }
button.btn.ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
button.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* the pay box: QR + invoice + the S-5 copy-credential floor */
.paybox {
  border: 1px solid var(--blue-light);
  border-radius: 8px;
  padding: 16px;
  margin: 14px 0;
  background: var(--paper);
}
.paybox h2 { font-size: 1rem; margin: 10px 0 6px; }
.paybox .qr {
  display: block;
  width: 260px;
  max-width: 100%;
  margin: 8px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.paybox .qr.stale { opacity: 0.35; filter: grayscale(1); }  /* expired invoice — do not scan */
.paybox textarea, .restore textarea {
  width: 100%;
  font-family: monospace;
  font-size: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #fff;
  resize: vertical;
}
.paybox .paystate { margin-top: 8px; font-weight: 600; }
.paybox .paystate.ok { color: #1a7f2e; }
.hint { color: var(--ink-soft); font-size: 0.85rem; margin: 4px 0; }

.restore { margin: 18px 0; }
.restore summary { cursor: pointer; color: var(--ink-soft); }
.restore .restore-body { margin-top: 8px; }

/* download-of-original surface (0x05; item pages + watch pages that also sell the file) */
.download-box {
  border: 1px solid var(--purple-light);
  border-radius: 8px;
  padding: 16px;
  margin: 14px 0;
  background: var(--paper);
}
.download-box h2 { font-size: 1rem; margin-bottom: 6px; }

/* page log (kept from the harness — honest persistence logging lives here) */
pre.pagelog {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font-size: 0.72rem;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 18px 0;
}

/* ── search page ─────────────────────────────────────────────────────────────────────────── */
.search-head { margin-bottom: 20px; }
.search-head .count { color: var(--ink-soft); font-size: 0.9rem; }

/* ── channel / provenance page ───────────────────────────────────────────────────────────── */
.channel-head { margin-bottom: 20px; }
.channel-head h1 { font-size: 1.4rem; }
.channel-head .provenance { color: var(--ink-soft); font-size: 0.9rem; margin-top: 4px; }
.channel-head .provenance a { color: var(--blue-mid); }

/* round-2 C6: the shared payment surface names its product; a returning download holder gets
   the copy surface without a phantom invoice */
.payproduct { margin: 0 0 .5rem; font-weight: 600; opacity: .85; }
.payproduct:empty { display: none; }
.paybox.saved .invoice { display: none; }

/* the custody law's recovery surface: archived credentials are listed, never buried in storage */
.archived { margin-top: .75rem; }
.archived h3 { margin: 0 0 .25rem; font-size: 1rem; }
.archived ul { list-style: none; margin: 0; padding: 0; }
.archived li { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .35rem 0; border-top: 1px solid rgba(128,128,128,.25); }
.archived code { font-size: .8rem; opacity: .8; }
