/* Police d'affichage auto-hebergee (aucune requete externe, CSP intacte).
   Space Grotesk variable, sous-ensemble latin — couvre les accents FR. */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/space-grotesk.woff2") format("woff2");
}

/* Identite : encre chaude, accent ambre (signal), une couleur par domaine.
   Tout passe par ces jetons ; les deux themes les redefinissent en bloc. */
:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-hover: #1d212a;
  --border: #2a2f3a;
  --text: #ece9e2;
  --text-muted: #9c9ba6;
  --accent: #e6b450;
  --accent-soft: rgba(230, 180, 80, 0.14);
  --accent-ink: #1a1405;
  --ok: #4ccf8a;
  --danger: #ff6b6b;
  --radius: 12px;
  --max-width: 1080px;
  --cat-soc: #ff6b6b;
  --cat-infra: #4ccf8a;
  --cat-dev: #a78bfa;
  --cat-conformite: #5aa9ff;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --rail-w: 264px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf8f3;
    --surface: #ffffff;
    --surface-hover: #f3f0e8;
    --border: #e2ddd2;
    --text: #1b1a17;
    --text-muted: #6a6972;
    --accent: #a56f0b;
    --accent-soft: rgba(165, 111, 11, 0.10);
    --accent-ink: #ffffff;
    --ok: #17874d;
    --danger: #d9483b;
    --cat-soc: #d9483b;
    --cat-infra: #17874d;
    --cat-dev: #6f4fd1;
    --cat-conformite: #1f6fd0;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); transition: color .15s ease; }

h1, h2, h3 { font-family: var(--display); }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.15; margin: 0 0 .4rem; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; margin: 0 0 .35rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.eyebrow {
  margin: 0 0 .5rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
}

.subtitle { margin: 0 0 1rem; color: var(--text-muted); font-size: 1.05rem; }
.muted { color: var(--text-muted); font-size: .9rem; }
.empty { color: var(--text-muted); font-style: italic; }

/* ------------------------------------------------------------------ layout */

.page {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  container: cmain / inline-size;
}

.page-narrow { max-width: 720px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; text-decoration: none; color: var(--text); }

