/* ==========================================================================
   The Vault — private media library
   Palette: charcoal-navy ground, brass accent, quiet red for live/badges
   Type: Fraunces (display) + Inter (body/UI) + JetBrains Mono (meta/badges)
   Signature: film-perforation divider between sections
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg:        #0B0E14;
  --surface:   #141821;
  --surface-2: #1B2029;
  --line:      #262C38;
  --text:      #EDEEF0;
  --text-dim:  #8B93A1;
  --brass:     #C9A24B;
  --brass-dim: #8A7434;
  --red:       #B33A3A;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 16px 32px;
  background: rgba(11,14,20,0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.3px;
  color: var(--brass);
  white-space: nowrap;
}
.nav-links { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.nav-links a {
  font-size: 14px; color: var(--text-dim); font-weight: 500;
  transition: color .15s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.nav-search {
  flex: 1; max-width: 340px;
}
.nav-search input {
  width: 100%; padding: 9px 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text); font-family: var(--font-body);
  font-size: 14px;
}
.nav-search input:focus { outline: none; border-color: var(--brass-dim); }

.nav-user { display: flex; align-items: center; gap: 14px; }
.btn-ghost {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 13px; color: var(--text-dim);
}
.btn-ghost:hover { border-color: var(--brass-dim); color: var(--text); }

/* ---------- Perforation divider (signature element) ---------- */
.reel-divider {
  display: flex; align-items: center; gap: 6px;
  margin: 8px 32px 18px;
  opacity: 0.55;
}
.reel-divider span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brass-dim);
  flex-shrink: 0;
}
.reel-divider::after {
  content: '';
  flex: 1; height: 1px; background: var(--line);
}

/* ---------- Section ---------- */
.section { padding: 0 32px 40px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 21px; font-weight: 600;
  color: var(--text);
}
.section-title .count {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
  margin-left: 10px; font-weight: 500;
}
.section-more { font-size: 13px; color: var(--brass); }

/* ---------- Poster grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}
.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--brass-dim); }

.card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  background: var(--surface-2);
  overflow: hidden;
}
.card-poster img { width: 100%; height: 100%; object-fit: cover; }
.card-poster .no-art {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-dim); font-family: var(--font-display);
  font-size: 14px; text-align: center; padding: 10px;
}

.badge {
  position: absolute; top: 8px; padding: 3px 8px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  border-radius: 3px; letter-spacing: 0.4px;
  background: rgba(11,14,20,0.85); color: var(--brass);
  border: 1px solid var(--brass-dim);
}
.badge.left { left: 8px; }
.badge.right { right: 8px; background: rgba(179,58,58,0.9); color: #fff; border-color: var(--red); }
.badge.year { right: 8px; background: rgba(11,14,20,0.85); color: var(--text-dim); border-color: var(--line); }

.card-ep {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(201,162,75,0.95); color: #14171d;
  font-family: var(--font-mono); font-weight: 700; font-size: 11px;
  padding: 3px 7px; border-radius: 3px;
}

.card-body { padding: 10px 10px 12px; }
.card-title {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-meta {
  font-size: 11.5px; color: var(--text-dim); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Detail / Watch page ---------- */
.detail-hero {
  display: flex; gap: 32px; padding: 40px 32px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.detail-poster {
  width: 220px; aspect-ratio: 2/3; border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2); flex-shrink: 0;
  border: 1px solid var(--line);
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; min-width: 260px; }
.detail-title {
  font-family: var(--font-display); font-size: 32px; font-weight: 700;
  margin: 0 0 8px;
}
.detail-badges { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.detail-badges span {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 3px; border: 1px solid var(--line); color: var(--text-dim);
}
.detail-desc { color: var(--text-dim); font-size: 14.5px; max-width: 640px; line-height: 1.65; }

.player-wrap { padding: 24px 32px; }
.player-wrap video {
  width: 100%; max-height: 72vh; background: #000; border-radius: var(--radius);
  border: 1px solid var(--line);
}

.season-tabs { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 32px 8px; }
.season-tab {
  padding: 7px 14px; border-radius: var(--radius); border: 1px solid var(--line);
  font-size: 13px; color: var(--text-dim); font-weight: 600;
}
.season-tab.active { border-color: var(--brass); color: var(--brass); }

.ep-list { padding: 8px 32px 40px; display: flex; flex-direction: column; gap: 10px; }
.ep-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.ep-row:hover { border-color: var(--brass-dim); }
.ep-num {
  font-family: var(--font-mono); font-weight: 700; color: var(--brass);
  width: 34px; text-align: center; font-size: 14px;
}
.ep-title { font-weight: 600; font-size: 14px; }
.ep-desc { color: var(--text-dim); font-size: 12.5px; margin-top: 2px; }

/* ---------- Auth pages ---------- */
.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 36px 32px;
}
.auth-brand {
  font-family: var(--font-display); font-size: 26px; font-weight: 700;
  color: var(--brass); text-align: center; margin-bottom: 6px;
}
.auth-sub { text-align: center; color: var(--text-dim); font-size: 13.5px; margin-bottom: 26px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.field input {
  width: 100%; padding: 11px 13px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
  font-family: var(--font-body); font-size: 14.5px; letter-spacing: 0.3px;
}
.field input:focus { outline: none; border-color: var(--brass-dim); }
.btn-primary {
  width: 100%; padding: 12px; border-radius: var(--radius); border: none;
  background: var(--brass); color: #14171d; font-weight: 700; font-size: 14.5px;
  cursor: pointer; font-family: var(--font-body);
  transition: background .15s ease;
}
.btn-primary:hover { background: #d9b567; }
.auth-error {
  background: rgba(179,58,58,0.12); border: 1px solid rgba(179,58,58,0.4);
  color: #e88; padding: 10px 12px; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 16px;
}
.auth-note { text-align: center; font-size: 12.5px; color: var(--text-dim); margin-top: 18px; }

.empty-state {
  text-align: center; padding: 80px 20px; color: var(--text-dim);
}
.empty-state h3 { font-family: var(--font-display); color: var(--text); font-size: 20px; }

@media (max-width: 640px) {
  .nav { padding: 12px 16px; flex-wrap: wrap; }
  .nav-search { order: 3; max-width: none; width: 100%; }
  .section { padding: 0 16px 32px; }
  .reel-divider { margin: 8px 16px 18px; }
  .detail-hero, .player-wrap, .season-tabs, .ep-list { padding-left: 16px; padding-right: 16px; }
}
