/* ==========================================================================
   Sans Musique — style.css
   Thème sombre par défaut. Thème clair : <html data-theme="light">.
   Les classes posées par app.js : .over / .compact (#drop), .on (#status, #studio).
   ========================================================================== */

/* ---------- 1. Jetons ---------- */
:root {
  color-scheme: dark;
  --bg: #0E0F10;
  --s1: #141618;       /* surfaces : cartes, zone de dépôt */
  --s2: #1B1E21;       /* surfaces 2 : pistes, contrôles */
  --s3: #262A2E;       /* rails de curseur, survols */
  --line: #2B3035;
  --line2: #3B4248;
  --tx: #ECEAE6;
  --tx2: #A9ADB2;
  --tx3: #868B91;      /* ≥ 4.5:1 sur --bg et --s2 */
  --acc: #EE216C;      /* accent Anymatic */
  --pri: var(--acc);   /* bouton principal */
  --on-pri: #FFFFFF;
  --seg-on: #2E3338;
  --video-bg: #08090A;
  --dlg: #E8743B;      /* Dialogue — orange brûlé */
  --fx: #2FB5A9;       /* Effets — sarcelle */
  --mus: #D9B14C;      /* Musique — ocre (plus clair que --dlg : distinct sans la teinte) */
  --ok: #5CC08A;
  --err: #F07A6A;
  --focus: var(--acc);
  --acc-tx: var(--acc);  /* accent sur du petit texte (contraste ≥ 4.5:1) */
  --acc-soft: color-mix(in srgb, var(--acc) 14%, transparent);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --wrap: 1200px;
  --gutter: 24px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #F4F3F0;
  --s1: #FFFFFF;
  --s2: #ECEBE7;
  --s3: #DFDDD8;
  --line: #DAD7D1;
  --line2: #BDB9B1;
  --tx: #16181A;
  --tx2: #4A4F55;
  --tx3: #5F646B;
  --seg-on: #FFFFFF;
  --dlg: #B04E1C;
  --fx: #0C7870;
  --mus: #8A6612;
  --ok: #1E7A4B;
  --err: #B3321F;
  --acc-tx: #C8135A;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* .btn / .notice set display; hidden must still win */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { list-style: none; padding: 0; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: var(--tx); text-underline-offset: 3px; }
a:hover { color: var(--tx2); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.overline { font: 400 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--tx3); }
.section-head .overline, .faq-wrap .overline { color: var(--acc-tx); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: var(--r-sm); background: var(--pri); color: var(--on-pri); }
.skip:focus { top: 12px; }

/* ---------- 3. Composants ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--r-sm); border: 1px solid var(--line2);
  background: transparent; color: var(--tx);
  font: 500 15px/1.2 var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--tx2); color: var(--tx); }
.btn.pri { background: var(--pri); border-color: var(--pri); color: var(--on-pri); }
.btn.pri:hover { opacity: .9; color: var(--on-pri); }
.btn.block { width: 100%; }
.btn.lg { min-height: 50px; font-size: 16px; }
.btn:disabled { opacity: .55; cursor: progress; }

.icon {
  width: 44px; height: 44px; flex: none; padding: 0;
  display: inline-grid; place-items: center;
  border-radius: var(--r-sm); border: 1px solid transparent;
  background: transparent; color: var(--tx2); cursor: pointer;
}
.icon:hover { background: var(--s3); color: var(--tx); }
.icon[aria-pressed="true"] {
  background: color-mix(in srgb, var(--c, var(--tx)) 18%, transparent);
  border-color: color-mix(in srgb, var(--c, var(--tx)) 55%, transparent);
  color: var(--c, var(--tx));
}
.icon svg { width: 20px; height: 20px; }

/* Contrôle segmenté : boutons (aria-pressed), liens (aria-current) ou radios */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--s2); border: 1px solid var(--line); }
.seg > button, .seg > a, .seg .opt span {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 14px; border: 0; border-radius: 7px;
  background: transparent; color: var(--tx2);
  font: 500 14px/1 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
}
.seg > button[aria-pressed="true"], .seg > a[aria-current], .seg .opt input:checked + span {
  background: var(--seg-on); color: var(--tx); box-shadow: 0 1px 2px rgba(0,0,0,.22);
}
.seg .opt { position: relative; display: inline-flex; }
.seg .opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.seg .opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.seg small { font-size: 12px; color: var(--tx3); font-weight: 400; }

