:root {
  --bg: #0b0d12;
  --bg-elevated: #12151d;
  --surface: #161a24;
  --surface-2: #1d2230;
  --border: #262c3a;
  --text: #e9edf6;
  --muted: #9aa4b8;
  --muted-2: #6f7a90;
  --accent: #7c5cff;
  --accent-2: #2dd4bf;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --danger: #ff6b81;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --container: 1180px;
  --header-h: 72px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(124, 92, 255, 0.14), transparent 60%),
    radial-gradient(700px 400px at 95% 5%, rgba(45, 212, 191, 0.09), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

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

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: rgba(11, 13, 18, 0.82);
  border-bottom: 1px solid rgba(38, 44, 58, 0.7);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #4f8cff 55%, var(--accent-2));
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.35);
}

.brand__mark--small {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.brand__name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  max-width: 560px;
  height: 42px;
  padding-left: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(22, 26, 36, 0.85);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search:focus-within {
  border-color: rgba(124, 92, 255, 0.7);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.search__icon {
  position: absolute;
  left: 15px;
  color: var(--muted);
}

.search input {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0 12px 0 0;
  outline: none;
}

.search input::placeholder {
  color: var(--muted-2);
}

.search input::-webkit-search-cancel-button {
  filter: invert(1);
  opacity: 0.5;
}

.search__submit {
  height: 32px;
  margin-right: 5px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.85rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.search__submit:hover {
  background: var(--accent);
  color: #fff;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex: 0 0 auto;
}

.nav-link {
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #5b7cfa);
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.3);
}

.btn--primary:hover {
  box-shadow: 0 14px 36px rgba(124, 92, 255, 0.4);
}

.btn--secondary {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.btn--secondary:hover {
  border-color: rgba(124, 92, 255, 0.5);
  background: rgba(124, 92, 255, 0.1);
}

.btn--ghost {
  min-height: 38px;
  padding: 0 16px;
  border-color: var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
}

.btn--ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn--wide {
  width: 100%;
  min-height: 48px;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 48px;
  align-items: center;
  padding-block: 72px 56px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.07);
  color: #8ee8dc;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 20px 0 18px;
  font-size: clamp(2.3rem, 4.6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.gradient-text {
  background: linear-gradient(100deg, #a78bfa 0%, #60a5fa 45%, #2dd4bf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  max-width: 520px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__stats {
  display: flex;
  gap: 36px;
  margin: 38px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--border);
}

.hero__stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero__stats dt {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero__stats dd {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.85rem;
}

.hero__visual {
  position: relative;
  min-height: 380px;
}

.hero-card {
  position: absolute;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-card--back {
  inset: 8% 0 20% 14%;
  transform: rotate(6deg);
  background: linear-gradient(150deg, #1c2130, #12151d);
  opacity: 0.55;
}

.hero-card--mid {
  inset: 4% 6% 14% 8%;
  transform: rotate(-4deg);
  background: linear-gradient(150deg, #202638, #12151d);
  opacity: 0.8;
}

.hero-card--front {
  inset: 0 10% 10% 0;
  overflow: hidden;
  background: var(--surface);
}

.hero-card__screen {
  position: relative;
  display: grid;
  place-items: center;
  height: 72%;
  background:
    radial-gradient(120% 90% at 20% 10%, rgba(124, 92, 255, 0.55), transparent 60%),
    radial-gradient(120% 100% at 90% 90%, rgba(45, 212, 191, 0.4), transparent 55%),
    linear-gradient(135deg, #252b3d, #12151d);
}

.hero-card__screen::before {
  content: "";
  position: absolute;
  inset: 12% 10%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 26px 26px;
  opacity: 0.5;
}

.hero-card__play {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #fff;
  background: rgba(11, 13, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px);
}

.hero-card__meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}

.skeleton {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2), #2a3042, var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 2.4s ease infinite;
}

.skeleton--title {
  width: 70%;
  height: 14px;
}

.skeleton--line {
  width: 45%;
  height: 10px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Catalog */

.catalog {
  padding-block: 20px 80px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  letter-spacing: -0.03em;
}

.section-sub {
  margin: 4px 0 0;
  color: var(--muted-2);
  font-size: 0.92rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.chip:hover {
  color: var(--text);
  border-color: rgba(124, 92, 255, 0.5);
}

.chip.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #5b7cfa);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 26px 20px;
}

.video-card {
  min-width: 0;
}

.video-card[hidden] {
  display: none;
}

.video-card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.video-card__thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 80% at 20% 20%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.45));
}

.video-card__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.1) 48%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}

.video-card__thumb:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.video-card__thumb:hover::after {
  transform: translateX(120%);
}

.thumb--1 { background: linear-gradient(135deg, #3b2f8f, #7c5cff 45%, #2dd4bf); }
.thumb--2 { background: linear-gradient(135deg, #062c3a, #0e7490 45%, #34d399); }
.thumb--3 { background: linear-gradient(135deg, #2a0f3f, #a21caf 50%, #fb7185); }
.thumb--4 { background: linear-gradient(135deg, #1e293b, #2563eb 55%, #38bdf8); }
.thumb--5 { background: linear-gradient(135deg, #3f1d38, #db2777 50%, #f59e0b); }
.thumb--6 { background: linear-gradient(135deg, #0f2e22, #059669 50%, #a3e635); }
.thumb--7 { background: linear-gradient(135deg, #3b0d0d, #dc2626 50%, #f97316); }
.thumb--8 { background: linear-gradient(135deg, #3b2a0d, #d97706 50%, #fde68a); }

.badge-duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(5, 7, 10, 0.82);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.play-pill {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #fff;
  background: rgba(5, 7, 10, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(4px);
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.video-card__thumb:hover .play-pill,
.video-card__thumb:focus-visible .play-pill {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.video-card__body {
  display: flex;
  gap: 12px;
  padding: 12px 4px 0;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

.avatar--violet { background: linear-gradient(135deg, #7c5cff, #4f46e5); }
.avatar--teal { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.avatar--orange { background: linear-gradient(135deg, #ea580c, #f59e0b); }
.avatar--blue { background: linear-gradient(135deg, #2563eb, #38bdf8); }
.avatar--pink { background: linear-gradient(135deg, #db2777, #f472b6); }
.avatar--green { background: linear-gradient(135deg, #15803d, #4ade80); }
.avatar--red { background: linear-gradient(135deg, #b91c1c, #f87171); }
.avatar--amber { background: linear-gradient(135deg, #b45309, #fbbf24); }

.video-card__text {
  min-width: 0;
}

.video-card__text h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card__text h3 a:hover {
  color: #c4b5fd;
}

.video-card__channel {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.video-card__meta {
  margin: 1px 0 0;
  color: var(--muted-2);
  font-size: 0.82rem;
}

.empty-state {
  margin: 40px 0 0;
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(11, 13, 18, 0.6);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 32px;
  padding-block: 28px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
}

.footer-note {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.82rem;
}

.footer-nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-nav a:hover {
  color: var(--text);
}

/* Modal */

.modal {
  width: min(100% - 32px, 430px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(4px);
}

.modal__panel {
  position: relative;
  padding: 30px 30px 26px;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.modal__close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.modal__head {
  margin-bottom: 22px;
  text-align: center;
}

.modal__head .brand__mark {
  margin: 0 auto 14px;
}

.modal__head h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

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

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  border-color: rgba(124, 92, 255, 0.75);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.form-error {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid rgba(255, 107, 129, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(255, 107, 129, 0.09);
  color: #ffb3bf;
  font-size: 0.87rem;
}

.form-hint {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.76rem;
  text-align: center;
}

.btn__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading .btn__spinner {
  display: inline-block;
}

.btn.is-loading .btn__label {
  opacity: 0.75;
}

.btn[disabled] {
  cursor: progress;
  opacity: 0.8;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 60;
  padding: 12px 16px;
  border: 1px solid rgba(255, 107, 129, 0.4);
  border-radius: 10px;
  background: #2a1218;
  color: #ffb3bf;
  text-align: center;
  font-size: 0.9rem;
}

/* Responsive */

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-block: 52px 40px;
  }

  .hero__visual {
    min-height: 300px;
    max-width: 560px;
  }

  .header-nav .nav-link {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: auto;
  }

  .site-header {
    position: static;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
    padding-block: 14px;
  }

  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .header-nav {
    margin-left: auto;
  }

  .hero__stats {
    gap: 24px;
  }

  .section-head {
    align-items: flex-start;
  }

  .chips {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .chip {
    flex: 0 0 auto;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-nav {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .brand__name {
    font-size: 1.2rem;
  }

  .hero h1 {
    font-size: 2.1rem;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .hero__visual {
    min-height: 240px;
  }

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

  .modal__panel {
    padding: 26px 20px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
