/* ISIMET controller demos — shared layout.

   Every demo is the same frame: a 1280 x 800 stage, scaled to fit whatever
   it is shown in. The controller's front panel fills the left column; the
   illustrated room it controls fills the middle and reacts to it, with
   "What just happened" along its foot; room conditions and building controls
   share the panel on the right. A demo supplies the panel and the room (two
   SVGs), the scenario cards and its own rules (app.js) — this file and
   demo.js are shared. Typeface: Barlow, carried over from the ASPE 2026
   booth app. */
@font-face{font-family:'Barlow';font-weight:500;font-display:swap;src:url(fonts/barlow-latin-500-normal.woff2) format('woff2')}
@font-face{font-family:'Barlow';font-weight:600;font-display:swap;src:url(fonts/barlow-latin-600-normal.woff2) format('woff2')}
@font-face{font-family:'Barlow';font-weight:700;font-display:swap;src:url(fonts/barlow-latin-700-normal.woff2) format('woff2')}
@font-face{font-family:'Barlow';font-weight:800;font-display:swap;src:url(fonts/barlow-latin-800-normal.woff2) format('woff2')}
@font-face{font-family:'Barlow Condensed';font-weight:700;font-display:swap;src:url(fonts/barlow-condensed-latin-700-normal.woff2) format('woff2')}
@font-face{font-family:'Barlow Condensed';font-weight:800;font-display:swap;src:url(fonts/barlow-condensed-latin-800-normal.woff2) format('woff2')}

:root{
  --ink:#0F1A24; --body:#3E4A57; --muted:#5A6878; --line:#C6D0DA; --paper:#F3F5F7;
  --blue:#0056B3; --green:#1F8A4C; --red:#C0312C; --amber:#F2A900;
  --ease:cubic-bezier(.2,.7,.2,1);
}
html,body{margin:0;height:100%;overflow:hidden;background:#0F1A24;-webkit-text-size-adjust:100%}
body{font-family:'Barlow',system-ui,sans-serif;color:var(--ink)}
button{font:inherit;color:inherit;margin:0;-webkit-appearance:none;appearance:none;cursor:pointer}
button:focus-visible{outline:4px solid var(--amber);outline-offset:2px}
.sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

#stage{
  position:absolute;left:50%;top:50%;width:1280px;height:800px;overflow:hidden;
  transform:translate(-50%,-50%);background:#DCE3EA;
}

/* --- top bar -------------------------------------------------------------- */
.bar{
  position:absolute;left:0;right:0;top:0;height:56px;z-index:6;box-sizing:border-box;
  display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:0 14px;
  background:#fff;border-bottom:3px solid var(--blue);
}
.bar__model{display:flex;align-items:baseline;gap:10px}
.bar__code{font-family:'Barlow Condensed',sans-serif;font-size:30px;font-weight:800;line-height:1}
.bar__name{font-size:16px;font-weight:600;color:var(--body)}
.bar__hint{font-size:16px;font-weight:600;color:var(--muted)}
.bar__restart{
  justify-self:end;display:flex;align-items:center;gap:8px;height:40px;padding:0 16px 0 12px;
  border:0;border-radius:10px;background:var(--ink);color:#fff;font-size:16px;font-weight:700;
}

/* --- the room ------------------------------------------------------------- */
.scene{position:absolute;left:380px;top:56px;width:620px;height:620px;display:block;font-family:'Barlow',sans-serif}
.scene text{font-family:'Barlow',sans-serif}
/* Shown/hidden by data-show. The fade waits for .ready, which demo.js sets
   after the first paint, so the opening state appears at once rather than
   fading in or out. Never put an opacity animation on the same element as
   data-show: the animation wins and the element never hides — animate a
   child instead. */
.is-hidden{opacity:0}
.ready .fade{transition:opacity .35s}

/* Controls drawn in SVG: a focus ring each, shown on keyboard focus. */
.ctl{cursor:pointer;outline:none}
.ctl .ring{fill:none;stroke:var(--amber);stroke-width:4;opacity:0;transition:opacity .15s}
.ctl:hover .ring{opacity:.45}
.ctl:focus-visible .ring{opacity:1}

