/* ============================================================
   elio_pe — styles
   ============================================================ */
:root {
  --bg: #0a0a0a;
  --fg: #ecebe6;
  --dim: rgba(236, 235, 230, .58);
  --faint: rgba(236, 235, 230, .32);
  --line: rgba(236, 235, 230, .14);
  --panel: #111110;
  --accent: #ff4a1c;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pad: clamp(14px, 2.2vw, 32px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --tl-h: 118px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color: var(--fg); -webkit-text-size-adjust: 100%; }
body {
  font: 400 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  opacity: 0;
  transition: opacity .45s var(--ease);
}
body.ready { opacity: 1; }
body.leaving { opacity: 0; transition-duration: .25s; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }
ul, ol { list-style: none; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 7px 3px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--dim);
  white-space: nowrap;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Grain pellicule */
body::after {
  content: "";
  position: fixed;
  inset: -100px;
  z-index: 100;
  pointer-events: none;
  opacity: .09;
  mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .6s steps(4) infinite;
}
@keyframes grain {
  25% { transform: translate(-30px, 20px); }
  50% { transform: translate(20px, -40px); }
  75% { transform: translate(-10px, 30px); }
}

/* ---------- en-tête ---------- */
.chrome {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 16px;
  padding: var(--pad);
  color: var(--fg);
  text-shadow: 0 1px 14px rgba(0, 0, 0, .4);
  pointer-events: none;
  transition: opacity .5s var(--ease);
}
.chrome a { pointer-events: auto; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.rec { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: rec 1.6s steps(1) infinite; }
@keyframes rec { 50% { opacity: .15; } }
.nav { display: flex; gap: 22px; font-size: 14px; }
.nav a { position: relative; opacity: .7; transition: opacity .2s; }
.nav a:hover, .nav a[aria-current] { opacity: 1; }
.nav a[aria-current]::before {
  content: "";
  position: absolute;
  left: -10px; top: 50%;
  width: 4px; height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: currentColor;
}
.nav sup { font-family: var(--mono); font-size: 9px; margin-left: 3px; opacity: .7; }
.meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.meta .role { opacity: .6; }
.clock { opacity: .85; font-variant-numeric: tabular-nums; }
.meta a { border-bottom: 1px solid currentColor; padding-bottom: 1px; }

/* ---------- loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  cursor: pointer;
  transition: opacity .6s var(--ease);
}
.loader.out { opacity: 0; pointer-events: none; }
.ld-canvas { position: absolute; inset: 0; width: 100%; height: 100%; filter: brightness(.62) saturate(.9); }
.ld-canvas.ld-3d { filter: none; }
.ld-ui {
  position: absolute;
  left: var(--pad); right: var(--pad);
  bottom: calc(var(--pad) + 20px);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  color: var(--fg);
  text-shadow: 0 1px 14px rgba(0, 0, 0, .6);
}
.ld-name { font-family: var(--sans); font-size: 15px; font-weight: 600; letter-spacing: -.01em; text-transform: none; }
.ld-status b { color: var(--accent); font-weight: 400; font-variant-numeric: tabular-nums; }
.ld-bar { position: absolute; left: var(--pad); right: var(--pad); bottom: var(--pad); height: 1px; background: var(--line); }
.ld-bar i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.ld-skip { position: absolute; left: 0; right: 0; top: var(--pad); text-align: center; color: var(--faint); }

/* variante "barres de mire" */
.ld-bars { position: absolute; inset: 0; display: flex; }
.ld-bars i { flex: 1; transform-origin: 50% 0; transition: transform .5s var(--ease); }
.loader.out .ld-bars i { transform: scaleY(0); }
.ld-bars ~ .ld-ui span { background: rgba(10, 10, 10, .8); padding: 5px 9px 4px; border-radius: 2px; }

/* ---------- accueil ---------- */
.home { position: fixed; inset: 0; overflow: hidden; background: #000; }
.stage { position: absolute; inset: 0; }
/* Vidéos verticales : image entière, fond flouté pour remplir l'écran */
.stage-bg, .p-bg {
  position: absolute;
  inset: -6%;
  background: center / cover no-repeat;
  opacity: 0;
  transition: opacity .9s var(--ease);
}
.stage-bg { filter: blur(34px) brightness(.45) saturate(.8); }
.p-bg { filter: blur(40px) brightness(.38) saturate(.8); }
.stage.vert .stage-bg, .player.vert .p-bg { opacity: 1; }
.stage.vert video { object-fit: contain; }
.stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .9s var(--ease), transform 1.6s var(--ease);
}
.stage video.on { opacity: 1; transform: none; }
/* calque WebGL de fx.js : au-dessus des vidéos, sous les dégradés */
.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(10, 10, 10, .92) 0, rgba(10, 10, 10, .5) calc(var(--tl-h) + 140px), transparent 72%),
    linear-gradient(180deg, rgba(10, 10, 10, .5), transparent 22%);
}
.info {
  text-shadow: 0 2px 28px rgba(0, 0, 0, .55);
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: calc(var(--tl-h) + 18px);
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.idx { color: var(--dim); margin-bottom: 10px; }
.idx span { color: var(--fg); }
.title { font-size: clamp(44px, 8.4vw, 132px); font-weight: 500; letter-spacing: -.045em; line-height: .9; overflow: hidden; padding-bottom: .06em; }
.title span { display: inline-block; }
.info .tags { margin-top: 12px; }
.info-r { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px 12px;
  border-radius: 2px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 500;
  transition: background .2s, color .2s;
}
.btn span { transition: transform .25s var(--ease); }
.btn:hover { background: var(--accent); color: #fff; }
.btn:hover span { transform: translateX(4px); }
.hint { color: var(--faint); }

/* Timeline */
.timeline {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  height: var(--tl-h);
  padding: 0 var(--pad) var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.tl-head { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--dim); }
.tl-tc { color: var(--fg); font-variant-numeric: tabular-nums; }
.tl-right { display: flex; align-items: center; gap: 18px; }
.snd { display: flex; align-items: center; gap: 10px; }
.snd-label { color: var(--faint); }
.snd-btn { color: var(--dim); white-space: nowrap; transition: color .2s; }
.snd-btn:hover { color: var(--fg); }
.snd-btn.on { color: var(--accent); }

/* fader de volume */
.fader { -webkit-appearance: none; appearance: none; width: 92px; height: 14px; background: none; cursor: pointer; }
.fader::-webkit-slider-runnable-track { height: 1px; background: var(--line); }
.fader::-moz-range-track { height: 1px; background: var(--line); }
.fader::-webkit-slider-thumb { -webkit-appearance: none; width: 3px; height: 13px; margin-top: -6px; border-radius: 1px; background: var(--fg); }
.fader::-moz-range-thumb { width: 3px; height: 13px; border: 0; border-radius: 1px; background: var(--fg); }
.snd-btn.on ~ .fader::-webkit-slider-thumb { background: var(--accent); }
.p-bar .fader { width: 80px; }
.tl-row { display: flex; gap: 10px; }
.tl-label { display: grid; place-items: center; width: 30px; border: 1px solid var(--line); border-radius: 2px; color: var(--dim); font-size: 10px; }
.tl { position: relative; flex: 1; cursor: ew-resize; user-select: none; touch-action: none; }
.tl.drag { cursor: grabbing; }
.ruler { position: relative; height: 16px; border-bottom: 1px solid var(--line); }
.ruler i { position: absolute; bottom: 0; width: 1px; height: 4px; background: var(--faint); }
.ruler i.big { height: 8px; background: var(--dim); }
.ruler b { position: absolute; left: 4px; bottom: 3px; font: 400 9px/1 var(--mono); color: var(--faint); white-space: nowrap; }
.track { display: flex; height: 46px; margin-top: 4px; }
.clip {
  position: relative;
  min-width: 0;
  height: 100%;
  border-right: 2px solid var(--bg);
  border-radius: 3px;
  background: #1a1a19 center / cover no-repeat;
  overflow: hidden;
  opacity: .5;
  text-align: left;
  transition: opacity .3s;
}
.clip::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 10, 10, .75), rgba(10, 10, 10, .1)); }
.clip span {
  position: absolute;
  left: 8px; right: 8px; top: 6px;
  font: 400 10px/1.2 var(--mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clip:hover { opacity: .8; }
.clip.on { opacity: 1; outline: 1px solid var(--accent); outline-offset: -1px; }
.playhead { position: absolute; top: 0; bottom: 0; left: 0; z-index: 3; width: 1px; background: var(--accent); pointer-events: none; will-change: transform; }
.playhead::before, .scrub-head::before {
  content: "";
  position: absolute;
  top: 0; left: -5px;
  border: 5px solid transparent;
  border-top: 7px solid var(--accent);
  border-bottom: 0;
}

/* ---------- liste des projets ---------- */
.work { min-height: 100svh; padding: calc(var(--pad) + 90px) var(--pad) 80px; }
.work-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 36px; }
.work-head h1 { font-size: clamp(56px, 11vw, 170px); font-weight: 500; letter-spacing: -.05em; line-height: .85; }
.work-head sup { font: 400 12px var(--mono); letter-spacing: .06em; vertical-align: top; margin-left: 6px; color: var(--dim); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 7px 11px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--dim);
  transition: color .2s, border-color .2s, background .2s;
}
.chip:hover { color: var(--fg); border-color: var(--faint); }
.chip.on { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.bin { border-top: 1px solid var(--line); }
.bin-head, .bin-row a {
  display: grid;
  grid-template-columns: 44px minmax(0, 2.4fr) minmax(0, 1.1fr) minmax(0, 2fr) 60px 108px;
  gap: 16px;
  align-items: center;
}
.bin-head { padding: 10px 0; color: var(--faint); border-bottom: 1px solid var(--line); }
.bin-row { border-bottom: 1px solid var(--line); }
.bin-row a { padding: 18px 0; transition: opacity .3s; }
.bin-row .t { font-size: clamp(20px, 2.4vw, 34px); font-weight: 500; letter-spacing: -.03em; line-height: 1.05; transition: transform .4s var(--ease); }
.bin-row .n, .bin-row .c, .bin-row .y, .bin-row .d { color: var(--dim); }
.bin-row .n { transition: color .2s; }
.bin-row .r { display: flex; flex-wrap: wrap; gap: 5px; }
.bin-thumb { display: none; }
.bin:hover .bin-row a { opacity: .4; }
.bin .bin-row a:hover { opacity: 1; }
.bin-row a:hover .t { transform: translateX(10px); }
.bin-row a:hover .n { color: var(--accent); }
.hover-prev { position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none; }
.hover-prev > div {
  width: clamp(240px, 24vw, 380px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 2px;
  background: #111;
  opacity: 0;
  transform: translate(28px, -50%) scale(.6);
  transition: opacity .25s, transform .45s var(--ease);
}
.hover-prev.on > div { opacity: 1; transform: translate(28px, -50%); }
.hover-prev.vert > div { width: clamp(150px, 13vw, 230px); aspect-ratio: 9 / 16; }
.hover-prev video { width: 100%; height: 100%; object-fit: cover; }

/* ---------- page projet ---------- */
.player { position: fixed; inset: 0; overflow: hidden; background: #000; }
.player::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 150px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent);
  pointer-events: none;
  transition: opacity .5s var(--ease);
}
body.idle .player::after { opacity: 0; }
#pv { position: relative; width: 100%; height: 100%; object-fit: contain; transition: transform .7s var(--ease), filter .7s var(--ease); }
body.panel-open #pv { transform: scale(.94) translateX(-10%); filter: blur(10px) brightness(.45); }
.p-ui {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 140px var(--pad) var(--pad);
  background: linear-gradient(0deg, rgba(0, 0, 0, .85), transparent);
  transition: opacity .5s var(--ease);
}
body.idle { cursor: none; }
body.idle .p-ui, body.idle .chrome { opacity: 0; }
body.panel-open .p-ui { opacity: 0; pointer-events: none; }
.p-title h1 { font-size: clamp(34px, 5.6vw, 88px); font-weight: 500; letter-spacing: -.045em; line-height: .9; margin-bottom: 12px; }
.p-title .tags { margin-bottom: 22px; }
.p-bar { display: flex; align-items: center; gap: 18px; }
.p-bar button { padding: 6px 0; opacity: .75; white-space: nowrap; transition: opacity .2s, color .2s; }
.p-bar button:hover { opacity: 1; }
.p-bar button.hot { opacity: 1; color: var(--accent); }
#play { min-width: 44px; text-align: left; }
.p-tc { color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.scrub { position: relative; flex: 1; height: 26px; display: flex; align-items: center; cursor: ew-resize; touch-action: none; }
.scrub-track { position: relative; width: 100%; height: 2px; background: var(--line); transition: height .2s; }
.scrub:hover .scrub-track { height: 4px; }
.scrub-buf, .scrub-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); }
.scrub-buf { background: var(--faint); opacity: .5; }
.scrub-fill { background: var(--fg); }
.scrub-ticks i { position: absolute; bottom: 5px; width: 1px; height: 4px; background: var(--faint); }
.scrub-ticks i.big { height: 8px; }
.scrub-head { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--accent); pointer-events: none; }

