/* Même identité que la présentation et le questionnaire : noir de la salle de projection,
   rouge du carré de Malévitch. Une longue page : quatre parties, chaque œuvre avec son lecteur vidéo. */
:root {
  --bg: #000;
  --surface: #111;
  --surface-2: #1b1b1b;
  --line: #2b2b2b;
  --fg: #f2f2f2;
  --muted: #a3a3a3;
  --accent: #ef4a3c;      /* texte rouge sur fond noir */
  --accent-btn: #d63426;  /* fonds rouges sous texte blanc */
  --accent-ink: #fff;
  --warn: #ffb347;

  --f-display: "Big Shoulders Display", "Oswald", "Arial Narrow", sans-serif;
  --f-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius: 6px;
  --nav-h: 3.1rem;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--nav-h) + 1rem); }
html, body { background: var(--bg); color: var(--fg); }
body { margin: 0; font-family: var(--f-body); font-size: 1.0625rem; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 800; line-height: 1; margin: 0; text-wrap: balance; letter-spacing: .01em; }
p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.muted { color: var(--muted); }
.acc { color: var(--accent); }
.small { font-size: .85rem; }
em { font-style: italic; }
sup { font-size: .7em; }

.wrap { max-width: 1180px; margin-inline: auto; padding-inline: 16px; }
.wrap.narrow { max-width: 820px; }
.eyebrow { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }

/* ---------- navigation ---------- */
.topnav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: .75rem;
  min-height: var(--nav-h); padding: .35rem 16px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.topnav .home {
  font-family: var(--f-display); font-weight: 800; font-size: 1.2rem; text-transform: uppercase;
  color: var(--fg); text-decoration: none; white-space: nowrap; display: flex; align-items: center; gap: .5rem;
}
.topnav .home::before { content: ""; width: .7rem; height: .7rem; background: var(--accent); }
.steps { display: flex; gap: 3px; overflow-x: auto; flex: 1 1 auto; min-width: 0; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.steps a {
  font-family: var(--f-mono); font-size: .72rem; font-weight: 600; text-decoration: none; color: var(--muted);
  background: var(--surface-2); border-radius: 3px; padding: .3rem .55rem; white-space: nowrap;
}
.steps a:hover { color: var(--fg); }
.steps a.on { background: var(--accent-btn); color: var(--accent-ink); }
.topnav .exo { font-family: var(--f-mono); font-size: .75rem; white-space: nowrap; text-decoration: none; }

/* aperçu local : page ouverte depuis le disque, où YouTube refuse ses lecteurs */
.local-note {
  margin: 0; padding: .6rem 16px; background: var(--accent-btn); color: var(--accent-ink);
  font-family: var(--f-mono); font-size: .78rem; line-height: 1.45; text-align: center;
}

/* ---------- ouverture ---------- */
.hero { background: #000; }
.hero-img { width: 100%; max-height: 52vh; object-fit: cover; opacity: .9; }
.hero-text { padding-block: 2rem 3rem; display: grid; gap: .9rem; }
.hero h1 { font-size: clamp(3rem, 9vw, 7rem); text-transform: uppercase; max-width: 14ch; }
.lede { font-size: clamp(1.1rem, 2.2vw, 1.4rem); color: var(--muted); max-width: 46ch; }
.hero-cap { font-size: .85rem; }

/* ---------- blocs ---------- */
.block { padding-block: clamp(2.6rem, 6vw, 4.5rem); border-top: 1px solid var(--line); }
.block h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); text-transform: uppercase; margin-block: .4rem 1.2rem; }
.topic-title { font-size: clamp(1.9rem, 4vw, 2.8rem); text-transform: uppercase; margin-block: .4rem 1.4rem; }
.prose { display: grid; gap: .9rem; max-width: 64ch; min-width: 0; }
.prose strong { color: var(--accent); font-weight: 600; }
.block .prose + .prose, .block .cols3 + .prose, .block .cols2 + .prose, .block .timeline + .prose,
.block .warn + .prose, .block .cards4 + .prose { margin-top: 1.4rem; }
.block .prose + .cols3, .block .prose + .timeline { margin-top: 1.6rem; }
.text-block .prose p { font-size: 1.1rem; }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.stack { display: grid; gap: 1.4rem; min-width: 0; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; align-items: start; }
.cols2.even { gap: clamp(1.5rem, 4vw, 3rem); }
.cols2.wide-right { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: end; }
.cols2.small { gap: .8rem; margin-block: .6rem 1rem; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.8rem 1.4rem; align-items: start; }
.cols3.tight { align-items: end; margin-bottom: 1.6rem; }
.col { display: grid; gap: .7rem; min-width: 0; align-content: start; }
.col-head { font-weight: 600; color: var(--fg); }
.col-head em { font-weight: 600; }

