:root {
  --bg: #090a0b; --surface: #0e0f14; --raised: #1b1d24; --line: #2a2d36;
  --fg: #fff; --muted: #b6c1c8; --faint: rgb(255 255 255 / 0.4);
  --accent: #02d2e3; --accent-soft: rgb(2 210 227 / 0.25);
  --ok: #3ddc97; --bad: #ff6b6b;
  --font-sans: "Space Grotesk", system-ui, sans-serif; --font-display: "Oswald", Impact, sans-serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 20px clamp(16px, 4vw, 40px); }
.back { font-size: 13px; text-transform: uppercase; text-decoration: none; transition: color 150ms var(--ease); }
.back:hover { color: var(--accent); }
.brand { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

main { width: min(1240px, 100% - 2 * clamp(16px, 4vw, 40px)); margin: 0 auto; padding-bottom: 80px; }
.hero { padding: clamp(32px, 6vw, 72px) 0 36px; max-width: 820px; }
.eyebrow { font-size: 12px; font-weight: 500; text-transform: uppercase; color: var(--accent); letter-spacing: -0.02em; margin-bottom: 16px; }
.hero h1 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; line-height: 0.98; font-size: clamp(2.6rem, 7vw, 5rem); }
.lead { margin-top: 20px; color: var(--muted); font-size: 1.05rem; max-width: 62ch; }

.panel { position: relative; background: var(--surface); border: 1px solid var(--line); padding: clamp(20px, 3vw, 32px); margin-bottom: 28px; }
.step { display: flex; align-items: baseline; gap: 14px; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 3vw, 2rem); text-transform: uppercase; line-height: 1; margin-bottom: 22px; }
.step span { font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: var(--accent); letter-spacing: -0.02em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; background: var(--accent); color: var(--bg); border: 1px solid var(--accent); font: 500 14px/1 var(--font-sans); text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background 150ms var(--ease), color 150ms var(--ease), opacity 150ms; }
.btn:hover { background: transparent; color: var(--accent); }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--accent-soft); }
.btn.ghost:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 12px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; margin-left: 10px; }

/* tâches */
.tasks { display: grid; gap: 12px; }
.task { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px; padding: 16px 18px; background: var(--raised); border: 1px solid var(--line); transition: border-color 250ms var(--ease); }
.task .ico { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--accent-soft); color: var(--accent); font-size: 18px; }
.task b { display: block; font-size: 1.05rem; }
.task p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.state { min-width: 92px; text-align: right; font-size: 13px; text-transform: uppercase; color: var(--faint); }
.task.ok { border-color: var(--ok); }
.task.ok .ico { color: var(--ok); border-color: var(--ok); }
.task.ok .state { color: var(--ok); }
.task.ko .state { color: var(--bad); }
.verify { margin-top: 24px; max-width: 520px; }
.verify label, .form label { display: block; font-size: 13px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.row { display: flex; gap: 10px; }
input, textarea { width: 100%; min-height: 44px; padding: 10px 12px; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 0; font: 15px/1.4 var(--font-sans); text-transform: none; transition: border-color 150ms var(--ease); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, textarea:hover { border-color: #3a3e4a; }
input:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 96px; }
.msg { margin-top: 12px; min-height: 1.4em; font-size: 14px; color: var(--muted); }
.msg.bad { color: var(--bad); } .msg.good { color: var(--ok); }
.note { margin-top: 16px; padding: 12px 14px; border: 1px dashed var(--accent-soft); color: var(--muted); font-size: 14px; }
.note code, .how code, .hint code { font: 13px ui-monospace, Menlo, monospace; color: var(--accent); }

/* générateur */
.builder.locked .grid, .builder.locked .publish { display: none; }
.builder.locked > .step { opacity: 0.4; }
.builder.locked::after { content: "Termine l'étape 01 pour débloquer le générateur."; display: block; color: var(--faint); font-size: 14px; }
.banner { margin-bottom: 18px; padding: 10px 14px; background: var(--raised); border-left: 3px solid var(--accent); color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 28px; align-items: start; margin-bottom: 28px; }
.form { display: grid; gap: 18px; }
fieldset { margin: 0; padding: 18px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 14px; min-width: 0; }
legend { padding: 0 8px; font-family: var(--font-display); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hint { color: var(--faint); font-size: 12px; text-transform: none; font-weight: 400; }
.form label .hint { margin-left: 6px; }
.tpls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl { position: relative; cursor: pointer; }
.tpl input { position: absolute; opacity: 0; inset: 0; min-height: 0; }
.tpl span { display: block; height: 100%; padding: 12px; border: 1px solid var(--line); background: var(--raised); text-transform: uppercase; font-size: 13px; transition: border-color 150ms var(--ease), background 150ms; }
.tpl b { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 500; letter-spacing: 0.02em; }
.tpl small { display: block; margin-top: 4px; color: var(--muted); text-transform: none; font-size: 12px; line-height: 1.3; }
.tpl input:checked + span { border-color: var(--accent); background: rgb(2 210 227 / 0.08); }
.tpl input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-row { display: flex; gap: 16px; align-items: center; }
.photo-row label { margin: 0; }
.form label.btn { display: inline-flex; width: auto; margin: 0; color: var(--accent); }
.form label.btn:hover { color: var(--bg); }
.photo-prev { width: 72px; height: 72px; background: var(--raised) center / cover; border: 1px solid var(--line); flex: none; }
.rep { display: grid; gap: 12px; }
.entry { position: relative; padding: 14px; border: 1px solid var(--line); background: var(--raised); display: grid; gap: 10px; }
.entry .x { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.entry .x:hover { color: var(--bad); }
.entry .two { padding-right: 24px; }

.preview { position: sticky; top: 16px; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0 12px; text-transform: uppercase; font-size: 13px; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
#frame { display: block; width: 100%; height: min(78vh, 900px); border: 1px solid var(--line); background: #fff; }

.how { display: grid; gap: 10px; counter-reset: s; }
.how li { counter-increment: s; position: relative; padding-left: 38px; color: var(--muted); }
.how li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--accent-soft); color: var(--accent); font-size: 13px; }
.how b { color: var(--fg); font-weight: 500; }
.how a { color: var(--accent); }
.publish .hint { margin-top: 14px; font-size: 13px; }
.foot { padding: 28px; text-align: center; color: var(--faint); font-size: 13px; text-transform: uppercase; border-top: 1px solid var(--line); }

@media (max-width: 1080px) {
  .grid { grid-template-columns: 1fr; }
  .preview { position: static; }
  #frame { height: 70vh; }
}
@media (max-width: 640px) {
  .task { grid-template-columns: auto 1fr; }
  .task .btn { grid-column: 1 / -1; }
  .state { grid-column: 1 / -1; text-align: left; min-height: 0; }
  .state:empty { display: none; }
  .two, .three, .tpls { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .actions { width: 100%; } .actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
