/* ==========================================================================
   DevLog — carnet de build
   Palette volontairement éloignée des defaults IA (pas de crème+terracotta,
   pas de noir quasi-pur + un seul accent néon). Encre bleu-nuit, laiton,
   sauge et rose poussière comme indicateurs sémantiques (à la git diff).
   Dualité typographique : le mono documente la machine (dates, tags, code),
   le serif porte la prose rédigée — exactement le geste que fait l'outil.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ink: #151A21;
  --panel: #1E252E;
  --panel-raised: #242C37;
  --paper: #E8E6DE;
  --muted: #8B93A1;
  --brass: #D9A441;
  --brass-dim: rgba(217, 164, 65, 0.25);
  --sage: #5FA777;
  --dusty-rose: #C1666B;
  --line: rgba(232, 230, 222, 0.1);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a { color: var(--brass); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 150ms ease; touch-action: manipulation; }
a:hover { color: #ecc678; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

#accueil, #projets, #contribuer, #administration {
  scroll-margin-top: 1.5rem;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand__dot { color: var(--brass); }

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.4em 0.2em;
}

.link-btn:hover { color: var(--paper); }

.hamburger {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 38px;
  height: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
  transition: border-color 150ms ease;
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--paper);
  border-radius: 1px;
  transition: opacity 150ms ease;
}

.hamburger:hover { border-color: var(--brass); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }

.nav-panel {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.nav-panel a {
  padding: 0.9em 1.5rem;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.nav-panel a:last-child { border-bottom: none; }
.nav-panel a:hover { color: var(--brass); background: var(--panel-raised); }

/* ---------- Accueil (hero) ---------- */

.hero {
  padding: 4rem 0 3.5rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 800px 400px at 15% -10%, rgba(217, 164, 65, 0.08), transparent),
    var(--ink);
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.hero__kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brass);
  margin: 0 0 0.6em;
}

.hero__title {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  max-width: 16ch;
  margin-bottom: 0.4em;
}

.hero__lead {
  max-width: 46ch;
  color: var(--paper);
  opacity: 0.8;
  margin: 0 0 1.5em;
}

.hero__stats {
  display: flex;
  gap: 1.75rem;
  margin: 0 0 1.75em;
  font-family: var(--font-mono);
}

.hero__stat-value {
  display: block;
  font-size: 1.4rem;
  color: var(--brass);
  font-variant-numeric: tabular-nums;
}

.hero__stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2em;
}

.hero__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Panneau décoratif : trois "entrées" factices qui font écho au carnet de build réel
   plus bas sur la page — purement visuel, masqué aux lecteurs d'écran. */
.hero__glyph {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
}

.hero__glyph-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  animation: rise 0.5s ease-out both;
}

.hero__glyph-row:last-child { border-bottom: none; }
.hero__glyph-row:nth-child(2) { animation-delay: 0.1s; }
.hero__glyph-row:nth-child(3) { animation-delay: 0.2s; }

.hero__glyph-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hero__glyph-bars { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; }

.hero__glyph-bar {
  height: 7px;
  border-radius: 3px;
  background: var(--line);
}

.hero__glyph-bar--wide { width: 85%; }
.hero__glyph-bar--mid { width: 55%; }
.hero__glyph-bar--narrow { width: 35%; }

@media (prefers-reduced-motion: reduce) {
  .hero__glyph-row { animation: none; }
}

@media (max-width: 780px) {
  .hero__inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero__glyph { order: -1; }
}

/* ---------- Contribuer ---------- */