.chip {
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line2); background: transparent; color: var(--tx2);
  font: 500 14px/1 var(--font); cursor: pointer;
}
.chip:hover { color: var(--tx); border-color: var(--tx2); }
.chip[aria-pressed="true"] { background: var(--acc-soft); border-color: var(--acc); color: var(--tx); }

.badge { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tx2); }
.badge svg { width: 16px; height: 16px; color: var(--acc); flex: none; }

kbd { font: 12px var(--mono); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line2); border-bottom-width: 2px; color: var(--tx2); }

.bar { height: 6px; border-radius: 3px; background: var(--s3); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--acc); transition: width .2s linear; }

.card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--s1); padding: 24px; }

/* Curseurs : la couleur vient de --c, le remplissage de --v (ex. "40%") */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 28px; margin: 2px 0 0;
  background: transparent; cursor: pointer;
  --c0: var(--c, var(--tx));
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--c0) var(--v, 50%), var(--s3) var(--v, 50%));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px;
  border-radius: 50%; background: var(--bg); border: 3px solid var(--c0);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--s3); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--c0); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 3px solid var(--c0); }
input[type="range"]:focus-visible { outline-offset: 4px; border-radius: 4px; }

/* Messages (erreurs, avertissements) */
.notice { display: none; gap: 16px; padding: 20px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--s1); }
.notice.on { display: flex; }
.notice-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--s2); color: var(--tx); }
.notice-ico svg { width: 20px; height: 20px; }
.notice.is-error { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); }
.notice.is-error .notice-ico { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.notice-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.notice-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.notice-text { color: var(--tx2); font-size: 15px; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.notice-actions:empty { display: none; }
.notice code { font: 13px var(--mono); padding: 2px 6px; border-radius: 4px; background: var(--s2); }

/* ---------- 4. En-tête ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { height: 64px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--tx); }
.brand svg { width: 22px; height: 22px; }
.brand-logo { display: block; height: 20px; aspect-ratio: 896 / 199; background: currentColor; -webkit-mask: url(/logo.svg) no-repeat center / contain; mask: url(/logo.svg) no-repeat center / contain; }
.brand .brand-logo { height: 22px; }
.nav { display: flex; gap: 24px; margin-left: 12px; }
.nav a { font-size: 14px; color: var(--tx2); text-decoration: none; }
.nav a:hover { color: var(--acc-tx); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
@media (max-width: 760px) { .nav { display: none; } }

/* ---------- 5. Hero + outil ---------- */
.hero { padding: 88px 0 80px; }
.hero-copy { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-copy .overline { margin-bottom: 20px; }
.hero h1 { font-size: clamp(38px, 5.6vw, 72px); line-height: 1.04; letter-spacing: -.035em; font-weight: 700; max-width: 1180px; text-wrap: balance; }
.hero h1 span { color: var(--acc); }
.hero-lead { margin-top: 24px; max-width: 660px; font-size: clamp(17px, 1.6vw, 19px); color: var(--tx2); }
.hero-lead strong { color: var(--tx); font-weight: 600; }
.hero .nowrap { white-space: nowrap; }

.tool { max-width: 880px; margin: 44px auto 0; display: flex; flex-direction: column; gap: 16px; }


/* Zone de dépôt (#drop) */
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center; padding: 52px 24px 48px;
  border: 1.5px dashed var(--line2); border-radius: var(--r-lg); background: var(--s1);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover { border-color: var(--acc); }
.drop:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.drop input[type="file"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop-ico { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--acc-soft); color: var(--acc); }
.drop-ico svg { width: 26px; height: 26px; }
.drop-body { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
#drop-title { font-size: 21px; font-weight: 600; letter-spacing: -.01em; margin-top: 8px; }
.drop-sub { color: var(--tx2); font-size: 15px; }
.drop-sub u { color: var(--tx); text-underline-offset: 3px; text-decoration-color: var(--acc); text-decoration-thickness: 2px; }
.drop-formats { font: 12px var(--mono); letter-spacing: .06em; color: var(--tx3); margin-top: 8px; }
.drop-change { display: none; }

/* B — Glisser en cours : app.js ajoute .over ; le calque couvre toute la page */
.drop.over { border-style: solid; border-color: var(--acc); background: var(--s2); }
.drop-overlay {
  display: none; position: fixed; inset: 16px; z-index: 50;
  flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center;
  border: 2px dashed var(--tx); border-radius: 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  pointer-events: none;
}
.drop.over .drop-overlay { display: flex; }
.drop-overlay .drop-ico { width: 80px; height: 80px; border-radius: 18px; background: var(--acc); color: var(--on-pri); }
.drop-overlay .drop-ico svg { width: 34px; height: 34px; }
.drop-overlay strong { font-size: clamp(24px, 3vw, 36px); letter-spacing: -.025em; margin-top: 8px; }
.drop-overlay span { color: var(--tx2); }

/* E — Compact : app.js ajoute .compact après chargement */
.drop.compact { flex-direction: row; justify-content: flex-start; text-align: left; gap: 14px; padding: 12px 12px 12px 14px; border-style: solid; border-color: var(--line); }
.drop.compact .drop-ico { width: 40px; height: 40px; border-radius: 8px; }
.drop.compact .drop-ico svg { width: 20px; height: 20px; }
.drop.compact .drop-body { flex: 1; align-items: flex-start; gap: 0; }
.drop.compact #drop-title { font-size: 15px; margin: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop.compact .drop-sub, .drop.compact .drop-formats { display: none; }
.drop.compact .drop-body { flex-direction: row; align-items: baseline; gap: 12px; }
.drop-status { font: 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--tx3); white-space: nowrap; }
.drop:not(.compact) .drop-status, .drop:not(.compact) #batch-reset { display: none; }
.drop #batch-reset { margin-right: 6px; }
.drop.compact .drop-change { display: inline-flex; min-height: 40px; flex: none; }

/* Sous la zone : badges + qualité */
.tool-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 24px; }
.hero-copy .tool-meta { margin-top: 24px; }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.quality { display: flex; align-items: center; gap: 12px; }
.quality > span { font-size: 14px; color: var(--tx2); }

/* C, D — Progression (#status) */
#status:not(.on) { display: none; }
#status { background: var(--s1); }
#status .bar { width: min(100%, 360px); margin: 6px 0 4px; }
#status .bp-wait-note { max-width: 520px; }

/* H — Mobile / écran tactile : pas d'outil, un message clair */
.mobile-gate { display: none; flex-direction: column; gap: 12px; text-align: left; }
.mobile-gate strong { font-size: 20px; letter-spacing: -.01em; }
.mobile-gate p { color: var(--tx2); font-size: 15px; }
.mobile-gate small { font-size: 13px; color: var(--tx3); }
.no-gpu-note { display: none; }
@media (hover: none) and (pointer: coarse) {
  .tool .drop, .tool .quality, .tool .status { display: none; }
  .tool .mobile-gate { display: flex; }
}
html.is-mobile .tool .drop, html.is-mobile .tool .quality, html.is-mobile .tool .status { display: none; }
html.is-mobile .tool .mobile-gate { display: flex; }
/* G1 — Pas de WebGPU (app.js ou un test ajoute html.no-webgpu) */
html.no-webgpu .tool .drop, html.no-webgpu .tool .quality { display: none; }
html.no-webgpu .notice-gpu { display: flex; }

/* ---------- 6. Studio (E) ---------- */
.studio { display: none; }
.studio.on { display: block; }
.studio .bp-head { padding-left: 8px; }
.studio .hint { font-size: 13px; color: var(--tx3); padding-right: 10px; }
#media { cursor: pointer; }
#media:has(.audio-only) { cursor: default; }
.audio-only { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.audio-only canvas, .audio-only svg.wave { width: 100%; height: 96px; }
#play { color: var(--tx); }
#seek { flex: 1; margin: 0; }
#t-end { color: var(--tx2); }
.dot { width: 10px; height: 10px; flex: none; border-radius: 3px; background: var(--c); }
.demo-actions .btn.pri small { color: inherit; opacity: .75; }
.studio-foot { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 16px 20px; }
#export-state { min-height: 18px; font: 12px var(--mono); color: var(--tx3); text-align: right; overflow-wrap: anywhere; }

/* F — Après l'export : suggestion affiliée discrète (ajouter .on après le téléchargement) */
.after-export { display: none; border-top: 1px solid var(--line); padding-top: 12px; flex-direction: column; gap: 4px; }
.after-export.on { display: flex; }
.after-export a { font-size: 14px; color: var(--tx2); text-decoration: none; }
.after-export a:hover { color: var(--tx); text-decoration: underline; }
.after-export small { font-size: 12px; color: var(--tx3); }
.after-export small a, .aff-note a { font-size: inherit; color: inherit; text-decoration: underline; }

.studio-stats { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tx3); }
.studio-stats::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: none; }

/* ---------- 6b. File d'attente (plusieurs fichiers / dossier) ---------- */
/* Bouton « un dossier » dans la zone de dépôt : se lit comme le lien souligné voisin */
.linkish {
  padding: 0; border: 0; background: none; font: inherit; color: var(--tx); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--acc); text-decoration-thickness: 2px;
}
.linkish:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.drop.compact .linkish { display: none; }

