/* ============ Tokens ============ */
:root{
  --bg:            #ffffff;
  --bg-soft:       #f9f9f9;
  --surface:       #ffffff;
  --surface-hi:    #f2f2f2;
  --line:          #e5e5e5;
  --text:          #0f0f0f;
  --text-dim:      #606060;
  --text-faint:    #909090;
  --accent:        #ff0000;
  --accent-hi:     #cc0000;
  --shadow:        0 8px 24px -8px rgba(0,0,0,.2);
  --ff-display:    "Fraunces", Georgia, serif;
  --ff-body:       "Archivo", -apple-system, sans-serif;
  --logo-bg:       #15120f;
  --topbar-h:      56px;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--ff-body);
  line-height:1.5;
}
img{ max-width:100%; display:block; }
a{ color:inherit; }
button{ font-family:inherit; cursor:pointer; }
h1,h2,h3{ font-family:var(--ff-display); margin:0; }

/* ============ Top app bar ============ */
.topbar{
  position:fixed; top:0; left:0; right:0; height:var(--topbar-h); z-index:300;
  background:var(--logo-bg); border-bottom:1px solid rgba(255,255,255,.08);
  display:flex; align-items:center; gap:16px; padding:0 16px;
}
.icon-btn{
  width:40px; height:40px; border-radius:50%; flex:none;
  display:flex; align-items:center; justify-content:center;
  background:none; border:none; color:var(--text);
}
.icon-btn:hover{ background:var(--surface-hi); }
.menu-btn{ color:#fff; }
.menu-btn:hover{ background:rgba(255,255,255,.14); }

.brand{
  display:flex; flex-direction:column; align-items:stretch; justify-content:center; gap:4px;
  flex:none; padding:6px 12px;
  text-decoration:none;
}
.brand-word{
  font-family:var(--ff-body); font-weight:800; font-size:13px; letter-spacing:.01em;
  color:#fdfcfa; line-height:1; white-space:nowrap;
}
.brand-studio{
  font-family:var(--ff-body); font-weight:800; font-size:10px;
  color:var(--logo-bg); background:#fdfcfa; border-radius:4px; padding:2px 0; line-height:1.3;
  white-space:nowrap; text-align:center;
}

.search-box{
  flex:1 1 auto; max-width:600px; margin:0 auto; display:flex; align-items:center;
  height:40px; padding:0 6px 0 16px; border:1px solid var(--line); border-radius:10px;
  background:var(--bg);
}
.search-icon{ background:none; border:none; color:var(--text-faint); display:flex; padding:0; }
.search-box input{
  flex:1; border:none; outline:none; background:transparent; color:var(--text);
  font-family:var(--ff-body); font-size:14px; padding:0 10px; min-width:0;
}
.search-box input::placeholder{ color:var(--text-faint); }

/* ============ Sidebar ============ */
.sidebar-backdrop{
  position:fixed; inset:0; top:var(--topbar-h); background:rgba(0,0,0,.5);
  z-index:250; opacity:0; pointer-events:none; transition:opacity .2s ease;
}
.sidebar{
  position:fixed; top:var(--topbar-h); left:0; bottom:0; width:240px;
  background:var(--bg); border-right:1px solid var(--line);
  padding:12px 8px; overflow-y:auto; z-index:260;
  transition:width .2s ease, transform .2s ease;
}
.nav{ display:flex; flex-direction:column; gap:2px; }
.nav-link{
  display:flex; align-items:center; gap:20px; padding:11px 12px; border-radius:10px;
  text-decoration:none; color:var(--text); font-size:13.5px; font-weight:500;
  transition:background .15s ease;
}
.nav-link svg{ flex:none; }
.nav-link:hover{ background:var(--surface-hi); }
.nav-link.active{ background:var(--surface-hi); font-weight:700; }

.sidebar-section{ margin-top:14px; padding-top:14px; border-top:1px solid var(--line); }
.nav-secondary{ margin-top:14px; padding-top:14px; border-top:1px solid var(--line); }
.sidebar-heading{
  font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color:var(--text-faint); padding:0 12px; margin:0 0 6px;
}
.sidebar-genres{ display:flex; flex-direction:column; gap:2px; }
.sidebar-genre-link{
  display:flex; align-items:center; gap:12px; width:100%; text-align:left;
  padding:8px 12px; border-radius:10px; font-size:13px; color:var(--text-dim);
  background:none; border:none;
}
.sidebar-genre-link:hover{ background:var(--surface-hi); color:var(--text); }
.sidebar-genre-link.active{ background:var(--surface-hi); color:var(--text); font-weight:700; }
.genre-dot{ width:8px; height:8px; border-radius:50%; background:var(--accent); flex:none; }

.sidebar-foot{ margin-top:16px; padding:12px; border-top:1px solid var(--line); }
.sidebar-foot p{ font-size:11.5px; color:var(--text-faint); line-height:1.5; margin:0; }

body.sidebar-collapsed .sidebar{ width:72px; }
body.sidebar-collapsed .nav-link{ flex-direction:column; gap:4px; padding:12px 2px; font-size:9.5px; text-align:center; }
body.sidebar-collapsed .sidebar-section,
body.sidebar-collapsed .sidebar-foot{ display:none; }
body.sidebar-collapsed .main{ margin-left:72px; }

/* ============ Main / grid ============ */
.main{
  margin-left:240px; margin-top:var(--topbar-h); padding:20px 24px 60px;
  min-height:calc(100vh - var(--topbar-h));
  transition:margin-left .2s ease;
}

.shelf{ margin-bottom:8px; }
.shelf-title{ font-size:18px; font-weight:600; margin:0 0 14px; }
.section-title{ font-size:20px; font-weight:600; margin:32px 0 16px; }

.shelf-row{
  display:flex; flex-wrap:nowrap; gap:16px; overflow-x:auto; overflow-y:hidden;
  padding-bottom:20px; margin-bottom:12px; scrollbar-width:thin; scrollbar-color:var(--line) transparent;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 16px),transparent);
  mask-image:linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 16px),transparent);
}
.shelf-row::-webkit-scrollbar{ height:5px; }
.shelf-row::-webkit-scrollbar-track{ background:transparent; }
.shelf-row::-webkit-scrollbar-thumb{ background:var(--line); border-radius:999px; }
.shelf-row .video-card{ flex:0 0 220px; }

