/* ===========================================================================
 * Streamo — static site styles
 * Design tokens live in :root and are referenced via var() everywhere below.
 * =========================================================================== */

:root {
  /* Typography */
  --font-display: 'Bricolage Grotesque', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* Neutral ramp */
  --ink-950: #0a0a0c;
  --ink-900: #111114;
  --ink-800: #1a1a1f;
  --ink-700: #26262d;
  --ink-600: #3a3a43;
  --ink-500: #6b6b75;
  --ink-400: #9a9aa3;
  --ink-300: #c2c2c8;
  --ink-200: #e3e3e6;
  --ink-100: #f2f2f4;
  --ink-50:  #f8f8fa;
  --white:   #ffffff;

  /* Accent */
  --accent:       #ff4d4d;
  --accent-soft:  #ff7a7a;
  --accent-ink:   #ffffff;
  --accent-tint:  rgba(255, 77, 77, 0.12);

  --success: #20c997;
  --danger:  #ef4444;

  /* Semantic */
  --bg:            var(--ink-50);
  --bg-raised:     var(--white);
  --bg-muted:      var(--ink-100);
  --border:        var(--ink-200);
  --border-strong: var(--ink-300);
  --text:          var(--ink-900);
  --text-muted:    var(--ink-500);
  --text-subtle:   var(--ink-400);

  /* Radii */
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-full: 999px;

  /* Space */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  /* Shadows */
  --sh-sm: 0 1px 2px rgba(10,10,12,0.06), 0 1px 1px rgba(10,10,12,0.04);
  --sh-md: 0 6px 16px -6px rgba(10,10,12,0.12), 0 2px 4px rgba(10,10,12,0.06);
  --sh-lg: 0 20px 40px -12px rgba(10,10,12,0.18), 0 8px 16px -8px rgba(10,10,12,0.08);

  /* Layout */
  --header-h: 64px;
  --sidebar-w: 240px;
  --content-max: 1600px;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --d-fast: 120ms;
  --d-med:  220ms;
  --d-slow: 360ms;
}

/* =======================================================================
 * Reset + base
 * ======================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text);
}
h1 { font-size: clamp(32px, 4vw, 56px); letter-spacing: -0.035em; }
h2 { font-size: clamp(24px, 2.4vw, 32px); }
h3 { font-size: 20px; }
h4 { font-size: 16px; }

p { margin: 0; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

.btn-reset {
  appearance: none; background: none; border: none; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: var(--r-full); }
::-webkit-scrollbar-track { background: transparent; }

/* =======================================================================
 * Layout shell
 * ======================================================================= */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.shell__body { display: flex; flex: 1; min-height: 0; }
.shell__main { flex: 1; min-width: 0; }
.container { max-width: var(--content-max); margin: 0 auto; padding: var(--s-6) var(--s-8); }
@media (max-width: 767px) { .container { padding: var(--s-4); } }

/* =======================================================================
 * Header
 * ======================================================================= */
.header {
  position: sticky; top: 0; z-index: 300;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.2) blur(8px);
}
.header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-6);
  height: var(--header-h);
  padding: 0 var(--s-6);
}
@media (max-width: 767px) { .header__inner { padding: 0 var(--s-4); gap: var(--s-3); } }

.header__left { display: flex; align-items: center; gap: var(--s-4); }
.header__right { display: flex; align-items: center; gap: var(--s-3); }
.header__center { display: flex; justify-content: center; }

.burger {
  display: inline-flex; width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: var(--r-full); color: var(--text);
  background: none; border: none; cursor: pointer;
}
.burger:hover { background: var(--bg-muted); }
.burger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.logo-link { display: inline-flex; }

.topics-btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 6px 10px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 500; color: var(--text);
  background: none; border: none; cursor: pointer;
}
.topics-btn:hover { background: var(--bg-muted); }
@media (max-width: 767px) { .topics-btn { display: none; } }