/* with a preview the queue gets wider: preview on the left, the list as a side nav */
.hero:has(#batch.has-preview) .tool { max-width: 1240px; }

.batch { display: none; flex-direction: column; gap: 16px; }
.batch.on { display: flex; }
.text-btn { padding: 4px 0; border: 0; background: none; font: 14px var(--font); color: var(--tx3); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-btn:hover { color: var(--tx); }
.text-btn[hidden] { display: none; }
.batch-head h2 { font-size: 19px; letter-spacing: -.01em; }
.batch-body { display: grid; gap: 16px; align-items: start; }
.batch.has-preview .batch-body { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); }
.batch.has-preview .batch-list { max-height: none; }
.batch-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.batch-side .btn[hidden] { display: none; }
.batch.has-preview .batch-side .btn { width: 100%; }
.batch:not(.has-preview) .batch-side .btn { align-self: flex-start; }
.batch-actions:has(> .split[hidden]) { display: none; }
@media (max-width: 900px) { .batch.has-preview .batch-body { grid-template-columns: minmax(0, 1fr); } }

/* Preview of the selected output: video + 3 lanes, styled like the demo */
.bp { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--s1); }
.bp[hidden] { display: none; }
.bp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 6px 8px 10px; border-bottom: 1px solid var(--line); }
.bp-head .seg button:disabled { opacity: .4; cursor: progress; }
.bp-media .audio-only svg { width: 100%; height: 96px; color: var(--tx2); }
.bp-media { position: relative; aspect-ratio: 16 / 9; background: var(--video-bg); }
.bp-media video { width: 100%; height: 100%; object-fit: contain; cursor: pointer; display: block; }
.bp-media:has(.audio-only) { aspect-ratio: auto; background: var(--s1); }
.bp-media.loading::after { content: ''; position: absolute; inset: 0; margin: auto; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--acc); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
#bp-seek { flex: 1; margin: 0; }

