/* The live gate (/gate/, "Where it sits"). Example actions flow from your machine to your systems; each one is
   decided at the porcelain gate by the page's own classifier (pages/gate.js). The arch is drawn in an oblique view
   (tools: _work/innovate/shots/gate/arch.mjs), so a tile on the lane really passes through it: the back layer sits
   under the tiles, the near pillar (.lg-front) over them. Geometry in the arch's viewBox: hold line at x 56, floor at
   y 300, box 216 x 344; --s is pixels per unit. Colour keeps its meaning: green runs, vermilion only while held,
   ink blocked. Without JavaScript, and under reduced motion, three static tiles show one of each. */
.lg{padding-block:clamp(90px,13vh,170px) clamp(56px,8vh,110px)}
.lg .sec-head{margin-bottom:clamp(20px,3vh,40px)}

.lg-stage{--s:1.25;--tw:236px;--th:118px;--hx:45%;--top:16px;--floor:calc(var(--top) + var(--s)*300px);
  position:relative;height:calc(var(--floor) + var(--s)*24px + 56px);overflow:hidden;
  background:none}
@media (min-width:720px) and (max-width:1099px){.lg-stage{--s:1;--tw:212px;--th:114px;--hx:44%}}
@media (max-width:719px){.lg-stage{--s:.72;--tw:164px;--th:106px;--hx:53%;--top:34px;height:calc(var(--floor) + var(--s)*24px + 44px)}}

/* the lane: a floor strip from your machine to your systems */
.lg-floor{position:absolute;left:0;right:0;top:calc(var(--floor) - var(--s)*13px);height:calc(var(--s)*26px);
  background:linear-gradient(180deg,rgba(15,23,34,.09) 0,rgba(15,23,34,.025) 1px,rgba(15,23,34,.035) 100%);
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 6%,#000 94%,transparent 100%);mask-image:linear-gradient(90deg,transparent 0,#000 6%,#000 94%,transparent 100%)}
.lg-end{position:absolute;z-index:4;top:calc(var(--floor) + var(--s)*24px + 14px);font-family:var(--mono);font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--text-3);white-space:nowrap}
.lg-from{left:0}.lg-to{right:0}
.lg-from::after,.lg-to::before{content:"";display:inline-block;width:22px;height:1px;margin:0 10px;vertical-align:middle;background:currentColor}
.lg-at{left:calc(var(--hx) + var(--s)*78px);transform:translateX(-50%)}
@media (max-width:719px){.lg-end{top:6px;font-size:11px}.lg-end.lg-at{top:calc(var(--floor) + var(--s)*24px + 8px)}.lg-from::after,.lg-to::before{width:14px;margin:0 6px}}

/* the porcelain arch */
.lg-gate{position:absolute;left:calc(var(--hx) - var(--s)*56px);top:var(--top);width:calc(var(--s)*216px);height:calc(var(--s)*344px);overflow:visible;pointer-events:none}
.lg-back{z-index:1}
.lg-front{z-index:3}
.lg-core{stroke:rgba(15,23,34,.22);stroke-width:2.4;stroke-linecap:round;transition:stroke .3s var(--calm)}
.lg-glow{stroke:var(--hold);stroke-width:14;stroke-linecap:round;opacity:0;transition:opacity .35s var(--calm)}
.lg-warm{opacity:0;transition:opacity .45s var(--calm)}
.lg-stage[data-line=scan] .lg-core{stroke:rgba(15,23,34,.6)}
.lg-stage[data-line=ok] .lg-core{stroke:var(--ok);stroke-width:3}
.lg-stage[data-line=block] .lg-core{stroke:var(--ink);stroke-width:3.4}
.lg-stage[data-line=hold] .lg-core,.lg:not(.is-live) .lg-core{stroke:var(--hold);stroke-width:3.2}
.lg-stage[data-line=hold] .lg-glow,.lg:not(.is-live) .lg-glow{opacity:.3}
.lg-stage[data-line=hold] .lg-warm,.lg:not(.is-live) .lg-warm{opacity:1}
.lg-stage[data-line=hold] .lg-glow{animation:lg-pulse 1.1s ease-in-out infinite}
@keyframes lg-pulse{50%{opacity:.12}}
.lg.is-paused .lg-glow{animation-play-state:paused}