.search {
  position: relative; display: flex; align-items: center;
  width: min(640px, 100%);
  background: var(--bg-muted);
  border: 1px solid transparent;
  border-radius: var(--r-full);
  padding: 0 var(--s-4);
  transition: border-color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.search:focus-within {
  background: var(--bg-raised);
  border-color: var(--border-strong);
  box-shadow: var(--sh-sm);
}
.search__icon { color: var(--text-muted); flex-shrink: 0; }
.search__input {
  flex: 1; padding: 10px var(--s-3); border: none; background: transparent;
  outline: none; font-size: 14px; min-width: 0;
}
.search__input::placeholder { color: var(--text-subtle); }
.kbd {
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border-strong); border-radius: var(--r-xs);
  padding: 2px 6px; background: var(--bg-raised);
}

.icon-btn {
  display: inline-flex; width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: var(--r-full); color: var(--text);
}
.icon-btn:hover { background: var(--bg-muted); color: var(--text); }
.icon-btn--upload { background: var(--ink-100); }
.icon-btn--upload:hover { background: var(--ink-200); }

.nav-login {
  font-size: 13px; font-weight: 600; padding: 8px 14px;
  border-radius: var(--r-full); border: 1px solid var(--border-strong);
  transition: background var(--d-fast) var(--ease-out);
}
.nav-login:hover { background: var(--bg-muted); color: var(--text); }
@media (max-width: 639px) { .nav-login { display: none; } }

.avatar-btn {
  width: 36px; height: 36px; border-radius: 50%;
  overflow: hidden; border: 1px solid var(--border);
  background: none; padding: 0; cursor: pointer;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* =======================================================================
 * Sidebar
 * ======================================================================= */
.sidebar {
  position: sticky; top: var(--header-h); align-self: start;
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  background: var(--bg); border-right: 1px solid var(--border);
}
@media (max-width: 1023px) { .sidebar { display: none; } }

.sidebar__scroll { height: 100%; overflow-y: auto; padding: var(--s-5) var(--s-3); }

.sidebar__section { margin-bottom: var(--s-6); }
.sidebar__title {
  font-family: var(--font-body);
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-muted);
  margin: 0 var(--s-3) var(--s-3);
}

.sidebar__list { list-style: none; margin: 0; padding: 0; }
.sidebar__row {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-3); border-radius: var(--r-md);
  transition: background var(--d-fast) var(--ease-out); color: inherit;
}
.sidebar__row:hover { background: var(--bg-muted); color: inherit; }

.sidebar__avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.sidebar__meta { display: flex; flex-direction: column; min-width: 0; }
.sidebar__name {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar__count { font-size: 12px; color: var(--text-muted); }
.verified-badge { flex-shrink: 0; }

.join-card {
  background: var(--bg-raised);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--s-4); text-align: center;
  margin: var(--s-2) var(--s-1) 0;
}
.join-card__title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 4px; letter-spacing: -0.01em;
}
.join-card__copy { font-size: 12px; color: var(--text-muted); margin-bottom: var(--s-3); }
.join-card__btn {
  display: inline-block; padding: 6px 18px;
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--r-full); font-size: 12px; font-weight: 600;
}
.join-card__btn:hover { background: var(--accent-soft); color: var(--accent-ink); }

/* Loading skeletons */
.sk { background: linear-gradient(90deg, var(--ink-100), var(--ink-200), var(--ink-100));
      background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite;
      border-radius: var(--r-sm); }
.sk--avatar { width: 32px; height: 32px; border-radius: 50%; }
.sk--text { flex: 1; height: 14px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* =======================================================================
 * Buttons
 * ======================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  border: none; border-radius: var(--r-full);
  font-weight: 600; letter-spacing: -0.005em;
  cursor: pointer;
  transition: background var(--d-fast) var(--ease-out),
              color var(--d-fast) var(--ease-out),
              transform var(--d-fast) var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn--primary { background: var(--ink-900); color: var(--white); }
.btn--primary:hover:not(:disabled) { background: var(--ink-700); color: var(--white); }
.btn--secondary { background: var(--white); color: var(--ink-900); border: 1px solid var(--border-strong); }
.btn--secondary:hover:not(:disabled) { background: var(--bg-muted); border-color: var(--ink-500); }
.btn--ghost { background: transparent; color: var(--text); }
.btn--ghost:hover:not(:disabled) { background: var(--bg-muted); color: var(--text); }
.btn--danger { background: var(--accent); color: var(--accent-ink); }
.btn--danger:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-ink); }

