:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-card: #16161f;
  --text: #e8e8ed;
  --text-muted: #9a9aa8;
  --accent: #7c5cff;
  --accent-hover: #9b82ff;
  --border: #2a2a35;
  --radius: 12px;
  --transition: 0.25s ease;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

[data-mode="light"] {
  --bg: #e8e8ec;
  --bg-elevated: #f0f0f4;
  --bg-card: #f3f3f7;
  --text: #2a2a34;
  --text-muted: #6e6e7c;
  --border: #d0d0da;
  --shadow: 0 8px 28px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
.container { width: min(1100px, 92%); margin-inline: auto; }

.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 1.15rem;
}
.logo-sub {
  color: var(--accent); font-weight: 600; margin-left: 0.35rem; font-size: 0.95rem;
}
.mode-toggle {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-muted); cursor: pointer;
}
.mode-toggle:hover { border-color: var(--accent); color: var(--accent); }

.hero { padding: 7rem 0 2rem; }
.hero-tag {
  color: var(--accent); font-size: 0.85rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem;
}
.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 0.5rem;
}
.hero-desc { color: var(--text-muted); }

.section { padding: 1rem 0 4rem; }

.player-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
.player-wrap.hidden { display: none; }
#mainVideo {
  width: 100%;
  max-height: 70vh;
  background: #000;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}
.player-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem 1.1rem; flex-wrap: wrap;
}
.player-title { font-weight: 600; }
.player-cat { font-size: 0.85rem; color: var(--text-muted); }
.player-actions { display: flex; gap: 0.4rem; }
.btn-icon {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent;
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.btn-icon:hover {
  border-color: var(--accent); color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.loading { color: var(--text-muted); padding: 2rem 0; text-align: center; }
.loading.hidden { display: none; }

.categories { display: flex; flex-direction: column; gap: 2rem; }
.category-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.9rem;
}
.category-head h2 {
  font-family: 'Space Grotesk', sans-serif; font-size: 1.25rem;
}
.category-count { color: var(--text-muted); font-size: 0.85rem; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}
.video-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.video-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.video-thumb {
  aspect-ratio: 16 / 9;
  background: #12121a;
  position: relative;
  overflow: hidden;
}
.video-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.video-thumb .play-badge {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.25);
  opacity: 0; transition: opacity var(--transition);
  font-size: 1.6rem;
}
.video-card:hover .play-badge { opacity: 1; }
.video-info { padding: 0.75rem 0.9rem; }
.video-info .title {
  font-weight: 600; font-size: 0.92rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.video-info .actions {
  display: flex; gap: 0.35rem; margin-top: 0.45rem;
}
.video-info .actions button {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 999px;
  padding: 0.2rem 0.55rem; font-size: 0.75rem; cursor: pointer;
}
.video-info .actions button:hover {
  border-color: var(--accent); color: var(--accent);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--text-muted); font-size: 0.9rem;
}

.empty {
  color: var(--text-muted);
  padding: 2rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
