/* Fightplan Work: the /work/karst case page only (2026-11-21, KD-58).
   Loaded after styles.css, inner.css and work.css. Fightplan's tokens come from styles.css. Inside the rope's stage
   the look is Karst's own (the invented client's brand): its ground, its two typefaces, its one teal. The ground here
   is #020406, the exact colour the rendered frames fade to at the bottom, so the floor falls away into the page.
   Every default below is the still state: no JS gets it, and so does reduced motion. work-karst.js adds the rest.
   Blocks:
     .kg            the rope's stage. Default: the rope, the heading, the six parts, the rope apart, in a column.
     .kg.is-live    wide screens with motion on: the stage pins; a canvas scrubs the take-apart; the rope turns on a drag
     .kg.is-lite    phones, tablets and reduced motion with JS: the still becomes a play-once video; a small turntable
     .kb-sheet      the brand sheet
     .kb-tape       how it was made: four numbers, scoreboard style */

.kg{--k-limestone:#D8D1C4;--k-chalk:#F2EEE6;--k-silt:#A59E91;--k-cavern:#020406;--k-cenote:#35C9B8;
  --k-x:"Archivo","Barlow Condensed","Arial Narrow",sans-serif;--k-mono:"Martian Mono",ui-monospace,"Cascadia Mono",Consolas,monospace;
  position:relative;background:var(--k-cavern);color:var(--k-limestone);
  border-top:1px solid var(--border);border-bottom:1px solid var(--border)}

/* ---------- the still state (and the phone's column) ---------- */
.kg-view{position:relative;overflow:hidden;background:var(--k-cavern)}
.kg-still img{display:block;width:100%;height:auto}
.kg-canvas{display:none}
.kg-marks{display:none;list-style:none;margin:0;padding:0}
.kg-video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity 400ms var(--ease)}
.kg-view.is-on .kg-video{opacity:1}
.kg-replay{position:absolute;right:var(--gutter);bottom:var(--space-4);display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 14px;
  border:1px solid rgba(216,209,196,.4);background:rgba(2,4,6,.72);color:var(--k-limestone);
  font:500 11px/1 var(--k-mono);letter-spacing:.14em;text-transform:uppercase;cursor:pointer}
.kg-replay[hidden]{display:none}
.kg-replay .icon{width:14px;height:14px;fill:currentColor;stroke:none}
.kg-replay:focus-visible{outline:2px solid var(--k-chalk);outline-offset:2px}

.kg-head{padding:var(--space-6) var(--gutter) 0;max-width:calc(1200px + 2 * var(--gutter));margin:0 auto}
.kg-kicker{display:block;font:500 12px/1.3 var(--k-mono);letter-spacing:.14em;text-transform:uppercase;color:var(--k-cenote)}
.kg-title{margin:var(--space-3) 0 0;font-family:var(--k-x);font-stretch:125%;font-weight:800;font-size:clamp(28px,7.4vw,46px);line-height:1;
  letter-spacing:-.005em;text-transform:uppercase;color:var(--k-limestone)}
