@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=DM+Sans:wght@300;400;500&family=Bebas+Neue&display=swap');

:root {
  --noir: #0a0a0b;
  --deep: #111114;
  --surface: #18181d;
  --card: #1e1e25;
  --border: #2a2a35;
  --gold: #c9a227;
  --gold-light: #e8c547;
  --gold-dim: #7a6115;
  --cream: #f5f0e8;
  --silver: #9a9aaa;
  --white: #ffffff;
  --red: #b02a2a;
  --green: #2a7a4b;
  --radius: 4px;
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--noir);
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── GRAIN OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.5;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--deep); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── NAVBAR ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
  height: 70px;
  background: linear-gradient(180deg, rgba(10,10,11,0.98) 0%, rgba(10,10,11,0.0) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201, 162, 39, 0.1);
  transition: background var(--transition);
}

.navbar.scrolled {
  background: rgba(10,10,11,0.98);
  border-bottom-color: rgba(201, 162, 39, 0.2);
}

.nav-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo span { color: var(--cream); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--silver);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* ── HERO ── */
.hero {
  position: relative;
  height: 100vh;
  min-height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(201,162,39,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 70%, rgba(176,42,42,0.08) 0%, transparent 60%),
    linear-gradient(180deg, var(--noir) 0%, #0d0c14 100%);
}

.hero-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201,162,39,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,162,39,0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 0%, transparent 100%);
}

.hero-content {
  position: relative;
  text-align: center;
  padding: 2rem;
  max-width: 900px;
  animation: heroFadeIn 1.2s ease forwards;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.hero-eyebrow::before,
.hero-eyebrow::after {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: var(--gold-dim);
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--cream);
  margin-bottom: 1.5rem;
}

.hero-title em {
  font-style: italic;
  color: var(--gold);
  display: block;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--silver);
  max-width: 500px;
  margin: 0 auto 3rem;
  font-weight: 300;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 3rem;
}

.hero-stat {
  text-align: center;
}

.hero-stat-number {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem;
  color: var(--gold);
  line-height: 1;
  letter-spacing: 0.05em;
}

.hero-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--silver);
  margin-top: 0.3rem;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  background: var(--gold);
  color: var(--noir);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: all var(--transition);
  box-shadow: 0 0 30px rgba(201,162,39,0.2);
}

.hero-cta:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(201,162,39,0.35);
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--gold-dim);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: scrollPulse 2s ease infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(6px); }
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--gold-dim), transparent);
}

/* ── SECTIONS ── */
.section {
  padding: 6rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 3rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--cream);
  position: relative;
  padding-left: 1.2rem;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 3px;
  background: var(--gold);
}

.section-link {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--transition);
}

.section-link:hover { color: var(--gold-light); }

/* ── GENRE BADGES ── */
.genres-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 4rem;
}

.genre-badge {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--silver);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-block;
}

.genre-badge:hover,
.genre-badge.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,162,39,0.06);
}

/* ── FEATURED FILMS (horizontal scroll) ── */
.films-track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

/* ── FILM CARD ── */
.film-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  group: true;
}

.film-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-dim);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(201,162,39,0.1);
}

.film-card-poster {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--surface);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.film-card-poster-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--surface) 0%, var(--deep) 100%);
}

.film-card-poster-letter {
  font-family: 'Playfair Display', serif;
  font-size: 5rem;
  font-weight: 900;
  color: rgba(201,162,39,0.12);
  position: relative;
  z-index: 1;
  user-select: none;
  letter-spacing: -0.05em;
}

.film-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(10,10,11,0.9) 100%);
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 2;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.film-card:hover .film-card-overlay { opacity: 1; }

.film-card-genre-tag {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(201,162,39,0.15);
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
  border: 1px solid rgba(201,162,39,0.25);
}

.film-card-body {
  padding: 1rem;
}

.film-card-year {
  font-size: 0.7rem;
  color: var(--gold-dim);
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
}

.film-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cream);
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.film-card-director {
  font-size: 0.75rem;
  color: var(--silver);
  margin-bottom: 0.75rem;
}

.film-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.film-rating {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 500;
}

.film-rating svg {
  width: 12px;
  height: 12px;
  fill: var(--gold);
}

/* ── FILMS PAGE ── */
.films-page-hero {
  padding-top: 70px;
  padding-bottom: 4rem;
  background: linear-gradient(180deg, var(--deep) 0%, var(--noir) 100%);
  border-bottom: 1px solid var(--border);
}

