:root {
  --ink: #0a0d12;
  --ink-soft: #111620;
  --panel: #151b25;
  --line: #2a3240;
  --muted: #949daa;
  --paper: #f2f2ed;
  --lime: #c9ff5a;
  --aqua: #79e8d2;
  --red: #ff705f;
  --side: clamp(18px, 4vw, 64px);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--ink);
  color: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.1'/%3E%3C/svg%3E");
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; background: var(--lime); color: var(--ink); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; }

.site-header {
  min-height: 72px;
  padding: 0 var(--side);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; width: max-content; text-decoration: none; text-transform: uppercase; font-size: 13px; font-weight: 800; letter-spacing: .12em; }
.brand > span:last-child span { color: var(--lime); }
.brand-mark { position: relative; display: flex; align-items: center; gap: 4px; width: 30px; height: 30px; border: 1px solid var(--paper); }
.brand-mark i { width: 5px; height: 14px; margin-left: 7px; background: var(--lime); }
.brand-mark b { width: 0; height: 0; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 8px solid var(--lime); }
.header-meta { grid-column: 2; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 0 4px rgba(121,232,210,.08); }
.refresh-button { margin-left: 6px; padding: 6px 9px; color: var(--aqua); background: transparent; border: 1px solid #40584f; cursor: pointer; font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.refresh-button:hover:not(:disabled) { color: var(--ink); background: var(--aqua); border-color: var(--aqua); }
.refresh-button:disabled { opacity: .55; cursor: wait; }
.icon-button { background: transparent; border: 0; }
.mobile-filter { display: none; justify-self: end; width: 38px; height: 38px; padding: 8px; }

main { padding: 0 var(--side) 100px; }
.intro { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: clamp(48px, 10vw, 160px); align-items: end; min-height: 390px; padding: 68px 0 60px; }
.eyebrow { margin: 0 0 18px; color: var(--lime); font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .18em; }
h1 { margin: 0; font: 500 clamp(52px, 7vw, 104px)/.88 Georgia, "Times New Roman", serif; letter-spacing: -.055em; }
h1 em { color: var(--muted); font-weight: 400; }
.intro-note { max-width: 590px; padding-bottom: 5px; }
.intro-note > p { max-width: 540px; margin: 0 0 34px; color: #b9c0ca; font-size: clamp(16px, 1.5vw, 20px); line-height: 1.55; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.stats > div { padding-top: 17px; }
.stats strong { display: block; font: 500 28px/1 Georgia, serif; }
.stats span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }

.toolbar-wrap { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 28px; margin: 0 calc(var(--side) * -1); padding: 0 var(--side); min-height: 72px; background: rgba(10,13,18,.96); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.view-tabs { display: flex; align-self: stretch; }
.tab { position: relative; padding: 0 22px; color: var(--muted); background: transparent; border: 0; cursor: pointer; font-size: 13px; font-weight: 650; }
.tab:first-child { padding-left: 0; }
.tab::after { position: absolute; bottom: -1px; right: 18px; left: 18px; height: 2px; content: ""; background: transparent; }
.tab:first-child::after { left: 0; }
.tab.is-active { color: var(--paper); }
.tab.is-active::after { background: var(--lime); }
.tab span { color: var(--muted); font: 600 10px ui-monospace, monospace; }
.tools { display: flex; align-items: center; gap: 22px; }
.search { display: flex; align-items: center; gap: 9px; width: min(28vw, 330px); color: var(--muted); border-bottom: 1px solid #424b5a; }
.search:focus-within { color: var(--aqua); border-color: var(--aqua); }
.search svg { flex: 0 0 17px; width: 17px; }
.search input { min-width: 0; width: 100%; padding: 11px 0; color: var(--paper); background: transparent; border: 0; outline: 0; }
.search input::placeholder { color: #737d8b; }
.watch-toggle { display: flex; align-items: center; gap: 9px; color: #c0c6ce; cursor: pointer; font-size: 12px; white-space: nowrap; }
.watch-toggle input { position: absolute; opacity: 0; }
.watch-toggle span { position: relative; width: 30px; height: 16px; background: #333b48; border-radius: 20px; transition: background .2s; }
.watch-toggle span::after { position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; content: ""; background: var(--paper); border-radius: 50%; transition: transform .2s; }
.watch-toggle input:checked + span { background: var(--aqua); }
.watch-toggle input:checked + span::after { background: var(--ink); transform: translateX(14px); }

.filters { display: flex; align-items: center; gap: 0; min-height: 66px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: 0 0 auto; padding: 9px 15px; color: var(--muted); background: transparent; border: 0; cursor: pointer; font-size: 12px; }
.filter:first-child { padding-left: 0; }
.filter + .filter::before { margin-right: 15px; color: #4a5360; content: "/"; }
.filter.is-active { color: var(--lime); }

.view-section { padding-top: 58px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.section-heading .eyebrow { margin-bottom: 10px; }
h2 { margin: 0; font: 500 clamp(30px, 4vw, 52px)/1 Georgia, serif; letter-spacing: -.035em; }
.section-heading > p { margin: 0; color: var(--muted); font: 11px ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; }
.video-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 34px 22px; }
.video-card { grid-column: span 4; min-width: 0; }
.video-card.is-feature { grid-column: span 8; grid-row: span 2; }
.thumb { position: relative; display: block; width: 100%; aspect-ratio: 16/9; padding: 0; overflow: hidden; background: var(--panel); border: 0; cursor: pointer; }
.thumb::after { position: absolute; inset: 0; content: ""; border: 1px solid rgba(255,255,255,.08); pointer-events: none; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.82) contrast(1.03); transition: transform .35s ease, filter .35s ease; }
.thumb:hover img { transform: scale(1.025); filter: saturate(1) contrast(1.05); }
.play { position: absolute; right: 14px; bottom: 14px; display: grid; width: 42px; height: 42px; place-items: center; background: var(--lime); color: var(--ink); border-radius: 50%; box-shadow: 0 6px 24px rgba(0,0,0,.34); }
.play i { width: 0; height: 0; margin-left: 3px; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid currentColor; }
.watched-stamp { position: absolute; top: 12px; left: 12px; display: none; padding: 5px 8px; color: var(--ink); background: var(--aqua); font: 800 9px ui-monospace, monospace; letter-spacing: .12em; }
.video-card.is-watched .watched-stamp { display: block; }
.video-card.is-watched .thumb img { opacity: .48; filter: grayscale(.45); }
.card-copy { padding-top: 16px; }
.card-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font: 10px ui-monospace, monospace; text-transform: uppercase; letter-spacing: .11em; }
.card-meta .topic { color: var(--aqua); }
.card-copy h3 { margin: 10px 0 18px; font: 600 19px/1.28 ui-sans-serif, system-ui, sans-serif; letter-spacing: -.018em; }
.is-feature .card-copy h3 { max-width: 900px; font-size: clamp(27px, 3.4vw, 48px); line-height: 1.06; }
.card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; }
.channel-link { color: #d9dde3; text-decoration: none; }
.channel-link:hover { color: var(--lime); }
.card-actions { display: flex; align-items: center; gap: 12px; margin-top: 17px; }
.watch-button { display: inline-flex; min-height: 38px; align-items: center; padding: 0 15px; color: var(--ink); background: var(--lime); border: 1px solid var(--lime); text-decoration: none; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.mark-button { min-height: 38px; padding: 0 8px; color: var(--muted); background: transparent; border: 0; cursor: pointer; font-size: 11px; }
.mark-button span { color: var(--aqua); }
.mark-button:hover { color: var(--paper); }
.video-card.is-watched .mark-button i::before { content: "Marked "; }
.video-card.is-watched .mark-button i { font-size: 0; }
.video-card.is-watched .mark-button i::before { font-size: 11px; }
.load-more { display: block; width: 100%; margin-top: 46px; padding: 18px; color: var(--paper); background: transparent; border: 1px solid var(--line); cursor: pointer; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.load-more:hover { border-color: var(--aqua); }
.skeleton { grid-column: span 4; min-height: 330px; background: #131923; animation: pulse 1.5s ease-in-out infinite; }
.skeleton-feature { grid-column: span 8; grid-row: span 2; min-height: 640px; }
@keyframes pulse { 50% { opacity: .45; } }

.channel-view { padding-top: 58px; }
.channel-heading { align-items: center; }
.account-note { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 30px; padding: 18px; color: #b9c0ca; background: #111720; border-left: 2px solid var(--aqua); }
.account-note p { margin: 0; }
.account-note strong { color: var(--paper); }
.channel-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.channel-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 92px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.channel-row:nth-child(odd) { padding-right: 28px; border-right: 1px solid var(--line); }
.channel-row:nth-child(even) { padding-left: 28px; }
.channel-avatar { display: grid; width: 42px; height: 42px; place-items: center; color: var(--ink); background: var(--aqua); font: 800 12px ui-monospace, monospace; }
.channel-row:nth-child(3n) .channel-avatar { background: var(--lime); }
.channel-info { min-width: 0; }
.channel-info h3 { overflow: hidden; margin: 0 0 3px; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.channel-info p { margin: 0; color: var(--muted); font: 10px ui-monospace, monospace; text-transform: uppercase; letter-spacing: .09em; }
.channel-controls { display: flex; align-items: center; gap: 10px; }
.subscribe-link { padding: 8px 10px; color: var(--paper); border: 1px solid #46505e; text-decoration: none; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.subscribe-link:hover { color: var(--ink); background: var(--lime); border-color: var(--lime); }

.empty-state { padding: 100px 0; text-align: center; }
.empty-state > span { color: var(--lime); font-size: 38px; }
.empty-state h2 { margin-top: 14px; }
.empty-state p { color: var(--muted); }
.empty-state button { padding: 10px 14px; background: transparent; border: 1px solid var(--line); cursor: pointer; }
footer { display: flex; justify-content: space-between; gap: 30px; padding: 28px var(--side); color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
footer p { margin: 0; }
footer strong { color: var(--paper); }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .header-meta { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; padding: 0 0 12px; }
  .mobile-filter { display: block; }
  .intro { grid-template-columns: 1fr; gap: 44px; min-height: auto; padding-top: 64px; }
  .intro-note { max-width: 680px; }
  .toolbar-wrap { min-height: 64px; }
  .tools { display: none; position: absolute; top: 64px; right: 0; left: 0; padding: 18px var(--side); background: var(--ink-soft); border-bottom: 1px solid var(--line); }
  .tools.is-open { display: flex; }
  .search { width: 100%; }
  .video-card { grid-column: span 6; }
  .video-card.is-feature { grid-column: span 12; grid-row: auto; }
  .skeleton { grid-column: span 6; }
  .skeleton-feature { grid-column: span 12; grid-row: auto; min-height: 520px; }
}

@media (max-width: 700px) {
  .site-header { min-height: 62px; }
  .intro { padding: 48px 0 44px; }
  h1 { font-size: clamp(48px, 15vw, 72px); }
  .intro-note > p { font-size: 16px; }
  .toolbar-wrap { overflow-x: auto; }
  .tab { padding: 0 14px; }
  .filters { min-height: 56px; }
  .view-section { padding-top: 42px; }
  .section-heading { align-items: start; flex-direction: column; gap: 12px; }
  .video-grid { display: block; }
  .video-card { margin-bottom: 40px; }
  .is-feature .card-copy h3 { font-size: 24px; }
  .card-copy h3 { font-size: 18px; }
  .skeleton { min-height: 400px; margin-bottom: 20px; }
  .channel-heading { align-items: start; }
  .channel-list { grid-template-columns: 1fr; }
  .channel-row:nth-child(n) { padding-right: 0; padding-left: 0; border-right: 0; }
  .channel-controls { gap: 7px; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
