:root {
    color-scheme: dark;
    --bg: #090b12;
    --surface: #11151f;
    --surface-2: #181e2b;
    --text: #f4f6fb;
    --muted: #9ca7ba;
    --line: rgba(255, 255, 255, .09);
    --accent: #8b5cf6;
    --accent-2: #ec4899;
    --success: #34d399;
    --danger: #fb7185;
    --radius: 16px;
    --shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: #c4b5fd; }
button, input, textarea, select { font: inherit; }
button, .button { cursor: pointer; }
img, video { display: block; max-width: 100%; }
.container { width: min(1280px, calc(100% - 40px)); margin-inline: auto; }
.narrow { max-width: 820px; }
.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; }
.skip-link { position: fixed; z-index: 100; top: -80px; left: 20px; padding: 12px 18px; background: white; color: #111; border-radius: 8px; }
.skip-link:focus { top: 20px; }
:focus-visible { outline: 3px solid #c4b5fd; outline-offset: 3px; }

.site-header { position: sticky; top: 0; z-index: 30; background: rgba(9, 11, 18, .88); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.header-main { min-height: 78px; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.3rem; font-weight: 850; letter-spacing: -.04em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; padding-left: 2px; border-radius: 11px; color: white; font-size: .8rem; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 25px rgba(139, 92, 246, .35); }
.search-form { display: flex; max-width: 460px; margin-left: auto; flex: 1; }
.search-form input { width: 100%; min-width: 0; padding: 11px 16px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px 0 0 12px; }
.search-form button { padding: 0 18px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-left: 0; border-radius: 0 12px 12px 0; }
.menu-toggle { display: none; padding: 8px 13px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; }
.main-navigation { border-top: 1px solid var(--line); }
.main-navigation .container { display: flex; gap: 30px; }
.main-navigation a { position: relative; padding: 12px 0; color: var(--muted); font-size: .92rem; font-weight: 650; }
.main-navigation a:hover, .main-navigation a.active { color: var(--text); }
.main-navigation a.active::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

main { min-height: 60vh; padding-bottom: 64px; }
.page-heading { padding: 46px 0 28px; }
.page-heading h1, .video-page > h1 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.65rem); line-height: 1.15; letter-spacing: -.045em; }
.page-heading p { max-width: 700px; margin: 12px 0 0; color: var(--muted); }
.home-heading { position: relative; overflow: hidden; padding-block: 62px 40px; }
.home-heading::after { content: ""; position: absolute; z-index: -1; width: 400px; height: 200px; top: 0; right: 10%; background: var(--accent); filter: blur(130px); opacity: .12; }
.eyebrow { display: block; margin-bottom: 10px; color: #c4b5fd; font-size: .72rem; font-weight: 800; letter-spacing: .16em; }
.video-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 20px; }
.video-card { min-width: 0; }
.thumbnail { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 30px rgba(0, 0, 0, .15); }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, opacity .35s; }
.thumbnail:hover img { transform: scale(1.045); opacity: .8; }
.duration { position: absolute; right: 9px; bottom: 9px; padding: 3px 7px; border-radius: 6px; background: rgba(0, 0, 0, .78); color: white; font-size: .72rem; font-weight: 700; line-height: 1.4; }
.play-icon { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 48px; height: 48px; padding-left: 4px; border-radius: 50%; background: rgba(139, 92, 246, .9); color: white; opacity: 0; transform: translate(-50%, -40%); transition: .25s; }
.thumbnail:hover .play-icon { opacity: 1; transform: translate(-50%, -50%); }
.card-body { padding: 12px 3px 0; }
.card-body h2 { margin: 0; font-size: .98rem; line-height: 1.4; letter-spacing: -.015em; }
.card-body h2 a { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--text); }
.card-meta { display: flex; gap: 12px; margin-top: 7px; color: var(--muted); font-size: .77rem; }
.card-meta span + span::before { content: "•"; margin-right: 12px; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.pagination a, .pagination span { min-width: 40px; padding: 8px 12px; text-align: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: .88rem; }
.pagination .current { background: var(--accent); border-color: var(--accent); }
.empty-state { padding: 80px 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state > span:not(.error-code) { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.empty-state h1, .empty-state h2 { margin-bottom: 4px; }
.empty-state p { color: var(--muted); }
.error-code { display: block; color: var(--accent); font-size: 5rem; font-weight: 900; line-height: 1; }

.breadcrumbs { display: flex; gap: 10px; overflow: hidden; margin: 28px 0 18px; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.breadcrumbs span:last-child { overflow: hidden; text-overflow: ellipsis; }
.video-page > h1 { margin-bottom: 22px; }
.player-shell { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #030407; box-shadow: var(--shadow); }
.player-shell video { width: 100%; max-height: 75vh; aspect-ratio: 16 / 9; background: #030407; }
.player-error { margin: 0; padding: 12px 16px; color: var(--danger); font-size: .85rem; }
.video-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 2px; border-bottom: 1px solid var(--line); }
.video-stats { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: .85rem; }
.voting { display: flex; align-items: center; gap: 8px; }
.voting form { display: inline-flex; }
.vote-button { padding: 8px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.vote-button:hover, .vote-button.selected { border-color: var(--accent); background: rgba(139, 92, 246, .18); color: #ddd6fe; }
.rating { margin-left: 6px; color: var(--muted); font-size: .82rem; }
.video-description { max-width: 900px; padding: 25px 0; }
.video-description h2 { font-size: 1.05rem; }
.video-description p { margin: 0; color: #c0c8d6; white-space: normal; }
.recommendations { padding-top: 45px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.03em; }
.section-heading a, .section-heading > span { color: var(--muted); font-size: .85rem; }
.tag-page .page-heading { padding-bottom: 20px; }

.site-footer { padding-top: 35px; border-top: 1px solid var(--line); background: #07090e; }
.tagcloud-section { padding-bottom: 35px; border-bottom: 1px solid var(--line); }
.tagcloud-section h2 { margin: 0 0 16px; font-size: 1rem; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 9px; }
.tagcloud a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .78rem; transition: .2s; }
.tagcloud a:hover { border-color: var(--accent); background: rgba(139, 92, 246, .12); color: var(--text); transform: translateY(-1px); }
.footer-bottom { display: flex; justify-content: space-between; gap: 40px; padding-block: 36px; }
.footer-bottom p { margin: 10px 0 0; color: var(--muted); font-size: .8rem; }
.footer-bottom nav { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px 24px; color: var(--muted); font-size: .85rem; }
.copyright { padding: 15px 0 24px; color: #687386; font-size: .75rem; }

.notice { margin-top: 20px; padding: 14px 18px; border: 1px solid; border-radius: 12px; font-size: .9rem; }
.notice.success { border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .08); color: #a7f3d0; }
.notice.error { border-color: rgba(251, 113, 133, .35); background: rgba(251, 113, 133, .08); color: #fecdd3; }
.notice ul { margin-bottom: 0; }
.panel { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.form-stack { display: grid; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-stack label { display: grid; gap: 7px; color: #dce2ed; font-size: .85rem; font-weight: 650; }
.form-stack input, .form-stack textarea, .form-stack select { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: #0c1018; color: var(--text); }
.form-stack input:focus, .form-stack textarea:focus, .form-stack select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 92, 246, .15); }
.form-stack textarea { resize: vertical; }
.form-help { margin: -8px 0 0; color: var(--muted); font-size: .8rem; }
.button { display: inline-flex; justify-content: center; align-items: center; width: fit-content; padding: 11px 20px; border: 0; border-radius: 10px; background: linear-gradient(135deg, var(--accent), #7c3aed); color: white; font-weight: 750; }
.button:hover { color: white; filter: brightness(1.1); }
.honeypot { position: absolute; left: -10000px; }

@media (max-width: 1050px) {
    .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .container { width: min(100% - 28px, 1280px); }
    .header-main { min-height: 68px; flex-wrap: wrap; gap: 12px; padding-block: 12px; }
    .brand { font-size: 1.15rem; }
    .brand-mark { width: 31px; height: 31px; }
    .search-form { order: 3; max-width: none; flex-basis: 100%; }
    .menu-toggle { display: block; margin-left: auto; }
    .main-navigation { display: none; }
    .main-navigation.open { display: block; }
    .main-navigation .container { gap: 24px; overflow-x: auto; }
    .main-navigation a { flex: 0 0 auto; }
    .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 13px; }
    .page-heading { padding-top: 34px; }
    .home-heading { padding-block: 40px 28px; }
    .video-toolbar { align-items: flex-start; flex-direction: column; }
    .footer-bottom { flex-direction: column; gap: 25px; }
}
@media (max-width: 480px) {
    .container { width: min(100% - 24px, 1280px); }
    .video-grid { grid-template-columns: 1fr; }
    .thumbnail { border-radius: 13px; }
    .card-body h2 { font-size: 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .panel { padding: 20px; }
    .voting { flex-wrap: wrap; }
    .rating { width: 100%; margin: 3px 0 0; }
    .search-form button { padding-inline: 13px; }
    .main-navigation .container { gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
