/* ============================================================
   UNHEARD STORY — Netflix-style streaming UI
   ============================================================ */

:root {
  --bg: #141414;
  --bg-raised: #181818;
  --bg-card: #2f2f2f;
  --red: #e50914;
  --red-dark: #b20710;
  --text: #ffffff;
  --text-dim: #b3b3b3;
  --text-faint: #808080;
  --font-display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nav-h: 68px;
  --pad-x: 4vw;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; }
button { font-family: inherit; cursor: pointer; border: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--red); color: #fff; }

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 0; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #4d4d4d; border-radius: 6px; }

/* ============================================================
   INTRO SPLASH (ta-dum)
   ============================================================ */
#intro {
  position: fixed; inset: 0; z-index: 1000;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  animation: intro-out .6s ease 2s forwards;
}
#intro .brand {
  font-family: var(--font-display);
  font-size: clamp(64px, 14vw, 190px);
  letter-spacing: .04em;
  color: var(--red);
  text-shadow: 0 0 60px rgba(229, 9, 20, .55);
  animation: intro-zoom 2.2s cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes intro-zoom {
  0%   { transform: scale(1.6); opacity: 0; filter: blur(8px); }
  18%  { opacity: 1; filter: blur(0); }
  70%  { transform: scale(1); }
  100% { transform: scale(.96); opacity: 1; }
}
@keyframes intro-out {
  to { opacity: 0; visibility: hidden; }
}
#intro.skip { display: none; }

/* ============================================================
   NAV
   ============================================================ */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 var(--pad-x);
  background: linear-gradient(180deg, rgba(0,0,0,.75) 0%, transparent 100%);
  transition: background-color .35s ease;
}
#nav.solid { background-color: var(--bg); }

.logo {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: .06em;
  color: var(--red);
  line-height: 1;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  user-select: none;
}
.logo .u-badge {
  width: 32px; height: 32px;
  background: var(--red);
  color: #fff;
  border-radius: 5px;
  display: grid; place-items: center;
  font-size: 24px;
  padding-top: 3px;
  box-shadow: 0 2px 12px rgba(229,9,20,.5);
}

.nav-links { display: flex; gap: 20px; list-style: none; }
.nav-links a {
  font-size: 13.5px; font-weight: 500; color: var(--text-dim);
  transition: color .2s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: #fff; font-weight: 600; }

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

.search-box {
  display: flex; align-items: center;
  border: 1px solid transparent;
  background: transparent;
  transition: all .3s ease;
}
.search-box input {
  width: 0; opacity: 0;
  background: transparent; border: 0; outline: 0;
  color: #fff; font-size: 14px; font-family: var(--font-body);
  transition: all .3s ease;
}
.search-box.open {
  background: rgba(0,0,0,.85);
  border-color: #fff;
  padding: 6px 10px;
}
.search-box.open input { width: 210px; opacity: 1; margin-left: 8px; }
.icon-btn {
  background: none; color: #fff;
  display: grid; place-items: center;
  width: 28px; height: 28px;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }

.avatar {
  width: 32px; height: 32px; border-radius: 4px;
  background: linear-gradient(135deg, var(--red), #7a0a55);
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #fff;
  flex-shrink: 0;
}

/* ============================================================
   HERO
   ============================================================ */
#hero {
  position: relative;
  min-height: 92vh;
  display: flex; align-items: center;
  overflow: hidden;
}
.hero-backdrop {
  position: absolute; inset: -4%;
  background-size: cover; background-position: center 22%;
  filter: blur(34px) brightness(.52) saturate(1.25);
  transform: scale(1.12);
}
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(20,20,20,.92) 0%, rgba(20,20,20,.55) 42%, rgba(20,20,20,.15) 70%, rgba(20,20,20,0) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(20,20,20,0) 28%);
}
.hero-inner {
  position: relative; z-index: 2;
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 48px;
  padding: calc(var(--nav-h) + 24px) var(--pad-x) 64px;
}
.hero-copy { max-width: 620px; }

