/* Compact — dense, scannable rows. System fonts, neutral greys, one accent. */

:root {
  --bg: #ffffff;
  --text: #1c1c1e;
  --muted: #62646a;
  --faint: #85878d;
  --line: #ececef;
  --line-strong: #dcdde1;
  --field: #ffffff;
  --field-line: #d4d5d9;
  --soft: #f5f5f7;
  --accent: #2459c2;
  --mark: color-mix(in srgb, var(--accent) 18%, transparent);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141416;
    --text: #e9e9ec;
    --muted: #a3a5ab;
    --faint: #8b8d93;
    --line: #26272b;
    --line-strong: #34353a;
    --field: #1b1c1f;
    --field-line: #3a3b40;
    --soft: #1d1e21;
    --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: 15px/1.5 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: 960px; margin: 0 auto; padding: 32px 24px 28px; }

/* ── Header ───────────────────────────── */
.back { font-size: 14px; margin-bottom: 20px; }
.head { padding-bottom: 20px; }
.head-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; }
h1 { font-size: 24px; line-height: 1.3; font-weight: 650; letter-spacing: -0.01em; text-wrap: balance; overflow-wrap: anywhere; }
h1 .by { font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
h1 .by a { color: var(--muted); }
.facts { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.head > .facts { margin-top: 6px; }
.lede { margin-top: 6px; color: var(--muted); max-width: 70ch; }

/* ── Toolbar ──────────────────────────── */
.bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.search { position: relative; flex: 1 1 220px; min-width: 0; }
.bar > .tabs:first-child + .search { flex: 0 1 300px; margin-left: auto; }
.search-icon {
  position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px;
  fill: none; stroke: var(--faint); stroke-width: 1.6; stroke-linecap: round; pointer-events: none;
}
input[type="search"], select {
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--field); border: 1px solid var(--field-line); border-radius: 6px;
  height: 36px;
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}
input[type="search"] { width: 100%; padding: 0 36px 0 32px; }
input[type="search"]::placeholder { color: var(--faint); opacity: 1; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
select {
  flex: 0 1 220px; min-width: 0; padding: 0 30px 0 10px; font-size: 15px;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  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 10px center;
}
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: 9px; 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: 2px 5px;
}
.search:focus-within kbd { display: none; }

/* Segmented text tabs: year on the index, type on a video page. */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; flex: 1 1 100%; }
.bar > .tabs:first-child { flex: 1 1 auto; }
.tabs button {
  font: inherit; font-size: 14px; color: var(--muted);
  background: none; border: 0; border-radius: 6px;
  padding: 5px 9px; cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--text); background: var(--soft); }
.tabs button[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 600; }
.tabs .c { font-weight: 400; color: var(--faint); font-variant-numeric: tabular-nums; margin-left: 2px; }
.tabs button[aria-pressed="true"] .c { color: inherit; opacity: 0.8; }

.status {
  display: flex; align-items: baseline; gap: 12px;
  padding: 8px 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.status strong { color: var(--text); font-weight: 600; }
.link-btn { font: inherit; 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); }

/* ── Rows ─────────────────────────────── */
.rows { border-top: 1px solid var(--line-strong); }
.rows > li { border-bottom: 1px solid var(--line); }

/* Index */
.vrow .line {
  display: grid; grid-template-columns: 7.5em minmax(0, 1fr) auto; gap: 16px;
  align-items: baseline; padding: 9px 0;
}
.date, .cnt { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cnt { text-align: right; }
.vrow .t { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.vrow .t:hover { color: var(--accent); }
.hits { padding: 0 0 10px calc(7.5em + 16px); font-size: 14px; }
.hits li { display: flex; flex-wrap: wrap; gap: 0 8px; padding: 2px 0; align-items: baseline; }
.hit-n { color: var(--faint); font-variant-numeric: tabular-nums; min-width: 2em; text-align: right; }
.hits a { overflow-wrap: anywhere; min-width: 0; }
.hit-meta { color: var(--muted); overflow-wrap: anywhere; }
.hit-more { padding-left: calc(2em + 8px) !important; }

/* Video page */
.section h2 {
  font-size: 14px; font-weight: 600; line-height: 1.4;
  padding: 18px 0 6px;
}
.section:first-child h2 { padding-top: 6px; }
.section h2 .c { font-weight: 400; color: var(--faint); margin-left: 4px; font-variant-numeric: tabular-nums; }
.s { scroll-margin-top: var(--sticky, 16px); }
.s:target { background: var(--soft); }
.s .line {
  display: grid;
  grid-template-columns: 2.6em minmax(0, 1fr) minmax(0, max-content) 3.6em 28px;
  gap: 12px; align-items: baseline;
  padding: 6px 0;
}
.n { color: var(--faint); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.n:hover { color: var(--accent); text-decoration: none; }
.s .t { overflow-wrap: anywhere; }
.dm {
  max-width: 15em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; color: var(--muted); text-align: right;
}
.at { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.more {
  align-self: center; width: 28px; height: 24px; padding: 0; border: 0; border-radius: 5px;
  background: none; color: var(--faint); cursor: pointer;
}
.more::before {
  content: ""; display: block; width: 10px; height: 6px; margin: auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1 4 4 4-4'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1 4 4 4-4'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.15s ease-out;
}
.more:hover { color: var(--text); background: var(--soft); }
.more[aria-expanded="true"]::before { transform: scaleY(-1); }

.detail { padding: 0 40px 10px 51px; font-size: 13px; color: var(--muted); }
.dmeta > span + span::before { content: "·"; margin: 0 6px; color: var(--faint); }
.note { margin-top: 3px; max-width: 72ch; line-height: 1.5; }

/* ── Empty, pager, footer ─────────────── */
.empty { padding: 24px 0; border-top: 1px solid var(--line-strong); }
.rows + .empty, #list + .empty { border-top: 0; }
.empty p + p { margin-top: 4px; font-size: 14px; }

.pager { display: flex; flex-direction: column; gap: 4px; margin-top: 28px; font-size: 14px; }
.pager a { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); overflow-wrap: anywhere; }

.foot {
  margin-top: 40px; padding-top: 16px; 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 (min-width: 721px) {
  .bar.sticky { position: sticky; top: 0; z-index: 2; }
  .s { scroll-margin-top: 140px; }
}

@media (max-width: 720px) {
  .page { padding: 24px 16px 24px; }
  h1 { font-size: 22px; }
  .bar > .tabs:first-child + .search { flex: 1 1 100%; margin-left: 0; order: -1; }
  .bar select { flex: 1 1 100%; }

  .vrow .line { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .vrow .t { grid-column: 1 / -1; }
  .vrow .date { grid-row: 2; }
  .vrow .cnt { grid-row: 2; }
  .hits { padding-left: 0; }

  /* Two short lines: number + title, then website + timestamp. */
  .s .line {
    grid-template-columns: 2.2em minmax(0, 1fr) auto 28px;
    gap: 1px 10px; padding: 8px 0;
  }
  .n { grid-column: 1; grid-row: 1; }
  .s .t { grid-column: 2 / 4; grid-row: 1; }
  .more { grid-column: 4; grid-row: 1; align-self: start; }
  .dm { grid-column: 2; grid-row: 2; text-align: left; max-width: none; }
  .at { grid-column: 3; grid-row: 2; }
  .detail { padding: 0 0 10px 43px; }
  .foot p:last-child { margin-left: 0; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.dmeta .nw { white-space: nowrap; }