/* Panneau breakdown */
.scrim { position: fixed; inset: 0; z-index: 70; display: none; }
body.panel-open .scrim { display: block; }
.panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 80;
  width: min(540px, 100%);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--panel);
  border-left: 1px solid var(--line);
  transform: translateX(102%);
  transition: transform .6s var(--ease);
}
body.panel-open .panel { transform: none; }
.panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.panel-head span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.panel-close { color: var(--dim); }
.panel-close:hover { color: var(--fg); }
.panel-body { padding: 24px 24px 40px; }
.panel-body h2 { font-size: 34px; font-weight: 500; letter-spacing: -.035em; line-height: 1; margin-bottom: 14px; }
.desc { max-width: 60ch; color: var(--dim); font-size: 15px; line-height: 1.55; }
.facts { margin: 26px 0 30px; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dt { font: 400 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.bd-list { display: grid; gap: 22px; }
.bd img, .bd video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; background: #000; }
.bd figcaption { display: flex; gap: 10px; align-items: baseline; margin-top: 8px; color: var(--dim); font-size: 13px; }
.bd figcaption .mono { color: var(--accent); }
.compare { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 2px; cursor: ew-resize; touch-action: none; user-select: none; }
.compare img { position: absolute; inset: 0; height: 100%; pointer-events: none; }
.compare .before { clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.compare-bar { position: absolute; top: 0; bottom: 0; left: var(--x); width: 1px; background: var(--fg); }
.compare-bar::after {
  content: "";
  position: absolute;
  top: 50%; left: -13px;
  width: 26px; height: 26px;
  margin-top: -13px;
  border: 1px solid var(--fg);
  border-radius: 50%;
  background: rgba(10, 10, 10, .55);
}
.compare-l, .compare-r { position: absolute; top: 10px; padding: 3px 6px; background: rgba(10, 10, 10, .7); font-size: 10px; }
.compare-l { left: 10px; }
.compare-r { right: 10px; }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 36px; background: var(--line); border: 1px solid var(--line); }
.pn a { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: var(--panel); font-size: 17px; font-weight: 500; letter-spacing: -.02em; transition: background .2s; }
.pn a:last-child { align-items: flex-end; text-align: right; }
.pn a:hover { background: #1a1a19; }
.pn .mono { color: var(--faint); }
.keys { margin-top: 22px; color: var(--faint); line-height: 1.8; }

/* ---------- à propos ---------- */
.about {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  padding: calc(var(--pad) + 110px) var(--pad) var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 60px;
}
.about-bg { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; opacity: .2; filter: grayscale(1) contrast(1.1); }
.statement { max-width: 24ch; font-size: clamp(28px, 3.8vw, 58px); font-weight: 500; letter-spacing: -.04em; line-height: 1.04; }
.about-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.about-cols h2 { color: var(--faint); margin-bottom: 12px; }
.about-cols li { font-size: 15px; line-height: 1.7; }
.about-cols a { border-bottom: 1px solid var(--line); transition: border-color .2s; }
.about-cols a:hover { border-color: var(--fg); }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .bin-head { display: none; }
  .bin-row a {
    grid-template-columns: 1fr auto;
    grid-template-areas: "img img" "t y" "r r";
    row-gap: 10px;
    padding: 22px 0;
  }
  .bin-thumb { display: block; grid-area: img; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; }
  .bin-row .n, .bin-row .c, .bin-row .d { display: none; }
  .bin-row .t { grid-area: t; }
  .bin-row .y { grid-area: y; }
  .bin-row .r { grid-area: r; }
  .bin:hover .bin-row a { opacity: 1; }
}
@media (max-width: 760px) {
  :root { --tl-h: 104px; }
  .chrome { grid-template-columns: auto 1fr auto; }
  .nav { justify-content: center; }
  .meta .role, .clock { display: none; }
  .info { flex-direction: column; align-items: flex-start; }
  .info-r { align-items: flex-start; }
  .hint, .ruler b, .clip span { display: none; }
  .tl-head { gap: 12px; }
  .tl-head > span:first-child, .snd-label { display: none; }
  .tl-right { gap: 12px; }
  .fader { width: 64px; }
  .p-bar { flex-wrap: wrap; gap: 8px 16px; }
  .scrub { order: -1; flex-basis: 100%; }
  .p-tc { margin-right: auto; }
  .about-cols { grid-template-columns: 1fr 1fr; row-gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