.hero-rank {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 700; letter-spacing: .02em;
  margin-bottom: 18px;
}
.hero-rank .badge {
  background: var(--red);
  font-family: var(--font-display);
  font-size: 15px; letter-spacing: .06em;
  padding: 3px 7px 1px; border-radius: 4px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 6.2vw, 96px);
  line-height: .96;
  letter-spacing: .015em;
  text-shadow: 0 4px 30px rgba(0,0,0,.6);
  margin-bottom: 18px;
  text-wrap: balance;
}
.hero-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 14.5px; font-weight: 600; color: var(--text-dim);
  margin-bottom: 16px;
}
.hero-meta .views { color: #46d369; font-weight: 700; }
.chip {
  border: 1px solid rgba(255,255,255,.4);
  font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 3px;
  color: var(--text-dim);
}
.hero-syn {
  font-size: clamp(15px, 1.25vw, 19px);
  line-height: 1.5; color: #e6e6e6;
  text-shadow: 0 1px 8px rgba(0,0,0,.7);
  max-width: 540px;
  margin-bottom: 28px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: clamp(15px, 1.1vw, 18px); font-weight: 700;
  padding: 11px 26px; border-radius: 5px;
  transition: background .2s, transform .15s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 22px; height: 22px; }
.btn-play { background: #fff; color: #000; }
.btn-play:hover { background: rgba(255,255,255,.78); }
.btn-info { background: rgba(109,109,110,.55); color: #fff; backdrop-filter: blur(4px); }
.btn-info:hover { background: rgba(109,109,110,.38); }

.hero-poster-wrap {
  flex-shrink: 0;
  perspective: 900px;
  display: block;
}
.hero-poster {
  width: clamp(220px, 21vw, 320px);
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.08);
  transform: rotateY(-7deg) rotateX(2deg);
  transition: transform .5s ease;
  cursor: pointer;
}
.hero-poster:hover { transform: rotateY(0) rotateX(0) scale(1.02); }

/* ============================================================
   ROWS
   ============================================================ */
#rows { position: relative; z-index: 3; margin-top: -60px; padding-bottom: 60px; }

.row { margin-bottom: 4vw; }
.row-title {
  font-size: clamp(17px, 1.5vw, 22px);
  font-weight: 700;
  padding: 0 var(--pad-x);
  margin-bottom: 12px;
  display: flex; align-items: baseline; gap: 10px;
}
.row-title .count { font-size: 12px; color: var(--text-faint); font-weight: 600; }

.row-outer { position: relative; }
.row-scroll {
  display: flex; gap: 8px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  padding: 6px var(--pad-x) 14px;
  scrollbar-width: none;
}
.row-scroll::-webkit-scrollbar { display: none; }

.row-arrow {
  position: absolute; top: 0; bottom: 14px; z-index: 30;
  width: calc(var(--pad-x) * 0.92);
  background: rgba(20,20,20,.55);
  color: #fff;
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity .25s;
}
.row-outer:hover .row-arrow { opacity: 1; }
.row-arrow:hover { background: rgba(20,20,20,.82); }
.row-arrow.left { left: 0; border-radius: 0 4px 4px 0; }
.row-arrow.right { right: 0; border-radius: 4px 0 0 4px; }
.row-arrow svg { width: 30px; height: 30px; stroke: #fff; stroke-width: 3; fill: none; }

/* ---------- poster cards (9:16 Shorts) ---------- */
.card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(138px, 12.5vw, 188px);
  aspect-ratio: 9 / 16;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s;
}
.card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.card:hover {
  transform: scale(1.13);
  z-index: 20;
  box-shadow: 0 16px 44px rgba(0,0,0,.7);
}
.card:hover img { transform: scale(1.04); }

.card-shade {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.88) 0%, rgba(0,0,0,.25) 38%, rgba(0,0,0,0) 60%);
  opacity: 0;
  transition: opacity .3s;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px;
}
.card:hover .card-shade { opacity: 1; }

.card-title {
  font-size: 12.5px; font-weight: 700; line-height: 1.25;
  margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-dim); font-weight: 600; }