/* processing panel: 3 lanes of bars that breathe, in the track colours */
.bp-wait { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 420px; padding: 32px 24px; text-align: center; }
.bp-wait[hidden] { display: none; }
.bp-wait-anim { width: min(100%, 360px); display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.bp-wait-lane { display: flex; align-items: center; justify-content: space-between; height: 28px; }
.bp-wait-lane i { width: 4px; height: 100%; border-radius: 2px; background: var(--c); transform: scaleY(.15); opacity: .35; animation: bp-wave 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * 45ms); }
.bp-wait-lane:nth-child(2) i { animation-delay: calc(var(--i) * 45ms + 200ms); }
.bp-wait-lane:nth-child(3) i { animation-delay: calc(var(--i) * 45ms + 400ms); }
@keyframes bp-wave { 0%, 100% { transform: scaleY(.15); opacity: .35; } 50% { transform: scaleY(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bp-wait-lane i { animation: none; transform: scaleY(.5); opacity: .7; } }
.bp-wait-title { font-size: 17px; font-weight: 600; max-width: 100%; overflow-wrap: anywhere; }
.bp-wait-stage { font: 13px var(--mono); color: var(--tx2); }
.bp-wait-note, .bp-wait-hint { font-size: 13px; color: var(--tx3); }
.bp-wait-note[hidden] { display: none; }
#bp-end { color: var(--tx2); }
.bp .lane .icon:disabled { opacity: .4; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--tx2); cursor: pointer; width: fit-content; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--acc); cursor: inherit; }
.check:has(input:disabled) { cursor: not-allowed; }

