/* Lab Live: the swarm home page (DESIGN.md "One unit"; docs/designs/lab-live.md). Loaded by the home template only.
   The stage is white with no box: the claim and the lab line, the count, the picture (WebGL tiles under a 2D label
   layer, static/js/swarm.js), the day strip and the rail. Below it, on the plate ground, the main builds row.
   Colours are the site's tokens (skin-episode.css). Text is 16px or more; only the labels drawn on the picture and
   the day strip are 14 and 13px. Without the script the still, the count and the numbers in text stay. */

/* classic.css has an older `.sw` (a 12px legend swatch); the swarm section is not that.
   The first screen (2026-11-24): the section is exactly the window under the 65px nav. Top to bottom: the claim and the
   count (one row), the picture (all the height that is left), the day strip, the rail. Nothing of it is below the fold. */
.sw[data-swarm]{display:block;width:auto;height:calc(100vh - 65px);height:calc(100svh - 65px);min-height:600px;background:#FFFFFF}
.sw [hidden]{display:none!important}
.sw-wrap{max-width:var(--wide,1320px);height:100%;margin:0 auto;padding:0 var(--gut,40px);display:flex;flex-direction:column}   /* the header's edges */

/* the head of the stage: the claim and the lab line on the left, the count on the right */
.sw-hud{flex:none;display:flex;align-items:flex-end;justify-content:space-between;gap:32px;padding:16px 0 8px}
.sw-say{min-width:0;flex:1 1 auto}
.sw .sw-claim{margin:0 0 8px;font-family:"Bricolage Grotesque",var(--disp);font-weight:600;font-stretch:85%;font-variation-settings:normal;
  font-size:clamp(1.5rem,2.2vw,1.875rem);line-height:1.1;letter-spacing:-.02em;color:var(--navy);max-width:none;text-wrap:balance}
.sw-lab{margin:0;color:var(--dim);font-size:1rem;line-height:1.5}
.sw-lab b{color:var(--navy);font-weight:600}
.sw-sq{display:inline-block;width:8px;height:8px;background:var(--navy);margin-right:10px;vertical-align:1px}
.sw.is-air .sw-sq{background:var(--yellow);outline:1.5px solid var(--navy)}
.sw-sync{color:var(--navy)}
.sw-sync.is-old{color:var(--dim)}
.sw-count{text-align:right;flex:none}
.sw-n{margin:0;font-family:"Bricolage Grotesque",var(--disp);font-weight:560;font-stretch:80%;font-size:clamp(3.25rem,4.7vw,4.25rem);
  line-height:.86;letter-spacing:-.03em;font-variant-numeric:tabular-nums;color:var(--navy)}
.sw-u{margin:8px 0 0;color:var(--dim);font-size:1rem;font-variant-numeric:tabular-nums}
.sw-u b{color:var(--navy);font-weight:500}

/* the picture: it takes every pixel the head, the strip and the rail leave */
.sw-field{position:relative;flex:1 1 auto;min-height:0}
.sw-stage{position:relative;height:100%;min-height:280px;background:#FFFFFF}
.sw-still,.sw-still img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:block}
.sw-under,.sw-gl,.sw-2d{position:absolute;inset:0;width:100%;height:100%;display:block;visibility:hidden}
.sw.is-drawn .sw-under,.sw.is-drawn .sw-gl,.sw.is-drawn .sw-2d{visibility:visible}
/* the opening: the still turns into a faint guide the tiles fill in (swarm.js ghost()), then fades out */
.sw-still{overflow:hidden}
.sw-still img{transition:opacity .6s ease-out}
.sw.is-drawn .sw-still img{opacity:0}
.sw.is-drawn.is-opening .sw-still img{opacity:.13}
.sw-2d{cursor:crosshair;touch-action:pan-y}

/* on air: the stream Window takes 7 of 12 columns, the swarm keeps 5 */
.sw.is-onair .sw-field{display:grid;grid-template-columns:7fr 5fr;gap:24px;align-items:stretch}
.sw.is-onair .sw-stage{min-height:280px}
.sw-live{min-width:0;align-self:start;margin:0 6px 6px 0;box-shadow:6px 6px 0 var(--navy)}
.sw-live .win-bar{justify-content:flex-start}
.sw-live .win-t{flex:none}
.sw-now{display:inline-block;width:9px;height:9px;background:var(--yellow);outline:1.5px solid var(--navy);margin-right:9px;vertical-align:0}
.sw-live-since{margin-right:auto;color:var(--dim);font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.sw-watch{display:none;color:var(--navy);font-weight:600;text-decoration:underline;text-decoration-color:var(--yellow);text-decoration-thickness:3px;text-underline-offset:4px}
.sw-watch:hover{color:var(--royal)}
.sw-player{aspect-ratio:16/9;background:var(--navy);overflow:hidden}
.sw-player img{display:block;width:100%;height:100%;max-height:none;object-fit:contain}

/* the card on the stage (D15): a Window for a piece that plays, a hairline card for a still */
.sw-card{position:absolute;z-index:5;top:0;left:0;width:300px;display:flex;flex-direction:column;background:#FFFFFF;
  pointer-events:none;font-size:1rem;line-height:1.35;color:var(--navy)}
.sw-card.is-pinned{pointer-events:auto}
.sw-card.is-film{border:2px solid var(--navy);box-shadow:6px 6px 0 var(--navy)}
.sw-card.is-still{border:1px solid var(--navy)}
.sw-card.is-still .win-bar,.sw-card.is-film .sw-card-t{display:none}
.sw-card .win-bar{padding:0 12px}
.sw-card-pic{display:block;height:200px;background:var(--plate)}
.sw-card-pic canvas,.sw-card-pic img{display:block;width:100%;height:100%;object-fit:contain}
.sw-card-t{margin:0;padding:10px 12px 0;font-weight:600}
.sw-card-m{margin:0;padding:6px 12px 12px;color:var(--dim)}
.sw-card-m span{display:block}
.sw-card-a{display:none;align-self:flex-start;margin:-4px 12px 12px;color:var(--navy);font-weight:600;text-decoration:underline;
  text-decoration-color:var(--yellow);text-decoration-thickness:3px;text-underline-offset:4px}
.sw-card.is-pinned .sw-card-a{display:inline-block}
.sw-card-a:hover{color:var(--royal)}

/* the day strip: hidden until the script has the counts */
.sw-strip{flex:none;display:none;border-top:1px solid var(--line);padding:9px 0 7px}
.sw.has-strip .sw-strip{display:block}
.sw-strip canvas{display:block;width:100%;height:0}

/* the rail: the tour button, the chart's name with one line, then back, "7 / 16" and next. Back and next stay put
   on the right, so a visitor can tap next again and again without chasing the button */
.sw-rail{flex:none;display:flex;align-items:center;gap:18px;min-height:60px;border-top:1px solid var(--navy);
  font-family:"Bricolage Grotesque",var(--disp);font-stretch:75%;font-variant-numeric:tabular-nums}
.sw-tour{all:unset;box-sizing:border-box;cursor:pointer;width:36px;height:36px;border:2px solid var(--navy);display:grid;place-items:center;flex:none}
.sw-tour::before{content:"";box-sizing:border-box;width:12px;height:13px;border-left:4px solid var(--navy);border-right:4px solid var(--navy)}
.sw-tour[aria-pressed=false]::before{width:0;height:0;border:7px solid transparent;border-left:11px solid var(--navy);border-right:0;margin-left:3px}
.sw-tour:hover,.sw-step:hover{box-shadow:3px 3px 0 var(--navy)}
.sw-tour:focus-visible,.sw-step:focus-visible{outline:3px solid var(--royal);outline-offset:3px}
.sw-what{flex:1 1 auto;margin:0;min-width:0;font-family:var(--body);font-stretch:100%;font-size:1rem;color:var(--dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sw-what b{font-family:"Bricolage Grotesque",var(--disp);font-weight:600;font-stretch:85%;font-size:1.375rem;line-height:1;letter-spacing:-.01em;color:var(--navy);margin-right:10px}
.sw-steps{flex:none;display:flex;align-items:center;gap:12px}
.sw-step{all:unset;box-sizing:border-box;cursor:pointer;width:44px;height:36px;border:2px solid var(--navy);display:grid;place-items:center;background:#FFFFFF}
.sw-step i{display:block;width:10px;height:10px;border-left:3px solid var(--navy);border-bottom:3px solid var(--navy);transform:translateX(2px) rotate(45deg)}
.sw-step-next{background:var(--yellow)}
.sw-step-next i{transform:translateX(-2px) rotate(-135deg)}
.sw-pos{min-width:4.2em;text-align:center;font-size:1rem;font-weight:600;letter-spacing:.012em;color:var(--navy)}

/* the main builds row, on the plate ground */
.sw-main.band-ground{background:var(--plate);padding:72px 0 88px}
.sw-main-h{display:flex;align-items:baseline;justify-content:space-between;gap:24px;margin-bottom:28px}
.sw-main-h h2{margin:0}
.sw-main-h p{margin:0;color:var(--dim);font-family:"Bricolage Grotesque",var(--disp);font-stretch:75%;font-weight:500;font-size:1rem;
  letter-spacing:.012em;font-variant-numeric:tabular-nums}
.sw-main-row{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:32px 24px}
.sw-mb{display:flex;flex-direction:column;height:100%;background:#FFFFFF;border:1px solid var(--line);color:inherit;text-decoration:none;
  transition:transform .15s ease-out,box-shadow .15s ease-out,border-color .15s ease-out}
.sw-mb:hover{transform:translate(-3px,-3px);box-shadow:6px 6px 0 var(--navy);border-color:var(--navy)}
.sw-mb:hover b{color:var(--royal)}
.sw-mb-logo{display:block;height:232px;padding:40px 44px}
.sw-mb-logo img{display:block;width:100%;height:100%;object-fit:contain}
.sw-mb-cap{display:block;margin-top:auto;padding:12px 14px 14px;border-top:1px solid var(--line)}
.sw-mb-cap b{display:block;font-weight:600;font-size:1.125rem;line-height:1.3}
.sw-mb-cap span{color:var(--dim);font-size:1rem}
@media (prefers-reduced-motion:reduce){.sw-mb{transition:none}.sw-mb:hover{transform:none}}

/* phones: the claim and the count, the picture (the rest of the screen), the day strip, the rail */
@media (max-width:820px){
  .sw[data-swarm]{min-height:560px}
  .sw-wrap{padding:0 16px}
  /* the claim and the count share the top row; the lab line is one line under both (the byline drops) */
  .sw-hud{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px;row-gap:6px;align-items:start;padding:12px 0 6px}
  .sw-say{display:contents}
  .sw .sw-claim{grid-column:1;grid-row:1;margin:0;font-size:1.375rem}
  .sw-count{grid-column:2;grid-row:1}
  .sw-lab{grid-column:1/-1;grid-row:2;font-size:.875rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .sw-by{display:none}
  .sw-n{font-size:2.5rem}
  .sw-u{font-size:.875rem}
  .sw-air.is-last{display:none}
  .sw-stage,.sw.is-onair .sw-stage{min-height:240px}
  .sw.is-onair .sw-field{display:block}
  .sw-live{margin:0 4px 16px 0;box-shadow:4px 4px 0 var(--navy)}
  .sw-live .win-bar{border-bottom:0}
  .sw-live .win-dots,.sw-player{display:none}
  .sw-watch{display:inline}
  .sw-rail{gap:10px;min-height:56px}
  .sw-what span{display:none}
  .sw-steps{gap:8px}
  .sw-step{width:48px;height:44px}
  .sw-pos{min-width:3.4em}
  .sw-main.band-ground{padding:48px 0 56px}
  .sw-main-h{flex-direction:column;gap:6px}
  .sw-main-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px}
  .sw-mb-logo{height:130px;padding:20px 18px}
}
