/* Plain — one quiet centred column. System fonts, neutral greys, one accent. */

:root {
  --bg: #ffffff;
  --text: #1c1c1e;
  --muted: #62646a;
  --faint: #8a8c92;
  --line: #e6e6e9;
  --field: #ffffff;
  --field-line: #d4d5d9;
  --soft: #f4f4f6;
  --accent: #2459c2;
  --mark: color-mix(in srgb, var(--accent) 18%, transparent);
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141416;
    --text: #e9e9ec;
    --muted: #a3a5ab;
    --faint: #85878d;
    --line: #2a2b2f;
    --field: #1b1c1f;
    --field-line: #3a3b40;
    --soft: #1e1f22;
    --accent: #84aaf3;
    --mark: color-mix(in srgb, var(--accent) 28%, transparent);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  accent-color: var(--accent);
  caret-color: var(--accent);
  -webkit-font-smoothing: antialiased;
}
::selection { background: color-mix(in srgb, var(--accent) 26%, transparent); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
p, h1, h2, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
html:not(.js) .js-only { display: none !important; }
[hidden] { display: none !important; }

.page { max-width: 680px; margin: 0 auto; padding: 40px 20px 32px; }

/* ── Header ───────────────────────────── */
.back { font-size: 14px; margin-bottom: 28px; }
.head { margin-bottom: 28px; }
.channel { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.channel a { color: var(--muted); }
h1 {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.015em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.lede { margin-top: 10px; color: var(--muted); max-width: 62ch; }
.meta { margin-top: 10px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.watch .meta { margin-top: 0; }

.watch { display: flex; gap: 16px; align-items: center; margin-top: 18px; }
.watch .thumb { width: 168px; }
.yt { font-size: 15px; font-weight: 500; }

.thumb {
  display: block;
  flex: none;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--line);
}
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ── Search + filters ─────────────────── */
.tools { display: flex; gap: 8px; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 180px; min-width: 0; }
#year { flex: none; }
.search-icon {
  position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  fill: none; stroke: var(--faint); stroke-width: 1.6; stroke-linecap: round; pointer-events: none;
}
input[type="search"], select {
  font: inherit;
  font-size: 16px; /* no zoom on iOS */
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--field-line);
  border-radius: var(--radius);
  height: 42px;
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}
input[type="search"] { width: 100%; padding: 0 40px 0 36px; }
input[type="search"]::placeholder { color: var(--faint); opacity: 1; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
select {
  padding: 0 34px 0 12px;
  max-width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%238a8c92' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
input[type="search"]:hover, select:hover { border-color: var(--faint); }
input[type="search"]:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
select.on { border-color: var(--accent); color: var(--accent); }
kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font: 12px/1 system-ui, sans-serif; color: var(--faint);
  border: 1px solid var(--field-line); border-radius: 4px; padding: 3px 6px;
}
.search:focus-within kbd { display: none; }
.selects { display: flex; gap: 8px; flex: 1 1 100%; min-width: 0; }
.selects select { flex: 1 1 0; min-width: 0; width: 0; }
.source-meta .nw { white-space: nowrap; }

.status {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 14px 0 8px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.status strong { color: var(--text); font-weight: 600; }
.link-btn {
  font: inherit; font-size: 14px; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.copied { margin-left: auto; color: var(--text); }

/* ── Index: videos ────────────────────── */
.videos { border-top: 1px solid var(--line); }
.video {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.video .thumb { width: 128px; }
.video-body { flex: 1; min-width: 0; }
.video h2 { font-size: 17px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.video h2 a { color: var(--text); }
.video h2 a:hover { color: var(--accent); }
.video-meta { margin-top: 4px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

.hits { margin-top: 10px; font-size: 14px; line-height: 1.5; }
.hits li { display: grid; grid-template-columns: 2.2em 1fr; column-gap: 4px; padding: 3px 0; }
.hit-n { color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; padding-right: 6px; grid-row: span 2; }
.hits a { overflow-wrap: anywhere; }
.hit-meta { color: var(--muted); grid-column: 2; overflow-wrap: anywhere; }
.hit-more { grid-template-columns: 2.2em 1fr; }
.hit-more a { grid-column: 2; }

/* ── Video page: sources ──────────────── */
.section { margin-top: 28px; }
.section:first-child { margin-top: 12px; }
.section h2 {
  font-size: 15px; font-weight: 600; line-height: 1.4;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.section h2 .count { font-weight: 400; color: var(--faint); margin-left: 4px; font-variant-numeric: tabular-nums; }

.source {
  display: grid; grid-template-columns: 2.25em 1fr; column-gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 16px;
}
.source:target { background: linear-gradient(var(--soft), var(--soft)) no-repeat; box-shadow: -10px 0 0 var(--soft), 10px 0 0 var(--soft); }
.n {
  color: var(--faint); font-size: 14px; line-height: 1.75; text-align: right;
  font-variant-numeric: tabular-nums;
}
.n:hover { color: var(--accent); text-decoration: none; }
.n[data-copied] { color: var(--accent); }
.source-body { min-width: 0; }
.title { font-size: 16px; line-height: 1.45; font-weight: 500; overflow-wrap: anywhere; }
.source-meta { margin-top: 3px; font-size: 14px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
/* Each part wraps as a whole: "Stephen / Puleo" never splits across lines. */
.source-meta > span { display: inline-block; max-width: 100%; }
/* The dot ends the part before it, so a wrapped line never starts with one. */
.source-meta > span:not(:last-child)::after { content: "·"; margin: 0 6px; color: var(--faint); }
.note { margin-top: 6px; font-size: 14px; color: var(--muted); line-height: 1.55; }

/* ── Empty, pager, footer ─────────────── */
.empty { padding: 28px 0; border-top: 1px solid var(--line); }
.videos + .empty { border-top: 0; }
.empty p + p { margin-top: 4px; font-size: 15px; }

.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 15px;
}
.pager a { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.pager .muted { font-size: 13px; }
.pager .next { text-align: right; grid-column: 2; }

.foot {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px 20px;
}
.foot a { color: var(--muted); }
.foot a:hover { color: var(--accent); }
.links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.foot p:last-child { margin-left: auto; }

@media (max-width: 520px) {
  .page { padding: 28px 16px 24px; }
  h1 { font-size: 24px; }
  .video { gap: 12px; padding: 14px 0; }
  .video .thumb { width: 96px; }
  .video h2 { font-size: 16px; }
  .watch .thumb { width: 128px; }
  .source { grid-template-columns: 1.9em 1fr; column-gap: 8px; }
  .foot p:last-child { margin-left: 0; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