.films-page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(4rem, 10vw, 9rem);
  letter-spacing: 0.05em;
  color: var(--cream);
  line-height: 0.9;
  margin-bottom: 0.5rem;
}

.films-page-title span { color: var(--gold); }

.films-count {
  font-size: 0.8rem;
  color: var(--silver);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ── SEARCH & FILTER BAR ── */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem 3rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 70px;
  z-index: 50;
}

.search-wrapper {
  flex: 1;
  min-width: 240px;
  position: relative;
}

.search-wrapper svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--silver);
  stroke-width: 2;
}

#searchInput {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}

#searchInput:focus { border-color: var(--gold-dim); }
#searchInput::placeholder { color: var(--silver); opacity: 0.5; }

.filter-select {
  padding: 0.7rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239a9aaa'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.filter-select:focus { border-color: var(--gold-dim); }
.filter-select option { background: var(--card); }

.sort-select {
  padding: 0.7rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239a9aaa'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.results-count {
  font-size: 0.8rem;
  color: var(--silver);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ── FILMS GRID ── */
.films-grid-container {
  padding: 2rem 3rem 4rem;
  max-width: 1800px;
  margin: 0 auto;
}

.films-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

/* ── NO RESULTS ── */
.no-results {
  text-align: center;
  padding: 6rem 2rem;
  color: var(--silver);
  display: none;
}

.no-results svg {
  width: 60px;
  height: 60px;
  stroke: var(--border);
  fill: none;
  stroke-width: 1.5;
  margin-bottom: 1.5rem;
}

.no-results h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--cream);
  margin-bottom: 0.5rem;
}

/* ── FOOTER ── */
.footer {
  background: var(--deep);
  border-top: 1px solid var(--border);
  padding: 3rem;
  text-align: center;
}

.footer-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  display: block;
}

.footer-logo span { color: var(--cream); }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  margin-bottom: 2rem;
}

.footer-links a {
  color: var(--silver);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--gold); }

.footer-copy {
  font-size: 0.75rem;
  color: var(--gold-dim);
  letter-spacing: 0.05em;
}

/* ── DECORATIVE DIVIDER ── */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  margin: 0 auto;
}

/* ── TOP RATED SECTION ── */
.top-rated-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.top-rated-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.top-rated-item:hover { padding-left: 0.5rem; }

.top-rated-rank {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  color: var(--border);
  width: 60px;
  text-align: right;
  flex-shrink: 0;
  line-height: 1;
  transition: color var(--transition);
}

.top-rated-item:hover .top-rated-rank { color: var(--gold-dim); }

.top-rated-info { flex: 1; }

.top-rated-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 0.2rem;
  transition: color var(--transition);
}

.top-rated-item:hover .top-rated-title { color: var(--gold); }

.top-rated-meta {
  font-size: 0.75rem;
  color: var(--silver);
}

.top-rated-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: var(--gold);
  letter-spacing: 0.05em;
}

/* ── GENRE TAG COLORS ── */
.tag-action { --tag-color: #4a9eff; }
.tag-drama { --tag-color: #e8c547; }
.tag-scifi { --tag-color: #7b68ee; }
.tag-horror { --tag-color: #ff6b6b; }
.tag-comedy { --tag-color: #51cf66; }
.tag-thriller { --tag-color: #ff922b; }
.tag-animation { --tag-color: #f06595; }
.tag-western { --tag-color: #a9e34b; }
.tag-war { --tag-color: #74c0fc; }
.tag-romance { --tag-color: #f783ac; }
.tag-adventure { --tag-color: #63e6be; }
.tag-fantasy { --tag-color: #da77f2; }

/* ── LETTER INDEX ── */
.letter-section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 4rem;
  color: rgba(201,162,39,0.08);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  padding-top: 2rem;
  line-height: 1;
}

/* ── ANIMATIONS ── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .navbar { padding: 0 1.5rem; }
  .hero-stats { gap: 1.5rem; }
  .hero-stat-number { font-size: 2.2rem; }
  .section { padding: 4rem 1.5rem; }
  .controls-bar { padding: 1rem 1.5rem; }
  .films-grid-container { padding: 1.5rem 1.5rem 3rem; }
  .footer { padding: 2rem 1.5rem; }
  .films-page-hero { padding-left: 1.5rem; padding-right: 1.5rem; }
  .top-rated-rank { font-size: 1.8rem; width: 45px; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .hero-stats { flex-direction: row; gap: 1rem; }
  .films-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .section-header { flex-direction: column; gap: 0.5rem; }
  .footer-links { flex-wrap: wrap; gap: 1rem; }
}