figure { margin: 0; display: grid; gap: .5rem; min-width: 0; }
figcaption { font-size: .85rem; display: grid; gap: .1rem; color: var(--fg); }
figcaption .note { color: var(--muted); }
.zoom { padding: 0; border: 0; background: #000; cursor: zoom-in; border-radius: 4px; overflow: hidden; display: block; width: 100%; }
.zoom img { width: 100%; transition: opacity .2s; }
.zoom:hover img { opacity: .88; }
.narrow-fig { max-width: 300px; }
.strip-fig { max-width: 110px; }

.quote { margin: .4rem 0 0; padding: 0; display: grid; gap: .4rem; max-width: 60ch; }
.quote p { font-size: 1.2rem; font-style: italic; line-height: 1.45; }
.quote footer { font-family: var(--f-mono); font-size: .75rem; color: var(--muted); }

/* ---------- en-têtes de parties ---------- */
.part-head { padding-block: clamp(3.5rem, 9vw, 6.5rem); border-top: 1px solid var(--line); background: #070707; }
.part-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: center; }
.part-text { display: grid; gap: .8rem; }
.part-num { font-family: var(--f-display); font-weight: 800; font-size: 1.6rem; color: var(--accent); letter-spacing: .06em; }
.part-head h2 { font-size: clamp(2.8rem, 8vw, 6rem); text-transform: uppercase; max-width: 12ch; margin: 0; }
.part-dates { font-family: var(--f-mono); color: var(--muted); }
.motif { width: clamp(120px, 24vw, 260px); aspect-ratio: 1; }
.motif.square { background: var(--accent-btn); }
.motif.circle { background: var(--fg); border-radius: 50%; }
.motif.lines { background: repeating-linear-gradient(to bottom, var(--fg) 0 9%, transparent 9% 14%); position: relative; }
.motif.lines::after { content: ""; position: absolute; left: 0; right: 0; top: 43%; height: 9%; background: var(--accent-btn); }
.motif.pixels { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6%; }
.motif.pixels i { background: var(--fg); }
.motif.pixels i:nth-child(3n) { background: var(--muted); }
.motif.pixels i:nth-child(11), .motif.pixels i:nth-child(37) { background: var(--accent-btn); }
.motif.pixels i:nth-child(1), .motif.pixels i:nth-child(13), .motif.pixels i:nth-child(23),
.motif.pixels i:nth-child(31), .motif.pixels i:nth-child(43), .motif.pixels i:nth-child(47) { background: transparent; }

/* ---------- une œuvre ---------- */
.work .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.work-text { display: grid; gap: .8rem; align-content: start; }
.work h3 { font-size: clamp(2.2rem, 5vw, 3.4rem); text-transform: uppercase; margin-top: .2rem; }
.sub { font-size: 1.1rem; color: var(--muted); }
.sub em { color: var(--fg); }
.tech { font-family: var(--f-mono); font-size: .75rem; color: var(--muted); margin-top: .4rem; }
.work-media { display: grid; gap: 1rem; min-width: 0; }

/* lecteurs vidéo : iframes YouTube et Vimeo au format 16:9 */
.video { gap: .45rem; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 6px; overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { display: block; font-family: var(--f-mono); font-size: .75rem; }
.video figcaption a { text-decoration: none; }

/* frise des inventeurs */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.6rem 1rem; }
.timeline li { display: grid; gap: .55rem; align-content: start; border-top: 2px solid var(--line); padding-top: .8rem; position: relative; }
.timeline li::before { content: ""; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-btn); }
.timeline .year { font-family: var(--f-display); font-weight: 800; font-size: 2rem; line-height: 1; }
.timeline .zoom img { aspect-ratio: 1; object-fit: contain; }
.tl-text { font-size: .88rem; color: var(--muted); }