.spin{animation:spin .45s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.blink{animation:blink 1s steps(1) infinite}
@keyframes blink{50%{opacity:.25}}
.strobe{animation:strobe 1s linear infinite}
@keyframes strobe{0%,14%{opacity:1}15%,100%{opacity:.08}}
.pulse{animation:pulse 1.4s ease-in-out infinite}
@keyframes pulse{50%{opacity:.35}}
/* A flame flickers about its own base. fill-box makes the origin the
   flame's bottom centre wherever it is drawn; without it the origin is the
   drawing's top-left corner, and a flame far from it jumps up and down. */
.flicker{animation:flicker .7s ease-in-out infinite alternate;transform-box:fill-box;transform-origin:50% 100%}
@keyframes flicker{to{transform:scale(.94,.84)}}
/* Steam and bubbles rise and fade, then start again unseen, rather than
   bobbing up and back down. */
.rise{animation:rise 2.2s linear infinite}
@keyframes rise{0%{transform:translateY(6px);opacity:0}30%{opacity:.9}100%{transform:translateY(-12px);opacity:0}}
.flow{stroke-dasharray:10 7;animation:flow .45s linear infinite}
@keyframes flow{to{stroke-dashoffset:-17}}
.drift{animation:drift 3s ease-in-out infinite alternate}
@keyframes drift{to{transform:translate(6px,-10px)}}

/* --- three columns: controller | room | scenarios ------------------------- */
/* Layout, Gabe 2026-10-29: the controller in a column of its own so it never
   covers the room, and the room conditions and building controls together in
   one panel on the right. */
.ctrl{
  position:absolute;left:0;top:56px;bottom:0;width:380px;box-sizing:border-box;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;
  background:linear-gradient(#E9EEF2,#DCE3E9);border-right:2px solid var(--line);
}
.ctrl__panel{display:block;width:350px;height:auto;overflow:visible}
.ctrl__hint{margin:0;font-size:14px;font-weight:600;color:var(--muted);text-align:center}
.side{
  position:absolute;right:0;top:56px;bottom:0;width:280px;box-sizing:border-box;
  padding:14px 14px 12px;overflow:auto;display:flex;flex-direction:column;gap:8px;
  background:#fff;border-left:2px solid var(--line);
}
.side__title{margin:0;font-size:18px;font-weight:800;letter-spacing:-.01em}
.side__title + .side__sub{margin-top:-6px}
.side__sub{margin:0 0 2px;font-size:13.5px;line-height:1.35;color:var(--muted)}
.side__rule{border:0;border-top:2px solid var(--line);margin:8px 0 4px;width:100%}

/* One card per signal. aria-pressed marks the condition as present. */
.sig{
  display:grid;grid-template-columns:38px 1fr;grid-template-rows:auto auto;column-gap:10px;row-gap:0;
  width:100%;padding:8px 10px;text-align:left;box-sizing:border-box;
  background:var(--paper);border:2px solid var(--line);border-radius:12px;
  transition:background .2s,border-color .2s,transform .08s;
}
.sig:active{transform:scale(.98)}
.sig__icon{
  grid-row:1 / span 2;width:38px;height:38px;border-radius:9px;display:flex;align-items:center;justify-content:center;
  background:#fff;border:2px solid var(--line);color:var(--body);box-sizing:border-box;
}
.sig__icon svg{width:22px;height:22px}
.sig__name{font-size:15.5px;font-weight:700;line-height:1.2;align-self:end}
.sig__state{font-size:13px;font-weight:600;color:var(--muted)}
.sig.is-alarm{background:#FBE5E4;border-color:var(--red)}
.sig.is-alarm .sig__icon{background:var(--red);border-color:var(--red);color:#fff}
.sig.is-alarm .sig__state{color:#8E1F1B}
.sig.is-quiet{background:#E6EAEE;border-color:#7A8693}
.sig.is-quiet .sig__icon{background:#3E4A57;border-color:#3E4A57;color:#fff}
/* --- tooltips: data-tip on any element, shown on hover and keyboard focus -- */
.tip{
  position:absolute;z-index:20;max-width:300px;padding:9px 12px;box-sizing:border-box;
  background:var(--ink);color:#fff;border-radius:10px;font-size:14.5px;font-weight:500;line-height:1.4;
  box-shadow:0 10px 24px -10px rgba(0,0,0,.5);pointer-events:none;
  transform:translate(-50%,calc(-100% - 10px));
}
.tip.below{transform:translate(-50%,10px)}
.tip[hidden]{display:none}
.tip-target{cursor:help;outline:none}
.tip-target .ring{fill:none;stroke:var(--amber);stroke-width:4;opacity:0;transition:opacity .15s}
.tip-target:hover .ring{opacity:.45}
.tip-target:focus-visible .ring{opacity:1}

/* --- tooltips on/off, bottom left (added by demo.js) ---------------------- */
.tipswitch{
  position:absolute;left:16px;bottom:16px;z-index:6;display:flex;align-items:center;gap:10px;
  padding:6px 12px 6px 6px;border:2px solid var(--line);border-radius:999px;background:#fff;
  font-size:14px;font-weight:700;color:var(--body);
}
.tipswitch__track{
  position:relative;width:40px;height:22px;border-radius:999px;background:#B8C2CC;transition:background .2s;
}
.tipswitch__knob{
  position:absolute;left:3px;top:3px;width:16px;height:16px;border-radius:50%;background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.3);transition:transform .2s var(--ease);
}
.tipswitch[aria-checked="true"] .tipswitch__track{background:var(--green)}
.tipswitch[aria-checked="true"] .tipswitch__knob{transform:translateX(18px)}

/* --- what just happened --------------------------------------------------- */
.log{
  position:absolute;left:380px;width:620px;bottom:0;height:124px;z-index:3;box-sizing:border-box;
  display:flex;flex-direction:column;justify-content:flex-start;gap:6px;padding:10px 14px;
  background:#fff;border-top:2px solid var(--line);
}
.log__label{font-size:12px;font-weight:800;line-height:1;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.log__chips{display:flex;flex-wrap:wrap;align-items:center;gap:4px 3px}
.chip{
  display:inline-flex;align-items:center;height:26px;padding:0 8px;border-radius:7px;
  font-size:14px;font-weight:700;white-space:nowrap;box-sizing:border-box;animation:chip .35s var(--ease) backwards;
}
.chip-arrow{color:#6B7682;animation:chip .35s var(--ease) backwards}
@keyframes chip{from{opacity:0;transform:translateY(8px)}}
.chip--alarm{background:var(--red);color:#fff}
.chip--off{background:#3E4A57;color:#fff}
.chip--on{background:#1C7D45;color:#fff}
.chip--fan{background:var(--blue);color:#fff}
.chip--beacon{background:#FDE2E0;color:#A3221C;border:2px solid #E5221A}
.chip--key{background:#fff;color:var(--blue);border:2px solid var(--blue)}
.chip--water{background:#DCEBFA;color:#0A4A94}
.chip--neutral{background:#fff;color:#1B2A38;border:2px solid #B8C2CC}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}
}

/* --- set up the room (accessories a visitor adds or removes) --------------- */
/* The side panel has two tabs: the scenarios, and the room's setup. An
   accessory that is not fitted stays in the room, greyed, so the visitor can
   see it is available (Gabe, 25 Nov 2026). */
.is-gone{display:none !important}
.tabs{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:4px;padding:3px;border-radius:11px;background:#E6EAEE}
.tab{height:32px;border:0;border-radius:8px;background:transparent;font-size:14px;font-weight:700;color:var(--body)}
.tab[aria-pressed="true"]{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(15,26,36,.2)}
.pane{display:flex;flex-direction:column;gap:8px}
.sig.is-unfit{opacity:.5;border-style:dashed}
.not-fitted{opacity:.3;filter:grayscale(1)}
.unfit-label{font-size:12px;font-weight:800;fill:#8E1F1B}
.count-badge circle{fill:var(--blue);stroke:#fff;stroke-width:2}
.count-badge text{font-size:12px;font-weight:800;fill:#fff}
.kit{
  display:grid;grid-template-columns:1fr auto;align-items:center;column-gap:8px;
  padding:8px 10px;background:var(--paper);border:2px solid var(--line);border-radius:12px;
}
.kit__name{font-size:15px;font-weight:700;line-height:1.2}
.kit__sub{grid-column:1 / -1;margin-top:3px;font-size:12.5px;line-height:1.3;font-weight:600;color:var(--muted)}
.kit__sub.is-short{color:#8E1F1B}
.step{display:flex;align-items:center;gap:4px}
.step button{
  width:30px;height:30px;border:2px solid var(--line);border-radius:8px;background:#fff;
  font-size:18px;font-weight:800;line-height:1;color:var(--ink);
}
.step b{min-width:22px;text-align:center;font-size:17px;font-weight:800}
.kit__switch{
  position:relative;width:44px;height:24px;border:0;border-radius:999px;background:#B8C2CC;transition:background .2s;
}
.kit__switch::after{
  content:"";position:absolute;left:3px;top:3px;width:18px;height:18px;border-radius:50%;background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.3);transition:transform .2s var(--ease);
}
.kit__switch[aria-pressed="true"]{background:var(--green)}
.kit__switch[aria-pressed="true"]::after{transform:translateX(20px)}
.kit__go{
  display:flex;align-items:center;justify-content:center;height:42px;border-radius:10px;
  background:var(--blue);color:#fff;font-size:15.5px;font-weight:800;text-decoration:none;
}
.kit__go:focus-visible{outline:4px solid var(--amber);outline-offset:2px}
.kit__copy{height:36px;border:2px solid var(--line);border-radius:10px;background:#fff;font-size:14px;font-weight:700;color:var(--body)}
.kit__note{margin:0;font-size:12.5px;line-height:1.35;color:var(--muted)}
.bar__tools{justify-self:end;display:flex;align-items:center;gap:8px}
.bar__buildit{
  display:flex;align-items:center;height:40px;padding:0 14px;border-radius:10px;
  background:var(--blue);color:#fff;font-size:15px;font-weight:700;text-decoration:none;
}
.bar__buildit:focus-visible{outline:4px solid var(--amber);outline-offset:2px}

/* --- what the codes say (the Codes tab; entries drawn by demo.js) ---------- */
.code__group{margin-top:6px;font-size:11.5px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.code{
  display:flex;flex-direction:column;gap:3px;padding:8px 10px;text-decoration:none;color:var(--ink);
  background:var(--paper);border:2px solid var(--line);border-radius:12px;
}
.code:hover{border-color:var(--blue)}
.code:focus-visible{outline:4px solid var(--amber);outline-offset:2px}
.code__name{font-size:15px;font-weight:800;line-height:1.2}
.code__cite{font-size:12px;font-weight:600;line-height:1.3;color:var(--muted)}
.code__quote{font-size:13px;line-height:1.4;color:var(--body);font-style:italic}
.code__sum{font-size:13px;line-height:1.4;color:var(--body)}
.code__more{font-size:12.5px;font-weight:700;color:var(--blue)}
