:root {
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast: 0.16s;
    --t-med: 0.28s;
    --shadow-soft: var(--shadow-plate);
    --shadow-pop: var(--shadow-lift);
    --ring: 0 0 0 4px var(--gold-soft);
}

html { scroll-behavior: smooth; }

::selection { background: rgba(var(--primary-rgb), 0.34); color: #fff; }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    box-shadow: none;
}
@media (forced-colors: active) {
    :focus-visible { outline-color: Highlight; }
}

@media (hover: hover) {
    * { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
    ::-webkit-scrollbar { width: 11px; height: 11px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb {
        background: var(--border);
        border: 3px solid transparent;
        border-radius: 999px;
        background-clip: content-box;
    }
    ::-webkit-scrollbar-thumb:hover { background: var(--gold); background-clip: content-box; }
}

.header {
    transition: box-shadow var(--t-med), background var(--t-med);
}
@media (hover: hover) {
    .header {
        -webkit-backdrop-filter: saturate(140%) blur(16px);
        backdrop-filter: saturate(140%) blur(16px);
    }
    @supports (background: color-mix(in srgb, red, blue)) {
        .header { background: color-mix(in srgb, var(--bg) 88%, transparent); }
    }
}
.header--scrolled {
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.16);
}
[data-theme="dark"] .header--scrolled {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

.header__search input {
    padding-inline-end: 50px;
    border-radius: 999px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.header__search input:focus { box-shadow: var(--ring); }

[dir="rtl"] .header__search svg,
[dir="rtl"] .header__search > i { left: auto; right: 15px; }
[dir="rtl"] .header__search input { padding-inline-start: 38px; }

.header__search-btn {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    bottom: 4px;
    width: 42px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--rose-bright), var(--rose-deep));
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 0;
    transition: filter var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.header__search-btn:hover { filter: brightness(1.1); }
.header__search-btn:active { transform: scale(0.94); }
.header__search:focus-within .header__search-btn { box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.5); }

.udd__trigger {
    transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
    border-radius: 999px;
}
.udd__trigger:active { transform: scale(0.95); }

.video-card {
    min-width: 0;
    transition: transform var(--t-med) var(--ease-out);
}
.video-card__info, .video-card__title { min-width: 0; max-width: 100%; }

.video-card__thumb {
    background: var(--bg-card);
    transition: box-shadow var(--t-med) var(--ease-out);
}
[data-theme="dark"] .video-card__thumb { background: #1d1530; }

.video-card__thumb::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 54px;
    height: 54px;
    transform: translate(-50%, -50%) scale(1);
    border-radius: 50%;
    z-index: 3;
    pointer-events: none;
    background: rgba(12, 9, 19, 0.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%23f0c071'/%3E%3C/svg%3E") center / 20px no-repeat;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(212, 164, 76, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity var(--t-med), transform var(--t-med) var(--ease-spring);
}
@media (hover: hover) {
    .video-card .video-card__thumb::after { opacity: 0; }
    .video-card:hover .video-card__thumb:not(.is-previewing)::after { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
    .video-card__thumb.is-previewing::after { opacity: 0 !important; }
}

.video-card__duration {
    z-index: 5;
    pointer-events: none;
    bottom: 7px;
    right: 7px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.video-card__thumb--noimg {
    background: #1d1530 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6282' stroke-width='1.3'%3E%3Crect x='3' y='5' width='18' height='14' rx='2.5'/%3E%3Cpath d='M10 9l5 3-5 3z' fill='%236f6282' stroke='none'/%3E%3C/svg%3E") center / 42px no-repeat;
}
.video-card__thumb--noimg::after { opacity: 0 !important; }

.video-card__preview, .video-card__sprite { z-index: 2; border-radius: var(--card-radius, 12px); }
.video-card__preview-progress { z-index: 6; height: 3px; background: linear-gradient(90deg, var(--gold), var(--rose)); box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.5); }

.video-card__info { padding: 9px 2px 4px; }
.video-card__title a { transition: color var(--t-fast); }
.video-card__title a:hover { color: var(--rose); }
[data-theme="dark"] .video-card__title a:hover { color: var(--rose-bright); }
.video-card__meta {
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.video-card__meta span:first-child { color: var(--text-muted); font-weight: 600; }
.video-card__meta span:last-child { color: var(--text-light); }

.section-title-row .section-title {
    position: relative;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
    padding-inline-start: 16px;
}
.section-title-row .section-title::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 4px;
    bottom: 4px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(to bottom, var(--gold-bright), var(--rose));
}
.section-more {
    transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.pagination__link {
    transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
@media (hover: hover) {
    .pagination__link:hover { transform: translateY(-1px); }
}
.pagination__link--active {
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.18);
}

.video-player {
    box-shadow: var(--shadow-pop);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gold-line);
}
.video-info__title { letter-spacing: 0.005em; }

.vote-btn, .btn-icon {
    transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.vote-btn:active, .btn-icon:active { transform: scale(0.96); }
.vote-btn.active.like {
    background: linear-gradient(135deg, var(--rose-bright), var(--rose-deep));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.35);
}

.recommended-more__btn {
    border-radius: 999px;
    transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
@media (hover: hover) {
    .recommended-more__btn:hover {
        background: var(--gold-soft);
        border-color: var(--gold);
        color: var(--gold);
        transform: translateY(-1px);
    }
    [data-theme="dark"] .recommended-more__btn:hover { color: var(--gold-bright); }
}

@media (hover: none) {
    .video-card__thumb::after { opacity: 0.45; }
}

@media (max-width: 768px) {
    .section-title-row .section-title { font-size: 18px; padding-inline-start: 12px; }
    .video-card__thumb::after { width: 44px; height: 44px; background-size: 17px; }
    .video-card__info { padding: 7px 2px 2px; }
    .video-card__title { font-size: 12.5px; }
    .header__search-btn { width: 38px; }
    .hn-hero__title { font-size: 26px; }
}

@media (max-width: 480px) {
    .video-card__thumb { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
    [data-theme="dark"] .video-card__thumb { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); }
}

@media (min-width: 1700px) {
    .video-card__info { padding: 11px 3px 5px; }
    .video-card__title { font-size: 14px; }
}

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