/* The golden show (P19): Delicious told in five beats on one slide (layout B). js/golden.js drives it.
   The base rules are the still: the phone (its baked still without JS), then every beat in order, every receipt, both
   halves of the punch and Visit. .gs-live (set by golden.js while it drives) turns the list into one slide: every
   beat shares one grid cell, so the caption box is always as tall as the tallest beat and a swap never moves the
   page; only li.is-now shows, receipts and the apology fade in on .is-in, and the dots light from li.is-now.
   The live demo's crash (keynote.js) plays over the phone. No blur, no backdrop-filter; motion is opacity and transform. */

#lab .gs{position:relative;display:grid;gap:clamp(10px,1.8cqi,18px);padding:clamp(12px,2.2cqi,24px);background:#fff;color:#0b0b0c;
  border:2px solid #0b0b0c;border-radius:4px;box-shadow:8px 8px 0 var(--shadow)}

/* the phone: the rig at 600/560, never taller than about half a screen */
#lab .gs-frame{position:relative;justify-self:center;width:min(100%,calc(var(--gs-h,56svh) * 600 / 560));border-radius:4px;overflow:hidden}
#lab .gs-rig{aspect-ratio:600/560}
#lab .gs-rig .rig-svg,#lab .gs-rig noscript.rig-still>svg{display:block;width:100%;height:auto}
@media (max-height:760px){#lab .gs{--gs-h:44svh}}

/* the beats, as a list */
#lab .gs-dots{display:none}
#lab .gs-beats{display:grid;gap:clamp(12px,1.8cqi,18px);margin:0;padding:0;list-style:none}
#lab .gs-beats>li{display:grid;gap:8px;align-content:start}
#lab .gs-beats p{margin:0}
#lab .gs-beats>li>p:not(.gs-rcpt){font:800 clamp(19px,2.7cqi,28px)/1.18 "Archivo",system-ui,sans-serif;letter-spacing:-.015em;text-wrap:balance}
#lab .gs-beats>li[data-beat="tap"]>p{font-weight:900;font-size:clamp(23px,3.4cqi,36px);line-height:1.04;font-stretch:112%}
#lab .gs-beats [data-claim]{background:linear-gradient(transparent 62%,color-mix(in srgb,var(--acc) 80%,#fff) 62%)}
#lab .gs-rcpt{padding:1px 0 1px 12px;border-left:3px solid var(--acc);font:500 clamp(14px,1.7cqi,17px)/1.32 "Archivo",system-ui,sans-serif;color:#2b2b27;text-wrap:pretty}
#lab .gs-beats>li>p.gs-sorry{font-size:clamp(16px,2.1cqi,21px);font-weight:700}
#lab .gs-visit{display:inline-block;margin-left:4px;padding:2px 8px;background:var(--acc);color:#0b0b0c;border:1.5px solid #0b0b0c;border-radius:999px;
  font:800 .82em/1.3 "Archivo",system-ui,sans-serif;text-decoration:none;white-space:nowrap}
#lab .gs-visit:focus-visible{outline:3px solid #0b0b0c;outline-offset:3px}

/* the button: the visitor's press is the play button */
#lab .gs-go[hidden]{display:none}
#lab .gs-go{justify-self:center;min-height:46px;padding:0 24px;background:var(--acc);color:#0b0b0c;border:2px solid #0b0b0c;border-radius:999px;
  box-shadow:3px 3px 0 #0b0b0c;font:900 17px/1 "Archivo",system-ui,sans-serif;letter-spacing:.01em;cursor:pointer;touch-action:manipulation}
#lab .gs-go:active{transform:translate(2px,2px);box-shadow:1px 1px 0 #0b0b0c}
#lab .gs-go:focus-visible{outline:3px solid #0b0b0c;outline-offset:3px}
#lab .gs-go[aria-disabled="true"]{opacity:.45;cursor:default;box-shadow:none;transform:none}

