:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #0d0d0f;
  --panel-2: #111114;
  --border: #26262b;
  --border-hover: #38383f;
  --text: #f5f5f7;
  --muted: #9a9aa3;
  --soft: #17171b;
  --accent: #ffffff;
  --danger: #ff6b6b;
  --success: #7ee787;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 15%, #171717 0, transparent 28%),
    radial-gradient(circle at 85% 85%, #121212 0, transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

/* ========== AUTH (index) ========== */
.shell {
  width: min(1050px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 0.92fr;
  gap: 26px;
  align-items: center;
  padding: 42px 0;
}
.brand-panel { padding: 30px 12px; }
.brand-mark {
  width: 54px; height: 54px;
  border: 1px solid var(--border-hover);
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 24px; font-weight: 800; letter-spacing: -0.04em;
  background: linear-gradient(145deg, #1a1a1e, #080808);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .22em;
  font-weight: 700;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 82px);
  line-height: .95;
  letter-spacing: -.07em;
}
.tagline {
  margin: 22px 0 0;
  max-width: 430px;
  color: #b2b2ba;
  font-size: 18px;
  line-height: 1.6;
}
.feature-list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  max-width: 430px;
  display: grid;
  gap: 16px;
}
.feature-list li {
  color: #b2b2ba;
  font-size: 15px;
  line-height: 1.55;
}
.feature-list strong {
  display: block;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 2px;
  font-size: 15px;
}
.auth-card {
  width: 100%;
  max-width: 470px;
  justify-self: end;
  background: rgba(13,13,15,.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
  backdrop-filter: blur(20px);
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: #09090a;
  border-radius: 15px;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px 8px;
  border-radius: 11px;
  font-weight: 700;
}
.tab.active { background: var(--soft); color: var(--text); }
.panel { padding: 28px 26px 22px; }
.hidden { display: none !important; }
h2 { margin: 0 0 7px; font-size: 28px; letter-spacing: -.035em; }
.muted { margin: 0; color: var(--muted); line-height: 1.55; font-size: 14px; }
form { display: grid; gap: 9px; }
label {
  margin-top: 7px;
  color: #d7d7dd;
  font-size: 13px;
  font-weight: 650;
}
input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #09090a;
  color: var(--text);
  outline: none;
  padding: 0 14px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input { height: 48px; }
textarea {
  min-height: 110px;
  padding: 12px 14px;
  resize: vertical;
}
input::placeholder, textarea::placeholder { color: #5f5f66; }
input:focus, textarea:focus {
  border-color: #595961;
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
  background: #0b0b0d;
}
.input-wrap, .password-wrap { position: relative; }
.input-wrap input { padding-right: 42px; }
.password-wrap input { padding-right: 62px; }
.input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b6b73;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.show-password {
  position: absolute;
  right: 8px; top: 8px; bottom: 8px;
  border: 0;
  background: transparent;
  color: #a9a9b1;
  padding: 0 9px;
  border-radius: 8px;
}
.show-password:hover { background: #17171a; color: var(--text); }
.primary {
  margin-top: 12px;
  height: 50px;
  border: 1px solid #f4f4f4;
  border-radius: 12px;
  background: #f4f4f4;
  color: #070707;
  font-weight: 800;
  transition: transform .15s ease, filter .15s ease;
}
.primary:hover { filter: brightness(.92); transform: translateY(-1px); }
.primary:active { transform: translateY(0); }
.status {
  min-height: 20px;
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.45;
}
.status.error { color: var(--danger); }
.status.success { color: var(--success); }
.switch {
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.switch span { color: var(--text); font-weight: 700; }
.switch:hover span { text-decoration: underline; }
.tiny-note { color: #777780; font-size: 12px; line-height: 1.5; margin: 12px 0 0; }

/* ========== SHARED SITE CHROME ========== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--border);
  background: rgba(5,5,5,.88);
  backdrop-filter: blur(18px);
}
.brand-button {
  border: 1px solid var(--border);
  background: #111114;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 800;
  letter-spacing: -.03em;
  font-size: 14px;
}
.brand-button:hover { border-color: var(--border-hover); background: #18181c; }
.main-nav {
  display: flex;
  gap: 6px;
  background: #0a0a0c;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.nav-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 16px;
  border-radius: 9px;
  font-weight: 650;
  font-size: 13px;
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active {
  background: var(--soft);
  color: var(--text);
}
.settings-area { position: relative; }
.settings-button {
  border: 1px solid var(--border);
  background: #0b0b0c;
  color: #e9e9ed;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 650;
}
.settings-button:hover { border-color: var(--border-hover); background: #141418; }
.settings-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: #0d0d0f;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  display: grid;
  gap: 2px;
  z-index: 50;
}
.settings-menu button {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}
.settings-menu button:hover { background: #17171b; }

.site-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 80px;
}

/* Announcement bar */
.announcement {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(13,13,15,.7);
  color: var(--muted);
  font-size: 14px;
}
.announcement strong { color: var(--text); margin-right: 6px; }
.announcement-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(126,231,135,.15);
  flex-shrink: 0;
}

/* Views */
.view { display: none; }
.view.active { display: block; }

/* Hero */
.hero, .hero-home {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 28px;
  align-items: stretch;
  margin-bottom: 40px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(13,13,15,.88);
  box-shadow: 0 25px 80px rgba(0,0,0,.28);
}
.hero-main .eyebrow { margin-bottom: 10px; }
.hero-main h1 {
  font-size: clamp(40px, 6vw, 64px);
  margin-bottom: 16px;
}
.hero-main h1 span { color: #c8c8d0; }
.hero-description {
  max-width: 520px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  margin: 0 0 24px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.primary-button, .secondary-button, .subscribe-button, .subscribe-large-button {
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  transition: transform .15s ease, filter .15s ease, background .15s ease, border-color .15s ease;
}
.primary-button {
  background: #f4f4f4;
  color: #070707;
  border-color: #f4f4f4;
}
.primary-button:hover { filter: brightness(.92); transform: translateY(-1px); }
.secondary-button, .subscribe-button {
  background: #0b0b0c;
  color: #e9e9ed;
  border-color: var(--border);
}
.secondary-button:hover, .subscribe-button:hover {
  border-color: var(--border-hover);
  background: #141418;
}
.subscribe-button.selected, .subscribe-large-button.selected {
  background: #1a2a1a;
  border-color: #2e4a2e;
  color: var(--success);
}
.subscribe-large-button {
  background: #f4f4f4;
  color: #070707;
  padding: 12px 22px;
  font-size: 15px;
}
.subscribe-large-button:hover { filter: brightness(.92); }

.hero-panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  background: #09090a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.hero-stat-big {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1;
}
.hero-stat-label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 16px;
}
.hero-mini-grid {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}
.hero-mini-grid div {
  display: grid;
  gap: 2px;
}
.hero-mini-grid strong {
  font-size: 14px;
  color: var(--text);
}
.hero-mini-grid span {
  font-size: 13px;
  color: var(--muted);
}

/* Section headers */
.section-heading-row, .section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
}
.section-heading-row .eyebrow, .section-header .eyebrow {
  margin: 0;
}
.section-heading-row h2, .section-header h2 {
  margin: 0;
  font-size: 28px;
}
@media (max-width: 560px) {
  .section-heading-row, .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* Video grid */
.video-grid, .home-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.video-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #09090a;
  display: flex;
  flex-direction: column;
}
.video-player, .video-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 0;
}
.video-card-body { padding: 14px 16px 16px; display: grid; gap: 10px; }
.video-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.video-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.3;
}
.channel-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 13px;
  font-weight: 650;
}
.channel-button:hover { color: var(--text); text-decoration: underline; }
.privacy-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: #0d0d0f;
}
.video-description {
  margin: 0;
  color: #a8a8b0;
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.reaction-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.reaction-button {
  border: 1px solid var(--border);
  background: #0d0d0f;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.reaction-button:hover { border-color: var(--border-hover); background: #151518; }
.reaction-button.selected {
  border-color: #3a3a45;
  background: #1a1a20;
}
.video-meta {
  color: #85858e;
  font-size: 12px;
  margin-left: auto;
}
.comments-section {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: grid;
  gap: 10px;
}
.comments-section h3 {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.comments-list { display: grid; gap: 8px; max-height: 180px; overflow-y: auto; }
.comment {
  background: #0d0d0f;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}
.comment strong { font-size: 12px; color: #d0d0d6; }
.comment p { margin: 4px 0 0; font-size: 13px; color: #b8b8c0; line-height: 1.4; }
.comment-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.comment-form input { height: 40px; }

/* Empty states */
.empty-card, .feed-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  place-items: center;
  text-align: center;
  min-height: 200px;
  padding: 36px 24px;
  border: 1px dashed #2c2c31;
  border-radius: 18px;
  color: #84848c;
  background: rgba(9,9,10,.5);
}
.empty-card h2, .feed-empty h2 { color: #d7d7dd; font-size: 20px; margin: 0; }
.empty-icon { font-size: 28px; margin-bottom: 4px; opacity: .7; }

/* Upload / Account cards */
.page-card, .wide-card {
  border: 1px solid var(--border);
  background: rgba(13,13,15,.88);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 25px 80px rgba(0,0,0,.28);
}
.page-heading { margin-bottom: 24px; }
.page-heading h1 { font-size: clamp(32px, 5vw, 42px); margin-bottom: 8px; }
.page-heading p { color: var(--muted); margin: 0; }
.upload-form { display: grid; gap: 14px; }
.form-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.file-name {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 0;
}
.privacy-options { display: grid; gap: 10px; }
.privacy-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #09090a;
  cursor: pointer;
}
.privacy-option:has(input:checked) {
  border-color: #4a4a55;
  background: #101014;
}
.privacy-option input { width: auto; height: auto; margin-top: 3px; }
.privacy-option span { display: grid; gap: 2px; }
.privacy-option strong { font-size: 14px; }
.privacy-option small { color: var(--muted); font-size: 13px; }
.upload-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

/* Account */
.account-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.account-heading h1 { font-size: clamp(28px, 4vw, 36px); }
.account-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.account-stat {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background: #09090a;
  display: grid;
  gap: 4px;
}
.account-stat strong {
  font-size: 24px;
  letter-spacing: -.03em;
}
.account-stat span {
  color: var(--muted);
  font-size: 13px;
}
.notice {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0d0d0f;
  color: var(--muted);
  margin-bottom: 20px;
}

/* Channel page */
.channel-page-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(13,13,15,.88);
  margin-bottom: 28px;
  box-shadow: 0 25px 80px rgba(0,0,0,.25);
}
.channel-header-main {
  display: flex;
  align-items: center;
  gap: 18px;
}
.channel-avatar {
  width: 72px; height: 72px;
  border-radius: 20px;
  border: 1px solid var(--border-hover);
  background: linear-gradient(145deg, #1a1a1e, #080808);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.04em;
}
.channel-header-info .eyebrow { margin-bottom: 4px; }
.channel-header-info h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 6px;
}
.channel-actions { flex-shrink: 0; }
.channel-videos-section { margin-top: 8px; }

/* Timeout screen */
.timeout-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.timeout-card {
  max-width: 480px;
  text-align: center;
  padding: 36px 28px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(13,13,15,.95);
  display: grid;
  gap: 12px;
  justify-items: center;
}
.timeout-brand { margin-bottom: 8px; }
.timeout-box {
  width: 100%;
  margin: 8px 0 12px;
  padding: 14px;
  border-radius: 12px;
  background: #09090a;
  border: 1px solid var(--border);
  display: grid;
  gap: 4px;
}
.timeout-box span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }

/* Responsive */
@media (max-width: 900px) {
  .hero, .hero-home { grid-template-columns: 1fr; }
  .form-grid-two { grid-template-columns: 1fr; }
  .account-stats { grid-template-columns: 1fr; }
  .channel-page-card { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 800px) {
  .shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 26px 0 38px;
  }
  .brand-panel { padding: 10px 8px 0; }
  .tagline { margin-top: 14px; font-size: 16px; }
  .auth-card { justify-self: stretch; max-width: none; }
  .topbar {
    flex-wrap: wrap;
    padding-inline: 14px;
  }
  .main-nav { order: 3; width: 100%; justify-content: stretch; }
  .nav-tab { flex: 1; text-align: center; }
  .site-shell { width: calc(100% - 20px); padding-top: 20px; }
  .hero, .hero-home, .page-card { padding: 20px; }
  .video-grid, .home-video-grid {
    grid-template-columns: 1fr;
  }
}
