:root {
  color-scheme: light;
  --bg: #f0f1f5;
  --surface: #fff;
  --line: #dfe3eb;
  --text: #111827;
  --muted: #697386;
  --blue: #075cff;
  --violet: #8517ff;
  --navy: #071b47;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--bg); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.site-header { position: relative; z-index: 10; background: #fff; border-bottom: 1px solid rgba(7, 27, 71, .1); }
.site-header::after {
  position: absolute;
  right: 0;
  bottom: -3px;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #02c8f2, var(--blue) 48%, var(--violet));
  content: "";
}

.header-inner, .section-inner, .collection-shell { width: min(1760px, calc(100% - 48px)); margin: 0 auto; }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { width: 210px; display: block; line-height: 0; }
.brand img { display: block; width: 100%; height: auto; }
.header-count { display: flex; align-items: baseline; gap: 7px; color: var(--muted); font-size: .84rem; }
.header-count strong { color: var(--navy); font-size: 1rem; }

.section-bar { color: #fff; background: var(--navy); }
.section-inner { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: .98rem; }
.section-inner > div { display: flex; align-items: center; gap: 10px; }
.home-icon { color: #fff; font-size: 1.45rem; line-height: 1; transform: translateY(-2px); }
.separator { color: rgba(255, 255, 255, .45); }
.sort-label {
  padding: 8px 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  border-radius: 6px;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-decoration: none;
  text-transform: uppercase;
}
.sort-label:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.slide-banner { width: min(2021px, 100%); margin: 0 auto; background: #031a4c; line-height: 0; }
.slide-banner-link { display: block; }
.slide-banner img { display: block; width: 100%; height: auto; }
.slide-banner-link:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }

.collection-shell { padding: 20px 0 48px; }
.collection-summary {
  min-height: 34px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: .8rem;
}
.collection-summary strong { color: var(--text); font-size: .9rem; }
.collection-panel { min-width: 0; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 22px 16px; }
.video-row-banner { grid-column: 1 / -1; min-width: 0; line-height: 0; }
.video-row-banner img { display: block; width: 100%; height: auto; }
.video-card, .video-link, .video-meta { min-width: 0; }
.video-card { overflow: hidden; }
.video-link { display: block; color: inherit; text-decoration: none; }

.video-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background:
    radial-gradient(circle at 78% 18%, rgba(143, 58, 255, .75), transparent 32%),
    radial-gradient(circle at 22% 76%, rgba(0, 199, 242, .68), transparent 38%),
    linear-gradient(145deg, #0a1740, #111936 56%, #230756);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(7, 27, 71, .16);
  isolation: isolate;
}
.preview-media, .preview-fallback, .preview-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; }
.preview-media {
  z-index: 1;
  display: block;
  object-fit: cover;
  opacity: 1;
  transition: transform .15s ease;
}
.preview-media[hidden] { display: none; }
.preview-fallback {
  z-index: 1;
  display: block;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
.preview-fallback.is-ready { opacity: 1; }
.preview-placeholder { display: grid; place-items: center; }
.preview-placeholder::before, .preview-placeholder::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  content: "";
}
.preview-placeholder::before { width: 78%; aspect-ratio: 1; }
.preview-placeholder::after { width: 52%; aspect-ratio: 1; }
.play-icon {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 50%;
}
.play-icon::after {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid #fff;
  content: "";
}
.video-number, .open-label {
  position: absolute;
  z-index: 2;
  top: 7px;
  padding: 4px 6px;
  color: #fff;
  background: rgba(0, 0, 0, .78);
  border-radius: 3px;
  font-size: .66rem;
  font-weight: 800;
  line-height: 1;
}
.video-number { left: 7px; }
.open-label {
  right: 7px;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease;
}
.video-meta { padding-top: 8px; }
.video-meta time {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-meta h2 {
  display: -webkit-box;
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--text);
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.empty-state {
  min-height: 320px;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 30px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.empty-state span { color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 0; margin-top: 38px; }
.pagination a, .current-page, .page-dots {
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-left: -1px;
  color: var(--blue);
  background: #fff;
  border: 1px solid #cfd5e0;
  font-size: .84rem;
  text-decoration: none;
}
.pagination > :first-child { border-radius: 5px 0 0 5px; }
.pagination > :last-child { border-radius: 0 5px 5px 0; }
.current-page { position: relative; z-index: 1; color: #fff; background: linear-gradient(135deg, var(--blue), var(--violet)); border-color: var(--blue); font-weight: 800; }
.page-dots { color: var(--muted); }
.corner-promos {
  position: fixed;
  z-index: 30;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(46px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: clamp(92px, 10vw, 148px);
}
.corner-promo {
  display: block;
  width: 100%;
  line-height: 0;
  filter: drop-shadow(0 8px 18px rgba(7, 27, 71, .28));
  transition: filter .2s ease, transform .2s ease;
}
.corner-promo img { display: block; width: 100%; height: auto; }
.corner-promo-static { pointer-events: none; }
.corner-promo:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

@media (hover: hover) {
  a.sort-label:hover { filter: brightness(1.12); }
  a.corner-promo:hover { filter: drop-shadow(0 10px 22px rgba(7, 27, 71, .36)) brightness(1.08); transform: translateY(-3px); }
  .video-link:hover .preview-media { transform: scale(1.035); }
  .video-link:hover .video-meta h2 { color: var(--blue); }
  .video-link:hover .open-label { opacity: 1; transform: translateY(0); }
  .pagination a:hover { position: relative; z-index: 2; background: #eef4ff; border-color: var(--blue); }
}

@media (min-width: 1500px) {
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); }
}

@media (max-width: 700px) {
  .header-inner, .section-inner, .collection-shell { width: calc(100% - 24px); }
  .site-header { position: sticky; top: 0; }
  .header-inner { min-height: 58px; }
  .brand { width: 142px; }
  .header-count { display: grid; justify-items: end; gap: 0; font-size: .64rem; line-height: 1.2; }
  .header-count strong { font-size: .8rem; }
  .section-inner { min-height: 48px; font-size: .84rem; }
  .sort-label { padding: 6px 8px; font-size: .64rem; }
  .home-icon { font-size: 1.2rem; }
  .collection-shell { padding: 14px 0 34px; }
  .collection-summary { min-height: 28px; margin-bottom: 10px; font-size: .67rem; }
  .collection-summary strong { font-size: .72rem; }
  .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px 10px; }
  .video-preview { border-radius: 3px; }
  .video-number { top: 5px; left: 5px; padding: 3px 4px; font-size: .55rem; }
  .open-label { display: none; }
  .play-icon { width: 34px; height: 34px; }
  .play-icon::after { border-top-width: 6px; border-bottom-width: 6px; border-left-width: 9px; }
  .video-meta { padding-top: 6px; }
  .video-meta time { font-size: .58rem; }
  .video-meta h2 { margin-top: 2px; font-size: .7rem; line-height: 1.3; }
  .pagination { margin-top: 28px; }
  .pagination a, .current-page, .page-dots { min-width: 34px; height: 36px; font-size: .76rem; }
  .corner-promos {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(32px, env(safe-area-inset-bottom));
    width: 86px;
  }
}

@media (max-width: 370px) {
  .header-inner, .section-inner, .collection-shell { width: calc(100% - 16px); }
  .brand { width: 130px; }
  .video-grid { gap: 16px 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .preview-media, .preview-fallback, .open-label, .corner-promo { transition: none; }
}