.chipbar{
  display:flex; flex-wrap:nowrap; gap:10px; overflow-x:auto; overflow-y:hidden;
  padding-bottom:18px; margin-bottom:22px; scrollbar-width:thin; scrollbar-color:var(--line) transparent;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 16px),transparent);
  mask-image:linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 16px),transparent);
}
.chipbar::-webkit-scrollbar{ height:5px; }
.chipbar::-webkit-scrollbar-track{ background:transparent; }
.chipbar::-webkit-scrollbar-thumb{ background:var(--line); border-radius:999px; }
.chip{
  flex:none; white-space:nowrap; border:none; background:var(--surface-hi); color:var(--text);
  font-size:13px; font-weight:600; padding:7px 14px; border-radius:8px; transition:background .15s ease;
}
.chip:hover{ background:#e5e5e5; }
.chip.active{ background:var(--text); color:#fff; }

.video-grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:28px 16px;
}
.video-card{
  background:none; border:none; padding:0; text-align:left; cursor:pointer;
  display:flex; flex-direction:column; width:100%;
}
.card-thumb{
  position:relative; width:100%; aspect-ratio:16/9; border-radius:12px; overflow:hidden;
  background:#000; margin-bottom:12px;
}
.card-thumb img{ width:100%; height:100%; object-fit:cover; transition:transform .25s ease; }
.video-card:hover .card-thumb img{ transform:scale(1.04); }
.card-duration{
  position:absolute; right:6px; bottom:6px; background:rgba(0,0,0,.8); color:#fff;
  font-size:11px; font-weight:600; padding:1px 5px; border-radius:4px;
}
.card-playing{
  position:absolute; inset:0; background:rgba(0,0,0,.4);
  display:flex; align-items:center; justify-content:center;
}
.card-body{ display:flex; gap:12px; }
.card-avatar{
  width:36px; height:36px; border-radius:50%; flex:none;
  background:var(--logo-bg); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--ff-display); font-weight:900; font-size:14px;
}
.card-text{ min-width:0; }
.card-title{
  font-size:14.5px; font-weight:600; color:var(--text); line-height:1.35;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  margin:0 0 4px;
}
.card-channel, .card-meta{ font-size:12.5px; color:var(--text-faint); margin:0; }
.video-card.is-playing .card-title{ color:var(--accent-hi); }