/* tiles */
.lg-tile{position:absolute;left:0;top:0;box-sizing:border-box;width:var(--tw);height:var(--th);margin:0;padding:13px 15px 12px;list-style:none;
  display:flex;flex-direction:column;gap:6px;border-radius:14px;color:var(--ink);
  background:linear-gradient(180deg,#FFFFFF 0%,#FBFAF7 100%);box-shadow:var(--tile-edge);
  transition:background-color .35s var(--calm),box-shadow .35s var(--calm),color .35s var(--calm)}
.lg-act{margin:0;font-family:var(--mono);font-size:13.5px;line-height:1.35;min-height:2.7em;overflow:hidden;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow-wrap:anywhere}
.lg-res{margin:auto 0 0;display:flex;flex-direction:column;align-items:flex-start;gap:5px}
.lg-res .tag{height:24px;padding:0 10px;font-size:12px}
.lg-rule{font-family:var(--mono);font-size:11.5px;color:var(--text-3)}
.lg-tile.d-runs,.lg-tile.is-ok{box-shadow:0 0 0 1.5px var(--ok),0 3px 0 -1px rgba(15,23,34,.09),0 9px 16px -9px rgba(15,23,34,.28)}
.lg-tile.d-held{box-shadow:0 0 0 2px var(--hold),0 0 30px -4px rgba(240,74,26,.55),0 9px 16px -9px rgba(15,23,34,.28)}
.lg-tile.d-blocked{background:var(--ink);color:#fff;box-shadow:0 0 0 1px var(--ink),0 14px 22px -12px rgba(15,23,34,.5)}
.lg-tile.d-blocked .lg-rule{color:rgba(255,255,255,.74)}
.lg-tile.d-blocked .tag{background:rgba(255,255,255,.14);color:#fff}
.lg-tile.is-mine{outline:1.5px dashed var(--ink);outline-offset:4px}
.lg-tile.is-mine.d-blocked{outline-color:var(--ink)}
.lg-mark{position:absolute;top:-9px;right:-9px;width:26px;height:26px;border-radius:50%;background:var(--ok);display:grid;place-items:center;
  box-shadow:0 0 0 3px var(--page);opacity:0;transform:scale(.4);transition:opacity .25s var(--calm),transform .4s var(--ease)}
.lg-mark svg{width:13px;height:13px}
.lg-tile.is-ok .lg-mark{opacity:1;transform:none}

/* the stream */
.lg-lane{position:absolute;inset:0;z-index:2;pointer-events:none;
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 5%,#000 95%,transparent 100%);mask-image:linear-gradient(90deg,transparent 0,#000 5%,#000 95%,transparent 100%)}
.lg-lane .lg-tile{will-change:transform,opacity;opacity:0}
.lg-lane .lg-res{opacity:0;transform:translateY(4px);transition:opacity .3s var(--calm),transform .3s var(--calm)}
.lg-lane .is-decided .lg-res{opacity:1;transform:none}
.lg-lane,.lg.is-live .lg-static{display:none}
.lg.is-live .lg-lane{display:block}

/* the static frame (no JavaScript, or reduced motion): one run past the gate, one held at the line, one dropped */
.lg-static{margin:0;padding:0}
.lg-static .lg-tile{position:absolute;z-index:2;top:calc(var(--floor) - var(--th))}
.lg-s-held{left:calc(var(--hx) - var(--tw))}
.lg-s-runs{left:calc(var(--hx) + var(--s)*162px)}
.lg-s-blocked{left:calc(var(--hx) - 2*var(--tw) - 44px);transform:translateY(22px) rotate(-5deg)}
@media (max-width:1099px){.lg-s-blocked{left:max(4px,calc(var(--hx) - 2*var(--tw) - 32px))}}
@media (max-width:719px){
  .lg:not(.is-live) .lg-stage{height:calc(var(--floor) + var(--s)*24px + 44px + 2*var(--th) + 36px)}
  .lg-static .lg-s-runs,.lg-static .lg-s-blocked{left:calc(var(--hx) - var(--tw));transform:none}
  .lg-static .lg-s-runs{top:calc(var(--floor) + var(--s)*24px + 44px)}
  .lg-static .lg-s-blocked{top:calc(var(--floor) + var(--s)*24px + 56px + var(--th))}
}

/* the bar: counter, pause, your own action */
.lg-bar{display:none;margin-top:clamp(18px,3vh,30px);align-items:flex-end;gap:16px 28px;flex-wrap:wrap}
.lg.lg-ready .lg-bar{display:flex}
.lg-count{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 11px}
.lg-count .tag-grey{background:var(--ink);color:#fff}
.lg-count b{font-variant-numeric:tabular-nums;font-weight:700;min-width:1.4ch;text-align:right}
.lg-pause{height:44px;padding:0 20px;margin-bottom:2px}
.lg:not(.is-live) .lg-count,.lg:not(.is-live) .lg-pause{display:none}
.lg-ask{display:flex;flex-direction:column;gap:8px;flex:1 1 420px;max-width:620px;margin-left:auto}
.lg-ask label{font-weight:600;font-size:14px}
.lg-row{display:flex;gap:10px}
.lg-ask input{flex:1;min-width:0;height:48px;padding:0 16px;border-radius:14px;border:1px solid var(--text-3);background:var(--card);color:var(--ink);font:inherit;font-size:16px}
.lg-ask input:focus{outline:none;border-color:var(--ink);box-shadow:0 0 0 4px rgba(15,23,34,.08)}
.lg-ask .btn{height:48px}
/* vermilion means held on this stage, so the send button never turns vermilion on hover */
.lg .btn-ink:hover{background:var(--text-2)}
.lg-note{margin-top:14px;color:var(--text-3)}
.lg-say{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
@media (max-width:719px){
  .lg-act{font-size:11.5px}
  .lg-tile{padding:10px 11px 10px;border-radius:12px;gap:4px}
  .lg-res{gap:4px}
  .lg-res .tag{height:22px;padding:0 8px;font-size:11px;gap:5px}
  .lg-rule{font-size:10.5px}
  .lg-bar{flex-direction:column;align-items:stretch}
  .lg-count{margin:0}
  .lg-pause{align-self:flex-start}
  .lg-ask{flex:none;margin-left:0}
  .lg-row{flex-direction:column}
  .lg-ask input{flex:none}
}
@media (prefers-reduced-motion:reduce){.lg-tile,.lg-core,.lg-glow,.lg-warm,.lg-mark{transition:none}.lg-stage[data-line=hold] .lg-glow{animation:none}}

/* v13 (31 Oct 2026): no cards and no drop shadows; the work stands on the canvas, divided by hairlines */
.lg-tile{background:var(--card);box-shadow:0 0 0 1px rgba(15,23,34,.14)}
.lg-tile.d-runs,.lg-tile.is-ok{box-shadow:0 0 0 1.5px var(--ok)}
.lg-tile.d-held{box-shadow:0 0 0 2px var(--hold)}
.lg-tile.d-blocked{box-shadow:0 0 0 1px var(--ink)}
.lg-tile{border-radius:4px}