.batch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--s1); }
.job {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; column-gap: 12px;
  min-height: 52px; padding: 4px 6px 4px 14px; border-top: 1px solid var(--line);
}
.job:first-child { border-top: 0; }
.job-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); }
.job[data-status="running"] .job-dot { background: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
.job[data-status="done"] .job-dot { background: var(--ok); }
.job[data-status="error"] .job-dot { background: var(--err); }
.job-name { font: 14px var(--font); color: var(--tx); text-align: left; padding: 0; border: 0; background: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job[data-status="done"] { cursor: pointer; }
.job[data-status="done"]:hover { background: var(--s3); }
.job[aria-current="true"] { background: var(--acc-soft); box-shadow: inset 3px 0 0 var(--acc); }
.job-name:disabled { cursor: inherit; }
.job-dir { color: var(--tx3); }
.job-state { font: 12px var(--mono); font-variant-numeric: tabular-nums; color: var(--tx3); white-space: nowrap; text-align: right; }
.job[data-status="running"] .job-state { color: var(--tx2); }
.job[data-status="error"] .job-state { color: var(--err); }
.job-act { width: 40px; height: 40px; }
.job-act[hidden] { display: inline-grid; visibility: hidden; }
.job .bar { grid-column: 2 / -1; height: 3px; margin: 2px 6px 6px 0; display: none; }
.job[data-status="running"] .bar { display: block; }
@media (max-width: 560px) {
  .job { grid-template-columns: auto minmax(0, 1fr) auto; }
  .job-state { grid-column: 2; grid-row: 2; text-align: left; }
  .job-act { grid-column: 3; grid-row: 1 / span 2; }
}

.batch-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.batch-actions .btn[hidden] { display: none; }
.batch-actions { align-items: center; }
.batch-dl-hint { font-size: 13px; color: var(--tx3); }
.batch-dl-hint[hidden] { display: none; }
.split .btn:disabled { cursor: not-allowed; }

/* split button: Download all videos | ▾ (videos only / videos + audio tracks) */
.split { position: relative; display: inline-flex; }
.split[hidden] { display: none; }
.split > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-more { padding: 0 14px; margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.split-more svg { transition: transform .15s; }
.split-more[aria-expanded="true"] svg { transform: rotate(180deg); }
.split > .btn.pri + .btn.pri { border-left-color: color-mix(in srgb, var(--on-pri) 35%, transparent); }
.menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 100%; padding: 6px; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line2); border-radius: var(--r-md); background: var(--s2); box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.menu[hidden] { display: none; }
.menu-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 0; border-radius: var(--r-sm); background: none; color: var(--tx); font: 500 15px/1.3 var(--font); text-align: left; white-space: nowrap; cursor: pointer; }
.menu-item small { font: 12px var(--mono); color: var(--tx3); }
.menu-item:hover, .menu-item:focus-visible { background: var(--s3); outline: none; }

/* ---------- 7. Sections de la landing ---------- */
.section { border-top: 1px solid var(--line); padding: 96px 0; }
.section h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; letter-spacing: -.025em; font-weight: 700; }
.section .overline { margin-bottom: 12px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin-bottom: 32px; }
.section-head h2 { max-width: 640px; }
.section-lead { margin: 16px 0 40px; max-width: 640px; color: var(--tx2); font-size: 17px; }

/* Once a file is dropped, the visitor's own result replaces the demo (and its menu link) */
body:has(#drop.compact) #demo,
body:has(#drop.compact) a[href="/#demo"] { display: none; }

/* Démo avant / après — sons en Web Audio (demo.js) ; .lane.is-muted = piste coupée */
.demo-frame { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--s1); }
.demo-video { position: relative; aspect-ratio: 16 / 9; background: var(--video-bg); }
.demo-video video { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.demo-play { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--acc); color: var(--on-pri); cursor: pointer; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.demo-play:hover { filter: brightness(1.08); }
.demo-play svg { width: 26px; height: 26px; }
.demo.loading .demo-play { opacity: .6; cursor: progress; }
.demo.started .demo-play { display: none; }
.demo-transport { display: flex; align-items: center; gap: 12px; padding: 6px 20px 6px 8px; border-bottom: 1px solid var(--line); }
.demo-transport .icon { color: var(--tx); }
.demo-time { font: 13px var(--mono); font-variant-numeric: tabular-nums; min-width: 34px; }
#demo-end { color: var(--tx2); }
#demo-seek { flex: 1; margin: 0; }
.lanes { padding: 16px 12px 8px 20px; display: flex; flex-direction: column; gap: 6px; }
.lane { display: grid; grid-template-columns: 104px minmax(0, 1fr) 48px 44px 44px; align-items: center; gap: 4px 12px; }
.lane-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.lane > svg { width: 100%; height: 40px; color: var(--c); transition: opacity .15s; }
.lane .lvl { font: 13px var(--mono); text-align: right; color: var(--tx2); }
.lane.is-muted > svg { opacity: .18; }
.lane.is-muted .lvl { color: var(--tx3); }
.lane .icon svg { width: 20px; height: 20px; }
.lane .mute .spk-off, .lane .mute[aria-pressed="true"] .spk-on { display: none; }
.lane .mute[aria-pressed="true"] .spk-off { display: block; }
/* coupé = icône barrée, pas de surbrillance colorée */
.lane .mute[aria-pressed="true"] { background: transparent; border-color: transparent; color: var(--tx3); }
.lane .mute[aria-pressed="false"] { color: var(--c); }
.demo-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 8px 12px 16px 20px; }
.demo-actions .btn small { font-size: 12px; font-weight: 400; color: var(--tx3); }
.demo-note { margin-top: 16px; color: var(--tx3); font-size: 14px; }

/* Outils (affiliés) */
.aff-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tx3); max-width: 380px; }
.aff-note svg { width: 16px; height: 16px; flex: none; }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tool-card { display: flex; flex-direction: column; gap: 10px; padding: 22px; }
.tool-card header { display: flex; align-items: center; gap: 12px; }
.tool-logo { width: 44px; height: 44px; border-radius: 10px; border: 1px dashed var(--line2); display: grid; place-items: center; font: 10px var(--mono); color: var(--tx3); overflow: hidden; flex: none; }
.tool-logo img { width: 100%; height: 100%; object-fit: contain; }
.tool-card h3 { margin-top: 4px; font-size: 18px; }
.tool-card p { font-size: 14px; color: var(--tx2); }
.tool-card a { margin-top: auto; padding-top: 8px; font-size: 14px; font-weight: 500; }

