/* Layout : en-tête collant, une « affiche à la une », puis des rangées d'affiches qui défilent comme sur une télé ; la recherche bascule en grille. */
:root {
  --bg: #F3F1F7;
  --surface: #FFFFFF;
  --raise: #E8E4F0;
  --fg: #1A1626;
  --muted: #6B647C;
  --line: #DAD5E4;
  --bulb: #FFC845;
  --bulb-ink: #1A1626;
  --bulb-text: #8A5A00;
  --free: #1F8A5B;
  --free-bg: #DDF3E8;
  --shade: rgba(26, 22, 38, .55);
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --r: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #110F18; --surface: #1B1824; --raise: #26222F; --fg: #F2EFF8; --muted: #9D96AE; --line: #2E2939;
    --bulb: #FFC845; --bulb-ink: #1A1626; --bulb-text: #FFD36E; --free: #5FD69E; --free-bg: #173226;
    --shade: rgba(0, 0, 0, .7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #110F18; --surface: #1B1824; --raise: #26222F; --fg: #F2EFF8; --muted: #9D96AE; --line: #2E2939;
  --bulb: #FFC845; --bulb-ink: #1A1626; --bulb-text: #FFD36E; --free: #5FD69E; --free-bg: #173226;
  --shade: rgba(0, 0, 0, .7); color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.5; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--bulb); outline-offset: 2px; }
a { color: inherit; }

/* En-tête */
header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
header .wrap { display: flex; align-items: center; gap: 14px; padding-block: 12px; flex-wrap: wrap; }
.logo { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -.03em; display: flex; align-items: baseline; gap: 1px; background: none; border: 0; padding: 0; cursor: pointer; }
.logo i { width: 9px; height: 9px; border-radius: 50%; background: var(--bulb); display: inline-block; box-shadow: 0 0 14px var(--bulb); }
.search { flex: 1 1 240px; min-width: 0; position: relative; }
.search input { width: 100%; padding: 10px 14px 10px 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pill { border: 1px solid var(--line); background: var(--surface); padding: 9px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.pill[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pill .n { background: var(--bulb); color: var(--bulb-ink); border-radius: 999px; padding: 0 7px; font-size: 12px; font-variant-numeric: tabular-nums; }

/* À la une */
.hero { position: relative; overflow: hidden; border-radius: 22px; margin-top: 20px; background: var(--raise); isolation: isolate; }
.hero .bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) saturate(1.3); opacity: .55; z-index: -2; transition: background-image .4s; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 55%, transparent 100%); z-index: -1; }
.hero-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; padding: clamp(22px, 4vw, 48px); }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--bulb-text); display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bulb); box-shadow: 0 0 10px var(--bulb); }
.hero h1 { font-size: clamp(36px, 6.4vw, 76px); font-weight: 800; letter-spacing: -.035em; line-height: .95; margin-top: 12px; }
.hero p { max-width: 52ch; color: var(--fg); opacity: .85; font-size: 17px; margin: 14px 0 0; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 14px; margin-top: 12px; font-variant-numeric: tabular-nums; }
.meta b { color: var(--fg); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 12px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-size: 15px; }
.btn.main { background: var(--bulb); color: var(--bulb-ink); }
.btn.main:hover { filter: brightness(1.06); }
.btn.ghost { background: var(--surface); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.hero-poster { width: clamp(150px, 20vw, 230px); aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px -20px var(--shade); transform: rotate(2deg); max-width: 100%; }
.hero-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dots { display: flex; gap: 6px; margin-top: 24px; }
.dots button { width: 22px; height: 4px; border-radius: 4px; border: 0; background: var(--line); cursor: pointer; padding: 0; }
.dots button[aria-current="true"] { background: var(--bulb); }

/* Filtres */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-block: 22px 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 7px 13px; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip.free[aria-pressed="true"] { background: var(--free); border-color: var(--free); color: var(--bg); }

/* Rangées */
.row { margin-top: 30px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.row h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.row-head span { color: var(--muted); font-size: 14px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(130px, 15vw, 172px); gap: 14px; overflow-x: auto; padding-block: 14px 10px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.rail > * { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 14px; padding-block: 14px; }

.card { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.poster { position: relative; aspect-ratio: 2 / 3; border-radius: var(--r); overflow: hidden; background: var(--raise); max-width: 100%; transition: transform .25s ease, box-shadow .25s ease; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card:hover .poster, .card:focus-visible .poster { transform: translateY(-4px); box-shadow: 0 16px 30px -14px var(--shade); }
.card .t { font-weight: 600; font-size: 14px; line-height: 1.25; }
.card .s { color: var(--muted); font-size: 13px; margin-top: -6px; font-variant-numeric: tabular-nums; }
.badge { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--free-bg); color: var(--free); }
.saved { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--bulb); color: var(--bulb-ink); display: grid; place-items: center; }
.score { position: absolute; right: 8px; bottom: 8px; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(17, 15, 24, .78); color: #FFD36E; font-variant-numeric: tabular-nums; }
.empty { padding: 48px 0; color: var(--muted); text-align: center; }
.empty strong { display: block; color: var(--fg); font-family: var(--display); font-size: 22px; margin-bottom: 6px; }

/* Plateformes gratuites */
.free-sec { margin-top: 56px; padding-block: 32px; border-top: 1px solid var(--line); }
.free-sec h2 { font-size: clamp(26px, 3.6vw, 36px); font-weight: 800; letter-spacing: -.03em; }
.free-sec > p { color: var(--muted); max-width: 60ch; margin: 8px 0 0; }
.plats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 22px; }
.plat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: border-color .2s; min-width: 0; }
.plat:hover { border-color: var(--free); }
.plat b { font-family: var(--display); font-size: 18px; }
.plat span { color: var(--muted); font-size: 14px; }
.plat em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--free); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
footer { color: var(--muted); font-size: 13px; padding-block: 24px 40px; }

/* Fiche */
dialog { border: 0; padding: 0; border-radius: 22px; background: var(--surface); color: var(--fg); width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: 0 30px 80px -20px var(--shade); }
dialog::backdrop { background: var(--shade); backdrop-filter: blur(4px); }
.sheet { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 26px; padding: 26px; position: relative; }
.sheet .poster { box-shadow: 0 18px 40px -18px var(--shade); }
.sheet h3 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.03em; line-height: 1; padding-right: 36px; }
.sheet .orig { color: var(--muted); font-size: 14px; margin-top: 6px; }
.sheet p { margin: 16px 0 0; font-size: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--raise); }
.where { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--raise); font-size: 14px; }
.where b { font-weight: 600; }
.where.is-free { background: var(--free-bg); color: var(--free); }
.close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; }

@media (max-width: 640px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-poster { display: none; }
  .hero p { font-size: 16px; }
  .sheet { grid-template-columns: 1fr; padding: 20px; }
  .sheet .poster { width: 150px; }
  .logo { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
