/* ============================================================
   MOVIEFINDER — CATÉGORIES · NOIR
   Même langage que l'index. Conserve les IDs de categories.js
   et les composants générés (cartes catégories, mini-cartes).
   ============================================================ */

:root {
  --ink: #07080a;
  --ink-2: #0b0d11;
  --ash: #14161b;
  --smoke: #23262e;
  --silver: #c3c6ce;
  --paper: #e9e7e0;
  --glow: #f6f4ec;
  --dim: #777b86;
  --blood: #b21f2d;
  --gold: #d8b057;

  --glass-bg: rgba(16, 18, 23, 0.42);
  --glass-bg-strong: rgba(13, 15, 19, 0.82);
  --glass-border: rgba(233, 231, 224, 0.14);
  --glass-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.92), inset 0 1px 0 rgba(246, 244, 236, 0.08);

  --radius: 4px;
  --radius-lg: 10px;
  --maxw: 1240px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Barlow", system-ui, -apple-system, sans-serif;
  background: var(--ink);
  color: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body.no-scroll, body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
::selection { background: rgba(246, 244, 236, 0.85); color: #07080a; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(233,231,224,0.16); border: 3px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: rgba(233,231,224,0.3); }

.italic { font-family: "Playfair Display", serif; font-style: italic; font-weight: 600; }

/* ============================================================
   DÉCOR DE VILLE + AMBIANCE
   ============================================================ */
.cityscape { position: fixed; inset: 0; z-index: -3; overflow: hidden; background: radial-gradient(140% 100% at 24% 0%, #1b1e25 0%, #0c0e12 45%, #07080a 100%); }
.moon { position: absolute; top: 6%; left: 14%; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 38% 38%, #f6f4ec, #cfd0cb 55%, #9a9c98 100%); box-shadow: 0 0 80px 24px rgba(246,244,236,0.16), 0 0 180px 60px rgba(246,244,236,0.07); }
.moon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset -16px -14px 26px rgba(10,12,15,0.35); }
.skyline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; }
.skyline-far { height: 44vh; opacity: 0.45; }
.skyline-far path { fill: #0e1014; }
.skyline-near { height: 38vh; opacity: 0.9; }
.skyline-near path:not(.bridge-cable) { fill: #060708; }
.bridge-cable { stroke: #1c1f26; }
.city-haze { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,8,10,0) 36%, rgba(7,8,10,0.72) 76%, var(--ink) 100%); }

#rain { position: fixed; inset: 0; z-index: -2; width: 100%; height: 100%; opacity: 0.45; pointer-events: none; }
.grain { position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: 0.06; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); animation: grain 0.6s steps(3) infinite; }
@keyframes grain { 0% { transform: translate(0,0); } 33% { transform: translate(-6%,4%); } 66% { transform: translate(4%,-5%); } 100% { transform: translate(0,0); } }
.lightning { position: fixed; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(120% 80% at 60% -10%, rgba(246,244,236,0.9), rgba(246,244,236,0.2) 30%, transparent 60%); opacity: 0; }
.lightning.flash { animation: flash 0.7s ease; }
@keyframes flash { 0% { opacity: 0; } 6% { opacity: 0.9; } 12% { opacity: 0.1; } 18% { opacity: 0.75; } 30% { opacity: 0; } 100% { opacity: 0; } }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(120% 120% at 50% 38%, transparent 40%, rgba(0,0,0,0.55) 100%); }
.spotlight { position: fixed; top: 0; left: 0; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(246,244,236,0.06), transparent 64%); transform: translate(-50%,-50%); pointer-events: none; z-index: 1; opacity: 0; transition: opacity 0.5s ease; mix-blend-mode: screen; }

