/* jfd-logs — système visuel « canvas / nodes » repris de jfdube.online (index.html) */

@font-face {
  font-family: 'Departure Mono';
  src: url('../fonts/DepartureMono-Regular.woff2') format('woff2'), url('../fonts/DepartureMono-Regular.woff') format('woff');
  font-display: swap;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --orange: #FF5500; --orange-hover: #e04c00;
  --black: #0f0f0e; --bg: #f3f2ee; --border: #c8c7c3; --muted: #8a8983;
  --surface: #ffffff; --surface-hover: #f7f6f2; --grid: rgba(0,0,0,0.065);
  --code-bg: #f7f6f2; --code-border: #dcdbd6; --field: #ffffff; --code-str: #8a6a2f;
  --stripe: #c2c1bd;
}
html[data-theme="dark"] {
  --black: #f1f0ec; --bg: #0e0e0d; --border: #2c2c2a; --muted: #7d7c77;
  --surface: #161615; --surface-hover: #1d1d1b; --grid: rgba(255,255,255,0.05);
  --code-bg: #101010; --code-border: #2c2c2a; --field: #101010; --code-str: #d9b872;
  --stripe: #46463f;
}
html { scroll-behavior: smooth; }
html:has(.overlay.detail:not([hidden])) { overflow: hidden; }
body {
  font-family: 'Space Grotesk', sans-serif; background-color: var(--bg); color: var(--black);
  overflow-x: hidden;
  background-image: repeating-conic-gradient(var(--grid) 0% 25%, transparent 0% 50%);
  background-size: 4px 4px;
}
a { text-decoration: none; color: inherit; }
a:hover { color: var(--orange); }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, select, textarea { font-family: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--black); color: var(--bg); }
::-webkit-scrollbar { width: 15px; height: 15px; }
::-webkit-scrollbar-track {
  background-color: var(--code-bg);
  background-image: repeating-conic-gradient(var(--stripe) 0% 25%, transparent 0% 50%);
  background-size: 4px 4px;
  border-left: 1px solid var(--border);
}
::-webkit-scrollbar-thumb { background: var(--surface); border: 1px solid var(--border); }
::-webkit-scrollbar-corner { background: var(--code-bg); }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes winOpen { from { opacity: 0; transform: translateY(26px) scale(0.9); } to { opacity: 1; transform: none; } }