.card-meta .views { color: #46d369; }
.card-actions { position: absolute; top: 9px; right: 9px; display: flex; gap: 6px; opacity: 0; transition: opacity .3s; }
.card:hover .card-actions { opacity: 1; }
.mini-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.6px solid rgba(255,255,255,.65);
  background: rgba(20,20,20,.6);
  color: #fff;
  display: grid; place-items: center;
  backdrop-filter: blur(3px);
  transition: border-color .2s, background .2s;
}
.mini-btn:hover { border-color: #fff; background: rgba(20,20,20,.85); }
.mini-btn svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2.4; fill: none; }
.mini-btn.in-list { background: #fff; color: #000; border-color: #fff; }

.short-tag {
  position: absolute; top: 9px; left: 9px;
  background: var(--red);
  font-size: 9.5px; font-weight: 800; letter-spacing: .08em;
  padding: 3px 6px; border-radius: 3px;
  text-transform: uppercase;
}

/* ---------- ranked row (Top 10) ---------- */
.rank-card {
  position: relative;
  flex: 0 0 auto;
  display: flex; align-items: flex-end;
  cursor: pointer;
  transition: transform .35s cubic-bezier(.2,.7,.3,1);
}
.rank-card:hover { transform: scale(1.08); z-index: 20; }
.rank-num {
  font-family: var(--font-display);
  font-size: clamp(120px, 13vw, 208px);
  line-height: .78;
  color: var(--bg);
  -webkit-text-stroke: 4px #595959;
  letter-spacing: -.05em;
  margin-right: -0.16em;
  user-select: none;
  transition: -webkit-text-stroke-color .3s;
}
.rank-card:hover .rank-num { -webkit-text-stroke-color: var(--red); }
.rank-poster {
  position: relative;
  width: clamp(118px, 10.2vw, 152px);
  aspect-ratio: 9 / 16;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 8px 26px rgba(0,0,0,.55);
}
.rank-poster img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- wide cards (long-form 16:9) ---------- */
.wide-card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(300px, 28vw, 420px);
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s;
}
.wide-card:hover { transform: scale(1.07); z-index: 20; box-shadow: 0 16px 44px rgba(0,0,0,.7); }
.wide-card img { width: 100%; height: 100%; object-fit: cover; }
.wide-card .card-shade { opacity: 1; background: linear-gradient(0deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,0) 52%); }
.wide-card .card-title { font-size: 15px; -webkit-line-clamp: 2; }

/* ---------- coming soon cards ---------- */
.soon-card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(138px, 12.5vw, 188px);
  aspect-ratio: 9 / 16;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 14px 12px;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s;
  /* hue set inline via --h */
  background:
    radial-gradient(120% 90% at 80% -10%, hsl(var(--h) 80% 38% / .95), transparent 60%),
    radial-gradient(130% 100% at 10% 110%, hsl(calc(var(--h) + 40) 70% 22% / .9), transparent 65%),
    linear-gradient(160deg, hsl(var(--h) 45% 14%), #0b0b0b 75%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}
.soon-card:hover { transform: scale(1.13); z-index: 20; box-shadow: 0 16px 44px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.14); }
.soon-ribbon {
  align-self: flex-start;
  background: rgba(0,0,0,.5);
  border: 1px solid hsl(var(--h) 90% 60% / .8);
  color: hsl(var(--h) 95% 78%);
  font-size: 9px; font-weight: 800; letter-spacing: .14em;
  padding: 3px 7px; border-radius: 3px;
  text-transform: uppercase;
  backdrop-filter: blur(2px);
}
.soon-body .soon-emoji { font-size: 30px; margin-bottom: 8px; }
.soon-body .soon-title {
  font-family: var(--font-display);
  font-size: clamp(19px, 1.7vw, 25px);
  line-height: 1.02; letter-spacing: .03em;
  text-shadow: 0 2px 14px rgba(0,0,0,.6);
}
.soon-body .soon-tag { margin-top: 8px; font-size: 10.5px; font-weight: 700; color: rgba(255,255,255,.75); letter-spacing: .05em; text-transform: uppercase; }

/* ============================================================
   MODAL
   ============================================================ */
#modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(3px);
  display: none;
  align-items: flex-start; justify-content: center;
  overflow-y: auto;
  padding: 4vh 16px;
}
#modal-overlay.open { display: flex; animation: fade-in .25s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

