/* LintelWorks — Goods-In diagram: what stays in the building, what leaves.
   Mounted by goodsin.js into every [data-anim="goods-in"]. All classes are prefixed gi-.
   The drawing is laid out in real CSS pixels by the script, so type never scales below 13px. */
.gi-root {
  position: relative;
  display: block;
  width: 100%;
  color: var(--ink, #16201B);
  font-family: var(--font-body, "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif);
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
}
.gi-root *, .gi-root *::before, .gi-root *::after { box-sizing: border-box; }
.gi-stage { position: relative; width: 100%; }
.gi-root:not(.gi--ready) .gi-stage { visibility: hidden; min-height: 300px; }

/* ---------- the drawing ---------- */
.gi-inside { position: absolute; left: 0; top: 0; background: var(--go-tint, #E3EFE7); }
.gi-svg { position: absolute; left: 0; top: 0; display: block; max-width: none; overflow: visible; pointer-events: none; }
.gi-ln { fill: none; stroke: var(--ink, #16201B); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.gi-paper { fill: var(--surface, #FFFFFF); }
.gi-ln.gi-paper { fill: var(--surface, #FFFFFF); }
.gi-hatch { fill: none; stroke: var(--ink, #16201B); stroke-width: 1; }
.gi-thin { fill: none; stroke: var(--ink-2, #55605A); stroke-width: 1; stroke-linecap: round; }
.gi-beam { fill: var(--beam, #18372C); }
.gi-box { fill: var(--ask, #F2B33D); stroke: var(--ink, #16201B); stroke-width: 1.5; stroke-linejoin: round; }
.gi-pupil { fill: var(--ink, #16201B); }
.gi-cable { fill: none; stroke: #9AA39C; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- text on the drawing ---------- */
.gi-zone { position: absolute; display: grid; gap: 6px; margin: 0; }
.gi-zone-h {
  margin: 0; max-width: none;
  font: 600 17px/1.25 var(--font-display, "Archivo", Arial, sans-serif);
  font-stretch: 112%; letter-spacing: -0.01em;
}
.gi-cap { margin: 0; max-width: none; font-size: 15px; line-height: 1.45; }
.gi-glyph { display: inline-block; width: 30px; height: 12px; margin-right: 8px; overflow: visible; vertical-align: -1px; }
.gi-glyph .gi-g-wall { stroke: var(--ink, #16201B); stroke-width: 3; }
.gi-glyph .gi-g-stay { fill: none; stroke: var(--ink, #16201B); stroke-width: 1.5; stroke-dasharray: 4 3; }
.gi-glyph .gi-g-go { fill: none; stroke: var(--go, #1F6F4A); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.gi--big .gi-zone-h { font-size: 20px; }
.gi--big .gi-cap { font-size: 16px; }
.gi--big .gi-zone { gap: 8px; }

.gi-lab { position: absolute; margin: 0; font-size: 13px; line-height: 1.35; color: var(--ink-2, #55605A); }
.gi-lab--cam { white-space: nowrap; }
.gi-lab--app { display: grid; gap: 1px; }
.gi-lab-name { font-weight: 600; color: var(--ink, #16201B); }

/* ---------- portal card and record chip ---------- */
.gi-card {
  position: absolute; display: grid; gap: 9px; align-content: start;
  padding: 11px 12px 12px;
  background: var(--surface, #FFFFFF);
  border: 1.5px solid var(--ink, #16201B);
  border-radius: 5px;
}
.gi--big .gi-card { padding: 14px 16px 16px; gap: 11px; }
.gi-card-h { margin: 0; font: 600 14px/1.3 var(--font-body, sans-serif); }
.gi-slot { justify-self: start; max-width: 100%; border-radius: 4px; outline: 1.5px dashed #9AA39C; outline-offset: -1.5px; }
.gi-slot .gi-chip { visibility: hidden; }
.gi-chip {
  display: block; margin: 0; padding: 5px 9px;
  background: var(--surface, #FFFFFF);
  border: 1.5px solid var(--go, #1F6F4A);
  border-radius: 4px;
  font: 500 13px/1.4 var(--font-body, sans-serif);
  color: var(--ink, #16201B);
}
.gi-chip-a, .gi-chip-b { display: inline-block; white-space: nowrap; }
.gi-chip-b { font-family: var(--font-mono, ui-monospace, Menlo, Consolas, monospace); font-weight: 400; letter-spacing: -0.01em; }
.gi--two .gi-chip-a { display: block; }
.gi-status { display: grid; }
.gi-status > * { grid-area: 1 / 1; margin: 0; max-width: none; font-size: 14px; line-height: 1.4; }
.gi-wait { color: var(--ink-2, #55605A); }
.gi-done { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.gi-tick { flex: none; width: 20px; height: 20px; margin-top: 0; }
.gi-tick circle { fill: var(--go, #1F6F4A); }
.gi-tick path { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 14; stroke-dashoffset: 14; }
.gi-clip { position: absolute; overflow: hidden; pointer-events: none; }
.gi-fly { position: absolute; }

/* ---------- the sequence: each step adds a class to the root ---------- */
.gi-dyn { transition: opacity 260ms linear; }
.gi-parcel { opacity: 0; transform: translateX(-26px); transition: opacity 360ms linear, transform 620ms var(--ease, cubic-bezier(0.2, 0, 0, 1)); }
.gi-s1 .gi-parcel { opacity: 1; transform: none; }

.gi-frame { fill: none; stroke: var(--go, #1F6F4A); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(1.5);
  transition: opacity 300ms linear, transform 560ms var(--ease, cubic-bezier(0.2, 0, 0, 1)); }
.gi-s2 .gi-frame { opacity: 1; transform: none; }
.gi-lbl { transition: stroke 240ms linear; }
.gi-s4 .gi-lbl { stroke: var(--go, #1F6F4A); }

.gi-video { fill: none; stroke: var(--ink, #16201B); stroke-width: 1.5; stroke-dashoffset: var(--gi-len, 0); }
.gi-s3 .gi-video { stroke-dashoffset: 0; transition: stroke-dashoffset 820ms linear; }

.gi-led { fill: var(--surface, #FFFFFF); stroke: var(--ink-2, #55605A); stroke-width: 1.5; transition: fill 200ms linear, stroke 200ms linear; }
.gi-s4 .gi-led { fill: var(--go, #1F6F4A); stroke: var(--go, #1F6F4A); }
.gi-read { opacity: 0; transform: translateY(3px); transition: opacity 300ms linear, transform 300ms var(--ease, cubic-bezier(0.2, 0, 0, 1)); }
.gi-s4 .gi-read { opacity: 1; transform: none; }
/* stacked: the label sits above the appliance, so its name waits beside the box until the second line appears */
.gi--stack .gi-lab-name { transform: translateY(var(--gi-readh, 0px)); transition: transform 300ms var(--ease, cubic-bezier(0.2, 0, 0, 1)); }
.gi--stack.gi-s4 .gi-lab-name { transform: none; }

.gi-wire { fill: none; stroke: var(--go, #1F6F4A); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: var(--gi-len, 0); stroke-dashoffset: var(--gi-len, 0); }
.gi-s5 .gi-wire { stroke-dashoffset: 0; transition: stroke-dashoffset 480ms var(--ease, cubic-bezier(0.2, 0, 0, 1)); }
.gi-arrow { fill: none; stroke: var(--go, #1F6F4A); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.gi-s5 .gi-arrow { opacity: 1; transition: opacity 160ms linear 400ms; }
.gi-fly { opacity: 0; transform: translate(var(--gi-dx, 0px), var(--gi-dy, 0px)); }
.gi-s5 .gi-fly { opacity: 1; transform: none; transition: transform 1100ms var(--ease, cubic-bezier(0.2, 0, 0, 1)) 360ms, opacity 160ms linear 360ms; }

.gi-wait { transition: opacity 200ms linear; }
.gi-done { opacity: 0; transition: opacity 260ms linear; }
.gi-s6 .gi-wait { opacity: 0; }
.gi-s6 .gi-done { opacity: 1; }
.gi-s6 .gi-tick path { stroke-dashoffset: 0; transition: stroke-dashoffset 320ms var(--ease, cubic-bezier(0.2, 0, 0, 1)) 120ms; }

/* fade the moving parts out before a loop restarts, then snap back with no transition */
.gi-out .gi-dyn { opacity: 0 !important; transition: opacity 260ms linear !important; }
.gi-snap *, .gi--static * { transition: none !important; }

/* ---------- control bar ---------- */
.gi-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.gi-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; min-width: 104px; padding: 8px 16px 8px 12px;
  font: 600 15px/1.2 var(--font-body, sans-serif);
  color: var(--beam, #18372C); background: transparent;
  border: 1px solid var(--beam, #18372C); border-radius: var(--radius, 6px);
  cursor: pointer;
  transition: background 150ms var(--ease, cubic-bezier(0.2, 0, 0, 1));
}
.gi-toggle:hover { background: rgba(24, 55, 44, 0.07); }
.gi-toggle:focus-visible { outline: 3px solid var(--beam, #18372C); outline-offset: 2px; }
.gi-toggle svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.gi-example { display: inline-block; font: 600 13px/1.3 var(--font-body, sans-serif); color: var(--ink-2, #55605A); border: 1px dashed #9AA39C; border-radius: 4px; padding: 2px 8px; }
.gi--static .gi-toggle { display: none; }
.gi-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  .gi-root *, .gi-root *::before, .gi-root *::after { transition: none !important; animation: none !important; }
}