/* ── one slide, while golden.js drives ── */
#lab .gs-live .gs-dots{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 14px;margin:0;padding:0;list-style:none;
  font:700 11px/1 var(--mono);letter-spacing:.1em;text-transform:uppercase;color:#6b6b64}
#lab .gs-dots li{display:flex;align-items:center;gap:6px}
#lab .gs-dots li::before{content:"";width:9px;height:9px;border:1.5px solid #0b0b0c;border-radius:50%;background:#fff}
#lab .gs:has(.gs-beats>li:nth-child(2).is-now) .gs-dots li:nth-child(-n+1)::before,
#lab .gs:has(.gs-beats>li:nth-child(3).is-now) .gs-dots li:nth-child(-n+2)::before,
#lab .gs:has(.gs-beats>li:nth-child(4).is-now) .gs-dots li:nth-child(-n+3)::before,
#lab .gs:has(.gs-beats>li:nth-child(5).is-now) .gs-dots li:nth-child(-n+4)::before{background:#0b0b0c}
#lab .gs:has(.gs-beats>li:nth-child(1).is-now) .gs-dots li:nth-child(1),
#lab .gs:has(.gs-beats>li:nth-child(2).is-now) .gs-dots li:nth-child(2),
#lab .gs:has(.gs-beats>li:nth-child(3).is-now) .gs-dots li:nth-child(3),
#lab .gs:has(.gs-beats>li:nth-child(4).is-now) .gs-dots li:nth-child(4),
#lab .gs:has(.gs-beats>li:nth-child(5).is-now) .gs-dots li:nth-child(5){color:#0b0b0c}
#lab .gs:has(.gs-beats>li:nth-child(1).is-now) .gs-dots li:nth-child(1)::before,
#lab .gs:has(.gs-beats>li:nth-child(2).is-now) .gs-dots li:nth-child(2)::before,
#lab .gs:has(.gs-beats>li:nth-child(3).is-now) .gs-dots li:nth-child(3)::before,
#lab .gs:has(.gs-beats>li:nth-child(4).is-now) .gs-dots li:nth-child(4)::before,
#lab .gs:has(.gs-beats>li:nth-child(5).is-now) .gs-dots li:nth-child(5)::before{background:var(--acc);transform:scale(1.25)}

#lab .gs-live .gs-beats{grid-template-areas:"beat"}
#lab .gs-live .gs-beats>li{grid-area:beat}
#lab .gs-live .gs-beats>li:not(.is-now){visibility:hidden;opacity:0}
#lab .gs-live .gs-rcpt:not(.is-in),#lab .gs-live .gs-sorry:not(.is-in){opacity:0;transform:translateY(6px)}
/* the crash and its save line belong to the build; the other beats keep the phone clear */
#lab .gs-live:not([data-now="crash"]):not([data-now="ahh"]) .kn-moment{visibility:hidden}

@media (prefers-reduced-motion:no-preference){
  #lab .gs-live .gs-beats>li{transition:opacity .35s ease,visibility 0s linear .35s}
  #lab .gs-live .gs-beats>li.is-now{transition:opacity .35s ease .1s,visibility 0s}
  #lab .gs-live .gs-rcpt,#lab .gs-live .gs-sorry{transition:opacity .4s ease,transform .4s cubic-bezier(.2,.9,.3,1)}
  #lab .gs-dots li::before{transition:background-color .3s,transform .3s}
}

/* wide: the phone on the left, the story on the right */
@media (min-width:900px){
  #lab .gs{grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);grid-template-areas:"frame beats" "frame go";align-items:center;
    column-gap:clamp(20px,3cqi,40px)}
  #lab .gs-frame{grid-area:frame}
  #lab .gs-beats{grid-area:beats}
  #lab .gs-go{grid-area:go;justify-self:start}
  #lab .gs-live{grid-template-areas:"frame dots" "frame beats" "frame go"}
  #lab .gs-live .gs-dots{grid-area:dots;justify-content:start}
}