.monogram {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.ghost-link { color: var(--text-muted); text-decoration: none; font-size: .9rem; }
.ghost-link:hover { color: var(--text); }

.admin-nav { display: flex; gap: 1.25rem; align-items: center; font-size: .92rem; }
.admin-nav a { text-decoration: none; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .88rem;
}

.footer-links { display: flex; gap: 1rem; }

/* -------------------------------------------------------------------- gate */

.gate {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 3rem 1.5rem;
}

.gate-card {
  width: 100%;
  max-width: 420px;
  padding: 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.gate-intro { color: var(--text-muted); font-size: .95rem; }

.gate-form { display: grid; gap: .55rem; margin-top: 1.75rem; }
.gate-form label { font-size: .85rem; font-weight: 600; color: var(--text-muted); }

.gate-form input[type="text"] {
  font-size: 1.35rem;
  letter-spacing: .3em;
  text-align: center;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

/* ------------------------------------------------------------------- forms */

input, textarea, button, select {
  font: inherit;
  color: inherit;
}

input[type="text"], input[type="password"], input[type="url"],
input[type="number"], input:not([type]), textarea {
  width: 100%;
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

input:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

textarea { resize: vertical; }

button, .button {
  display: inline-block;
  padding: .7rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s ease;
}

button:hover, .button:hover { filter: brightness(1.1); }

.button-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.inline-form input { flex: 1 1 170px; width: auto; }

.stacked-form {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.stacked-form label { display: grid; gap: .35rem; font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkbox { display: flex !important; flex-direction: row; align-items: center; gap: .5rem; }
.checkbox input { width: auto; }

.alert {
  margin: 1.25rem 0 0;
  padding: .7rem .9rem;
  border: 1px solid var(--danger);
  border-radius: 8px;
  background: rgba(248, 81, 73, .1);
  color: var(--danger);
  font-size: .9rem;
}

/* ------------------------------------------------------------------ content */

.hero { margin-bottom: 3rem; }
.hero-note { max-width: 55ch; color: var(--text-muted); }

/* ---- Accueil RH / direction : le trajet de la requête ---- */

.story {
  position: relative;
  margin: 1.75rem 0 0;
  padding: 2rem 2rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(60% 80% at 18% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
  overflow: hidden;
}

.story-kicker {
  margin: 0 0 .5rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.story-title {
  margin: 0 0 1.75rem;
  max-width: 38ch;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.journey {
  display: grid;
  grid-template-columns: 1fr 3.5rem 1fr 3.5rem 1fr 3.5rem 1fr;
  align-items: start;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.journey-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  min-width: 0;
}

.journey-step strong { font-size: 1rem; }
.journey-step > span:last-child { font-size: .88rem; line-height: 1.45; color: var(--text-muted); }

.journey-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: .35rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
}

.journey-icon svg { width: 1.35rem; height: 1.35rem; }

.journey-step.is-key .journey-icon {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 24px -6px var(--accent);
}

.journey-step.is-key strong { color: var(--accent); }

.journey-link {
  position: relative;
  align-self: start;
  width: 100%;
  height: 2px;
  margin-top: calc(2.75rem / 2 - 1px);
  border-radius: 2px;
  background: color-mix(in srgb, var(--text-muted) 35%, transparent);
  overflow: hidden;
}

.journey-link::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: journey-pulse 2.4s linear infinite;
}

.journey-link:nth-of-type(4)::after { animation-delay: .8s; }
.journey-link:nth-of-type(6)::after { animation-delay: 1.6s; }

@keyframes journey-pulse {
  to { left: 100%; }
}

.story-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .75rem;
  margin: 1.75rem 0 0;
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--border);
}

.story-facts div { display: grid; gap: .1rem; }
.story-facts dt { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.story-facts dd { margin: 0; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.story-note {
  max-width: 62ch;
  margin: 1.4rem 0 0;
  color: var(--text);
}

.story-cta {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.story-cta::after { content: '→'; transition: transform .18s ease; }
.story-cta:hover::after { transform: translateX(3px); }

@media (max-width: 760px) {
  .story { padding: 1.5rem 1.25rem; }
  .journey { grid-template-columns: 1fr; gap: .25rem; }
  .journey-step { display: grid; grid-template-columns: 2.75rem 1fr; column-gap: .9rem; row-gap: .15rem; align-items: start; }
  .journey-icon { grid-row: 1 / 3; margin: 0; }
  .journey-link { width: 2px; height: 1.75rem; margin: 0 0 0 calc(2.75rem / 2 - 1px); }
  .journey-link::after { top: -40%; left: 0; width: 100%; height: 40%; background: linear-gradient(180deg, transparent, var(--accent), transparent); animation-name: journey-pulse-v; }
  @keyframes journey-pulse-v { to { top: 100%; } }
}

.tech-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.1rem 0 .6rem;
  padding: .6rem .9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  color: var(--text-muted);
}

.tech-strip span:nth-child(odd) { color: var(--text); }
.tech-strip span:nth-child(even) { color: var(--border); }

.section-title {
  margin: 2.5rem 0 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}

.section-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1.5rem;
}

.section-title-row h2 { margin: 0; }

/* Legende cliquable : chaque pastille filtre la grille (filter.js). */
.filter { display: flex; flex-wrap: wrap; gap: .4rem; }

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .3rem .7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.filter-btn:hover { color: var(--text); border-color: var(--text-muted); filter: none; }
.filter-btn.is-active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

.legend-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--cat-accent, var(--accent));
}

@media (max-width: 560px) {
  .section-title-row { flex-direction: column; align-items: flex-start; }
}

.project-grid {
  display: grid;
  /* auto-fit (et non auto-fill) : les pistes vides s'effondrent et les cartes
     presentes se partagent TOUTE la largeur disponible, quel que soit le nombre
     d'ecrans. (Un max fixe ici — ex. 700px — ferait calculer le nombre de
     colonnes sur ce max et couperait le remplissage : le max doit rester 1fr.) */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.project-card {
  --cat-accent: var(--accent);
  --cat-soft: var(--accent-soft);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--cat-accent);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.project-detail { --cat-accent: var(--accent); --cat-soft: var(--accent-soft); }
[data-category="soc"] { --cat-accent: var(--cat-soc); --cat-soft: color-mix(in srgb, var(--cat-soc) 14%, transparent); }
[data-category="infra"] { --cat-accent: var(--cat-infra); --cat-soft: color-mix(in srgb, var(--cat-infra) 14%, transparent); }
[data-category="dev"] { --cat-accent: var(--cat-dev); --cat-soft: color-mix(in srgb, var(--cat-dev) 14%, transparent); }
[data-category="conformite"] { --cat-accent: var(--cat-conformite); --cat-soft: color-mix(in srgb, var(--cat-conformite) 14%, transparent); }

/* Ce qui tourne en production se voit : bordure teintee, point vert qui bat. */
.project-card[data-status="prod"] { border-color: color-mix(in srgb, var(--cat-accent) 40%, var(--border)); }

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-bottom: .85rem;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  background: var(--cat-soft);
  color: var(--cat-accent);
}

.card-icon svg { width: 1.15rem; height: 1.15rem; }

.status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
  font-size: .74rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.status-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--text-muted); }
[data-status="prod"] .status { color: var(--ok); }
[data-status="prod"] .status-dot { background: var(--ok); animation: status-pulse 2.2s ease-out infinite; }
[data-status="auto"] .status { color: var(--accent); }
[data-status="auto"] .status-dot { background: var(--accent); }

@keyframes status-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  100% { box-shadow: 0 0 0 9px transparent; }
}

.project-card[hidden] { display: none; }

.cat-badge {
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--cat-soft);
  color: var(--cat-accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.project-card:hover {
  border-color: var(--border);
  border-top-color: var(--cat-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px -12px var(--cat-soft), 0 0 0 1px var(--cat-soft);
}

/* Le titre est un lien : souligne des le repos (fin, teinte), franc au survol. */
.project-card h3 a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .2em;
  text-decoration-color: color-mix(in srgb, var(--cat-accent) 45%, transparent);
  transition: color .15s ease, text-decoration-color .15s ease;
}
.project-card:hover h3 a { color: var(--accent); text-decoration-color: var(--accent); }

/* Toute la carte est cliquable (lien etendu) ; le clavier garde un contour net. */
.card-cta::before { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.project-card:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.project-card:hover .card-cta::after { transform: translateX(3px); }
.tagline { margin: 0 0 .75rem; color: var(--text-muted); font-size: .95rem; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes card-reveal {
      from { opacity: 0; transform: translateY(16px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .project-card {
      animation: card-reveal .5s ease both;
      animation-timeline: view();
      animation-range: entry 0% cover 25%;
    }
  }
}

.result {
  margin: 0 0 1rem;
  padding: .55rem .75rem;
  border-left: 3px solid var(--cat-accent, var(--accent));
  background: var(--cat-soft, var(--accent-soft));
  border-radius: 0 6px 6px 0;
  font-size: .9rem;
}

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; padding: 0; list-style: none; }

.tags li {
  padding: .2rem .6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .78rem;
  color: var(--text-muted);
  transition: border-color .15s ease, color .15s ease;
}

.project-card:hover .tags li { border-color: var(--accent-soft); color: var(--text); }

.card-cta { margin-top: auto; font-size: .9rem; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
.card-cta::after { content: '→'; display: inline-block; transition: transform .18s ease; }
.card-cta:hover::after { transform: translateX(3px); }

.callout {
  margin: 1.75rem 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--cat-accent, var(--accent));
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
}

.callout-label {
  display: block;
  margin-bottom: .35rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.callout p { margin: 0; }
.prose p { margin: 0 0 1.15rem; }

/* -------------------------------------------------------------------- admin */

.stats { display: flex; flex-wrap: wrap; gap: 1rem; }

.stat {
  flex: 1 1 150px;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat-value { display: block; font-size: 2rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .82rem; color: var(--text-muted); }

.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--surface); }
th, td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-hover); }
.row-revoked { opacity: .45; }

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  letter-spacing: .12em;
}

code {
  padding: .12rem .4rem;
  border-radius: 4px;
  background: var(--accent-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85em;
}

.copy-field {
  width: 260px;
  padding: .35rem .5rem !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem;
}

.copy-field.wide { width: 100%; margin-top: .35rem; }

.row-actions { display: flex; gap: .75rem; align-items: center; }
.row-actions form { display: inline; }

.link-button {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}

.link-button.danger { color: var(--danger); }

.feed { margin: 0; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.feed li { padding: .7rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); font-size: .9rem; }
.feed li:last-child { border-bottom: none; }
.feed-time { display: inline-block; min-width: 145px; color: var(--text-muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.ua { display: block; margin-top: .2rem; font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .feed-time { display: block; min-width: 0; }
  .copy-field { width: 180px; }
}

/* ------------------------------------------------ layout « console » (public) */

.c-shell { flex: 1; display: grid; grid-template-columns: var(--rail-w) 1fr; width: 100%; }

.c-rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 1.6rem 1.4rem;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.c-id { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--text); }
.c-tile {
  display: grid; place-items: center;
  width: 2.35rem; height: 2.35rem;
  border-radius: 9px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono); font-weight: 700; font-size: .85rem;
}
.c-who b { display: block; font-family: var(--display); font-size: 1.02rem; letter-spacing: -0.01em; }
.c-who span { display: block; font-family: var(--mono); font-size: .68rem; color: var(--text-muted); letter-spacing: .03em; }

.c-lbl { font-family: var(--mono); font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .7rem; }
.c-status { display: flex; flex-direction: column; gap: .5rem; }
.c-srow { display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: .76rem; }
.c-k { color: var(--text-muted); }
.c-v { color: var(--text); }
.c-v.on { color: var(--ok); }
.c-led { display: inline-block; width: 7px; height: 7px; margin-right: .45rem; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }

.c-nav { display: flex; flex-direction: column; }
.c-nav a { padding: .4rem 0; font-family: var(--mono); font-size: .84rem; color: var(--text); text-decoration: none; }
.c-nav a::before { content: "\203A  "; color: var(--text-muted); }
.c-nav a:hover { color: var(--accent); }
.c-nav a.cur { color: var(--accent); }
.c-nav a.cur::before { content: "\25B8  "; color: var(--accent); }

.c-rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: .35rem; font-family: var(--mono); font-size: .72rem; }
.c-rail-foot a { color: var(--text-muted); text-decoration: none; }
.c-rail-foot a:hover { color: var(--accent); }

.c-main {
  min-width: 0;
  container: cmain / inline-size;
  padding: 2.6rem 2.6rem 3.5rem;
  background-color: var(--bg);
  background-image: radial-gradient(120% 90% at 12% -6%, var(--accent-soft), transparent 55%);
  background-repeat: no-repeat;
}
.c-main-inner { max-width: 900px; }

.c-crumb { margin: 0 0 1.5rem; font-family: var(--mono); font-size: .76rem; color: var(--text-muted); }
.c-crumb a { color: var(--text-muted); text-decoration: none; }
.c-crumb a:hover { color: var(--accent); }
.c-crumb b { color: var(--accent); font-weight: 500; }
.c-crumb .sep { padding: 0 .35rem; opacity: .5; }

@media (max-width: 820px) {
  .c-shell { grid-template-columns: 1fr; }
  .c-rail {
    position: static; height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: .75rem 1.5rem;
    padding: 1rem 1.25rem;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .c-rail .c-block, .c-rail .c-rail-foot { display: none; }
  .c-nav { flex-direction: row; gap: 1.1rem; margin-left: auto; }
  .c-nav a { padding: 0; }
  .c-main { padding: 2rem 1.25rem 3rem; }
}

/* ------------------------------------------------ adaptation fluide (fenetre snappee / demi-ecran)
   Les media queries regardent la fenetre, mais le rail mange --rail-w : en demi-ecran
   (snap Windows, ~950px), le contenu ne fait que ~600px sans que les regles "etroites"
   ne se declenchent. Les container queries ci-dessous observent la largeur REELLE du
   contenu (.c-main / .page), quel que soit l'etat du rail. Les media queries d'origine
   restent en place comme filet pour les navigateurs sans container queries. */

/* rail aminci quand la fenetre retrecit mais reste au-dessus du seuil de repli */
@media (max-width: 1080px) and (min-width: 821px) {
  :root { --rail-w: 216px; }
  .c-rail { padding: 1.5rem 1.1rem; }
  .c-main { padding: 2.2rem 1.8rem 3rem; }
}

/* miroir container de @media 760px : le parcours passe en vertical des que le contenu est etroit */
@container cmain (max-width: 720px) {
  .story { padding: 1.5rem 1.25rem; }
  .journey { grid-template-columns: 1fr; gap: .25rem; }
  .journey-step { display: grid; grid-template-columns: 2.75rem 1fr; column-gap: .9rem; row-gap: .15rem; align-items: start; }
  .journey-icon { grid-row: 1 / 3; margin: 0; }
  .journey-link { width: 2px; height: 1.75rem; margin: 0 0 0 calc(2.75rem / 2 - 1px); }
  .journey-link::after { top: -40%; left: 0; width: 100%; height: 40%; background: linear-gradient(180deg, transparent, var(--accent), transparent); animation-name: journey-pulse-v; }
}

/* keyframes du miroir : defini hors media pour etre disponible meme quand seule la
   container query s'applique (dans @media 760px il n'existe que si la media matche) */
@keyframes journey-pulse-v { to { top: 100%; } }

/* miroir container de @media 560px */
@container cmain (max-width: 520px) {
  .section-title-row { flex-direction: column; align-items: flex-start; }
}

/* miroir container de @media 640px (formulaires / flux admin) */
@container cmain (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; }
  .feed-time { display: block; min-width: 0; }
  .copy-field { width: 180px; }
}

/* plein ecran / multi-ecrans : sur la page projets, aucun plafond — la grille
   s'etend sur TOUTE la largeur disponible (auto-fit ci-dessous). Le hero (textes)
   garde sa largeur lisible, et les pages sans grille (detail, legal) restent a 900px. */
.c-main-inner:has(.project-grid) { max-width: none; }

/* Bulle d'anecdotes : discrète, coin bas-droit, fermeture facile */
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(1rem); }
}

.anecdote-bubble {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  max-width: 280px;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 99;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.anecdote-bubble p {
  margin: 0;
  flex: 1;
}

.anecdote-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.anecdote-close:hover {
  color: var(--accent);
}

@media (max-width: 600px) {
  .anecdote-bubble {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}
.c-main-inner:has(.project-grid) .hero { max-width: 900px; }
