/* Matechi staging v3c (17 Nov 14:05-14:20), loaded after site3b.css */

/* ---- the journey on home (A, C): one stage stays in place, a bar per tool at the bottom ---- */
.j3head { padding-bottom: clamp(24px, 3vw, 40px); }
.j3 { position: relative; background: #000; color: #fff; }
.j3 .pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.j3stage { position: absolute; inset: 0; overflow: hidden; background: #000; }
.j3v { position: absolute; left: 0; top: -7%; width: 100%; height: 114%; object-fit: cover; opacity: 0; transition: opacity 0.45s ease; }  /* crops the film's own top strip */
.j3v.on { opacity: 1; }
/* the bar covers the film's own caption bar and carries ours */
.j3bars { position: absolute; left: 0; right: 0; bottom: 0; height: max(158px, 17.5svh); z-index: 3; }
.j3bars::before { content: ""; position: absolute; inset: 0; background: rgba(8, 9, 10, 0.96); border-top: 1px solid rgba(255, 255, 255, 0.12); }
.j3bar { position: absolute; inset: 0; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px clamp(16px, 2vw, 32px);
  align-items: center; padding: 14px var(--edge-r) calc(14px + env(safe-area-inset-bottom, 0px)) var(--edge);
  opacity: 0; transform: translateY(70%); transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease; pointer-events: none; }
.j3bar.on { opacity: 1; transform: none; pointer-events: auto; }
.j3bar.out { opacity: 0; transform: translateY(-60%); }
.j3txt { display: grid; gap: 6px; min-width: 0; }
.j3tool { font: 500 14px ui-monospace, Consolas, monospace; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.j3act { margin: 0; font-size: clamp(17px, 1.6vw, 24px); line-height: 1.3; color: #fff; max-width: 52ch; }
.j3real { position: relative; margin: 0; width: clamp(140px, 13vw, 200px); aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #111; border: 1px solid rgba(255, 255, 255, 0.18); }
.j3real video { width: 100%; height: 100%; object-fit: cover; display: block; }
.j3real figcaption { position: absolute; left: 6px; top: 6px; font: 500 11px var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: #000; background: #fff; padding: 2px 6px; border-radius: 4px; }
.j3exits { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: flex-end; opacity: 0; transform: translateY(8px); transition: opacity 0.35s ease, transform 0.35s ease; pointer-events: none; }
.j3bar.exits-on .j3exits { opacity: 1; transform: none; pointer-events: auto; }
.j3exits .btn { padding-block: 10px; }
.j3exits .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.6); background: transparent; }
.j3all, .bexits .j3all { border: 0; background: none; color: inherit; font: 500 16px var(--font); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; padding: 6px 2px; }
.j3dots { position: absolute; right: calc(var(--edge-r) - 6px); top: 50%; transform: translateY(-60%); z-index: 4; display: grid; gap: 10px; }
.j3dots button { width: 12px; height: 12px; border-radius: 50%; border: 1.6px solid rgba(255, 255, 255, 0.7); background: rgba(0, 0, 0, 0.35); padding: 0; cursor: pointer; }
.j3dots button.is-done { background: rgba(255, 255, 255, 0.55); }
.j3dots button.is-current { background: var(--accent); border-color: var(--accent); transform: scale(1.25); }
.j3skip { position: absolute; right: var(--edge-r); top: 84px; z-index: 5; border: 1.6px solid rgba(255, 255, 255, 0.55); background: rgba(0, 0, 0, 0.45); color: #fff;
  font: 500 14px var(--font); padding: 6px 12px; border-radius: 999px; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.framed .j3skip, .mr2 .j3skip { top: 12px; right: 12px; left: auto; }
.show-full .j3skip { top: auto; bottom: 22px; right: var(--edge-r); }
@media (max-width: 760px) {
  .j3 .pin { display: grid; grid-template-rows: auto minmax(0, 1fr); padding-top: 64px; box-sizing: border-box; }
  .j3stage { position: relative; inset: auto; aspect-ratio: 4 / 5; max-height: 56svh; }
  .j3v { top: -6%; height: 123%; }
  .j3bars { position: relative; height: auto; min-height: 0; }
  .j3bars::before { border-top: 0; }
  .j3bar { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-content: start; align-items: start; padding-top: 18px; }
  .j3txt { grid-column: 1 / 2; }
  .j3real { width: 112px; grid-column: 2 / 3; grid-row: 1 / 2; }
  .j3exits { grid-column: 1 / -1; justify-content: flex-start; }
  .j3act { font-size: 18px; }
  .j3dots { top: calc(64px + min(125vw, 56svh) - 26px); right: auto; left: 50%; transform: translateX(-50%); grid-auto-flow: column; gap: 9px; }
  .j3skip { top: 76px; }
}

/* ---- version B: exits in the last stretch ---- */
.bexits { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; opacity: 0; transform: translateY(8px); transition: opacity 0.35s ease, transform 0.35s ease; pointer-events: none; }
.exits-on .bexits { opacity: 1; transform: none; pointer-events: auto; }
.show-full .bexits .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.6); }
.cap .steps-list li { cursor: pointer; }
.cap .steps-list li:hover::after { content: ""; }
.cap .steps-list { padding-block: 6px; }
.cap .steps-list li { height: 0; padding-top: 0; position: relative; }
.cap .steps-list li::after { content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 18px; }   /* a bigger target for the dot */

/* ---- tool pages: the model, then real ---- */
.mr2 .card { --w: 0%; }
.mr2 .card video.mr2-model { position: absolute; left: 0; top: -7%; width: 100%; height: 124%; aspect-ratio: auto; object-fit: cover; object-position: 50% 30%; }  /* crops the film's own strip and caption bar */
.mr2 .card video.mr2-real { aspect-ratio: auto; }
.mr2 .mr2-real { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; clip-path: inset(0 0 0 calc(100% - var(--w))); z-index: 1; }
.mr2 .card::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(100% - var(--w)); width: 2px; margin-left: -1px; background: #fff; z-index: 2;
  opacity: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); }
.mr2:not(.model-only) .card::after { opacity: 1; }
.mr2-tag { position: absolute; left: 12px; top: 12px; z-index: 3; font: 500 12px var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: #000; background: #fff; padding: 3px 8px; border-radius: 4px; }
.mr2 .steps-list li[data-phase="r"] { border-top-style: dashed; }
.mr2 .bexits { margin-top: 6px; }
@media (max-width: 760px) {
  .mr2 .card { aspect-ratio: 1.21 / 1; }
  .mr2 .card video.mr2-model { top: -6%; height: 123%; aspect-ratio: auto; }
}

.mr2.model-only .mr2-tag { display: none; }