/* ---- menubar ---- */
.menubar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 34px;
  display: flex; align-items: stretch;
  background: var(--surface); border-bottom: 1px solid var(--black); box-shadow: 0 1px 0 var(--border);
  font-family: 'Silkscreen', 'Space Mono', monospace; font-size: 10px; letter-spacing: 0.06em;
}
.mb-logo { display: flex; align-items: center; gap: 10px; padding: 0 18px 0 12px; }
.mb-logo:hover { color: inherit; }
.mb-plume { display: block; height: 27px; width: auto; }
.mb-word { font-family: 'Departure Mono', 'Space Mono', monospace; font-size: 16.5px; letter-spacing: 0; color: var(--black); white-space: nowrap; }
.mb-word strong { font-weight: 400; text-shadow: 1.5px 0 0 currentColor; letter-spacing: 1.5px; }
.mb-item {
  display: flex; align-items: center; gap: 7px; padding: 0 13px;
  font-family: inherit; font-size: inherit; letter-spacing: inherit;
  text-transform: uppercase; color: var(--black);
}
.mb-item:hover, .mb-item[aria-current="page"] { background: var(--black); color: var(--bg); }
.mb-ico { width: 11px; height: 13px; display: block; flex-shrink: 0; }
.mb-spacer { flex: 1; }
.mb-contact { background: var(--orange); color: #fff; }
.mb-contact:hover { background: var(--black); color: var(--bg); }

.mb-switch {
  position: fixed; bottom: 16px; left: 16px; z-index: 55; display: flex;
  border: 1px solid var(--black); background: var(--surface); box-shadow: 2px 2px 0 var(--stripe);
  font-family: 'Silkscreen', 'Space Mono', monospace; font-size: 8px; letter-spacing: 0.06em;
}
.sw-opt {
  font-family: inherit; font-size: inherit; letter-spacing: inherit; text-transform: uppercase;
  padding: 4px 9px; color: var(--black); background: var(--surface); border-right: 1px solid var(--black);
}
.sw-opt:last-child { border-right: none; }
.sw-opt:hover { background: var(--surface-hover); }
.sw-opt[aria-pressed="true"] { background: var(--black); color: var(--bg); }

.btn-orange {
  position: relative; display: flex; align-items: center; justify-content: center; height: 40px; padding: 0 18px; border-radius: 3px;
  background: var(--orange); color: #fff; font-family: 'Space Mono', monospace; font-size: 10.5px;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.btn-orange:hover { background: var(--orange-hover); color: #fff; }
.btn-orange::after, .detail-cta::after {
  content: ''; position: absolute; inset: -4px; border: 1px solid var(--orange); border-radius: 5px; pointer-events: none;
}

/* ---- minimap ---- */
#minimap { position: fixed; top: 50%; right: 18px; transform: translateY(-50%); z-index: 55; display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }
.mini-btn { display: flex; align-items: center; gap: 9px; font-family: 'Space Mono', monospace; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); background: none; border: none; cursor: pointer; }
.mini-btn .mini-label { opacity: 0; transition: opacity 0.18s; }
.mini-btn .mini-tick { display: block; width: 18px; height: 2px; background: var(--border); transition: all 0.18s; }
.mini-btn:hover .mini-label { opacity: 1; }
.mini-btn[data-active="1"] { color: var(--orange); }
.mini-btn[data-active="1"] .mini-label { opacity: 1; }
.mini-btn[data-active="1"] .mini-tick { background: var(--orange); width: 30px; height: 3px; }

/* ---- canvas + nodes ---- */
#canvas { min-height: 100dvh; cursor: grab; }
#pipe { position: relative; width: min(94vw,1600px); min-width: 75vw; margin: 0 auto; padding: 120px 28px 90px; }
#wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; }

.node { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: 3px 3px 0 var(--border); }
.node-bar {
  border-radius: 12px 12px 0 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px;
  border-bottom: 1px solid var(--border); font-family: 'Space Mono', monospace; font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase; cursor: move; user-select: none;
  background-image: repeating-linear-gradient(to bottom, var(--stripe) 0 1px, transparent 1px 3px);
  background-repeat: no-repeat; background-position: center; background-size: 100% 15px;
}
.node-bar .node-bar-label { display: flex; align-items: center; gap: 8px; background: var(--surface); padding: 0 9px; margin-left: -9px; }
.node-bar .node-bar-id { color: var(--muted); text-transform: none; letter-spacing: 0.04em; background: var(--surface); padding: 0 9px; margin-right: -9px; }
.node-dot { position: absolute; left: 50%; transform: translateX(-50%); width: 9px; height: 9px; background: var(--bg); border: 1px solid var(--border); z-index: 1; }
.node-dot.top { top: -5px; } .node-dot.bottom { bottom: -5px; }
.node-dot.on { background: var(--orange); border-color: var(--orange); }
.tri { color: var(--orange); font-size: 6px; }

#trigger { width: min(100%,560px); margin: 0 auto; }
#trigger .node-body { padding: 24px 22px; display: flex; flex-direction: column; gap: 16px; }
#trigger h1 { font-family: 'Departure Mono', 'Space Mono', monospace; font-weight: 400; font-size: 33px; line-height: 1; letter-spacing: 0; white-space: nowrap; user-select: none; min-height: 1em; }
#trigger h1 strong { font-weight: 400; text-shadow: 0.0909em 0 0 currentColor; letter-spacing: 0.0909em; }
.type-caret { display: inline-block; width: 0.8em; height: 0.85em; margin-left: 0.12em; vertical-align: -0.08em; background: url('../img/plume.svg') no-repeat center / contain; animation: caretBlink 1.06s steps(1, end) infinite; }
#trigger h1.is-typing .type-caret { animation: none; }
@keyframes caretBlink { 50% { opacity: 0; } }
#trigger .lede { font-size: 15px; line-height: 1.55; font-weight: 500; }
.text-link { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
#trigger .desc { font-size: 14.5px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { font-family: 'Space Mono', monospace; font-size: 11px; padding: 5px 11px; border: 1px solid var(--code-border); border-radius: 4px; background: var(--code-bg); }
.chip.accent { border-color: var(--orange); color: var(--orange); }
a.chip:hover { border-color: var(--orange); }
.code-block { background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 4px; padding: 14px 16px; font-family: 'Space Mono', monospace; font-size: 12px; line-height: 1.9; }
.code-block .k { padding-left: 16px; } .code-block .muted { color: var(--muted); } .code-block .str { color: var(--code-str); }
.hint { font-family: 'Space Mono', monospace; font-size: 11px; line-height: 1.6; color: var(--muted); }

#router { width: min(100%,300px); margin: 0 auto; }
.router-link { color: var(--black); font-weight: 700; }
.router-body { padding: 14px; font-family: 'Space Mono', monospace; font-size: 12px; line-height: 1.6; color: var(--muted); }

.gap-1 { height: 70px; } .gap-2 { height: 72px; }

.action-grid { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 56px 32px; align-items: start; }
.action-node { text-align: left; display: block; width: 100%; }
.action-node:hover { color: inherit; border-color: var(--orange); box-shadow: 3px 3px 0 var(--orange); }
.action-node .node-body { padding: 22px 18px; display: flex; flex-direction: column; gap: 10px; }
.action-node .action-title { font-family: 'Bebas Neue', sans-serif; font-size: 42px; line-height: 0.95; letter-spacing: 0.04em; }
.action-node .action-desc { font-size: 13px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.node-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-top: 1px solid var(--border); font-family: 'Space Mono', monospace; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.node-foot .muted { color: var(--muted); } .node-foot .go { color: var(--orange); }

/* log nodes */
.log-node .action-title { font-size: clamp(30px, 2.6vw, 38px); text-transform: uppercase; }
.log-node .log-kicker { font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange); }
.log-node .log-thumb { height: 150px; background-size: cover; background-position: center; border-bottom: 1px solid var(--border); }
.log-node .action-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.log-empty { grid-column: 1 / -1; padding: 22px; text-align: center; }

/* pagination */
.pager-node { width: min(100%,420px); margin: 0 auto; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.pager a { color: var(--orange); }
.pager .muted { color: var(--muted); }
.pager .off { visibility: hidden; }

/* output / subscribe */
#output { width: min(100%,620px); margin: 0 auto; border-color: var(--orange); box-shadow: 3px 3px 0 var(--orange); }
#output .node-bar { border-bottom-color: var(--orange); }
#output .out-body { padding: 24px 22px 6px; display: flex; flex-direction: column; gap: 14px; }
#output .out-title { font-family: 'Bebas Neue', sans-serif; font-size: clamp(38px,5vw,58px); line-height: 0.92; letter-spacing: 0.035em; }
#output .out-desc { font-size: 14px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.out-cta { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 10px; }

.sub-form { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.sub-row { display: flex; gap: 14px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.field span { font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.field input { border: 1px solid var(--border); background: var(--field); color: var(--black); height: 40px; padding: 0 13px; font-size: 13px; border-radius: 2px; outline: none; width: 100%; }
.field input:focus { border-color: var(--orange); }
.sub-form .sub-loading, .sub-form .sub-msg { display: none; }
.sub-form.loading .sub-idle { display: none; }
.sub-form.loading .sub-loading { display: inline; }
.sub-form.loading button { opacity: 0.75; pointer-events: none; }
.sub-form.success .sub-ok { display: block; color: var(--orange); }
.sub-form.success .sub-row { display: none; }
.sub-form.error .sub-err { display: block; color: var(--orange); }
.sub-member { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--muted); }
.sub-member a { color: var(--orange); }

.footer-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; width: min(100%,620px); margin: 34px auto 0; font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.footer-row .socials { display: flex; gap: 16px; }

/* ---- fenêtres ---- */
.overlay {
  position: fixed; inset: 0; z-index: 200; background-color: color-mix(in srgb, var(--black) 55%, transparent);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.overlay.detail { z-index: 220; background: color-mix(in srgb, var(--black) 62%, transparent); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.win { width: 100%; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 5px; box-shadow: 5px 5px 0 rgba(0,0,0,0.3), 0 44px 90px -40px rgba(0,0,0,0.5); animation: winOpen 0.26s cubic-bezier(0.16,1,0.3,1); }
.win.post-win { max-width: 1160px; max-height: 92dvh; }
.winbar {
  flex-shrink: 0; display: flex; align-items: center; gap: 14px; height: 46px; padding: 0 12px;
  border-bottom: 1px solid var(--border); background-color: var(--code-bg); cursor: move; user-select: none;
  background-image: repeating-linear-gradient(to bottom, var(--stripe) 0 1px, transparent 1px 3px);
  background-repeat: no-repeat; background-position: center; background-size: 100% 19px;
}
.winbar .dots { display: flex; align-items: center; gap: 7px; background: var(--code-bg); padding-right: 6px; }
.winbar .wdot { width: 12px; height: 12px; background: var(--surface); border: 1px solid var(--black); display: block; }
.winbar .wdot.close { background: var(--orange); border-color: color-mix(in srgb, var(--orange) 65%, #000); }
.winbar .wtitle { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 0; font-family: 'Space Mono', monospace; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.winbar .wtitle > span { background: var(--code-bg); padding: 0 5px; white-space: nowrap; }
.winbar .wtitle > span.wname { overflow: hidden; text-overflow: ellipsis; }
.winbar .wtitle .muted { color: var(--muted); text-transform: none; letter-spacing: 0.04em; }
.winbar .wnum { width: 56px; display: flex; justify-content: flex-end; font-family: 'Space Mono', monospace; font-size: 9.5px; color: var(--muted); background: var(--code-bg); }
.winbar .wnav { width: 120px; display: flex; justify-content: flex-end; gap: 6px; }
.winbar .wnav > * { font-family: 'Space Mono', monospace; font-size: 11px; line-height: 1.4; color: var(--muted); padding: 2px 6px; border: 1px solid var(--border); border-radius: 2px; background: var(--surface); }
.winbar .wnav a:hover { color: var(--black); }
.winbar .wnav .off { opacity: 0.35; }
.winfoot { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--code-bg); font-family: 'Space Mono', monospace; font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.pill { font-family: 'Space Mono', monospace; font-size: 9.5px; padding: 3px 9px; border: 1px solid var(--border); border-radius: 2px; }
.pill.accent { border-color: var(--orange); color: var(--orange); }
a.pill:hover { border-color: var(--orange); }

.detail-scroll { flex: 1; min-height: 0; overflow: auto; }
.detail-hero { padding: 26px 30px 20px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.detail-hero .branche { font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange); }
.detail-hero h1 { font-family: 'Bebas Neue', sans-serif; font-weight: 400; font-size: clamp(48px,7vw,104px); line-height: 0.88; letter-spacing: 0.035em; text-transform: uppercase; text-wrap: balance; }
.detail-main { display: grid; grid-template-columns: 1.35fr 1fr; border-bottom: 1px solid var(--border); }
.detail-left { border-right: 1px solid var(--border); padding: 24px 30px; display: flex; flex-direction: column; gap: 16px; }
.detail-left .desc { font-size: 16.5px; line-height: 1.6; font-weight: 500; max-width: 48ch; text-wrap: pretty; }
.detail-cta { position: relative; align-self: flex-start; margin-top: 2px; padding: 13px 22px; border-radius: 3px; background: var(--orange); color: #fff; font-family: 'Space Mono', monospace; font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.detail-cta:hover { background: var(--orange-hover); color: #fff; }
.detail-stats { display: grid; grid-template-rows: repeat(3,1fr); }
.detail-stats .dstat { padding: 16px 22px; border-bottom: 1px solid var(--border); }
.detail-stats .dstat:last-child { border-bottom: none; }
.detail-stats .dstat .lbl { font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.detail-stats .dstat .val { font-family: 'Space Mono', monospace; font-size: 16px; font-weight: 700; }
.detail-stats .dstat .val.accent { color: var(--orange); }
.post-cover { border-bottom: 1px solid var(--border); height: clamp(240px,34vw,460px); }
.post-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-cover figcaption { display: none; }
.detail-nav { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); }
.detail-nav > * { text-align: left; border-right: 1px solid var(--border); padding: 20px 26px; display: flex; flex-direction: column; gap: 4px; width: 100%; }
.detail-nav > *:last-child { border-right: none; text-align: right; align-items: flex-end; }
.detail-nav a:hover { background: var(--surface-hover); color: inherit; }
.detail-nav .nlbl { font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.detail-nav .nname { font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: 0.04em; text-transform: uppercase; }

/* bloc abonnement dans un post */
.post-sub { border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1.35fr; }
.post-sub .ps-left { padding: 24px 30px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.post-sub .ps-title { font-family: 'Bebas Neue', sans-serif; font-size: 44px; line-height: 0.92; letter-spacing: 0.035em; }
.post-sub .ps-desc { font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.post-sub .ps-right { padding: 24px 30px; display: flex; align-items: center; }

/* page simple / erreur */
.page-shell { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 70px 20px 40px; }
.page-shell .win { max-width: 860px; max-height: none; }

/* ---- chrome bitmap System 1.0 ---- */
.node-bar, .node-foot, .winbar .wtitle, .winbar .wnum, .winfoot, .mini-btn {
  font-family: 'Silkscreen', 'Space Mono', monospace;
}
.node-bar { font-size: 10px; letter-spacing: 0.05em; }
.node-foot { font-size: 9px; letter-spacing: 0.03em; }
.winbar .wtitle { font-size: 10px; letter-spacing: 0.05em; }
.winbar .wnum { font-size: 9px; }
.winfoot { font-size: 8.5px; letter-spacing: 0.03em; }
.mini-btn { font-size: 8px; letter-spacing: 0.05em; }

@media (max-width: 900px) {
  .action-grid { grid-template-columns: 1fr; gap: 40px; }
  .detail-main, .post-sub { grid-template-columns: 1fr; }
  .detail-left, .post-sub .ps-left { border-right: none; border-bottom: 1px solid var(--border); }
  #minimap { display: none; }
}
@media (max-width: 640px) {
  .mb-item[data-ext] { display: none; }
  .mb-logo { padding: 0 10px; }
  .overlay { padding: 0; }
  .win { max-width: 100% !important; max-height: 100dvh !important; height: 100dvh !important; border-radius: 0; }
  .page-shell .win { height: auto !important; }
  .sub-row { flex-direction: column; align-items: stretch; }
  .detail-hero, .detail-left, .post-sub .ps-left, .post-sub .ps-right { padding-left: 20px; padding-right: 20px; }
  .winbar .wtitle .muted { display: none; }
  .winbar .wnav { width: auto; }
  .winfoot > *:last-child { display: none; }
}
@media (pointer: coarse) {
  .node-bar { cursor: default; }
}
