/* ============================================================
   home-act4.css — act 04 "Reproducible, and yours." banner
   session. A result card with a provenance ribbon sits inside a
   dotted "your infrastructure" boundary (key glyph stays inside;
   the arrow toward a faded vendor cloud is crossed out). Left: a
   week timeline (w1…w7) whose memory pins accumulate, each with
   a hover/focus tooltip chip. A real REPLAY button re-rolls the
   card's three key numbers, which settle identical (green) with
   "reproduced · bit-for-bit ✓" while the provenance chain draws
   spec → run → checks → signature. Once per loop the replay runs
   again on a colleague's-machine chip. Everything scoped hm4-;
   no bare state classes. Reduced motion: static reproduced
   state, button still works with instant settle (JS handles it).
   ============================================================ */

/* ---- kicker ------------------------------------------------ */
#hm-act4 .hm4-kick {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline;
  margin: 0 0 12px;
  font-family: var(--font-mono, monospace); font-size: 12px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--color-muted, #6c6b61);
}
.hm4-kick-a { display: inline-flex; align-items: center; gap: 8px; color: var(--color-text, #1a1a17); }
.hm4-kick-a::before { content: ""; width: 18px; height: 2px; background: var(--accent, #d9542b); }

/* ---- stage ------------------------------------------------- */
.hm4-stage {
  position: relative; display: flex; align-items: stretch;
  min-width: 0; max-width: 100%;
  gap: clamp(14px, 2vw, 26px);
  height: clamp(264px, 26vw, 330px);
  padding: clamp(12px, 1.6vw, 18px);
  border: 1px solid var(--bb-line, rgba(26, 26, 23, .14)); border-radius: 10px;
  background: var(--color-bg, #f5f4ef);
}

/* ---- left: week timeline / memory pins --------------------- */
.hm4-weeks { flex: 0 0 152px; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
.hm4-weeks-h {
  margin: 0 0 7px; font: 600 12px/1.2 var(--font-mono, monospace);
  letter-spacing: .1em; text-transform: uppercase; color: var(--color-muted, #6c6b61);
}
.hm4-wk {
  position: relative; display: flex; align-items: center; gap: 8px;
  margin: 0; padding: 3px 5px; border: 0; border-radius: 4px;
  background: none; -webkit-appearance: none; appearance: none;
  font-family: var(--font-mono, monospace); text-align: left; cursor: default;
}
.hm4-wk:hover { background: rgba(26, 26, 23, .05); }
.hm4-wk:focus { outline: none; }
.hm4-wk:focus-visible { outline: 2px solid var(--accent, #d9542b); outline-offset: 1px; }
.hm4-wk-d {
  flex: none; width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid rgba(26, 26, 23, .3); background: transparent;
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.hm4-wk-on .hm4-wk-d {
  background: var(--color-text, #1a1a17); border-color: var(--color-text, #1a1a17);
  box-shadow: 0 0 0 3px rgba(26, 26, 23, .07);
}
.hm4-wk-t { font: 500 12px/1 var(--font-mono, monospace); letter-spacing: .05em; color: var(--color-muted, #6c6b61); transition: color .25s ease; }
.hm4-wk-on .hm4-wk-t { color: var(--color-text, #1a1a17); }
.hm4-wk-tip {
  position: absolute; left: calc(100% + 6px); top: 50%; z-index: 6;
  transform: translateY(-50%) translateX(-4px);
  padding: 4px 8px; border: 1px solid var(--bb-line, rgba(26, 26, 23, .14)); border-radius: 999px;
  background: #fff; box-shadow: 0 6px 16px -10px rgba(26, 26, 23, .3);
  font: 500 12px/1 var(--font-mono, monospace); letter-spacing: .02em;
  color: var(--color-text, #1a1a17); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.hm4-wk:hover .hm4-wk-tip,
.hm4-wk:focus-visible .hm4-wk-tip { opacity: 1; transform: translateY(-50%) translateX(0); }

/* ---- center: dotted boundary + result card ----------------- */
.hm4-mid { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-width: 0; }
.hm4-fence {
  position: relative; width: min(100%, 420px);
  border: 1.5px dashed rgba(26, 26, 23, .35); border-radius: 12px;
  padding: 14px 16px 28px;
  transition: box-shadow .45s ease;
}
.hm4-fence-ping { box-shadow: 0 0 0 5px var(--accent-soft, rgba(217, 84, 43, .1)); }
.hm4-fence-lab {
  position: absolute; top: -6px; left: 14px; padding: 0 6px;
  background: var(--color-bg, #f5f4ef);
  font: 600 12px/1.2 var(--font-mono, monospace);
  letter-spacing: .1em; text-transform: uppercase; color: var(--color-muted, #6c6b61);
}

.hm4-card {
  position: relative; min-width: 0; background: #fff;
  border: 1px solid var(--bb-line, rgba(26, 26, 23, .14)); border-radius: 8px;
  padding: 9px 12px; box-shadow: 0 12px 26px -18px rgba(26, 26, 23, .25);
}
.hm4-ribbon {
  margin: 0 0 7px; padding-bottom: 6px;
  border-bottom: 1px solid var(--bb-line, rgba(26, 26, 23, .14));
  font: 500 12px/1.4 var(--font-mono, monospace); letter-spacing: .02em;
  color: var(--color-muted, #6c6b61);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hm4-nums { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px; }
.hm4-num { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.hm4-num-l {
  font: 500 12px/1.4 var(--font-mono, monospace); letter-spacing: .06em;
  color: var(--color-muted, #6c6b61); /* no uppercase — η would render as H */
}
.hm4-num-v {
  font: 500 14px/1.25 var(--font-mono, monospace); letter-spacing: .01em;
  color: var(--color-text, #1a1a17); font-variant-numeric: tabular-nums;
  transition: color .2s ease;
}
.hm4-num-roll { color: var(--color-muted, #6c6b61); }
.hm4-num-ok { color: var(--color-success, #22c55e); }
.hm4-badge {
  margin: 0 0 7px; font: 600 12px/1 var(--font-mono, monospace); letter-spacing: .04em;
  color: var(--color-success, #22c55e);
  opacity: 0; transform: translateY(2px); transition: opacity .3s ease, transform .3s ease;
}
.hm4-badge-on { opacity: 1; transform: none; }

/* provenance chain: spec → run → checks → signature */
.hm4-chain {
  display: flex; align-items: flex-start; gap: 6px;
  padding-top: 7px; border-top: 1px solid var(--bb-line, rgba(26, 26, 23, .14));
}
.hm4-ch-n { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.hm4-ch-d { display: block; width: 7px; height: 7px; border-radius: 50%; background: rgba(26, 26, 23, .18); transition: background .3s ease, box-shadow .3s ease; }
.hm4-ch-t {
  font: 500 12px/1 var(--font-mono, monospace); letter-spacing: .04em;
  text-transform: uppercase; color: var(--color-muted, #6c6b61);
  opacity: .45; transition: opacity .3s ease;
}
.hm4-ch-n-on .hm4-ch-d { background: var(--color-text, #1a1a17); }
.hm4-ch-n-on .hm4-ch-t { opacity: 1; }
.hm4-ch-n-sig.hm4-ch-n-on .hm4-ch-d { background: var(--accent, #d9542b); box-shadow: 0 0 0 3px var(--accent-soft, rgba(217, 84, 43, .1)); }
.hm4-ch-l {
  flex: 1 1 auto; height: 1.5px; margin-top: 3px; background: rgba(26, 26, 23, .3);
  transform: scaleX(0); transform-origin: left center; transition: transform .32s ease;
}
.hm4-ch-l-on { transform: scaleX(1); }

/* key glyph — stays inside the boundary */
.hm4-key {
  position: absolute; left: 15px; bottom: 11px; width: 9px; height: 9px;
  border: 2px solid var(--accent, #d9542b); border-radius: 50%;
  animation: hm4-key 5.8s ease-in-out infinite;
}
.hm4-key::after  { content: ""; position: absolute; left: 8px; top: 3px; width: 11px; height: 2px; background: var(--accent, #d9542b); }
.hm4-key::before { content: ""; position: absolute; left: 15px; top: 5px; width: 2px; height: 4px; background: var(--accent, #d9542b); }
.hm4-key-lab {
  position: absolute; left: 40px; bottom: 12px;
  font: 500 12px/1 var(--font-mono, monospace); letter-spacing: .08em;
  text-transform: uppercase; color: var(--color-muted, #6c6b61);
}
@keyframes hm4-key { 0%, 100% { transform: none; } 50% { transform: translateY(-1.5px); } }

/* ---- right rail: crossed-out cloud, replay, machines ------- */
.hm4-rail { flex: 0 0 208px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 12px; }
.hm4-noexit { position: relative; width: 200px; height: 52px; }
.hm4-arr { position: absolute; left: 0; top: 18px; width: 86px; border-top: 2px dashed rgba(26, 26, 23, .38); opacity: .5; transition: opacity .3s ease; }
.hm4-arr::after {
  content: ""; position: absolute; right: -2px; top: -6px; width: 0; height: 0;
  border-left: 6px solid rgba(26, 26, 23, .45); border-top: 4px solid transparent; border-bottom: 4px solid transparent;
}
.hm4-x {
  position: absolute; left: 36px; top: 9px;
  font: 700 14px/1 var(--font-mono, monospace); color: rgba(26, 26, 23, .75);
  transition: transform .3s ease;
}
.hm4-noexit-hot .hm4-x { transform: scale(1.3); }
.hm4-noexit-hot .hm4-arr { opacity: .22; }
.hm4-cloud { position: absolute; left: 104px; top: 14px; width: 36px; height: 13px; background: rgba(26, 26, 23, .14); border-radius: 999px; }
.hm4-cloud::before { content: ""; position: absolute; left: 6px;  top: -6px; width: 13px; height: 13px; background: rgba(26, 26, 23, .14); border-radius: 50%; }
.hm4-cloud::after  { content: ""; position: absolute; left: 17px; top: -4px; width: 9px;  height: 9px;  background: rgba(26, 26, 23, .14); border-radius: 50%; }
.hm4-cloud-lab {
  position: absolute; left: 79px; top: 36px; white-space: nowrap;
  font: 600 12px/1 var(--font-mono, monospace); letter-spacing: .08em;
  text-transform: uppercase; color: var(--color-muted, #6c6b61); opacity: .75;
}

.hm4-btn {
  -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border: 1px solid var(--color-text, #1a1a17); border-radius: 999px;
  background: #fff; color: var(--color-text, #1a1a17); cursor: pointer;
  font: 600 12px/1 var(--font-mono, monospace); letter-spacing: .1em; text-transform: uppercase;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.hm4-btn::before { content: "↻"; font-size: 12px; line-height: 1; }
.hm4-btn:hover { border-color: var(--accent, #d9542b); box-shadow: 0 6px 14px -10px rgba(26, 26, 23, .4); }
.hm4-btn:focus { outline: none; }
.hm4-btn:focus-visible { outline: 2px solid var(--accent, #d9542b); outline-offset: 2px; }
.hm4-btn:active,
.hm4-btn-dn {
  transform: translateY(1px) scale(.97);
  background: var(--accent-soft, rgba(217, 84, 43, .1)); border-color: var(--accent, #d9542b);
}

.hm4-mach { display: flex; flex-wrap: wrap; gap: 6px; }
.hm4-chip {
  padding: 4px 9px; border: 1px solid var(--bb-line, rgba(26, 26, 23, .14)); border-radius: 999px;
  font: 500 12px/1 var(--font-mono, monospace); letter-spacing: .05em;
  color: var(--color-muted, #6c6b61); background: transparent; white-space: nowrap;
  transition: color .25s ease, border-color .25s ease, background .25s ease;
}
.hm4-chip-act { color: var(--color-text, #1a1a17); border-color: var(--color-text, #1a1a17); background: #fff; }

.hm4-status {
  margin: 0; min-height: 16px;
  font: 500 12px/1.3 var(--font-mono, monospace); letter-spacing: .04em;
  color: var(--color-muted, #6c6b61); transition: color .25s ease;
}
.hm4-status-hi { color: var(--color-text, #1a1a17); font-weight: 600; }

/* ---- narrow / stacked -------------------------------------- */
@media (max-width: 720px) {
  .hm4-stage { flex-direction: column; height: auto; gap: 16px; }
  .hm4-mid { order: 1; }
  .hm4-weeks { order: 2; flex: none; flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 4px 10px; }
  .hm4-weeks-h { width: 100%; margin: 0 0 2px; }
  .hm4-wk { flex-direction: column; gap: 5px; padding: 2px 3px; }
  .hm4-wk-tip {
    left: 50%; top: auto; bottom: calc(100% + 6px);
    transform: translateX(-50%) translateY(2px);
  }
  .hm4-wk:hover .hm4-wk-tip,
  .hm4-wk:focus-visible .hm4-wk-tip { transform: translateX(-50%) translateY(0); }
  .hm4-rail { order: 3; flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
  .hm4-noexit { display: none; }
  .hm4-fence { padding: 14px 12px 28px; }
}

/* ---- reduced motion ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  #hm-act4 *, #hm-act4 *::before, #hm-act4 *::after { animation: none !important; }
  #hm-act4 .hm4-ch-l, #hm-act4 .hm4-badge { transition: none; }
}
