/* =========================================================
   Pornri — fast tube theme, light + dark
   ========================================================= */
:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-soft: #efefea;
  --ink: #111111;
  --muted: #65655f;
  --faint: #969690;
  --line: #deded6;
  --line-strong: #c8c8be;
  --header: #101010;
  --header-fg: #f7f7f4;
  --header-muted: #a5a5a0;
  --accent: #f5c518;
  --accent-ink: #111111;
  --accent-soft: #fff6d6;
  --radius: 10px;
  --header-h: 64px;
  --container: 1400px;
  --shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 14px 34px rgba(17, 17, 17, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0f;
  --surface: #161618;
  --surface-soft: #1d1d20;
  --ink: #f5f5f2;
  --muted: #a4a4a0;
  --faint: #7b7b78;
  --line: #2a2a2e;
  --line-strong: #3c3c40;
  --header: #08080a;
  --header-fg: #f5f5f2;
  --header-muted: #92928e;
  --accent: #ffd84d;
  --accent-ink: #111111;
  --accent-soft: #3a3010;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 44px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .18s ease, color .18s ease;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.ic { display: inline-block; vertical-align: middle; flex: none; }
.site-main { min-height: 58vh; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 999; padding: 10px 16px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-weight: 700; transition: top .2s ease; }
.skip-link:focus { top: 16px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 7px; font-size: .8rem; font-weight: 700; line-height: 1; transition: all .16s ease; }
.btn .ic { width: 16px; height: 16px; }
.btn-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-accent:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.btn-block { width: 100%; }

/* header */
.site-header { position: sticky; top: 0; z-index: 60; background: var(--header); color: var(--header-fg); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.logo { display: inline-flex; align-items: center; gap: 9px; flex: none; }
.logo-mark { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-size: .95rem; font-weight: 900; line-height: 1; }
.logo-text { color: var(--header-fg); font-size: 1.16rem; font-weight: 800; letter-spacing: -.055em; line-height: 1; }
.main-nav { display: flex; align-items: center; gap: 22px; min-width: 0; }
.main-nav > a { position: relative; padding: 10px 0; color: var(--header-muted); font-size: .78rem; font-weight: 600; white-space: nowrap; transition: color .15s ease; }
.main-nav > a:hover, .main-nav > a.is-active { color: var(--header-fg); }
.main-nav > a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--accent); }
.header-custom-links { color: var(--header-muted); font-size: .75rem; white-space: nowrap; }
.header-custom-links a:hover { color: var(--accent); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.header-search { display: flex; align-items: center; gap: 7px; width: 250px; height: 36px; padding: 0 12px; border: 1px solid #323235; border-radius: 6px; background: #1a1a1d; transition: border-color .16s ease, box-shadow .16s ease; }
.header-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245, 197, 24, .12); }
.header-search .ic { width: 15px; height: 15px; color: var(--header-muted); }
.header-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--header-fg); font-size: .76rem; }
.header-search input::placeholder { color: var(--header-muted); }
.icon-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--header-muted); transition: color .15s ease, background .15s ease, border-color .15s ease; }
.icon-btn:hover { color: var(--header-fg); background: #222225; border-color: #343438; }
.mobile-search-btn, .mobile-menu-btn { display: none; }
.theme-icon { display: none; align-items: center; justify-content: center; }
.theme-icon-moon { display: inline-flex; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: inline-flex; }
.theme-toggle .ic { width: 18px; height: 18px; }

/* page lead */
.page-lead { padding: 34px 0 22px; border-bottom: 1px solid var(--line); }
.lead-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.lead-copy { min-width: 0; max-width: 780px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 10px; color: var(--faint); font-size: .63rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.page-lead h1 { font-size: clamp(1.9rem, 4vw, 3.3rem); line-height: 1; letter-spacing: -.06em; font-weight: 800; }
.page-lead p { max-width: 65ch; margin-top: 10px; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.lead-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; flex: none; }
.lead-count { color: var(--faint); font-size: .67rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.lead-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.section-latest { padding-top: 28px; padding-bottom: 44px; }

/* grid + cards */
.video-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 16px; }
.v-card { min-width: 0; }
.v-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: var(--surface-soft); }
.v-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, opacity .2s ease; }
.v-card:hover .v-thumb img { transform: scale(1.025); }
.v-shade { position: absolute; inset: 0; opacity: .45; background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .5) 100%); }
.v-duration { position: absolute; right: 7px; bottom: 7px; z-index: 2; padding: 3px 5px; border-radius: 4px; background: rgba(0, 0, 0, .84); color: #fff; font-size: .61rem; font-weight: 700; letter-spacing: .02em; }
.v-play { position: absolute; left: 50%; top: 50%; z-index: 2; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .94); color: #111; opacity: 0; transform: translate(-50%, -50%) scale(.85); transition: opacity .18s ease, transform .18s ease; }
.v-play .ic { width: 17px; height: 17px; margin-left: 2px; }
.v-card:hover .v-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.v-body { padding: 9px 1px 0; }
.v-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .87rem; line-height: 1.4; font-weight: 600; letter-spacing: -.012em; }
.v-title a:hover { color: var(--accent); }
.v-meta { display: flex; align-items: center; gap: 6px; min-height: 15px; margin-top: 5px; color: var(--faint); font-size: .64rem; }
.v-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.v-meta .ic { width: 12px; height: 12px; }
.v-badge { margin-left: auto; padding: 2px 5px; border-radius: 3px; background: var(--accent); color: var(--accent-ink); font-size: .6rem; font-weight: 800; }