.eq{ display:flex; align-items:flex-end; gap:2px; height:14px; }
.eq i{ width:3px; background:#fff; border-radius:2px; animation:eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2){ animation-delay:.2s; } .eq i:nth-child(3){ animation-delay:.4s; }
@keyframes eq{ 0%,100%{ height:4px; } 50%{ height:14px; } }

.empty-state{ color:var(--text-faint); text-align:center; padding:48px 0; }

/* ============ About / footer ============ */
.about{
  margin-top:40px; padding:32px;
  background:var(--surface); border:1px solid var(--line); border-radius:16px;
  box-shadow:var(--shadow);
}
.about h2{ font-size:22px; font-weight:600; margin-bottom:12px; }
.about-lede{ max-width:68ch; color:var(--text-dim); font-size:14.5px; margin:0 0 20px; }

.about-genres{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:24px; }
.about-genre-pill{
  font-size:12.5px; font-weight:700; color:var(--text);
  background:var(--surface-hi); border-radius:999px; padding:6px 14px;
}

.about-stats{
  display:flex; flex-wrap:wrap; gap:32px;
  padding-top:20px; border-top:1px solid var(--line);
}
.about-stat{ display:flex; flex-direction:column; gap:2px; }
.about-stat strong{
  font-family:var(--ff-display); font-weight:900; font-size:24px; color:var(--text); line-height:1;
}
.about-stat span{
  font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--text-faint);
}

.site-footer{
  padding:20px 0 40px; color:var(--text-faint); font-size:12.5px; display:flex; gap:8px;
}

/* ============ Floating player ============ */
.player-backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.6); backdrop-filter:blur(4px);
  z-index:499; opacity:0; pointer-events:none; transition:opacity .35s ease;
}
.player-backdrop.show{ opacity:1; pointer-events:auto; }

.player{
  position:fixed; z-index:500; background:var(--surface); border:1px solid var(--line);
  border-radius:14px; box-shadow:var(--shadow); overflow:hidden;
  transition:all .45s cubic-bezier(.16,1,.3,1);
  display:flex; flex-direction:column;
}
.player[hidden]{ display:none; }
.player.mini{ right:24px; bottom:24px; left:auto; top:auto; width:320px; }
.player.expanded{
  left:50%; top:50%; width:min(880px,90vw); transform:translate(-50%,-50%);
  bottom:auto; right:auto;
}

.player-video{ position:relative; width:100%; aspect-ratio:16/9; background:#000; flex:none; }
.player-frame-wrap{ position:absolute; inset:0; }
.player-frame-wrap iframe{ width:100%; height:100%; border:0; display:block; }

.player-info{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 14px; }
.player-title{ margin:0; font-size:13.5px; font-weight:700; }
.player-artist{ margin:2px 0 0; font-size:11.5px; color:var(--text-faint); }
.player-controls{ display:flex; gap:6px; flex:none; }
.player-controls button{
  width:32px; height:32px; border-radius:50%; border:1px solid var(--line);
  background:var(--surface-hi); color:var(--text); font-size:12px;
}
.player-controls button:hover{ border-color:var(--accent); color:var(--accent-hi); }

.player-close, .player-expand{
  position:absolute; top:8px; z-index:2; width:28px; height:28px; border-radius:50%; border:none;
  background:rgba(0,0,0,.55); color:#fff; font-size:13px;
  display:flex; align-items:center; justify-content:center;
}
.player-close:hover, .player-expand:hover{ background:var(--accent); color:#fff; }
.player-close{ right:8px; }
.player-expand{ right:42px; }
.player.expanded .player-expand{ transform:rotate(180deg); }

/* ============ Responsive ============ */
@media (max-width:760px){
  :root{ --topbar-h:68px; }
  .topbar{ flex-wrap:nowrap; padding:0 12px; }
  .search-box{ flex:1 1 auto; min-width:0; margin:0; }

  .sidebar{
    width:260px; transform:translateX(-100%);
    box-shadow:0 0 28px rgba(0,0,0,.18);
  }
  body.sidebar-open .sidebar{ transform:translateX(0); }
  body.sidebar-collapsed .sidebar{ width:260px; }
  body.sidebar-collapsed .nav-link{ flex-direction:row; gap:20px; padding:11px 12px; font-size:13.5px; text-align:left; }
  body.sidebar-collapsed .sidebar-section, body.sidebar-collapsed .sidebar-foot{ display:block; }
  body.sidebar-collapsed .main{ margin-left:0; }

  body.sidebar-open .sidebar-backdrop{ opacity:1; pointer-events:auto; }

  .main{ margin-left:0; padding:16px 16px 60px; }
  .video-grid{ grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:20px 12px; }
  .player.mini{ right:12px; left:12px; width:auto; bottom:12px; }
}
