/* ------------------------------------------------------------------
   L'Atelier — feuille de style unique.
   Thème sombre par défaut, variante claire automatique selon le réglage
   du visiteur. Toutes les couleurs sont des variables : pour changer
   l'ambiance du site, il suffit de toucher au bloc :root ci-dessous.
   ------------------------------------------------------------------ */

:root {
  --bg:        #0d0e11;
  --bg-soft:   #131519;
  --card:      #16181d;
  --card-hi:   #1c1f26;
  --line:      #272b33;
  --txt:       #e9eaee;
  --dim:       #9aa0aa;
  --dimmer:    #6f757f;
  --accent:    #e8a33d;
  --accent-dk: #b87c22;
  --accent-tx: #1a1205;
  --ok:        #4ec98a;
  --warn:      #f0b429;
  --radius:    14px;
  --maxw:      880px;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:      #f6f6f4;
    --bg-soft: #efefec;
    --card:    #ffffff;
    --card-hi: #fbfbf9;
    --line:    #e2e2dd;
    --txt:     #1b1c1f;
    --dim:     #63666d;
    --dimmer:  #8b8f97;
    --accent:  #b4761a;
    --accent-dk:#8d5c12;
    --accent-tx:#fffaf0;
    --shadow:  0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- en-tête / pied ---------- */

.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.site-head .wrap {
  display: flex; align-items: center; gap: 16px;
  padding-top: 18px; padding-bottom: 18px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--txt); }
.brand:hover { text-decoration: none; }
.brand b { font-size: 19px; letter-spacing: -.01em; }
.brand span { color: var(--dim); font-size: 13px; }
.site-nav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
.site-nav a { color: var(--dim); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--txt); text-decoration: none; }

.site-foot {
  border-top: 1px solid var(--line);
  margin-top: 64px; padding: 28px 0 48px;
  color: var(--dimmer); font-size: 13px;
}
.site-foot .wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.site-foot .sep { margin-left: auto; }

/* ---------- titres ---------- */

.hero { padding: 56px 0 8px; }
.hero h1 {
  margin: 0 0 10px; font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15; letter-spacing: -.02em;
}
.hero p { margin: 0; color: var(--dim); font-size: 17px; max-width: 60ch; }

h2 {
  font-size: 20px; letter-spacing: -.01em;
  margin: 48px 0 16px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
h3 { font-size: 16px; margin: 28px 0 8px; }

/* ---------- cartes d'app ---------- */

.apps { display: grid; gap: 14px; }

.app-card {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
  text-decoration: none; color: inherit;
  transition: border-color .15s, background .15s, transform .15s;
}
.app-card:hover {
  border-color: var(--accent-dk); background: var(--card-hi);
  text-decoration: none; transform: translateY(-1px);
}
.app-icon {
  flex: none; width: 52px; height: 52px; border-radius: 12px;
  background: var(--bg-soft); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 26px;
}
.app-icon img { width: 100%; height: 100%; border-radius: 11px; object-fit: cover; }
.app-body { min-width: 0; flex: 1; }
.app-body .t { font-weight: 650; font-size: 17px; }
.app-body .d { color: var(--dim); font-size: 14.5px; margin-top: 2px; }
.app-meta { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  font-size: 12px; color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 9px; background: var(--bg-soft); white-space: nowrap;
}

/* ---------- boutons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-tx);
  border: 1px solid transparent; border-radius: 10px;
  padding: 10px 16px; font-size: 14.5px; font-weight: 650;
  cursor: pointer; text-decoration: none; font-family: inherit;
}
.btn:hover { background: var(--accent-dk); color: #fff; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--txt); border-color: var(--line); }
.btn.ghost:hover { background: var(--card-hi); border-color: var(--dimmer); color: var(--txt); }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.btn .sub { font-weight: 400; opacity: .75; font-size: 12.5px; }

/* ---------- encadrés ---------- */

.note {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: var(--card); border-radius: 8px;
  padding: 14px 16px; margin: 20px 0; font-size: 14.5px;
}
.note b { color: var(--txt); }
.note.calm { border-left-color: var(--dimmer); }

ol.steps { padding-left: 0; counter-reset: s; list-style: none; margin: 20px 0; }
ol.steps > li {
  position: relative; padding-left: 42px; margin-bottom: 22px;
}
ol.steps > li::before {
  counter-increment: s; content: counter(s);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line);
  color: var(--accent); font-weight: 700; font-size: 14px;
  display: grid; place-items: center;
}
ol.steps > li b { display: block; margin-bottom: 2px; }

code, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}
pre {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-size: 13.5px;
}
pre code { background: none; border: none; padding: 0; }

ul.plain { padding-left: 20px; color: var(--dim); }
ul.plain li { margin: 5px 0; }
ul.plain b { color: var(--txt); font-weight: 600; }

/* ---------- livre d'or ---------- */

.gb-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.gb-form label { display: block; font-size: 13px; color: var(--dim); margin: 0 0 5px; }
.gb-form .field { margin-bottom: 14px; }
input[type=text], input[type=password], textarea {
  width: 100%; background: var(--bg-soft); color: var(--txt);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; font: inherit; font-size: 15px;
}
input:focus, textarea:focus { outline: 2px solid var(--accent-dk); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 110px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.msg { font-size: 14px; margin-top: 12px; }
.msg.ok { color: var(--ok); }
.msg.err { color: #ff8f7a; }

.entries { margin-top: 26px; display: grid; gap: 14px; }
.entry {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
.entry .who { font-weight: 650; }
.entry .when { color: var(--dimmer); font-size: 12.5px; margin-left: 8px; font-weight: 400; }
.entry .what { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry .app-ref { font-size: 12px; color: var(--dim); margin-top: 6px; }
.reply {
  margin-top: 14px; padding: 12px 14px;
  background: var(--bg-soft); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}
.reply .who { color: var(--accent); font-size: 13.5px; }
.reply .what { font-size: 14.5px; }
.entry.hidden-e { opacity: .55; border-style: dashed; }
.admin-tools { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

.empty { color: var(--dimmer); font-size: 14.5px; padding: 20px 0; }

@media (max-width: 560px) {
  .hero { padding-top: 36px; }
  .site-nav { width: 100%; margin-left: 0; }
  .app-card { padding: 15px; gap: 13px; }
}
