:root {
  color-scheme: light;
  --bg: #fff;
  --ink: #0f0f0f;
  --muted: #606060;
  --line: #e5e5e5;
  --soft: #f7f7f7;
  --accent: #ff0033;
  --panel: #111;
  --radius: 8px;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.topbar {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto 0;
  height: 64px;
  display: grid;
  grid-template-columns: 220px minmax(180px, 640px) auto;
  align-items: center;
  gap: 20px;
  padding: 0 22px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 22px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.search {
  justify-self: center;
  width: min(100%, 640px);
  display: grid;
  grid-template-columns: 1fr 54px;
  border: 1px solid #cfcfcf;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.search input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 11px 16px;
  font-size: 16px;
}

.search button {
  border: 0;
  border-left: 1px solid #d8d8d8;
  background: var(--soft);
  color: #202020;
  cursor: pointer;
}

.actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.actions button,
.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.actions button {
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 22px;
}

.avatar {
  background: #111;
  color: #fff;
  font-weight: 700;
}

.shell {
  height: 100vh;
  padding-top: 64px;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.rail {
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.rail-item {
  display: block;
  padding: 11px 14px;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.rail-item + .rail-item {
  margin-top: 4px;
}

.rail-item.active,
.rail-item:hover {
  background: #f0f0f0;
}

.feed-wrap {
  position: relative;
  height: calc(100vh - 64px);
  overflow: hidden;
  background: #fff;
}

.feed {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
}

.video-card {
  min-height: calc(100vh - 64px);
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(260px, 420px);
  justify-content: center;
  align-items: center;
  gap: 34px;
  padding: 28px;
}

.stage {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 9 / 16;
  background: #050505;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}

.stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #050505;
}

.video-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 54px 18px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0));
  color: #fff;
}

.video-overlay h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.video-overlay p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, .78);
  line-height: 1.45;
}

.meta {
  align-self: center;
  max-width: 420px;
}

.creator {
  color: var(--muted);
  font-weight: 700;
}

.meta h1 {
  margin: 10px 0 12px;
  font-size: 32px;
  line-height: 1.12;
}

.meta p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.controls button {
  border: 1px solid var(--line);
  background: #fff;
  color: #111;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.controls button:hover {
  background: var(--soft);
}

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
}

.empty h1 {
  margin: 0;
  font-size: 26px;
}

.empty p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

code {
  background: #f0f0f0;
  border-radius: 4px;
  padding: 2px 5px;
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    padding: 0 14px;
  }

  .brand-word,
  .rail {
    display: none;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .video-card {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    align-items: stretch;
  }

  .stage {
    width: 100%;
    height: calc(100vh - 64px);
    max-width: none;
    border-radius: 0;
    box-shadow: none;
  }

  .meta {
    display: none;
  }
}

@media (max-width: 560px) {
  .topbar {
    height: 56px;
  }

  .shell {
    padding-top: 56px;
  }

  .feed-wrap,
  .video-card,
  .stage {
    min-height: calc(100vh - 56px);
    height: calc(100vh - 56px);
  }

  .search {
    grid-template-columns: 1fr 44px;
  }

  .actions button {
    display: none;
  }
}