/* section heads */
.section { padding: 32px 0; }
.section-first { padding-top: 10px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { font-size: clamp(1.2rem, 2.1vw, 1.6rem); line-height: 1; letter-spacing: -.045em; font-weight: 800; }
.section-link { display: inline-flex; align-items: center; gap: 5px; flex: none; color: var(--muted); font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.section-link .ic { width: 14px; height: 14px; }
.section-link:hover { color: var(--accent); }
.section-tags { padding-top: 30px; padding-bottom: 42px; border-top: 1px solid var(--line); }

/* tags */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-chip { display: inline-flex; align-items: center; padding: 8px 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); font-size: .73rem; font-weight: 500; transition: all .14s ease; }
.tag-chip:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
html[data-theme="dark"] .tag-chip:hover { color: var(--accent); }
.tag-cloud-small { gap: 5px; }
.tag-cloud-small .tag-chip { padding: 6px 9px; font-size: .68rem; }

/* categories */
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.cat-card { display: flex; flex-direction: column; min-height: 94px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); transition: border-color .15s ease, transform .15s ease; }
.cat-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.cat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: auto; }
.cat-icon { display: inline-flex; width: 27px; height: 27px; align-items: center; justify-content: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); }
html[data-theme="dark"] .cat-icon { color: var(--accent); }
.cat-icon .ic { width: 14px; height: 14px; }
.cat-arrow { color: var(--faint); }
.cat-arrow .ic { width: 14px; height: 14px; }
.cat-name { margin-top: 12px; font-size: .84rem; font-weight: 700; letter-spacing: -.02em; }
.cat-count { margin-top: 2px; color: var(--faint); font-size: .64rem; }
.cat-desc { margin-top: 6px; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.cat-grid-large .cat-card { min-height: 130px; }

/* listing / category */
.category-banner { max-width: 840px; padding: 30px 0 18px; border-bottom: 1px solid var(--line); }
.category-banner .eyebrow { margin-bottom: 8px; }
.category-banner h1 { font-size: clamp(1.9rem, 4.5vw, 3.4rem); line-height: 1; letter-spacing: -.06em; }
.category-banner p { max-width: 65ch; margin-top: 10px; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.category-count { display: inline-block; margin-top: 10px; color: var(--faint); font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.listing-banner { max-width: none; padding-bottom: 22px; }
.listing-banner h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
.top-rated-page .v-badge { background: var(--accent); color: var(--accent-ink); }
.page-intro { padding-top: 28px; padding-bottom: 2px; }
.page-intro h1 { margin-top: 10px; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1; letter-spacing: -.055em; }
.page-intro-count { margin-left: 8px; color: var(--faint); font-size: .72rem; font-weight: 500; letter-spacing: 0; }

/* breadcrumbs / pagination */
.breadcrumbs { padding: 18px 0 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--faint); font-size: .64rem; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; color: var(--line-strong); }
.breadcrumbs a:hover { color: var(--accent); }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; margin-top: 32px; }
.page-btn { min-width: 34px; height: 34px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: .72rem; font-weight: 700; transition: all .14s ease; }
.page-btn:hover { border-color: var(--ink); color: var(--ink); }
.page-btn.is-current { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.page-btn.is-disabled { opacity: .35; pointer-events: none; }
.page-arrow .ic { width: 15px; height: 15px; }
.page-ellipsis { padding: 0 4px; color: var(--faint); }

/* video page */
.video-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; gap: 34px; padding-top: 6px; padding-bottom: 48px; }
.video-main { min-width: 0; }
.player-shell { margin-top: 14px; overflow: hidden; border-radius: 9px; background: #000; box-shadow: var(--shadow); }
.player { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-details { margin-top: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.video-title { font-size: clamp(1.25rem, 2.2vw, 1.7rem); line-height: 1.2; letter-spacing: -.04em; }
.video-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 14px; margin-top: 10px; color: var(--muted); font-size: .7rem; }
.video-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.video-meta .ic { width: 13px; height: 13px; }
.meta-rating { color: var(--accent-ink) !important; font-weight: 700; }
html[data-theme="dark"] .meta-rating { color: var(--accent) !important; }
.video-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rating { display: flex; align-items: center; gap: 6px; }
.rate-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); transition: all .14s ease; }
.rate-btn:hover { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.rate-btn .ic { width: 15px; height: 15px; }
.rating-info { display: flex; align-items: baseline; gap: 5px; margin-left: 2px; }
.rating-info strong { font-size: .98rem; }
.rating-info span { color: var(--faint); font-size: .64rem; }
.rating.is-loading { opacity: .55; pointer-events: none; }
.video-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.action-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: .68rem; font-weight: 600; }
.action-btn:hover { border-color: var(--ink); color: var(--ink); }
.action-btn .ic { width: 13px; height: 13px; }
.video-taxonomy { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; padding-top: 14px; }
.video-cats { color: var(--muted); font-size: .72rem; }
.video-cats .label { margin-right: 5px; color: var(--faint); font-size: .6rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.video-cats a { text-decoration: underline; text-underline-offset: 3px; }
.video-cats a:hover { color: var(--accent); }
.video-description { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.desc-content { max-height: 5.6em; overflow: hidden; color: var(--muted); font-size: .82rem; line-height: 1.65; overflow-wrap: anywhere; }
.video-description.is-open .desc-content { max-height: none; }
.readmore-btn { display: none; margin-top: 7px; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: .68rem; font-weight: 700; }
.readmore-btn.is-visible { display: inline-flex; align-items: center; gap: 3px; }
.readmore-btn .ic { width: 12px; height: 12px; }
.video-description.is-open .readmore-btn .ic { transform: rotate(-90deg); }
.video-sidebar { min-width: 0; }
.side-card { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.side-head h2 { font-size: .86rem; letter-spacing: -.02em; }
.side-head a { color: var(--faint); font-size: .6rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.side-list { display: flex; flex-direction: column; gap: 2px; }
.side-video { display: flex; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.side-video:last-child { border-bottom: 0; }
.side-video img { width: 86px; height: 54px; flex: none; object-fit: cover; border-radius: 5px; background: var(--surface-soft); }
.side-video-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.side-video-info strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .71rem; line-height: 1.35; font-weight: 600; }
.side-video-info small { color: var(--faint); font-size: .61rem; }
.side-video:hover strong { color: var(--accent); }
.side-cta { background: var(--header); border-color: var(--header); color: var(--header-fg); }
.side-cta-icon { display: inline-flex; margin-bottom: 7px; color: var(--accent); }
.side-cta h2 { font-size: 1rem; letter-spacing: -.03em; }
.side-cta p { margin-top: 4px; color: var(--header-muted); font-size: .72rem; line-height: 1.45; }
.side-cta .btn { margin-top: 12px; background: var(--accent); color: var(--accent-ink); }
.side-cta .btn:hover { background: var(--header-fg); color: var(--header); }

/* tag page */
.tag-hero { margin-top: 12px; padding: 20px 0 6px; }
.tag-hero h1 { font-size: clamp(1.8rem, 4.2vw, 3.3rem); line-height: 1; letter-spacing: -.055em; }
.tag-hero p { margin-top: 8px; color: var(--muted); font-size: .84rem; }
.player-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 1px; font-size: .76rem; }
.player-caption a { font-weight: 600; }
.player-caption a:hover { color: var(--accent); }
.player-caption span { flex: none; color: var(--faint); font-size: .65rem; }

/* prose / error */
.page-layout { max-width: 860px; padding-top: 20px; padding-bottom: 52px; }
.prose { margin-top: 12px; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.prose h1 { margin-bottom: 16px; font-size: clamp(1.7rem, 3.6vw, 2.8rem); line-height: 1; letter-spacing: -.05em; }
.prose h2, .prose h3 { margin: 22px 0 8px; letter-spacing: -.025em; }
.prose p, .prose li { color: var(--muted); font-size: .84rem; line-height: 1.7; }
.prose p + p { margin-top: 10px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
html[data-theme="light"] .prose a { color: #a47e00; }
.prose ul, .prose ol { margin: 10px 0; padding-left: 18px; list-style: disc; }
.prose ol { list-style: decimal; }
.error-layout { display: flex; align-items: center; justify-content: center; padding-top: 46px; padding-bottom: 46px; }
.error-card { width: 100%; max-width: 560px; padding: 28px; text-align: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.error-code { display: block; color: var(--accent); font-size: .68rem; font-weight: 800; letter-spacing: .16em; }
.error-card h1 { margin-top: 6px; font-size: clamp(1.8rem, 4.5vw, 3rem); line-height: 1; letter-spacing: -.055em; }
.error-card p { max-width: 42ch; margin: 10px auto 18px; color: var(--muted); font-size: .84rem; }
.inline-search { display: flex; align-items: center; gap: 6px; max-width: 400px; margin: 0 auto 14px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.inline-search .ic { color: var(--faint); }
.inline-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .76rem; }
.inline-search .btn { min-height: 32px; padding: 0 11px; font-size: .66rem; }

/* empty */
.empty-state { padding: 42px 20px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 8px; }
.empty-icon { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; margin-bottom: 12px; border-radius: 50%; background: var(--surface); }
.empty-state h2 { font-size: 1.25rem; letter-spacing: -.03em; }
.empty-state p { max-width: 420px; margin: 6px auto 16px; color: var(--muted); font-size: .82rem; }
.empty-state.compact { padding: 24px 16px; text-align: left; }

/* footer */
.site-footer { margin-top: 44px; padding: 40px 0 20px; background: var(--header); color: var(--header-fg); border-top: 3px solid var(--accent); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 30px; }
.footer-brand p { max-width: 38ch; margin-top: 10px; color: var(--header-muted); font-size: .75rem; line-height: 1.55; }
.footer-badge { display: inline-block; margin-top: 12px; padding: 3px 7px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 3px; color: var(--header-fg); font-size: .62rem; font-weight: 700; letter-spacing: .06em; }
.footer-links { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.footer-title { margin-bottom: 2px; color: var(--header-muted); font-size: .6rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.footer-links a { color: var(--header-muted); font-size: .73rem; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; margin-top: 30px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); color: var(--header-muted); font-size: .62rem; line-height: 1.5; }
.to-top { position: fixed; right: 16px; bottom: 18px; z-index: 45; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(6px); transition: all .18s ease; }
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.bottom-nav { display: none; }

/* search overlay / drawer */
.search-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 18px 18px; background: rgba(0, 0, 0, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.search-overlay[hidden] { display: none; }
.search-overlay-inner { position: relative; width: 100%; max-width: 650px; padding: 30px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.search-close { position: absolute; right: 8px; top: 8px; color: var(--muted); }
.search-eyebrow { margin-bottom: 10px; color: var(--faint); font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.search-overlay form { display: flex; gap: 6px; }
.search-overlay input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; outline: 0; background: var(--bg); color: var(--ink); font-size: .84rem; }
.search-overlay input:focus { border-color: var(--accent); }
.drawer-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .5); }
.drawer-overlay[hidden] { display: none; }
.mobile-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 95; width: min(360px, 88vw); padding: 16px; overflow-y: auto; background: var(--bg); color: var(--ink); transform: translateX(102%); transition: transform .26s ease; }
.mobile-drawer.is-open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.drawer-head .icon-btn { color: var(--muted); }
.drawer-nav { display: flex; flex-direction: column; padding-top: 6px; }
.drawer-nav > a { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: .98rem; font-weight: 700; letter-spacing: -.02em; }
.drawer-nav > a span { color: var(--faint); font-size: .62rem; font-weight: 500; }
.drawer-nav > a:hover { color: var(--accent); }
.drawer-custom { padding-top: 12px; color: var(--muted); font-size: .76rem; }
.drawer-cats { padding-top: 16px; }
.drawer-label { display: block; margin-bottom: 8px; color: var(--faint); font-size: .6rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.drawer-cats a { display: inline-block; margin: 0 5px 5px 0; padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); font-size: .68rem; }
.drawer-cats a:hover { border-color: var(--accent); }
.drawer-foot { padding-top: 16px; }

/* responsive */
@media (max-width: 1180px) {
  .main-nav { gap: 16px; }
  .header-search { width: 200px; }
  .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .video-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; }
}
@media (max-width: 1000px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: inline-flex; }
  .video-layout { grid-template-columns: 1fr; }
  .video-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .side-card { margin-top: 0; }
}
@media (max-width: 760px) {
  :root { --header-h: 58px; }
  .container { padding-left: 14px; padding-right: 14px; }
  .header-search { display: none; }
  .mobile-search-btn { display: inline-flex; }
  .page-lead { padding: 24px 0 18px; }
  .lead-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .lead-side { align-items: flex-start; width: 100%; }
  .lead-actions { justify-content: flex-start; }
  .page-lead h1 { font-size: clamp(1.7rem, 7vw, 2.6rem); }
  .page-lead p { font-size: .8rem; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 9px; }
  .v-title { font-size: .78rem; }
  .v-meta { font-size: .58rem; }
  .v-duration { font-size: .57rem; padding: 2px 4px; }
  .section { padding: 25px 0; }
  .section-head h2 { font-size: 1.15rem; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-card { min-height: 84px; padding: 11px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 6px; margin-top: 24px; }
  .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: flex; height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: var(--surface); }
  .bottom-nav a, .bottom-nav button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: transparent; color: var(--faint); font-size: .58rem; font-weight: 600; }
  .bottom-nav .ic { width: 18px; height: 18px; }
  .bottom-nav .is-active { color: var(--ink); }
  html[data-theme="dark"] .bottom-nav .is-active { color: var(--accent); }
  .site-main { padding-bottom: 58px; }
  .to-top { bottom: 68px; right: 10px; width: 34px; height: 34px; }
  .search-overlay { padding-top: 8vh; }
  .search-overlay-inner { padding: 22px 14px 16px; }
  .search-overlay form { flex-direction: column; }
  .video-details { padding: 14px; }
  .video-sidebar { grid-template-columns: 1fr; }
  .prose { padding: 16px; }
  .error-card { padding: 22px 14px; }
}
@media (max-width: 440px) {
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v-title { font-size: .74rem; }
  .v-meta { font-size: .56rem; }
  .page-lead h1 { font-size: 1.65rem; }
  .lead-actions .btn { min-height: 36px; padding: 0 12px; font-size: .7rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { font-size: .57rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
