/* PersonalFeed — plain CSS (no framework). Dark theme. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background: #0a0a0b;
  color: #e5e5e7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; }

/* ------- sidebar ------- */
.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: 220px;
  height: 100vh;
  background: #0a0a0b;
  border-right: 1px solid #27272a;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 50;
}
/* Hacker-style sidebar. Brand is a shell prompt, nav items are paths. */
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 8px 14px;
  border-bottom: 1px solid #27272a;
  margin-bottom: 12px;
}
.brand {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: #22c55e; /* terminal green */
  line-height: 1.2;
}
.brand-path { color: #4ade80; }
.brand-launch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #18181b;
  border: 1px solid #27272a;
  color: #a1a1aa;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.brand-launch:hover {
  color: #22c55e;
  border-color: #22c55e;
  background: #0a1a0e;
}
.brand-launch:active { transform: scale(0.95); }
.brand-launch.playing {
  color: #22c55e;
  border-color: #22c55e;
  background: #0a1a0e;
  animation: brand-launch-pulse 1.4s ease-in-out infinite;
}
@keyframes brand-launch-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50%      { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);   }
}

.nav-item {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  color: #71717a;
  transition: background 0.15s, color 0.15s;
}
.nav-item::before {
  content: "";
  color: #52525b;
  margin-right: 6px;
}
.nav-item:hover { color: #d4d4d8; background: #18181b; }
.nav-item:hover::before { content: "▸"; color: #22c55e; }
.nav-item.active { color: #22c55e; background: #0a1a0e; }
.nav-item.active::before { content: "▸"; color: #22c55e; }
.built {
  margin-top: auto;
  font-size: 10px;
  color: #52525b;
  padding: 8px 10px;
  border-top: 1px solid #18181b;
  font-family: ui-monospace, Menlo, monospace;
}

/* ------- main ------- */
.main {
  flex: 1;
  margin-left: 220px;
  padding: 32px 36px;
  min-width: 0;
}
.page-header {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
/* Sticky header container — pins page title, view toggle and filter chips
   to the top of the viewport while the list below scrolls. Negative margins
   bleed the sticky region out past `.main`'s 32/36px padding so the dark
   background fully covers the top edge when pinned. */
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #0a0a0b;
  margin: -32px -36px 18px;
  padding: 28px 36px 12px;
  border-bottom: 1px solid #18181b;
}
.sticky-top .page-header { margin-bottom: 12px; }
.sticky-top .chips { margin-bottom: 0; }
.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
}
.view-toggle {
  display: inline-flex;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.view-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #a1a1aa;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.view-btn:hover { color: #fff; }
.view-btn.active {
  background: #27272a;
  color: #fff;
}
.empty {
  padding: 60px 20px;
  text-align: center;
  color: #71717a;
  font-size: 14px;
}

/* ------- chips / filter buttons ------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.chip {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  color: #71717a;
  transition: background 0.15s, color 0.15s;
}
.chip:hover { color: #d4d4d8; }
.chip.active { background: #3f3f46; color: #fff; }
.chip .count { opacity: 0.5; margin-left: 4px; }

/* ------- videos ------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.video-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.video-grid.list-view .video-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  background: transparent;
  transition: background 0.15s;
}
.video-grid.list-view .video-card:hover { background: #18181b; }
.video-grid.list-view .thumb { aspect-ratio: 16/9; }
.video-grid.list-view .video-title {
  margin: 0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  -webkit-line-clamp: initial;
  -webkit-box-orient: initial;
}
.video-grid.list-view .video-meta {
  margin: 0;
  white-space: nowrap;
  font-size: 11px;
}
.video-card { text-align: left; }
.thumb {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  background: #18181b;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s;
}
.video-card:hover .thumb img { transform: scale(1.04); }
.thumb .play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 36px;
  opacity: 0;
  background: rgba(0,0,0,0.2);
  transition: opacity 0.2s;
}
.video-card:hover .thumb .play-icon { opacity: 1; }
.video-title {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #e4e4e7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-meta { font-size: 11px; color: #71717a; margin-top: 2px; }

/* ------- podcasts ------- */
.pod-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pod-grid.tiles-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.pod-grid.tiles-view .pod-card {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.pod-grid.tiles-view .pod-card img,
.pod-grid.tiles-view .pod-card .pod-ph {
  width: 100%;
  height: auto;
  aspect-ratio: 1/1;
}
.pod-grid.tiles-view .pod-desc { display: none; }
.pod-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  background: #111113;
  border: 1px solid #1f1f22;
  border-radius: 10px;
  padding: 12px;
  transition: background 0.15s;
}
.pod-card:hover { background: #18181b; }
.pod-card img {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.pod-card .pod-ph {
  width: 64px;
  height: 64px;
  background: #27272a;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.pod-info { min-width: 0; flex: 1; }
.pod-title {
  font-size: 14px;
  font-weight: 500;
  color: #e4e4e7;
  margin-bottom: 2px;
}
.pod-meta { font-size: 11px; color: #71717a; margin-bottom: 4px; }
.pod-desc {
  font-size: 12px;
  color: #a1a1aa;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------- news ------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
/* Compressed list variant — one dense row per article. */
.news-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.news-grid.list-view .news-card {
  padding: 8px 12px;
  border-radius: 6px;
  gap: 14px;
  align-items: center;
}
.news-grid.list-view .news-img {
  width: 40px;
  height: 40px;
}
.news-grid.list-view .news-body {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: center;
}
.news-grid.list-view .news-source {
  margin: 0;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news-grid.list-view .news-title {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: initial;
  -webkit-box-orient: initial;
}
.news-grid.list-view .news-snippet { display: none; }
.news-card {
  display: flex;
  gap: 12px;
  background: #111113;
  border: 1px solid #1f1f22;
  border-radius: 10px;
  padding: 12px;
  transition: background 0.15s, border-color 0.15s;
}
.news-card:hover { background: #18181b; border-color: #2d2d30; }
.news-img {
  width: 96px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #18181b;
}
.news-img img { width: 100%; height: 100%; object-fit: cover; }
.news-img-logo img { object-fit: contain; padding: 14px; }
.news-grid.list-view .news-img-logo img { padding: 6px; }
.news-body { min-width: 0; flex: 1; }
.news-source {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.news-title {
  font-size: 13px;
  font-weight: 600;
  color: #e4e4e7;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-snippet {
  font-size: 12px;
  color: #a1a1aa;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------- video overlay ------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.overlay-inner {
  width: 100%;
  max-width: 1100px;
  position: relative;
}
.overlay-frame {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.overlay-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.overlay-title {
  margin-top: 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
}
.overlay-close {
  position: absolute;
  right: -8px;
  top: -38px;
  font-size: 28px;
  color: #fff;
  line-height: 1;
  width: 32px;
  height: 32px;
}

/* ------- podcast player (pinned to sidebar bottom) ------- */
.podcast-bar {
  position: relative;
  background: #111113;
  border: 1px solid #27272a;
  border-radius: 10px;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 6px;
}
.pb-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding-right: 22px;
}
.pb-top > img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.pb-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pb-meta > div:first-child {
  font-size: 12px;
  font-weight: 500;
  color: #e4e4e7;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pb-meta > div:last-child {
  font-size: 10px;
  color: #71717a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pb-progress-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pb-time {
  font-size: 9px;
  color: #71717a;
  font-variant-numeric: tabular-nums;
  min-width: 26px;
  text-align: center;
}
.pb-seek {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #27272a;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
.pb-seek:focus-visible {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35);
}
.pb-seek::-webkit-slider-runnable-track {
  height: 4px;
  background: #27272a;
  border-radius: 999px;
}
.pb-seek::-moz-range-track {
  height: 4px;
  background: #27272a;
  border-radius: 999px;
}
.pb-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #f5f5f5;
  border: 0;
  margin-top: -4.5px;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s;
}
.pb-seek:hover::-webkit-slider-thumb,
.pb-seek:active::-webkit-slider-thumb { transform: scale(1.15); }
.pb-seek::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #f5f5f5;
  border: 0;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.pb-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
}
.pb-skip {
  font-size: 10px;
  font-weight: 600;
  color: #a1a1aa;
  padding: 5px 7px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s, background 0.15s;
}
.pb-skip:hover { color: #fff; background: #27272a; }
#pb-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f5f5f5;
  color: #000;
  font-size: 13px;
  flex-shrink: 0;
  transition: transform 0.1s;
}
#pb-toggle:hover { transform: scale(1.05); }
.pb-close {
  position: absolute;
  top: 6px;
  right: 8px;
  color: #52525b;
  font-size: 16px;
  line-height: 1;
  width: 18px;
  height: 18px;
}
.pb-close:hover { color: #fff; }
