:root {
  --bg-dark: #0f0f11;
  --bg-darker: #080809;
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --accent: #d4af37; /* Cinematic Gold */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Montserrat', sans-serif; color: var(--text-main); background-color: var(--bg-dark); margin: 0; line-height: 1.6; }
h1, h2, h3 { font-family: 'Cinzel', serif; font-weight: 600; margin-top: 0; }
a { text-decoration: none; transition: 0.3s; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.pt-0 { padding-top: 0; }
.text-center { text-align: center; }
.bg-darker { background-color: var(--bg-darker); }
.mt-3 { margin-top: 20px; display: inline-block; }

/* Header & Navigation */
.site-header { position: fixed; width: 100%; top: 0; background: rgba(15,15,17,0.85); backdrop-filter: blur(10px); z-index: 100; border-bottom: 1px solid rgba(255,255,255,0.05); transition: 0.3s; }
.solid-header { background: var(--bg-dark); }
.header-container { display: flex; justify-content: space-between; align-items: center; padding: 20px; }
.brand { font-family: 'Cinzel', serif; font-size: 1.6rem; color: #fff; font-weight: 600; z-index: 101; }
.main-nav { display: flex; align-items: center; }
.main-nav a { color: var(--text-main); margin: 0 15px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; }
.main-nav a:hover, .main-nav a.active { color: var(--accent); }
.imdb-btn { background: #f5c518; color: #000; padding: 8px 16px; border-radius: 4px; font-weight: 600; font-size: 0.85rem; display: inline-flex; align-items: center; margin-left: 10px; }
.imdb-btn:hover { background: #e2b616; transform: translateY(-2px); color: #000 !important; }

/* Hamburger Menu Toggle */
.nav-toggle { display: none; background: none; border: none; flex-direction: column; gap: 6px; cursor: pointer; z-index: 101; padding: 5px; }
.nav-toggle span { display: block; width: 30px; height: 2px; background: #fff; transition: 0.3s; }

/* Hero */
.hero { height: 100vh; display: flex; align-items: center; position: relative; background: url('https://images.unsplash.com/photo-1585647347384-2593bc35786b?auto=format&fit=crop&w=1920&q=80') center/cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgba(8,8,9,0.95) 20%, rgba(8,8,9,0.6)); }
.hero-content { position: relative; z-index: 2; max-width: 650px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: 3px; font-size: 0.9rem; }
.hero h1 { font-size: 4.5rem; color: #fff; margin: 10px 0; line-height: 1.1; }
.hero .lead { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 30px; }
.hero-actions { display: flex; gap: 15px; }

/* Buttons */
.btn { display: inline-block; padding: 12px 30px; font-family: 'Cinzel', serif; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; transition: 0.3s; font-size: 0.9rem; border-radius: 2px; text-align: center; }
.btn-primary { background: var(--accent); color: #000; border: 1px solid var(--accent); font-weight: 600; }
.btn-primary:hover { background: transparent; color: var(--accent); }
.btn-secondary { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.btn-secondary:hover { border-color: #fff; }
.btn-block { display: block; width: 100%; margin-top: 10px; }

/* Trailer Carousel - Draggable Setup */
.trailer-section { overflow: hidden; padding: 60px 0; }
.marquee-container { width: 100vw; overflow: hidden; position: relative; }
.marquee-container::before, .marquee-container::after { content: ''; position: absolute; top: 0; width: 150px; height: 100%; z-index: 5; pointer-events: none; }
.marquee-container::before { left: 0; background: linear-gradient(to right, var(--bg-darker), transparent); }
.marquee-container::after { right: 0; background: linear-gradient(to left, var(--bg-darker), transparent); }

.marquee-track { 
  display: flex; gap: 30px; padding: 0 15px; 
  overflow-x: auto; 
  scrollbar-width: none; 
  -ms-overflow-style: none; 
  cursor: grab;
}
.marquee-track::-webkit-scrollbar { display: none; }
.marquee-track:active { cursor: grabbing; }

.trailer-item { width: 450px; flex-shrink: 0; }
.trailer-title { 
  font-size: 0.95rem; color: var(--accent); text-transform: uppercase; 
  letter-spacing: 1px; margin-bottom: 10px; margin-top: 0; text-align: left; 
  font-family: 'Montserrat', sans-serif; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}
.trailer-card { aspect-ratio: 16/9; position: relative; border-radius: 6px; overflow: hidden; background: #000; }
.trailer-card iframe { width: 100%; height: 100%; pointer-events: none; opacity: 0.7; transition: 0.4s ease; }
.trailer-card:hover iframe { opacity: 1; }
.click-overlay { position: absolute; inset: 0; z-index: 10; cursor: pointer; }

/* Featured Grid */
.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; margin-top: 40px; }
.featured-card { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 2/3; display: block; background: #000; cursor: default; }
.featured-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease, opacity 0.4s ease; opacity: 0.8; }
.card-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.4) 50%, transparent 100%); display: flex; flex-direction: column; justify-content: flex-end; padding: 30px; opacity: 0; transition: 0.4s ease; }
.card-text { transform: translateY(20px); transition: 0.4s ease; }
.featured-card:hover img { transform: scale(1.05); opacity: 0.3; }
.featured-card:hover .card-overlay { opacity: 1; }
.featured-card:hover .card-text { transform: translateY(0); }

.card-text h3 { color: #fff; font-size: 1.8rem; margin-bottom: 5px; }
.card-text .year { color: var(--accent); font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 10px; }
.card-text .desc { color: var(--text-muted); font-size: 0.95rem; margin: 0; line-height: 1.5; }

/* Forms */
.custom-form { max-width: 600px; margin: 40px auto 0; display: flex; flex-direction: column; gap: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.custom-form input, .custom-form textarea { width: 100%; padding: 15px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #fff; font-family: 'Montserrat', sans-serif; border-radius: 4px; transition: border-color 0.3s; }
.custom-form input:focus, .custom-form textarea:focus { outline: none; border-color: var(--accent); }
.custom-form textarea { height: 150px; resize: vertical; }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 1000; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: 0.3s; padding: 20px; }
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal-content-video { width: 100%; max-width: 1000px; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; background: #000; border-radius: 8px; }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.close-modal { position: absolute; top: -40px; right: 0; background: none; border: none; color: #fff; font-size: 2.5rem; cursor: pointer; transition: 0.3s; }
.close-modal:hover { color: var(--accent); }

.modal-content-form { background: var(--bg-darker); padding: 40px; border-radius: 8px; border: 1px solid var(--accent); text-align: center; max-width: 400px; transform: translateY(20px); transition: 0.3s; }
.modal-overlay.show .modal-content-form { transform: translateY(0); }
.modal-content-form h3 { color: var(--accent); margin-bottom: 10px; font-size: 1.5rem; }
.modal-content-form p { color: var(--text-muted); margin-bottom: 25px; }

/* Filmography List Page */
.page-header { padding: 140px 0 60px; background: var(--bg-darker); border-bottom: 1px solid rgba(255,255,255,0.05); margin-bottom: 40px; }
.list-wrapper { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 15px; }
.list-year-marker { font-family: 'Cinzel', serif; font-size: 1.5rem; color: var(--accent); font-weight: 600; margin-top: 30px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.list-year-marker:first-child { margin-top: 0; }

/* Poster Reveal Styles (Desktop) */
.list-item { position: relative; padding: 20px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 8px; transition: 0.3s; overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.list-item:hover, .list-item.touch-active { background: rgba(255,255,255,0.05); border-color: var(--accent); }

.list-item-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; box-sizing: border-box; }

.list-poster { position: absolute; left: 20px; top: 50%; transform: translateY(-50%) translateX(-20px); height: 75px; width: 50px; object-fit: cover; border-radius: 4px; opacity: 0; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 2px 2px 10px rgba(0,0,0,0.5); }
.list-item:hover .list-poster, .list-item.touch-active .list-poster { opacity: 1; transform: translateY(-50%) translateX(0); }

/* Only the left info slides over on Desktop! */
.list-info { transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.4s; max-width: calc(100% - 150px); }
.list-item:hover .list-info { transform: translateX(65px); }

.list-info h3 { margin: 0 0 5px 0; color: #fff; font-size: 1.2rem; }
.list-info .role { color: var(--text-muted); font-size: 0.85rem; }
.highlight { color: var(--accent); font-size: 0.75rem; font-family: 'Montserrat', sans-serif; letter-spacing: 1px; margin-left: 10px; padding: 2px 6px; border: 1px solid var(--accent); border-radius: 4px; vertical-align: middle; }
.list-meta { text-align: right; flex-shrink: 0; margin-left: 20px; z-index: 2; position: relative; }
.list-meta .format { display: block; color: var(--accent); font-size: 0.8rem; text-transform: uppercase; margin-bottom: 3px; font-weight: 600; }
.list-meta .episodes { color: var(--text-muted); font-size: 0.85rem; }

footer { padding: 40px 0; border-top: 1px solid rgba(255,255,255,0.05); color: var(--text-muted); font-size: 0.9rem; background: var(--bg-darker); }

/* MOBILE OPTIMIZATION */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .main-nav { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh; 
    background: rgba(8,8,9,0.98); backdrop-filter: blur(15px); 
    flex-direction: column; justify-content: center; align-items: center; 
    gap: 30px; opacity: 0; visibility: hidden; transition: 0.4s ease; z-index: 100;
  }
  .main-nav.open { opacity: 1; visibility: visible; }
  .main-nav a { font-size: 1.2rem; margin: 0; }
  .mobile-hidden { display: none; } 
  
  .hero h1 { font-size: 2.8rem; }
  .hero .lead { font-size: 1rem; }
  .hero-actions { flex-direction: column; width: 100%; }
  
  .trailer-item { width: 300px; } 
  
  .featured-grid {
    display: flex; flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 15px; padding-bottom: 15px;
  }
  .featured-grid::-webkit-scrollbar { display: none; }
  .featured-card { width: 260px; flex-shrink: 0; scroll-snap-align: center; }

  .form-row { grid-template-columns: 1fr; }
  
  /* OVERFLOW FIX: Mobile Poster Reveal Handling */
  .list-info { max-width: 100%; }
  .list-item:hover .list-info, .list-item.touch-active .list-info { transform: none; } 
  
  /* We use padding-left to push the text over, so it wraps naturally instead of going off-screen! */
  .list-item-inner { 
    transition: padding-left 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 15px; 
    width: 100%; 
    box-sizing: border-box; 
  }
  
  /* When touched, apply padding-left. The text gets squished safely. */
  .list-item:hover .list-item-inner, .list-item.touch-active .list-item-inner { 
    padding-left: 70px; 
    transform: none; 
  } 

  .list-meta { text-align: left; margin-left: 0; }
  .highlight { display: inline-block; margin-left: 0; margin-top: 5px; }
}