.preloader { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: var(--ink); transition: opacity 0.7s var(--ease), visibility 0.7s var(--ease); }
.preloader.done { opacity: 0; visibility: hidden; }
.preloader-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.preloader-word { font-family: "Oswald"; font-weight: 500; letter-spacing: 0.42em; font-size: 13px; color: var(--silver); padding-left: 0.42em; }
.preloader-bar { width: 220px; height: 2px; background: rgba(233,231,224,0.14); overflow: hidden; }
.preloader-bar span { display: block; height: 100%; width: 38%; background: var(--glow); animation: loadbar 1.1s var(--ease) infinite; }
@keyframes loadbar { 0% { transform: translateX(-120%); } 100% { transform: translateX(360%); } }
.lenses { display: inline-flex; gap: 8px; align-items: center; }
.lenses span { width: 22px; height: 13px; background: var(--glow); border-radius: 60% 60% 55% 55% / 70% 70% 40% 40%; box-shadow: 0 0 14px rgba(246,244,236,0.7), 0 0 34px rgba(246,244,236,0.35); transform: rotate(-8deg); animation: blink 6s steps(1) infinite; }
.lenses span:last-child { transform: rotate(8deg) scaleX(-1); }
@keyframes blink { 0%, 94%, 100% { opacity: 1; } 96% { opacity: 0.15; } }
.scroll-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0%; z-index: 999; background: var(--glow); box-shadow: 0 0 12px rgba(246,244,236,0.6); }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; transition: background 0.45s var(--ease), border-color 0.45s var(--ease); border-bottom: 1px solid transparent; }
.nav.scrolled { background: rgba(7,8,10,0.55); backdrop-filter: blur(16px) saturate(60%); -webkit-backdrop-filter: blur(16px) saturate(60%); border-bottom: 1px solid rgba(233,231,224,0.1); }
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 18px 30px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: "Oswald"; font-weight: 600; font-size: 18px; letter-spacing: 0.14em; color: var(--glow); }
.brand-lens { width: 16px; height: 16px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 12px rgba(246,244,236,0.7); position: relative; }
.brand-lens::after { content: ""; position: absolute; inset: 4px 3px; background: var(--ink); border-radius: 50%; }
.brand-noir { color: var(--dim); margin-left: 6px; font-weight: 300; }
.nav-links { display: flex; gap: 2px; margin-left: 14px; }
.nav-link { position: relative; padding: 9px 15px; font-family: "Oswald"; font-size: 14px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--silver); transition: color 0.25s ease; }
.nav-link::after { content: ""; position: absolute; left: 15px; right: 15px; bottom: 6px; height: 1px; background: var(--glow); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.nav-link:hover, .nav-link.active { color: var(--glow); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.btn { position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 11px 20px; border-radius: var(--radius); font-family: "Oswald"; font-size: 14px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid transparent; transition: transform 0.3s var(--ease), background 0.3s ease, color 0.3s ease, border-color 0.3s ease; white-space: nowrap; }
.btn-ghost { color: var(--silver); padding: 11px 16px; }
.btn-ghost:hover { color: var(--glow); }
.burger { display: none; flex-direction: column; gap: 5px; width: 42px; height: 42px; border-radius: var(--radius); background: var(--glass-bg); border: 1px solid var(--glass-border); align-items: center; justify-content: center; }
.burger span { width: 18px; height: 2px; background: var(--paper); transition: all 0.3s var(--ease); }
body.menu-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .burger span:nth-child(2) { opacity: 0; }
body.menu-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.ct-stage { position: relative; min-height: 48vh; display: flex; align-items: center; overflow: hidden; padding: 150px 0 20px; }
.ct-stage-grid { position: relative; z-index: 3; max-width: var(--maxw); margin: 0 auto; padding: 0 30px; width: 100%; text-align: center; }
.ct-eyebrow { display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px; border: 1px solid var(--glass-border); border-radius: 100px; font-family: "Oswald"; font-size: 12px; font-weight: 400; letter-spacing: 0.18em; text-transform: uppercase; color: var(--silver); background: var(--glass-bg); backdrop-filter: blur(8px); margin: 0 auto 26px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blood); box-shadow: 0 0 0 0 rgba(178,31,45,0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(178,31,45,0); } 100% { box-shadow: 0 0 0 0 rgba(178,31,45,0); } }
.ct-pretitle { display: block; font-family: "Playfair Display", serif; font-style: italic; font-weight: 500; font-size: clamp(1.1rem, 2vw, 1.7rem); color: var(--silver); margin: 0 0 0.15em; }
.ct-title { font-family: "Oswald", sans-serif; font-weight: 700; font-size: clamp(2.8rem, 9vw, 6.5rem); line-height: 0.9; letter-spacing: 0.01em; margin: 0 0 0.1em; text-transform: uppercase; color: var(--glow); text-shadow: 0 0 50px rgba(0,0,0,0.7); }
.ct-lede { max-width: 600px; margin: 24px auto 28px; color: var(--silver); font-size: clamp(1rem, 1.4vw, 1.12rem); line-height: 1.65; }
.ct-stats { display: flex; align-items: center; justify-content: center; gap: 26px; flex-wrap: wrap; }
.ct-stat { display: flex; flex-direction: column; gap: 4px; }
.ct-stat-num { font-family: "Oswald"; font-size: 2.2rem; font-weight: 600; color: var(--glow); }
.ct-stat-label { font-family: "Oswald"; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }

/* ============================================================
   TOOLBAR
   ============================================================ */
.ct-shell { position: relative; z-index: 3; max-width: var(--maxw); margin: 0 auto; padding: 6px 30px 110px; }
.categories-toolbar { display: flex; gap: 12px; align-items: center; margin: 0 0 30px; }
.category-search {
  flex: 1; background: rgba(7,8,10,0.6); border: 1px solid var(--glass-border);
  border-radius: var(--radius); color: var(--paper); padding: 14px 16px; font-size: 15px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.category-search:focus { outline: none; border-color: rgba(246,244,236,0.5); background: rgba(7,8,10,0.85); }
.category-search::placeholder { color: var(--dim); }
.text-btn { font-family: "Oswald"; text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px; padding: 13px 20px; border-radius: var(--radius); border: 1px solid var(--glass-border); background: rgba(7,8,10,0.4); color: var(--silver); transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease; white-space: nowrap; }
.text-btn:hover { color: var(--glow); border-color: rgba(233,231,224,0.34); background: rgba(233,231,224,0.06); }

/* ============================================================
   GRILLE DE CATÉGORIES
   ============================================================ */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 22px; }
.category-card {
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  background: var(--glass-bg); backdrop-filter: blur(14px) saturate(60%) brightness(0.9);
  -webkit-backdrop-filter: blur(14px) saturate(60%) brightness(0.9); padding: 22px;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.category-card:hover { border-color: rgba(233,231,224,0.26); transform: translateY(-3px); }
.category-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--glass-border); }
.category-card-header h2 { font-family: "Oswald"; text-transform: uppercase; letter-spacing: 0.06em; font-size: 19px; color: var(--glow); margin: 0 0 4px; }
.category-card-header p { color: var(--dim); font-size: 12.5px; margin: 0; }
.category-pill { flex-shrink: 0; font-family: "Oswald"; text-transform: uppercase; letter-spacing: 0.08em; font-size: 10.5px; color: var(--paper); background: rgba(233,231,224,0.08); border: 1px solid var(--glass-border); padding: 6px 12px; border-radius: 100px; }

