/* ================= Design tokens ================= */
:root {
  --bg: #0d0f14;
  --bg-elevated: #161922;
  --bg-elevated-2: #1e222d;
  --border: #2a2f3d;
  --text: #eef0f5;
  --text-dim: #9aa1b2;
  --accent: #f5a623;       /* signature amber — "play" color */
  --accent-hover: #ffb742;
  --accent-text: #17130a;
  --danger: #e5484d;
  --success: #3ecf8e;
  --radius: 10px;
  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --max-width: 1400px;
}

[data-theme="light"] {
  --bg: #f7f7f9;
  --bg-elevated: #ffffff;
  --bg-elevated-2: #f0f0f3;
  --border: #e2e2e8;
  --text: #14151a;
  --text-dim: #5b6070;
  --accent-text: #17130a;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--font-body);
  scroll-behavior: smooth;
}
h1, h2, h3, .brand { font-family: var(--font-display); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ================= Header ================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 20px; max-width: var(--max-width); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.35rem; font-weight: 700; white-space: nowrap; }
.brand .play-mark {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); display: inline-flex; align-items: center; justify-content: center;
}
.brand .play-mark::after {
  content: ''; width: 0; height: 0; margin-left: 2px;
  border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid var(--accent-text);
}
.search-form { flex: 1; display: flex; max-width: 560px; }
.search-form input {
  flex: 1; padding: 10px 14px; border-radius: var(--radius) 0 0 var(--radius);
  border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text); font-size: 0.95rem;
}
.search-form button {
  padding: 0 16px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
  border-radius: 0 var(--radius) var(--radius) 0; font-weight: 600;
}
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.theme-toggle {
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
}
.nav-categories {
  display: flex; gap: 18px; overflow-x: auto; padding: 0 20px 12px; max-width: var(--max-width); margin: 0 auto;
  scrollbar-width: none;
}
.nav-categories::-webkit-scrollbar { display: none; }
.nav-categories a { color: var(--text-dim); font-size: 0.9rem; white-space: nowrap; padding: 4px 0; }
.nav-categories a:hover, .nav-categories a.active { color: var(--accent); }

/* ================= Layout ================= */
.page-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; padding: 24px 0 60px; }
.page-layout .main-col { min-width: 0; }
.sidebar { display: block; }
@media (max-width: 980px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

.section-title {
  display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 16px;
  font-size: 1.3rem; font-weight: 700;
}
.section-title a { font-size: 0.85rem; font-weight: 500; color: var(--accent); }

/* ================= Video grid & cards ================= */
.video-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin-bottom: 36px;
}
.video-card { display: block; }
.thumb-wrap {
  position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-elevated-2); margin-bottom: 8px;
}
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.video-card:hover .thumb-wrap img { transform: scale(1.04); }
.duration-badge {
  position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.8); color: #fff;
  font-size: 0.72rem; padding: 2px 6px; border-radius: 4px; font-variant-numeric: tabular-nums;
}
.video-card .title { font-size: 0.95rem; font-weight: 600; line-height: 1.35; margin: 0 0 4px; }
.video-card .meta { font-size: 0.8rem; color: var(--text-dim); }

.hero-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 260px; gap: 16px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 36px; }

/* ================= Video detail page ================= */
.player-wrap { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player-wrap video { width: 100%; height: 100%; }
.video-title { font-size: 1.4rem; font-weight: 700; margin: 18px 0 6px; }
.video-stats { color: var(--text-dim); font-size: 0.88rem; margin-bottom: 14px; }
.video-desc { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; font-size: 0.92rem; line-height: 1.55; color: var(--text-dim); white-space: pre-line; }
.tag-pill {
  display: inline-block; font-size: 0.78rem; padding: 3px 10px; border-radius: 999px;
  background: var(--bg-elevated-2); color: var(--text-dim); margin: 10px 6px 0 0;
}

/* ================= Ads ================= */
.ad-slot { display: flex; align-items: center; justify-content: center; overflow: hidden; margin: 24px 0; }
.ad-slot[data-empty="true"] { display: none; }
.ad-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); text-align: center; margin-bottom: 4px; }

/* ================= Buttons / forms shared ================= */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text); font-weight: 600; font-size: 0.9rem;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-sm { padding: 6px 10px; font-size: 0.8rem; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.load-more-wrap { display: flex; justify-content: center; margin: 10px 0 30px; }

/* ================= Footer ================= */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 30px 0; color: var(--text-dim); font-size: 0.85rem; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }

@media (max-width: 640px) {
  .site-header .inner { flex-wrap: wrap; }
  .search-form { order: 3; width: 100%; max-width: none; }
}