.btn--sm { padding: 6px 14px; font-size: 13px; }
.btn--md { padding: 9px 18px; font-size: 14px; }
.btn--lg { padding: 13px 24px; font-size: 15px; }
.btn--block { width: 100%; }

.btn__spinner {
  width: 14px; height: 14px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =======================================================================
 * Inputs
 * ======================================================================= */
.field {
  display: flex; flex-direction: column; gap: var(--s-2);
}
.field__label { font-size: 13px; font-weight: 600; color: var(--text); }
.field__control {
  display: flex; align-items: center;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  padding: 0 var(--s-3);
  transition: border-color var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
}
.field__control:focus-within {
  border-color: var(--ink-900);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.field__input {
  flex: 1; padding: 10px 0; border: none; background: transparent;
  outline: none; font-size: 14px; min-width: 0;
}
.field__input::placeholder { color: var(--text-subtle); }
.field__hint { font-size: 12px; color: var(--text-muted); }
.field__error { font-size: 12px; color: var(--danger); }
.field--error .field__control { border-color: var(--danger); }
.field--error .field__control:focus-within { box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }

.textarea {
  width: 100%; padding: 10px var(--s-3);
  background: var(--bg-raised);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  font-family: inherit; font-size: 14px; line-height: 1.5;
  resize: vertical; outline: none;
  transition: border-color var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
}
.textarea:focus { border-color: var(--ink-900); box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }

/* =======================================================================
 * Home page
 * ======================================================================= */
.home { display: flex; flex-direction: column; gap: var(--s-10); }

.section { display: flex; flex-direction: column; gap: var(--s-4); }
.section__head { display: flex; align-items: center; justify-content: space-between; }
.section__title {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: var(--s-2);
}
.section__info { color: var(--text-muted); }

.featured-scroller {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: minmax(300px, 1fr);
  gap: var(--s-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--s-3);
  margin: 0 calc(-1 * var(--s-8));
  padding-inline: var(--s-8);
}
@media (max-width: 767px) {
  .featured-scroller { margin: 0 calc(-1 * var(--s-4)); padding-inline: var(--s-4); }
}

.browse-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); flex-wrap: wrap;
}

.tabs {
  display: inline-flex; gap: var(--s-1);
  padding: 4px;
  background: var(--bg-muted); border-radius: var(--r-full);
}
.tab {
  padding: 6px 16px; border-radius: var(--r-full);
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  background: none; border: none; cursor: pointer;
  transition: background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out);
}
.tab:hover { color: var(--text); }
.tab--active { background: var(--bg-raised); color: var(--text); box-shadow: var(--sh-sm); }

.browse-title {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700; letter-spacing: -0.025em;
}

/* Dropdown */
.dropdown { position: relative; display: inline-block; }
.dropdown__trigger {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 7px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--bg-raised);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: border-color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.dropdown__trigger:hover { background: var(--bg-muted); }
.dropdown__chev { color: var(--text-muted); transition: transform var(--d-fast) var(--ease-out); }
.dropdown[aria-expanded="true"] .dropdown__chev { transform: rotate(180deg); }

.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  list-style: none; margin: 0; padding: 6px;
  min-width: 160px;
  background: var(--bg-raised);
  border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  z-index: 100;
  display: none;
}
.dropdown[aria-expanded="true"] .dropdown__menu { display: block; }

.dropdown__option {
  display: block; width: 100%;
  padding: 8px 10px; border-radius: var(--r-sm);
  text-align: left; font-size: 13px;
  background: none; border: none; cursor: pointer;
}
.dropdown__option:hover { background: var(--bg-muted); }
.dropdown__option--selected { background: var(--ink-100); font-weight: 600; }

/* =======================================================================
 * Grid + Cards
 * ======================================================================= */
.grid { display: grid; gap: var(--s-5) var(--s-4); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1279px) { .grid--4, .grid--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .grid--3, .grid--4, .grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479px) { .grid--3, .grid--4, .grid--5 { grid-template-columns: 1fr; } }