.category-film-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.category-film-card { display: flex; flex-direction: column; gap: 8px; transition: transform 0.25s var(--ease); }
.category-film-card:hover { transform: translateY(-4px); }
.category-film-poster { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--glass-border); background: var(--smoke); }
.category-film-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.category-film-card:hover .category-film-poster img { transform: scale(1.06); }
.film-poster-placeholder { position: absolute; inset: 0; display: grid; place-items: center; font-family: "Oswald"; font-weight: 700; font-size: 28px; color: var(--dim); }
.category-film-meta { display: flex; flex-direction: column; gap: 2px; }
.category-film-meta strong { color: var(--paper); font-size: 12.5px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.category-film-meta span { color: var(--dim); font-size: 11px; }

.no-films { grid-column: 1 / -1; text-align: center; color: var(--dim); font-style: italic; padding: 60px 0; font-size: 15px; }

/* ============================================================
   CONTRÔLES FLOTTANTS (theme.js)
   ============================================================ */
.floating-controls { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.floating-control-btn { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--glass-bg-strong); border: 1px solid var(--glass-border); color: var(--glow); font-size: 18px; backdrop-filter: blur(12px); box-shadow: 0 14px 30px -16px rgba(0,0,0,0.9); transition: transform 0.2s var(--ease), background 0.2s var(--ease); }
.floating-control-btn:hover { transform: translateY(-2px); background: rgba(35,38,46,0.9); }

/* ============================================================
   RÉVÉLATIONS
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.category-card { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.category-card.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-account { display: none; }
  .burger { display: flex; }
  .nav-links.mobile-open { display: flex; flex-direction: column; gap: 4px; position: fixed; top: 80px; left: 14px; right: 14px; background: rgba(11,13,17,0.97); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 16px; backdrop-filter: blur(20px); z-index: 120; }
  .nav-links.mobile-open .nav-link { padding: 14px 16px; font-size: 16px; }
  .moon { width: 88px; height: 88px; }
  .categories-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .nav-inner { padding: 14px 18px; }
  .ct-stage-grid, .ct-shell { padding-left: 18px; padding-right: 18px; }
  .categories-toolbar { flex-direction: column; align-items: stretch; }
  .category-film-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