.kg-hint{margin:var(--space-3) 0 0;max-width:34ch;font-size:var(--text-md);line-height:1.45;color:#C9C3B7}
.kg-hint-live{display:none}
.kg-turn{display:flex;align-items:center;gap:12px;margin-top:var(--space-4);font:500 11px/1 var(--k-mono);letter-spacing:.14em;
  text-transform:uppercase;color:var(--k-silt)}
.kg-turn[hidden]{display:none}
.kg-turn input{flex:1 1 auto;max-width:240px;min-height:44px;margin:0;background:none;accent-color:var(--k-cenote);cursor:ew-resize}
.kg-turn input:focus-visible{outline:2px solid var(--k-chalk);outline-offset:2px}

.kg-parts{list-style:none;margin:var(--space-5) auto 0;padding:0 var(--gutter);max-width:calc(1200px + 2 * var(--gutter));
  display:grid;grid-template-columns:1fr 1fr;gap:0 var(--space-6)}
.kg-parts li{padding:var(--space-3) 0;border-top:1px solid rgba(216,209,196,.18)}
.kg-parts b{display:block;font-family:var(--k-x);font-stretch:125%;font-weight:800;font-size:15px;line-height:1.3;letter-spacing:.01em;
  text-transform:uppercase;color:var(--k-limestone)}
.kg-parts i{margin-right:10px;font:500 12px/1 var(--k-mono);font-style:normal;letter-spacing:.1em;color:var(--k-cenote)}
.kg-parts span{display:block;margin-top:2px;font-size:var(--text-sm);line-height:1.4;color:#B9B3A7}
.kg-end{display:none}

.kg-apart{margin:var(--space-6) auto 0;padding:0 var(--gutter);max-width:calc(1280px + 2 * var(--gutter))}
.kg-apart img{display:block;width:100%;height:auto}
.kg-apart .work-cap,.kg-cap{padding-left:0;padding-right:0;color:var(--k-silt)}
.kg-apart .work-cap b,.kg-cap b{color:var(--k-limestone)}
.kg-cap{margin:0 auto;padding:var(--space-4) var(--gutter) var(--space-6);max-width:calc(1200px + 2 * var(--gutter))}

.kg-spin{margin:var(--space-6) auto 0;padding:0;max-width:640px}
.kg-spin[hidden]{display:none}
.kg-spin-canvas{display:block;width:100%;height:auto;aspect-ratio:14/9;touch-action:pan-y;cursor:grab}
.kg-spin-canvas.is-held{cursor:grabbing}
.kg-spin .kg-turn{margin-top:var(--space-2);padding:0 var(--gutter)}
.kg-spin .kg-turn input{max-width:none}

@media (max-width:767px){
  .kg-parts{grid-template-columns:1fr}
  .kg-head{padding-top:var(--space-5)}
  .kg-apart{padding:0}
  .kg-apart .work-cap{padding-left:var(--gutter);padding-right:var(--gutter)}
}

/* with JS, off the wide stage: the hint stays the short one; the turntable comes straight after the heading
   ("Turn it."), then the six parts and the rope apart */
.kg.is-lite .kg-view{cursor:default}
.kg.is-lite{display:flex;flex-direction:column}
.kg.is-lite .kg-pin{display:contents}
.kg.is-lite .kg-view{order:1}
.kg.is-lite .kg-head{order:2;width:100%}
.kg.is-lite .kg-spin{order:3;width:100%;margin-top:var(--space-5)}
.kg.is-lite .kg-parts{order:4;width:100%}
.kg.is-lite .kg-apart{order:5;width:100%}
.kg.is-lite .kg-cap{order:6;width:100%}

/* ---------- wide screens, motion on: the pinned stage ---------- */
.kg.is-live{height:calc(100vh + var(--kg-span,3600px));height:calc(100svh + var(--kg-span,3600px))}
.kg.is-live .kg-pin{position:sticky;top:0;height:100vh;height:100svh;overflow:hidden}
.kg.is-live .kg-view{position:absolute;inset:0}
.kg.is-live .kg-still img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.kg.is-live .kg-canvas{display:block;position:absolute;inset:0;width:100%;height:100%;opacity:0;touch-action:pan-y}
.kg.is-live .kg-view.is-on .kg-canvas{opacity:1}
/* at rest the canvas gives way to a sharper still of the very same frame (2560 wide); any move brings the canvas back */
.kg.is-live .kg-sharp{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;pointer-events:none;transition:opacity 220ms var(--ease)}
.kg.is-live .kg-view.is-sharp-apart .kg-sharp{opacity:1}
.kg.is-live .kg-view.is-on.is-sharp-whole .kg-canvas{opacity:0;transition:opacity 220ms var(--ease)}
.kg.is-live .kg-view.can-turn .kg-canvas{cursor:grab}
.kg.is-live .kg-view.is-held .kg-canvas{cursor:grabbing}
.kg.is-live .kg-head{position:absolute;left:max(var(--gutter),4vw);top:calc(var(--header-h) + max(28px,7vh));bottom:max(56px,9vh);width:min(26vw,340px);
  padding:0;margin:0;display:flex;flex-direction:column;align-items:flex-start;pointer-events:none}
.kg.is-live .kg-head .kg-turn{margin-top:auto;width:100%;pointer-events:auto}
.kg.is-live .kg-title{font-size:clamp(20px,2.15vw,34px)}
.kg.is-live .kg-hint-live{display:inline}
.kg.is-live .kg-hint-lite{display:none}
.kg.is-live .kg-turn{transition:opacity 300ms var(--ease)}
.kg.is-live .kg-turn.is-off{opacity:.25;pointer-events:none}
.kg.is-live .kg-parts{position:absolute;right:max(var(--gutter),3vw);top:calc(var(--header-h) + max(20px,6vh));width:min(22vw,290px);
  margin:0;padding:0;display:block}
.kg.is-live .kg-parts li{padding:10px 0;opacity:.3;transition:opacity 300ms var(--ease)}
.kg.is-live .kg-parts li.on{opacity:1}
.kg.is-live .kg-parts span{font-size:14px}
.kg.is-live .kg-marks{display:block;position:absolute;inset:0;pointer-events:none}
.kg.is-live .kg-marks li{position:absolute;left:0;top:0;margin:-34px 0 0 -15px;width:30px;height:22px;display:grid;place-items:center;
  font:500 11px/1 var(--k-mono);letter-spacing:.06em;color:var(--k-cenote);background:rgba(2,4,6,.9);box-shadow:inset 0 0 0 1.5px var(--k-cenote);opacity:0;
  transition:opacity 260ms var(--ease);will-change:transform}
.kg.is-live .kg-marks li::after{content:"";position:absolute;left:50%;top:100%;width:1.5px;height:12px;margin-left:-.75px;background:var(--k-cenote)}
.kg.is-live .kg-marks li.on{opacity:1}
/* the cable's tag sits beside the cable, with a short tick across to it */
.kg.is-live .kg-marks li:nth-child(5)::after{left:auto;right:100%;top:50%;width:10px;height:1.5px;margin:-.75px 0 0}
.kg.is-live .kg-end{display:block;position:absolute;right:max(var(--gutter),3vw);bottom:max(44px,9vh);margin:0;max-width:9em;text-align:right;
  font-family:var(--k-x);font-stretch:125%;font-weight:800;font-size:clamp(24px,3.1vw,48px);line-height:1;text-transform:uppercase;
  color:var(--k-limestone);opacity:0;transition:opacity 400ms var(--ease);pointer-events:none}
.kg.is-live .kg-end.on{opacity:1}
.kg.is-live .kg-apart,.kg.is-live .kg-spin,.kg.is-live .kg-replay{display:none}
.kg.is-live .kg-cap{position:absolute;left:max(var(--gutter),4vw);bottom:max(18px,3vh);margin:0;padding:0;font-size:13px}
/* while the visitor turns the rope it sweeps the whole stage, so the words leave it the room */
.kg.is-live .kg-kicker,.kg.is-live .kg-title,.kg.is-live .kg-hint,.kg.is-live .kg-parts{transition:opacity 260ms var(--ease)}
.kg.is-live.is-turning .kg-kicker,.kg.is-live.is-turning .kg-title,.kg.is-live.is-turning .kg-hint,.kg.is-live.is-turning .kg-parts{opacity:0}
/* laptops under 1400 wide or 840 tall: the parts list is names only, so it ends above the rope */
@media (max-height:840px),(max-width:1399px){
  .kg.is-live .kg-parts li{padding:7px 0}
  .kg.is-live .kg-parts span{display:none}
}

/* ---------- The film ---------- */
.kf-sec{background:var(--black);border-bottom:1px solid var(--border);padding:var(--space-7) 0}
/* the player fits one laptop screen with its caption, and never shows past 1380 px */
.kf-wrap{width:min(calc(100% - 2 * var(--gutter)),1380px,max(640px,calc((100vh - 230px) * 16 / 9)));margin:0 auto}
.kf-stage{position:relative}
.kf-film{position:relative;overflow:hidden;aspect-ratio:16 / 9;background:#020406;border:1px solid var(--border-strong)}
.kf-video{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;background:#020406}
/* the button waits low and right on the picture: the one corner the film's own words leave free in every shot */
.kf-play{position:absolute;right:var(--space-5);bottom:var(--space-5);z-index:2;gap:10px;width:auto;margin:0}
.kf-play[hidden]{display:none !important}
.kf-play .icon{width:16px;height:16px;fill:currentColor;stroke:none}
.kf-film.is-sound + .kf-play{display:none}
.kf-phone{width:min(100%,320px);margin:0 auto}
.kf-phone .frame-view{aspect-ratio:9 / 16;background:#020406}
.kf-tall-video{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;background:#020406}
.kf-play-tall{left:0;right:0;top:auto;bottom:10px;width:max-content;margin:0 auto}
.kf-tall .show-work .work-cap{text-align:center;padding-bottom:var(--space-6)}
@media (max-width:767px){
  .kf-sec{padding:var(--space-5) 0 var(--space-6)}
  .kf-wrap{width:calc(100% - 2 * var(--gutter))}
  .kf-stage .kf-play{position:static;display:flex;width:100%;justify-content:center;margin-top:var(--space-3)}
  .kf-film.is-sound + .kf-play{display:flex}
  .kf-phone{width:min(78%,320px)}
}

/* ---------- The brand ---------- */
.kb-sheet{margin:0;max-width:820px}
.kb-sheet a{display:block}
.kb-sheet a:focus-visible{outline:2px solid var(--fg);outline-offset:3px}
.kb-sheet img{display:block;width:100%;height:auto;border:1px solid var(--border)}
.kb-specs{margin-top:0;max-width:none}

/* ---------- How it was made: four numbers ---------- */
.kb-tape{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-top:1px solid var(--border-strong)}
.kb-tape > div{display:grid;align-content:start;gap:var(--space-2);padding:var(--space-4) var(--space-5) 0 0}
.kb-tape > div + div{padding-left:var(--space-5);border-left:1px solid var(--border)}
.kb-num{font-family:var(--font-display);font-weight:700;font-size:clamp(56px,6vw,84px);line-height:.9;color:var(--fg);font-variant-numeric:tabular-nums}
.kb-tape span{font-size:var(--text-sm);line-height:1.45;color:var(--fg-2)}
.kb-made-line{margin:var(--space-6) 0 0;max-width:62ch;font-size:var(--text-md);line-height:1.55;color:var(--fg-2)}
@media (max-width:1023px){
  .kb-tape{grid-template-columns:1fr 1fr}
  .kb-tape > div:nth-child(odd){padding-left:0;border-left:0}
  .kb-tape > div:nth-child(n+3){margin-top:var(--space-4);border-top:1px solid var(--border)}
}
@media (max-width:767px){
  .kb-tape > div{padding:var(--space-4) var(--space-3) var(--space-4) 0}
  .kb-tape > div + div{padding-left:var(--space-4)}
  .kb-tape > div:nth-child(odd){padding-left:0}
  .kb-tape > div:nth-child(n+3){margin-top:0}
  .kb-num{font-size:56px}
  .kb-made-line{margin-top:var(--space-5);font-size:var(--text-sm)}
}

@media (prefers-reduced-motion:reduce){
  .kg-video,.kg.is-live .kg-sharp,.kg.is-live .kg-canvas,.kg.is-live .kg-parts,.kg.is-live .kg-parts li,.kg.is-live .kg-marks li,.kg.is-live .kg-end,.kg.is-live .kg-turn,.kg.is-live .kg-kicker,.kg.is-live .kg-title,.kg.is-live .kg-hint{transition:none}
}
