/* Ciselo — feuille de style unique. Variables en haut, clair/sombre automatique. */

:root {
  --paper: #f6f7f4;
  --panel: #ffffff;
  --ink: #1b2320;
  --mute: #5e6b66;
  --line: #d5dbd6;
  --steel: #22658a;
  --on-steel: #ffffff;
  --ok: #2f7d4f;
  --bad: #a33a2e;
  --bad-bg: #f7e9e6;
  --check-a: #e3e6e1;
  --check-b: #ffffff;
  --radius: 6px;
  --measure: 60ch;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151a18;
    --panel: #1c2320;
    --ink: #e9ece7;
    --mute: #9aa6a0;
    --line: #2c3532;
    --steel: #6fb1d4;
    --on-steel: #10181d;
    --ok: #7fc69b;
    --bad: #e08a7d;
    --bad-bg: #2d1f1c;
    --check-a: #2a322f;
    --check-b: #1c2320;
  }
}

* { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Avenir", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--steel); text-underline-offset: 0.15em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); line-height: 1.1; letter-spacing: -0.015em; font-weight: 600; margin: 0 0 0.6em; max-width: 20ch; }
h2 { font-size: 1.25rem; font-weight: 600; margin: 2.5rem 0 0.5em; }
p { max-width: var(--measure); margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* En-tête */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; font-size: 1.35rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.mark { width: 1.1em; height: 1.1em; fill: var(--steel); }
.nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; font-size: 0.95rem; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { text-decoration: underline; }
.nav .lang { color: var(--mute); }
.credits { padding: 0.15rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; font-variant-numeric: tabular-nums; }
.inline { display: inline; }
button.link { background: none; border: 0; padding: 0; color: var(--ink); font: inherit; cursor: pointer; }
button.link:hover { text-decoration: underline; }

/* Page */
.page { max-width: 64rem; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.narrow { max-width: var(--measure); }
.hint { color: var(--mute); font-size: 0.9rem; }
.big { font-size: 1.5rem; font-weight: 600; }
.notice { padding: 0.6rem 0.9rem; border-left: 3px solid var(--steel); background: var(--panel); margin-bottom: 1rem; }
.notice.bad { border-color: var(--bad); background: var(--bad-bg); }

/* Boutons et champs */
.btn { display: inline-block; padding: 0.6rem 1.1rem; background: var(--steel); color: var(--on-steel); border: 0; border-radius: var(--radius); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.small { padding: 0.35rem 0.75rem; font-size: 0.9rem; }
.btn.disabled { opacity: 0.45; cursor: default; }
input[type="email"] { font: inherit; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); min-width: 0; flex: 1; }
input[aria-invalid="true"] { border-color: var(--bad); }
label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* Accueil : le texte à gauche, la coupe à droite */
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.pitch { font-size: 1.15rem; color: var(--mute); }
.signin { margin-top: 2rem; }
.demo { position: relative; aspect-ratio: 1; max-width: 26rem; justify-self: end; width: 100%; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.demo-before, .demo-after { position: absolute; inset: 0; display: grid; place-items: center; }
.demo-before { background: #c9cfc8; }
.demo-after { clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.demo-object { width: 46%; aspect-ratio: 3 / 4; background: var(--steel); border-radius: 4% 4% 48% 48% / 3% 3% 20% 20%; box-shadow: inset -1.2rem -0.6rem 0 rgba(0, 0, 0, 0.18); }
.demo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top right, transparent calc(50% - 1px), var(--ink) calc(50% - 1px), var(--ink) calc(50% + 1px), transparent calc(50% + 1px)); }
@media (max-width: 48rem) { .hero { grid-template-columns: 1fr; } .demo { justify-self: start; max-width: 20rem; } }

/* Damier pour montrer la transparence */
.checker {
  background-color: var(--check-b);
  background-image: linear-gradient(45deg, var(--check-a) 25%, transparent 25%, transparent 75%, var(--check-a) 75%),
                    linear-gradient(45deg, var(--check-a) 25%, transparent 25%, transparent 75%, var(--check-a) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}

/* Zone de dépôt : une table lumineuse, pas de pointillés */
.drop { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.05); }
.drop label { display: grid; gap: 0.5rem; justify-items: start; padding: 2.5rem 2rem; margin: 0; cursor: pointer; font-weight: 400; }
.drop label strong { font-size: 1.35rem; font-weight: 600; }
.drop label span:not(.btn) { color: var(--mute); max-width: var(--measure); }
.drop label .btn { margin-top: 0.75rem; }
.drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop:has(input:focus-visible) { outline: 2px solid var(--steel); outline-offset: 2px; }
.drop.htmx-request { opacity: 0.6; }

/* Liste des détourages : des lignes, pas des cartes */
.jobs { margin-top: 2rem; border-top: 1px solid var(--line); }
.jobs:empty::before { content: attr(data-empty); display: block; padding: 2rem 0; color: var(--mute); }
.job { display: grid; grid-template-columns: 5rem 5rem minmax(0, 1fr); gap: 1rem; align-items: center; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.thumb { margin: 0; width: 5rem; height: 5rem; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb .cut { width: 70%; height: 2px; background: var(--steel); transform: rotate(-40deg); }
.thumb .gone { font-size: 0.7rem; line-height: 1.2; text-align: center; padding: 0.25rem; color: var(--mute); }
.job-processing .thumb .cut { animation: sweep 1.1s linear infinite; }
@keyframes sweep { from { transform: rotate(-40deg) translateX(-18%); } to { transform: rotate(-40deg) translateX(18%); } }
.meta { display: grid; gap: 0.25rem; justify-items: start; }
.status { font-weight: 600; }
.job-done .status { color: var(--ok); }
.job-failed .status { color: var(--bad); }
.dims { color: var(--mute); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
@media (max-width: 36rem) { .job { grid-template-columns: 4rem 4rem minmax(0, 1fr); } .thumb { width: 4rem; height: 4rem; } }

/* Compte */
.key { padding: 0.8rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; font-size: 0.95rem; }

/* Packs de crédits : des lignes comme les détourages, le prix aligné */
.packs { list-style: none; padding: 0; margin: 0 0 0.75rem; border-top: 1px solid var(--line); }
.pack { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 0.5rem 1.25rem; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.pack-credits { font-weight: 600; }
.pack-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.pack form { margin: 0; }
@media (max-width: 36rem) { .pack { grid-template-columns: minmax(0, 1fr) auto; } .pack .hint { grid-column: 1; } }

/* Historique des achats */
.purchases { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.purchases th { text-align: left; font-weight: 600; color: var(--mute); }
.purchases th, .purchases td { padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--line); }