/* FAQ */
.faq-wrap { display: flex; flex-wrap: wrap; gap: 32px 64px; }
.faq-wrap > div:first-child { flex: 1 1 280px; }
.faq { flex: 2 1 520px; min-width: 0; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 44px; padding: 18px 0; font-weight: 500; font-size: 17px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 20px var(--mono); color: var(--acc-tx); }
.faq summary:hover { color: var(--acc-tx); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 20px; max-width: 680px; color: var(--tx2); }

/* Pied de page */
.site-footer { border-top: 1px solid var(--line); background: var(--s1); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 40px 48px; padding-top: 56px; padding-bottom: 32px; }
.footer-grid > div:nth-child(1) { flex: 1 1 260px; max-width: 420px; margin-right: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-grid > div:not(:first-child) { flex: 0 1 180px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.footer-grid h2 { font: 400 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--tx3); }
.footer-grid p { font-size: 14px; color: var(--tx2); }
.footer-grid > div:not(:first-child) > a { font-size: 14px; }
.footer-base { padding-bottom: 32px; font-size: 13px; color: var(--tx3); }
.footer-links { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer-links a { color: var(--tx2); }
.footer-links a:hover { color: var(--acc-tx); }

/* Pages légales */
.legal { max-width: 760px; padding-top: 72px; padding-bottom: 96px; }
.legal-head { margin-bottom: 40px; }
.legal-head h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.15; letter-spacing: -.02em; margin-bottom: 12px; }
.legal-head p { color: var(--tx2); font-size: 16px; }
.legal section { padding: 28px 0; border-top: 1px solid var(--line); }
.legal h2 { font-size: 19px; letter-spacing: -.01em; margin-bottom: 14px; }
.legal p, .legal li { color: var(--tx2); font-size: 15.5px; line-height: 1.65; }
.legal p + p, .legal ul + p, .legal p + ul { margin-top: 12px; }
.legal ul { padding-left: 20px; list-style: disc; display: flex; flex-direction: column; gap: 6px; }
.legal strong { color: var(--tx); font-weight: 600; }
.legal a { color: var(--tx); text-underline-offset: 3px; }
.legal a.btn { color: var(--on-pri); }
.legal-updated { margin-top: 24px; font: 13px var(--mono); color: var(--tx3) !important; }

@media (max-width: 560px) {
  :root { --gutter: 20px; }
  .hero { padding: 56px 0 56px; }
  .section { padding: 72px 0; }
  .drop { padding: 40px 20px 36px; }
  .lane { grid-template-columns: 76px minmax(0, 1fr) 44px 44px; gap: 4px 8px; }
  .lane .lvl { display: none; }
  .lanes { padding-left: 14px; padding-right: 6px; }
  .demo-actions { padding-left: 14px; }
  .demo-actions .btn { width: 100%; }
  .demo-actions .btn small { display: none; }
  .demo-transport { padding-right: 14px; }
  .batch-side .btn, .split { width: 100%; }
  .split > .btn:first-child { flex: 1; }
  .tool-meta { justify-content: center; }
}
