/* Cravia — public frontend
   Brand: Netflix-style, dark cinematic, one red accent.
   Canvas pure black, Cravia Red #C1121F only chromatic accent.
   No shadows anywhere — depth from surface tones only. */

:root {
  --red: #C1121F;
  --red-hover: #9E0E1A;
  --black: #000000;
  --obsidian: #0F0F0F;
  --carbon: #232323;
  --charcoal: #2D2D2D;
  --slate: #393939;
  --ash: #5A5A5A;
  --steel: #808080;
  --fog: #B3B3B3;
  --white: #FFFFFF;
  --wine: #6B1D3A;
  --max-w: 1200px;
  --radius-card: 8px;
  --radius-tile: 16px;
  --radius-input: 4px;
  --gap: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--fog);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

::selection { background: var(--red); color: var(--white); }

/* ---------- Layout ---------- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 16px; }
.section { margin-top: 48px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.section-head h2 { color: var(--white); font-size: 24px; font-weight: 700; line-height: 1.2; }
.section-head .more { color: var(--steel); font-size: 14px; font-weight: 500; }
.section-head .more:hover { color: var(--white); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--obsidian);
  border-bottom: 1px solid var(--carbon);
}
.header-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 16px;
  height: 60px; display: flex; align-items: center; gap: 24px;
}
.brand {
  color: var(--red); font-size: 26px; font-weight: 900;
  letter-spacing: -0.03em; line-height: 1; flex-shrink: 0;
}
.brand:hover { color: var(--red); }
.main-nav { display: flex; gap: 4px; }
.main-nav a {
  color: var(--fog); font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: var(--radius-card);
}
.main-nav a:hover { color: var(--white); background: var(--carbon); }
.main-nav a.active { color: var(--white); background: var(--carbon); }
.header-search { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-search input {
  width: 220px; background: var(--charcoal); color: var(--white);
  border: 1px solid var(--slate); border-radius: var(--radius-input);
  padding: 8px 12px; font-size: 14px; outline: none;
}
.header-search input::placeholder { color: var(--steel); }
.header-search input:focus { border-color: var(--red); }
.header-search button {
  background: var(--carbon); color: var(--white); border: 1px solid var(--slate);
  border-radius: var(--radius-input); padding: 8px 14px; font-size: 14px; font-weight: 500;
}
.header-search button:hover { background: var(--slate); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--red); color: var(--white); border: none;
  font-size: 16px; font-weight: 500; padding: 12px 24px; border-radius: var(--radius-card);
}
.btn:hover { background: var(--red-hover); }
.btn-secondary { background: var(--carbon); color: var(--white); }
.btn-secondary:hover { background: var(--slate); }
.btn-sm { font-size: 14px; padding: 8px 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ---------- Hero / feature card ---------- */
.hero {
  position: relative; border-radius: var(--radius-tile); overflow: hidden;
  min-height: 440px; margin-top: 24px; background: var(--obsidian);
  display: flex; align-items: flex-end;
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 85% 20%, rgba(107, 29, 58, 0.55), transparent 60%),
    linear-gradient(90deg, rgba(0,0,0,0.96) 0%, rgba(0,0,0,0.72) 45%, rgba(0,0,0,0.15) 100%),
    linear-gradient(0deg, rgba(0,0,0,0.9) 0%, transparent 55%);
}
.hero-content { position: relative; z-index: 2; padding: 32px; max-width: 620px; }
.hero-kicker {
  color: var(--red); font-size: 12px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px;
}
.hero-content h1 {
  color: var(--white); font-size: 56px; font-weight: 900;
  line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 12px;
}
.hero-content p {
  color: var(--fog); font-size: 16px; line-height: 1.5; margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-meta { display: flex; align-items: center; gap: 12px; color: var(--steel); font-size: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.hero-meta .cat { color: var(--white); background: var(--carbon); padding: 4px 10px; border-radius: var(--radius-card); font-weight: 500; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Category chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; background: var(--carbon); color: var(--fog);
  border: none; font-size: 14px; font-weight: 500;
  padding: 8px 16px; border-radius: var(--radius-card);
}
.chip:hover { background: var(--slate); color: var(--white); }
.chip.active { background: var(--red); color: var(--white); }

/* ---------- Video grid & cards ---------- */
.video-grid {
  display: grid; gap: 20px 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.video-card { min-width: 0; }
.video-card .thumb {
  position: relative; display: block; aspect-ratio: 16 / 9;
  background: var(--carbon); border-radius: var(--radius-card);
  overflow: hidden; border: 1px solid transparent;
}
.video-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-card:hover .thumb { border-color: var(--red); }
.video-card .duration {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0, 0, 0, 0.85); color: var(--white);
  font-size: 12px; font-weight: 500; padding: 2px 6px; border-radius: var(--radius-input);
}
.video-card h3 {
  margin-top: 8px; color: var(--white); font-size: 14px; font-weight: 500;
  line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.video-card h3 a:hover { color: var(--red); }
.video-card .meta-line { color: var(--steel); font-size: 12px; margin-top: 2px; }

/* ---------- Trending row (Top 10) ---------- */
.trend-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.trend-row::-webkit-scrollbar { display: none; }
.trend-item { flex-shrink: 0; display: flex; align-items: flex-end; width: 300px; }
.trend-rank {
  color: var(--white); font-size: 100px; font-weight: 900; line-height: 0.75;
  letter-spacing: -0.06em; margin-right: -14px; z-index: 2;
  -webkit-text-stroke: 2px var(--black);
  paint-order: stroke fill;
}
.trend-item .thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  background: var(--carbon); border-radius: var(--radius-card); overflow: hidden;
  border: 1px solid transparent;
}
.trend-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.trend-item:hover .thumb { border-color: var(--red); }
.trend-item .duration {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0, 0, 0, 0.85); color: var(--white);
  font-size: 12px; font-weight: 500; padding: 2px 6px; border-radius: var(--radius-input);
}
.trend-item .trend-title {
  margin-top: 8px; color: var(--white); font-size: 14px; font-weight: 500;
  line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Ad slots (clearly separated, never inside cards) ---------- */
.ad-slot {
  background: var(--obsidian); border: 1px solid var(--carbon);
  border-radius: var(--radius-card); margin-top: 48px;
  padding: 16px; text-align: center; min-height: 110px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.ad-slot .ad-label {
  color: var(--ash); font-size: 10px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.ad-slot .ad-body { color: var(--steel); font-size: 14px; }
.ad-slot.ad-tall { min-height: 250px; }

/* ---------- Toolbar (sort / count) ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 16px; flex-wrap: wrap; }
.toolbar .count { color: var(--steel); font-size: 14px; }
.toolbar select {
  background: var(--charcoal); color: var(--white); border: 1px solid var(--slate);
  border-radius: var(--radius-input); padding: 8px 12px; font-size: 14px; outline: none;
}
.toolbar select:focus { border-color: var(--red); }

/* ---------- Pagination / load more ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 32px 0 8px; }
.pager button {
  background: var(--carbon); color: var(--white); border: 1px solid var(--slate);
  border-radius: var(--radius-card); padding: 8px 14px; font-size: 14px; font-weight: 500;
}
.pager button:hover:not(:disabled) { background: var(--slate); }
.pager button:disabled { opacity: 0.4; cursor: default; }
.pager .page-info { color: var(--steel); font-size: 14px; padding: 0 8px; }
.load-more-wrap { text-align: center; margin: 32px 0 8px; }

/* ---------- Video detail page ---------- */
.player-wrap {
  margin-top: 24px; aspect-ratio: 16 / 9; background: var(--black);
  border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--carbon);
}
.player-wrap video { width: 100%; height: 100%; display: block; background: var(--black); }
.player-fallback {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; color: var(--steel);
  background: var(--obsidian); text-align: center; padding: 24px;
}
.video-title { color: var(--white); font-size: 24px; font-weight: 700; line-height: 1.3; margin-top: 20px; }
.video-stats { display: flex; align-items: center; gap: 16px; color: var(--steel); font-size: 14px; margin-top: 8px; flex-wrap: wrap; }
.video-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.like-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--carbon); color: var(--white); border: 1px solid var(--slate); border-radius: var(--radius-card); padding: 8px 16px; font-size: 14px; font-weight: 500; }
.like-btn:hover { background: var(--slate); }
.like-btn.liked { background: var(--red); border-color: var(--red); }
.video-desc { color: var(--fog); font-size: 14px; line-height: 1.6; margin-top: 16px; white-space: pre-wrap; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.tag {
  background: var(--carbon); color: var(--fog); font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: var(--radius-card); border: none;
}
.tag:hover { background: var(--slate); color: var(--white); }
.cat-link { color: var(--red); font-weight: 500; }
.cat-link:hover { text-decoration: underline; }

/* ---------- Age gate ---------- */
.age-gate {
  position: fixed; inset: 0; z-index: 1000; background: var(--black);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.age-gate.hidden { display: none; }
.age-gate-inner { max-width: 480px; text-align: center; }
.age-gate .brand { font-size: 32px; display: block; margin-bottom: 8px; }
.age-gate .big-18 {
  color: var(--white); font-size: 100px; font-weight: 900; line-height: 1;
  letter-spacing: -0.02em; margin: 8px 0;
}
.age-gate p { color: var(--fog); font-size: 16px; line-height: 1.5; margin-bottom: 24px; }
.age-gate .gate-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.age-gate .gate-note { margin-top: 20px; color: var(--ash); font-size: 12px; }

/* ---------- Empty / loading states ---------- */
.empty-state { text-align: center; padding: 64px 16px; color: var(--steel); }
.empty-state h3 { color: var(--white); font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 420px; margin: 0 auto; }
.skeleton { background: var(--carbon); border-radius: var(--radius-card); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.skel-card .skel-thumb { aspect-ratio: 16 / 9; }
.skel-card .skel-line { height: 12px; margin-top: 8px; width: 80%; }
.skel-card .skel-line.short { width: 55%; }
.error-note { color: var(--steel); font-size: 13px; text-align: center; padding: 12px 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--carbon); margin-top: 64px; padding: 32px 0 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-brand { color: var(--red); font-size: 20px; font-weight: 900; letter-spacing: -0.03em; }
.footer-tag { color: var(--steel); font-size: 14px; margin-top: 4px; }
.footer-links { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.footer-links a { color: var(--fog); font-size: 14px; }
.footer-links a:hover { color: var(--white); }
.footer-legal { color: var(--ash); font-size: 12px; margin-top: 24px; line-height: 1.6; }

/* ---------- Page headings ---------- */
.page-head { margin-top: 32px; }
.page-head h1 { color: var(--white); font-size: 24px; font-weight: 700; }
.page-head p { color: var(--steel); font-size: 14px; margin-top: 4px; }
.search-big { display: flex; gap: 8px; margin-top: 16px; }
.search-big input {
  flex: 1; background: var(--charcoal); color: var(--white);
  border: 1px solid var(--slate); border-radius: var(--radius-input);
  padding: 12px 16px; font-size: 16px; outline: none;
}
.search-big input::placeholder { color: var(--steel); }
.search-big input:focus { border-color: var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { min-height: 360px; }
  .hero-content h1 { font-size: 36px; }
  .hero-content { padding: 24px; }
  .header-search input { width: 150px; }
}
@media (max-width: 640px) {
  .main-nav { display: none; }
  .header-search { flex: 1; }
  .header-search input { flex: 1; width: auto; }
  .hero { min-height: 300px; border-radius: var(--radius-card); }
  .hero-content h1 { font-size: 28px; }
  .hero-content p { font-size: 14px; }
  .hero-content { padding: 20px; }
  .video-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 10px; }
  .section-head h2 { font-size: 20px; }
  .trend-item { width: 250px; }
  .trend-rank { font-size: 72px; }
  .age-gate .big-18 { font-size: 72px; }
  .video-title { font-size: 20px; }
}
