:root {
  color-scheme: dark;
  --background: #0b0b0b;
  --foreground: #f5f5f5;
  --muted: #a4a4a4;
  --accent: #e50914;
  --surface: #141414;
  --surface-light: #1f1f1f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: var(--background);
  color: var(--foreground);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  min-height: 100vh;
  background: var(--background);
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 2.75vw;
  transition: background 0.3s ease-in;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
}

.navbar.scrolled {
  background: var(--background);
}

.navbar__left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  color: var(--accent);
  width: 148px;
  height: 40px;
  display: block;
  flex-shrink: 0;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.nav-links a {
  color: var(--muted);
  transition: color 0.2s ease-in-out;
}

.nav-links a.is-active,
.nav-links a:hover {
  color: var(--foreground);
  font-weight: 600;
}

.navbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.icon-button {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--foreground);
  cursor: pointer;
  position: relative;
}

.icon-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  padding: 4px 8px;
  transition: border-color 0.3s ease, background 0.3s ease, padding 0.3s ease;
}

.search__input {
  width: 0;
  opacity: 0;
  border: none;
  background: transparent;
  color: var(--foreground);
  font-size: 0.85rem;
  outline: none;
  transition: width 0.3s ease, opacity 0.3s ease;
}

.search.is-active {
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.75);
  padding: 6px 10px;
}

.search.is-active .search__input {
  width: 210px;
  opacity: 1;
}

.search__input::placeholder {
  color: var(--muted);
  font-size: 0.8rem;
}

.notification {
  position: relative;
  display: inline-flex;
}

.notification__count {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  text-align: center;
  line-height: 16px;
}

.notification__popup {
  position: absolute;
  top: calc(100% + 16px);
  right: -10px;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid rgba(128, 128, 128, 0.4);
  border-radius: 0;
  padding: 0;
  display: grid;
  font-size: 0.85rem;
  color: var(--foreground);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 60;
}

.notification__popup span {
  padding: 16px 24px;
}

.notification:hover .notification__popup,
.notification:focus-within .notification__popup {
  opacity: 1;
  pointer-events: auto;
}

.profile-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--foreground);
  cursor: pointer;
}

.profile-chip img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
}

.profile-chip__caret {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

.profile-wrapper:hover .profile-chip__caret {
  transform: rotate(180deg);
}

.profile-chip:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 220px;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid rgba(128, 128, 128, 0.4);
  border-radius: 0;
  padding: 0;
  display: grid;
  gap: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 60;
}

.profile-wrapper:hover .profile-menu,
.profile-menu.is-active {
  opacity: 1;
  pointer-events: auto;
}

.profile-menu__arrow {
  position: absolute;
  top: -14px;
  right: 16px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 14px solid rgba(128, 128, 128, 0.6);
}

.profile-menu__profiles {
  padding: 10px 0;
}

.profile-menu__profile {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 6px 16px;
  background: transparent;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  font-size: 0.85rem;
  text-align: left;
  transition: background 0.15s ease;
}

.profile-menu__profile:hover {
  text-decoration: underline;
}

.profile-menu__profile img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
}

.profile-menu__divider {
  height: 1px;
  background: rgba(128, 128, 128, 0.4);
  margin: 0;
}

.profile-menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  color: var(--foreground);
  text-align: left;
  font-size: 0.8rem;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.profile-menu__item svg {
  width: 22px;
  height: 22px;
  fill: var(--muted);
  flex-shrink: 0;
}

.profile-menu__item:hover,
.profile-menu__item:focus-visible {
  text-decoration: underline;
  outline: none;
}

.profile-menu__signout {
  justify-content: center;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--foreground);
}

.profile {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hero {
  position: relative;
  height: 56.25vw;
  min-height: 420px;
  display: flex;
  align-items: center;
  padding: 0 2.75vw;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}

.hero__bottom-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 7.4rem;
  background: linear-gradient(to top, var(--background), transparent);
}

.hero__side-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.6), transparent 40%);
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 33%;
  min-width: 250px;
}

.hero__content h1 {
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1.5vw;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.8);
}

.hero__content p {
  font-size: clamp(0.9rem, 1.4vw, 1.3rem);
  margin-bottom: 1.5vw;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.8);
  color: var(--foreground);
}