.card {
  display: flex; flex-direction: column; gap: var(--s-3);
  color: inherit;
  transition: transform var(--d-med) var(--ease-out);
}
.card:hover { color: inherit; }
.card:hover .card__thumb { transform: scale(1.03); }
.card:hover .card__play { opacity: 1; }
.card:hover .card__title { color: var(--accent); }

.card__thumb-wrap {
  position: relative; width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden; border-radius: var(--r-md);
  background: var(--ink-800);
  box-shadow: var(--sh-sm);
}
.card__thumb {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--d-slow) var(--ease-out);
}
.card__duration {
  position: absolute; right: var(--s-2); bottom: var(--s-2);
  padding: 2px 7px;
  background: rgba(10,10,12,0.82); color: var(--white);
  font-size: 12px; font-weight: 600; letter-spacing: -0.01em;
  border-radius: var(--r-xs);
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(2px);
}
.card__play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.35) 100%);
  opacity: 0;
  transition: opacity var(--d-med) var(--ease-out);
  pointer-events: none;
}
.card__play svg { filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4)); }

.card__body { display: flex; gap: var(--s-3); align-items: flex-start; }
.card__avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; border: 1px solid var(--border);
}
.card__meta { flex: 1; min-width: 0; }
.card__title {
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600; line-height: 1.35;
  letter-spacing: -0.005em; color: var(--text);
  margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis;
  transition: color var(--d-fast) var(--ease-out);
}
.card__channel-row { display: flex; align-items: center; gap: 4px; }
.card__channel {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-muted); font-weight: 500;
}
.card__stats {
  display: flex; align-items: center; gap: 6px; margin-top: 2px;
  font-size: 12px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.card__dot { opacity: 0.6; }

/* Featured card (dark overlay variant) */
.fcard { display: block; color: var(--white); transition: transform var(--d-med) var(--ease-out); }
.fcard:hover { color: var(--white); }
.fcard:hover .fcard__thumb { transform: scale(1.04); }

.fcard__wrap {
  position: relative; aspect-ratio: 16 / 10;
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--ink-900); box-shadow: var(--sh-md); isolation: isolate;
}
.fcard__thumb {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--d-slow) var(--ease-out);
}
.fcard__gradient {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.5) 70%, rgba(0,0,0,0.9) 100%);
  pointer-events: none;
}
.fcard__duration {
  position: absolute; right: var(--s-3); top: var(--s-3);
  padding: 3px 9px;
  background: rgba(10,10,12,0.82); color: var(--white);
  font-size: 12px; font-weight: 600;
  border-radius: var(--r-xs);
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}
.fcard__overlay {
  position: absolute; inset: auto 0 0 0;
  padding: var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.fcard__title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700; line-height: 1.2;
  letter-spacing: -0.015em; color: var(--white);
  display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1;
  -webkit-box-orient: vertical; overflow: hidden;
}
.fcard__desc {
  font-size: 13px; line-height: 1.45;
  color: rgba(255,255,255,0.78);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.fcard__channel { display: flex; align-items: center; gap: var(--s-2); margin-top: 4px; }
.fcard__avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.fcard__channel-name {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.9);
}
.fcard--scroll { scroll-snap-align: start; min-width: 280px; }

/* Grid skeleton */
.grid-sk { display: flex; flex-direction: column; gap: var(--s-3); }
.grid-sk__thumb { aspect-ratio: 16 / 9; border-radius: var(--r-md); }
.grid-sk__meta { display: flex; gap: var(--s-3); }
.grid-sk__avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.grid-sk__text { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.grid-sk__line { height: 12px; border-radius: 4px; }

.empty {
  padding: var(--s-12) var(--s-6);
  text-align: center;
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
  background: var(--bg-raised);
}
.empty__title { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.empty__copy  { font-size: 13px; color: var(--text-muted); }

/* =======================================================================
 * Watch page
 * ======================================================================= */
.watch { padding-bottom: var(--s-10); }
.watch__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--s-8);
}
@media (max-width: 1279px) { .watch__layout { grid-template-columns: 1fr; } }
.watch__main { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }

.player {
  aspect-ratio: 16 / 9;
  background: var(--ink-950);
  border-radius: var(--r-lg); overflow: hidden;
  position: relative;
}
.player__video { width: 100%; height: 100%; display: block; }
.player__placeholder {
  width: 100%; height: 100%;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
}
.player__play-btn {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(10,10,12,0.7); color: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  border: none; cursor: pointer;
  transition: transform var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.player__play-btn:hover { transform: scale(1.06); background: rgba(10,10,12,0.85); }

.watch__title {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.2;
}

.watch__meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-3) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.watch__channel { display: inline-flex; align-items: center; gap: var(--s-3); color: inherit; }
.watch__channel img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.watch__channel-name { font-weight: 600; font-size: 14px; }
.watch__sub-count { font-size: 12px; color: var(--text-muted); }
.watch__actions { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--text-muted); font-size: 13px; }
.watch__stat { font-variant-numeric: tabular-nums; }

.watch__description {
  white-space: pre-wrap;
  font-size: 14px; line-height: 1.6; color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--s-4);
}

.rail { display: flex; flex-direction: column; gap: var(--s-3); }
.rail__title { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: var(--s-1); }

.rel {
  display: grid; grid-template-columns: 160px 1fr; gap: var(--s-3);
  color: inherit;
  transition: background var(--d-fast) var(--ease-out);
  border-radius: var(--r-md); padding: var(--s-2);
}
.rel:hover { background: var(--bg-muted); color: inherit; }

.rel__thumb-wrap { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; }
.rel__thumb { width: 100%; height: 100%; object-fit: cover; }
.rel__duration {
  position: absolute; right: 4px; bottom: 4px;
  padding: 1px 5px;
  background: rgba(10,10,12,0.82); color: var(--white);
  font-size: 10px; font-weight: 600; border-radius: var(--r-xs);
}
.rel__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rel__title {
  font-size: 13px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.rel__channel { font-size: 12px; color: var(--text-muted); }
.rel__stats { font-size: 11px; color: var(--text-muted); }

/* =======================================================================
 * Upload page
 * ======================================================================= */
.upload { max-width: 1100px; margin: 0 auto; }
.upload__head { margin-bottom: var(--s-8); }
.upload__title {
  font-family: var(--font-display);
  font-size: 40px; font-weight: 800; letter-spacing: -0.035em;
  line-height: 1; margin-bottom: var(--s-2);
}
.upload__subtitle { color: var(--text-muted); font-size: 15px; }

.upload__columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--s-8);
}
@media (max-width: 1023px) { .upload__columns { grid-template-columns: 1fr; } }

.dropzone {
  position: relative; min-height: 420px;
  padding: var(--s-8);
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-xl);
  background: var(--bg-raised);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s-4); text-align: center;
  transition: border-color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.dropzone--drag { border-color: var(--accent); background: var(--accent-tint); }
.dropzone--has-file { justify-content: flex-start; align-items: stretch; }
.dropzone__input { display: none; }

.drop-idle { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); }
.drop-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--bg-muted); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
}
.drop-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.drop-hint { color: var(--text-muted); font-size: 13px; }
.drop-meta { color: var(--text-subtle); font-size: 12px; margin-top: var(--s-2); }

.preview {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-4);
  background: var(--bg-muted); border-radius: var(--r-lg);
  width: 100%;
}
.preview__icon {
  width: 52px; height: 52px; border-radius: var(--r-md);
  background: var(--bg-raised);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); flex-shrink: 0;
}
.preview__meta { flex: 1; min-width: 0; text-align: left; }
.preview__name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview__sub { font-size: 12px; color: var(--text-muted); }

.remove-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  background: none; border: none; cursor: pointer;
}
.remove-btn:hover:not(:disabled) { background: var(--bg-raised); color: var(--text); }
.remove-btn:disabled { opacity: 0.4; }