/* film réduit à la lumière */
.duo { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: start; }
.duo > div { display: grid; gap: .5rem; }
.filmstrip { width: 64px; height: auto; }
.warn { color: var(--warn); font-size: .9rem; font-weight: 600; margin-top: 1.4rem; max-width: 70ch; }
.work .warn { margin-top: .2rem; }
.question { font-family: var(--f-display); font-weight: 800; font-size: 1.7rem; text-transform: uppercase; line-height: 1.05; color: var(--fg); margin-top: .4rem; }

/* datamoshing */
.datamosh { display: grid; gap: .45rem; margin-top: .4rem; }
.dm-row { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.dm-label { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); width: 5.5rem; }
.dm-row b {
  width: 2rem; height: 2rem; display: grid; place-items: center; font-family: var(--f-mono); font-size: .8rem;
  border: 1px solid var(--line); border-radius: 3px; background: var(--surface-2); color: var(--muted);
}
.dm-row b.i { background: var(--fg); color: #000; border-color: var(--fg); }
.dm-row b.x { color: var(--accent); border-color: var(--accent); background: #000; }
.dm-row b.hot { color: var(--accent); }
.dm-cap { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); }

/* synthèse et pistes */
.cards4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2rem; }
.card4 { display: grid; gap: .5rem; align-content: start; }
.card4 img { width: 100%; aspect-ratio: 786 / 600; object-fit: cover; border-radius: 4px; margin-bottom: .3rem; }
.c-head { font-family: var(--f-display); font-weight: 800; font-size: 1.5rem; text-transform: uppercase; line-height: 1; }
.cards2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.pcard { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1.2rem 1.3rem; }
.pcard > div { display: grid; gap: .4rem; }
.pnum { font-family: var(--f-display); font-weight: 800; font-size: 3rem; line-height: .9; color: var(--accent); }
.cta { margin-top: 2rem; display: grid; gap: .8rem; justify-items: start; }
.btn {
  display: inline-block; background: var(--accent-btn); color: var(--accent-ink); text-decoration: none; font-weight: 600;
  padding: .75rem 1.2rem; border-radius: var(--radius);
}
.btn:hover { filter: brightness(1.08); }

/* ressources */
.res { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .6rem; }
.res a { color: var(--fg); text-decoration-color: var(--accent); text-underline-offset: 3px; font-weight: 600; }
.credits .prose p { font-size: .92rem; }

/* ---------- loupe ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .95);
  display: grid; place-items: center; align-content: center; gap: .8rem; padding: 16px; cursor: zoom-out;
}
.lightbox img { max-height: 84vh; width: auto; }
.lightbox p { color: #d6d6d6; font-size: .9rem; text-align: center; max-width: 70ch; }
.lightbox p a { pointer-events: none; color: inherit; text-decoration: none; }

@media (max-width: 1000px) {
  .timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .split, .work .split, .cols3, .cols2.even, .cols2.wide-right, .cards2 { grid-template-columns: minmax(0, 1fr); }
  .topnav .exo { display: none; }
  .part-grid { grid-template-columns: minmax(0, 1fr); }
  .motif { width: 120px; order: -1; }
}
@media (max-width: 520px) {
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards4 { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
