/* ═══════════ Zygomatique — système visuel « suite de montage » ═══════════ */
:root {
  /* Surfaces graphite (du plus profond au plus élevé) */
  --bg: #191a22;
  --bg-deep: #101117;
  --s1: #20212b;
  --s2: #282a36;
  --s3: #323443;
  --text: #edebe5;
  --text-2: #b4b3bd;
  --muted: #8b8a96;
  --line: rgba(237, 235, 229, .09);
  --line-2: rgba(237, 235, 229, .16);

  /* Action : le marqueur d'entrée/sortie */
  --mango: #f3a83b;
  --mango-hi: #ffbf5e;
  --on-mango: #1b1408;

  /* Étiquettes de clips (catégories, pistes) */
  --iris: #8d88f4;
  --teal: #45c3aa;
  --rose: #ee7fa2;
  --sky: #5ba8ee;
  --lime: #b5cf6a;

  --r-xs: 4px;
  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;

  /* Typographie : trois rôles (titres, texte, timecodes), trois associations au choix */
  --font-display: "Big Shoulders Display", "Big Shoulders", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-tc: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --dw: 800;        /* graisse des titres */
  --ds: 1.12;       /* échelle des titres (une police étroite s'affiche plus grand) */
  --dtrack: .004em; /* interlettrage des titres */
  --dlh: .9;        /* interlignage des titres */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .5, 1);
  --bar-h: 76px;

  /* Alias de compatibilité (régie, page d'avis) */
  --paper: var(--bg);
  --ink: var(--text);
  --card: var(--s1);
  --chroma: var(--mango);
  --chroma-deep: var(--mango);
  --on-chroma: var(--on-mango);
  --spill: var(--rose);
  --radius-s: var(--r-s);
  --radius-m: var(--r-m);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .7);

  color-scheme: dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html[data-fonts="affiche"] {
  --font-display: "League Gothic", "Arial Narrow", sans-serif; --font: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-tc: "JetBrains Mono", ui-monospace, Menlo, monospace; --dw: 400; --ds: 1.22; --dtrack: .008em; --dlh: .88;
}
html[data-fonts="studio"] {
  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif; --font: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-tc: "DM Mono", ui-monospace, Menlo, monospace; --dw: 750; --ds: .84; --dtrack: -.03em; --dlh: .95;
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-behavior: smooth; scroll-padding-top: env(safe-area-inset-top, 0px); background: var(--bg); overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* Grain de pellicule, très léger, sur toute la page */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 300; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--mango); color: var(--on-mango); }
:focus-visible { outline: 2px solid var(--mango); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ───────── Boutons ───────── */
.btn {
  --b: var(--s2); --c: var(--text);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55em; cursor: pointer;
  min-height: 48px; padding: .7em 1.35em; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--b); color: var(--c); font-weight: 650; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: transform .18s var(--ease-out), background .18s, border-color .18s, box-shadow .18s;
}
.btn:hover { border-color: var(--line-2); background: var(--s3); }
.btn:active { transform: scale(.97); }
.btn.primary { --b: var(--mango); --c: var(--on-mango); border-color: transparent; box-shadow: 0 8px 28px -10px rgba(243, 168, 59, .65); }
.btn.primary:hover { background: var(--mango-hi); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--s1); }
.btn.small { min-height: 38px; padding: .45em 1em; font-size: .9rem; }
.btn.danger { --b: var(--rose); --c: #2a0d17; border-color: transparent; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }

/* ───────── Champs ───────── */
.field { display: grid; gap: .4rem; }
.field > span { font-size: .9rem; font-weight: 600; color: var(--text-2); }
.field small { color: var(--muted); font-size: .82rem; }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: .75rem .95rem; border-radius: var(--r-s);
  border: 1px solid var(--line-2); background: var(--bg-deep); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--mango); box-shadow: 0 0 0 3px rgba(243, 168, 59, .18); }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8a96' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; background-size: 18px; padding-right: 2.6rem; }
.check { display: flex; gap: .6rem; align-items: center; font-weight: 500; cursor: pointer; color: var(--text-2); }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--mango); }

.notice { padding: .85rem 1rem; border-radius: var(--r-s); font-size: .95rem; border: 1px solid; }
.notice.ok { background: color-mix(in srgb, var(--teal) 12%, var(--s1)); border-color: color-mix(in srgb, var(--teal) 40%, transparent); }
.notice.err { background: color-mix(in srgb, var(--rose) 12%, var(--s1)); border-color: color-mix(in srgb, var(--rose) 40%, transparent); }
.demo-flag {
  position: fixed; z-index: 90; bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px) + 12px); left: 12px; pointer-events: none;
  background: var(--s2); color: var(--text-2); border: 1px solid var(--line-2); font-size: .78rem; padding: .3rem .7rem; border-radius: 999px;
}
.stars { color: var(--mango); letter-spacing: .08em; }

/* Vignette de remplacement (mode démo, vidéo absente) */
.placeholder {
  position: absolute; inset: 0;
  background:
    radial-gradient(110% 60% at 25% 15%, hsl(var(--h) 70% 58% / .9), transparent 60%),
    radial-gradient(80% 55% at 85% 85%, hsl(calc(var(--h) + 50) 60% 45% / .85), transparent 65%),
    linear-gradient(170deg, hsl(calc(var(--h) + 200) 25% 18%), hsl(calc(var(--h) + 220) 30% 9%));
}
.placeholder::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
}

/* Rôles typographiques */
.display, h1, h2, h3 { font-family: var(--font-display); font-weight: var(--dw); letter-spacing: var(--dtrack); }
.num { font-family: var(--font-display); font-weight: var(--dw); letter-spacing: var(--dtrack); line-height: 1; }
.tcf { font-family: var(--font-tc); font-variant-numeric: tabular-nums; letter-spacing: 0; }

/* Logo */
.mark { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; font-family: var(--font-display); font-weight: var(--dw); letter-spacing: calc(var(--dtrack) + .02em); font-size: calc(1.2rem * var(--ds)); line-height: 1; }
.mark svg { width: 26px; height: 26px; flex: none; }