.contribute {
  padding: 3rem 0;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.contribute p { color: var(--paper); opacity: 0.85; max-width: 55ch; }

/* ---------- Bannières de statut ---------- */

.banner {
  margin: 1.25rem auto 0;
  max-width: 760px;
  padding: 0.85em 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  border-left: 3px solid var(--muted);
}

.banner--info { border-color: var(--muted); color: var(--paper); }
.banner--success { border-color: var(--sage); color: var(--paper); }
.banner--warn { border-color: var(--brass); color: var(--paper); background: rgba(217,164,65,0.08); }
.banner--error { border-color: var(--dusty-rose); color: var(--paper); background: rgba(193,102,107,0.08); }

/* ---------- Carnet de build (chronologie) ---------- */

.log {
  list-style: none;
  margin: 2.5rem 0;
  padding: 0;
}

.log-entry {
  position: relative;
  margin-left: 6px;
  padding-left: 2rem;
  padding-bottom: 2.75rem;
  border-left: 2px solid var(--brass-dim);
  animation: rise 0.4s ease-out both;
}

.log-entry:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.log-dot {
  position: absolute;
  left: -7px;
  top: 0.3rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 0 4px var(--ink);
}

.log-meta {
  display: flex;
  gap: 0.75em;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.4em;
}

.log-code { color: var(--brass); }

.log-title { font-size: 1.35rem; margin-bottom: 0.35em; }
.log-title a { color: var(--paper); }
.log-title a:hover { color: var(--brass); }

.log-hook {
  color: var(--paper);
  opacity: 0.85;
  margin: 0 0 0.6em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.log-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  padding: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.log-tags li {
  border: 1px solid var(--line);
  padding: 0.25em 0.6em;
  color: var(--muted);
}

.empty {
  padding: 3rem 0;
  color: var(--muted);
  font-family: var(--font-mono);
}

.section-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 3.5rem 0 0;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.log-series {
  color: var(--brass);
}

.project-series {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--brass);
  margin: -0.5em 0 1.5em;
}

/* ---------- Administration ---------- */

.admin {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.admin__title {
  font-size: 1.1rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.field {
  display: block;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.field > span {
  display: block;
  margin-bottom: 0.4em;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.6em 0.75em;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.field textarea {
  resize: vertical;
  line-height: 1.5;
}

.field__hint {
  display: block;
  margin-top: 0.35em;
  color: var(--muted);
  font-size: 0.75rem;
  font-family: var(--font-body);
  font-style: italic;
}

.field__hint--ok {
  color: var(--sage);
  font-style: normal;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field-inline {
  display: flex;
  gap: 0.5rem;
}

.field-inline select { flex: 1; }

.form__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--brass);
  color: var(--ink);
  border: none;
  border-radius: 6px;
  padding: 0.65em 1.2em;
  cursor: pointer;
  font-weight: 500;
}

.btn:hover { background: #ecc678; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--ghost {
  background: none;
  color: var(--paper);
  border: 1px solid var(--line);
}

.btn--ghost:hover { border-color: var(--brass); color: var(--brass); background: none; }

.hint {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.preview {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--line);
}

.automation {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--line);
}

.article-form {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--line);
}

.preview__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------- Page projet statique (générée par build.js) ---------- */

.project-page {
  padding: 3rem 0 5rem;
}

.project-back {
  display: inline-block;
  margin-bottom: 2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.project-title {
  font-size: 2.2rem;
  margin-bottom: 0.3em;
}

.project-hook {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--brass);
  border-left: 2px solid var(--brass);
  padding-left: 1em;
  margin: 1.5em 0 2em;
}

.project-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 1.75em;
  background: var(--panel);
}

.project-media {
  margin: 2em 0;
}

.project-media-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.project-media-video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.project-media-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.project-media--svg {
  margin: 1.75em 0;
}

.project-media-svg {
  display: flex;
  justify-content: center;
  padding: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.project-media-svg svg { max-width: 100%; height: auto; }

.project-media figcaption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.6em;
  text-align: center;
}

.project-body p {
  margin: 0 0 1.3em;
}

.project-body h2 {
  font-size: 1.4rem;
  margin-top: 1.8em;
}

.project-body h3 {
  font-size: 1.15rem;
  margin-top: 1.5em;
}

.project-body ul, .project-body ol {
  margin: 0 0 1.3em;
  padding-left: 1.4em;
  color: var(--paper);
}

.project-body li { margin-bottom: 0.4em; }

.project-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--panel);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.project-body pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1em 1.25em;
  overflow-x: auto;
  margin: 0 0 1.5em;
}

.project-body pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
  line-height: 1.55;
}

.project-body strong { color: var(--paper); }

.project-tags, .project-stack {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  padding: 0;
  margin: 0.5em 0 1.5em;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-tags li, .project-stack li {
  border: 1px solid var(--line);
  padding: 0.25em 0.6em;
  color: var(--muted);
}

.project-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* ---------- Mouvement ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .log-entry { animation: none; }
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .site-header__inner { padding: 1rem; }
  .project-title { font-size: 1.6rem; }
}
