/* Modern reset */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
	margin: 0;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
	font-size: 15px;
}

/* Color system */
:root {
	--bg: #fafafa;
	--surface: #ffffff;
	--surface-2: #f8fafc;
	--border: #e2e8f0;
	--muted: #64748b;
	--text: #0f172a;
	--brand: #3b82f6;
	--accent: #6366f1;
	--card-bg: #ffffff;
	--card-shadow: rgba(0,0,0,0.04);
	--card-hover-shadow: rgba(0,0,0,0.1);
}

[data-theme="dark"] {
	--bg: #0f172a;
	--surface: #1e293b;
	--surface-2: #334155;
	--border: #475569;
	--muted: #94a3b8;
	--text: #f1f5f9;
	--brand: #60a5fa;
	--accent: #a855f7;
	--card-bg: #1e293b;
	--card-shadow: rgba(0,0,0,0.2);
	--card-hover-shadow: rgba(0,0,0,0.4);
}

/* Layout */
.container { 
	max-width: 1200px; 
	margin: 0 auto; 
	padding: 0 24px; 
}

@media (max-width: 768px) {
	.container { padding: 0 16px; }
}

/* Header */
.site-header {
	position: sticky; 
	top: 0; 
	z-index: 50;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	padding: 12px 0;
}

.site-header .container { 
	display: flex; 
	align-items: center; 
	justify-content: space-between; 
}

.site-title { 
	margin: 0; 
	font-size: 24px; 
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--text);
}

.site-nav { 
	display: flex; 
	gap: 4px; 
	align-items: center; 
}

.site-nav a { 
	color: var(--muted); 
	text-decoration: none; 
	font-weight: 500;
	padding: 4px 6px; 
	border-radius: 6px;
	transition: color 0.2s ease;
}

.site-nav a:hover { 
	color: var(--text);
	text-decoration: underline;
}

/* Intro section */
.intro { 
	padding: 48px 0 32px; 
}

.intro h2 { 
	margin: 0 0 12px; 
	font-size: 42px; 
	font-weight: 800; 
	letter-spacing: -0.03em;
	color: var(--text);
	line-height: 1.1;
}

.intro p { 
	margin: 0; 
	color: var(--muted); 
	font-size: 18px;
	max-width: 600px;
}

/* Filters */
.filters { 
	margin-bottom: 40px;
}

#search {
	width: 100%;
	max-width: 400px;
	padding: 14px 16px; 
	border-radius: 12px; 
	border: 1px solid var(--border);
	background: var(--surface); 
	color: var(--text);
	font-size: 16px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#search:focus {
	outline: none;
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.tags { 
	display: flex; 
	gap: 8px; 
	flex-wrap: wrap;
	margin-top: 16px;
}

.tag { 
	padding: 6px 12px; 
	border-radius: 20px; 
	border: 1px solid var(--border); 
	cursor: pointer; 
	color: var(--muted); 
	background: var(--surface); 
	font-size: 13px; 
	font-weight: 500;
	transition: all 0.2s ease;
}

.tag:hover {
	border-color: var(--brand);
	color: var(--brand);
}

.tag.active { 
	background: var(--brand); 
	color: white; 
	border-color: var(--brand); 
}

.tag:focus-visible { 
	outline: 2px solid var(--brand); 
	outline-offset: 2px; 
}

/* Grid */
.grid { 
	display: grid; 
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
	gap: 24px; 
	margin-bottom: 64px;
}

.card {
	display: block; 
	text-decoration: none; 
	color: inherit;
	background: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: 12px; 
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	box-shadow: 0 1px 2px var(--card-shadow);
}

.card:hover { 
	transform: translateY(-2px); 
	box-shadow: 0 6px 12px var(--card-hover-shadow);
}

.cover-wrap { 
	position: relative; 
	width: 100%; 
	aspect-ratio: 16/9; 
	background: var(--surface-2);
	display: flex; 
	align-items: center; 
	justify-content: center;
	overflow: hidden;
}

.cover { 
	width: 100%; 
	height: 100%; 
	object-fit: cover; 
	display: block;
	transition: transform 0.3s ease;
}

.card:hover .cover {
	transform: scale(1.05);
}

.fallback-cover { 
	display: flex; 
	align-items: center; 
	justify-content: center; 
	font-weight: 700; 
	font-size: 28px; 
	color: var(--muted);
	background: var(--surface);
}

.cover-overlay { display:none; }
.play-badge { display:none; }

.card-body { 
	padding: 16px; 
}

.card-title { 
	margin: 0 0 6px; 
	font-size: 16px; 
	font-weight: 700;
	color: var(--text);
}

.card-desc { 
	margin: 0; 
	color: var(--muted); 
	font-size: 13px;
	line-height: 1.5;
}

.card-tags { 
	display: flex; 
	gap: 6px; 
	flex-wrap: wrap;
}

.card-tags .tag { 
	font-size: 11px; 
	padding: 4px 8px;
	border: none;
	background: var(--surface-2);
	color: var(--muted);
	cursor: default;
}

/* Theme toggle */
.theme-toggle { 
	background: var(--surface); 
	color: var(--text); 
	border: 1px solid var(--border); 
	border-radius: 8px; 
	padding: 8px 12px; 
	cursor: pointer; 
	font-weight: 500;
	font-size: 14px;
	transition: all 0.2s ease;
}

.theme-toggle:hover { 
	background: var(--surface-2);
	border-color: var(--brand);
}

/* Footer */
.empty { 
	color: var(--muted); 
	padding: 48px 24px; 
	text-align: center;
	font-size: 16px;
}

.site-footer { 
	border-top: 1px solid var(--border); 
	color: var(--muted);
	padding: 32px 0;
	margin-top: 64px;
}