:root {
  --bg: #0e1217;
  --tile: #161b22;
  --tile-hover: #1c222b;
  --line: #2a313b;
  --line-strong: #3a424d;
  --ink: #e6edf3;
  --ink-soft: #b8c0c8;
  --muted: #6e7681;
  --muted-dim: #4a5158;
  --accent: #f5b942;
  --accent-soft: #ffd87a;
  --link: #58a6ff;
  --link-hover: #f5b942;
  --positive: #56d364;
  --negative: #f47067;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

/* Header — minimal */
.site-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px;
}
.site-header h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.site-tag {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-stamp {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

/* Channel nav (in-page filter) */
.channel-nav {
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  background: rgba(245, 185, 66, 0.04);
}
.channel-nav a {
  display: inline-block;
  margin: 0 8px 4px 0;
  padding: 2px 0;
  color: var(--muted);
  letter-spacing: 0.04em;
  border-bottom: 1px solid transparent;
}
.channel-nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.section-title {
  display: none;  /* hide section headers — channel name is inside each tile */
}

/* Tile grid — fills the screen */
.latest, .channels {
  padding: 18px;
}
.channels {
  display: contents;  /* let each section's grid live in the same layout flow */
}
.channels-grid,
.latest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

/* "Channel" wrapper — kept for SEO/anchor but visually flattened */
.channel {
  margin: 0;
  padding: 0;
  border-top: none;
}
.channel-title,
.channel-handle {
  display: none;  /* channel name shown small inside each tile instead */
}

/* Tile */
.vid {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px 12px;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.vid:hover {
  background: var(--tile-hover);
  border-color: var(--line-strong);
}

.vid-head { margin-bottom: 10px; }
.vid-channel {
  display: block !important;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 4px;
  text-transform: none;
}
.vid-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.vid-meta {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.vid-meta a {
  color: var(--link);
  font-weight: 500;
}
.vid-meta a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.vid-body p {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}
.vid-body p:first-of-type {
  color: var(--ink);
  font-weight: 500;
}
.vid-body p:last-child { margin-bottom: 0; }
.vid-body ul {
  margin: 0 0 10px;
  padding-left: 18px;
  list-style: none;
}
.vid-body ul li {
  position: relative;
  padding-left: 6px;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}
.vid-body ul li::before {
  content: "▸";
  position: absolute;
  left: -12px;
  color: var(--accent);
  font-size: 11px;
  top: 2px;
}
.vid-body ul:last-child { margin-bottom: 0; }

.muted { color: var(--muted); font-style: italic; font-size: 0.9rem; }

.site-footer {
  padding: 20px;
  text-align: center;
  border-top: 1px solid var(--line);
  color: var(--muted-dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Larger screens — squeeze more tiles per row */
@media (min-width: 1400px) {
  .channels-grid,
  .latest-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
}

/* Narrow screens — single column */
@media (max-width: 600px) {
  body { font-size: 14px; }
  .latest, .channels { padding: 12px; }
  .channels-grid,
  .latest-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .vid { padding: 12px 14px; }
}