.progress-wrap {
  position: relative; width: 100%; height: 8px;
  background: var(--bg-muted); border-radius: var(--r-full);
  overflow: hidden; margin-top: var(--s-4);
}
.progress-bar {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: inherit;
  transition: width var(--d-med) var(--ease-out);
}
.progress-label {
  position: absolute; right: 0; top: -22px;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.banner-success {
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: rgba(32,201,151,0.1); color: #0e8062;
  border-radius: var(--r-md);
  font-size: 13px; font-weight: 600;
}
.banner-error {
  padding: var(--s-3) var(--s-4);
  background: rgba(239,68,68,0.08); color: var(--danger);
  border-radius: var(--r-md); font-size: 13px;
}

.form {
  display: flex; flex-direction: column; gap: var(--s-4);
  padding: var(--s-6);
  background: var(--bg-raised);
  border: 1px solid var(--border); border-radius: var(--r-xl);
}
.form__foot { display: flex; justify-content: flex-end; gap: var(--s-3); margin-top: var(--s-2); }

/* =======================================================================
 * Channel page
 * ======================================================================= */
.channel-page { display: flex; flex-direction: column; gap: var(--s-8); }

.channel-hero {
  position: relative; padding: var(--s-8);
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 20% 20%, rgba(255,77,77,0.18), transparent 50%),
    linear-gradient(135deg, var(--ink-900), var(--ink-700));
  color: var(--white); overflow: hidden;
}
.channel-hero__inner { display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap; }
.channel-hero__avatar {
  width: 96px; height: 96px; border-radius: 50%;
  border: 3px solid var(--white); object-fit: cover;
}
.channel-hero__info { flex: 1; min-width: 0; }
.channel-hero__name {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 36px); font-weight: 800;
  letter-spacing: -0.03em;
  display: inline-flex; align-items: center; gap: var(--s-2);
  color: var(--white);
}
.channel-hero__handle { color: rgba(255,255,255,0.65); font-size: 14px; margin-top: 2px; }
.channel-hero__stats { color: rgba(255,255,255,0.5); font-size: 13px; margin-top: 4px; }

/* =======================================================================
 * Auth page
 * ======================================================================= */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-8) var(--s-4);
  position: relative; overflow: hidden;
  background: var(--bg);
}
.auth-art { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.auth-blob {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.35;
}
.auth-blob--1 {
  top: -100px; left: -80px;
  width: 420px; height: 420px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}
.auth-blob--2 {
  bottom: -120px; right: -60px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  opacity: 0.25;
}
.auth-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.4;
  -webkit-mask-image: radial-gradient(circle at center, black 20%, transparent 70%);
          mask-image: radial-gradient(circle at center, black 20%, transparent 70%);
}

.auth-card {
  position: relative; width: 100%; max-width: 420px;
  padding: var(--s-8);
  background: var(--bg-raised);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  z-index: 1;
}
.auth-logo { display: inline-flex; margin-bottom: var(--s-6); }

.auth-tabs {
  display: inline-flex; gap: 0;
  padding: 4px;
  background: var(--bg-muted); border-radius: var(--r-full);
  margin-bottom: var(--s-6);
}
.auth-tab {
  padding: 6px 16px; border-radius: var(--r-full);
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  transition: background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out);
}
.auth-tab:hover { color: var(--text); }
.auth-tab--active { background: var(--bg-raised); color: var(--text); box-shadow: var(--sh-sm); }

.auth-title {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.1; margin-bottom: var(--s-2);
}
.auth-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: var(--s-6); }
.auth-form { display: flex; flex-direction: column; gap: var(--s-4); }
.auth-foot {
  margin-top: var(--s-6); text-align: center;
  font-size: 13px; color: var(--text-muted);
}
.auth-foot a { color: var(--accent); font-weight: 600; }
.auth-foot a:hover { text-decoration: underline; }

/* =======================================================================
 * 404
 * ======================================================================= */
.nf { max-width: 520px; margin: 0 auto; padding: var(--s-16) var(--s-6); text-align: center; }
.nf__code {
  font-family: var(--font-display);
  font-size: 120px; font-weight: 800; letter-spacing: -0.05em;
  line-height: 1; color: var(--accent); margin-bottom: var(--s-4);
}
.nf__title { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -0.025em; margin-bottom: var(--s-3); }
.nf__desc { color: var(--text-muted); margin-bottom: var(--s-6); }

/* =======================================================================
 * Page transition
 * ======================================================================= */
.fade-in { animation: fade-in var(--d-med) var(--ease-out) both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
