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

html {
    min-width: 280px;
    min-height: 100%;
    background: var(--site-bg, #0b0f14);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text-primary, rgba(255, 255, 255, .78));
    background: var(--body-background, #0b0f14);
    font-family: var(--font-sans, "Avenir Next", "Segoe UI", sans-serif);
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

body.menu-open {
    overflow: hidden;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

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

h1,
h2,
h3,
p {
    margin-top: 0;
}

.shell {
    width: min(var(--content-width, 1440px), calc(100% - 20px));
    margin-inline: auto;
}

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

.site-header {
    position: relative;
    z-index: 30;
    min-height: 61px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--header-border, #000);
    background: var(--header-background, rgba(0, 0, 0, .52));
}

.header-row {
    display: flex;
    min-height: 60px;
    align-items: center;
    gap: 18px;
}

.brand {
    display: inline-flex;
    min-width: 190px;
    height: 50px;
    align-items: center;
    gap: 10px;
    color: var(--brand-text, #f4f4f4);
    font-size: clamp(22px, 2vw, 29px);
    font-weight: 850;
    letter-spacing: -.055em;
    text-decoration: none;
    white-space: nowrap;
}

.brand img {
    width: auto;
    max-width: 210px;
    max-height: 48px;
}

.brand-mark {
    position: relative;
    display: inline-block;
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    border: 3px solid var(--accent, #f40337);
    border-radius: 50%;
}

.brand-mark::before {
    position: absolute;
    top: 50%;
    left: 54%;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 12px solid var(--accent, #f40337);
    content: "";
    transform: translate(-50%, -50%);
}

.brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.primary-nav a {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--border, rgba(255, 255, 255, .1));
    border-radius: var(--control-radius, 12px);
    color: var(--text-primary, rgba(255, 255, 255, .78));
    background: var(--surface-1, #0f1620);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.primary-nav a:hover,
.primary-nav a.active {
    color: var(--text-strong, #fff);
    border-color: var(--border-strong, rgba(255, 255, 255, .26));
    background: var(--surface-2, #121b26);
}

.search {
    position: relative;
    z-index: 10;
    width: min(310px, 26vw);
    min-width: 190px;
    overflow: visible;
    border: 1px solid var(--border, rgba(255, 255, 255, .1));
    border-radius: var(--control-radius, 12px);
    background: var(--surface-1, #0f1620);
    box-shadow: var(--shadow-small, 0 6px 18px rgba(0, 0, 0, .35));
}

.search input {
    width: 100%;
    height: 40px;
    padding: 0 48px 0 15px;
    color: var(--text-strong, #fff);
    border: 0;
    outline: 0;
    background: transparent;
}

.search input::placeholder {
    color: var(--text-muted, rgba(255, 255, 255, .48));
}

.search button {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.search button::before {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 15px;
    height: 15px;
    border: 2px solid var(--text-primary, rgba(255, 255, 255, .78));
    border-radius: 50%;
    content: "";
}

.search button::after {
    position: absolute;
    top: 25px;
    left: 25px;
    width: 9px;
    height: 2px;
    background: var(--text-primary, rgba(255, 255, 255, .78));
    content: "";
    transform: rotate(45deg);
    transform-origin: left center;
}

.search-suggestions {
    position: absolute;
    z-index: 80;
    top: calc(100% + 7px);
    right: 0;
    left: 0;
    max-height: min(430px, 65vh);
    padding: 5px;
    overflow-y: auto;
    border: 1px solid var(--border-strong, rgba(255, 255, 255, .24));
    border-radius: 9px;
    background: var(--menu-background, #111820);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .62);
}

.search-suggestions[hidden] {
    display: none;
}

.search-suggestion {
    display: flex;
    min-height: 43px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    color: var(--text-primary, rgba(255, 255, 255, .76));
    border-radius: 6px;
    text-decoration: none;
}

.search-suggestion:hover,
.search-suggestion.active {
    color: var(--text-strong, #fff);
    background: var(--surface-3, #172233);
}

.search-suggestion-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-suggestion mark {
    color: var(--text-strong, #fff);
    background: transparent;
    font-weight: 800;
}

.search-suggestion small {
    flex: 0 0 auto;
    color: var(--accent-text, #ff526f);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.nav-toggle > span[aria-hidden] {
    position: relative;
    display: block;
    width: 28px;
    height: 2px;
    margin: auto;
    background: var(--text-strong, #fff);
}

.nav-toggle > span[aria-hidden]::before,
.nav-toggle > span[aria-hidden]::after {
    position: absolute;
    left: 0;
    width: 28px;
    height: 2px;
    background: inherit;
    content: "";
}

.nav-toggle > span[aria-hidden]::before { top: -8px; }
.nav-toggle > span[aria-hidden]::after { top: 8px; }

.site-main {
    min-height: calc(100vh - 132px);
    padding-bottom: 42px;
}

.page-heading,
.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.page-heading {
    min-height: 48px;
    padding: 7px 0 10px;
    border-bottom: 1px solid var(--divider, rgba(255, 255, 255, .08));
}

.page-heading h1,
.section-heading h1,
.section-heading h2,
.video-detail-header h1 {
    margin: 0;
    color: var(--heading, #bfbfbf);
    font-weight: 520;
    letter-spacing: .01em;
}

.page-heading h1 {
    font-size: clamp(20px, 2vw, 28px);
}

.page-heading p,
.section-heading > span {
    margin: 0;
    color: var(--text-muted, rgba(255, 255, 255, .48));
    font-size: 14px;
}

.category-strip,
.video-section,
.directory-section {
    margin-top: 18px;
}

.section-heading {
    min-height: 38px;
    padding-bottom: 7px;
}

.section-heading h2 {
    font-size: clamp(18px, 1.6vw, 24px);
}

.section-heading h1 {
    font-size: clamp(20px, 2vw, 28px);
}

.video-sort {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.video-sort > span {
    color: var(--text-muted, rgba(255, 255, 255, .48));
    font-size: 13px;
}

.video-sort > div {
    display: flex;
    overflow: hidden;
    border-radius: 8px;
}

.video-sort a {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 0 13px;
    color: var(--text-primary, rgba(255, 255, 255, .78));
    background: rgba(255, 255, 255, .12);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
}

.video-sort a:hover,
.video-sort a.active {
    color: #fff;
    background: var(--accent, #f40337);
}

.category-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding-top: 8px;
}

.category-cloud a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    color: var(--text-secondary, rgba(255, 255, 255, .68));
    border: 1px solid var(--border, rgba(255, 255, 255, .1));
    border-radius: 6px;
    background: var(--surface-1, #0f1620);
    font-size: 13px;
    text-decoration: none;
}

.category-cloud a:hover {
    color: var(--text-strong, #fff);
    border-color: var(--accent, #f40337);
}

.category-cloud small {
    color: var(--text-muted, rgba(255, 255, 255, .48));
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 16px;
}

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

.video-thumb {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: var(--thumb-radius, 10px);
    background: var(--surface-2, #121b26);
}

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

.video-thumb img {
    transition: opacity .2s ease, transform .25s ease;
}

.video-card:hover .video-thumb img {
    transform: scale(1.015);
}

.video-thumb.preview-active img {
    opacity: 0;
}

.video-thumb video {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.video-badge {
    position: absolute;
    z-index: 4;
    top: 6px;
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 2px 7px 2px 25px;
    color: #fff;
    border-radius: 6px;
    background: rgba(0, 0, 0, .65);
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: .02em;
}

.video-duration { right: 6px; }
.video-views { left: 6px; }

.video-duration::before,
.video-views::before {
    position: absolute;
    left: 8px;
    content: "";
}

.video-duration::before {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid #fff;
}

.video-views::before {
    width: 12px;
    height: 8px;
    border: 2px solid #fff;
    border-radius: 50%;
}

.play-indicator {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    width: 46px;
    height: 46px;
    border: 2px solid rgba(255, 255, 255, .76);
    border-radius: 50%;
    background: rgba(0, 0, 0, .36);
    opacity: 0;
    transform: translate(-50%, -50%) scale(.85);
    transition: opacity .18s ease, transform .18s ease;
}

.play-indicator::after {
    position: absolute;
    top: 50%;
    left: 54%;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 11px solid #fff;
    content: "";
    transform: translate(-50%, -50%);
}

.video-card:hover .play-indicator {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.video-card h3 {
    margin: 0;
    padding: 4px 12px 0 0;
    overflow: hidden;
    font-size: clamp(15px, 1.1vw, 17px);
    font-weight: 520;
    line-height: 1.35;
    letter-spacing: .005em;
}

.video-card h3 a {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-primary, rgba(255, 255, 255, .78));
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.video-card h3 a:hover {
    color: var(--text-strong, #fff);
}

.video-meta {
    min-height: 18px;
    padding-top: 2px;
    color: var(--text-muted, rgba(255, 255, 255, .48));
    font-size: 12px;
}

.video-meta:empty {
    display: none;
}

.video-meta a {
    text-decoration: none;
}

.video-meta a:hover {
    color: var(--accent, #f40337);
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 26px;
}

.pager a,
.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    color: var(--text-strong, #fff);
    border: 1px solid var(--accent-soft, rgba(244, 3, 55, .62));
    border-radius: 6px;
    background: var(--surface-2, #121b26);
    font-weight: 700;
    text-decoration: none;
}

.pager a:hover,
.button:hover {
    background: var(--accent, #f40337);
}

.video-list-enhanced .pager {
    display: none;
}

.video-load-status {
    display: grid;
    min-height: 86px;
    place-items: center;
    color: var(--text-muted, rgba(255, 255, 255, .48));
    font-size: 13px;
    text-align: center;
}

.video-load-status [data-video-loading] {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.video-load-status [data-video-loading][hidden] {
    display: none;
}

.video-load-status [data-video-loading]::before {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-strong, rgba(255, 255, 255, .24));
    border-top-color: var(--accent, #f40337);
    border-radius: 50%;
    content: "";
    animation: loading-spin .7s linear infinite;
}

.video-load-status.load-error {
    min-height: 64px;
    color: var(--accent-text, #ff526f);
}

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

.empty-copy,
.empty-state {
    padding: 38px 0;
    color: var(--text-muted, rgba(255, 255, 255, .48));
}

.empty-state h1 {
    color: var(--heading, #bfbfbf);
}

.empty-state .button {
    margin-top: 12px;
}

.entity-group {
    margin-top: 24px;
}

.entity-group > h3 {
    margin-bottom: 10px;
    color: var(--heading, #bfbfbf);
    font-size: 17px;
    font-weight: 600;
}

.entity-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.entity-card {
    display: flex;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    color: var(--text-primary, rgba(255, 255, 255, .78));
    border: 1px solid var(--border, rgba(255, 255, 255, .1));
    border-radius: 7px;
    background: var(--surface-1, #0f1620);
    text-decoration: none;
}

.entity-card:hover {
    color: var(--text-strong, #fff);
    border-color: var(--accent-soft, rgba(244, 3, 55, .62));
}

.entity-card strong {
    overflow: hidden;
    font-weight: 560;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entity-card span {
    flex: 0 0 auto;
    color: var(--text-muted, rgba(255, 255, 255, .48));
    font-size: 12px;
}

.video-detail {
    width: 100%;
}

.video-layout {
    display: flex;
    align-items: flex-start;
    gap: clamp(22px, 4vw, 62px);
}

.video-main {
    flex: 1 1 auto;
    min-width: 0;
}

.video-layout-wide .video-main {
    max-width: 1200px;
    margin-inline: auto;
}

.player-shell {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 6px;
    background: #000;
    box-shadow: var(--shadow-large, 0 10px 30px rgba(0, 0, 0, .45));
}

.site-video-player,
.player-poster {
    width: 100%;
    aspect-ratio: 16 / 9;
}

.site-video-player {
    background: #000;
}

.player-poster {
    position: relative;
    display: block;
    color: #fff;
}

.player-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .74;
}

.player-poster span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: max-content;
    max-width: calc(100% - 30px);
    padding: 12px 18px;
    border-radius: 7px;
    background: var(--accent, #f40337);
    font-weight: 750;
    transform: translate(-50%, -50%);
}

.player-poster .player-unavailable {
    background: rgba(0, 0, 0, .78);
}

.video-title {
    margin: 10px 0 0;
    color: var(--heading, #bfbfbf);
    font-size: clamp(22px, 2.3vw, 34px);
    font-weight: 520;
    line-height: 1.22;
}

.advertising-slot {
    margin: 16px 0;
    overflow: hidden;
    text-align: center;
}

.demo-advertisement {
    display: grid;
    min-height: 64px;
    place-items: center;
    padding: 14px;
    color: var(--text-muted, rgba(255, 255, 255, .48));
    border: 1px dashed var(--border-strong, rgba(255, 255, 255, .24));
    border-radius: 7px;
    background: var(--surface-1, #0f1620);
    font-size: 12px;
    text-transform: uppercase;
}

.demo-advertisement a {
    color: inherit;
    text-decoration: none;
}

.demo-advertisement-rectangle {
    width: min(300px, 100%);
    min-height: 250px;
}

.video-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 0;
    padding: 11px 0 13px;
    color: var(--text-muted, rgba(255, 255, 255, .48));
    border-bottom: 1px solid var(--divider, rgba(255, 255, 255, .08));
    font-size: 13px;
}

.video-fact {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    white-space: nowrap;
}

.video-fact + .video-fact::before {
    width: 3px;
    height: 3px;
    margin: 0 11px;
    border-radius: 50%;
    background: var(--accent, #f40337);
    content: "";
}

.video-bottom-ad {
    padding: 4px 0;
}

.video-description {
    max-width: 900px;
    margin: 20px 0 0;
    color: var(--text-secondary, rgba(255, 255, 255, .68));
    line-height: 1.65;
}

.video-taxonomy {
    display: grid;
    gap: 10px;
    margin-top: 17px;
}

.video-taxonomy-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.video-taxonomy-row strong {
    min-width: 76px;
    color: var(--text-muted, rgba(255, 255, 255, .48));
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.taxonomy-chip {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 4px 10px;
    color: var(--text-primary, rgba(255, 255, 255, .76));
    border: 1px solid var(--border, rgba(255, 255, 255, .1));
    border-radius: 8px;
    background: var(--surface-1, #0f1620);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
}

.taxonomy-chip:hover {
    color: var(--text-strong, #fff);
    border-color: var(--accent-soft, rgba(244, 3, 55, .62));
    background: var(--surface-2, #121b26);
}

.taxonomy-model {
    border-color: rgba(255, 255, 255, .16);
    background: var(--surface-2, #121b26);
}

.taxonomy-category::before,
.taxonomy-tag::before {
    margin-right: 2px;
    color: var(--accent-text, #ff526f);
    content: "#";
}

.video-ad-rail {
    display: flex;
    flex: 0 0 310px;
    width: 310px;
    min-height: 250px;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    text-align: center;
}

.video-mobile-ad {
    display: none;
    margin: 18px auto 0;
    overflow: hidden;
    text-align: center;
}

.site-footer {
    min-height: 61px;
    color: var(--text-muted, rgba(255, 255, 255, .48));
    border-top: 1px solid var(--divider, rgba(255, 255, 255, .08));
    background: var(--footer-background, rgba(0, 0, 0, .26));
}

.footer-row {
    display: flex;
    min-height: 60px;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.footer-row a {
    color: var(--accent-text, #ff526f);
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 1160px) {
    .primary-nav a { padding-inline: 9px; }
    .search { width: 210px; min-width: 160px; }
}

@media (max-width: 980px) {
    .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .entity-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .video-layout { display: block; }
    .video-ad-rail { display: none; }
    .video-mobile-ad { display: block; }
    .nav-toggle { display: block; }
    .brand { margin-right: auto; }

    .primary-nav {
        position: fixed;
        z-index: 50;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(340px, calc(100% - 58px));
        padding: 20px 12px;
        overflow-y: auto;
        align-items: stretch;
        flex-direction: column;
        background: var(--menu-background, #111820);
        box-shadow: 18px 0 50px rgba(0, 0, 0, .55);
        transform: translateX(-105%);
        transition: transform .22s ease;
    }

    .primary-nav a {
        min-height: 50px;
        padding-inline: 16px;
        font-size: 17px;
    }

    body.menu-open .primary-nav { transform: translateX(0); }

    body.menu-open::after {
        position: fixed;
        z-index: 20;
        inset: 0;
        background: rgba(0, 0, 0, .68);
        content: "";
    }
}

@media (max-width: 680px) {
    .shell { width: calc(100% - 20px); }
    .site-header { margin-bottom: 5px; }
    .header-row { min-height: 58px; gap: 9px; }
    .brand { min-width: 0; height: 48px; justify-content: center; }
    .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
    .brand-name { font-size: 21px; }
    .search { width: 44px; min-width: 44px; border-color: var(--border-strong, rgba(255, 255, 255, .26)); }
    .search input { position: absolute; width: 1px; opacity: 0; pointer-events: none; }
    .search:focus-within { position: absolute; right: 10px; left: 10px; width: auto; z-index: 60; }
    .search:focus-within input { position: static; width: 100%; opacity: 1; pointer-events: auto; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
    .video-sort { width: 100%; margin-top: 7px; }
    .video-sort > div { flex: 1; }
    .video-sort a { flex: 1; justify-content: center; padding-inline: 6px; font-size: 11px; }
    .category-cloud { flex-wrap: nowrap; padding-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
    .category-cloud::-webkit-scrollbar { display: none; }
    .category-cloud a { flex: 0 0 auto; }
    .entity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .video-card h3 { font-size: 15px; }
    .video-title { margin-top: 8px; font-size: 21px; }
    .video-facts { font-size: 12px; }
    .video-fact + .video-fact::before { margin-inline: 8px; }
    .video-taxonomy-row strong { width: 100%; min-width: 0; }
}

@media (max-width: 520px) {
    .video-grid { grid-template-columns: 1fr; gap: 16px; }
    .entity-grid { grid-template-columns: 1fr; }
    .video-card h3 { padding-top: 5px; font-size: 16px; }
    .video-meta { font-size: 13px; }
    .section-heading > span { display: none; }
    .pager { gap: 8px; }
    .pager a { padding-inline: 14px; }
}

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