.hero__actions {
  display: flex;
  gap: 0.8vw;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8vw 2.3vw;
  font-size: clamp(0.85rem, 1vw, 1rem);
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 700;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.btn--primary {
  background: var(--foreground);
  color: var(--background);
}

.btn--primary:hover {
  background: rgba(245, 245, 245, 0.75);
}

.btn--secondary {
  background: rgba(164, 164, 164, 0.4);
  color: var(--foreground);
}

.btn--secondary:hover {
  background: rgba(164, 164, 164, 0.25);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.hero__note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 420px;
}

.hero__note code {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  color: var(--foreground);
}

.content {
  margin-top: -64px;
  position: relative;
  z-index: 10;
}

.video-row {
  margin-bottom: 24px;
}

.video-row h2 {
  padding: 12px 50px;
  font-size: 1.1rem;
  font-weight: 700;
}

.row-wrapper {
  position: relative;
  overflow: visible;
}

.row-track {
  display: flex;
  gap: 10px;
  overflow-x: hidden;
  padding: 0 50px;
  scroll-behavior: smooth;
  min-height: 140px;
  padding-bottom: 80px;
  margin-bottom: -80px;
  overflow-y: visible;
}

.row-scroll {
  position: absolute;
  top: 0;
  bottom: 80px;
  width: 50px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  cursor: pointer;
  z-index: 10;
}

.row-scroll svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.row-wrapper:hover .row-scroll {
  opacity: 1;
}

.row-scroll.left {
  left: 0;
}

.row-scroll.right {
  right: 0;
}

.video-card {
  position: relative;
  flex-shrink: 0;
  width: 200px;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  z-index: 1;
}

.video-card:hover {
  z-index: 20;
}

.video-card img {
  width: 100%;
  border-radius: 4px;
}

.video-card__inner {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 4px;
  transform-origin: center bottom;
}

.video-card:hover .video-card__inner {
  transform: scale(1.45);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.75);
  border-radius: 6px;
  overflow: hidden;
}

.video-card__cover {
  width: 100%;
  height: 112px;
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface-light);
}

.video-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-hover-info {
  background: var(--surface);
  padding: 10px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease;
  text-align: left;
}

.video-card:hover .card-hover-info {
  opacity: 1;
  max-height: 120px;
}

.card-hover-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.card-hover-actions__right {
  margin-left: auto;
}

.card-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.card-action-btn:hover {
  border-color: var(--foreground);
  background: rgba(255, 255, 255, 0.1);
}

.card-action-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.card-action-btn--play {
  background: var(--foreground);
  color: var(--background);
  border-color: var(--foreground);
}

.card-action-btn--play:hover {
  background: rgba(255, 255, 255, 0.8);
}

.card-hover-meta {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--foreground);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-hover-progress {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.card-hover-progress__bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.row-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 20px 0;
}

.footer {
  padding: 1px 50px;
  border-top: 1px solid #222;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  z-index: 100;
}

.modal.is-active {
  opacity: 1;
  pointer-events: auto;
}

.modal__close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--surface-light);
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal__close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.modal__content {
  width: min(960px, 90vw);
  padding: 0 16px;
  display: flex;
  flex-direction: column;
}

.modal__content .player {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 8px;
  background: #000;
}

.player__meta {
  margin-top: 16px;
}

.player__meta h3 {
  margin: 0 0 6px;
}

.player__meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.no-scroll {
  overflow: hidden;
}

.modal--info {
  background: rgba(0, 0, 0, 0.85);
  padding: 32px 16px;
}

.info-modal {
  width: min(1000px, 94vw);
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.info-modal .modal__close {
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  background: var(--surface);
  border-radius: 50%;
}

.info-modal__media {
  position: relative;
  height: clamp(260px, 50vw, 480px);
  background: #000;
  overflow: hidden;
}

.info-modal__backdrop {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-modal__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--surface) 0%,
    rgba(20, 20, 20, 0.6) 40%,
    transparent 70%
  );
}

.info-modal__title {
  position: absolute;
  left: 32px;
  bottom: 80px;
  margin: 0;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 700;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.7);
  max-width: 60%;
  z-index: 1;
}

.info-modal__actions {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 24px;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 1;
}

.info-modal__actions-right {
  margin-left: auto;
}

.info-modal__icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(20, 20, 20, 0.6);
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.info-modal__icon-btn:hover {
  border-color: var(--foreground);
  background: rgba(40, 40, 40, 0.8);
}

.info-modal__icon-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.info-modal__details {
  padding: 24px 32px 36px;
  display: grid;
  gap: 16px;
}

.info-modal__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.info-modal__description {
  margin: 0;
  color: var(--foreground);
  line-height: 1.6;
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .hero__content {
    max-width: 70%;
  }
}

@media (max-width: 600px) {
  .hero {
    min-height: 360px;
  }

  .content {
    margin-top: -32px;
  }

  .video-row h2,
  .row-track {
    padding-left: 24px;
    padding-right: 24px;
  }

  .row-scroll {
    width: 32px;
  }

  .info-modal__title {
    left: 16px;
    bottom: 70px;
    max-width: 70%;
  }

  .info-modal__actions {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .info-modal__details {
    padding: 20px;
  }
}