#modal {
  position: relative;
  background: var(--bg-raised);
  border-radius: 10px;
  max-width: 980px; width: 100%;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.8);
  animation: modal-up .3s cubic-bezier(.2,.7,.3,1);
}
@keyframes modal-up { from { transform: translateY(26px) scale(.98); opacity: .4; } to { transform: none; opacity: 1; } }

.modal-grid { display: grid; grid-template-columns: 352px 1fr; }
.modal-grid.wide-mode { grid-template-columns: 1fr; }

.modal-player {
  background: #000;
  aspect-ratio: 9 / 16;
  position: relative;
}
.modal-grid.wide-mode .modal-player { aspect-ratio: 16 / 9; }
.modal-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.modal-info { padding: 30px 32px; display: flex; flex-direction: column; min-width: 0; }
.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-raised); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.6);
}
.modal-close svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 2.5; fill: none; }

.modal-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: .98; letter-spacing: .02em;
  margin-bottom: 14px;
  text-wrap: balance;
}
.modal-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 16px; }
.modal-meta .views { color: #46d369; font-weight: 700; }
.modal-syn { font-size: 15px; line-height: 1.6; color: #ddd; margin-bottom: 20px; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tag-chip {
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.13);
  font-size: 11.5px; font-weight: 600; color: var(--text-dim);
  padding: 4px 11px; border-radius: 999px;
}
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.btn-yt { background: var(--red); color: #fff; }
.btn-yt:hover { background: var(--red-dark); }
.btn-list { background: rgba(109,109,110,.4); color: #fff; }
.btn-list:hover { background: rgba(109,109,110,.6); }

.more-like {
  grid-column: 1 / -1;
  padding: 6px 32px 30px;
}
.more-like h3 { font-size: 17px; margin-bottom: 14px; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.more-card {
  position: relative; aspect-ratio: 9/16; border-radius: 5px; overflow: hidden;
  cursor: pointer; background: var(--bg-card);
  transition: transform .25s;
}
.more-card:hover { transform: scale(1.06); }
.more-card img { width: 100%; height: 100%; object-fit: cover; }
.more-card span {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 8px 7px;
  background: linear-gradient(0deg, rgba(0,0,0,.92), transparent);
  font-size: 10.5px; font-weight: 700; line-height: 1.2;
}

/* ============================================================
   SEARCH RESULTS OVERLAY
   ============================================================ */
#search-results {
  display: none;
  padding: calc(var(--nav-h) + 30px) var(--pad-x) 80px;
  min-height: 100vh;
}
#search-results.open { display: block; }
#search-results h2 { font-size: 20px; color: var(--text-dim); font-weight: 500; margin-bottom: 24px; }
#search-results h2 b { color: #fff; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.results-grid .card { width: 100%; }
.no-results { color: var(--text-faint); font-size: 15px; line-height: 1.7; }

body.searching #hero, body.searching #rows { display: none; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  padding: 50px var(--pad-x) 40px;
  color: var(--text-faint);
  font-size: 13px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.foot-brand { font-family: var(--font-display); font-size: 22px; color: var(--red); letter-spacing: .05em; margin-bottom: 10px; }
.foot-tag { margin-bottom: 18px; color: var(--text-dim); }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 18px; }
.foot-links a:hover { color: #fff; text-decoration: underline; }
.foot-note { font-size: 11.5px; line-height: 1.6; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .modal-grid { grid-template-columns: 330px 1fr; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hero-poster-wrap { display: none; }
  .hero-copy { max-width: 100%; }
  #hero { min-height: 78vh; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-player { aspect-ratio: 9 / 16; max-height: 64vh; }
  .modal-player iframe { height: 100%; }
  .more-like { padding: 6px 22px 24px; }
  .modal-info { padding: 24px 22px; }
}
@media (max-width: 480px) {
  :root { --pad-x: 16px; }
  .search-box.open input { width: 130px; }
  .rank-num { font-size: 96px; -webkit-text-stroke-width: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; transition-duration: .01s !important; }
}
